Movatterモバイル変換


[0]ホーム

URL:



Internet-DraftDTLS 1.3April 2021
Rescorla, et al.Expires 1 November 2021[Page]
Workgroup:
TLS
Internet-Draft:
draft-ietf-tls-dtls13-43
Obsoletes:
6347 (if approved)
Published:
Intended Status:
Standards Track
Expires:
Authors:
E. Rescorla
RTFM, Inc.
H. Tschofenig
Arm Limited
N. Modadugu
Google, Inc.

The Datagram Transport Layer Security (DTLS) Protocol Version 1.3

Abstract

This document specifies Version 1.3 of the Datagram Transport Layer Security(DTLS) protocol. DTLS 1.3 allows client/server applications to communicate over theInternet in a way that is designed to prevent eavesdropping, tampering, and messageforgery.

The DTLS 1.3 protocol is intentionally based on the Transport Layer Security (TLS)1.3 protocol and provides equivalent security guarantees with the exception of order protection/non-replayability. Datagram semantics of the underlying transport are preserved by the DTLS protocol.

This document obsoletes RFC 6347.

Status of This Memo

This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is athttps://datatracker.ietf.org/drafts/current/.

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

This Internet-Draft will expire on 1 November 2021.

Copyright Notice

Copyright (c) 2021 IETF Trust and the persons identified as the document authors. All rights reserved.

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.

Table of Contents

1.Introduction

RFC EDITOR: PLEASE REMOVE THE FOLLOWING PARAGRAPH

The source for this draft is maintained in GitHub. Suggested changesshould be submitted as pull requests at https://github.com/tlswg/dtls13-spec.Instructions are on that page as well. Editorial changes can be managed in GitHub,but any substantive change should be discussed on the TLS mailing list.

The primary goal of the TLS protocol is to establish an authenticated,confidentiality and integrity protected channel between two communicating peers.The TLS protocol is composed of two layers:the TLS Record Protocol and the TLS Handshake Protocol. However, TLS mustrun over a reliable transport channel - typically TCP[RFC0793].

There are applications that use UDP[RFC0768] as a transport and to offer communicationsecurity protection for those applications the Datagram Transport LayerSecurity (DTLS) protocol has been developed. DTLS is deliberately designed to beas similar to TLS as possible, both to minimize new security invention and tomaximize the amount of code and infrastructure reuse.

DTLS 1.0[RFC4347] was originally defined as a delta from TLS 1.1[RFC4346] andDTLS 1.2[RFC6347] was defined as a series of deltas to TLS 1.2[RFC5246]. Thereis no DTLS 1.1; that version number was skipped in order to harmonize version numberswith TLS. This specification describes the most current version of the DTLS protocolas a delta from TLS 1.3[TLS13]. It obsoletes DTLS 1.2.

Implementations that speak both DTLS 1.2 and DTLS 1.3 can interoperate with thosethat speak only DTLS 1.2 (using DTLS 1.2 of course), just as TLS 1.3 implementationscan interoperate with TLS 1.2 (see Appendix D of[TLS13] for details).While backwards compatibility with DTLS 1.0 is possible the use of DTLS 1.0 is notrecommended as explained in Section 3.1.2 of RFC 7525[RFC7525] and[DEPRECATE].

2.Conventions and Terminology

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD","SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in thisdocument are to be interpreted as described in BCP 14[RFC2119][RFC8174]when, and only when, they appear in all capitals, as shown here.

The following terms are used:

  • client: The endpoint initiating the DTLS connection.
  • association: Shared state between two endpoints established witha DTLS handshake.
  • connection: Synonym for association.
  • endpoint: Either the client or server of the connection.
  • epoch: one set of cryptographic keys used for encryption and decryption.
  • handshake: An initial negotiation between client and server that establishesthe parameters of the connection.
  • peer: An endpoint. When discussing a particular endpoint, "peer" refers tothe endpoint that is remote to the primary subject of discussion.
  • receiver: An endpoint that is receiving records.
  • sender: An endpoint that is transmitting records.
  • server: The endpoint which did not initiate the DTLS connection.
  • CID: Connection ID
  • MSL: Maximum Segment Lifetime

The reader is assumed to be familiar with[TLS13].As in TLS 1.3, the HelloRetryRequest has the same format as a ServerHellomessage, but for convenience we use the term HelloRetryRequest throughoutthis document as if it were a distinct message.

DTLS 1.3 uses network byte order (big-endian) format for encoding messagesbased on the encoding format defined in[TLS13] and earlier (D)TLS specifications.

The reader is also assumed to be familiar with[I-D.ietf-tls-dtls-connection-id]as this document applies the CID functionality to DTLS 1.3.

Figures in this document illustrate various combinations of the DTLS protocol exchanges and the symbols have the following meaning:

  • '+' indicates noteworthy extensions sent in the previously noted message.
  • '*' indicates optional or situation-dependent messages/extensions that are not always sent.
  • '{}' indicates messages protected using keys derived from a [sender]_handshake_traffic_secret.
  • '[]' indicates messages protected using keys derived from traffic_secret_N.

3.DTLS Design Rationale and Overview

The basic design philosophy of DTLS is to construct "TLS over datagram transport".Datagram transport does not require nor provide reliable or in-order delivery of data.The DTLS protocol preserves this property for application data.Applications, such as media streaming, Internet telephony, and online gaming usedatagram transport for communication due to the delay-sensitive natureof transported data. The behavior of such applications is unchanged when theDTLS protocol is used to secure communication, since the DTLS protocoldoes not compensate for lost or reordered data traffic. Note that whilelow-latency streaming and gaming use DTLS to protect data (e.g. forprotection of a WebRTC data channel), telephony utilizes DTLS forkey establishment, and Secure Real-time Transport Protocol (SRTP) forprotection of data[RFC5763].

TLS cannot be used directly over datagram transports the following five reasons:

  1. TLS relies on an implicit sequence number on records. If a record is notreceived, then the recipient will use the wrong sequence number whenattempting to remove record protection from subsequent records. DTLS solvesthis problem by adding sequence numbers to records.
  2. The TLS handshake is a lock-step cryptographic protocol. Messagesmust be transmitted and received in a defined order; any otherorder is an error. The DTLS handshake includes message sequencenumbers to enable fragmented message reassembly and in-orderdelivery in case datagrams are lost or reordered.
  3. During the handshake, messages are implicitly acknowledged by other handshakemessages. Some handshake messages, such as the NewSessionTicket message, donot result in any direct response that would allow the sender to detect loss.DTLS adds an acknowledgment message to enable better loss recovery.
  4. Handshake messages are potentially larger than can be contained in a singledatagram. DTLS adds fields to handshake messages to support fragmentationand reassembly.
  5. Datagram transport protocols, like UDP, are susceptible to abusive behavioreffecting denial of service attacks against nonparticipants. DTLS adds areturn-routability check and DTLS 1.3 uses the TLS 1.3 HelloRetryRequest message(seeSection 5.1 for details).

3.1.Packet Loss

DTLS uses a simple retransmission timer to handle packet loss.Figure 1 demonstrates the basic concept, using the firstphase of the DTLS handshake:

         Client                                   Server         ------                                   ------         ClientHello           ------>                                 X<-- HelloRetryRequest                                                  (lost)         [Timer Expires]         ClientHello           ------>         (retransmit)
Figure 1:DTLS retransmission example

Once the client has transmitted the ClientHello message, it expectsto see a HelloRetryRequest or a ServerHello from the server. However, if thetimer expires, the client knows that either theClientHello or the response from the server has been lost, whichcauses the the clientto retransmit the ClientHello. When the server receives the retransmission,it knows to retransmit its HelloRetryRequest or ServerHello.

The server also maintains a retransmission timer for messages itsends (other than HelloRetryRequest) and retransmits when that timer expires. Notapplying retransmissions to the HelloRetryRequest avoids the need tocreate state on the server. The HelloRetryRequest is designed to besmall enough that it will not itself be fragmented, thus avoidingconcerns about interleaving multiple HelloRetryRequests.

For more detail on timeouts and retransmission,seeSection 5.8.

3.2.Reordering

In DTLS, each handshake message is assigned a specific sequencenumber. When a peer receives a handshakemessage, it can quickly determine whether that message is the nextmessage it expects. If it is, then it processes it. If not, itqueues it for future handling once all previous messages have beenreceived.

3.3.Fragmentation

TLS and DTLS handshake messages can be quite large (in theory up to2^24-1 bytes, in practice many kilobytes). By contrast, UDPdatagrams are often limited to less than 1500 bytes if IP fragmentation is notdesired. In order to compensate for this limitation, each DTLShandshake message may be fragmented over several DTLS records, eachof which is intended to fit in a single UDP datagram(seeSection 4.4 for guidance). Each DTLShandshake message contains both a fragment offset and a fragmentlength. Thus, a recipient in possession of all bytes of a handshakemessage can reassemble the original unfragmented message.

3.4.Replay Detection

DTLS optionally supports record replay detection. The technique usedis the same as in IPsec AH/ESP, by maintaining a bitmap window ofreceived records. Records that are too old to fit in the window andrecords that have previously been received are silently discarded.The replay detection feature is optional, since packet duplication isnot always malicious, but can also occur due to routing errors.Applications may conceivably detect duplicate packets and accordinglymodify their data transmission strategy.

4.The DTLS Record Layer

The DTLS 1.3 record layer is different from the TLS 1.3 record layer andalso different from the DTLS 1.2 record layer.

  1. The DTLSCiphertext structure omits the superfluous version number andtype fields.
  2. DTLS adds an epoch and sequence number to the TLS record header.This sequence number allows the recipient to correctly verify the DTLS MAC.However, the number of bits used for the epoch and sequence number fields inthe DTLSCiphertext structure have been reduced from those in previousversions.
  3. The DTLSCiphertext structure has a variable length header.

DTLSPlaintext records are used to send unprotected records and DTLSCiphertextrecords are used to send protected records.

The DTLS record formats are shown below. Unless explicitly stated themeaning of the fields is unchanged from previous TLS / DTLS versions.

    struct {        ContentType type;        ProtocolVersion legacy_record_version;        uint16 epoch = 0        uint48 sequence_number;        uint16 length;        opaque fragment[DTLSPlaintext.length];    } DTLSPlaintext;    struct {         opaque content[DTLSPlaintext.length];         ContentType type;         uint8 zeros[length_of_padding];    } DTLSInnerPlaintext;    struct {        opaque unified_hdr[variable];        opaque encrypted_record[length];    } DTLSCiphertext;
Figure 2:DTLS 1.3 Record Formats
legacy_record_version
This value MUST be set to {254, 253} for all records otherthan the initial ClientHello (i.e., one not generated after a HelloRetryRequest),where it may also be {254, 255} for compatibility purposes.It MUST be ignored for all purposes. See[TLS13]; Appendix D.1for the rationale for this.
unified_hdr:
The unified header (unified_hdr) is a structure of variable length, as shown inFigure 3.
encrypted_record:
The AEAD-encrypted form of the serialized DTLSInnerPlaintext structure.
    0 1 2 3 4 5 6 7    +-+-+-+-+-+-+-+-+    |0|0|1|C|S|L|E E|    +-+-+-+-+-+-+-+-+    | Connection ID |   Legend:    | (if any,      |    /  length as    /   C   - Connection ID (CID) present    |  negotiated)  |   S   - Sequence number length    +-+-+-+-+-+-+-+-+   L   - Length present    |  8 or 16 bit  |   E   - Epoch    |Sequence Number|    +-+-+-+-+-+-+-+-+    | 16 bit Length |    | (if present)  |    +-+-+-+-+-+-+-+-+
Figure 3:DTLS 1.3 Unified Header
Fixed Bits:
The three high bits of the first byte of the unified header are set to001. This ensures that the value will fit within the DTLS region whenmultiplexing is performed as described in[RFC7983]. It also ensuresthat distinguishing encrypted DTLS 1.3 records from encrypted DTLS 1.2records is possible when they are carried on the same host/port quartet;such multiplexing is only possible when CIDs[I-D.ietf-tls-dtls-connection-id]are in use, in which case DTLS 1.2 records will have the content type tls12_cid (25).
C:
The C bit (0x10) is set if the Connection ID is present.
S:
The S bit (0x08) indicates the size of the sequence number.0 means an 8-bit sequence number, 1 means 16-bit. Implementations MAY mix sequence numbers of different lengths on the same connection.
L:
The L bit (0x04) is set if the length is present.
E:
The two low bits (0x03) include the low order two bits of the epoch.
Connection ID:
Variable length CID. The CID functionalityis described in[I-D.ietf-tls-dtls-connection-id]. An examplecan be found inSection 9.1.
Sequence Number:
The low order 8 or 16 bits of the record sequence number. This value is 16bits if the S bit is set to 1, and 8 bits if the S bit is 0.
Length:
Identical to the length field in a TLS 1.3 record.

As with previous versions of DTLS, multiple DTLSPlaintextand DTLSCiphertext records can be included in the sameunderlying transport datagram.

