idnits 2.17.1 draft-ietf-tls-dtls-connection-id-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack a Security Considerations section. -- The draft header indicates that this document obsoletes RFC6347, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to contain a disclaimer for pre-RFC5378 work, but was first submitted on or after 10 November 2008. The disclaimer is usually necessary only for documents that revise or obsolete older RFCs, and that take significant amounts of text from those RFCs. If you can contact all authors of the source material and they are willing to grant the BCP78 rights to the IETF Trust, you can and should remove the disclaimer. Otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (December 27, 2017) is 2311 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'ChangeCipherSpec' is mentioned on line 354, but not defined -- Looks like a reference, but probably isn't: '1' on line 461 == Outdated reference: A later version (-43) exists of draft-ietf-tls-dtls13-22 ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) ** Obsolete normative reference: RFC 6347 (Obsoleted by RFC 9147) Summary: 3 errors (**), 0 flaws (~~), 4 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 TLS E. Rescorla, Ed. 3 Internet-Draft RTFM, Inc. 4 Obsoletes: 6347 (if approved) H. Tschofenig, Ed. 5 Intended status: Standards Track ARM Limited 6 Expires: June 30, 2018 T. Fossati 7 Nokia 8 T. Gondrom 9 Huawei 10 December 27, 2017 12 The Datagram Transport Layer Security (DTLS) Connection Identifier 13 draft-ietf-tls-dtls-connection-id-00 15 Abstract 17 This document specifies the "Connection ID" concept for the Datagram 18 Transport Layer Security (DTLS) protocol, version 1.2 and version 19 1.3. 21 A Connection ID is an identifier carried in the record layer header 22 that gives the recipient additional information for selecting the 23 appropriate security association. In "classical" DTLS, selecting a 24 security association of an incoming DTLS record is accomplished with 25 the help of the 5-tuple. If the source IP address and/or source port 26 changes during the lifetime of an ongoing DTLS session then the 27 receiver will be unable to locate the correct security context. 29 Status of This Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at http://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on June 30, 2018. 46 Copyright Notice 48 Copyright (c) 2017 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (http://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 This document may contain material from IETF Documents or IETF 62 Contributions published or made publicly available before November 63 10, 2008. The person(s) controlling the copyright in some of this 64 material may not have granted the IETF Trust the right to allow 65 modifications of such material outside the IETF Standards Process. 66 Without obtaining an adequate license from the person(s) controlling 67 the copyright in such materials, this document may not be modified 68 outside the IETF Standards Process, and derivative works of it may 69 not be created outside the IETF Standards Process, except to format 70 it for publication as an RFC or to translate it into languages other 71 than English. 73 Table of Contents 75 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 76 2. Conventions and Terminology . . . . . . . . . . . . . . . . . 3 77 3. The "connection_id" Extension . . . . . . . . . . . . . . . . 3 78 4. Post-Handshake Messages . . . . . . . . . . . . . . . . . . . 5 79 5. Record Layer Extensions . . . . . . . . . . . . . . . . . . . 5 80 6. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 6 81 7. Security and Privacy Considerations . . . . . . . . . . . . . 8 82 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 83 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 9 84 9.1. Normative References . . . . . . . . . . . . . . . . . . 9 85 9.2. Informative References . . . . . . . . . . . . . . . . . 10 86 Appendix A. History . . . . . . . . . . . . . . . . . . . . . . 11 87 Appendix B. Working Group Information . . . . . . . . . . . . . 11 88 Appendix C. Contributors . . . . . . . . . . . . . . . . . . . . 11 89 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 12 91 1. Introduction 93 The Datagram Transport Layer Security (DTLS) protocol was designed 94 for securing connection-less transports, like UDP. DTLS, like TLS, 95 starts with a handshake, which can be computationally demanding 96 (particularly when public key cryptography is used). After a 97 successful handshake, symmetric key cryptography is used to apply 98 data origin authentication, integrity and confidentiality protection. 99 This two-step approach allows to amortize the cost of the initial 100 handshake to subsequent application data protection. Ideally, the 101 second phase where application data is protected lasts over a longer 102 period of time since the established keys will only need to be 103 updated once the key lifetime expires. 105 In the current version of DTLS, the IP address and port of the peer 106 is used to identify the DTLS association. Unfortunately, in some 107 cases, such as NAT rebinding, these values are insufficient. This is 108 a particular issue in the Internet of Things when the device needs to 109 enter extended sleep periods to increase the battery lifetime and is 110 therefore subject to rebinding. This leads to connection failure, 111 with the resulting cost of a new handshake. 113 This document defines an extension to DTLS to add a connection ID to 114 each DTLS record. The presence of the connection ID is negotiated 115 via a DTLS extension. It also defines a DTLS 1.3 post-handshake 116 message to change connection ids. 118 2. Conventions and Terminology 120 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 121 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 122 "OPTIONAL" in this document are to be interpreted as described in RFC 123 2119 [RFC2119]. 125 The reader is assumed to be familiar with the DTLS specifications 126 since this document defines an extension to DTLS 1.2 and DTLS 1.3. 128 3. The "connection_id" Extension 130 This document defines a new extension type (connection_id(TBD)), 131 which is used in ClientHello and ServerHello messages. 133 The extension type is specified as follows. 135 enum { 136 connection_id(TBD), (65535) 137 } ExtensionType; 139 The extension_data field of this extension, when included in the 140 ClientHello, MUST contain the CID structure, which contains the CID 141 which the client wishes the server to use when sending messages 142 towards it. A zero-length value indicates that the client is 143 prepared to send with a connection ID but does not wish the server to 144 use one when sending (alternately, this can be interpreted as the 145 client wishes the server to use a zero-length CID; the result is the 146 same). 148 struct { 149 opaque cid<0..2^8-1>; 150 } ConnectionId; 152 A server which is willing to use CIDs will respond with its own 153 "connection_id" extension, containing the CID which it wishes the 154 client to use when sending messages towards it. A zero-length value 155 indicates that the server will send with the client's CID but does 156 not wish the client to use a CID (or again, alternately, to use a 157 zero-length CID). 159 When a session is resumed, the "connection_id" extension is 160 negotiated afresh, not retained from previous connections in the 161 session. 163 This is effectively the simplest possible design that will work. 164 Previous design ideas for using cryptographically generated session 165 ids, either using hash chains or public key encryption, were 166 dismissed due to their inefficient designs. Note that a client 167 always has the chance to fall-back to a full handshake or more 168 precisely to a handshake that uses session resumption (DTLS 1.2 169 language) or to a PSK-based handshake using the ticket-based 170 approach. 172 Because each party sends in the extension_data the value that it will 173 receive as a connection identifier in encrypted records, it is 174 possible for an endpoint to use a globally constant length for such 175 connection identifiers. This can in turn ease parsing and connection 176 lookup, for example by having the length in question be a compile- 177 time constant. Note that such implementations must still be able to 178 send other length connection identifiers to other parties. 180 In DTLS 1.2, connection ids are exchanged at the beginning of the 181 DTLS session only. There is no dedicated "connection id update" 182 message that allows new connection ids to be established mid-session, 183 because DTLS 1.2 in general does not allow post-handshake messages 184 that do not themselves begin other handshakes. In DTLS 1.3, which 185 does allow such messages, we use post-handshake message to update the 186 connection ID Section 4 and to request new IDs. 188 DTLS 1.2 peers switch to the new record layer format when encryption 189 is enabled. The same is true for DTLS 1.3 but since the DTLS 1.3 190 enables encryption early in the handshake phase the connection ID 191 will be enabled earlier. For this reason, the connection ID needs to 192 go in the DTLS 1.3 ServerHello. 194 4. Post-Handshake Messages 196 In DTLS 1.3, if the client and server have negotiated the 197 "connection_id" extension, either side can send a new connection ID 198 which it wishes the other side to use in a NewConnectionId message: 200 enum { 201 cid_immediate(0), cid_spare(1), (255) 202 } ConnectionIdUsage; 204 struct { 205 opaque cid<0..2^8-1>; 206 ConnectionIdUsage usage; 207 } NewConnectionId; 209 cid Indicates the CID which the sender wishes the peer to use. 211 usage Indicates whether the new CID should be used immediately or is 212 a spare. If usage is set to "cid_immediate", then the new CID 213 MUST be used immediately for all future records. If it is set to 214 "cid_spare", then either CID MAY be used, as described in 215 Section 7. 217 If the client and server have negotiated the "connection_id" 218 extension, either side can request a new CID using the 219 RequestConnectionId message. 221 struct { 222 } RequestConnectionId; 224 Endpoints SHOULD respond to RequestConnectionId by sending a 225 NewConnectionId with usage "cid_spare" as soon as possible. Note 226 that an endpoint MAY ignore requests which it considers excessive 227 (though they MUST be ACKed as usual). 229 5. Record Layer Extensions 231 This extension is applicable for use with DTLS 1.2 and DTLS 1.3. 232 This extension can be used with the optimized DTLS 1.3 record layer 233 format. 235 Figure 1 and Figure 2 illustrate the record formats of DTLS 1.2 and 236 DTLS 1.3, respectively. 238 struct { 239 ContentType type; 240 ProtocolVersion version; 241 uint16 epoch; 242 uint48 sequence_number; 243 opaque cid[cid_length]; // New field 244 uint16 length; 245 select (CipherSpec.cipher_type) { 246 case block: GenericBlockCipher; 247 case aead: GenericAEADCipher; 248 } fragment; 249 } DTLSCiphertext; 251 Figure 1: DTLS 1.2 Record Format with Connection ID 253 struct { 254 opaque content[DTLSPlaintext.length]; 255 ContentType type; 256 uint8 zeros[length_of_padding]; 257 } DTLSInnerPlaintext; 259 struct { 260 ContentType opaque_type = 23; /* application_data */ 261 ProtocolVersion legacy_record_version = {254,253); // DTLSv1.2 262 uint16 epoch; // DTLS-related field 263 uint48 sequence_number; // DTLS-related field 264 opaque cid[cid_length]; // New field 265 uint16 length; 266 opaque encrypted_record[length]; 267 } DTLSCiphertext; 269 Figure 2: DTLS 1.3 Record Format with Connection ID 271 Besides the "cid" field, all other fields are defined in the DTLS 1.2 272 and DTLS 1.3 specifications. 274 Note that for both record formats, it is not possible to parse the 275 records without knowing if the connection ID is in use and how long 276 it is. 278 6. Examples 280 Below is an example exchange for DTLS 1.3 using a single connection 281 id in each direction. 283 Client Server 284 ------ ------ 286 ClientHello 287 (connection_id=5) 288 --------> 290 <-------- HelloRetryRequest 291 (cookie) 293 ClientHello --------> 294 (connection_id=5) 295 +cookie 297 <-------- ServerHello 298 (connection_id=100) 299 EncryptedExtensions 300 (cid=5) 301 Certificate 302 (cid=5) 303 CertificateVerify 304 (cid=5) 305 Finished 306 (cid=5) 308 Certificate --------> 309 (cid=100) 310 CertificateVerify 311 (cid=100) 312 Finished 313 (cid=100) 314 <-------- Ack 315 (cid=5) 317 Application Data ========> 318 (cid=100) 319 <======== Application Data 320 (cid=5) 322 Figure 3: Example DTLS 1.3 Exchange with Connection IDs 324 Below is an example exchange for DTLS 1.2 using a connection id used 325 uni-directionally from the client to the server. 327 Client Server 328 ------ ------ 330 ClientHello 331 (connection_id=empty) 332 --------> 334 <-------- HelloVerifyRequest 335 (cookie) 337 ClientHello --------> 338 (connection_id=empty) 339 +cookie 341 <-------- ServerHello 342 (connection_id=100) 343 Certificate 344 ServerKeyExchange 345 CertificateRequest 346 ServerHelloDone 348 Certificate --------> 349 ClientKeyExchange 350 CertificateVerify 351 [ChangeCipherSpec] 352 Finished 353 (cid=100) 354 <-------- [ChangeCipherSpec] 355 Finished 357 Application Data ========> 358 (cid=100) 359 <======== Application Data 361 Figure 4: Example DTLS 1.2 Exchange with Connection IDs 363 7. Security and Privacy Considerations 365 The connection id replaces the previously used 5-tuple and, as such, 366 introduces an identifier that remains persistent during the lifetime 367 of a DTLS connection. Every identifier introduces the risk of 368 linkability, as explained in [RFC6973]. 370 In addition, endpoints can use the connection ID to attach arbitrary 371 metadata to each record they receive. This may be used as a 372 mechanism to communicate per-connection to on-path observers. There 373 is no straightforward way to address this with connection IDs that 374 contain arbitrary values; implementations concerned about this SHOULD 375 refuse to use connection ids. 377 An on-path adversary, who is able to observe the DTLS 1.2 protocol 378 exchanges between the DTLS client and the DTLS server, is able to 379 link the observed payloads to all subsequent payloads carrying the 380 same connection id pair (for bi-directional communication). In DTLS 381 1.3, it is possible to provide new encrypted connection IDs, though 382 of course those IDs are immediately used on the wire. Without multi- 383 homing and mobility the use of the connection id is not different to 384 the use of the 5-tuple. 386 With multi-homing, an adversary is able to correlate the 387 communication interaction over the two paths, which adds further 388 privacy concerns. In order to prevent this, implementations SHOULD 389 attempt to use fresh connection IDs whenever they change local 390 addresses or ports (though this is not always possible to detect). 391 In DTLS 1.3, The RequestConnectionId message can be used to ask for 392 new IDs in order to ensure that you have a pool of suitable IDs. 394 This document does not change the security properties of DTLS 1.2 395 [RFC6347] and DTLS 1.3 [I-D.ietf-tls-dtls13]. It merely provides a 396 more robust mechanism for associating an incoming packet with a 397 stored security context. 399 [[OPEN ISSUE: Sequence numbers leak connection IDs. We need to 400 update the document to address this. One possibility would be the 401 technique documented in https://quicwg.github.io/base-drafts/draft- 402 ietf-quic-transport.html#packet-number-gap.]] 404 8. IANA Considerations 406 IANA is requested to allocate an entry to the existing TLS 407 "ExtensionType Values" registry, defined in [RFC5246], for 408 connection_id(TBD) defined in this document. 410 IANA is requested to allocate two values in the "TLS Handshake Type" 411 registry, defined in [RFC5246], for request_connection_id (TBD), and 412 new_connection_id (TBD), as defined in this document. 414 9. References 416 9.1. Normative References 418 [I-D.ietf-tls-dtls13] 419 Rescorla, E., Tschofenig, H., and N. Modadugu, "The 420 Datagram Transport Layer Security (DTLS) Protocol Version 421 1.3", draft-ietf-tls-dtls13-22 (work in progress), 422 November 2017. 424 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 425 Requirement Levels", BCP 14, RFC 2119, 426 DOI 10.17487/RFC2119, March 1997, . 429 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 430 (TLS) Protocol Version 1.2", RFC 5246, 431 DOI 10.17487/RFC5246, August 2008, . 434 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 435 Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347, 436 January 2012, . 438 9.2. Informative References 440 [RFC6973] Cooper, A., Tschofenig, H., Aboba, B., Peterson, J., 441 Morris, J., Hansen, M., and R. Smith, "Privacy 442 Considerations for Internet Protocols", RFC 6973, 443 DOI 10.17487/RFC6973, July 2013, . 446 9.3. URIs 448 [1] mailto:tls@ietf.org 450 Appendix A. History 452 RFC EDITOR: PLEASE REMOVE THE THIS SECTION 454 draft-rescorla-tls-dtls-connection-id-00 456 - Initial version 458 Appendix B. Working Group Information 460 The discussion list for the IETF TLS working group is located at the 461 e-mail address tls@ietf.org [1]. Information on the group and 462 information on how to subscribe to the list is at 463 https://www1.ietf.org/mailman/listinfo/tls 465 Archives of the list can be found at: https://www.ietf.org/mail- 466 archive/web/tls/current/index.html 468 Appendix C. Contributors 470 Many people have contributed to this specification since the 471 functionality has been highly desired by the IoT community. We would 472 like to thank the following individuals for their contributions in 473 earlier specifications: 475 * Nikos Mavrogiannopoulos 476 RedHat 477 nmav@redhat.com 479 Additionally, we would like to thank Yin Xinxing (Huawei), Tobias 480 Gondrom (Huawei), and the Connection ID task force team members: 482 - Martin Thomson (Mozilla) 484 - Christian Huitema (Private Octopus Inc.) 486 - Jana Iyengar (Google) 488 - Daniel Kahn Gillmor (ACLU) 490 - Patrick McManus (Sole Proprietor) 492 - Ian Swett (Google) 494 - Mark Nottingham (Fastly) 496 Finally, we want to thank the IETF TLS working group chairs, Joseph 497 Salowey and Sean Turner, for their patience, support and feedback. 499 Authors' Addresses 501 Eric Rescorla (editor) 502 RTFM, Inc. 504 EMail: ekr@rtfm.com 506 Hannes Tschofenig (editor) 507 ARM Limited 509 EMail: hannes.tschofenig@arm.com 511 Thomas Fossati 512 Nokia 514 EMail: thomas.fossati@nokia.com 516 Tobias Gondrom 517 Huawei 519 EMail: tobias.gondrom@gondrom.org