idnits 2.17.1 draft-ietf-quic-transport-01.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. ** There are 2 instances of too long lines in the document, the longest one being 2 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (January 14, 2017) is 2652 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) -- Looks like a reference, but probably isn't: '4' on line 349 -- Looks like a reference, but probably isn't: '1' on line 2101 == Unused Reference: 'QUIC-HTTP' is defined on line 2084, but no explicit reference was found in the text -- Possible downref: Non-RFC (?) normative reference: ref. 'QUIC-RECOVERY' -- Possible downref: Non-RFC (?) normative reference: ref. 'QUIC-TLS' ** Obsolete normative reference: RFC 7540 (Obsoleted by RFC 9113) Summary: 3 errors (**), 0 flaws (~~), 3 warnings (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 QUIC J. Iyengar, Ed. 3 Internet-Draft Google 4 Intended status: Standards Track M. Thomson, Ed. 5 Expires: July 18, 2017 Mozilla 6 January 14, 2017 8 QUIC: A UDP-Based Multiplexed and Secure Transport 9 draft-ietf-quic-transport-01 11 Abstract 13 QUIC is a multiplexed and secure transport protocol that runs on top 14 of UDP. QUIC builds on past transport experience, and implements 15 mechanisms that make it useful as a modern general-purpose transport 16 protocol. Using UDP as the basis of QUIC is intended to address 17 compatibility issues with legacy clients and middleboxes. QUIC 18 authenticates all of its headers, preventing third parties from 19 changing them. QUIC encrypts most of its headers, thereby limiting 20 protocol evolution to QUIC endpoints only. Therefore, middleboxes, 21 in large part, are not required to be updated as new protocol 22 versions are deployed. This document describes the core QUIC 23 protocol, including the conceptual design, wire format, and 24 mechanisms of the QUIC protocol for connection establishment, stream 25 multiplexing, stream and connection-level flow control, and data 26 reliability. Accompanying documents describe QUIC's loss recovery 27 and congestion control, and the use of TLS 1.3 for key negotiation. 29 Note to Readers 31 Discussion of this draft takes place on the QUIC working group 32 mailing list (quic@ietf.org), which is archived at 33 https://mailarchive.ietf.org/arch/search/?email_list=quic . 35 Working Group information can be found at https://github.com/quicwg ; 36 source code and issues list for this draft can be found at 37 https://github.com/quicwg/base-drafts/labels/transport . 39 Status of This Memo 41 This Internet-Draft is submitted in full conformance with the 42 provisions of BCP 78 and BCP 79. 44 Internet-Drafts are working documents of the Internet Engineering 45 Task Force (IETF). Note that other groups may also distribute 46 working documents as Internet-Drafts. The list of current Internet- 47 Drafts is at http://datatracker.ietf.org/drafts/current/. 49 Internet-Drafts are draft documents valid for a maximum of six months 50 and may be updated, replaced, or obsoleted by other documents at any 51 time. It is inappropriate to use Internet-Drafts as reference 52 material or to cite them other than as "work in progress." 54 This Internet-Draft will expire on July 18, 2017. 56 Copyright Notice 58 Copyright (c) 2017 IETF Trust and the persons identified as the 59 document authors. All rights reserved. 61 This document is subject to BCP 78 and the IETF Trust's Legal 62 Provisions Relating to IETF Documents 63 (http://trustee.ietf.org/license-info) in effect on the date of 64 publication of this document. Please review these documents 65 carefully, as they describe your rights and restrictions with respect 66 to this document. Code Components extracted from this document must 67 include Simplified BSD License text as described in Section 4.e of 68 the Trust Legal Provisions and are provided without warranty as 69 described in the Simplified BSD License. 71 Table of Contents 73 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 74 2. Conventions and Definitions . . . . . . . . . . . . . . . . . 4 75 2.1. Notational Conventions . . . . . . . . . . . . . . . . . 5 76 3. A QUIC Overview . . . . . . . . . . . . . . . . . . . . . . . 5 77 3.1. Low-Latency Connection Establishment . . . . . . . . . . 5 78 3.2. Stream Multiplexing . . . . . . . . . . . . . . . . . . . 6 79 3.3. Rich Signaling for Congestion Control and Loss Recovery . 6 80 3.4. Stream and Connection Flow Control . . . . . . . . . . . 6 81 3.5. Authenticated and Encrypted Header and Payload . . . . . 7 82 3.6. Connection Migration and Resilience to NAT Rebinding . . 7 83 3.7. Version Negotiation . . . . . . . . . . . . . . . . . . . 7 84 4. Versions . . . . . . . . . . . . . . . . . . . . . . . . . . 7 85 5. Packet Types and Formats . . . . . . . . . . . . . . . . . . 8 86 5.1. Common Header . . . . . . . . . . . . . . . . . . . . . . 8 87 5.1.1. Identifying Packet Types . . . . . . . . . . . . . . 10 88 5.1.2. Handling Packets from Different Versions . . . . . . 10 89 5.2. Regular Packets . . . . . . . . . . . . . . . . . . . . . 11 90 5.2.1. Packet Number Compression and Reconstruction . . . . 12 91 5.2.2. Frames and Frame Types . . . . . . . . . . . . . . . 13 92 5.3. Version Negotiation Packet . . . . . . . . . . . . . . . 14 93 5.4. Public Reset Packet . . . . . . . . . . . . . . . . . . . 15 94 6. Life of a Connection . . . . . . . . . . . . . . . . . . . . 15 95 6.1. Version Negotiation . . . . . . . . . . . . . . . . . . . 15 96 6.2. Crypto and Transport Handshake . . . . . . . . . . . . . 16 97 6.2.1. Transport Parameters and Options . . . . . . . . . . 16 98 6.2.2. Proof of Source Address Ownership . . . . . . . . . . 17 99 6.2.3. Crypto Handshake Protocol Features . . . . . . . . . 18 100 6.2.4. Version Negotiation Validation . . . . . . . . . . . 19 101 6.3. Connection Migration . . . . . . . . . . . . . . . . . . 19 102 6.4. Connection Termination . . . . . . . . . . . . . . . . . 19 103 7. Frame Types and Formats . . . . . . . . . . . . . . . . . . . 20 104 7.1. STREAM Frame . . . . . . . . . . . . . . . . . . . . . . 21 105 7.2. ACK Frame . . . . . . . . . . . . . . . . . . . . . . . . 22 106 7.2.1. Ack Block Section . . . . . . . . . . . . . . . . . . 24 107 7.2.2. Timestamp Section . . . . . . . . . . . . . . . . . . 25 108 7.3. STOP_WAITING Frame . . . . . . . . . . . . . . . . . . . 26 109 7.4. WINDOW_UPDATE Frame . . . . . . . . . . . . . . . . . . . 27 110 7.5. BLOCKED Frame . . . . . . . . . . . . . . . . . . . . . . 27 111 7.6. RST_STREAM Frame . . . . . . . . . . . . . . . . . . . . 28 112 7.7. PADDING Frame . . . . . . . . . . . . . . . . . . . . . . 28 113 7.8. PING frame . . . . . . . . . . . . . . . . . . . . . . . 29 114 7.9. CONNECTION_CLOSE frame . . . . . . . . . . . . . . . . . 29 115 7.10. GOAWAY Frame . . . . . . . . . . . . . . . . . . . . . . 29 116 8. Packetization and Reliability . . . . . . . . . . . . . . . . 30 117 9. Streams: QUIC's Data Structuring Abstraction . . . . . . . . 32 118 9.1. Life of a Stream . . . . . . . . . . . . . . . . . . . . 32 119 9.1.1. idle . . . . . . . . . . . . . . . . . . . . . . . . 34 120 9.1.2. reserved . . . . . . . . . . . . . . . . . . . . . . 34 121 9.1.3. open . . . . . . . . . . . . . . . . . . . . . . . . 35 122 9.1.4. half-closed (local) . . . . . . . . . . . . . . . . . 35 123 9.1.5. half-closed (remote) . . . . . . . . . . . . . . . . 35 124 9.1.6. closed . . . . . . . . . . . . . . . . . . . . . . . 36 125 9.2. Stream Identifiers . . . . . . . . . . . . . . . . . . . 37 126 9.3. Stream Concurrency . . . . . . . . . . . . . . . . . . . 37 127 9.4. Sending and Receiving Data . . . . . . . . . . . . . . . 37 128 10. Flow Control . . . . . . . . . . . . . . . . . . . . . . . . 38 129 10.1. Edge Cases and Other Considerations . . . . . . . . . . 39 130 10.1.1. Mid-stream RST_STREAM . . . . . . . . . . . . . . . 39 131 10.1.2. Response to a RST_STREAM . . . . . . . . . . . . . . 40 132 10.1.3. Offset Increment . . . . . . . . . . . . . . . . . . 40 133 10.1.4. BLOCKED frames . . . . . . . . . . . . . . . . . . . 40 134 11. Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . 41 135 12. Security and Privacy Considerations . . . . . . . . . . . . . 44 136 12.1. Spoofed Ack Attack . . . . . . . . . . . . . . . . . . . 44 137 13. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 45 138 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 45 139 14.1. Normative References . . . . . . . . . . . . . . . . . . 45 140 14.2. Informative References . . . . . . . . . . . . . . . . . 45 141 14.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 46 142 Appendix A. Contributors . . . . . . . . . . . . . . . . . . . . 46 143 Appendix B. Acknowledgments . . . . . . . . . . . . . . . . . . 46 144 Appendix C. Change Log . . . . . . . . . . . . . . . . . . . . . 46 145 C.1. Since draft-ietf-quic-transport-00: . . . . . . . . . . . 47 146 C.2. Since draft-hamilton-quic-transport-protocol-01: . . . . 47 147 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 47 149 1. Introduction 151 QUIC is a multiplexed and secure transport protocol that runs on top 152 of UDP. QUIC builds on past transport experience and implements 153 mechanisms that make it useful as a modern general-purpose transport 154 protocol. Using UDP as the substrate, QUIC seeks to be compatible 155 with legacy clients and middleboxes. QUIC authenticates all of its 156 headers, preventing middleboxes and other third parties from changing 157 them, and encrypts most of its headers, limiting protocol evolution 158 largely to QUIC endpoints only. 160 This document describes the core QUIC protocol, including the 161 conceptual design, wire format, and mechanisms of the QUIC protocol 162 for connection establishment, stream multiplexing, stream and 163 connection-level flow control, and data reliability. Accompanying 164 documents describe QUIC's loss detection and congestion control 165 [QUIC-RECOVERY], and the use of TLS 1.3 for key negotiation 166 [QUIC-TLS]. 168 2. Conventions and Definitions 170 The words "MUST", "MUST NOT", "SHOULD", and "MAY" are used in this 171 document. It's not shouting; when they are capitalized, they have 172 the special meaning defined in [RFC2119]. 174 Definitions of terms that are used in this document: 176 o Client: The endpoint initiating a QUIC connection. 178 o Server: The endpoint accepting incoming QUIC connections. 180 o Endpoint: The client or server end of a connection. 182 o Stream: A logical, bi-directional channel of ordered bytes within 183 a QUIC connection. 185 o Connection: A conversation between two QUIC endpoints with a 186 single encryption context that multiplexes streams within it. 188 o Connection ID: The identifier for a QUIC connection. 190 o QUIC packet: A well-formed UDP payload that can be parsed by a 191 QUIC receiver. QUIC packet size in this document refers to the 192 UDP payload size. 194 2.1. Notational Conventions 196 Packet and frame diagrams use the format described in [RFC2360] 197 Section 3.1, with the following additional conventions: 199 [x] Indicates that x is optional 201 {x} Indicates that x is encrypted 203 x (*) ... Indicates that x is variable-length 205 x (A/B/C) ... Indicates that x is one of A, B, or C bits long 207 3. A QUIC Overview 209 This section briefly describes QUIC's key mechanisms and benefits. 210 Key strengths of QUIC include: 212 o Low-latency connection establishment 214 o Multiplexing without head-of-line blocking 216 o Authenticated and encrypted header and payload 218 o Rich signaling for congestion control and loss recovery 220 o Stream and connection flow control 222 o Connection migration and resilience to NAT rebinding 224 o Version negotiation 226 3.1. Low-Latency Connection Establishment 228 QUIC relies on a combined crypto and transport handshake for setting 229 up a secure transport connection. QUIC connections are expected to 230 commonly use 0-RTT handshakes, meaning that for most QUIC 231 connections, data can be sent immediately following the client 232 handshake packet, without waiting for a reply from the server. QUIC 233 provides a dedicated stream (Stream ID 1) to be used for performing 234 the crypto handshake and QUIC options negotiation. The format of the 235 QUIC options and parameters used during negotiation are described in 236 this document, but the handshake protocol that runs on Stream ID 1 is 237 described in the accompanying crypto handshake draft [QUIC-TLS]. 239 3.2. Stream Multiplexing 241 When application messages are transported over TCP, independent 242 application messages can suffer from head-of-line blocking. When an 243 application multiplexes many streams atop TCP's single-bytestream 244 abstraction, a loss of a TCP segment results in blocking of all 245 subsequent segments until a retransmission arrives, irrespective of 246 the application streams that are encapsulated in subsequent segments. 247 QUIC ensures that lost packets carrying data for an individual stream 248 only impact that specific stream. Data received on other streams can 249 continue to be reassembled and delivered to the application. 251 3.3. Rich Signaling for Congestion Control and Loss Recovery 253 QUIC's packet framing and acknowledgments carry rich information that 254 help both congestion control and loss recovery in fundamental ways. 255 Each QUIC packet carries a new packet number, including those 256 carrying retransmitted data. This obviates the need for a separate 257 mechanism to distinguish acks for retransmissions from those for 258 original transmissions, avoiding TCP's retransmission ambiguity 259 problem. QUIC acknowledgments also explicitly encode the delay 260 between the receipt of a packet and its acknowledgment being sent, 261 and together with the monotonically-increasing packet numbers, this 262 allows for precise network roundtrip-time (RTT) calculation. QUIC's 263 ACK frames support up to 256 ack blocks, so QUIC is more resilient to 264 reordering than TCP with SACK support, as well as able to keep more 265 bytes on the wire when there is reordering or loss. 267 3.4. Stream and Connection Flow Control 269 QUIC implements stream- and connection-level flow control, closely 270 following HTTP/2's flow control mechanisms. At a high level, a QUIC 271 receiver advertises the absolute byte offset within each stream up to 272 which the receiver is willing to receive data. As data is sent, 273 received, and delivered on a particular stream, the receiver sends 274 WINDOW_UPDATE frames that increase the advertised offset limit for 275 that stream, allowing the peer to send more data on that stream. In 276 addition to this stream-level flow control, QUIC implements 277 connection-level flow control to limit the aggregate buffer that a 278 QUIC receiver is willing to allocate to all streams on a connection. 279 Connection-level flow control works in the same way as stream-level 280 flow control, but the bytes delivered and highest received offset are 281 all aggregates across all streams. 283 3.5. Authenticated and Encrypted Header and Payload 285 TCP headers appear in plaintext on the wire and are not 286 authenticated, causing a plethora of injection and header 287 manipulation issues for TCP, such as receive-window manipulation and 288 sequence-number overwriting. While some of these are mechanisms used 289 by middleboxes to improve TCP performance, others are active attacks. 290 Even "performance-enhancing" middleboxes that routinely interpose on 291 the transport state machine end up limiting the evolvability of the 292 transport protocol, as has been observed in the design of MPTCP and 293 in its subsequent deployability issues. 295 Generally, QUIC packets are always authenticated and the payload is 296 typically fully encrypted. The parts of the packet header which are 297 not encrypted are still authenticated by the receiver, so as to 298 thwart any packet injection or manipulation by third parties. Some 299 early handshake packets, such as the Version Negotiation packet, are 300 not encrypted, but information sent in these unencrypted handshake 301 packets is later verified under crypto cover. 303 PUBLIC_RESET packets that reset a connection are currently not 304 authenticated. 306 3.6. Connection Migration and Resilience to NAT Rebinding 308 QUIC connections are identified by a 64-bit Connection ID, randomly 309 generated by the client. QUIC's consistent connection ID allows 310 connections to survive changes to the client's IP and port, such as 311 those caused by NAT rebindings or by the client changing network 312 connectivity to a new address. QUIC provides automatic cryptographic 313 verification of a rebound client, since the client continues to use 314 the same session key for encrypting and decrypting packets. The 315 consistent connection ID can be used to allow migration of the 316 connection to a new server IP address as well, since the Connection 317 ID remains consistent across changes in the client's and the server's 318 network addresses. 320 3.7. Version Negotiation 322 QUIC version negotiation allows for multiple versions of the protocol 323 to be deployed and used concurrently. Version negotiation is 324 described in Section 6.1. 326 4. Versions 328 QUIC versions are identified using a 32-bit value. 330 The version 0x00000000 is reserved to represent an invalid version. 331 This version of the specification is identified by the number 332 0x00000001. 334 Versions with the most significant 16 bits of the version number 335 cleared are reserved for use in future IETF consensus documents. 337 [[RFC editor: please remove the remainder of this section before 338 publication.]] 340 The version number for the final version of this specification 341 (0x00000001), is reserved for the version of the protocol that is 342 published as an RFC. 344 Version numbers used to identify IETF drafts are created by adding 345 the draft number to 0xff000000. For example, draft-ietf-quic- 346 transport-13 would be identified as 0xff00000D. 348 Versions of QUIC that are used for experimentation are coordinated on 349 the github wiki [4]. 351 5. Packet Types and Formats 353 We first describe QUIC's packet types and their formats, since some 354 are referenced in subsequent mechanisms. 356 All numeric values are encoded in network byte order (that is, big- 357 endian) and all field sizes are in bits. When discussing individual 358 bits of fields, the least significant bit is referred to as bit 0. 359 Hexadecimal notation is used for describing the value of fields. 361 5.1. Common Header 363 All QUIC packets begin with a QUIC Common header, as shown below. 365 0 1 2 3 366 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 367 +-+-+-+-+-+-+-+-+ 368 | Flags (8) | 369 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 370 | | 371 + [Connection ID (64)] + 372 | | 373 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 374 | Type-Dependent Fields (*) ... 375 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 377 The fields in the Common Header are the following: 379 o Flags: 381 * 0x01 = VERSION. The semantics of this flag depends on whether 382 the packet is sent by the server or the client. A client MAY 383 set this flag and include exactly one proposed version. A 384 server may set this flag when the client-proposed version was 385 unsupported, and may then provide a list (0 or more) of 386 acceptable versions as a part of version negotiation (described 387 in Section 6.1.) 389 * 0x02 = PUBLIC_RESET. Set to indicate that the packet is a 390 Public Reset packet. 392 * 0x04 = KEY_PHASE. This is used by the QUIC packet protection 393 to identify the correct packet protection keys, see [QUIC-TLS]. 395 * 0x08 = CONNECTION_ID. Indicates the Connection ID is present 396 in the packet. This must be set in all packets until 397 negotiated to a different value for a given direction. For 398 instance, if a client indicates that the 5-tuple fully 399 identifies the connection at the client, the connection ID is 400 optional in the server-to-client direction. 402 * 0x30 = PACKET_NUMBER_SIZE. These two bits indicate the number 403 of low-order-bytes of the packet number that are present in 404 each packet. 406 + 11 indicates that 6 bytes of the packet number are present 408 + 10 indicates that 4 bytes of the packet number are present 410 + 01 indicates that 2 bytes of the packet number are present 412 + 00 indicates that 1 byte of the packet number is present 414 * 0x40 = MULTIPATH. This bit is reserved for multipath use. 416 * 0x80 is currently unused, and must be set to 0. 418 o Connection ID: An unsigned 64-bit random number chosen by the 419 client, used as the identifier of the connection. Connection ID 420 is tied to a QUIC connection, and remains consistent across client 421 and/or server IP and port changes. 423 5.1.1. Identifying Packet Types 425 While all QUIC packets have the same common header, there are three 426 types of packets: Regular packets, Version Negotiation packets, and 427 Public Reset packets. The flowchart below shows how a packet is 428 classified into one of these three packet types: 430 Check the flags in the common header 431 | 432 | 433 V 434 +--------------+ 435 | PUBLIC_RESET | YES 436 | flag set? |-------> Public Reset packet 437 +--------------+ 438 | 439 | NO 440 V 441 +------------+ +-------------+ 442 | VERSION | YES | Packet sent | YES Version 443 | flag set? |-------->| by server? |--------> Negotiation 444 +------------+ +-------------+ packet 445 | | 446 | NO | NO 447 V V 448 Regular packet with Regular packet with 449 no QUIC Version in header QUIC Version in header 451 Figure 1: Types of QUIC Packets 453 5.1.2. Handling Packets from Different Versions 455 Version negotiation (Section 6.1) is performed using packets that 456 have the VERSION bit set. This bit is always set on packets that are 457 sent prior to connection establishment. When receiving a packet that 458 is not associated with an existing connection, packets without a 459 VERSION bit MUST be discarded. 461 Implementations MUST assume that an unsupported version uses an 462 unknown packet format. 464 Between different versions the following things are guaranteed to 465 remain constant are: 467 o the location and size of the Flags field, 469 o the location and value of the VERSION bit in the Flags field, 470 o the location and size of the Connection ID field, and 472 o the Version (or Supported Versions, Section 5.3) field. 474 All other values MUST be ignored when processing a packet that 475 contains an unsupported version. 477 5.2. Regular Packets 479 Each Regular packet contains additional header fields followed by an 480 encrypted payload, as shown below: 482 0 1 2 3 483 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 484 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 485 | [Version (32)] | 486 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 487 | Packet Number (8/16/32/48) ... 488 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 489 | {Encrypted Payload (*)} ... 490 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 492 Figure 2: Regular Packet 494 The fields in a Regular packet past the Common Header are the 495 following: 497 o QUIC Version: A 32-bit opaque tag that represents the version of 498 the QUIC protocol. Only present in the client-to-server 499 direction, and if the VERSION flag is set. Version Negotiation is 500 described in Section 6.1. 502 o Packet Number: The lower 8, 16, 32, or 48 bits of the packet 503 number, based on the PACKET_NUMBER_SIZE flag. Each Regular packet 504 is assigned a packet number by the sender. The first packet sent 505 by an endpoint MUST have a packet number of 1. 507 o Encrypted Payload: The remainder of a Regular packet is both 508 authenticated and encrypted once packet protection keys are 509 available. [QUIC-TLS] describes packet protection in detail. 510 After decryption, the plaintext consists of a sequence of frames, 511 as shown in Figure 3. Frames are described in Section 5.2.2. 513 0 1 2 3 514 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 515 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 516 | Frame 1 (*) ... 517 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 518 | Frame 2 (*) ... 519 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 520 ... 521 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 522 | Frame N (*) ... 523 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 525 Figure 3: Contents of Encrypted Payload 527 5.2.1. Packet Number Compression and Reconstruction 529 The complete packet number is a 64-bit unsigned number and is used as 530 part of a cryptographic nonce for packet encryption. To reduce the 531 number of bits required to represent the packet number over the wire, 532 at most 48 bits of the packet number are transmitted over the wire. 533 A QUIC endpoint MUST NOT reuse a complete packet number within the 534 same connection (that is, under the same cryptographic keys). If the 535 total number of packets transmitted in this connection reaches 2^64 - 536 1, the sender MUST close the connection by sending a CONNECTION_CLOSE 537 frame with the error code QUIC_SEQUENCE_NUMBER_LIMIT_REACHED 538 (connection termination is described in Section 6.4.) For 539 unambiguous reconstruction of the complete packet number by a 540 receiver from the lower-order bits, a QUIC sender MUST NOT have more 541 than 2^(packet_number_size - 2) in flight at any point in the 542 connection. In other words, 544 o If a sender sets PACKET_NUMBER_SIZE bits to 11, it MUST NOT have 545 more than (2^46) packets in flight. 547 o If a sender sets PACKET_NUMBER_SIZE bits to 10, it MUST NOT have 548 more than (2^30) packets in flight. 550 o If a sender sets PACKET_NUMBER_SIZE bits to 01, it MUST NOT have 551 more than (2^14) packets in flight. 553 o If a sender sets PACKET_NUMBER_SIZE bits to 00, it MUST NOT have 554 more than (2^6) packets in flight. 556 DISCUSS: Should the receiver be required to enforce this rule that 557 the sender MUST NOT exceed the inflight limit? Specifically, 558 should the receiver drop packets that are received outside this 559 window? 560 Any truncated packet number received from a peer MUST be 561 reconstructed as the value closest to the next expected packet 562 number from that peer. 564 (TODO: Clarify how packet number size can change mid-connection.) 566 5.2.2. Frames and Frame Types 568 A Regular packet MUST contain at least one frame, and MAY contain 569 multiple frames and multiple frame types. Frames MUST fit within a 570 single QUIC packet and MUST NOT span a QUIC packet boundary. Each 571 frame begins with a Frame Type byte, indicating its type, followed by 572 additional type-dependent fields: 574 0 1 2 3 575 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 576 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 577 | Type (8) | Type-Dependent Fields (*) ... 578 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 580 Figure 4: Generic Frame Layout 582 The following table lists currently defined frame types. Note that 583 the Frame Type byte in STREAM and ACK frames is used to carry other 584 frame-specific flags. For all other frames, the Frame Type byte 585 simply identifies the frame. These frames are explained in more 586 detail as they are referenced later in the document. 588 +---+------------------+------------------+--------------+ 589 | | Type-field value | Frame type | Definition | 590 +---+------------------+------------------+--------------+ 591 | | "1FDOOOSS" | STREAM | Section 7.1 | 592 | | | | | 593 | | "01NULLMM" | ACK | Section 7.2 | 594 | | | | | 595 | | 00000000 (0x00) | PADDING | Section 7.7 | 596 | | | | | 597 | | 00000001 (0x01) | RST_STREAM | Section 7.6 | 598 | | | | | 599 | | 00000010 (0x02) | CONNECTION_CLOSE | Section 7.9 | 600 | | | | | 601 | | 00000011 (0x03) | GOAWAY | Section 7.10 | 602 | | | | | 603 | | 00000100 (0x04) | WINDOW_UPDATE | Section 7.4 | 604 | | | | | 605 | | 00000101 (0x05) | BLOCKED | Section 7.5 | 606 | | | | | 607 | | 00000110 (0x06) | STOP_WAITING | Section 7.3 | 608 | | | | | 609 | | 00000111 (0x07) | PING | Section 7.8 | 610 +---+------------------+------------------+--------------+ 612 5.3. Version Negotiation Packet 614 A Version Negotiation packet is only sent by the server, MUST have 615 the VERSION flag set, and MUST include the full 64-bit Connection ID. 616 The remainder of the Version Negotiation packet is a list of 32-bit 617 versions which the server supports, as shown below. 619 0 1 2 3 620 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 621 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 622 | Supported Version 1 (32) ... 623 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 624 | Supported Version 2 (32) ... 625 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 626 ... 627 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 628 | Supported Version N (32) ... 629 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 631 Figure 5: Version Negotiation Packet 633 5.4. Public Reset Packet 635 A Public Reset packet MUST have the PUBLIC_RESET flag set, and MUST 636 include the full 64-bit connection ID. The content of the Public 637 Reset packet is TBD. 639 0 1 2 3 640 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 641 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 642 | Public Reset Fields (*) ... 643 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 645 Figure 6: Public Reset Packet 647 6. Life of a Connection 649 A QUIC connection is a single conversation between two QUIC 650 endpoints. QUIC's connection establishment intertwines version 651 negotiation with the crypto and transport handshakes to reduce 652 connection establishment latency, as described in Section 6.2. Once 653 established, a connection may migrate to a different IP or port at 654 either endpoint, due to NAT rebinding or mobility, as described in 655 Section 6.3. Finally a connection may be terminated by either 656 endpoint, as described in Section 6.4. 658 6.1. Version Negotiation 660 QUIC's connection establishment begins with version negotiation, 661 since all communication between the endpoints, including packet and 662 frame formats, relies on the two endpoints agreeing on a version. 664 A QUIC connection begins with a client sending a handshake packet. 665 The details of the handshake mechanisms are described in Section 6.2, 666 but all of the initial packets sent from the client to the server 667 MUST have the VERSION flag set, and MUST specify the version of the 668 protocol being used. 670 When the server receives a packet from a client with the VERSION flag 671 set, it compares the client's version to the versions it supports. 673 If the version selected by the client is not acceptable to the 674 server, the server discards the incoming packet and responds with a 675 version negotiation packet (Section 5.3). This includes the VERSION 676 flag and a list of versions that the server will accept. A server 677 MUST send a version negotiation packet for every packet that it 678 receives with an unacceptable version. 680 If the packet contains a version that is acceptable to the server, 681 the server proceeds with the handshake (Section 6.2). All subsequent 682 packets sent by the server MUST have the VERSION flag unset. This 683 commits the server to the version that the client selected. 685 When the client receives a Version Negotiation packet from the 686 server, it should select an acceptable protocol version. If the 687 server lists an acceptable version, the client selects that version 688 and resends all packets using that version. The resent packets MUST 689 use new packet numbers. These packets MUST continue to have the 690 VERSION flag set and MUST include the new negotiated protocol 691 version. 693 The client MUST set the VERSION flag on all packets until version 694 negotiation concludes. Version negotiation successfully concludes 695 when the client receives a packet from the server with the VERSION 696 flag unset. All subsequent packets sent by the client SHOULD have 697 the VERSION flag unset. 699 Once the server receives a packet from the client with the VERSION 700 flag unset, it MUST ignore the flag in subsequently received packets. 702 Version negotiation uses unprotected data. The result of the 703 negotiation MUST be revalidated once the cryptographic handshake has 704 completed (see Section 6.2.4). 706 6.2. Crypto and Transport Handshake 708 QUIC relies on a combined crypto and transport handshake to minimize 709 connection establishment latency. QUIC provides a dedicated stream 710 (Stream ID 1) to be used for performing a combined connection and 711 security handshake (streams are described in detail in Section 9). 712 The crypto handshake protocol encapsulates and delivers QUIC's 713 transport handshake to the peer on the crypto stream. The first QUIC 714 packet from the client to the server MUST carry handshake information 715 as data on Stream ID 1. 717 6.2.1. Transport Parameters and Options 719 During connection establishment, the handshake must negotiate various 720 transport parameters. The currently defined transport parameters are 721 described later in the document. 723 The transport component of the handshake is responsible for 724 exchanging and negotiating the following parameters for a QUIC 725 connection. Not all parameters are negotiated, some are parameters 726 sent in just one direction. These parameters and options are encoded 727 and handed off to the crypto handshake protocol to be transmitted to 728 the peer. 730 6.2.1.1. Encoding 732 (TODO: Describe format with example) 734 QUIC encodes the transport parameters and options as tag-value pairs, 735 all as 7-bit ASCII strings. QUIC parameter tags are listed below. 737 6.2.1.2. Required Transport Parameters 739 o SFCW: Stream Flow Control Window. The stream level flow control 740 byte offset advertised by the sender of this parameter. 742 o CFCW: Connection Flow Control Window. The connection level flow 743 control byte offset advertised by the sender of this parameter. 745 o MSPC: Maximum number of incoming streams per connection. 747 o ICSL: Idle timeout in seconds. The maximum value is 600 seconds 748 (10 minutes). 750 6.2.1.3. Optional Transport Parameters 752 o TCID: Indicates support for truncated Connection IDs. If sent by 753 a peer, indicates that connection IDs sent to the peer should be 754 truncated to 0 bytes. This is expected to commonly be used by an 755 endpoint where the 5-tuple is sufficient to identify a connection. 756 For instance, if the 5-tuple is unique at the client, the client 757 MAY send a TCID parameter to the server. When a TCID parameter is 758 received, an endpoint MAY choose to not send the connection ID on 759 subsequent packets. 761 o COPT: Connection Options are a repeated tag field. The field 762 contains any connection options being requested by the client or 763 server. These are typically used for experimentation and will 764 evolve over time. Example use cases include changing congestion 765 control algorithms and parameters such as initial window. (TODO: 766 List connection options.) 768 6.2.2. Proof of Source Address Ownership 770 Transport protocols commonly use a roundtrip time to verify a 771 client's address ownership for protection from malicious clients that 772 spoof their source address. QUIC uses a cookie, called the Source 773 Address Token (STK), to mostly eliminate this roundtrip of delay. 775 This technique is similar to TCP Fast Open's use of a cookie to avoid 776 a roundtrip of delay in TCP connection establishment. 778 On a new connection, a QUIC server sends an STK, which is opaque to 779 and stored by the client. On a subsequent connection, the client 780 echoes it in the transport handshake as proof of IP ownership. 782 A QUIC server also uses the STK to store server-designated connection 783 IDs for Stateless Rejects, to verify that an incoming connection 784 contains the correct connection ID. 786 A QUIC server MAY additionally store other data in a the STK, such as 787 measured bandwidth and measured minimum RTT to the client that may 788 help the server better bootstrap a subsequent connection from the 789 same client. A server MAY send an updated STK message mid-connection 790 to update server state that is stored at the client in the STK. 792 (TODO: Describe server and client actions on STK, encoding, 793 recommendations for what to put in an STK. Describe SCUP messages.) 795 6.2.3. Crypto Handshake Protocol Features 797 QUIC's current crypto handshake mechanism is documented in 798 [QUICCrypto]. QUIC does not restrict itself to using a specific 799 handshake protocol, so the details of a specific handshake protocol 800 are out of this document's scope. If not explicitly specified in the 801 application mapping, TLS is assumed to be the default crypto 802 handshake protocol, as described in [QUIC-TLS]. An application that 803 maps to QUIC MAY however specify an alternative crypto handshake 804 protocol to be used. 806 The following list of requirements and recommendations documents 807 properties of the current prototype handshake which should be 808 provided by any handshake protocol. 810 o The crypto handshake MUST ensure that the final negotiated key is 811 distinct for every connection between two endpoints. 813 o Transport Negotiation: The crypto handshake MUST provide a 814 mechanism for the transport component to exchange transport 815 parameters and Source Address Tokens. To avoid downgrade attacks, 816 the transport parameters sent and received MUST be verified before 817 the handshake completes successfully. 819 o Connection Establishment in 0-RTT: Since low-latency connection 820 establishment is a critical feature of QUIC, the QUIC handshake 821 protocol SHOULD attempt to achieve 0-RTT connection establishment 822 latency for repeated connections between the same endpoints. 824 o Source Address Spoofing Defense: Since QUIC handles source address 825 verification, the crypto protocol SHOULD NOT impose a separate 826 source address verification mechanism. 828 o Server Config Update: A QUIC server may refresh the source-address 829 token (STK) mid-connection, to update the information stored in 830 the STK at the client and to extend the period over which 0-RTT 831 connections can be established by the client. 833 o Certificate Compression: Early QUIC experience demonstrated that 834 compressing certificates exchanged during a handshake is valuable 835 in reducing latency. This additionally helps to reduce the 836 amplification attack footprint when a server sends a large set of 837 certificates, which is not uncommon with TLS. The crypto protocol 838 SHOULD compress certificates and any other information to minimize 839 the number of packets sent during a handshake. 841 6.2.4. Version Negotiation Validation 843 The following information used during the QUIC handshake MUST be 844 cryptographically verified by the crypto handshake protocol: 846 o Client's originally proposed version in its first packet. 848 o Server's version list in it's Version Negotiation packet, if one 849 was sent. 851 6.3. Connection Migration 853 QUIC connections are identified by their 64-bit Connection ID. 854 QUIC's consistent connection ID allows connections to survive changes 855 to the client's IP and/or port, such as those caused by client or 856 server migrating to a new network. QUIC also provides automatic 857 cryptographic verification of a rebound client, since the client 858 continues to use the same session key for encrypting and decrypting 859 packets. 861 DISCUSS: Simultaneous migration. Is this reasonable? 863 TODO: Perhaps move mitigation techniques from Security Considerations 864 here. 866 6.4. Connection Termination 868 Connections should remain open until they become idle for a pre- 869 negotiated period of time. A QUIC connection, once established, can 870 be terminated in one of three ways: 872 1. Explicit Shutdown: An endpoint sends a CONNECTION_CLOSE frame to 873 the peer initiating a connection termination. An endpoint may 874 send a GOAWAY frame to the peer prior to a CONNECTION_CLOSE to 875 indicate that the connection will soon be terminated. A GOAWAY 876 frame signals to the peer that any active streams will continue 877 to be processed, but the sender of the GOAWAY will not initiate 878 any additional streams and will not accept any new incoming 879 streams. On termination of the active streams, a 880 CONNECTION_CLOSE may be sent. If an endpoint sends a 881 CONNECTION_CLOSE frame while unterminated streams are active (no 882 FIN bit or RST_STREAM frames have been sent or received for one 883 or more streams), then the peer must assume that the streams were 884 incomplete and were abnormally terminated. 886 2. Implicit Shutdown: The default idle timeout for a QUIC connection 887 is 30 seconds, and is a required parameter (ICSL) in connection 888 negotiation. The maximum is 10 minutes. If there is no network 889 activity for the duration of the idle timeout, the connection is 890 closed. By default a CONNECTION_CLOSE frame will be sent. A 891 silent close option can be enabled when it is expensive to send 892 an explicit close, such as mobile networks that must wake up the 893 radio. 895 3. Abrupt Shutdown: An endpoint may send a Public Reset packet at 896 any time during the connection to abruptly terminate an active 897 connection. A Public Reset packet SHOULD only be used as a final 898 recourse. Commonly, a public reset is expected to be sent when a 899 packet on an established connection is received by an endpoint 900 that is unable decrypt the packet. For instance, if a server 901 reboots mid-connection and loses any cryptographic state 902 associated with open connections, and then receives a packet on 903 an open connection, it should send a Public Reset packet in 904 return. (TODO: articulate rules around when a public reset 905 should be sent.) 907 TODO: Connections that are terminated are added to a TIME_WAIT list 908 at the server, so as to absorb any straggler packets in the network. 909 Discuss TIME_WAIT list. 911 7. Frame Types and Formats 913 As described in Section 8, Regular packets contain one or more 914 frames. We now describe the various QUIC frame types that can be 915 present in a Regular packet. The use of these frames and various 916 frame header bits are described in subsequent sections. 918 7.1. STREAM Frame 920 STREAM frames implicitly create a stream and carry stream data. The 921 type byte for a STREAM frame contains embedded flags, and is 922 formatted as "1FDOOOSS". These bits are parsed as follows: 924 o The leftmost bit must be set to 1, indicating that this is a 925 STREAM frame. 927 o "F" is the FIN bit, which is used for stream termination. 929 o The "D" bit indicates whether a Data Length field is present in 930 the STREAM header. When set to 0, this field indicates that the 931 Stream Data field extends to the end of the packet. When set to 932 1, this field indicates that Data Length field contains the length 933 (in bytes) of the Stream Data field. The option to omit the 934 length should only be used when the packet is a "full-sized" 935 packet, to avoid the risk of corruption via padding. 937 o The "OOO" bits encode the length of the Offset header field as 0, 938 16, 24, 32, 40, 48, 56, or 64 bits long. 940 o The "SS" bits encode the length of the Stream ID header field as 941 8, 16, 24, or 32 bits. (DISCUSS: Consider making this 8, 16, 32, 942 64.) 944 A STREAM frame is shown below. 946 0 1 2 3 947 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 948 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 949 | Stream ID (8/16/24/32) ... 950 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 951 | Offset (0/16/24/32/40/48/56/64) ... 952 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 953 | [Data Length (16)] | 954 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 955 | Stream Data (*) ... 956 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 958 Figure 7: STREAM Frame Format 960 The STREAM frame contains the following fields: 962 o Stream ID: A variable-sized unsigned ID unique to this stream, 963 whose size is determined by the "SS" bits in the type byte. 965 o Offset: A variable-sized unsigned number specifying the byte 966 offset in the stream for the data in this STREAM frame. The first 967 byte in the stream has an offset of 0. 969 o Data Length: An optional 16-bit unsigned number specifying the 970 length of the Stream Data field in this STREAM frame. 972 o Stream Data: The bytes from the designated stream to be delivered. 974 A STREAM frame MUST have either non-zero data length or the FIN bit 975 set. 977 Stream multiplexing is achieved by interleaving STREAM frames from 978 multiple streams into one or more QUIC packets. A single QUIC packet 979 MAY bundle STREAM frames from multiple streams. 981 Implementation note: One of the benefits of QUIC is avoidance of 982 head-of-line blocking across multiple streams. When a packet loss 983 occurs, only streams with data in that packet are blocked waiting for 984 a retransmission to be received, while other streams can continue 985 making progress. Note that when data from multiple streams is 986 bundled into a single QUIC packet, loss of that packet blocks all 987 those streams from making progress. An implementation is therefore 988 advised to bundle as few streams as necessary in outgoing packets 989 without losing transmission efficiency to underfilled packets. 991 7.2. ACK Frame 993 Receivers send ACK frames to inform senders which packets they have 994 received, as well as which packets are considered missing. The ACK 995 frame contains between 1 and 256 ack blocks. Ack blocks are ranges 996 of acknowledged packets. 998 To limit the ACK blocks to the ones that haven't yet been received by 999 the sender, the sender periodically sends STOP_WAITING frames that 1000 signal the receiver to stop acking packets below a specified sequence 1001 number, raising the "least unacked" packet number at the receiver. A 1002 sender of an ACK frame thus reports only those ACK blocks between the 1003 received least unacked and the reported largest observed packet 1004 numbers. An endpoint SHOULD use the "Largest Acked" packet number it 1005 received to calculate the "Least Unacked Delta" value in any 1006 STOP_WAITING frame it might send. 1008 Unlike TCP SACKs, QUIC ACK blocks are irrevocable. Once a packet is 1009 acked, even if it does not appear in a future ACK frame, it is 1010 assumed to be acked. 1012 A sender MAY intentionally skip packet numbers to introduce entropy 1013 into the connection, to avoid opportunistic ack attacks. The sender 1014 MUST close the connection if an unsent packet number is acked. The 1015 format of the ACK frame is efficient at expressing blocks of missing 1016 packets; skipping packet numbers between 1 and 255 effectively 1017 provides up to 8 bits of efficient entropy on demand, which should be 1018 adequate protection against most opportunistic ack attacks. 1020 The type byte for a ACK frame contains embedded flags, and is 1021 formatted as "01NULLMM". These bits are parsed as follows: 1023 o The first two bits must be set to 01 indicating that this is an 1024 ACK frame. 1026 o The "N" bit indicates whether the frame has more than 1 ack range 1027 (i.e., whether the Ack Block Section contains a Num Blocks field). 1029 o The "U" bit is unused and MUST be set to zero. 1031 o The two "LL" bits encode the length of the Largest Acked field as 1032 1, 2, 4, or 6 bytes long. 1034 o The two "MM" bits encode the length of the Ack Block Length fields 1035 as 1, 2, 4, or 6 bytes long. 1037 An ACK frame is shown below. 1039 0 1 2 3 1040 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1041 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1042 | Largest Acked (8/16/32/48) ... 1043 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1044 | Ack Delay (16) | 1045 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1046 |[Num Blocks(8)]| Ack Block Section (*) ... 1047 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1048 | NumTS (8) | Timestamp Section (*) ... 1049 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1051 Figure 8: ACK Frame Format 1053 The fields in the ACK frame are as follows: 1055 o Largest Acked: A variable-sized unsigned value representing the 1056 largest packet number the peer is acking in this packet (typically 1057 the largest that the peer has seen thus far.) 1059 o Ack Delay: Time from when the largest acked, as indicated in the 1060 Largest Acked field, was received by this peer to when this ack 1061 was sent. 1063 o Num Blocks (opt): An optional 8-bit unsigned value specifying the 1064 number of additional ack blocks (besides the required First Ack 1065 Block) in this ACK frame. Only present if the 'N' flag bit is 1. 1067 o Ack Block Section: Contains one or more blocks of packet numbers 1068 which have been successfully received. See Section 7.2.1. 1070 o Num Timestamps: An unsigned 8-bit number specifying the total 1071 number of pairs in the Timestamp 1072 Section. 1074 o Timestamp Section: Contains zero or more timestamps reporting 1075 transit delay of received packets. See Section 7.2.2. 1077 7.2.1. Ack Block Section 1079 The Ack Block Section contains between one and 256 blocks of packet 1080 numbers which have been successfully received. If the Num Blocks 1081 field is absent, only the First Ack Block length is present in this 1082 section. Otherwise, the Num Blocks field indicates how many 1083 additional blocks follow the First Ack Block Length field. 1085 0 1 2 3 1086 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1087 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1088 | First Ack Block Length (8/16/32/48) ... 1089 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1090 | [Gap 1 (8)] | [Ack Block 1 Length (8/16/32/48)] ... 1091 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1092 | [Gap 2 (8)] | [Ack Block 2 Length (8/16/32/48)] ... 1093 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1094 ... 1095 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1096 | [Gap N (8)] | [Ack Block N Length (8/16/32/48)] ... 1097 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1099 Figure 9: Ack Block Section 1101 The fields in the Ack Block Section are: 1103 o First Ack Block Length: An unsigned packet number delta that 1104 indicates the number of contiguous additional packets being acked 1105 starting at the Largest Acked. 1107 o Gap To Next Block (opt, repeated): An unsigned number specifying 1108 the number of contiguous missing packets from the end of the 1109 previous ack block to the start of the next. 1111 o Ack Block Length (opt, repeated): An unsigned packet number delta 1112 that indicates the number of contiguous packets being acked 1113 starting after the end of the previous gap. Along with the 1114 previous field, this field is repeated "Num Blocks" times. 1116 7.2.2. Timestamp Section 1118 The Timestamp Section contains between zero and 255 measurements of 1119 packet receive times relative to the beginning of the connection. 1121 0 1 2 3 1122 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1123 +-+-+-+-+-+-+-+-+ 1124 | [Delta LA (8)]| 1125 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1126 | [First Timestamp (32)] | 1127 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1128 |[Delta LA 1(8)]| [Time Since Previous 1 (16)] | 1129 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1130 |[Delta LA 2(8)]| [Time Since Previous 2 (16)] | 1131 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1132 ... 1133 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1134 |[Delta LA N(8)]| [Time Since Previous N (16)] | 1135 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1137 Figure 10: Timestamp Section 1139 The fields in the Timestamp Section are: 1141 o Delta Largest Acked (opt): An optional 8-bit unsigned packet 1142 number delta specifying the delta between the largest acked and 1143 the first packet whose timestamp is being reported. In other 1144 words, this first packet number may be computed as (Largest Acked 1145 - Delta Largest Acked.) 1147 o First Timestamp (opt): An optional 32-bit unsigned value 1148 specifying the time delta in microseconds, from the beginning of 1149 the connection to the arrival of the packet indicated by Delta 1150 Largest Acked. 1152 o Delta Largest Acked 1..N (opt, repeated): (Same as above.) 1153 o Time Since Previous Timestamp 1..N(opt, repeated): An optional 1154 16-bit unsigned value specifying time delta from the previous 1155 reported timestamp. It is encoded in the same format as the Ack 1156 Delay. Along with the previous field, this field is repeated "Num 1157 Timestamps" times. 1159 7.2.2.1. Time Format 1161 DISCUSS_AND_REPLACE: Perhaps make this format simpler. 1163 The time format used in the ACK frame above is a 16-bit unsigned 1164 float with 11 explicit bits of mantissa and 5 bits of explicit 1165 exponent, specifying time in microseconds. The bit format is loosely 1166 modeled after IEEE 754. For example, 1 microsecond is represented as 1167 0x1, which has an exponent of zero, presented in the 5 high order 1168 bits, and mantissa of 1, presented in the 11 low order bits. When 1169 the explicit exponent is greater than zero, an implicit high-order 1170 12th bit of 1 is assumed in the mantissa. For example, a floating 1171 value of 0x800 has an explicit exponent of 1, as well as an explicit 1172 mantissa of 0, but then has an effective mantissa of 4096 (12th bit 1173 is assumed to be 1). Additionally, the actual exponent is one-less 1174 than the explicit exponent, and the value represents 4096 1175 microseconds. Any values larger than the representable range are 1176 clamped to 0xFFFF. 1178 7.3. STOP_WAITING Frame 1180 The STOP_WAITING frame (type=0x06) is sent to inform the peer that it 1181 should not continue to wait for packets with packet numbers lower 1182 than a specified value. The packet number is encoded in 1, 2, 4 or 6 1183 bytes, using the same coding length as is specified for the packet 1184 number for the enclosing packet's header (specified in the QUIC Frame 1185 packet's Flags field.) The frame is as follows: 1187 0 1 2 3 1188 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1189 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1190 | Least Unacked Delta (8/16/32/48) ... 1191 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1193 Figure 11: STOP_WAITING Frame Format 1195 The STOP_WAITING frame contains a single field: 1197 o Least Unacked Delta: A variable-length packet number delta with 1198 the same length as the packet header's packet number. Subtract it 1199 from the complete packet number of the enclosing packet to 1200 determine the least unacked packet number. The resulting least 1201 unacked packet number is the earliest packet for which the sender 1202 is still awaiting an ack. If the receiver is missing any packets 1203 earlier than this packet, the receiver SHOULD consider those 1204 packets to be irrecoverably lost and MUST NOT report those packets 1205 as missing in subsequent acks. 1207 7.4. WINDOW_UPDATE Frame 1209 The WINDOW_UPDATE frame (type=0x04) informs the peer of an increase 1210 in an endpoint's flow control receive window. The Stream ID can be 1211 zero, indicating this WINDOW_UPDATE applies to the connection level 1212 flow control window, or non-zero, indicating that the specified 1213 stream should increase its flow control window. The frame is as 1214 follows: 1216 0 1 2 3 1217 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1218 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1219 | Stream ID (32) | 1220 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1221 | | 1222 + Byte Offset (64) + 1223 | | 1224 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1226 The fields in the WINDOW_UPDATE frame are as follows: 1228 o Stream ID: ID of the stream whose flow control windows is being 1229 updated, or 0 to specify the connection-level flow control window. 1231 o Byte offset: A 64-bit unsigned integer indicating the absolute 1232 byte offset of data which can be sent on the given stream. In the 1233 case of connection level flow control, the cumulative number of 1234 bytes which can be sent on all currently open streams. 1236 7.5. BLOCKED Frame 1238 A sender sends a BLOCKED frame (type=0x05) when it is ready to send 1239 data (and has data to send), but is currently flow control blocked. 1240 BLOCKED frames are purely informational frames, but extremely useful 1241 for debugging purposes. A receiver of a BLOCKED frame should simply 1242 discard it (after possibly printing a helpful log message). The 1243 frame is as follows: 1245 0 1 2 3 1246 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1247 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1248 | Stream ID (32) | 1249 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1251 The BLOCKED frame contains a single field: 1253 o Stream ID: A 32-bit unsigned number indicating the stream which is 1254 flow control blocked. A non-zero Stream ID field specifies the 1255 stream that is flow control blocked. When zero, the Stream ID 1256 field indicates that the connection is flow control blocked. 1258 7.6. RST_STREAM Frame 1260 An endpoint may use a RST_STREAM frame (type=0x01) to abruptly 1261 terminate a stream. The frame is as follows: 1263 0 1 2 3 1264 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1265 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1266 | Stream ID (32) | 1267 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1268 | | 1269 + Byte Offset (64) + 1270 | | 1271 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1272 | Error Code (32) | 1273 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1275 The fields are: 1277 o Stream ID: The 32-bit Stream ID of the stream being terminated. 1279 o Byte offset: A 64-bit unsigned integer indicating the absolute 1280 byte offset of the end of data written on this stream by the 1281 RST_STREAM sender. 1283 o Error code: A 32-bit error code which indicates why the stream is 1284 being closed. 1286 7.7. PADDING Frame 1288 The PADDING frame (type=0x00) pads a packet with 0x00 bytes. When 1289 this frame is encountered, the rest of the packet is expected to be 1290 padding bytes. The frame contains 0x00 bytes and extends to the end 1291 of the QUIC packet. A PADDING frame has no additional fields. 1293 7.8. PING frame 1295 Endpoints can use PING frames (type=0x07) to verify that their peers 1296 are still alive or to check reachability to the peer. The PING frame 1297 contains no additional fields. The receiver of a PING frame simply 1298 needs to ACK the packet containing this frame. The PING frame SHOULD 1299 be used to keep a connection alive when a stream is open. The 1300 default is to send a PING frame after 15 seconds of quiescence. A 1301 PING frame has no additional fields. 1303 7.9. CONNECTION_CLOSE frame 1305 An endpoint sends a CONNECTION_CLOSE frame (type=0x02) to notify its 1306 peer that the connection is being closed. If there are open streams 1307 that haven't been explicitly closed, they are implicitly closed when 1308 the connection is closed. (Ideally, a GOAWAY frame would be sent 1309 with enough time that all streams are torn down.) The frame is as 1310 follows: 1312 0 1 2 3 1313 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1314 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1315 | Error Code (32) | 1316 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1317 | Reason Phrase Length (16) | [Reason Phrase (*)] ... 1318 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1320 The fields of a CONNECTION_CLOSE frame are as follows: 1322 o Error Code: A 32-bit error code which indicates the reason for 1323 closing this connection. 1325 o Reason Phrase Length: A 16-bit unsigned number specifying the 1326 length of the reason phrase. This may be zero if the sender 1327 chooses to not give details beyond the Error Code. 1329 o Reason Phrase: An optional human-readable explanation for why the 1330 connection was closed. 1332 7.10. GOAWAY Frame 1334 An endpoint may use a GOAWAY frame (type=0x03) to notify its peer 1335 that the connection should stop being used, and will likely be closed 1336 in the future. The endpoints will continue using any active streams, 1337 but the sender of the GOAWAY will not initiate any additional 1338 streams, and will not accept any new streams. The frame is as 1339 follows: 1341 0 1 2 3 1342 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1343 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1344 | Error Code (32) | 1345 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1346 | Last Good Stream ID (32) | 1347 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1348 | Reason Phrase Length (16) | [Reason Phrase (*)] ... 1349 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1351 The fields of a GOAWAY frame are as follows: 1353 o Frame type: An 8-bit value that must be set to 0x03 specifying 1354 that this is a GOAWAY frame. 1356 o Error Code: A 32-bit field error code which indicates the reason 1357 for closing this connection. 1359 o Last Good Stream ID: The last Stream ID which was accepted by the 1360 sender of the GOAWAY message. If no streams were replied to, this 1361 value must be set to 0. 1363 o Reason Phrase Length: A 16-bit unsigned number specifying the 1364 length of the reason phrase. This may be zero if the sender 1365 chooses to not give details beyond the error code. 1367 o Reason Phrase: An optional human-readable explanation for why the 1368 connection was closed. 1370 8. Packetization and Reliability 1372 The maximum packet size for QUIC is the maximum size of the encrypted 1373 payload of the resulting UDP datagram. All QUIC packets SHOULD be 1374 sized to fit within the path's MTU to avoid IP fragmentation. The 1375 recommended default maximum packet size is 1350 bytes for IPv6 and 1376 1370 bytes for IPv4. To optimize better, endpoints MAY use PLPMTUD 1377 [RFC4821] for detecting the path's MTU and setting the maximum packet 1378 size appropriately. 1380 A sender bundles one or more frames in a Regular QUIC packet. A 1381 sender MAY bundle any set of frames in a packet. All QUIC packets 1382 MUST contain a packet number and MAY contain one or more frames 1383 (Section 5.2.2). Packet numbers MUST be unique within a connection 1384 and MUST NOT be reused within the same connection. Packet numbers 1385 MUST be assigned to packets in a strictly monotonically increasing 1386 order. The initial packet number used, at both the client and the 1387 server, MUST be 0. That is, the first packet in both directions of 1388 the connection MUST have a packet number of 0. 1390 A sender SHOULD minimize per-packet bandwidth and computational costs 1391 by bundling as many frames as possible within a QUIC packet. A 1392 sender MAY wait for a short period of time to bundle multiple frames 1393 before sending a packet that is not maximally packed, to avoid 1394 sending out large numbers of small packets. An implementation may 1395 use heuristics about expected application sending behavior to 1396 determine whether and for how long to wait. This waiting period is 1397 an implementation decision, and an implementation should be careful 1398 to delay conservatively, since any delay is likely to increase 1399 application-visible latency. 1401 Regular QUIC packets are "containers" of frames; a packet is never 1402 retransmitted whole, but frames in a lost packet may be rebundled and 1403 transmitted in a subsequent packet as necessary. 1405 A packet may contain frames and/or application data, only some of 1406 which may require reliability. When a packet is detected as lost, 1407 the sender re-sends any frames as necessary: 1409 o All application data sent in STREAM frames MUST be retransmitted, 1410 with one exception. When an endpoint sends a RST_STREAM frame, 1411 data outstanding on that stream SHOULD NOT be retransmitted, since 1412 subsequent data on this stream is expected to not be delivered by 1413 the receiver. 1415 o ACK, STOP_WAITING, and PADDING frames MUST NOT be retransmitted. 1416 New frames of these types may however be bundled with any outgoing 1417 packet. 1419 o All other frames MUST be retransmitted. 1421 Upon detecting losses, a sender MUST take appropriate congestion 1422 control action. The details of loss detection and congestion control 1423 are described in [QUIC-RECOVERY]. 1425 A receiver acknowledges receipt of a received packet by sending one 1426 or more ACK frames containing the packet number of the received 1427 packet. To avoid perpetual acking between endpoints, a receiver MUST 1428 NOT generate an ack in response to every packet containing only ACK 1429 frames. However, since it is possible that an endpoint sends only 1430 packets containing ACK frame (or other non-retransmittable frames), 1431 the receiving peer MAY send an ACK frame after a reasonable number 1432 (currently 20) of such packets have been received. 1434 Strategies and implications of the frequency of generating 1435 acknowledgments are discussed in more detail in [QUIC-RECOVERY]. 1437 9. Streams: QUIC's Data Structuring Abstraction 1439 Streams in QUIC provide a lightweight, ordered, and bidirectional 1440 byte-stream abstraction. Streams can be created either by the client 1441 or the server, can concurrently send data interleaved with other 1442 streams, and can be cancelled. QUIC's stream lifetime is modeled 1443 closely after HTTP/2's [RFC7540]. Streams are independent of each 1444 other in delivery order. That is, data that is received on a stream 1445 is delivered in order within that stream, but there is no particular 1446 delivery order across streams. Transmit ordering among streams is 1447 left to the implementation. QUIC streams are considered lightweight 1448 in that the creation and destruction of streams are expected to have 1449 minimal bandwidth and computational cost. A single STREAM frame may 1450 create, carry data for, and terminate a stream, or a stream may last 1451 the entire duration of a connection. Implementations are therefore 1452 advised to keep these extremes in mind and to implement stream 1453 creation and destruction to be as lightweight as possible. 1455 An alternative view of QUIC streams is as an elastic "message" 1456 abstraction, similar to the way ephemeral streams are used in SST 1457 [SST], which may be a more appealing description for some 1458 applications. 1460 9.1. Life of a Stream 1462 The semantics of QUIC streams is based on HTTP/2 streams, and the 1463 lifecycle of a QUIC stream therefore closely follows that of an 1464 HTTP/2 stream [RFC7540], with some differences to accommodate the 1465 possibility of out-of-order delivery due to the use of multiple 1466 streams in QUIC. The lifecycle of a QUIC stream is shown in the 1467 following figure and described below. 1469 app +--------+ 1470 reserve_stream | | 1471 ,--------------| idle | 1472 / | | 1473 / +--------+ 1474 V | 1475 +----------+ send data/ | 1476 | | recv data | send data/ 1477 ,---| reserved |------------. | recv data 1478 | | | \ | 1479 | +----------+ v v 1480 | recv FIN/ +--------+ send FIN/ 1481 | app read_close | | app write_close 1482 | ,---------| open |-----------. 1483 | / | | \ 1484 | v +--------+ v 1485 | +----------+ | +----------+ 1486 | | half | | | half | 1487 | | closed | | send RST/ | closed | 1488 | | (remote) | | recv RST | (local) | 1489 | +----------+ | +----------+ 1490 | | | | 1491 | | recv FIN/ | send FIN/ | 1492 | | app write_close/ | app read_close/ | 1493 | | send RST/ v send RST/ | 1494 | | recv RST +--------+ recv RST | 1495 | send RST/ `------------->| |<---------------' 1496 | recv RST | closed | 1497 `-------------------------->| | 1498 +--------+ 1500 send: endpoint sends this frame 1501 recv: endpoint receives this frame 1503 data: application data in a STREAM frame 1504 FIN: FIN flag in a STREAM frame 1505 RST: RST_STREAM frame 1507 app: application API signals to QUIC 1508 reserve_stream: causes a StreamID to be reserved for later use 1509 read_close: causes stream to be half-closed without receiving a FIN 1510 write_close: causes stream to be half-closed without sending a FIN 1512 Figure 12: Lifecycle of a stream 1514 Note that this diagram shows stream state transitions and the frames 1515 and flags that affect those transitions only. For the purpose of 1516 state transitions, the FIN flag is processed as a separate event to 1517 the frame that bears it; a STREAM frame with the FIN flag set can 1518 cause two state transitions. When the FIN bit is sent on an empty 1519 STREAM frame, the offset in the STREAM frame MUST be one greater than 1520 the last data byte sent on this stream. 1522 Both endpoints have a subjective view of the state of a stream that 1523 could be different when frames are in transit. Endpoints do not 1524 coordinate the creation of streams; they are created unilaterally by 1525 either endpoint. The negative consequences of a mismatch in states 1526 are limited to the "closed" state after sending RST_STREAM, where 1527 frames might be received for some time after closing. 1529 Streams have the following states: 1531 9.1.1. idle 1533 All streams start in the "idle" state. 1535 The following transitions are valid from this state: 1537 Sending or receiving a STREAM frame causes the stream to become 1538 "open". The stream identifier is selected as described in 1539 Section 9.2. The same STREAM frame can also cause a stream to 1540 immediately become "half-closed". 1542 An application can reserve an idle stream for later use. The stream 1543 state for the reserved stream transitions to "reserved". 1545 Receiving any frame other than STREAM or RST_STREAM on a stream in 1546 this state MUST be treated as a connection error (Section 11) of type 1547 YYYY. 1549 9.1.2. reserved 1551 A stream in this state has been reserved for later use by the 1552 application. In this state only the following transitions are 1553 possible: 1555 o Sending or receiving a STREAM frame causes the stream to become 1556 "open". 1558 o Sending or receiving a RST_STREAM frame causes the stream to 1559 become "closed". 1561 9.1.3. open 1563 A stream in the "open" state may be used by both peers to send frames 1564 of any type. In this state, a sending peer must observe the flow- 1565 control limit advertised by its receiving peer (Section 10). 1567 From this state, either endpoint can send a frame with the FIN flag 1568 set, which causes the stream to transition into one of the "half- 1569 closed" states. An endpoint sending an FIN flag causes the stream 1570 state to become "half-closed (local)". An endpoint receiving a FIN 1571 flag causes the stream state to become "half-closed (remote)"; the 1572 receiving endpoint MUST NOT process the FIN flag until all preceding 1573 data on the stream has been received. 1575 Either endpoint can send a RST_STREAM frame from this state, causing 1576 it to transition immediately to "closed". 1578 9.1.4. half-closed (local) 1580 A stream that is in the "half-closed (local)" state MUST NOT be used 1581 for sending STREAM frames; WINDOW_UPDATE and RST_STREAM MAY be sent 1582 in this state. 1584 A stream transitions from this state to "closed" when a frame that 1585 contains an FIN flag is received or when either peer sends a 1586 RST_STREAM frame. 1588 An endpoint can receive any type of frame in this state. Providing 1589 flow-control credit using WINDOW_UPDATE frames is necessary to 1590 continue receiving flow-controlled frames. In this state, a receiver 1591 MAY ignore WINDOW_UPDATE frames for this stream, which might arrive 1592 for a short period after a frame bearing the FIN flag is sent. 1594 9.1.5. half-closed (remote) 1596 A stream that is "half-closed (remote)" is no longer being used by 1597 the peer to send any data. In this state, a sender is no longer 1598 obligated to maintain a receiver stream-level flow-control window. 1600 If an endpoint receives any STREAM frames for a stream that is in 1601 this state, it MUST close the connection with a 1602 QUIC_STREAM_DATA_AFTER_TERMINATION error (Section 11). 1604 A stream in this state can be used by the endpoint to send frames of 1605 any type. In this state, the endpoint continues to observe 1606 advertised stream-level and connection-level flow-control limits 1607 (Section 10). 1609 A stream can transition from this state to "closed" by sending a 1610 frame that contains a FIN flag or when either peer sends a RST_STREAM 1611 frame. 1613 9.1.6. closed 1615 The "closed" state is the terminal state. 1617 A final offset is present in both a frame bearing a FIN flag and in a 1618 RST_STREAM frame. Upon sending either of these frames for a stream, 1619 the endpoint MUST NOT send a STREAM frame carrying data beyond the 1620 final offset. 1622 An endpoint that receives any frame for this stream after receiving 1623 either a FIN flag and all stream data preceding it, or a RST_STREAM 1624 frame, MUST quietly discard the frame, with one exception. If a 1625 STREAM frame carrying data beyond the received final offset is 1626 received, the endpoint MUST close the connection with a 1627 QUIC_STREAM_DATA_AFTER_TERMINATION error (Section 11). 1629 An endpoint that receives a RST_STREAM frame (and which has not sent 1630 a FIN or a RST_STREAM) MUST immediately respond with a RST_STREAM 1631 frame, and MUST NOT send any more data on the stream. This endpoint 1632 may continue receiving frames for the stream on which a RST_STREAM is 1633 received. 1635 If this state is reached as a result of sending a RST_STREAM frame, 1636 the peer that receives the RST_STREAM might have already sent - or 1637 enqueued for sending - frames on the stream that cannot be withdrawn. 1638 An endpoint MUST ignore frames that it receives on closed streams 1639 after it has sent a RST_STREAM frame. An endpoint MAY choose to 1640 limit the period over which it ignores frames and treat frames that 1641 arrive after this time as being in error. 1643 STREAM frames received after sending RST_STREAM are counted toward 1644 the connection and stream flow-control windows. Even though these 1645 frames might be ignored, because they are sent before their sender 1646 receives the RST_STREAM, the sender will consider the frames to count 1647 against its flow-control windows. 1649 In the absence of more specific guidance elsewhere in this document, 1650 implementations SHOULD treat the receipt of a frame that is not 1651 expressly permitted in the description of a state as a connection 1652 error (Section 11). Frames of unknown types are ignored. 1654 (TODO: QUIC_STREAM_NO_ERROR is a special case. Write it up.) 1656 9.2. Stream Identifiers 1658 Streams are identified by an unsigned 32-bit integer, referred to as 1659 the StreamID. To avoid StreamID collision, clients MUST initiate 1660 streams usinge odd-numbered StreamIDs; streams initiated by the 1661 server MUST use even-numbered StreamIDs. 1663 A StreamID of zero (0x0) is reserved and used for connection-level 1664 flow control frames (Section 10); the StreamID of zero cannot be used 1665 to establish a new stream. 1667 StreamID 1 (0x1) is reserved for the crypto handshake. StreamID 1 1668 MUST NOT be used for application data, and MUST be the first client- 1669 initiated stream. 1671 Streams MUST be created or reserved in sequential order, but MAY be 1672 used in arbitrary order. A QUIC endpoint MUST NOT reuse a StreamID 1673 on a given connection. 1675 9.3. Stream Concurrency 1677 An endpoint can limit the number of concurrently active incoming 1678 streams by setting the MSPC parameter (see Section 6.2.1.2) in the 1679 transport parameters. The maximum concurrent streams setting is 1680 specific to each endpoint and applies only to the peer that receives 1681 the setting. That is, clients specify the maximum number of 1682 concurrent streams the server can initiate, and servers specify the 1683 maximum number of concurrent streams the client can initiate. 1685 Streams that are in the "open" state or in either of the "half- 1686 closed" states count toward the maximum number of streams that an 1687 endpoint is permitted to open. Streams in any of these three states 1688 count toward the limit advertised in the MSPC setting. 1690 Endpoints MUST NOT exceed the limit set by their peer. An endpoint 1691 that receives a STREAM frame that causes its advertised concurrent 1692 stream limit to be exceeded MUST treat this as a stream error of type 1693 QUIC_TOO_MANY_OPEN_STREAMS (Section 11). 1695 9.4. Sending and Receiving Data 1697 Once a stream is created, endpoints may use the stream to send and 1698 receive data. Each endpoint may send a series of STREAM frames 1699 encapsulating data on a stream until the stream is terminated in that 1700 direction. Streams are an ordered byte-stream abstraction, and they 1701 have no other structure within them. STREAM frame boundaries are not 1702 expected to be preserved in retransmissions from the sender or during 1703 delivery to the application at the receiver. 1705 When new data is to be sent on a stream, a sender MUST set the 1706 encapsulating STREAM frame's offset field to the stream offset of the 1707 first byte of this new data. The first byte of data that is sent on 1708 a stream has the stream offset 0. A receiver MUST ensure that 1709 received stream data is delivered to the application as an ordered 1710 byte-stream. Data received out of order MUST be buffered for later 1711 delivery, as long as it is not in violation of the receiver's flow 1712 control limits. 1714 An endpoint MUST NOT send any stream data without consulting the 1715 congestion controller and the flow controller, with the following two 1716 exceptions. 1718 o The crypto handshake stream, Stream 1, MUST NOT be subject to 1719 congestion control or connection-level flow control, but MUST be 1720 subject to stream-level flow control. 1722 o An application MAY exclude specific stream IDs from connection- 1723 level flow control. If so, these streams MUST NOT be subject to 1724 connection-level flow control. 1726 Flow control is described in detail in Section 10, and congestion 1727 control is described in the companion document [QUIC-RECOVERY]. 1729 10. Flow Control 1731 It is necessary to limit the amount of data that a sender may have 1732 outstanding at any time, so as to prevent a fast sender from 1733 overwhelming a slow receiver, or to prevent a malicious sender from 1734 consuming significant resources at a receiver. This section 1735 describes QUIC's flow-control mechanisms. 1737 QUIC employs a credit-based flow-control scheme similar to HTTP/2's 1738 flow control [RFC7540]. A receiver advertises the number of octets 1739 it is prepared to receive on a given stream and for the entire 1740 connection. This leads to two levels of flow control in QUIC: (i) 1741 Connection flow control, which prevents senders from exceeding a 1742 receiver's buffer capacity for the connection, and (ii) Stream flow 1743 control, which prevents a single stream from consuming the entire 1744 receive buffer for a connection. 1746 A receiver sends WINDOW_UPDATE frames to the sender to advertise 1747 additional credit, for both connection and stream flow control. A 1748 receiver advertises the maximum absolute byte offset in the stream or 1749 in the connection which the receiver is willing to receive. 1751 The initial flow control credit is 65536 bytes for both the stream 1752 and connection flow controllers. 1754 A receiver MAY advertise a larger offset at any point in the 1755 connection by sending a WINDOW_UPDATE frame. A receiver MUST NOT 1756 renege on an advertisement; that is, once a receiver advertises an 1757 offset via a WINDOW_UPDATE frame, it MUST NOT subsequently advertise 1758 a smaller offset. A sender may receive WINDOW_UPDATE frames out of 1759 order; a sender MUST therefore ignore any reductions in flow control 1760 credit. 1762 A sender MUST send BLOCKED frames to indicate it has data to write 1763 but is blocked by lack of connection or stream flow control credit. 1764 BLOCKED frames are expected to be sent infrequently in common cases, 1765 but they are considered useful for debugging and monitoring purposes. 1767 A receiver advertises credit for a stream by sending a WINDOW_UPDATE 1768 frame with the StreamID set appropriately. A receiver may simply use 1769 the current received offset to determine the flow control offset to 1770 be advertised. 1772 Connection flow control is a limit to the total bytes of stream data 1773 sent in STREAM frames. A receiver advertises credit for a connection 1774 by sending a WINDOW_UPDATE frame with the StreamID set to zero 1775 (0x00). A receiver may maintain a cumulative sum of bytes received 1776 cumulatively on all streams to determine the value of the connection 1777 flow control offset to be advertised in WINDOW_UPDATE frames. A 1778 sender may maintain a cumulative sum of stream data bytes sent to 1779 impose the connection flow control limit. 1781 10.1. Edge Cases and Other Considerations 1783 There are some edge cases which must be considered when dealing with 1784 stream and connection level flow control. Given enough time, both 1785 endpoints must agree on flow control state. If one end believes it 1786 can send more than the other end is willing to receive, the 1787 connection will be torn down when too much data arrives. Conversely 1788 if a sender believes it is blocked, while endpoint B expects more 1789 data can be received, then the connection can be in a deadlock, with 1790 the sender waiting for a WINDOW_UPDATE which will never come. 1792 10.1.1. Mid-stream RST_STREAM 1794 On receipt of an RST_STREAM frame, an endpoint will tear down state 1795 for the matching stream and ignore further data arriving on that 1796 stream. This could result in the endpoints getting out of sync, 1797 since the RST_STREAM frame may have arrived out of order and there 1798 may be further bytes in flight. The data sender would have counted 1799 the data against its connection level flow control budget, but a 1800 receiver that has not received these bytes would not know to include 1801 them as well. The receiver must learn of the number of bytes that 1802 were sent on the stream to make the same adjustment in its connection 1803 flow controller. 1805 To avoid this de-synchronization, a RST_STREAM sender MUST include 1806 the final byte offset sent on the stream in the RST_STREAM frame. On 1807 receiving a RST_STREAM frame, a receiver definitively knows how many 1808 bytes were sent on that stream before the RST_STREAM frame, and the 1809 receiver MUST use the final offset to account for all bytes sent on 1810 the stream in its connection level flow controller. 1812 10.1.2. Response to a RST_STREAM 1814 Since streams are bidirectional, a sender of a RST_STREAM needs to 1815 know how many bytes the peer has sent on the stream. If an endpoint 1816 receives a RST_STREAM frame and has sent neither a FIN nor a 1817 RST_STREAM, it MUST send a RST_STREAM in response, bearing the offset 1818 of the last byte sent on this stream as the final offset. 1820 10.1.3. Offset Increment 1822 This document leaves when and how many bytes to advertise in a 1823 WINDOW_UPDATE to the implementation, but offers a few considerations. 1824 WINDOW_UPDATE frames constitute overhead, and therefore, sending a 1825 WINDOW_UPDATE with small offset increments is undesirable. At the 1826 same time, sending WINDOW_UPDATES with large offset increments 1827 requires the sender to commit to that amount of buffer. 1828 Implementations must find the correct tradeoff between these sides to 1829 determine how large an offset increment to send in a WINDOW_UPDATE. 1831 A receiver MAY use an autotuning mechanism to tune the size of the 1832 offset increment to advertise based on a roundtrip time estimate and 1833 the rate at which the receiving application consumes data, similar to 1834 common TCP implementations. 1836 10.1.4. BLOCKED frames 1838 If a sender does not receive a WINDOW_UPDATE frame when it has run 1839 out of flow control credit, the sender will be blocked and MUST send 1840 a BLOCKED frame. A BLOCKED frame is expected to be useful for 1841 debugging at the receiver. A receiver SHOULD NOT wait for a BLOCKED 1842 frame before sending with a WINDOW_UPDATE, since doing so will cause 1843 at least one roundtrip of quiescence. For smooth operation of the 1844 congestion controller, it is generally considered best to not let the 1845 sender go into quiescence if avoidable. To avoid blocking a sender, 1846 and to reasonably account for the possibiity of loss, a receiver 1847 should send a WINDOW_UPDATE frame at least two roundtrips before it 1848 expects the sender to get blocked. 1850 11. Error Codes 1852 Error codes are 32 bits long, with the first two bits indicating the 1853 source of the error code: 1855 0x0000-0x3FFF: Application-specific error codes. Defined by each 1856 application-layer protocol. 1858 0x4000-0x7FFF: Reserved for host-local error codes. These codes 1859 MUST NOT be sent to a peer, but MAY be used in API return codes 1860 and logs. 1862 0x8000-0xAFFF: QUIC transport error codes, including packet 1863 protection errors. Applicable to all uses of QUIC. 1865 0xB000-0xFFFF: Cryptographic error codes. Defined by the crypto 1866 handshake protocol in use. 1868 This section lists the defined QUIC transport error codes that may be 1869 used in a CONNECTION_CLOSE or RST_STREAM frame. Error codes share a 1870 common code space. Some error codes apply only to either streams or 1871 the entire connection and have no defined semantics in the other 1872 context. 1874 QUIC_INTERNAL_ERROR (0x8001): Connection has reached an invalid 1875 state. 1877 QUIC_STREAM_DATA_AFTER_TERMINATION (0x8002): There were data frames 1878 after the a fin or reset. 1880 QUIC_INVALID_PACKET_HEADER (0x8003): Control frame is malformed. 1882 QUIC_INVALID_FRAME_DATA (0x8004): Frame data is malformed. 1884 QUIC_MISSING_PAYLOAD (0x8030): The packet contained no payload. 1886 QUIC_INVALID_STREAM_DATA (0x802e): STREAM frame data is malformed. 1888 QUIC_OVERLAPPING_STREAM_DATA (0x8057): STREAM frame data overlaps 1889 with buffered data. 1891 QUIC_UNENCRYPTED_STREAM_DATA (0x803d): Received STREAM frame data is 1892 not encrypted. 1894 QUIC_MAYBE_CORRUPTED_MEMORY (0x8059): Received a frame which is 1895 likely the result of memory corruption. 1897 QUIC_INVALID_RST_STREAM_DATA (0x8006): RST_STREAM frame data is 1898 malformed. 1900 QUIC_INVALID_CONNECTION_CLOSE_DATA (0x8007): CONNECTION_CLOSE frame 1901 data is malformed. 1903 QUIC_INVALID_GOAWAY_DATA (0x8008): GOAWAY frame data is malformed. 1905 QUIC_INVALID_WINDOW_UPDATE_DATA (0x8039): WINDOW_UPDATE frame data 1906 is malformed. 1908 QUIC_INVALID_BLOCKED_DATA (0x803a): BLOCKED frame data is malformed. 1910 QUIC_INVALID_STOP_WAITING_DATA (0x803c): STOP_WAITING frame data is 1911 malformed. 1913 QUIC_INVALID_PATH_CLOSE_DATA (0x804e): PATH_CLOSE frame data is 1914 malformed. 1916 QUIC_INVALID_ACK_DATA (0x8009): ACK frame data is malformed. 1918 QUIC_INVALID_VERSION_NEGOTIATION_PACKET (0x800a): Version 1919 negotiation packet is malformed. 1921 QUIC_INVALID_PUBLIC_RST_PACKET (0x800b): Public RST packet is 1922 malformed. 1924 QUIC_DECRYPTION_FAILURE (0x800c): There was an error decrypting. 1926 QUIC_ENCRYPTION_FAILURE (0x800d): There was an error encrypting. 1928 QUIC_PACKET_TOO_LARGE (0x800e): The packet exceeded kMaxPacketSize. 1930 QUIC_PEER_GOING_AWAY (0x8010): The peer is going away. May be a 1931 client or server. 1933 QUIC_INVALID_STREAM_ID (0x8011): A stream ID was invalid. 1935 QUIC_INVALID_PRIORITY (0x8031): A priority was invalid. 1937 QUIC_TOO_MANY_OPEN_STREAMS (0x8012): Too many streams already open. 1939 QUIC_TOO_MANY_AVAILABLE_STREAMS (0x804c): The peer created too many 1940 available streams. 1942 QUIC_PUBLIC_RESET (0x8013): Received public reset for this 1943 connection. 1945 QUIC_INVALID_VERSION (0x8014): Invalid protocol version. 1947 QUIC_INVALID_HEADER_ID (0x8016): The Header ID for a stream was too 1948 far from the previous. 1950 QUIC_INVALID_NEGOTIATED_VALUE (0x8017): Negotiable parameter 1951 received during handshake had invalid value. 1953 QUIC_DECOMPRESSION_FAILURE (0x8018): There was an error 1954 decompressing data. 1956 QUIC_NETWORK_IDLE_TIMEOUT (0x8019): The connection timed out due to 1957 no network activity. 1959 QUIC_HANDSHAKE_TIMEOUT (0x8043): The connection timed out waiting 1960 for the handshake to complete. 1962 QUIC_ERROR_MIGRATING_ADDRESS (0x801a): There was an error 1963 encountered migrating addresses. 1965 QUIC_ERROR_MIGRATING_PORT (0x8056): There was an error encountered 1966 migrating port only. 1968 QUIC_EMPTY_STREAM_FRAME_NO_FIN (0x8032): We received a STREAM_FRAME 1969 with no data and no fin flag set. 1971 QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA (0x803b): The peer received 1972 too much data, violating flow control. 1974 QUIC_FLOW_CONTROL_SENT_TOO_MUCH_DATA (0x803f): The peer sent too 1975 much data, violating flow control. 1977 QUIC_FLOW_CONTROL_INVALID_WINDOW (0x8040): The peer received an 1978 invalid flow control window. 1980 QUIC_CONNECTION_IP_POOLED (0x803e): The connection has been IP 1981 pooled into an existing connection. 1983 QUIC_TOO_MANY_OUTSTANDING_SENT_PACKETS (0x8044): The connection has 1984 too many outstanding sent packets. 1986 QUIC_TOO_MANY_OUTSTANDING_RECEIVED_PACKETS (0x8045): The connection 1987 has too many outstanding received packets. 1989 QUIC_CONNECTION_CANCELLED (0x8046): The QUIC connection has been 1990 cancelled. 1992 QUIC_BAD_PACKET_LOSS_RATE (0x8047): Disabled QUIC because of high 1993 packet loss rate. 1995 QUIC_PUBLIC_RESETS_POST_HANDSHAKE (0x8049): Disabled QUIC because of 1996 too many PUBLIC_RESETs post handshake. 1998 QUIC_TIMEOUTS_WITH_OPEN_STREAMS (0x804a): Disabled QUIC because of 1999 too many timeouts with streams open. 2001 QUIC_TOO_MANY_RTOS (0x8055): QUIC timed out after too many RTOs. 2003 QUIC_ENCRYPTION_LEVEL_INCORRECT (0x802c): A packet was received with 2004 the wrong encryption level (i.e. it should have been encrypted but 2005 was not.) 2007 QUIC_VERSION_NEGOTIATION_MISMATCH (0x8037): This connection involved 2008 a version negotiation which appears to have been tampered with. 2010 QUIC_IP_ADDRESS_CHANGED (0x8050): IP address changed causing 2011 connection close. 2013 QUIC_TOO_MANY_FRAME_GAPS (0x805d): Stream frames arrived too 2014 discontiguously so that stream sequencer buffer maintains too many 2015 gaps. 2017 QUIC_TOO_MANY_SESSIONS_ON_SERVER (0x8060): Connection closed because 2018 server hit max number of sessions allowed. 2020 12. Security and Privacy Considerations 2022 12.1. Spoofed Ack Attack 2024 An attacker receives an STK from the server and then releases the IP 2025 address on which it received the STK. The attacker may, in the 2026 future, spoof this same address (which now presumably addresses a 2027 different endpoint), and initiate a 0-RTT connection with a server on 2028 the victim's behalf. The attacker then spoofs ACK frames to the 2029 server which cause the server to potentially drown the victim in 2030 data. 2032 There are two possible mitigations to this attack. The simplest one 2033 is that a server can unilaterally create a gap in packet-number 2034 space. In the non-attack scenario, the client will send an ack with 2035 a larger largest acked. In the attack scenario, the attacker may ack 2036 a packet in the gap. If the server sees an ack for a packet that was 2037 never sent, the connection can be aborted. 2039 The second mitigation is that the server can require that acks for 2040 sent packets match the encryption level of the sent packet. This 2041 mitigation is useful if the connection has an ephemeral forward- 2042 secure key that is generated and used for every new connection. If a 2043 packet sent is encrypted with a forward-secure key, then any acks 2044 that are received for them must also be forward-secure encrypted. 2045 Since the attacker will not have the forward secure key, the attacker 2046 will not be able to generate forward-secure encrypted ack packets. 2048 13. IANA Considerations 2050 This document has no IANA actions yet. 2052 14. References 2054 14.1. Normative References 2056 [QUIC-RECOVERY] 2057 Iyengar, J., Ed. and I. Swett, Ed., "QUIC Loss Detection 2058 and Congestion Control". 2060 [QUIC-TLS] 2061 Thomson, M., Ed. and S. Turner, Ed, Ed., "Using Transport 2062 Layer Security (TLS) to Secure QUIC". 2064 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2065 Requirement Levels", BCP 14, RFC 2119, 2066 DOI 10.17487/RFC2119, March 1997, 2067 . 2069 [RFC4821] Mathis, M. and J. Heffner, "Packetization Layer Path MTU 2070 Discovery", RFC 4821, DOI 10.17487/RFC4821, March 2007, 2071 . 2073 [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext 2074 Transfer Protocol Version 2 (HTTP/2)", RFC 7540, 2075 DOI 10.17487/RFC7540, May 2015, 2076 . 2078 14.2. Informative References 2080 [EARLY-DESIGN] 2081 Roskind, J., "QUIC: Multiplexed Transport Over UDP", 2082 December 2013, . 2084 [QUIC-HTTP] 2085 Bishop, M., Ed., "Hypertext Transfer Protocol (HTTP) over 2086 QUIC". 2088 [QUICCrypto] 2089 Langley, A. and W. Chang, "QUIC Crypto", May 2016, 2090 . 2092 [RFC2360] Scott, G., "Guide for Internet Standards Writers", BCP 22, 2093 RFC 2360, DOI 10.17487/RFC2360, June 1998, 2094 . 2096 [SST] Ford, B., "Structured Streams: A New Transport 2097 Abstraction", ACM SIGCOMM 2007 , August 2007. 2099 14.3. URIs 2101 [1] https://github.com/quicwg/base-drafts/wiki/QUIC-Versions 2103 Appendix A. Contributors 2105 The original authors of this specification were Ryan Hamilton, Jana 2106 Iyengar, Ian Swett, and Alyssa Wilk. 2108 The original design and rationale behind this protocol draw 2109 significantly from work by Jim Roskind [EARLY-DESIGN]. In 2110 alphabetical order, the contributors to the pre-IETF QUIC project at 2111 Google are: Britt Cyr, Jeremy Dorfman, Ryan Hamilton, Jana Iyengar, 2112 Fedor Kouranov, Charles Krasic, Jo Kulik, Adam Langley, Jim Roskind, 2113 Robbie Shade, Satyam Shekhar, Cherie Shi, Ian Swett, Raman Tenneti, 2114 Victor Vasiliev, Antonio Vicente, Patrik Westin, Alyssa Wilk, Dale 2115 Worley, Fan Yang, Dan Zhang, Daniel Ziegler. 2117 Appendix B. Acknowledgments 2119 Special thanks are due to the following for helping shape pre-IETF 2120 QUIC and its deployment: Chris Bentzel, Misha Efimov, Roberto Peon, 2121 Alistair Riddoch, Siddharth Vijayakrishnan, and Assar Westerlund. 2123 This document has benefited immensely from various private 2124 discussions and public ones on the quic@ietf.org and proto- 2125 quic@chromium.org mailing lists. Our thanks to all. 2127 Appendix C. Change Log 2129 *RFC Editor's Note:* Please remove this section prior to 2130 publication of a final version of this document. 2132 C.1. Since draft-ietf-quic-transport-00: 2134 o Replaced DIVERSIFICATION_NONCE flag with KEY_PHASE flag 2136 o Defined versioning 2138 o Reworked description of packet and frame layout 2140 o Error code space is divided into regions for each component 2142 C.2. Since draft-hamilton-quic-transport-protocol-01: 2144 o Adopted as base for draft-ietf-quic-tls. 2146 o Updated authors/editors list. 2148 o Added IANA Considerations section. 2150 o Moved Contributors and Acknowledgments to appendices. 2152 Authors' Addresses 2154 Jana Iyengar (editor) 2155 Google 2157 Email: jri@google.com 2159 Martin Thomson (editor) 2160 Mozilla 2162 Email: martin.thomson@gmail.com