Figure 4 illustrates different record headers.

 0 1 2 3 4 5 6 7       0 1 2 3 4 5 6 7       0 1 2 3 4 5 6 7+-+-+-+-+-+-+-+-+     +-+-+-+-+-+-+-+-+     +-+-+-+-+-+-+-+-+| Content Type  |     |0|0|1|1|1|1|E E|     |0|0|1|0|0|0|E E|+-+-+-+-+-+-+-+-+     +-+-+-+-+-+-+-+-+     +-+-+-+-+-+-+-+-+|   16 bit      |     |               |     |8-bit Seq. No. ||   Version     |     / Connection ID /     +-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+     |               |     |               ||   16 bit      |     +-+-+-+-+-+-+-+-+     |   Encrypted   ||    Epoch      |     |    16 bit     |     /   Record      /+-+-+-+-+-+-+-+-+     |Sequence Number|     |               ||               |     +-+-+-+-+-+-+-+-+     +-+-+-+-+-+-+-+-+|               |     |   16 bit      ||   48 bit      |     |   Length      |       DTLSCiphertext|Sequence Number|     +-+-+-+-+-+-+-+-+         Structure|               |     |               |         (minimal)|               |     |  Encrypted    |+-+-+-+-+-+-+-+-+     /  Record       /|    16 bit     |     |               ||    Length     |     +-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+|               |      DTLSCiphertext|               |        Structure/   Fragment    /          (full)|               |+-+-+-+-+-+-+-+-+ DTLSPlaintext   Structure
Figure 4:DTLS 1.3 Header Examples

The length field MAY be omitted by clearing the L bit, which means that therecord consumes the entire rest of the datagram in the lowerlevel transport. In this case it is not possible to have multipleDTLSCiphertext format records without length fields in the same datagram.Omitting the length field MUST only be used for the last record in adatagram. Implementations MAY mix records with and without lengthfields on the same connection.

If a Connection ID is negotiated, then it MUST be contained in alldatagrams. Sending implementations MUST NOT mix records from multiple DTLS associationsin the same datagram. If the second or later record has a connectionID which does not correspond to the same association usedfor previous records, the rest of the datagram MUST be discarded.

When expanded, the epoch and sequence number can be combined into anunpacked RecordNumber structure, as shown below:

    struct {        uint16 epoch;        uint48 sequence_number;    } RecordNumber;

This 64-bit value is used in the ACK message as well as in the "record_sequence_number"input to the AEAD function.

The entire header value shown inFigure 4 (but prior to record numberencryption, seeSection 4.2.3) is used as as the additional data value for the AEADfunction. For instance, if the minimal variant is used,the AAD is 2 octets long. Note that this design is different from the additional datacalculation for DTLS 1.2 and for DTLS 1.2 with Connection ID.

4.1.Demultiplexing DTLS Records

DTLS 1.3 uses a variable length record format and hence thedemultiplexing process is more complex since more header formatsneed to be distinguished. Implementations can demultiplex DTLS 1.3 recordsby examining the first byte as follows:

  • If the first byte is alert(21), handshake(22), or ack(proposed, 26),the record MUST be interpreted as a DTLSPlaintext record.
  • If the first byte is any other value, then receiversMUST check to see if the leading bits of the first byte are001. If so, the implementation MUST process the record asDTLSCiphertext; the true content type will be inside theprotected portion.
  • Otherwise, the record MUST be rejected as if it had faileddeprotection, as described inSection 4.5.2.

Figure 5 shows this demultiplexing procedure graphicallytaking DTLS 1.3 and earlier versions of DTLS into account.

             +----------------+             | Outer Content  |             |   Type (OCT)   |             |                |             |   OCT == 20   -+--> ChangeCipherSpec (DTLS <1.3)             |   OCT == 21   -+--> Alert (Plaintext)             |   OCT == 22   -+--> Handshake (Plaintext)             |   OCT == 23   -+--> Application Data (DTLS <1.3)             |   OCT == 24   -+--> Heartbeat (DTLS <1.3)packet  -->  |   OCT == 25   -+--> DTLSCipherText with CID (DTLS 1.2)             |   OCT == 26   -+--> ACK (DTLS 1.3, Plaintext)             |                |             |                |   /+----------------+\             | 31 < OCT < 64 -+--> |DTLS Ciphertext |             |                |    |(header bits    |             |      else      |    | start with 001)|             |       |        |   /+-------+--------+\             +-------+--------+            |                     |                     |                     v          Decryption |               +---------+          +------+               |  Reject |          |               +---------+          v                            +----------------+                            | Decrypted      |                            | Content Type   |                            | (DCT)          |                            |                |                            |     DCT == 21 -+--> Alert                            |     DCT == 22 -+--> Handshake                            |     DCT == 23 -+--> Application Data                            |     DCT == 24 -+--> Heartbeat                            |     DCT == 26 -+--> ACK                            |                |                            +----------------+
Figure 5:Demultiplexing DTLS 1.2 and DTLS 1.3 Records

Note: The optimized DTLS header format shown inFigure 3, whichdoes not carry the Content Type in the Unified Header format, requiresa different demultilexing strategy compared to what was used in previousDTLS versions where the Content Type was conveyed in every record.As described inFigure 5, the first byte determines how an incomingDTLS record is demultiplexed. The first 3 bits of the first bytedistinguish a DTLS 1.3 encrypted record from record types used inprevious DTLS versions and plaintext DTLS 1.3 record types. Hence, therange 32 (0b0010 0000) to 63 (0b0011 1111) needs to be excludedfrom future allocations by IANA to avoid problems while demultiplexing;seeSection 14.

4.2.Sequence Number and Epoch

DTLS uses an explicit or partly explicit sequence number, rather than an implicit one,carried in the sequence_number field of the record. Sequence numbersare maintained separately for each epoch, with each sequence_numberinitially being 0 for each epoch.

The epoch number is initially zero and is incremented each timekeying material changes and a sender aims to rekey. More detailsare provided inSection 6.1.

4.2.1.Processing Guidelines

Because DTLS records could be reordered, a record from epochM may be received after epoch N (where N > M) has begun.Implementations SHOULD discard records from earlier epochs, butMAY choose toretain keying material from previous epochs for up to the default MSLspecified for TCP[RFC0793] to allow for packet reordering. (Note thatthe intention here is that implementers use the current guidance fromthe IETF for MSL, as specified in[RFC0793] or successors,not that they attempt to interrogate the MSL thatthe system TCP stack is using.)

Conversely, it is possible for records that are protected with thenew epoch to be received prior to the completion of ahandshake. For instance, the server may send its Finished messageand then start transmitting data. Implementations MAY either bufferor discard such records, though when DTLS is used over reliabletransports (e.g., SCTP[RFC4960]), they SHOULD be buffered andprocessed once the handshake completes. Note that TLS's restrictionson when records may be sent still apply, and the receiver treats therecords as if they were sent in the right order.

Implementations MUST send retransmissions of lost messages using the sameepoch and keying material as the original transmission.

Implementations MUST either abandon an association or re-key prior toallowing the sequence number to wrap.

Implementations MUST NOT allow the epoch to wrap, but instead MUSTestablish a new association, terminating the old association.

4.2.2.Reconstructing the Sequence Number and Epoch

When receiving protected DTLS records, the recipient does nothave a full epoch or sequence number value in the record and so there is someopportunity for ambiguity. Because the full epoch and sequence numberare used to compute the per-record nonce, failure to reconstruct thesevalues leads to failure to deprotect the record, and so implementationsMAY use a mechanism of their choice to determine the full values.This section provides an algorithm which is comparatively simpleand which implementations are RECOMMENDED to follow.

If the epoch bits match those of the current epoch, thenimplementations SHOULD reconstruct the sequence number by computingthe full sequence number which is numerically closest to one plus thesequence number of the highest successfully deprotected record in thecurrent epoch.

During the handshake phase, the epoch bits unambiguously indicate thecorrect key to use. After thehandshake is complete, if the epoch bits do not match those from thecurrent epoch implementations SHOULD use the most recent past epochwhich has matching bits, and then reconstruct the sequence number forthat epoch as described above.

4.2.3.Record Number Encryption

In DTLS 1.3, when records are encrypted, record sequence numbers arealso encrypted. The basic pattern is that the underlying encryptionalgorithm used with the AEAD algorithm is used to generate a maskwhich is then XORed with the sequence number.

When the AEAD is based on AES, then the Mask is generated bycomputing AES-ECB on the first 16 bytes of the ciphertext:

  Mask = AES-ECB(sn_key, Ciphertext[0..15])

When the AEAD is based on ChaCha20, then the mask is generatedby treating the first 4 bytes of the ciphertext as the blockcounter and the next 12 bytes as the nonce, passing them to the ChaCha20block function (Section 2.3 of[CHACHA]):

  Mask = ChaCha20(sn_key, Ciphertext[0..3], Ciphertext[4..15])

The sn_key is computed as follows:

   [sender]_sn_key  = HKDF-Expand-Label(Secret, "sn" , "", key_length)

[sender] denotes the sending side. The Secret value to be used is describedin Section 7.3 of[TLS13]. Note that a new key is used for each epoch:because the epoch is sent in the clear, this does not result in ambiguity.

The encrypted sequence number is computed by XORing the leadingbytes of the Mask with the on-the-wire representation of thesequence number. Decryption is accomplished by the same process.

This procedure requires the ciphertext length be at least 16 bytes. ReceiversMUST reject shorter records as if they had failed deprotection, as described inSection 4.5.2. Senders MUST pad short plaintexts out (using theconventional record padding mechanism) in order to make a suitable-lengthciphertext. Note most of the DTLS AEAD algorithms have a 16-byte authenticationtag and need no padding. However, some algorithms such asTLS_AES_128_CCM_8_SHA256 have a shorter authentication tag and may require paddingfor short inputs.

Future cipher suites, which are not based on AES or ChaCha20, MUST definetheir own record sequence number encryption in order to be used withDTLS.

Note that sequence number encryption is only applied to the DTLSCiphertextstructure and not to the DTLSPlaintext structure, which also contains asequence number.

4.3.Transport Layer Mapping

DTLS messages MAY be fragmented into multiple DTLS records.Each DTLS record MUST fit within a single datagram. In order toavoid IP fragmentation, clients of the DTLS record layer SHOULDattempt to size records so that they fit within any Path MTU (PMTU) estimatesobtained from the record layer. For more information about PMTU issuesseeSection 4.4.

Multiple DTLS records MAY be placed in a single datagram. Records are encodedconsecutively. The length field from DTLS records containing that field can beused to determine the boundaries between records. The final record in adatagram can omit the length field. The first byte of the datagram payload MUSTbe the beginning of a record. Records MUST NOT span datagrams.

DTLS records without CIDs do not contain any associationidentifiers and applications must arrange to multiplex between associations.With UDP, the host/port number is used to look up the appropriate securityassociation for incoming records without CIDs.

Some transports, such as DCCP[RFC4340], provide their own sequencenumbers. When carried over those transports, both the DTLS and thetransport sequence numbers will be present. Although this introducesa small amount of inefficiency, the transport layer and DTLS sequencenumbers serve different purposes; therefore, for conceptual simplicity,it is superior to use both sequence numbers.

Some transports provide congestion control for trafficcarried over them. If the congestion window is sufficiently narrow,DTLS handshake retransmissions may be held rather than transmittedimmediately, potentially leading to timeouts and spuriousretransmission. When DTLS is used over such transports, care shouldbe taken not to overrun the likely congestion window.[RFC5238]defines a mapping of DTLS to DCCP that takes these issues into account.

4.4.PMTU Issues

In general, DTLS's philosophy is to leave PMTU discovery to the application.However, DTLS cannot completely ignore PMTU for three reasons:

  • The DTLS record framing expands the datagram size, thus loweringthe effective PMTU from the application's perspective.
  • In some implementations, the application may not directly talk tothe network, in which case the DTLS stack may absorb ICMP[RFC1191] "Datagram Too Big" indications or ICMPv6[RFC4443]"Packet Too Big" indications.
  • The DTLS handshake messages can exceed the PMTU.

In order to deal with the first two issues, the DTLS record layerSHOULD behave as described below.

If PMTU estimates are available from the underlying transportprotocol, they should be made available to upper layerprotocols. In particular:

  • For DTLS over UDP, the upper layer protocol SHOULD be allowed toobtain the PMTU estimate maintained in the IP layer.
  • For DTLS over DCCP, the upper layer protocol SHOULD be allowed toobtain the current estimate of the PMTU.
  • For DTLS over TCP or SCTP, which automatically fragment andreassemble datagrams, there is no PMTU limitation. However, theupper layer protocol MUST NOT write any record that exceeds themaximum record size of 2^14 bytes.

The DTLS record layer SHOULD also allow the upper layer protocol todiscover the amount of record expansion expected by the DTLSprocessing; alternately it MAY report PMTU estimates minus theestimated expansion from the transport layer and DTLS recordframing.

Note that DTLS does not defend against spoofed ICMP messages;implementations SHOULD ignore any such messages that indicatePMTUs below the IPv4 and IPv6 minimums of 576 and 1280 bytesrespectively.

If there is a transport protocol indication that the PMTU was exceeded(either via ICMP or via arefusal to send the datagram as in Section 14 of[RFC4340]), then theDTLS record layer MUST inform the upper layer protocol of the error.

The DTLS record layer SHOULD NOT interfere with upper layer protocolsperforming PMTU discovery, whether via[RFC1191] and[RFC4821] forIPv4 or via[RFC8201] for IPv6. In particular:

  • Where allowed by the underlying transport protocol, the upperlayer protocol SHOULD be allowed to set the state of the DF bit(in IPv4) or prohibit local fragmentation (in IPv6).
  • If the underlying transport protocol allows the application torequest PMTU probing (e.g., DCCP), the DTLS record layer SHOULDhonor this request.

The final issue is the DTLS handshake protocol. From the perspectiveof the DTLS record layer, this is merely another upper layerprotocol. However, DTLS handshakes occur infrequently and involveonly a few round trips; therefore, the handshake protocol PMTUhandling places a premium on rapid completion over accurate PMTUdiscovery. In order to allow connections under these circumstances,DTLS implementations SHOULD follow the following rules:

  • If the DTLS record layer informs the DTLS handshake layer that amessage is too big, the handshake layer SHOULD immediately attempt to fragmentthe message, using any existing information about the PMTU.
  • If repeated retransmissions do not result in a response, and thePMTU is unknown, subsequent retransmissions SHOULD back off to asmaller record size, fragmenting the handshake message asappropriate. This specification does not specify an exact number ofretransmits to attempt before backing off, but 2-3 seemsappropriate.

