idnits 2.17.1 draft-ietf-quic-invariants-09.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. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (9 June 2020) is 1411 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-34) exists of draft-ietf-quic-tls-29 == Outdated reference: A later version (-34) exists of draft-ietf-quic-transport-29 Summary: 1 error (**), 0 flaws (~~), 3 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 QUIC M. Thomson 3 Internet-Draft Mozilla 4 Intended status: Standards Track 9 June 2020 5 Expires: 11 December 2020 7 Version-Independent Properties of QUIC 8 draft-ietf-quic-invariants-09 10 Abstract 12 This document defines the properties of the QUIC transport protocol 13 that are expected to remain unchanged over time as new versions of 14 the protocol are developed. 16 Note to Readers 18 Discussion of this draft takes place on the QUIC working group 19 mailing list (quic@ietf.org (mailto:quic@ietf.org)), which is 20 archived at https://mailarchive.ietf.org/arch/ 21 search/?email_list=quic. 23 Working Group information can be found at https://github.com/quicwg; 24 source code and issues list for this draft can be found at 25 https://github.com/quicwg/base-drafts/labels/-invariants. 27 Status of This Memo 29 This Internet-Draft is submitted in full conformance with the 30 provisions of BCP 78 and BCP 79. 32 Internet-Drafts are working documents of the Internet Engineering 33 Task Force (IETF). Note that other groups may also distribute 34 working documents as Internet-Drafts. The list of current Internet- 35 Drafts is at https://datatracker.ietf.org/drafts/current/. 37 Internet-Drafts are draft documents valid for a maximum of six months 38 and may be updated, replaced, or obsoleted by other documents at any 39 time. It is inappropriate to use Internet-Drafts as reference 40 material or to cite them other than as "work in progress." 42 This Internet-Draft will expire on 11 December 2020. 44 Copyright Notice 46 Copyright (c) 2020 IETF Trust and the persons identified as the 47 document authors. All rights reserved. 49 This document is subject to BCP 78 and the IETF Trust's Legal 50 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 51 license-info) in effect on the date of publication of this document. 52 Please review these documents carefully, as they describe your rights 53 and restrictions with respect to this document. Code Components 54 extracted from this document must include Simplified BSD License text 55 as described in Section 4.e of the Trust Legal Provisions and are 56 provided without warranty as described in the Simplified BSD License. 58 Table of Contents 60 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 61 2. Conventions and Definitions . . . . . . . . . . . . . . . . . 3 62 3. An Extremely Abstract Description of QUIC . . . . . . . . . . 3 63 4. Notational Conventions . . . . . . . . . . . . . . . . . . . 3 64 5. QUIC Packet Headers . . . . . . . . . . . . . . . . . . . . . 4 65 5.1. Long Header . . . . . . . . . . . . . . . . . . . . . . . 4 66 5.2. Short Header . . . . . . . . . . . . . . . . . . . . . . 5 67 5.3. Connection ID . . . . . . . . . . . . . . . . . . . . . . 5 68 5.4. Version . . . . . . . . . . . . . . . . . . . . . . . . . 6 69 6. Version Negotiation . . . . . . . . . . . . . . . . . . . . . 6 70 7. Security and Privacy Considerations . . . . . . . . . . . . . 7 71 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 72 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 8 73 9.1. Normative References . . . . . . . . . . . . . . . . . . 8 74 9.2. Informative References . . . . . . . . . . . . . . . . . 8 75 Appendix A. Incorrect Assumptions . . . . . . . . . . . . . . . 8 76 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 10 78 1. Introduction 80 In addition to providing secure, multiplexed transport, QUIC 81 [QUIC-TRANSPORT] includes the ability to negotiate a version. This 82 allows the protocol to change over time in response to new 83 requirements. Many characteristics of the protocol will change 84 between versions. 86 This document describes the subset of QUIC that is intended to remain 87 stable as new versions are developed and deployed. All of these 88 invariants are IP-version-independent. 90 The primary goal of this document is to ensure that it is possible to 91 deploy new versions of QUIC. By documenting the properties that 92 can't change, this document aims to preserve the ability to change 93 any other aspect of the protocol. Thus, unless specifically 94 described in this document, any aspect of the protocol can change 95 between different versions. 97 Appendix A is a non-exhaustive list of some incorrect assumptions 98 that might be made based on knowledge of QUIC version 1; these do not 99 apply to every version of QUIC. 101 2. Conventions and Definitions 103 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 104 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 105 "OPTIONAL" in this document are to be interpreted as described in 106 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all 107 capitals, as shown here. 109 This document uses terms and notational conventions from 110 [QUIC-TRANSPORT]. 112 3. An Extremely Abstract Description of QUIC 114 QUIC is a connection-oriented protocol between two endpoints. Those 115 endpoints exchange UDP datagrams. These UDP datagrams contain QUIC 116 packets. QUIC endpoints use QUIC packets to establish a QUIC 117 connection, which is shared protocol state between those endpoints. 119 4. Notational Conventions 121 Packet diagrams in this document use a format defined in 122 [QUIC-TRANSPORT] to illustrate the order and size of fields. 124 Complex fields are named and then followed by a list of fields 125 surrounded by a pair of matching braces. Each field in this list is 126 separated by commas. 128 Individual fields include length information, plus indications about 129 fixed value, optionality, or repetitions. Individual fields use the 130 following notational conventions, with all lengths in bits: 132 x (A): Indicates that x is A bits long 134 x (A..B): Indicates that x can be any length from A to B; A can be 135 omitted to indicate a minimum of zero bits and B can be omitted to 136 indicate no set upper limit; values in this format always end on 137 an octet boundary 139 x (?) = C: Indicates that x has a fixed value of C 141 x (E) ...: Indicates that x is repeated zero or more times (and that 142 each instance is length E) 144 This document uses network byte order (that is, big endian) values. 145 Fields are placed starting from the high-order bits of each byte. 147 Figure 1 shows an example structure: 149 Example Structure { 150 One-bit Field (1), 151 7-bit Field with Fixed Value (7) = 61, 152 Arbitrary-Length Field (..), 153 Variable-Length Field (8..24), 154 Repeated Field (8) ..., 155 } 157 Figure 1: Example Format 159 5. QUIC Packet Headers 161 QUIC endpoints exchange UDP datagrams that contain one or more QUIC 162 packets. This section describes the invariant characteristics of a 163 QUIC packet. A version of QUIC could permit multiple QUIC packets in 164 a single UDP datagram, but the invariant properties only describe the 165 first packet in a datagram. 167 QUIC defines two types of packet header: long and short. Packets 168 with long headers are identified by the most significant bit of the 169 first byte being set; packets with a short header have that bit 170 cleared. 172 Aside from the values described here, the payload of QUIC packets is 173 version-specific and of arbitrary length. 175 5.1. Long Header 177 Long headers take the form described in Figure 2. 179 Long Header Packet { 180 Header Form (1) = 1, 181 Version-Specific Bits (7), 182 Version (32), 183 Destination Connection ID Length (8), 184 Destination Connection ID (0..2040), 185 Source Connection ID Length (8), 186 Source Connection ID (0..2040), 187 Version-Specific Data (..), 188 } 190 Figure 2: QUIC Long Header 192 A QUIC packet with a long header has the high bit of the first byte 193 set to 1. All other bits in that byte are version specific. 195 The next four bytes include a 32-bit Version field. Versions are 196 described in Section 5.4. 198 The next byte contains the length in bytes of the Destination 199 Connection ID field that follows it. This length is encoded as an 200 8-bit unsigned integer. The Destination Connection ID field follows 201 the Destination Connection ID Length field and is between 0 and 255 202 bytes in length. Connection IDs are described in Section 5.3. 204 The next byte contains the length in bytes of the Source Connection 205 ID field that follows it. This length is encoded as a 8-bit unsigned 206 integer. The Source Connection ID field follows the Source 207 Connection ID Length field and is between 0 and 255 bytes in length. 209 The remainder of the packet contains version-specific content. 211 5.2. Short Header 213 Short headers take the form described in Figure 3. 215 Short Header Packet { 216 Header Form (1) = 0, 217 Version-Specific Bits (7), 218 Destination Connection ID (..), 219 Version-Specific Data (..), 220 } 222 Figure 3: QUIC Short Header 224 A QUIC packet with a short header has the high bit of the first byte 225 set to 0. 227 A QUIC packet with a short header includes a Destination Connection 228 ID immediately following the first byte. The short header does not 229 include the Connection ID Lengths, Source Connection ID, or Version 230 fields. The length of the Destination Connection ID is not encoded 231 in packets with a short header and is not constrained by this 232 specification. 234 The remainder of the packet has version-specific semantics. 236 5.3. Connection ID 238 A connection ID is an opaque field of arbitrary length. 240 The primary function of a connection ID is to ensure that changes in 241 addressing at lower protocol layers (UDP, IP, and below) don't cause 242 packets for a QUIC connection to be delivered to the wrong QUIC 243 endpoint. The connection ID is used by endpoints and the 244 intermediaries that support them to ensure that each QUIC packet can 245 be delivered to the correct instance of an endpoint. At the 246 endpoint, the connection ID is used to identify which QUIC connection 247 the packet is intended for. 249 The connection ID is chosen by each endpoint using version-specific 250 methods. Packets for the same QUIC connection might use different 251 connection ID values. 253 5.4. Version 255 QUIC versions are identified with a 32-bit integer, encoded in 256 network byte order. Version 0 is reserved for version negotiation 257 (see Section 6). All other version numbers are potentially valid. 259 The properties described in this document apply to all versions of 260 QUIC. A protocol that does not conform to the properties described 261 in this document is not QUIC. Future documents might describe 262 additional properties which apply to a specific QUIC version, or to a 263 range of QUIC versions. 265 6. Version Negotiation 267 A QUIC endpoint that receives a packet with a long header and a 268 version it either does not understand or does not support might send 269 a Version Negotiation packet in response. Packets with a short 270 header do not trigger version negotiation. 272 A Version Negotiation packet sets the high bit of the first byte, and 273 thus it conforms with the format of a packet with a long header as 274 defined in Section 5.1. A Version Negotiation packet is identifiable 275 as such by the Version field, which is set to 0x00000000. 277 Version Negotiation Packet { 278 Header Form (1) = 1, 279 Unused (7), 280 Version (32) = 0, 281 Destination Connection ID Length (8), 282 Destination Connection ID (0..2040), 283 Source Connection ID Length (8), 284 Source Connection ID (0..2040), 285 Supported Version (32) ..., 286 } 287 Figure 4: Version Negotiation Packet 289 The Version Negotiation packet contains a list of Supported Version 290 fields, each identifying a version that the endpoint sending the 291 packet supports. The Supported Version fields follow the Version 292 field. A Version Negotiation packet contains no other fields. An 293 endpoint MUST ignore a packet that contains no Supported Version 294 fields, or a truncated Supported Version. 296 Version Negotiation packets do not use integrity or confidentiality 297 protection. A specific QUIC version might authenticate the packet as 298 part of its connection establishment process. 300 An endpoint MUST include the value from the Source Connection ID 301 field of the packet it receives in the Destination Connection ID 302 field. The value for Source Connection ID MUST be copied from the 303 Destination Connection ID of the received packet, which is initially 304 randomly selected by a client. Echoing both connection IDs gives 305 clients some assurance that the server received the packet and that 306 the Version Negotiation packet was not generated by an off-path 307 attacker. 309 An endpoint that receives a Version Negotiation packet might change 310 the version that it decides to use for subsequent packets. The 311 conditions under which an endpoint changes QUIC version will depend 312 on the version of QUIC that it chooses. 314 See [QUIC-TRANSPORT] for a more thorough description of how an 315 endpoint that supports QUIC version 1 generates and consumes a 316 Version Negotiation packet. 318 7. Security and Privacy Considerations 320 It is possible that middleboxes could use traits of a specific 321 version of QUIC and assume that when other versions of QUIC exhibit 322 similar traits the same underlying semantic is being expressed. 323 There are potentially many such traits (see Appendix A). Some effort 324 has been made to either eliminate or obscure some observable traits 325 in QUIC version 1, but many of these remain. Other QUIC versions 326 might make different design decisions and so exhibit different 327 traits. 329 The QUIC version number does not appear in all QUIC packets, which 330 means that reliably extracting information from a flow based on 331 version-specific traits requires that middleboxes retain state for 332 every connection ID they see. 334 The Version Negotiation packet described in this document is not 335 integrity-protected; it only has modest protection against insertion 336 by off-path attackers. QUIC versions MUST define a mechanism that 337 authenticates the values it contains. 339 8. IANA Considerations 341 This document makes no request of IANA. 343 9. References 345 9.1. Normative References 347 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 348 Requirement Levels", BCP 14, RFC 2119, 349 DOI 10.17487/RFC2119, March 1997, 350 . 352 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 353 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 354 May 2017, . 356 9.2. Informative References 358 [QUIC-TLS] Thomson, M., Ed. and S. Turner, Ed., "Using Transport 359 Layer Security (TLS) to Secure QUIC", Work in Progress, 360 Internet-Draft, draft-ietf-quic-tls-29, 9 June 2020, 361 . 363 [QUIC-TRANSPORT] 364 Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based 365 Multiplexed and Secure Transport", Work in Progress, 366 Internet-Draft, draft-ietf-quic-transport-29, 9 June 2020, 367 . 370 [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated 371 Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, 372 . 374 Appendix A. Incorrect Assumptions 376 There are several traits of QUIC version 1 [QUIC-TRANSPORT] that are 377 not protected from observation, but are nonetheless considered to be 378 changeable when a new version is deployed. 380 This section lists a sampling of incorrect assumptions that might be 381 made based on knowledge of QUIC version 1. Some of these statements 382 are not even true for QUIC version 1. This is not an exhaustive 383 list, it is intended to be illustrative only. 385 The following statements are NOT guaranteed to be true for every QUIC 386 version: 388 * QUIC uses TLS [QUIC-TLS] and some TLS messages are visible on the 389 wire 391 * QUIC long headers are only exchanged during connection 392 establishment 394 * Every flow on a given 5-tuple will include a connection 395 establishment phase 397 * The first packets exchanged on a flow use the long header 399 * The last packet before a long period of quiescence might be 400 assumed to contain only an acknowledgment 402 * QUIC uses an AEAD (AEAD_AES_128_GCM [RFC5116]) to protect the 403 packets it exchanges during connection establishment 405 * QUIC packet numbers are encrypted and appear as the first 406 encrypted bytes 408 * QUIC packet numbers increase by one for every packet sent 410 * QUIC has a minimum size for the first handshake packet sent by a 411 client 413 * QUIC stipulates that a client speaks first 415 * QUIC packets always have the second bit of the first byte (0x40) 416 set 418 * A QUIC Version Negotiation packet is only sent by a server 420 * A QUIC connection ID changes infrequently 422 * QUIC endpoints change the version they speak if they are sent a 423 Version Negotiation packet 425 * The version field in a QUIC long header is the same in both 426 directions 428 * Only one connection at a time is established between any pair of 429 QUIC endpoints 431 Author's Address 433 Martin Thomson 434 Mozilla 436 Email: mt@lowentropy.net