4.5.Record Payload Protection

Like TLS, DTLS transmits data as a series of protected records. Therest of this section describes the details of that format.

4.5.1.Anti-Replay

Each DTLS record contains a sequence number to provide replay protection.Sequence number verification SHOULD be performed using the followingsliding window procedure, borrowed from Section 3.4.3 of[RFC4303].Because each epoch resets the sequence number space, a separate slidingwindow is needed for each epoch.

The received record counter for an epoch MUST be initialized tozero when that epoch is first used. For each received record, thereceiver MUST verify that the record contains a sequence number thatdoes not duplicate the sequence number of any other record receivedin that epoch during the lifetime of the association.This check SHOULD happen afterdeprotecting the record; otherwise the record discard might itselfserve as a timing channel for the record number. Note that computingthe full record number from the partial is still a potential timingchannel for the record number, though a less powerful one than whetherthe record was deprotected.

Duplicates are rejected through the use of a sliding receive window.(How the window is implemented is a local matter, but the followingtext describes the functionality that the implementation mustexhibit.) The receiver SHOULD pick a window large enough to handleany plausible reordering, which depends on the data rate.(The receiver does not notify the sender of the windowsize.)

The "right" edge of the window represents the highest validatedsequence number value received in the epoch. Records that containsequence numbers lower than the "left" edge of the window arerejected. Records falling within the window are checked against alist of received records within the window. An efficient means forperforming this check, based on the use of a bit mask, is described inSection 3.4.3 of[RFC4303]. If the received record falls within thewindow and is new, or if the record is to the right of the window,then the record is new.

The window MUST NOT be updated until the record has been deprotectedsuccessfully.

4.5.2.Handling Invalid Records

Unlike TLS, DTLS is resilient in the face of invalid records (e.g.,invalid formatting, length, MAC, etc.). In general, invalid recordsSHOULD be silently discarded, thus preserving the association;however, an error MAY be logged for diagnostic purposes.Implementations which choose to generate an alert instead, MUSTgenerate fatal alerts to avoid attacks where the attackerrepeatedly probes the implementation to see how it responds tovarious types of error. Note that if DTLS is run over UDP, then anyimplementation which does this will be extremely susceptible todenial-of-service (DoS) attacks because UDP forgery is so easy.Thus, generating fatal alerts is NOT RECOMMENDED for such transports, bothto increase the reliability of DTLS service and to avoid the riskof spoofing attacks sending traffic to unrelated third parties.

If DTLS is being carried over a transport that is resistant toforgery (e.g., SCTP with SCTP-AUTH), then it is safer to send alertsbecause an attacker will have difficulty forging a datagram that willnot be rejected by the transport layer.

Note that because invalid records are rejected at a layer lower thanthe handshake state machine, they do not affect pendingretransmission timers.

4.5.3.AEAD Limits

Section 5.5 of TLS[TLS13] defines limits on the number of records that canbe protected using the same keys. These limits are specific to an AEADalgorithm, and apply equally to DTLS. Implementations SHOULD NOT protect morerecords than allowed by the limit specified for the negotiated AEAD.Implementations SHOULD initiate a key update before reaching this limit.

[TLS13] does not specify a limit for AEAD_AES_128_CCM, but the analysis inAppendix B shows that a limit of 2^23 packets can be used to obtain thesame confidentiality protection as the limits specified in TLS.

The usage limits defined in TLS 1.3 exist for protection against attackson confidentiality and apply to successful applications of AEAD protection. Theintegrity protections in authenticated encryption also depend on limiting thenumber of attempts to forge packets. TLS achieves this by closing connectionsafter any record fails an authentication check. In comparison, DTLS ignores anypacket that cannot be authenticated, allowing multiple forgery attempts.

Implementations MUST count the number of received packets that failauthentication with each key. If the number of packets that fail authenticationexceed a limit that is specific to the AEAD in use, an implementation SHOULDimmediately close the connection. Implementations SHOULD initiate a key updatewith update_requested before reaching this limit. Once a key update has beeninitiated, the previous keys can be dropped when the limit is reached ratherthan closing the connection. Applying a limit reduces the probability that anattacker is able to successfully forge a packet; see[AEBounds] and[ROBUST].

For AEAD_AES_128_GCM, AEAD_AES_256_GCM, and AEAD_CHACHA20_POLY1305, the limiton the number of records that fail authentication is 2^36. Note that theanalysis in[AEBounds] supports a higher limit for the AEAD_AES_128_GCM andAEAD_AES_256_GCM, but this specification recommends a lower limit. ForAEAD_AES_128_CCM, the limit on the number of records that fail authenticationis 2^23.5; seeAppendix B.

The AEAD_AES_128_CCM_8 AEAD, as used in TLS_AES_128_CCM_8_SHA256, does not have alimit on the number of records that fail authentication that both limits theprobability of forgery by the same amount and does not expose implementationsto the risk of denial of service; seeAppendix B.3. Therefore,TLS_AES_128_CCM_8_SHA256 MUST NOT be used in DTLS without additional safeguardsagainst forgery. Implementations MUST set usage limits for AEAD_AES_128_CCM_8based on an understanding of any additional forgery protections that are used.

Any TLS cipher suite that is specified for use with DTLS MUST define limits onthe use of the associated AEAD function that preserves margins for bothconfidentiality and integrity. That is, limits MUST be specified for the numberof packets that can be authenticated and for the number of packets that can failauthentication before a key update is required. Providing a reference to any analysis upon which values arebased - and any assumptions used in that analysis - allows limits to be adaptedto varying usage conditions.

5.The DTLS Handshake Protocol

DTLS 1.3 re-uses the TLS 1.3 handshake messages and flows, withthe following changes:

  1. To handle message loss, reordering, and fragmentation modifications tothe handshake header are necessary.
  2. Retransmission timers are introduced to handle message loss.
  3. A new ACK content type has been added for reliable message delivery of handshake messages.

Note that TLS 1.3 already supports a cookie extension, which is used toprevent denial-of-service attacks. This DoS prevention mechanism isdescribed in more detail below since UDP-based protocols are more vulnerableto amplification attacks than a connection-oriented transport like TCPthat performs return-routability checks as part of the connection establishment.

DTLS implementations do not use the TLS 1.3 "compatibility mode" described inSection D.4 of[TLS13]. DTLS servers MUST NOT echo the"legacy_session_id" value from the client and endpoints MUST NOT send ChangeCipherSpecmessages.

With these exceptions, the DTLS message formats, flows, and logic arethe same as those of TLS 1.3.

5.1.Denial-of-Service Countermeasures

Datagram security protocols are extremely susceptible to a variety ofDoS attacks. Two attacks are of particular concern:

  1. An attacker can consume excessive resources on the server bytransmitting a series of handshake initiation requests, causingthe server to allocate state and potentially to performexpensive cryptographic operations.
  2. An attacker can use the server as an amplifier by sendingconnection initiation messages with a forged source address that belongs to avictim. The server then sends its response to the victimmachine, thus flooding it. Depending on the selectedparameters this response message can be quite large, asis the case for a Certificate message.

In order to counter both of these attacks, DTLS borrows the statelesscookie technique used by Photuris[RFC2522] and IKE[RFC7296]. Whenthe client sends its ClientHello message to the server, the serverMAY respond with a HelloRetryRequest message. The HelloRetryRequest message,as well as the cookie extension, is defined in TLS 1.3.The HelloRetryRequest message contains a stateless cookie (see[TLS13]; Section 4.2.2).The client MUST send a new ClientHellowith the cookie added as an extension. The server then verifies the cookieand proceeds with the handshake only if it is valid. This mechanism forcesthe attacker/client to be able to receive the cookie, which makes DoS attackswith spoofed IP addresses difficult. This mechanism does not provide any defenseagainst DoS attacks mounted from valid IP addresses.

The DTLS 1.3 specification changes how cookies are exchangedcompared to DTLS 1.2. DTLS 1.3 re-uses the HelloRetryRequest messageand conveys the cookie to the client via an extension. The clientreceiving the cookie uses the same extension to placethe cookie subsequently into a ClientHello message.DTLS 1.2 on the other hand used a separate message, namely the HelloVerifyRequest,to pass a cookie to the client and did not utilize the extension mechanism.For backwards compatibility reasons, the cookie field in the ClientHellois present in DTLS 1.3 but is ignored by a DTLS 1.3 compliant serverimplementation.

The exchange is shown inFigure 6. Note thatthe figure focuses on the cookie exchange; all other extensionsare omitted.

      Client                                   Server      ------                                   ------      ClientHello           ------>                            <----- HelloRetryRequest                                    + cookie      ClientHello           ------>       + cookie      [Rest of handshake]
Figure 6:DTLS exchange with HelloRetryRequest containing the "cookie" extension

The cookie extension is defined in Section 4.2.2 of[TLS13]. When sending theinitial ClientHello, the client does not have a cookie yet. In this case,the cookie extension is omitted and the legacy_cookie field in the ClientHellomessage MUST be set to a zero-length vector (i.e., a zero-valued single byte length field).

When responding to a HelloRetryRequest, the client MUST create a newClientHello message following the description in Section 4.1.2 of[TLS13].

If the HelloRetryRequest message is used, the initial ClientHello andthe HelloRetryRequest are included in the calculation of thetranscript hash. The computation of themessage hash for the HelloRetryRequest is done according to the descriptionin Section 4.4.1 of[TLS13].

The handshake transcript is not reset with the second ClientHelloand a stateless server-cookie implementation requires the content or hashof the initial ClientHello (and HelloRetryRequest)to be stored in the cookie. The initial ClientHello is included in thehandshake transcript as a synthetic "message_hash" message, so only the hashvalue is needed for the handshake to complete, though the completeHelloRetryRequest contents are needed.

When the second ClientHello is received, the server can verify thatthe cookie is valid and that the client can receive packets at thegiven IP address. If the client's apparent IP address is embeddedin the cookie, this prevents an attacker from generating an acceptableClientHello apparently from another user.

One potential attack on this scheme is for the attacker to collect anumber of cookies from different addresses where it controls endpointsand then reuse them to attack the server.The server can defend against this attack bychanging the secret value frequently, thus invalidating thosecookies. If the server wishes to allow legitimate clients tohandshake through the transition (e.g., a client received a cookie withSecret 1 and then sent the second ClientHello after the server haschanged to Secret 2), the server can have a limited window duringwhich it accepts both secrets.[RFC7296] suggests adding a keyidentifier to cookies to detect this case. An alternative approach issimply to try verifying with both secrets. It is RECOMMENDED thatservers implement a key rotation scheme that allows the serverto manage keys with overlapping lifetime.

Alternatively, the server can store timestamps in the cookie andreject cookies that were generated outside a certaininterval of time.

DTLS servers SHOULD perform a cookie exchange whenever a newhandshake is being performed. If the server is being operated in anenvironment where amplification is not a problem, the server MAY beconfigured not to perform a cookie exchange. The default SHOULD bethat the exchange is performed, however. In addition, the server MAYchoose not to do a cookie exchange when a session is resumed or, moregenerically, when the DTLS handshake uses a PSK-based key exchangeand the IP address matches one associated with the PSK.Servers which process 0-RTT requests and send 0.5-RTT responseswithout a cookie exchange risk being used in an amplification attackif the size of outgoing messages greatly exceeds the size of those that are received.A server SHOULD limit the amount of data it sends toward a client addressto three times the amount of data sent by the client beforeit verifies that the client is able to receive data at that address.A client address is valid after a cookie exchange or handshake completion.Clients MUST be prepared to do a cookie exchange with everyhandshake. Note that cookies are only valid for the existinghandshake and cannot be stored for future handshakes.

If a server receives a ClientHello with an invalid cookie, itMUST terminate the handshake with an "illegal_parameter" alert.This allows the client to restart the connection fromscratch without a cookie.

As described in Section 4.1.4 of[TLS13], clients MUSTabort the handshake with an "unexpected_message" alert in responseto any second HelloRetryRequest which was sent in the same connection(i.e., where the ClientHello was itself in response to a HelloRetryRequest).

DTLS clients which do not want to receive a Connection ID SHOULDstill offer the "connection_id" extension unlessthere is an application profile to the contrary. This permitsa server which wants to receive a CID to negotiate one.

5.2.DTLS Handshake Message Format

In order to support message loss, reordering, and messagefragmentation, DTLS modifies the TLS 1.3 handshake header:

    enum {        client_hello(1),        server_hello(2),        new_session_ticket(4),        end_of_early_data(5),        encrypted_extensions(8),        certificate(11),        certificate_request(13),        certificate_verify(15),        finished(20),        key_update(24),        message_hash(254),        (255)    } HandshakeType;    struct {        HandshakeType msg_type;    /* handshake type */        uint24 length;             /* bytes in message */        uint16 message_seq;        /* DTLS-required field */        uint24 fragment_offset;    /* DTLS-required field */        uint24 fragment_length;    /* DTLS-required field */        select (msg_type) {            case client_hello:          ClientHello;            case server_hello:          ServerHello;            case end_of_early_data:     EndOfEarlyData;            case encrypted_extensions:  EncryptedExtensions;            case certificate_request:   CertificateRequest;            case certificate:           Certificate;            case certificate_verify:    CertificateVerify;            case finished:              Finished;            case new_session_ticket:    NewSessionTicket;            case key_update:            KeyUpdate;        } body;    } Handshake;

The first message each side transmits in each association always hasmessage_seq = 0. Whenever a new message is generated, themessage_seq value is incremented by one. When a message isretransmitted, the old message_seq value is re-used, i.e., notincremented. From the perspective of the DTLS record layer, the retransmission isa new record. This record will have a newDTLSPlaintext.sequence_number value.

Note: In DTLS 1.2 the message_seq was reset to zero in case of arehandshake (i.e., renegotiation). On the surface, a rehandshake in DTLS 1.2shares similarities with a post-handshake message exchange in DTLS 1.3. However,in DTLS 1.3 the message_seq is not reset to allow distinguishing aretransmission from a previously sent post-handshake message from a newlysent post-handshake message.

DTLS implementations maintain (at least notionally) anext_receive_seq counter. This counter is initially set to zero.When a handshake message is received, if its message_seq value matchesnext_receive_seq, next_receive_seq is incremented and the message isprocessed. If the sequence number is less than next_receive_seq, themessage MUST be discarded. If the sequence number is greater thannext_receive_seq, the implementation SHOULD queue the message but MAYdiscard it. (This is a simple space/bandwidth tradeoff).

In addition to the handshake messages that are deprecated by the TLS 1.3specification, DTLS 1.3 furthermore deprecates the HelloVerifyRequest messageoriginally defined in DTLS 1.0. DTLS 1.3-compliant implements MUST NOTuse the HelloVerifyRequest to execute a return-routability check. Adual-stack DTLS 1.2/DTLS 1.3 client MUST, however, be prepared tointeract with a DTLS 1.2 server.

5.3.ClientHello Message

The format of the ClientHello used by a DTLS 1.3 client differs from theTLS 1.3 ClientHello format as shown below.

    uint16 ProtocolVersion;    opaque Random[32];    uint8 CipherSuite[2];    /* Cryptographic suite selector */    struct {        ProtocolVersion legacy_version = { 254,253 }; // DTLSv1.2        Random random;        opaque legacy_session_id<0..32>;        opaque legacy_cookie<0..2^8-1>;                  // DTLS        CipherSuite cipher_suites<2..2^16-2>;        opaque legacy_compression_methods<1..2^8-1>;        Extension extensions<8..2^16-1>;    } ClientHello;
legacy_version:
In previous versions of DTLS, this field was used for versionnegotiation and represented the highest version number supported bythe client. Experience has shown that many servers do not properlyimplement version negotiation, leading to "version intolerance" inwhich the server rejects an otherwise acceptable ClientHello with aversion number higher than it supports. In DTLS 1.3, the clientindicates its version preferences in the "supported_versions"extension (see Section 4.2.1 of[TLS13]) and thelegacy_version field MUST be set to {254, 253}, which was the versionnumber for DTLS 1.2. The supported_versions entries for DTLS 1.0 and DTLS 1.2 are0xfeff and 0xfefd (to match the wire versions). The value 0xfefc is usedto indicate DTLS 1.3.
random:
Same as for TLS 1.3, except that the downgrade sentinels describedin Section 4.1.3 of[TLS13] when TLS 1.2 and TLS 1.1 and below are negotiatedapply to DTLS 1.2 and DTLS 1.0 respectively.
legacy_session_id:
Versions of TLS and DTLS before version 1.3 supported a "session resumption"feature which has been merged with pre-shared keys in version 1.3. A clientwhich has a cached session ID set by a pre-DTLS 1.3 server SHOULD set thisfield to that value. Otherwise, it MUST be set as a zero-length vector(i.e., a zero-valued single byte length field).
legacy_cookie:
A DTLS 1.3-only client MUST set the legacy_cookie field to zero length.If a DTLS 1.3 ClientHello is received with any other value in this field,the server MUST abort the handshake with an "illegal_parameter" alert.
cipher_suites:
Same as for TLS 1.3; only suites with DTLS-OK=Y may be used.
legacy_compression_methods:
Same as for TLS 1.3.
extensions:
Same as for TLS 1.3.

5.4.ServerHello Message

The DTLS 1.3 ServerHello message is the same as the TLS 1.3ServerHello message, except that the legacy_version fieldis set to 0xfefd, indicating DTLS 1.2.

5.5.Handshake Message Fragmentation and Reassembly

As described inSection 4.3 one or more handshakemessages may be carried in a single datagram. However, handshake messages arepotentially bigger than the size allowed by the underlying datagram transport.DTLS provides a mechanism for fragmenting a handshake message over anumber of records, each of which can be transmitted in separate datagrams, thusavoiding IP fragmentation.

When transmitting the handshake message, the sender divides themessage into a series of N contiguous data ranges. The ranges MUST NOToverlap. The sender then creates N handshake messages, all with thesame message_seq value as the original handshake message. Each newmessage is labeled with the fragment_offset (the number of bytescontained in previous fragments) and the fragment_length (the lengthof this fragment). The length field in all messages is the same asthe length field of the original message. An unfragmented message isa degenerate case with fragment_offset=0 and fragment_length=length.Each handshake message fragment that is placed into a recordMUST be delivered in a single UDP datagram.

When a DTLS implementation receives a handshake message fragment correspondingto the next expected handshake message sequence number, itMUST buffer it until it has the entire handshake message. DTLSimplementations MUST be able to handle overlapping fragment ranges.This allows senders to retransmit handshake messages with smallerfragment sizes if the PMTU estimate changes. Senders MUST NOT changehandshake message bytes upon retransmission. Receivers MAY checkthat retransmitted bytes are identical and SHOULD abort the handshakewith an "illegal_parameter" alert if the value of a byte changes.

Note that as with TLS, multiple handshake messages may be placed inthe same DTLS record, provided that there is room and that they arepart of the same flight. Thus, there are two acceptable ways to packtwo DTLS handshake messages into the same datagram: in the same record or inseparate records.

5.6.End Of Early Data

The DTLS 1.3 handshake has one important difference from theTLS 1.3 handshake: the EndOfEarlyData message is omitted bothfrom the wire and the handshake transcript: because DTLSrecords have epochs, EndOfEarlyData is not necessary to determinewhen the early data is complete, and because DTLS is lossy,attackers can trivially mount the deletion attacks that EndOfEarlyDataprevents in TLS. Servers SHOULD NOT accept records from epoch 1 indefinitely once they are able to process records from epoch 3. Though reordering of IP packets can result in records from epoch 1 arriving after records from epoch 3, this is not likely to persist for very long relative to the round trip time. Servers could discard epoch 1 keys after the first epoch 3 data arrives, or retain keys for processing epoch 1 data for a short period.(SeeSection 6.1 for the definitions of each epoch.)

5.7.DTLS Handshake Flights

DTLS handshake messages are grouped into a series of message flights. A flight starts with thehandshake message transmission of one peer and ends with the expected response from theother peer.Table 1 contains a complete list of message combinations that constitute flights.

Table 1:Flight Handshake Message Combinations.
NoteClientServerHandshake Messages
 x ClientHello
  xHelloRetryRequest
  xServerHello, EncryptedExtensions, CertificateRequest, Certificate, CertificateVerify, Finished
1x Certificate, CertificateVerify, Finished
1 xNewSessionTicket

Remarks:

  • Table 1 does not highlight any of the optional messages.
  • Regarding note (1): When a handshake flight is sent without any expected response, as it is the case with the client's final flight or with the NewSessionTicket message, the flight must be acknowledged with an ACK message.

Below are several example message exchange illustrating the flight concept.The notational conventions from[TLS13] are used.

Client                                             Server                                                            +--------+ ClientHello                                                | Flight |                        -------->                           +--------+                                                            +--------+                        <--------        HelloRetryRequest  | Flight |                                          + cookie          +--------+                                                            +--------+ClientHello                                                 | Flight | + cookie               -------->                           +--------+                                               ServerHello                                     {EncryptedExtensions}  +--------+                                     {CertificateRequest*}  | Flight |                                            {Certificate*}  +--------+                                      {CertificateVerify*}                                                {Finished}                        <--------      [Application Data*] {Certificate*}                                             +--------+ {CertificateVerify*}                                       | Flight | {Finished}             -------->                           +--------+ [Application Data]                                                            +--------+                        <--------                    [ACK]  | Flight |                                       [Application Data*]  +--------+ [Application Data]     <------->      [Application Data]
Figure 7:Message flights for a full DTLS Handshake (with cookie exchange)
 ClientHello                                              +--------+  + pre_shared_key                                        | Flight |  + psk_key_exchange_modes                                +--------+  + key_share*         -------->                                             ServerHello                                        + pre_shared_key  +--------+                                            + key_share*  | Flight |                                   {EncryptedExtensions}  +--------+                       <--------              {Finished}                                     [Application Data*]                                                          +--------+ {Finished}            -------->                          | Flight | [Application Data*]                                      +--------+                                                          +--------+                       <--------                   [ACK]  | Flight |                                     [Application Data*]  +--------+ [Application Data]    <------->      [Application Data]
Figure 8:Message flights for resumption and PSK handshake (without cookie exchange)
Client                                            Server ClientHello  + early_data  + psk_key_exchange_modes                                +--------+  + key_share*                                            | Flight |  + pre_shared_key                                        +--------+ (Application Data*)     -------->                                             ServerHello                                        + pre_shared_key                                            + key_share*  +--------+                                   {EncryptedExtensions}  | Flight |                                              {Finished}  +--------+                       <--------     [Application Data*]                                                          +--------+ {Finished}            -------->                          | Flight | [Application Data*]                                      +--------+                                                          +--------+                       <--------                   [ACK]  | Flight |                                     [Application Data*]  +--------+ [Application Data]    <------->      [Application Data]
Figure 9:Message flights for the Zero-RTT handshake
Client                                            Server                                                          +--------+                       <--------       [NewSessionTicket] | Flight |                                                          +--------+                                                          +--------+[ACK]                  -------->                          | Flight |                                                          +--------+
Figure 10:Message flights for the NewSessionTicket message

KeyUpdate, NewConnectionId and RequestConnectionId follow a similarpattern to NewSessionTicket: a single message sent by one sidefollowed by an ACK by the other.

5.8.Timeout and Retransmission

5.8.1.State Machine

DTLS uses a simple timeout and retransmission scheme with thestate machine shown inFigure 11.

                             +-----------+                             | PREPARING |                +----------> |           |                |            |           |                |            +-----------+                |                  |                |                  | Buffer next flight                |                  |                |                 \|/                |            +-----------+                |            |           |                |            |  SENDING  |<------------------+                |            |           |                   |                |            +-----------+                   |        Receive |                  |                         |           next |                  | Send flight or partial  |         flight |                  | flight                  |                |                  |                         |                |                  | Set retransmit timer    |                |                 \|/                        |                |            +-----------+                   |                |            |           |                   |                +------------|  WAITING  |-------------------+                |     +----->|           |   Timer expires   |                |     |      +-----------+                   |                |     |          |  |   |                    |                |     |          |  |   |                    |                |     +----------+  |   +--------------------+                |    Receive record |   Read retransmit or ACK        Receive |  (Maybe Send ACK) |           last |                   |         flight |                   | Receive ACK                |                   | for last flight               \|/                  |                                    |            +-----------+           |            |           | <---------+            | FINISHED  |            |           |            +-----------+                |  /|\                |   |                |   |                +---+          Server read retransmit              Retransmit ACK
Figure 11:DTLS timeout and retransmission state machine

The state machine has four basic states: PREPARING, SENDING, WAITING,and FINISHED.

In the PREPARING state, the implementation does whatever computationsare necessary to prepare the next flight of messages. It thenbuffers them up for transmission (emptying the transmissionbuffer first) and enters the SENDING state.

In the SENDING state, the implementation transmits the bufferedflight of messages. If the implementation has received one or moreACKs (seeSection 7) from the peer, then it SHOULD omit any messages ormessage fragments which have already been ACKed. Once the messageshave been sent, the implementation then sets a retransmit timerand enters the WAITING state.

There are four ways to exit the WAITING state:

  1. The retransmit timer expires: the implementation transitions tothe SENDING state, where it retransmits the flight, adjusts and re-arms theretransmit timer (seeSection 5.8.2), and returns to the WAITING state.
  2. The implementation reads an ACK from the peer: upon receivingan ACK for a partial flight (as mentioned inSection 7.1),the implementation transitionsto the SENDING state, where it retransmits the unacked portionof the flight, adjusts and re-arms the retransmit timer, and returns to theWAITING state. Upon receiving an ACK for a complete flight,the implementation cancels all retransmissions and eitherremains in WAITING, or, if the ACK was for the final flight,transitions to FINISHED.
  3. The implementation reads a retransmitted flight from the peer: theimplementation transitions to the SENDING state, where itretransmits the flight, adjusts and re-arms the retransmit timer, and returnsto the WAITING state. The rationale here is that the receipt of aduplicate message is the likely result of timer expiry on the peerand therefore suggests that part of one's previous flight waslost.
  4. The implementation receives some or all of the next flight of messages: ifthis is the final flight of messages, the implementationtransitions to FINISHED. If the implementation needs to send a newflight, it transitions to the PREPARING state. Partial reads(whether partial messages or only some of the messages in theflight) may also trigger the implementation to send an ACK, asdescribed inSection 7.1.

Because DTLS clients send the first message (ClientHello), they startin the PREPARING state. DTLS servers start in the WAITING state, butwith empty buffers and no retransmit timer.

In addition, for at least twice the default MSL defined for[RFC0793],when in the FINISHED state, the server MUST respond to retransmissionof the client's final flight with a retransmit of its ACK.

Note that because of packet loss, it is possible for one side to besending application data even though the other side has not receivedthe first side's Finished message. Implementations MUST eitherdiscard or buffer all application data records for epoch 3 andabove until they have received the Finished message from thepeer. Implementations MAY treat receipt of application data with a newepoch prior to receipt of the corresponding Finished message asevidence of reordering or packet loss and retransmit their finalflight immediately, shortcutting the retransmission timer.

5.8.2.Timer Values

The configuration of timer settings varies with implementations, and certaindeployment environments require timer value adjustments. Mishandlingof the timer can lead to serious congestion problems, for example ifmany instances of a DTLS time out early and retransmit too quickly ona congested link.

Unless implementations have deployment-specific and/or external information about the round trip time,implementations SHOULD use an initial timer value of 1000 ms and doublethe value at each retransmission, up to no less than 60 seconds (theRFC 6298[RFC6298] maximum). Application specific profiles MAYrecommend shorter or longer timer values. For instance:

  • Profiles for specific deployment environments, such as in low-power,multi-hop mesh scenarios as used in some Internet of Things (IoT) networks,MAY specify longer timeouts. See[I-D.ietf-uta-tls13-iot-profile] formore information about one such DTLS 1.3 IoT profile.
  • Real-time protocols MAY specify shorter timeouts. It is RECOMMENDEDthat for DTLS-SRTP[RFC5764], a default timeout of400ms be used; because customer experience degrades with one-way latenciesof greater than 200ms, real-time deployments are less likelyto have long latencies.

In settings where there is external information (for instance from an ICE[RFC8445]handshake, or from previous connections to the same server)about the RTT, implementations SHOULD use 1.5 times that RTT estimateas the retransmit timer.

Implementations SHOULD retain the current timer value until amessage is transmitted and acknowledged without having tobe retransmitted, at which time the value SHOULD be adjustedto 1.5 times the measured round trip time for thatmessage. After a long period of idleness, no lessthan 10 times the current timer value, implementations MAY reset thetimer to the initial value.

Note that because retransmission is for the handshake and not dataflow, the effect oncongestion of shorter timeouts is smaller than in generic protocolssuch as TCP or QUIC. Experience with DTLS 1.2, which uses asimpler "retransmit everything on timeout" approach, has not shownserious congestion problems in practice.

5.8.3.Large Flight Sizes

DTLS does not have any built-in congestion control or rate control;in general this is not an issue because messages tend to be small.However, in principle, some messages - especially Certificate - canbe quite large. If all the messages in a large flight are sentat once, this can result in network congestion. A better strategyis to send out only part of the flight, sending more whenmessages are acknowledged. Several extensions have been standardizedto reduce the size of the certificate message, for examplethe cached information extension[RFC7924], certificatecompression[RFC8879] and[RFC6066], which defines the "client_certificate_url"extension allowing DTLS clients to send a sequence of UniformResource Locators (URLs) instead of the client certificate.

DTLS stacks SHOULD NOT send more than 10 records in a single transmission.

5.8.4.State machine duplication for post-handshake messages

DTLS 1.3 makes use of the following categories of post-handshake messages:

  1. NewSessionTicket
  2. KeyUpdate
  3. NewConnectionId
  4. RequestConnectionId
  5. Post-handshake client authentication

Messages of each category can be sent independently, and reliability is establishedvia independent state machines each of which behaves as described inSection 5.8.1.For example, if a server sends a NewSessionTicket and a CertificateRequest message,two independent state machines will be created.

As explained in the corresponding sections, sending multiple instances of messages ofa given category without having completed earlier transmissions is allowed for somecategories, but not for others. Specifically, a server MAY send multiple NewSessionTicketmessages at once without awaiting ACKs for earlier NewSessionTicket first. Likewise, aserver MAY send multiple CertificateRequest messages at once without having completedearlier client authentication requests before. In contrast, implementations MUST NOTsend KeyUpdate, NewConnectionId or RequestConnectionId messages if an earlier messageof the same type has not yet been acknowledged.

Note: Except for post-handshake client authentication, which involves handshake messagesin both directions, post-handshake messages are single-flight, and their respective statemachines on the sender side reduce to waiting for an ACK and retransmitting the originalmessage. In particular, note that a RequestConnectionId message does not force the receiverto send a NewConnectionId message in reply, and both messages are therefore treatedindependently.

Creating and correctly updating multiple state machines requires feedback from the handshakelogic to the state machine layer, indicating which message belongs to which state machine.For example, if a server sends multiple CertificateRequest messages and receives a Certificatemessage in response, the corresponding state machine can only be determined after inspecting thecertificate_request_context field. Similarly, a server sending a single CertificateRequestand receiving a NewConnectionId message in response can only decide that the NewConnectionIdmessage should be treated through an independent state machine after inspecting the handshakemessage type.

5.9.CertificateVerify and Finished Messages

CertificateVerify and Finished messages have the same format as inTLS 1.3. Hash calculations include entire handshake messages, includingDTLS-specific fields: message_seq, fragment_offset, andfragment_length. However, in order to remove sensitivity tohandshake message fragmentation, the CertificateVerify and the Finished messages MUST be computed asif each handshake message had been sent as a single fragment followingthe algorithm described in Section 4.4.3 and Section 4.4.4 of[TLS13], respectively.

5.10.Cryptographic Label Prefix

Section 7.1 of[TLS13] specifies that HKDF-Expand-Label usesa label prefix of "tls13 ". For DTLS 1.3, that label SHALL be"dtls13". This ensures key separation between DTLS 1.3 andTLS 1.3. Note that there is no trailing space; this is necessaryin order to keep the overall label size inside of one hashiteration because "DTLS" is one letter longer than "TLS".

5.11.Alert Messages

Note that Alert messages are not retransmitted at all, even when theyoccur in the context of a handshake. However, a DTLS implementationwhich would ordinarily issue an alert SHOULD generate a new alertmessage if the offending record is received again (e.g., as aretransmitted handshake message). Implementations SHOULD detect whena peer is persistently sending bad messages and terminate the localconnection state after such misbehavior is detected. Note that alertsare not reliably transmitted; implementation SHOULD NOT depend onreceiving alerts in order to signal errors or connection closure.

5.12.Establishing New Associations with Existing Parameters

If a DTLS client-server pair is configured in such a way thatrepeated connections happen on the same host/port quartet, then it ispossible that a client will silently abandon one connection and theninitiate another with the same parameters (e.g., after a reboot).This will appear to the server as a new handshake with epoch=0. Incases where a server believes it has an existing association on agiven host/port quartet and it receives an epoch=0 ClientHello, itSHOULD proceed with a new handshake but MUST NOT destroy the existingassociation until the client has demonstrated reachability either bycompleting a cookie exchange or by completing a complete handshakeincluding delivering a verifiable Finished message. After a correctFinished message is received, the server MUST abandon the previousassociation to avoid confusion between two valid associations withoverlapping epochs. The reachability requirement preventsoff-path/blind attackers from destroying associations merely bysending forged ClientHellos.

Note: it is not always possible to distinguish which associationa given record is from. For instance, if the client performsa handshake, abandons the connection, and then immediately startsa new handshake, it may not be possible to tell which connectiona given protected record is for. In these cases, trial decryptionmay be necessary, though implementations could use CIDs to avoidthe 5-tuple-based ambiguity.

6.Example of Handshake with Timeout and Retransmission

The following is an example of a handshake with lost packets andretransmissions. Note that the client sends an empty ACK messagebecause it can only acknowledge Record 2 sent by the server once it hasprocessed messages in Record 0 needed to establish epoch 2 keys, whichare needed to encrypt or decrypt messages found in Record 2.Section 7provides the necessary background details for this interaction.Note: for simplicity we are not re-setting record numbers in thisdiagram, so "Record 1" is really "Epoch 2, Record 0, etc.".

Client                                                Server------                                                ------ Record 0                  --------> ClientHello (message_seq=0)                             X<-----                 Record 0                             (lost)               ServerHello                                              (message_seq=0)                                                     Record 1                                          EncryptedExtensions                                              (message_seq=1)                                                  Certificate                                              (message_seq=2)                           <--------                 Record 2                                            CertificateVerify                                              (message_seq=3)                                                     Finished                                              (message_seq=4) Record 1                  --------> ACK []                           <--------                 Record 3                                                  ServerHello                                              (message_seq=0)                                          EncryptedExtensions                                              (message_seq=1)                                                  Certificate                                              (message_seq=2)                           <--------                 Record 4                                            CertificateVerify                                              (message_seq=3)                                                     Finished                                              (message_seq=4) Record 2                  --------> Certificate (message_seq=1) CertificateVerify (message_seq=2) Finished (message_seq=3)                           <--------               Record 5                                                    ACK [2]
Figure 12:Example DTLS exchange illustrating message loss

6.1.Epoch Values and Rekeying

A recipient of a DTLS message needs to select the correct keying materialin order to process an incoming message. With the possibility of message loss and re-ordering, an identifier is needed to determine which cipher statehas been used to protect the record payload. The epoch value fulfills thisrole in DTLS. In addition to the TLS 1.3-defined key derivation steps, seeSection 7 of[TLS13], a sender may want to rekey at any time duringthe lifetime of the connection. It therefore needs to indicate that it isupdating its sending cryptographic keys.

This version of DTLS assigns dedicated epoch values to messages in theprotocol exchange to allow identification of the correct cipher state:

  • epoch value (0) is used with unencrypted messages. There arethree unencrypted messages in DTLS, namely ClientHello, ServerHello,and HelloRetryRequest.
  • epoch value (1) is used for messages protected using keys derivedfrom client_early_traffic_secret. Note this epoch is skipped ifthe client does not offer early data.
  • epoch value (2) is used for messages protected using keys derivedfrom [sender]_handshake_traffic_secret. Messages transmitted duringthe initial handshake, such as EncryptedExtensions,CertificateRequest, Certificate, CertificateVerify, and Finishedbelong to this category. Note, however, post-handshake areprotected under the appropriate application traffic key and are not included in this category.
  • epoch value (3) is used for payloads protected using keys derivedfrom the initial [sender]_application_traffic_secret_0. This may includehandshake messages, such as post-handshake messages (e.g., aNewSessionTicket message).
  • epoch value (4 to 2^16-1) is used for payloads protected using keys fromthe [sender]_application_traffic_secret_N (N>0).

Using these reserved epoch values a receiver knows what cipher statehas been used to encrypt and integrity protect amessage. Implementations that receive a record with an epoch valuefor which no corresponding cipher state can be determined SHOULDhandle it as a record which fails deprotection.

Note that epoch values do not wrap. If a DTLS implementation wouldneed to wrap the epoch value, it MUST terminate the connection.

The traffic key calculation is described in Section 7.3 of[TLS13].

Figure 13 illustrates the epoch values in an example DTLS handshake.

Client                                             Server------                                             ------ Record 0 ClientHello (epoch=0)                            -------->                                                     Record 0                            <--------       HelloRetryRequest                                                    (epoch=0) Record 1 ClientHello                --------> (epoch=0)                                                     Record 1                            <--------             ServerHello                                                    (epoch=0)                                        {EncryptedExtensions}                                                    (epoch=2)                                                {Certificate}                                                    (epoch=2)                                          {CertificateVerify}                                                    (epoch=2)                                                   {Finished}                                                    (epoch=2) Record 2 {Certificate}              --------> (epoch=2) {CertificateVerify} (epoch=2) {Finished} (epoch=2)                                                     Record 2                            <--------                   [ACK]                                                    (epoch=3) Record 3 [Application Data]         --------> (epoch=3)                                                     Record 3                            <--------      [Application Data]                                                    (epoch=3)                         Some time later ...                 (Post-Handshake Message Exchange)                                                     Record 4                            <--------      [NewSessionTicket]                                                    (epoch=3) Record 4 [ACK]                      --------> (epoch=3)                         Some time later ...                           (Rekeying)                                                     Record 5                            <--------      [Application Data]                                                    (epoch=4) Record 5 [Application Data]         --------> (epoch=4)
Figure 13:Example DTLS exchange with epoch information

7.ACK Message

The ACK message is used by an endpoint to indicate which handshake recordsit has received and processed from the other side. ACK is nota handshake message but is rather a separate content type,with code point TBD (proposed, 25). This avoids having ACK being addedto the handshake transcript. Note that ACKs can still besent in the same UDP datagram as handshake records.

    struct {        RecordNumber record_numbers<0..2^16-1>;    } ACK;
record_numbers:
a list of the records containing handshake messages in the currentflight which the endpoint has received and either processed or buffered,in numerically increasingorder.

Implementations MUST NOT acknowledge records containinghandshake messages or fragments which have not beenprocessed or buffered. Otherwise, deadlock can ensue.As an example, implementations MUST NOT send ACKs forhandshake messages which they discard because they arenot the next expected message.

During the handshake, ACKs only cover the current outstanding flight (this ispossible because DTLS is generally a lockstep protocol). In particular,receiving a message from a handshake flight implicitly acknowledges allmessages from the previous flight(s). Accordingly, an ACKfrom the server would not cover both the ClientHello and the client'sCertificate, because the ClientHello and client Certificate are in differentflights. Implementations can accomplish this by clearing their ACKlist upon receiving the start of the next flight.

After the handshake, ACKs SHOULD be sent once for each receivedand processed handshake record (potentially subject to some delay) and MAYcover more than one flight. This includes records containing messages which arediscarded because a previous copy has been received.

During the handshake, ACK records MUST be sent with an epoch that isequal to or higher than the record which is being acknowledged.Note that some care is required when processing flights spanningmultiple epochs. For instance, if the client receives only the Server Helloand Certificate and wishes to ACK them in a single record,it must do so in epoch 2, as it is required to use an epochgreater than or equal to 2 and cannot yet send with any greaterepoch. Implementations SHOULD simply use the highestcurrent sending epoch, which will generally be the highest available.After the handshake, implementations MUST use the highest availablesending epoch.

7.1.Sending ACKs

When an implementation detects a disruption in the receipt of thecurrent incoming flight, it SHOULD generate an ACK that covers themessages from that flight which it has received and processed so far.Implementations have some discretion about which events to treatas signs of disruption, but it is RECOMMENDED that they generateACKs under two circumstances:

  • When they receive a message or fragment which is out of order,either because it is not the next expected message or becauseit is not the next piece of the current message.
  • When they have received part of a flight and do not immediatelyreceive the rest of the flight (which may be in the same UDPdatagram). "Immediately" is hard to define. One approach is toset a timer for 1/4 the current retransmit timer value whenthe first record in the flight is received and then send anACK when that timer expires. Note: the 1/4 value here is somewhatarbitrary. Given that the round trip estimates in the DTLShandshake are generally very rough (or the default), anyvalue will be an approximation, and there is an inherentcompromise due to competition between retransmision due to over-agressive ACKingand over-aggressive timeout-based retransmission.As a comparison point,QUIC's loss-based recovery algorithms([I-D.ietf-quic-recovery]; Section 6.1.2)work out to a delay of about 1/3 of the retransmit timer.

In general, flights MUST be ACKed unless they are implicitlyacknowledged. In the present specification the following flights are implicitly acknowledgedby the receipt of the next flight, which generally immediately follows the flight,

  1. Handshake flights other than the client's final flight of themain handshake.
  2. The server's post-handshake CertificateRequest.

ACKs SHOULD NOT be sent for these flights unlessthe responding flight cannot be generated immediately.In this case,implementations MAY send explicit ACKs for the complete receivedflight even though it will eventually also be implicitly acknowledgedthrough the responding flight. A notable example for this isthe case of client authentication in constrainedenvironments, where generating the CertificateVerify message cantake considerable time on the client. All other flights MUST be ACKed.Implementations MAY acknowledge the records corresponding to each transmission ofeach flight or simply acknowledge the most recent one. In general,implementations SHOULD ACK as many received packets as can fitinto the ACK record, as this provides the most complete informationand thus reduces the chance of spurious retransmission; if spaceis limited, implementations SHOULD favor including records whichhave not yet been acknowledged.

Note: While some post-handshake messages follow a request/responsepattern, this does not necessarily imply receipt.For example, a KeyUpdate sent in response to a KeyUpdate withrequest_update set to 'update_requested' does not implicitlyacknowledge the earlier KeyUpdate message because the two KeyUpdatemessages might have crossed in flight.

ACKs MUST NOT be sent for other records of any content typeother than handshake or for records which cannot be unprotected.

Note that in some cases it may be necessary to send an ACK whichdoes not contain any record numbers. For instance, a clientmight receive an EncryptedExtensions message prior to receivinga ServerHello. Because it cannot decrypt the EncryptedExtensions,it cannot safely acknowledge it (as it might be damaged). If the clientdoes not send an ACK, the server will eventually retransmitits first flight, but this might take far longer than theactual round trip time between client and server. Havingthe client send an empty ACK shortcuts this process.

7.2.Receiving ACKs

When an implementation receives an ACK, it SHOULD record that themessages or message fragments sent in the records beingACKed were received and omit them from any futureretransmissions. Upon receipt of an ACK that leaves it withonly some messages from a flight having been acknowledgedan implementation SHOULD retransmit the unacknowledgedmessages or fragments. Note that this requires implementations totrack which messages appear in which records. Once all the messages in a flight have beenacknowledged, the implementation MUST cancel all retransmissionsof that flight.Implementations MUST treat a recordas having been acknowledged if it appears in any ACK; thisprevents spurious retransmission in cases where a flight isvery large and the receiver is forced to elide acknowledgementsfor records which have already been ACKed.As noted above, the receipt of any record respondingto a given flight MUST be taken as an implicit acknowledgement for the entireflight to which it is responding.

7.3.Design Rationale

ACK messages are used in two circumstances, namely :

  • on sign of disruption, or lack of progress, and
  • to indicate complete receipt of the last flight in a handshake.

In the first case the use of the ACK message is optional becausethe peer will retransmit in any case and therefore the ACK justallows for selective or early retransmission, as opposed to the timeout-based wholeflight retransmission in previous versions of DTLS. When DTLS 1.3 is used in deploymentswith lossy networks, such as low-power, long range radio networks as well aslow-power mesh networks, the use of ACKs is recommended.

The use of the ACK for the second case is mandatory for the proper functioning of theprotocol. For instance, the ACK message sent by the client in Figure 13,acknowledges receipt and processing of record 4 (containing the NewSessionTicketmessage) and if it is not sent the server will continue retransmissionof the NewSessionTicket indefinitely until its maximum retransmission count is reached.

8.Key Updates

As with TLS 1.3, DTLS 1.3 implementations send a KeyUpdate message toindicate that they are updating their sending keys. As with otherhandshake messages with no built-in response, KeyUpdates MUST beacknowledged. In order to facilitate epoch reconstructionSection 4.2.2 implementations MUST NOT send records with the new keys orsend a new KeyUpdate until the previous KeyUpdate has beenacknowledged (this avoids having too many epochs in active use).

Due to loss and/or re-ordering, DTLS 1.3 implementationsmay receive a record with an older epoch than thecurrent one (the requirements above preclude receivinga newer record). They SHOULD attempt to process those recordswith that epoch (seeSection 4.2.2 for informationon determining the correct epoch), but MAY opt to discardsuch out-of-epoch records.

Due to the possibility of an ACK message for a KeyUpdate being lost and therebypreventing the sender of the KeyUpdate from updating its keying material,receivers MUST retain the pre-update keying material until receipt and successfuldecryption of a message using the new keys.

Figure 14 shows an example exchange illustrating that a successfulACK processing updates the keys of the KeyUpdate message sender, which isreflected in the change of epoch values.

Client                                             Server      /-------------------------------------------\     |                                             |     |             Initial Handshake               |      \-------------------------------------------/ [Application Data]         --------> (epoch=3)                            <--------      [Application Data]                                                    (epoch=3)      /-------------------------------------------\     |                                             |     |              Some time later ...            |      \-------------------------------------------/ [Application Data]         --------> (epoch=3) [KeyUpdate] (+ update_requested        --------> (epoch 3)                            <--------      [Application Data]                                                    (epoch=3)                                                        [Ack]                            <--------               (epoch=3) [Application Data] (epoch=4)                  -------->                            <--------             [KeyUpdate]                                                    (epoch=3) [Ack]                      --------> (epoch=4)                            <--------      [Application Data]                                                    (epoch=4)
Figure 14:Example DTLS Key Update

9.Connection ID Updates

If the client and server have negotiated the "connection_id"extension[I-D.ietf-tls-dtls-connection-id], either sidecan send a new CID which it wishes the other side to usein a NewConnectionId message.

    enum {        cid_immediate(0), cid_spare(1), (255)    } ConnectionIdUsage;    opaque ConnectionId<0..2^8-1>;    struct {        ConnectionIds cids<0..2^16-1>;        ConnectionIdUsage usage;    } NewConnectionId;
cid
Indicates the set of CIDs which the sender wishes the peer to use.
usage
Indicates whether the new CIDs should be used immediately or arespare. If usage is set to "cid_immediate", then one of the new CIDMUST be used immediately for all future records. If it is set to"cid_spare", then either existing or new CID MAY be used.

Endpoints SHOULD use receiver-provided CIDs in the order they were provided.Implementations which receive more spare CIDs than they wish to maintainMAY simply discard any extra CIDs.Endpoints MUST NOT have more than one NewConnectionId message outstanding.

Implementations which either did not negotiate the "connection_id" extensionor which have negotiated receiving an empty CID MUST NOTsend NewConnectionId. Implementations MUST NOT send RequestConnectionIdwhen sending an empty Connection ID. Implementations which detect a violationof these rules MUST terminate the connection with an "unexpected_message"alert.

Implementations SHOULD use a new CID whenever sending on a new path,and SHOULD request new CIDs for this purpose if path changes are anticipated.

    struct {      uint8 num_cids;    } RequestConnectionId;
num_cids
The number of CIDs desired.

Endpoints SHOULD respond to RequestConnectionId by sending aNewConnectionId with usage "cid_spare" containing num_cid CIDs soon aspossible. Endpoints MUST NOT send a RequestConnectionId messagewhen an existing request is still unfulfilled; this implies thatendpoints needs to request new CIDs well in advance. An endpoint MAYhandle requests, which it considers excessive, by responding witha NewConnectionId message containing fewer than num_cid CIDs,including no CIDs at all. Endpoints MAY handle an excessive numberof RequestConnectionId messages by terminating the connectionusing a "too_many_cids_requested" (alert number 52) alert.

Endpoints MUST NOT send either of these messages if they did not negotiate aCID. If an implementation receives these messages when CIDswere not negotiated, it MUST abort the connection with an unexpected_messagealert.

9.1.Connection ID Example

Below is an example exchange for DTLS 1.3 using a singleCID in each direction.

Note: The connection_id extension is defined in[I-D.ietf-tls-dtls-connection-id], which is usedin ClientHello and ServerHello messages.

Client                                             Server------                                             ------ClientHello(connection_id=5)                            -------->                            <--------       HelloRetryRequest                                                     (cookie)ClientHello                 -------->(connection_id=5)  +cookie                            <--------             ServerHello                                          (connection_id=100)                                          EncryptedExtensions                                                      (cid=5)                                                  Certificate                                                      (cid=5)                                            CertificateVerify                                                      (cid=5)                                                     Finished                                                      (cid=5)Certificate                -------->(cid=100)CertificateVerify(cid=100)Finished(cid=100)                           <--------                      Ack                                                      (cid=5)Application Data           ========>(cid=100)                           <========         Application Data                                                      (cid=5)
Figure 15:Example DTLS 1.3 Exchange with CIDs

If no CID is negotiated, then the receiver MUST reject anyrecords it receives that contain a CID.

10.Application Data Protocol

Application data messages are carried by the record layer and are splitinto recordsand encrypted based on the current connection state. The messagesare treated as transparent data to the record layer.

11.Security Considerations

Security issues are discussed primarily in[TLS13].

The primary additional security consideration raised by DTLS is thatof denial of service by excessive resource consumption. DTLS includes a cookie exchange designed toprotect against denial of service. However, implementations that donot use this cookie exchange are still vulnerable to DoS. Inparticular, DTLS servers that do not use the cookie exchange may beused as attack amplifiers even if they themselves are notexperiencing DoS. Therefore, DTLS servers SHOULD use the cookieexchange unless there is good reason to believe that amplification isnot a threat in their environment. Clients MUST be prepared to do acookie exchange with every handshake.

Some key properties required of the cookie for the cookie-exchange mechanismto be functional are described in Section 3.3 of[RFC2522]:

  • the cookie MUST depend on the client's address.
  • it MUST NOT be possible for anyone other than the issuing entity to generatecookies that are accepted as valid by that entity. This typically entailsan integrity check based on a secret key.
  • cookie generation and verification are triggered by unauthenticated parties,and as such their resource consumption needs to be restrained in order toavoid having the cookie-exchange mechanism itself serve as a DoS vector.

Although the cookie must allow the server to produce the right handshaketranscript, it SHOULD be constructed so that knowledge of the cookieis insufficient to reproduce the ClientHello contents. Otherwise,this may create problems with future extensions such as[I-D.ietf-tls-esni].

When cookies are generated using a keyed authentication mechanismit should be possible to rotate the associatedsecret key, so that temporary compromise of the key does not permanentlycompromise the integrity of the cookie-exchange mechanism. Though this secretis not as high-value as, e.g., a session-ticket-encryption key, rotating thecookie-generation key on a similar timescale would ensure that thekey-rotation functionality is exercised regularly and thus in working order.

The cookie exchange provides address validation during the initial handshake.DTLS with Connection IDs allows for endpoint addresses to change during theassociation; any such updated addresses are not covered by the cookie exchangeduring the handshake.DTLS implementations MUST NOT update the address they send to in responseto packets from a different address unless they first perform somereachability test; no such test is defined in this specification. Evenwith such a test, an active on-path adversary can also black-hole traffic orcreate a reflection attack against third parties because a DTLS peerhas no means to distinguish a genuine address update event (forexample, due to a NAT rebinding) from one that is malicious. Thisattack is of concern when there is a large asymmetry ofrequest/response message sizes.

With the exception of order protection and non-replayability, the securityguarantees for DTLS 1.3 are the same as TLS 1.3. While TLS always providesorder protection and non-replayability, DTLS does not provide order protectionand may not provide replay protection.

Unlike TLS implementations, DTLS implementations SHOULD NOT respondto invalid records by terminating the connection.

TLS 1.3 requires replay protection for 0-RTT data (or rather, for connectionsthat use 0-RTT data; see Section 8 of[TLS13]). DTLS provides an optionalper-record replay-protection mechanism, since datagram protocols areinherently subject to message reordering and replay. These tworeplay-protection mechanisms are orthogonal, and neither mechanism meets therequirements for the other.

The security and privacy properties of the CID for DTLS 1.3 buildson top of what is described for DTLS 1.2 in[I-D.ietf-tls-dtls-connection-id]. There are,however, several differences:

  • In both versions of DTLS extension negotiation is used to agree on the use of the CIDfeature and the CID values. In both versions the CID is carried in the DTLS record header (if negotiated).However, the way the CID is included in the record header differs between the two versions.
  • The use of the Post-Handshake message allows the client and the serverto update their CIDs and those values are exchanged with confidentialityprotection.
  • The ability to use multiple CIDs allows for improved privacy propertiesin multi-homed scenarios. When only a single CID is in use on multiplepaths from such a host, an adversary can correlate the communicationinteraction across paths, which adds further privacy concerns. In orderto prevent this, implementations SHOULD attempt to use fresh CIDswhenever they change local addresses or ports (though this is not alwayspossible to detect). The RequestConnectionId message can be used by a peerto ask for new CIDs to ensure that a pool of suitable CIDs is available.
  • The mechanism for encrypting sequence numbers (Section 4.2.3) preventstrivial tracking by on-path adversaries that attempt to correlate thepattern of sequence numbers received on different paths; such trackingcould occur even when different CIDs are used on each path, in theabsence of sequence number encryption. Switching CIDs based on certainevents, or even regularly, helps against tracking by on-pathadversaries. Note that sequence number encryption is used for allencrypted DTLS 1.3 records irrespective of whether a CID is used ornot. Unlike the sequence number, the epoch is not encrypted because it acts as a key identifier, whichmay improve correlation of packets from a single connection acrossdifferent network paths.
  • DTLS 1.3 encrypts handshake messages much earlier than in previousDTLS versions. Therefore, less information identifying the DTLS client, such asthe client certificate, is available to an on-path adversary.

12.Changes since DTLS 1.2

Since TLS 1.3 introduces a large number of changes with respect to TLS 1.2, the listof changes from DTLS 1.2 to DTLS 1.3 is equally large. For this reasonthis section focuses on the most important changes only.

  • New handshake pattern, which leads to a shorter message exchange
  • Only AEAD ciphers are supported. Additional data calculation has been simplified.
  • Removed support for weaker and older cryptographic algorithms
  • HelloRetryRequest of TLS 1.3 used instead of HelloVerifyRequest
  • More flexible ciphersuite negotiation
  • New session resumption mechanism
  • PSK authentication redefined
  • New key derivation hierarchy utilizing a new key derivation construct
  • Improved version negotiation
  • Optimized record layer encoding and thereby its size
  • Added CID functionality
  • Sequence numbers are encrypted.

13.Updates affecting DTLS 1.2

This document defines several changes that optionally affectimplementations of DTLS 1.2, including those which do not also supportDTLS 1.3.

  • A version downgrade protection mechanism as describedin[TLS13]; Section 4.1.3 and applying to DTLS asdescribed inSection 5.3.
  • The updates described in[TLS13]; Section 3.
  • The new compliance requirements described in[TLS13]; Section 9.3.

14.IANA Considerations

IANA is requested to allocate a new value in the "TLS ContentType"registry for the ACK message, defined inSection 7, with content type 26.The value for the "DTLS-OK" column is "Y". IANA is requested to reservethe content type range 32-63 so that content types in this range are notallocated.

IANA is requested to allocate "the too_many_cids_requested" alert inthe "TLS Alerts" registry with value 52.

IANA is requested to allocate two values in the "TLS Handshake Type"registry, defined in[TLS13], for RequestConnectionId (TBD), andNewConnectionId (TBD), as defined in this document. The value for the"DTLS-OK" columns are "Y".

IANA is requested to add this RFC as a reference to the TLS Cipher Suite Registryalong with the following Note:

Any TLS cipher suite that is specified for use with DTLS MUSTdefine limits on the use of the associated AEAD function thatpreserves margins for both confidentiality and integrity,as specified in [THIS RFC; Section TODO]

15.References

15.1.Normative References

[CHACHA]
Nir, Y. andA. Langley,"ChaCha20 and Poly1305 for IETF Protocols",RFC 8439,DOI 10.17487/RFC8439,,<https://www.rfc-editor.org/info/rfc8439>.
[I-D.ietf-tls-dtls-connection-id]
Rescorla, E.,Tschofenig, H.,Fossati, T., andA. Kraus,"Connection Identifiers for DTLS 1.2",Work in Progress,Internet-Draft, draft-ietf-tls-dtls-connection-id-11,,<https://www.ietf.org/internet-drafts/draft-ietf-tls-dtls-connection-id-11.txt>.
[RFC0768]
Postel, J.,"User Datagram Protocol",STD 6,RFC 768,DOI 10.17487/RFC0768,,<https://www.rfc-editor.org/info/rfc768>.
[RFC0793]
Postel, J.,"Transmission Control Protocol",STD 7,RFC 793,DOI 10.17487/RFC0793,,<https://www.rfc-editor.org/info/rfc793>.
[RFC1191]
Mogul, J. andS. Deering,"Path MTU discovery",RFC 1191,DOI 10.17487/RFC1191,,<https://www.rfc-editor.org/info/rfc1191>.
[RFC2119]
Bradner, S.,"Key words for use in RFCs to Indicate Requirement Levels",BCP 14,RFC 2119,DOI 10.17487/RFC2119,,<https://www.rfc-editor.org/info/rfc2119>.
[RFC4443]
Conta, A.,Deering, S., andM. Gupta, Ed.,"Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification",STD 89,RFC 4443,DOI 10.17487/RFC4443,,<https://www.rfc-editor.org/info/rfc4443>.
[RFC4821]
Mathis, M. andJ. Heffner,"Packetization Layer Path MTU Discovery",RFC 4821,DOI 10.17487/RFC4821,,<https://www.rfc-editor.org/info/rfc4821>.
[RFC6298]
Paxson, V.,Allman, M.,Chu, J., andM. Sargent,"Computing TCP's Retransmission Timer",RFC 6298,DOI 10.17487/RFC6298,,<https://www.rfc-editor.org/info/rfc6298>.
[RFC8174]
Leiba, B.,"Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words",BCP 14,RFC 8174,DOI 10.17487/RFC8174,,<https://www.rfc-editor.org/info/rfc8174>.
[TLS13]
Rescorla, E.,"The Transport Layer Security (TLS) Protocol Version 1.3",RFC 8446,DOI 10.17487/RFC8446,,<https://www.rfc-editor.org/info/rfc8446>.

15.2.Informative References

[AEBounds]
Luykx, A. andK. Paterson,"Limits on Authenticated Encryption Use in TLS",,<http://www.isg.rhul.ac.uk/~kp/TLS-AEbounds.pdf>.
[CCM-ANALYSIS]
Jonsson, J.,"On the Security of CTR + CBC-MAC",Selected Areas in Cryptography pp. 76-93,DOI 10.1007/3-540-36492-7_7,,<https://doi.org/10.1007/3-540-36492-7_7>.
[DEPRECATE]
Moriarty, K. andS. Farrell,"Deprecating TLSv1.0 and TLSv1.1",Work in Progress,Internet-Draft, draft-ietf-tls-oldversions-deprecate-12,,<http://www.ietf.org/internet-drafts/draft-ietf-tls-oldversions-deprecate-12.txt>.
[I-D.ietf-quic-recovery]
Iyengar, J. andI. Swett,"QUIC Loss Detection and Congestion Control",Work in Progress,Internet-Draft, draft-ietf-quic-recovery-34,,<https://www.ietf.org/internet-drafts/draft-ietf-quic-recovery-34.txt>.
[I-D.ietf-tls-esni]
Rescorla, E.,Oku, K.,Sullivan, N., andC. Wood,"TLS Encrypted Client Hello",Work in Progress,Internet-Draft, draft-ietf-tls-esni-10,,<https://www.ietf.org/internet-drafts/draft-ietf-tls-esni-10.txt>.
[I-D.ietf-uta-tls13-iot-profile]
Tschofenig, H. andT. Fossati,"TLS/DTLS 1.3 Profiles for the Internet of Things",Work in Progress,Internet-Draft, draft-ietf-uta-tls13-iot-profile-01,,<https://www.ietf.org/internet-drafts/draft-ietf-uta-tls13-iot-profile-01.txt>.
[RFC2522]
Karn, P. andW. Simpson,"Photuris: Session-Key Management Protocol",RFC 2522,DOI 10.17487/RFC2522,,<https://www.rfc-editor.org/info/rfc2522>.
[RFC4303]
Kent, S.,"IP Encapsulating Security Payload (ESP)",RFC 4303,DOI 10.17487/RFC4303,,<https://www.rfc-editor.org/info/rfc4303>.
[RFC4340]
Kohler, E.,Handley, M., andS. Floyd,"Datagram Congestion Control Protocol (DCCP)",RFC 4340,DOI 10.17487/RFC4340,,<https://www.rfc-editor.org/info/rfc4340>.
[RFC4346]
Dierks, T. andE. Rescorla,"The Transport Layer Security (TLS) Protocol Version 1.1",RFC 4346,DOI 10.17487/RFC4346,,<https://www.rfc-editor.org/info/rfc4346>.
[RFC4347]
Rescorla, E. andN. Modadugu,"Datagram Transport Layer Security",RFC 4347,DOI 10.17487/RFC4347,,<https://www.rfc-editor.org/info/rfc4347>.
[RFC4960]
Stewart, R., Ed.,"Stream Control Transmission Protocol",RFC 4960,DOI 10.17487/RFC4960,,<https://www.rfc-editor.org/info/rfc4960>.
[RFC5238]
Phelan, T.,"Datagram Transport Layer Security (DTLS) over the Datagram Congestion Control Protocol (DCCP)",RFC 5238,DOI 10.17487/RFC5238,,<https://www.rfc-editor.org/info/rfc5238>.
[RFC5246]
Dierks, T. andE. Rescorla,"The Transport Layer Security (TLS) Protocol Version 1.2",RFC 5246,DOI 10.17487/RFC5246,,<https://www.rfc-editor.org/info/rfc5246>.
[RFC5763]
Fischl, J.,Tschofenig, H., andE. Rescorla,"Framework for Establishing a Secure Real-time Transport Protocol (SRTP) Security Context Using Datagram Transport Layer Security (DTLS)",RFC 5763,DOI 10.17487/RFC5763,,<https://www.rfc-editor.org/info/rfc5763>.
[RFC5764]
McGrew, D. andE. Rescorla,"Datagram Transport Layer Security (DTLS) Extension to Establish Keys for the Secure Real-time Transport Protocol (SRTP)",RFC 5764,DOI 10.17487/RFC5764,,<https://www.rfc-editor.org/info/rfc5764>.
[RFC6066]
Eastlake 3rd, D.,"Transport Layer Security (TLS) Extensions: Extension Definitions",RFC 6066,DOI 10.17487/RFC6066,,<https://www.rfc-editor.org/info/rfc6066>.
[RFC6347]
Rescorla, E. andN. Modadugu,"Datagram Transport Layer Security Version 1.2",RFC 6347,DOI 10.17487/RFC6347,,<https://www.rfc-editor.org/info/rfc6347>.
[RFC7296]
Kaufman, C.,Hoffman, P.,Nir, Y.,Eronen, P., andT. Kivinen,"Internet Key Exchange Protocol Version 2 (IKEv2)",STD 79,RFC 7296,DOI 10.17487/RFC7296,,<https://www.rfc-editor.org/info/rfc7296>.
[RFC7525]
Sheffer, Y.,Holz, R., andP. Saint-Andre,"Recommendations for Secure Use of Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)",BCP 195,RFC 7525,DOI 10.17487/RFC7525,,<https://www.rfc-editor.org/info/rfc7525>.
[RFC7924]
Santesson, S. andH. Tschofenig,"Transport Layer Security (TLS) Cached Information Extension",RFC 7924,DOI 10.17487/RFC7924,,<https://www.rfc-editor.org/info/rfc7924>.
[RFC7983]
Petit-Huguenin, M. andG. Salgueiro,"Multiplexing Scheme Updates for Secure Real-time Transport Protocol (SRTP) Extension for Datagram Transport Layer Security (DTLS)",RFC 7983,DOI 10.17487/RFC7983,,<https://www.rfc-editor.org/info/rfc7983>.
[RFC8201]
McCann, J.,Deering, S.,Mogul, J., andR. Hinden, Ed.,"Path MTU Discovery for IP version 6",STD 87,RFC 8201,DOI 10.17487/RFC8201,,<https://www.rfc-editor.org/info/rfc8201>.
[RFC8445]
Keranen, A.,Holmberg, C., andJ. Rosenberg,"Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal",RFC 8445,DOI 10.17487/RFC8445,,<https://www.rfc-editor.org/info/rfc8445>.
[RFC8879]
Ghedini, A. andV. Vasiliev,"TLS Certificate Compression",RFC 8879,DOI 10.17487/RFC8879,,<https://www.rfc-editor.org/info/rfc8879>.
[ROBUST]
Fischlin, M.,Günther, F., andC. Janson,"Robust Channels: Handling Unreliable Networks in the Record Layers of QUIC and DTLS 1.3",,<https://eprint.iacr.org/2020/718>.

Appendix A.Protocol Data Structures and Constant Values

This section provides the normative protocol types and constants definitions.

A.1.Record Layer

struct {    ContentType type;    ProtocolVersion legacy_record_version;    uint16 epoch = 0    uint48 sequence_number;    uint16 length;    opaque fragment[DTLSPlaintext.length];} DTLSPlaintext;struct {     opaque content[DTLSPlaintext.length];     ContentType type;     uint8 zeros[length_of_padding];} DTLSInnerPlaintext;struct {    opaque unified_hdr[variable];    opaque encrypted_record[length];} DTLSCiphertext;0 1 2 3 4 5 6 7+-+-+-+-+-+-+-+-+|0|0|1|C|S|L|E E|+-+-+-+-+-+-+-+-+| Connection ID |   Legend:| (if any,      |/  length as    /   C   - Connection ID (CID) present|  negotiated)  |   S   - Sequence number length+-+-+-+-+-+-+-+-+   L   - Length present|  8 or 16 bit  |   E   - Epoch|Sequence Number|+-+-+-+-+-+-+-+-+| 16 bit Length || (if present)  |+-+-+-+-+-+-+-+-+struct {    uint16 epoch;    uint48 sequence_number;} RecordNumber;

A.2.Handshake Protocol

enum {    hello_request_RESERVED(0),    client_hello(1),    server_hello(2),    hello_verify_request_RESERVED(3),    new_session_ticket(4),    end_of_early_data(5),    hello_retry_request_RESERVED(6),    encrypted_extensions(8),    certificate(11),    server_key_exchange_RESERVED(12),    certificate_request(13),    server_hello_done_RESERVED(14),    certificate_verify(15),    client_key_exchange_RESERVED(16),    finished(20),    certificate_url_RESERVED(21),    certificate_status_RESERVED(22),    supplemental_data_RESERVED(23),    key_update(24),    message_hash(254),    (255)} HandshakeType;struct {    HandshakeType msg_type;    /* handshake type */    uint24 length;             /* bytes in message */    uint16 message_seq;        /* DTLS-required field */    uint24 fragment_offset;    /* DTLS-required field */    uint24 fragment_length;    /* DTLS-required field */    select (msg_type) {        case client_hello:          ClientHello;        case server_hello:          ServerHello;        case end_of_early_data:     EndOfEarlyData;        case encrypted_extensions:  EncryptedExtensions;        case certificate_request:   CertificateRequest;        case certificate:           Certificate;        case certificate_verify:    CertificateVerify;        case finished:              Finished;        case new_session_ticket:    NewSessionTicket;        case key_update:            KeyUpdate;    } body;} Handshake;uint16 ProtocolVersion;opaque Random[32];uint8 CipherSuite[2];    /* Cryptographic suite selector */struct {    ProtocolVersion legacy_version = { 254,253 }; // DTLSv1.2    Random random;    opaque legacy_session_id<0..32>;    opaque legacy_cookie<0..2^8-1>;                  // DTLS    CipherSuite cipher_suites<2..2^16-2>;    opaque legacy_compression_methods<1..2^8-1>;    Extension extensions<8..2^16-1>;} ClientHello;

A.3.ACKs

struct {    RecordNumber record_numbers<0..2^16-1>;} ACK;

A.4.Connection ID Management

enum {    cid_immediate(0), cid_spare(1), (255)} ConnectionIdUsage;opaque ConnectionId<0..2^8-1>;struct {    ConnectionIds cids<0..2^16-1>;    ConnectionIdUsage usage;} NewConnectionId;struct {  uint8 num_cids;} RequestConnectionId;

Appendix B.Analysis of Limits on CCM Usage

TLS[TLS13] and[AEBounds] do not specify limits on key usage forAEAD_AES_128_CCM. However, any AEAD that is used with DTLS requires limits onuse that ensure that both confidentiality and integrity are preserved. Thissection documents that analysis for AEAD_AES_128_CCM.

[CCM-ANALYSIS] is used as the basis of thisanalysis. The results of that analysis are used to derive usage limits that arebased on those chosen in[TLS13].

This analysis uses symbols for multiplication (*), division (/), andexponentiation (^), plus parentheses for establishing precedence. The followingsymbols are also used:

t:
The size of the authentication tag in bits. For this cipher, t is 128.
n:
The size of the block function in bits. For this cipher, n is 128.
l:
The number of blocks in each packet (see below).
q:
The number of genuine packets created and protected by endpoints. This valueis the bound on the number of packets that can be protected before updatingkeys.
v:
The number of forged packets that endpoints will accept. This value is thebound on the number of forged packets that an endpoint can reject beforeupdating keys.

The analysis of AEAD_AES_128_CCM relies on a count of the number of blockoperations involved in producing each message. For simplicity, and to match theanalysis of other AEAD functions in[AEBounds], this analysis assumes apacket length of 2^10 blocks and a packet size limit of 2^14 bytes.

For AEAD_AES_128_CCM, the total number of block cipher operations is the sumof: the length of the associated data in blocks, the length of the ciphertextin blocks, and the length of the plaintext in blocks, plus 1. In this analysis,this is simplified to a value of twice the maximum length of a record in blocks(that is,2l = 2^11). This simplification is based on the associated databeing limited to one block.

B.1.Confidentiality Limits

For confidentiality, Theorem 2 in[CCM-ANALYSIS] establishes that an attackergains a distinguishing advantage over an ideal pseudorandom permutation (PRP) ofno more than:

(2l * q)^2 / 2^n

For a target advantage of 2^-60, which matches that used by[TLS13], thisresults in the relation:

q <= 2^23

That is, endpoints cannot protect more than 2^23 packets with the same set ofkeys without causing an attacker to gain an larger advantage than the target of2^-60.

B.2.Integrity Limits

For integrity, Theorem 1 in[CCM-ANALYSIS] establishes that an attackergains an advantage over an ideal PRP of no more than:

v / 2^t + (2l * (v + q))^2 / 2^n

The goal is to limit this advantage to 2^-57, to match the target in[TLS13]. Ast andn are both 128, the first term is negligible relativeto the second, so that term can be removed without a significant effect on theresult. This produces the relation:

v + q <= 2^24.5

Using the previously-established value of 2^23 forq and rounding, this leadsto an upper limit onv of 2^23.5. That is, endpoints cannot attempt toauthenticate more than 2^23.5 packets with the same set of keys without causingan attacker to gain an larger advantage than the target of 2^-57.

B.3.Limits for AEAD_AES_128_CCM_8

The TLS_AES_128_CCM_8_SHA256 cipher suite uses the AEAD_AES_128_CCM_8 function,which uses a short authentication tag (that is, t=64).

The confidentiality limits of AEAD_AES_128_CCM_8 are the same as those forAEAD_AES_128_CCM, as this does not depend on the tag length; seeAppendix B.1.

The shorter tag length of 64 bits means that the simplification used inAppendix B.2 does not apply to AEAD_AES_128_CCM_8. If the goal is topreserve the same margins as other cipher suites, then the limit on forgeriesis largely dictated by the first term of the advantage formula:

v <= 2^7

As this represents attempts to fail authentication, applying this limit mightbe feasible in some environments. However, applying this limit in animplementation intended for general use exposes connections to an inexpensivedenial of service attack.

This analysis supports the view that TLS_AES_128_CCM_8_SHA256 is not suitablefor general use. Specifically, TLS_AES_128_CCM_8_SHA256 cannot be used withoutadditional measures to prevent forgery of records, or to mitigate the effect offorgeries. This might require understanding the constraints that exist in aparticular deployment or application. For instance, it might be possible to seta different target for the advantage an attacker gains based on anunderstanding of the constraints imposed on a specific usage of DTLS.

Appendix C.Implementation Pitfalls

In addition to the aspects of TLS that have been a source of interoperabilityand security problems (Section C.3 of[TLS13]), DTLS presents a few newpotential sources of issues, noted here.

  • Do you correctly handle messages received from multiple epochs during a keytransition? This includes locating the correct key as well as performingreplay detection, if enabled.
  • Do you retransmit handshake messages that are not (implicitly or explicitly)acknowledged (Section 5.8)?
  • Do you correctly handle handshake message fragments received, includingwhen they are out of order?
  • Do you correctly handle handshake messages received out of order?This may include either buffering or discarding them.
  • Do you limit how much data you send to a peer before its address isvalidated?
  • Do you verify that the explicit record length is contained within thedatagram in which it is contained?

Appendix D.History

RFC EDITOR: PLEASE REMOVE THE THIS SECTION

(*) indicates a change that may affect interoperability.

IETF Draftsdraft-42

  • SHOULD level requirement for the client to offer CIDextension.
  • Change the default retransmission timer to 1s andallow people to do otherwise if they have side knowledge.
  • Cap any given flight to 10 records
  • Don't re-set the timer to the initial value but to 1.5times the measured RTT.
  • A bunch more clarity about the reliability algorithmsand timers (including changing reset to re-arm)
  • Update IANA considerations

draft-40

   - Clarified encrypted_record structure in DTLS 1.3 record layer   - Added description of the demultiplexing process   - Added text about the DTLS 1.2 and DTLS 1.3 CID mechanism   - Forbid going from an empty CID to a non-empty CID (*)   - Add warning about certificates and congestion   - Use DTLS style version values, even for DTLS 1.3 (*)   - Describe how to distinguish DTLS 1.2 and DTLS 1.3 connections   - Updated examples   - Included editorial improvements from Ben Kaduk   - Removed stale text about out-of-epoch records   - Added clarifications around when ACKs are sent   - Noted that alerts are unreliable   - Clarify when you can reset the timer   - Indicated that records with bogus epochs should be discarded   - Relax age out text   - Updates to cookie text   - Require that cipher suites define a record number encryption algorithm   - Clean up use of connection and association   - Reference tls-old-versions-deprecate

draft-39- Updated Figure 4 due to misalignment with Figure 3 content

draft-38- Ban implicit Connection IDs (*)- ACKs are processed as the union.

draft-37:- Fix the other place where we have ACK.

draft-36:- Some editorial changes.- Changed the content type to not conflict with existing allocations (*)

draft-35:- I-D.ietf-tls-dtls-connection-id became a normative reference- Removed duplicate reference to I-D.ietf-tls-dtls-connection-id.- Fix figure 11 to have the right numbers andno cookie in message 1.- Clarify when you can ACK.- Clarify additional data computation.

draft-33:- Key separation between TLS and DTLS. Issue #72.

draft-32:- Editorial improvements and clarifications.

draft-31:- Editorial improvements in text and figures.- Added normative reference to ChaCha20 and Poly1305.

draft-30:- Changed record format- Added text about end of early data- Changed format of the Connection ID Update message- Added Appendix A "Protocol Data Structures and Constant Values"

draft-29:- Added support for sequence number encryption- Update to new record format- Emphasize that compatibility mode isn't used.

draft-28:- Version bump to align with TLS 1.3 pre-RFC version.

draft-27:- Incorporated unified header format.- Added support for CIDs.

draft-04 - 26:- Submissions to align with TLS 1.3 draft versions

draft-03- Only update keys after KeyUpdate is ACKed.

draft-02- Shorten the protected record header and introduce an ultra-short version of the record header.- Reintroduce KeyUpdate, which works properly now that we have ACK.- Clarify the ACK rules.

draft-01- Restructured the ACK to contain a list of records and also be a record rather than a handshake message.

draft-00- First IETF Draft

Personal Draftsdraft-01- Alignment with version -19 of the TLS 1.3 specification

draft-00

  • Initial version using TLS 1.3 as a baseline.
  • Use of epoch values instead of KeyUpdate message
  • Use of cookie extension instead of cookie field inClientHello and HelloVerifyRequest messages
  • Added ACK message
  • Text about sequence number handling

Appendix E.Working Group Information

RFC EDITOR: PLEASE REMOVE THIS SECTION.

The discussion list for the IETF TLS working group is located at the e-mailaddresstls@ietf.org. Information on the group and information on how tosubscribe to the list is athttps://www1.ietf.org/mailman/listinfo/tls

Archives of the list can be found at:https://www.ietf.org/mail-archive/web/tls/current/index.html

Appendix F.Contributors

Many people have contributed to previous DTLS versions and they are acknowledgedin prior versions of DTLS specifications or in the referenced specifications. Thesequence number encryption concept is taken from the QUIC specification. We wouldlike to thank the authors of the QUIC specification for their work. FelixGuenther and Martin Thomson contributed the analysis inAppendix B.

In addition, we would like to thank:

* David Benjamin  Google  davidben@google.com
* Thomas Fossati  Arm Limited  Thomas.Fossati@arm.com
* Tobias Gondrom  Huawei  tobias.gondrom@gondrom.org
* Felix Günther  ETH Zurich  mail@felixguenther.info
* Benjamin Kaduk  Akamai Technologies  kaduk@mit.edu
* Ilari Liusvaara  Independent  ilariliusvaara@welho.com
* Martin Thomson  Mozilla  martin.thomson@gmail.com
* Christopher A. Wood  Apple Inc.  cawood@apple.com
* Yin Xinxing  Huawei  yinxinxing@huawei.com
* Hanno Becker  Arm Limited  Hanno.Becker@arm.com

Appendix G.Acknowledgements

We would like to thank Jonathan Hammell, Bernard Aboba and Andy Cunningham for their review comments.

Additionally, we would like to thank the IESG members for their review comments: Martin Duke, Erik Kline, Francesca Palombini, Lars Eggert, Zaheduzzaman Sarker, John Scudder, Eric Vyncke, Robert Wilton, Roman Danyliw, Benjamin Kaduk, Murray Kucherawy, Martin Vigoureux, and Alvaro Retana

Authors' Addresses

Eric Rescorla
RTFM, Inc.
Hannes Tschofenig
Arm Limited
Nagendra Modadugu
Google, Inc.
Datatracker

draft-ietf-tls-dtls13-43

This is an older version of an Internet-Draft that was ultimately published asRFC 9147.

DocumentDocument type
This is an older version of an Internet-Draft that was ultimately published asRFC 9147.
Select version
Compare versions
AuthorsEric Rescorla,Hannes Tschofenig,Nagendra Modadugu
Email authors
Replacesdraft-rescorla-tls-dtls13
RFC streamIETF LogoIETF Logo
Intended RFC status Proposed Standard
Other formats
Additional resources GitHub Repository
Mailing list discussion
Report a datatracker bug

[8]ページ先頭

©2009-2026 Movatter.jp