draft-ietf-quic-transport-04.txt   draft-ietf-quic-transport-latest.txt 
QUIC Working Group J. Iyengar, Ed. QUIC Working Group J. Iyengar, Ed.
Internet-Draft Google Internet-Draft Google
Intended status: Standards Track M. Thomson, Ed. Intended status: Standards Track M. Thomson, Ed.
Expires: December 15, 2017 Mozilla Expires: January 17, 2018 Mozilla
June 13, 2017 July 16, 2017
QUIC: A UDP-Based Multiplexed and Secure Transport QUIC: A UDP-Based Multiplexed and Secure Transport
draft-ietf-quic-transport-04 draft-ietf-quic-transport-latest
Abstract Abstract
This document defines the core of the QUIC transport protocol. This This document defines the core of the QUIC transport protocol. This
document describes connection establishment, packet format, document describes connection establishment, packet format,
multiplexing and reliability. Accompanying documents describe the multiplexing and reliability. Accompanying documents describe the
cryptographic handshake and loss detection. cryptographic handshake and loss detection.
Note to Readers Note to Readers
skipping to change at page 1, line 44 skipping to change at page 1, line 44
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on December 15, 2017. This Internet-Draft will expire on January 17, 2018.
Copyright Notice Copyright Notice
Copyright (c) 2017 IETF Trust and the persons identified as the Copyright (c) 2017 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 3, line 10 skipping to change at page 3, line 10
5.9. Handling Packets from Different Versions . . . . . . . . 20 5.9. Handling Packets from Different Versions . . . . . . . . 20
6. Frames and Frame Types . . . . . . . . . . . . . . . . . . . 20 6. Frames and Frame Types . . . . . . . . . . . . . . . . . . . 20
7. Life of a Connection . . . . . . . . . . . . . . . . . . . . 22 7. Life of a Connection . . . . . . . . . . . . . . . . . . . . 22
7.1. Version Negotiation . . . . . . . . . . . . . . . . . . . 23 7.1. Version Negotiation . . . . . . . . . . . . . . . . . . . 23
7.1.1. Using Reserved Versions . . . . . . . . . . . . . . . 24 7.1.1. Using Reserved Versions . . . . . . . . . . . . . . . 24
7.2. Cryptographic and Transport Handshake . . . . . . . . . . 24 7.2. Cryptographic and Transport Handshake . . . . . . . . . . 24
7.3. Transport Parameters . . . . . . . . . . . . . . . . . . 25 7.3. Transport Parameters . . . . . . . . . . . . . . . . . . 25
7.3.1. Transport Parameter Definitions . . . . . . . . . . . 27 7.3.1. Transport Parameter Definitions . . . . . . . . . . . 27
7.3.2. Values of Transport Parameters for 0-RTT . . . . . . 28 7.3.2. Values of Transport Parameters for 0-RTT . . . . . . 28
7.3.3. New Transport Parameters . . . . . . . . . . . . . . 28 7.3.3. New Transport Parameters . . . . . . . . . . . . . . 28
7.3.4. Version Negotiation Validation . . . . . . . . . . . 28 7.3.4. Version Negotiation Validation . . . . . . . . . . . 29
7.4. Stateless Retries . . . . . . . . . . . . . . . . . . . . 30 7.4. Stateless Retries . . . . . . . . . . . . . . . . . . . . 30
7.5. Proof of Source Address Ownership . . . . . . . . . . . . 30 7.5. Proof of Source Address Ownership . . . . . . . . . . . . 30
7.5.1. Client Address Validation Procedure . . . . . . . . . 31 7.5.1. Client Address Validation Procedure . . . . . . . . . 31
7.5.2. Address Validation on Session Resumption . . . . . . 32 7.5.2. Address Validation on Session Resumption . . . . . . 32
7.5.3. Address Validation Token Integrity . . . . . . . . . 32 7.5.3. Address Validation Token Integrity . . . . . . . . . 32
7.6. Connection Migration . . . . . . . . . . . . . . . . . . 33 7.6. Connection Migration . . . . . . . . . . . . . . . . . . 33
7.6.1. Privacy Implications of Connection Migration . . . . 33 7.6.1. Privacy Implications of Connection Migration . . . . 33
7.6.2. Address Validation for Migrated Connections . . . . . 34 7.6.2. Address Validation for Migrated Connections . . . . . 34
7.7. Connection Termination . . . . . . . . . . . . . . . . . 34 7.7. Connection Termination . . . . . . . . . . . . . . . . . 34
8. Frame Types and Formats . . . . . . . . . . . . . . . . . . . 35 8. Frame Types and Formats . . . . . . . . . . . . . . . . . . . 35
8.1. STREAM Frame . . . . . . . . . . . . . . . . . . . . . . 35 8.1. PADDING Frame . . . . . . . . . . . . . . . . . . . . . . 35
8.2. ACK Frame . . . . . . . . . . . . . . . . . . . . . . . . 37 8.2. RST_STREAM Frame . . . . . . . . . . . . . . . . . . . . 36
8.2.1. ACK Block Section . . . . . . . . . . . . . . . . . . 39 8.3. CONNECTION_CLOSE frame . . . . . . . . . . . . . . . . . 36
8.2.2. Timestamp Section . . . . . . . . . . . . . . . . . . 40 8.4. GOAWAY Frame . . . . . . . . . . . . . . . . . . . . . . 37
8.2.3. ACK Frames and Packet Protection . . . . . . . . . . 41 8.5. MAX_DATA Frame . . . . . . . . . . . . . . . . . . . . . 38
8.3. MAX_DATA Frame . . . . . . . . . . . . . . . . . . . . . 42 8.6. MAX_STREAM_DATA Frame . . . . . . . . . . . . . . . . . . 39
8.4. MAX_STREAM_DATA Frame . . . . . . . . . . . . . . . . . . 43 8.7. MAX_STREAM_ID Frame . . . . . . . . . . . . . . . . . . . 40
8.5. MAX_STREAM_ID Frame . . . . . . . . . . . . . . . . . . . 44 8.8. PING frame . . . . . . . . . . . . . . . . . . . . . . . 40
8.6. BLOCKED Frame . . . . . . . . . . . . . . . . . . . . . . 44 8.9. BLOCKED Frame . . . . . . . . . . . . . . . . . . . . . . 40
8.7. STREAM_BLOCKED Frame . . . . . . . . . . . . . . . . . . 44 8.10. STREAM_BLOCKED Frame . . . . . . . . . . . . . . . . . . 41
8.8. STREAM_ID_NEEDED Frame . . . . . . . . . . . . . . . . . 45 8.11. STREAM_ID_NEEDED Frame . . . . . . . . . . . . . . . . . 41
8.9. RST_STREAM Frame . . . . . . . . . . . . . . . . . . . . 45 8.12. NEW_CONNECTION_ID Frame . . . . . . . . . . . . . . . . . 41
8.10. PADDING Frame . . . . . . . . . . . . . . . . . . . . . . 46 8.13. ACK Frame . . . . . . . . . . . . . . . . . . . . . . . . 42
8.11. PING frame . . . . . . . . . . . . . . . . . . . . . . . 46 8.13.1. ACK Block Section . . . . . . . . . . . . . . . . . 44
8.12. NEW_CONNECTION_ID Frame . . . . . . . . . . . . . . . . . 46 8.13.2. Timestamp Section . . . . . . . . . . . . . . . . . 45
8.13. CONNECTION_CLOSE frame . . . . . . . . . . . . . . . . . 47 8.13.3. ACK Frames and Packet Protection . . . . . . . . . . 47
8.14. GOAWAY Frame . . . . . . . . . . . . . . . . . . . . . . 48 8.14. STREAM Frame . . . . . . . . . . . . . . . . . . . . . . 48
9. Packetization and Reliability . . . . . . . . . . . . . . . . 49 9. Packetization and Reliability . . . . . . . . . . . . . . . . 50
9.1. Special Considerations for PMTU Discovery . . . . . . . . 51 9.1. Special Considerations for PMTU Discovery . . . . . . . . 52
10. Streams: QUIC's Data Structuring Abstraction . . . . . . . . 51 10. Streams: QUIC's Data Structuring Abstraction . . . . . . . . 52
10.1. Stream Identifiers . . . . . . . . . . . . . . . . . . . 52 10.1. Stream Identifiers . . . . . . . . . . . . . . . . . . . 53
10.2. Life of a Stream . . . . . . . . . . . . . . . . . . . . 52 10.2. Life of a Stream . . . . . . . . . . . . . . . . . . . . 53
10.2.1. idle . . . . . . . . . . . . . . . . . . . . . . . . 54 10.2.1. idle . . . . . . . . . . . . . . . . . . . . . . . . 55
10.2.2. open . . . . . . . . . . . . . . . . . . . . . . . . 54 10.2.2. open . . . . . . . . . . . . . . . . . . . . . . . . 55
10.2.3. half-closed (local) . . . . . . . . . . . . . . . . 55 10.2.3. half-closed (local) . . . . . . . . . . . . . . . . 56
10.2.4. half-closed (remote) . . . . . . . . . . . . . . . . 55 10.2.4. half-closed (remote) . . . . . . . . . . . . . . . . 56
10.2.5. closed . . . . . . . . . . . . . . . . . . . . . . . 56 10.2.5. closed . . . . . . . . . . . . . . . . . . . . . . . 57
10.3. Stream Concurrency . . . . . . . . . . . . . . . . . . . 56 10.3. Stream Concurrency . . . . . . . . . . . . . . . . . . . 57
10.4. Sending and Receiving Data . . . . . . . . . . . . . . . 57 10.4. Sending and Receiving Data . . . . . . . . . . . . . . . 58
10.5. Stream Prioritization . . . . . . . . . . . . . . . . . 57 10.5. Stream Prioritization . . . . . . . . . . . . . . . . . 58
11. Flow Control . . . . . . . . . . . . . . . . . . . . . . . . 58 11. Flow Control . . . . . . . . . . . . . . . . . . . . . . . . 59
11.1. Edge Cases and Other Considerations . . . . . . . . . . 59 11.1. Edge Cases and Other Considerations . . . . . . . . . . 60
11.1.1. Response to a RST_STREAM . . . . . . . . . . . . . . 60 11.1.1. Response to a RST_STREAM . . . . . . . . . . . . . . 61
11.1.2. Data Limit Increments . . . . . . . . . . . . . . . 60 11.1.2. Data Limit Increments . . . . . . . . . . . . . . . 61
11.2. Stream Limit Increment . . . . . . . . . . . . . . . . . 61 11.2. Stream Limit Increment . . . . . . . . . . . . . . . . . 62
11.2.1. Blocking on Flow Control . . . . . . . . . . . . . . 61 11.2.1. Blocking on Flow Control . . . . . . . . . . . . . . 62
11.3. Stream Final Offset . . . . . . . . . . . . . . . . . . 61 11.3. Stream Final Offset . . . . . . . . . . . . . . . . . . 62
12. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 62 12. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 63
12.1. Connection Errors . . . . . . . . . . . . . . . . . . . 62 12.1. Connection Errors . . . . . . . . . . . . . . . . . . . 63
12.2. Stream Errors . . . . . . . . . . . . . . . . . . . . . 63 12.2. Stream Errors . . . . . . . . . . . . . . . . . . . . . 64
12.3. Error Codes . . . . . . . . . . . . . . . . . . . . . . 63 12.3. Error Codes . . . . . . . . . . . . . . . . . . . . . . 64
13. Security and Privacy Considerations . . . . . . . . . . . . . 67 13. Security and Privacy Considerations . . . . . . . . . . . . . 66
13.1. Spoofed ACK Attack . . . . . . . . . . . . . . . . . . . 67 13.1. Spoofed ACK Attack . . . . . . . . . . . . . . . . . . . 66
13.2. Slowloris Attacks . . . . . . . . . . . . . . . . . . . 68 13.2. Slowloris Attacks . . . . . . . . . . . . . . . . . . . 67
13.3. Stream Fragmentation and Reassembly Attacks . . . . . . 68 13.3. Stream Fragmentation and Reassembly Attacks . . . . . . 67
13.4. Stream Commitment Attack . . . . . . . . . . . . . . . . 68 13.4. Stream Commitment Attack . . . . . . . . . . . . . . . . 67
14. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 69 14. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 68
14.1. QUIC Transport Parameter Registry . . . . . . . . . . . 69 14.1. QUIC Transport Parameter Registry . . . . . . . . . . . 68
15. References . . . . . . . . . . . . . . . . . . . . . . . . . 70 15. References . . . . . . . . . . . . . . . . . . . . . . . . . 69
15.1. Normative References . . . . . . . . . . . . . . . . . . 70 15.1. Normative References . . . . . . . . . . . . . . . . . . 69
15.2. Informative References . . . . . . . . . . . . . . . . . 71 15.2. Informative References . . . . . . . . . . . . . . . . . 70
15.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 72 15.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Appendix A. Contributors . . . . . . . . . . . . . . . . . . . . 72 Appendix A. Contributors . . . . . . . . . . . . . . . . . . . . 71
Appendix B. Acknowledgments . . . . . . . . . . . . . . . . . . 72 Appendix B. Acknowledgments . . . . . . . . . . . . . . . . . . 71
Appendix C. Change Log . . . . . . . . . . . . . . . . . . . . . 72 Appendix C. Change Log . . . . . . . . . . . . . . . . . . . . . 71
C.1. Since draft-ietf-quic-transport-02 . . . . . . . . . . . 73 C.1. Since draft-ietf-quic-transport-03 . . . . . . . . . . . 72
C.2. Since draft-ietf-quic-transport-01 . . . . . . . . . . . 74 C.2. Since draft-ietf-quic-transport-02 . . . . . . . . . . . 72
C.3. Since draft-ietf-quic-transport-00 . . . . . . . . . . . 76 C.3. Since draft-ietf-quic-transport-01 . . . . . . . . . . . 73
C.4. Since draft-hamilton-quic-transport-protocol-01 . . . . . 76 C.4. Since draft-ietf-quic-transport-00 . . . . . . . . . . . 75
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 76 C.5. Since draft-hamilton-quic-transport-protocol-01 . . . . . 75
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 75
1. Introduction 1. Introduction
QUIC is a multiplexed and secure transport protocol that runs on top QUIC is a multiplexed and secure transport protocol that runs on top
of UDP. QUIC aims to provide a flexible set of features that allow of UDP. QUIC aims to provide a flexible set of features that allow
it to be a general-purpose transport for multiple applications. it to be a general-purpose transport for multiple applications.
QUIC implements techniques learned from experience with TCP, SCTP and QUIC implements techniques learned from experience with TCP, SCTP and
other transport protocols. Using UDP as the substrate, QUIC seeks to other transport protocols. Using UDP as the substrate, QUIC seeks to
be compatible with legacy clients and middleboxes. QUIC be compatible with legacy clients and middleboxes. QUIC
skipping to change at page 8, line 14 skipping to change at page 8, line 14
early handshake packets, such as the Version Negotiation packet, are early handshake packets, such as the Version Negotiation packet, are
not encrypted, but information sent in these unencrypted handshake not encrypted, but information sent in these unencrypted handshake
packets is later verified as part of cryptographic processing. packets is later verified as part of cryptographic processing.
PUBLIC_RESET packets that reset a connection are currently not PUBLIC_RESET packets that reset a connection are currently not
authenticated. authenticated.
3.6. Connection Migration and Resilience to NAT Rebinding 3.6. Connection Migration and Resilience to NAT Rebinding
QUIC connections are identified by a 64-bit Connection ID, randomly QUIC connections are identified by a 64-bit Connection ID, randomly
generated by the client. QUIC's consistent connection ID allows generated by the server. QUIC's consistent connection ID allows
connections to survive changes to the client's IP and port, such as connections to survive changes to the client's IP and port, such as
those caused by NAT rebindings or by the client changing network those caused by NAT rebindings or by the client changing network
connectivity to a new address. QUIC provides automatic cryptographic connectivity to a new address. QUIC provides automatic cryptographic
verification of a rebound client, since the client continues to use verification of a rebound client, since the client continues to use
the same session key for encrypting and decrypting packets. The the same session key for encrypting and decrypting packets. The
consistent connection ID can be used to allow migration of the consistent connection ID can be used to allow migration of the
connection to a new server IP address as well, since the Connection connection to a new server IP address as well, since the Connection
ID remains consistent across changes in the client's and the server's ID remains consistent across changes in the client's and the server's
network addresses. network addresses.
skipping to change at page 10, line 31 skipping to change at page 10, line 31
Long headers are used for packets that are sent prior to the Long headers are used for packets that are sent prior to the
completion of version negotiation and establishment of 1-RTT keys. completion of version negotiation and establishment of 1-RTT keys.
Once both conditions are met, a sender SHOULD switch to sending Once both conditions are met, a sender SHOULD switch to sending
short-form headers. While inefficient, long headers MAY be used for short-form headers. While inefficient, long headers MAY be used for
packets encrypted with 1-RTT keys. The long form allows for special packets encrypted with 1-RTT keys. The long form allows for special
packets, such as the Version Negotiation and the Public Reset packets packets, such as the Version Negotiation and the Public Reset packets
to be represented in this uniform fixed-length packet format. A long to be represented in this uniform fixed-length packet format. A long
header contains the following fields: header contains the following fields:
Header Form: The most significant bit (0x80) of the first octet is Header Form: The most significant bit (0x80) of octet 0 (the first
set to 1 for long headers and 0 for short headers. octet) is set to 1 for long headers.
Long Packet Type: The remaining seven bits of first octet of a long Long Packet Type: The remaining seven bits of octet 0 contain the
packet is the packet type. This field can indicate one of 128 packet type. This field can indicate one of 128 packet types.
packet types. The types specified for this version are listed in The types specified for this version are listed in Table 1.
Table 1.
Connection ID: Octets 1 through 8 contain the connection ID. Connection ID: Octets 1 through 8 contain the connection ID.
Section 5.7 describes the use of this field in more detail. Section 5.7 describes the use of this field in more detail.
Packet Number: Octets 9 to 12 contain the packet number. Packet Number: Octets 9 to 12 contain the packet number.
Section 5.8 describes the use of packet numbers. Section 5.8 describes the use of packet numbers.
Version: Octets 13 to 16 contain the selected protocol version. Version: Octets 13 to 16 contain the selected protocol version.
This field indicates which version of QUIC is in use and This field indicates which version of QUIC is in use and
determines how the rest of the protocol fields are interpreted. determines how the rest of the protocol fields are interpreted.
Payload: Octets from 17 onwards (the rest of QUIC packet) are the Payload: Octets from 17 onwards (the rest of QUIC packet) are the
payload of the packet. payload of the packet.
The following packet types are defined: The following packet types are defined:
+------+-------------------------------+---------------+ +------+-------------------------------+---------------+
| Type | Name | Section | | Type | Name | Section |
+------+-------------------------------+---------------+ +------+-------------------------------+---------------+
| 01 | Version Negotiation | Section 5.3 | | 0x01 | Version Negotiation | Section 5.3 |
| | | | | | | |
| 02 | Client Initial | Section 5.4.1 | | 0x02 | Client Initial | Section 5.4.1 |
| | | | | | | |
| 03 | Server Stateless Retry | Section 5.4.2 | | 0x03 | Server Stateless Retry | Section 5.4.2 |
| | | | | | | |
| 04 | Server Cleartext | Section 5.4.3 | | 0x04 | Server Cleartext | Section 5.4.3 |
| | | | | | | |
| 05 | Client Cleartext | Section 5.4.4 | | 0x05 | Client Cleartext | Section 5.4.4 |
| | | | | | | |
| 06 | 0-RTT Protected | Section 5.5 | | 0x06 | 0-RTT Protected | Section 5.5 |
| | | | | | | |
| 07 | 1-RTT Protected (key phase 0) | Section 5.5 | | 0x07 | 1-RTT Protected (key phase 0) | Section 5.5 |
| | | | | | | |
| 08 | 1-RTT Protected (key phase 1) | Section 5.5 | | 0x08 | 1-RTT Protected (key phase 1) | Section 5.5 |
| | | | | | | |
| 09 | Public Reset | Section 5.6 | | 0x09 | Public Reset | Section 5.6 |
+------+-------------------------------+---------------+ +------+-------------------------------+---------------+
Table 1: Long Header Packet Types Table 1: Long Header Packet Types
The header form, packet type, connection ID, packet number and The header form, packet type, connection ID, packet number and
version fields of a long header packet are version-independent. The version fields of a long header packet are version-independent. The
types of packets defined in Table 1 are version-specific. See types of packets defined in Table 1 are version-specific. See
Section 5.9 for details on how packets from different versions of Section 5.9 for details on how packets from different versions of
QUIC are interpreted. QUIC are interpreted.
skipping to change at page 12, line 23 skipping to change at page 12, line 23
| Packet Number (8/16/32) ... | Packet Number (8/16/32) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Protected Payload (*) ... | Protected Payload (*) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 2: Short Header Format Figure 2: Short Header Format
The short header can be used after the version and 1-RTT keys are The short header can be used after the version and 1-RTT keys are
negotiated. This header form has the following fields: negotiated. This header form has the following fields:
Header Form: The most significant bit (0x80) of the first octet of a Header Form: The most significant bit (0x80) of octet 0 is set to 0
packet is the header form. This bit is set to 0 for the short for the short header.
header.
Connection ID Flag: The second bit (0x40) of the first octet Connection ID Flag: The second bit (0x40) of octet 0 indicates
indicates whether the Connection ID field is present. If set to whether the Connection ID field is present. If set to 1, then the
1, then the Connection ID field is present; if set to 0, the Connection ID field is present; if set to 0, the Connection ID
Connection ID field is omitted. field is omitted. The Connection ID field can only be omitted if
the omit_connection_id transport parameter (Section 7.3.1) is
specified by the intended recipient of the packet.
Key Phase Bit: The third bit (0x20) of the first octet indicates the Key Phase Bit: The third bit (0x20) of octet 0 indicates the key
key phase, which allows a recipient of a packet to identify the phase, which allows a recipient of a packet to identify the packet
packet protection keys that are used to protect the packet. See protection keys that are used to protect the packet. See
[QUIC-TLS] for details. [QUIC-TLS] for details.
Short Packet Type: The remaining 5 bits of the first octet include Short Packet Type: The remaining 5 bits of octet 0 include one of 32
one of 32 packet types. Table 2 lists the types that are defined packet types. Table 2 lists the types that are defined for short
for short packets. packets.
Connection ID: If the Connection ID Flag is set, a connection ID Connection ID: If the Connection ID Flag is set, a connection ID
occupies octets 1 through 8 of the packet. See Section 5.7 for occupies octets 1 through 8 of the packet. See Section 5.7 for
more details. more details.
Packet Number: The length of the packet number field depends on the Packet Number: The length of the packet number field depends on the
packet type. This field can be 1, 2 or 4 octets long depending on packet type. This field can be 1, 2 or 4 octets long depending on
the short packet type. the short packet type.
Protected Payload: Packets with a short header always include a Protected Payload: Packets with a short header always include a
1-RTT protected payload. 1-RTT protected payload.
The packet type in a short header currently determines only the size The packet type in a short header currently determines only the size
of the packet number field. Additional types can be used to signal of the packet number field. Additional types can be used to signal
the presence of other fields. the presence of other fields.
+------+--------------------+ +------+--------------------+
| Type | Packet Number Size | | Type | Packet Number Size |
+------+--------------------+ +------+--------------------+
| 01 | 1 octet | | 0x01 | 1 octet |
| | | | | |
| 02 | 2 octets | | 0x02 | 2 octets |
| | | | | |
| 03 | 4 octets | | 0x03 | 4 octets |
+------+--------------------+ +------+--------------------+
Table 2: Short Header Packet Types Table 2: Short Header Packet Types
The header form, connection ID flag and connection ID of a short The header form, connection ID flag and connection ID of a short
header packet are version-independent. The remaining fields are header packet are version-independent. The remaining fields are
specific to the selected QUIC version. See Section 5.9 for details specific to the selected QUIC version. See Section 5.9 for details
on how packets from different versions of QUIC are interpreted. on how packets from different versions of QUIC are interpreted.
5.3. Version Negotiation Packet 5.3. Version Negotiation Packet
skipping to change at page 18, line 44 skipping to change at page 18, line 44
The packet number is a 64-bit unsigned number and is used as part of The packet number is a 64-bit unsigned number and is used as part of
a cryptographic nonce for packet encryption. Each endpoint maintains a cryptographic nonce for packet encryption. Each endpoint maintains
a separate packet number for sending and receiving. The packet a separate packet number for sending and receiving. The packet
number for sending MUST increase by at least one after sending any number for sending MUST increase by at least one after sending any
packet, unless otherwise specified (see Section 5.8.1). packet, unless otherwise specified (see Section 5.8.1).
A QUIC endpoint MUST NOT reuse a packet number within the same A QUIC endpoint MUST NOT reuse a packet number within the same
connection (that is, under the same cryptographic keys). If the connection (that is, under the same cryptographic keys). If the
packet number for sending reaches 2^64 - 1, the sender MUST close the packet number for sending reaches 2^64 - 1, the sender MUST close the
connection by sending a CONNECTION_CLOSE frame with the error code connection without sending a CONNECTION_CLOSE frame or any further
QUIC_SEQUENCE_NUMBER_LIMIT_REACHED (connection termination is packets; the sender MAY send a Public Reset packet in response to
described in Section 7.7.) further packets that it receives.
To reduce the number of bits required to represent the packet number To reduce the number of bits required to represent the packet number
over the wire, only the least significant bits of the packet number over the wire, only the least significant bits of the packet number
are transmitted over the wire, up to 32 bits. The actual packet are transmitted over the wire, up to 32 bits. The actual packet
number for each packet is reconstructed at the receiver based on the number for each packet is reconstructed at the receiver based on the
largest packet number received on a successfully authenticated largest packet number received on a successfully authenticated
packet. packet.
A packet number is decoded by finding the packet number value that is A packet number is decoded by finding the packet number value that is
closest to the next expected packet. The next expected packet is the closest to the next expected packet. The next expected packet is the
highest received packet number plus one. For example, if the highest highest received packet number plus one. For example, if the highest
successfully authenticated packet had a packet number of 0xaa82f30e, successfully authenticated packet had a packet number of 0xaa82f30e,
then a packet containing a 16-bit value of 0x1f94 will be decoded as then a packet containing a 16-bit value of 0x1f94 will be decoded as
0xaa831f94. 0xaa831f94.
The sender MUST use a packet number size able to represent more than The sender MUST use a packet number size able to represent more than
twice as large a range than the difference between the largest twice as large a range than the difference between the largest
acknowledged packet and packet number being sent. A peer receiving acknowledged packet and packet number being sent. A peer receiving
the packet will then correctly decode the packet number, unless the the packet will then correctly decode the packet number, unless the
packet is delayed in transit such that it arrives after many higher- packet is delayed in transit such that it arrives after many higher-
numbered packets have been received. An endpoint MAY use a larger numbered packets have been received. An endpoint SHOULD use a large
packet number size to safeguard against such reordering. enough packet number encoding to allow the packet number to be
recovered even if the packet arrives after packets that are sent
afterwards.
As a result, the size of the packet number encoding is at least one As a result, the size of the packet number encoding is at least one
more than the base 2 logarithm of the number of contiguous more than the base 2 logarithm of the number of contiguous
unacknowledged packet numbers, including the new packet. unacknowledged packet numbers, including the new packet.
For example, if an endpoint has received an acknowledgment for packet For example, if an endpoint has received an acknowledgment for packet
0x6afa2f, sending a packet with a number of 0x6b4264 requires a 0x6afa2f, sending a packet with a number of 0x6b4264 requires a
16-bit or larger packet number encoding; whereas a 32-bit packet 16-bit or larger packet number encoding; whereas a 32-bit packet
number is needed to send a packet with a number of 0x6bc107. number is needed to send a packet with a number of 0x6bc107.
skipping to change at page 22, line 8 skipping to change at page 22, line 8
Frame types are listed in Table 3. Note that the Frame Type byte in Frame types are listed in Table 3. Note that the Frame Type byte in
STREAM and ACK frames is used to carry other frame-specific flags. STREAM and ACK frames is used to carry other frame-specific flags.
For all other frames, the Frame Type byte simply identifies the For all other frames, the Frame Type byte simply identifies the
frame. These frames are explained in more detail as they are frame. These frames are explained in more detail as they are
referenced later in the document. referenced later in the document.
+-------------+-------------------+--------------+ +-------------+-------------------+--------------+
| Type Value | Frame Type Name | Definition | | Type Value | Frame Type Name | Definition |
+-------------+-------------------+--------------+ +-------------+-------------------+--------------+
| 0x00 | PADDING | Section 8.10 | | 0x00 | PADDING | Section 8.1 |
| | | | | | | |
| 0x01 | RST_STREAM | Section 8.9 | | 0x01 | RST_STREAM | Section 8.2 |
| | | | | | | |
| 0x02 | CONNECTION_CLOSE | Section 8.13 | | 0x02 | CONNECTION_CLOSE | Section 8.3 |
| | | | | | | |
| 0x03 | GOAWAY | Section 8.14 | | 0x03 | GOAWAY | Section 8.4 |
| | | | | | | |
| 0x04 | MAX_DATA | Section 8.3 | | 0x04 | MAX_DATA | Section 8.5 |
| | | | | | | |
| 0x05 | MAX_STREAM_DATA | Section 8.4 | | 0x05 | MAX_STREAM_DATA | Section 8.6 |
| | | | | | | |
| 0x06 | MAX_STREAM_ID | Section 8.5 | | 0x06 | MAX_STREAM_ID | Section 8.7 |
| | | | | | | |
| 0x07 | PING | Section 8.11 | | 0x07 | PING | Section 8.8 |
| | | | | | | |
| 0x08 | BLOCKED | Section 8.6 | | 0x08 | BLOCKED | Section 8.9 |
| | | | | | | |
| 0x09 | STREAM_BLOCKED | Section 8.7 | | 0x09 | STREAM_BLOCKED | Section 8.10 |
| | | | | | | |
| 0x0a | STREAM_ID_NEEDED | Section 8.8 | | 0x0a | STREAM_ID_NEEDED | Section 8.11 |
| | | | | | | |
| 0x0b | NEW_CONNECTION_ID | Section 8.12 | | 0x0b | NEW_CONNECTION_ID | Section 8.12 |
| | | | | | | |
| 0xa0 - 0xbf | ACK | Section 8.2 | | 0xa0 - 0xbf | ACK | Section 8.13 |
| | | | | | | |
| 0xc0 - 0xff | STREAM | Section 8.1 | | 0xc0 - 0xff | STREAM | Section 8.14 |
+-------------+-------------------+--------------+ +-------------+-------------------+--------------+
Table 3: Frame Types Table 3: Frame Types
7. Life of a Connection 7. Life of a Connection
A QUIC connection is a single conversation between two QUIC A QUIC connection is a single conversation between two QUIC
endpoints. QUIC's connection establishment intertwines version endpoints. QUIC's connection establishment intertwines version
negotiation with the cryptographic and transport handshakes to reduce negotiation with the cryptographic and transport handshakes to reduce
connection establishment latency, as described in Section 7.2. Once connection establishment latency, as described in Section 7.2. Once
skipping to change at page 26, line 16 skipping to change at page 26, line 16
struct from Figure 6. This is described using the presentation struct from Figure 6. This is described using the presentation
language from Section 3 of [I-D.ietf-tls-tls13]. language from Section 3 of [I-D.ietf-tls-tls13].
uint32 QuicVersion; uint32 QuicVersion;
enum { enum {
initial_max_stream_data(0), initial_max_stream_data(0),
initial_max_data(1), initial_max_data(1),
initial_max_stream_id(2), initial_max_stream_id(2),
idle_timeout(3), idle_timeout(3),
truncate_connection_id(4), omit_connection_id(4),
max_packet_size(5), max_packet_size(5),
(65535) (65535)
} TransportParameterId; } TransportParameterId;
struct { struct {
TransportParameterId parameter; TransportParameterId parameter;
opaque value<0..2^16-1>; opaque value<0..2^16-1>;
} TransportParameter; } TransportParameter;
struct { struct {
select (Handshake.msg_type) { select (Handshake.msg_type) {
case client_hello: case client_hello:
QuicVersion negotiated_version; QuicVersion negotiated_version;
QuicVersion initial_version; QuicVersion initial_version;
case encrypted_extensions: case encrypted_extensions:
QuicVersion supported_versions<2..2^8-4>; QuicVersion supported_versions<2..2^8-4>;
case new_session_ticket:
struct {};
}; };
TransportParameter parameters<30..2^16-1>; TransportParameter parameters<30..2^16-1>;
} TransportParameters; } TransportParameters;
Figure 6: Definition of TransportParameters Figure 6: Definition of TransportParameters
The "extension_data" field of the quic_transport_parameters extension The "extension_data" field of the quic_transport_parameters extension
defined in [QUIC-TLS] contains a TransportParameters value. TLS defined in [QUIC-TLS] contains a TransportParameters value. TLS
encoding rules are therefore used to encode the transport parameters. encoding rules are therefore used to encode the transport parameters.
skipping to change at page 27, line 17 skipping to change at page 27, line 19
7.3.1. Transport Parameter Definitions 7.3.1. Transport Parameter Definitions
An endpoint MUST include the following parameters in its encoded An endpoint MUST include the following parameters in its encoded
TransportParameters: TransportParameters:
initial_max_stream_data (0x0000): The initial stream maximum data initial_max_stream_data (0x0000): The initial stream maximum data
parameter contains the initial value for the maximum data that can parameter contains the initial value for the maximum data that can
be sent on any newly created stream. This parameter is encoded as be sent on any newly created stream. This parameter is encoded as
an unsigned 32-bit integer in units of octets. This is equivalent an unsigned 32-bit integer in units of octets. This is equivalent
to an implicit MAX_STREAM_DATA frame (Section 8.4) being sent on to an implicit MAX_STREAM_DATA frame (Section 8.6) being sent on
all streams immediately after opening. all streams immediately after opening.
initial_max_data (0x0001): The initial maximum data parameter initial_max_data (0x0001): The initial maximum data parameter
contains the initial value for the maximum amount of data that can contains the initial value for the maximum amount of data that can
be sent on the connection. This parameter is encoded as an be sent on the connection. This parameter is encoded as an
unsigned 32-bit integer in units of 1024 octets. That is, the unsigned 32-bit integer in units of 1024 octets. That is, the
value here is multiplied by 1024 to determine the actual maximum value here is multiplied by 1024 to determine the actual maximum
value. This is equivalent to sending a MAX_DATA (Section 8.3) for value. This is equivalent to sending a MAX_DATA (Section 8.5) for
the connection immediately after completing the handshake. the connection immediately after completing the handshake.
initial_max_stream_id (0x0002): The initial maximum stream ID initial_max_stream_id (0x0002): The initial maximum stream ID
parameter contains the initial maximum stream number the peer may parameter contains the initial maximum stream number the peer may
initiate, encoded as an unsigned 32-bit integer. This is initiate, encoded as an unsigned 32-bit integer. This is
equivalent to sending a MAX_STREAM_ID (Section 8.5) immediately equivalent to sending a MAX_STREAM_ID (Section 8.7) immediately
after completing the handshake. after completing the handshake.
idle_timeout (0x0003): The idle timeout is a value in seconds that idle_timeout (0x0003): The idle timeout is a value in seconds that
is encoded as an unsigned 16-bit integer. The maximum value is is encoded as an unsigned 16-bit integer. The maximum value is
600 seconds (10 minutes). 600 seconds (10 minutes).
An endpoint MAY use the following transport parameters: An endpoint MAY use the following transport parameters:
truncate_connection_id (0x0004): The truncated connection identifier omit_connection_id (0x0004): The omit connection identifier
parameter indicates that packets sent to the peer can omit the parameter indicates that packets sent to the endpoint that
connection ID. This can be used by an endpoint where the 5-tuple advertises this parameter can omit the connection ID. This can be
is sufficient to identify a connection. This parameter is zero used by an endpoint where it knows that source and destination IP
length. Omitting the parameter indicates that the endpoint relies address and port are sufficient for it to identify a connection.
on the connection ID being present in every packet. This parameter is zero length. Absence this parameter indicates
that the endpoint relies on the connection ID being present in
every packet.
max_packet_size (0x0005): The maximum packet size parameter places a max_packet_size (0x0005): The maximum packet size parameter places a
limit on the size of packets that the endpoint is willing to limit on the size of packets that the endpoint is willing to
receive, encoded as an unsigned 16-bit integer. This indicates receive, encoded as an unsigned 16-bit integer. This indicates
that packets larger than this limit will be dropped. The default that packets larger than this limit will be dropped. The default
for this parameter is the maximum permitted UDP payload of 65527. for this parameter is the maximum permitted UDP payload of 65527.
Values below 1252 are invalid. This limit only applies to Values below 1252 are invalid. This limit only applies to
protected packets (Section 5.5). protected packets (Section 5.5).
7.3.2. Values of Transport Parameters for 0-RTT 7.3.2. Values of Transport Parameters for 0-RTT
Transport parameters from the server MUST be remembered by the client Transport parameters from the server MUST be remembered by the client
for use with 0-RTT data. If the TLS NewSessionTicket message for use with 0-RTT data. If the TLS NewSessionTicket message
includes the quic_transport_parameters extension, then those values includes the quic_transport_parameters extension, then those values
are used for the server values when establishing a new connection are used for the server values when establishing a new connection
using that ticket. Otherwise, the transport parameters that the using that ticket. Otherwise, the transport parameters that the
skipping to change at page 29, line 14 skipping to change at page 29, line 24
Section 7.3). As a result, modification of version negotiation Section 7.3). As a result, modification of version negotiation
packets by an attacker can be detected. packets by an attacker can be detected.
The client includes two fields in the transport parameters: The client includes two fields in the transport parameters:
o The negotiated_version is the version that was finally selected o The negotiated_version is the version that was finally selected
for use. This MUST be identical to the value that is on the for use. This MUST be identical to the value that is on the
packet that carries the ClientHello. A server that receives a packet that carries the ClientHello. A server that receives a
negotiated_version that does not match the version of QUIC that is negotiated_version that does not match the version of QUIC that is
in use MUST terminate the connection with a in use MUST terminate the connection with a
QUIC_VERSION_NEGOTIATION_MISMATCH error code. VERSION_NEGOTIATION_ERROR error code.
o The initial_version is the version that the client initially o The initial_version is the version that the client initially
attempted to use. If the server did not send a version attempted to use. If the server did not send a version
negotiation packet Section 5.3, this will be identical to the negotiation packet Section 5.3, this will be identical to the
negotiated_version. negotiated_version.
A server that processes all packets in a stateful fashion can A server that processes all packets in a stateful fashion can
remember how version negotiation was performed and validate the remember how version negotiation was performed and validate the
initial_version value. initial_version value.
skipping to change at page 29, line 36 skipping to change at page 29, line 46
(i.e., a stateless server) uses a different process. If the initial (i.e., a stateless server) uses a different process. If the initial
and negotiated versions are the same, a stateless server can accept and negotiated versions are the same, a stateless server can accept
the value. the value.
If the initial version is different from the negotiated_version, a If the initial version is different from the negotiated_version, a
stateless server MUST check that it would have sent a version stateless server MUST check that it would have sent a version
negotiation packet if it had received a packet with the indicated negotiation packet if it had received a packet with the indicated
initial_version. If a server would have accepted the version initial_version. If a server would have accepted the version
included in the initial_version and the value differs from the value included in the initial_version and the value differs from the value
of negotiated_version, the server MUST terminate the connection with of negotiated_version, the server MUST terminate the connection with
a QUIC_VERSION_NEGOTIATION_MISMATCH error. a VERSION_NEGOTIATION_ERROR error.
The server includes a list of versions that it would send in any The server includes a list of versions that it would send in any
version negotiation packet (Section 5.3) in supported_versions. This version negotiation packet (Section 5.3) in supported_versions. The
value is set even if it did not send a version negotiation packet. server populates this field even if it did not send a version
negotiation packet. This field is absent if the parameters are
included in a NewSessionTicket message.
The client can validate that the negotiated_version is included in The client can validate that the negotiated_version is included in
the supported_versions list and - if version negotiation was the supported_versions list and - if version negotiation was
performed - that it would have selected the negotiated version. A performed - that it would have selected the negotiated version. A
client MUST terminate the connection with a client MUST terminate the connection with a VERSION_NEGOTIATION_ERROR
QUIC_VERSION_NEGOTIATION_MISMATCH error code if the error code if the negotiated_version value is not included in the
negotiated_version value is not included in the supported_versions supported_versions list. A client MUST terminate with a
list. A client MUST terminate with a VERSION_NEGOTIATION_ERROR error code if version negotiation occurred
QUIC_VERSION_NEGOTIATION_MISMATCH error code if version negotiation but it would have selected a different version based on the value of
occurred but it would have selected a different version based on the the supported_versions list.
value of the supported_versions list.
7.4. Stateless Retries 7.4. Stateless Retries
A server can process an initial cryptographic handshake messages from A server can process an initial cryptographic handshake messages from
a client without committing any state. This allows a server to a client without committing any state. This allows a server to
perform address validation (Section 7.5, or to defer connection perform address validation (Section 7.5, or to defer connection
establishment costs. establishment costs.
A server that generates a response to an initial packet without A server that generates a response to an initial packet without
retaining connection state MUST use the Server Stateless Retry packet retaining connection state MUST use the Server Stateless Retry packet
skipping to change at page 32, line 51 skipping to change at page 33, line 13
requires access to the integrity protection key for tokens. requires access to the integrity protection key for tokens.
In TLS the address validation token is often bundled with the In TLS the address validation token is often bundled with the
information that TLS requires, such as the resumption secret. In information that TLS requires, such as the resumption secret. In
this case, adding integrity protection can be delegated to the this case, adding integrity protection can be delegated to the
cryptographic handshake protocol, avoiding redundant protection. If cryptographic handshake protocol, avoiding redundant protection. If
integrity protection is delegated to the cryptographic handshake, an integrity protection is delegated to the cryptographic handshake, an
integrity failure will result in immediate cryptographic handshake integrity failure will result in immediate cryptographic handshake
failure. If integrity protection is performed by QUIC, QUIC MUST failure. If integrity protection is performed by QUIC, QUIC MUST
abort the connection if the integrity check fails with a abort the connection if the integrity check fails with a
QUIC_ADDRESS_VALIDATION_FAILURE error code. PROTOCOL_VIOLATION error code.
7.6. Connection Migration 7.6. Connection Migration
QUIC connections are identified by their 64-bit Connection ID. QUIC connections are identified by their 64-bit Connection ID.
QUIC's consistent connection ID allows connections to survive changes QUIC's consistent connection ID allows connections to survive changes
to the client's IP and/or port, such as those caused by client or to the client's IP and/or port, such as those caused by client or
server migrating to a new network. Connection migration allows a server migrating to a new network. Connection migration allows a
client to retain any shared state with a connection when they move client to retain any shared state with a connection when they move
networks. This includes state that can be hard to recover such as networks. This includes state that can be hard to recover such as
outstanding requests, which might otherwise be lost with no easy way outstanding requests, which might otherwise be lost with no easy way
skipping to change at page 35, line 28 skipping to change at page 35, line 38
at the server, so as to absorb any straggler packets in the network. at the server, so as to absorb any straggler packets in the network.
Discuss TIME_WAIT list. Discuss TIME_WAIT list.
8. Frame Types and Formats 8. Frame Types and Formats
As described in Section 6, Regular packets contain one or more As described in Section 6, Regular packets contain one or more
frames. We now describe the various QUIC frame types that can be frames. We now describe the various QUIC frame types that can be
present in a Regular packet. The use of these frames and various present in a Regular packet. The use of these frames and various
frame header bits are described in subsequent sections. frame header bits are described in subsequent sections.
8.1. STREAM Frame 8.1. PADDING Frame
STREAM frames implicitly create a stream and carry stream data. The The PADDING frame (type=0x00) has no semantic value. PADDING frames
type byte for a STREAM frame contains embedded flags, and is can be used to increase the size of a packet. Padding can be used to
formatted as "11FSSOOD". These bits are parsed as follows: increase an initial client packet to the minimum required size, or to
provide protection against traffic analysis for protected packets.
o The first two bits must be set to 11, indicating that this is a A PADDING frame has no content. That is, a PADDING frame consists of
STREAM frame. the single octet that identifies the frame as a PADDING frame.
o "F" is the FIN bit, which is used for stream termination. 8.2. RST_STREAM Frame
o The "SS" bits encode the length of the Stream ID header field. An endpoint may use a RST_STREAM frame (type=0x01) to abruptly
The values 00, 01, 02, and 03 indicate lengths of 8, 16, 24, and terminate a stream.
32 bits long respectively.
o The "OO" bits encode the length of the Offset header field. The After sending a RST_STREAM, an endpoint ceases transmission of STREAM
values 00, 01, 02, and 03 indicate lengths of 0, 16, 32, and 64 frames on the identified stream. A receiver of RST_STREAM can
bits long respectively. discard any data that it already received on that stream. An
endpoint sends a RST_STREAM in response to a RST_STREAM unless the
stream is already closed.
o The "D" bit indicates whether a Data Length field is present in The RST_STREAM frame is as follows:
the STREAM header. When set to 0, this field indicates that the
Stream Data field extends to the end of the packet. When set to
1, this field indicates that Data Length field contains the length
(in bytes) of the Stream Data field. The option to omit the
length should only be used when the packet is a "full-sized"
packet, to avoid the risk of corruption via padding.
A STREAM frame is shown below. 0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Stream ID (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Error Code (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Final Offset (64) +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The fields are:
Stream ID: The 32-bit Stream ID of the stream being terminated.
Error code: A 32-bit error code which indicates why the stream is
being closed.
Final offset: A 64-bit unsigned integer indicating the absolute byte
offset of the end of data written on this stream by the RST_STREAM
sender.
8.3. CONNECTION_CLOSE frame
An endpoint sends a CONNECTION_CLOSE frame (type=0x02) to notify its
peer that the connection is being closed. If there are open streams
that haven't been explicitly closed, they are implicitly closed when
the connection is closed. (Ideally, a GOAWAY frame would be sent
with enough time that all streams are torn down.) The frame is as
follows:
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Stream ID (8/16/24/32) ... | Error Code (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Offset (0/16/32/64) ... | Reason Phrase Length (16) | [Reason Phrase (*)] ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| [Data Length (16)] | Stream Data (*) ...
The fields of a CONNECTION_CLOSE frame are as follows:
Error Code: A 32-bit error code which indicates the reason for
closing this connection.
Reason Phrase Length: A 16-bit unsigned number specifying the length
of the reason phrase in bytes. Note that a CONNECTION_CLOSE frame
cannot be split between packets, so in practice any limits on
packet size will also limit the space available for a reason
phrase.
Reason Phrase: A human-readable explanation for why the connection
was closed. This can be zero length if the sender chooses to not
give details beyond the Error Code. This SHOULD be a UTF-8
encoded string [RFC3629].
8.4. GOAWAY Frame
An endpoint uses a GOAWAY frame (type=0x03) to initiate a graceful
shutdown of a connection. The endpoints will continue to use any
active streams, but the sender of the GOAWAY will not initiate or
accept any additional streams beyond those indicated. The GOAWAY
frame is as follows:
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Largest Client Stream ID (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Largest Server Stream ID (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 7: STREAM Frame Format The fields of a GOAWAY frame are:
The STREAM frame contains the following fields: Largest Client Stream ID: The highest-numbered, client-initiated
stream on which the endpoint sending the GOAWAY frame either sent
data, or received and delivered data. All higher-numbered,
client-initiated streams (that is, odd-numbered streams) are
implicitly reset by sending or receiving the GOAWAY frame.
Stream ID: The stream ID of the stream (see Section 10.1). Largest Server Stream ID: The highest-numbered, server-initiated
stream on which the endpoint sending the GOAWAY frame either sent
data, or received and delivered data. All higher-numbered,
server-initiated streams (that is, even-numbered streams) are
implicitly reset by sending or receiving the GOAWAY frame.
Offset: A variable-sized unsigned number specifying the byte offset A GOAWAY frame indicates that any application layer actions on
in the stream for the data in this STREAM frame. When the offset streams with higher numbers than those indicated can be safely
length is 0, the offset is 0. The first byte in the stream has an retried because no data was exchanged. An endpoint MUST set the
offset of 0. The largest offset delivered on a stream - the sum value of the Largest Client or Server Stream ID to be at least as
of the re-constructed offset and data length - MUST be less than high as the highest-numbered stream on which it either sent data or
2^64. received and delivered data to the application protocol that uses
QUIC.
Stream Data: The bytes from the designated stream to be delivered. An endpoint MAY choose a larger stream identifier if it wishes to
allow for a number of streams to be created. This is especially
valuable for peer-initiated streams where packets creating new
streams could be in transit; using a larger stream number allows
those streams to complete.
Data Length: An optional 16-bit unsigned number specifying the In addition to initiating a graceful shutdown of a connection, GOAWAY
length of the Stream Data field in this STREAM frame. This field MAY be sent immediately prior to sending a CONNECTION_CLOSE frame
is present when the "D" bit is set to 1. that is sent as a result of detecting a fatal error. Higher-numbered
streams than those indicated in the GOAWAY frame can then be retried.
A STREAM frame MUST have either non-zero data length or the FIN bit 8.5. MAX_DATA Frame
set. When the FIN flag is sent on an empty STREAM frame, the offset
in the STREAM frame MUST be one greater than the last data byte sent
on this stream.
Stream multiplexing is achieved by interleaving STREAM frames from The MAX_DATA frame (type=0x04) is used in flow control to inform the
multiple streams into one or more QUIC packets. A single QUIC packet peer of the maximum amount of data that can be sent on the connection
can include multiple STREAM frames from one or more streams. as a whole.
Implementation note: One of the benefits of QUIC is avoidance of The frame is as follows:
head-of-line blocking across multiple streams. When a packet loss
occurs, only streams with data in that packet are blocked waiting for
a retransmission to be received, while other streams can continue
making progress. Note that when data from multiple streams is
bundled into a single QUIC packet, loss of that packet blocks all
those streams from making progress. An implementation is therefore
advised to bundle as few streams as necessary in outgoing packets
without losing transmission efficiency to underfilled packets.
8.2. ACK Frame 0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Maximum Data (64) +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The fields in the MAX_DATA frame are as follows:
Maximum Data: A 64-bit unsigned integer indicating the maximum
amount of data that can be sent on the entire connection, in units
of 1024 octets. That is, the updated connection-level data limit
is determined by multiplying the encoded value by 1024.
All data sent in STREAM frames counts toward this limit, with the
exception of data on stream 0. The sum of the largest received
offsets on all streams - including closed streams, but excluding
stream 0 - MUST NOT exceed the value advertised by a receiver. An
endpoint MUST terminate a connection with a
QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA error if it receives more
data than the maximum data value that it has sent, unless this is a
result of a change in the initial limits (see Section 7.3.2).
8.6. MAX_STREAM_DATA Frame
The MAX_STREAM_DATA frame (type=0x05) is used in flow control to
inform a peer of the maximum amount of data that can be sent on a
stream.
The frame is as follows:
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Stream ID (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Maximum Stream Data (64) +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The fields in the MAX_STREAM_DATA frame are as follows:
Stream ID: The stream ID of the stream that is affected.
Maximum Stream Data: A 64-bit unsigned integer indicating the
maximum amount of data that can be sent on the identified stream,
in units of octets.
When counting data toward this limit, an endpoint accounts for the
largest received offset of data that is sent or received on the
stream. Loss or reordering can mean that the largest received offset
on a stream can be greater than the total size of data received on
that stream. Receiving STREAM frames might not increase the largest
received offset.
The data sent on a stream MUST NOT exceed the largest maximum stream
data value advertised by the receiver. An endpoint MUST terminate a
connection with a FLOW_CONTROL_ERROR error if it receives more data
than the largest maximum stream data that it has sent for the
affected stream, unless this is a result of a change in the initial
limits (see Section 7.3.2).
8.7. MAX_STREAM_ID Frame
The MAX_STREAM_ID frame (type=0x06) informs the peer of the maximum
stream ID that they are permitted to open.
The frame is as follows:
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Maximum Stream ID (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The fields in the MAX_STREAM_ID frame are as follows:
Maximum Stream ID: ID of the maximum peer-initiated stream ID for
the connection.
Loss or reordering can mean that a MAX_STREAM_ID frame can be
received which states a lower stream limit than the client has
previously received. MAX_STREAM_ID frames which do not increase the
maximum stream ID MUST be ignored.
A peer MUST NOT initiate a stream with a higher stream ID than the
greatest maximum stream ID it has received. An endpoint MUST
terminate a connection with a STREAM_ID_ERROR error if a peer
initiates a stream with a higher stream ID than it has sent, unless
this is a result of a change in the initial limits (see
Section 7.3.2).
8.8. PING frame
Endpoints can use PING frames (type=0x07) to verify that their peers
are still alive or to check reachability to the peer. The PING frame
contains no additional fields. The receiver of a PING frame simply
needs to acknowledge the packet containing this frame. The PING
frame SHOULD be used to keep a connection alive when a stream is
open. The default is to send a PING frame after 15 seconds of
quiescence. A PING frame has no additional fields.
8.9. BLOCKED Frame
A sender sends a BLOCKED frame (type=0x08) when it wishes to send
data, but is unable to due to connection-level flow control (see
Section 11.2.1). BLOCKED frames can be used as input to tuning of
flow control algorithms (see Section 11.1.2).
The BLOCKED frame does not contain a payload.
8.10. STREAM_BLOCKED Frame
A sender sends a STREAM_BLOCKED frame (type=0x09) when it wishes to
send data, but is unable to due to stream-level flow control. This
frame is analogous to BLOCKED (Section 8.9).
The STREAM_BLOCKED frame is as follows:
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Stream ID (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The STREAM_BLOCKED frame contains a single field:
Stream ID: A 32-bit unsigned number indicating the stream which is
flow control blocked.
An endpoint MAY send a STREAM_BLOCKED frame for a stream that exceeds
the maximum stream ID set by its peer (see Section 8.7). This does
not open the stream, but informs the peer that a new stream was
needed, but the stream limit prevented the creation of the stream.
8.11. STREAM_ID_NEEDED Frame
A sender sends a STREAM_ID_NEEDED frame (type=0x0a) when it wishes to
open a stream, but is unable to due to the maximum stream ID limit.
The STREAM_ID_NEEDED frame does not contain a payload.
8.12. NEW_CONNECTION_ID Frame
A server sends a NEW_CONNECTION_ID frame (type=0x0b) to provide the
client with alternative connection IDs that can be used to break
linkability when migrating connections (see Section 7.6.1).
The NEW_CONNECTION_ID is as follows:
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence (16) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Connection ID (64) +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The fields are:
Sequence: A 16-bit sequence number. This value starts at 0 and
increases by 1 for each connection ID that is provided by the
server. The sequence value can wrap; the value 65535 is followed
by 0. When wrapping the sequence field, the server MUST ensure
that a value with the same sequence has been received and
acknowledged by the client. The connection ID that is assigned
during the handshake is assumed to have a sequence of 65535.
Connection ID: A 64-bit connection ID.
8.13. ACK Frame
Receivers send ACK frames to inform senders which packets they have Receivers send ACK frames to inform senders which packets they have
received and processed, as well as which packets are considered received and processed, as well as which packets are considered
missing. The ACK frame contains between 1 and 256 ACK blocks. ACK missing. The ACK frame contains between 1 and 256 ACK blocks. ACK
blocks are ranges of acknowledged packets. blocks are ranges of acknowledged packets. Implementations SHOULD
NOT generate ACK packets in response to packets which only contain
ACKs. However, they SHOULD ACK those packets when sending ACKs for
other packets.
To limit ACK blocks to those that have not yet been received by the To limit ACK blocks to those that have not yet been received by the
sender, the receiver SHOULD track which ACK frames have been sender, the receiver SHOULD track which ACK frames have been
acknowledged by its peer. Once an ACK frame has been acknowledged, acknowledged by its peer. Once an ACK frame has been acknowledged,
the packets it acknowledges SHOULD not be acknowledged again. the packets it acknowledges SHOULD not be acknowledged again.
A receiver that is only sending ACK frames will not receive A receiver that is only sending ACK frames will not receive
acknowledgments for its packets. Sending an occasional MAX_DATA or acknowledgments for its packets. Sending an occasional MAX_DATA or
MAX_STREAM_DATA frame as data is received will ensure that MAX_STREAM_DATA frame as data is received will ensure that
acknowledgements are generated by a peer. Otherwise, an endpoint MAY acknowledgements are generated by a peer. Otherwise, an endpoint MAY
send a PING frame once per RTT to solicit an acknowledgment. send a PING frame once per RTT to solicit an acknowledgment.
To limit receiver state or the size of ACK frames, a receiver MAY To limit receiver state or the size of ACK frames, a receiver MAY
limit the number of ACK blocks it sends. A receiver can do this even limit the number of ACK blocks it sends. A receiver can do this even
without receiving acknowledgment of its ACK frames, with the without receiving acknowledgment of its ACK frames, with the
knowledge this could cause the sender to unnecessarily retransmit knowledge this could cause the sender to unnecessarily retransmit
some data. When this is necessary, the receiver SHOULD acknowledge some data. When this is necessary, the receiver SHOULD acknowledge
newly received packets and stop acknowledging packets received in the newly received packets and stop acknowledging packets received in the
past. past.
Unlike TCP SACKs, QUIC ACK blocks are cumulative and therefore Unlike TCP SACKs, QUIC ACK blocks are irrevocable. Once a packet has
irrevocable. Once a packet has been acknowledged, even if it does been acknowledged, even if it does not appear in a future ACK frame,
not appear in a future ACK frame, it is assumed to be acknowledged. it remains acknowledged.
QUIC ACK frames contain a timestamp section with up to 255 QUIC ACK frames contain a timestamp section with up to 255
timestamps. Timestamps enable better congestion control, but are not timestamps. Timestamps enable better congestion control, but are not
required for correct loss recovery, and old timestamps are less required for correct loss recovery, and old timestamps are less
valuable, so it is not guaranteed every timestamp will be received by valuable, so it is not guaranteed every timestamp will be received by
the sender. A receiver SHOULD send a timestamp exactly once for each the sender. A receiver SHOULD send a timestamp exactly once for each
received packet containing retransmittable frames. A receiver MAY received packet containing retransmittable frames. A receiver MAY
send timestamps for non-retransmittable packets. A receiver MUST not send timestamps for non-retransmittable packets. A receiver MUST not
send timestamps in unprotected packets. send timestamps in unprotected packets.
skipping to change at page 38, line 15 skipping to change at page 43, line 25
effectively provides up to 8 bits of efficient entropy on demand, effectively provides up to 8 bits of efficient entropy on demand,
which should be adequate protection against most opportunistic which should be adequate protection against most opportunistic
acknowledgement attacks. acknowledgement attacks.
The type byte for a ACK frame contains embedded flags, and is The type byte for a ACK frame contains embedded flags, and is
formatted as "101NLLMM". These bits are parsed as follows: formatted as "101NLLMM". These bits are parsed as follows:
o The first three bits must be set to 101 indicating that this is an o The first three bits must be set to 101 indicating that this is an
ACK frame. ACK frame.
o The "N" bit indicates whether the frame has more than 1 range of o The "N" bit indicates whether the frame contains a Num Blocks
acknowledged packets (i.e., whether the ACK Block Section contains field.
a Num Blocks field).
o The two "LL" bits encode the length of the Largest Acknowledged o The two "LL" bits encode the length of the Largest Acknowledged
field. The values 00, 01, 02, and 03 indicate lengths of 8, 16, field. The values 00, 01, 02, and 03 indicate lengths of 8, 16,
32, and 48 bits respectively. 32, and 64 bits respectively.
o The two "MM" bits encode the length of the ACK Block Length o The two "MM" bits encode the length of the ACK Block Length
fields. The values 00, 01, 02, and 03 indicate lengths of 8, 16, fields. The values 00, 01, 02, and 03 indicate lengths of 8, 16,
32, and 48 bits respectively. 32, and 64 bits respectively.
An ACK frame is shown below. An ACK frame is shown below.
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|[Num Blocks(8)]| NumTS (8) | |[Num Blocks(8)]| NumTS (8) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Largest Acknowledged (8/16/32/48) ... | Largest Acknowledged (8/16/32/64) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ACK Delay (16) | | ACK Delay (16) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ACK Block Section (*) ... | ACK Block Section (*) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Timestamp Section (*) ... | Timestamp Section (*) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 8: ACK Frame Format Figure 7: ACK Frame Format
The fields in the ACK frame are as follows: The fields in the ACK frame are as follows:
Num Blocks (opt): An optional 8-bit unsigned value specifying the Num Blocks (opt): An optional 8-bit unsigned value specifying the
number of additional ACK blocks (besides the required First ACK number of additional ACK blocks (besides the required First ACK
Block) in this ACK frame. Only present if the 'N' flag bit is 1. Block) in this ACK frame. Only present if the 'N' flag bit is 1.
Num Timestamps: An unsigned 8-bit number specifying the total number Num Timestamps: An unsigned 8-bit number specifying the total number
of <packet number, timestamp> pairs in the Timestamp Section. of <packet number, timestamp> pairs in the Timestamp Section.
Largest Acknowledged: A variable-sized unsigned value representing Largest Acknowledged: A variable-sized unsigned value representing
the largest packet number the peer is acknowledging in this packet the largest packet number the peer is acknowledging in this packet
(typically the largest that the peer has seen thus far.) (typically the largest that the peer has seen thus far.)
ACK Delay: The time from when the largest acknowledged packet, as ACK Delay: The time from when the largest acknowledged packet, as
indicated in the Largest Acknowledged field, was received by this indicated in the Largest Acknowledged field, was received by this
peer to when this ACK was sent. peer to when this ACK was sent.
ACK Block Section: Contains one or more blocks of packet numbers ACK Block Section: Contains one or more blocks of packet numbers
which have been successfully received, see Section 8.2.1. which have been successfully received, see Section 8.13.1.
Timestamp Section: Contains zero or more timestamps reporting Timestamp Section: Contains zero or more timestamps reporting
transit delay of received packets. See Section 8.2.2. transit delay of received packets. See Section 8.13.2.
8.2.1. ACK Block Section 8.13.1. ACK Block Section
The ACK Block Section contains between one and 256 blocks of packet The ACK Block Section contains between one and 256 blocks of packet
numbers which have been successfully received. If the Num Blocks numbers which have been successfully received. If the Num Blocks
field is absent, only the First ACK Block length is present in this field is absent, only the First ACK Block length is present in this
section. Otherwise, the Num Blocks field indicates how many section. Otherwise, the Num Blocks field indicates how many
additional blocks follow the First ACK Block Length field. additional blocks follow the First ACK Block Length field.
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| First ACK Block Length (8/16/32/48) ... | First ACK Block Length (8/16/32/64) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| [Gap 1 (8)] | [ACK Block 1 Length (8/16/32/48)] ... | [Gap 1 (8)] | [ACK Block 1 Length (8/16/32/64)] ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| [Gap 2 (8)] | [ACK Block 2 Length (8/16/32/48)] ... | [Gap 2 (8)] | [ACK Block 2 Length (8/16/32/64)] ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
... ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| [Gap N (8)] | [ACK Block N Length (8/16/32/48)] ... | [Gap N (8)] | [ACK Block N Length (8/16/32/64)] ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 9: ACK Block Section Figure 8: ACK Block Section
The fields in the ACK Block Section are: The fields in the ACK Block Section are:
First ACK Block Length: An unsigned packet number delta that First ACK Block Length: An unsigned packet number delta that
indicates the number of contiguous additional packets being indicates the number of contiguous additional packets being
acknowledged starting at the Largest Acknowledged. acknowledged starting at the Largest Acknowledged.
Gap To Next Block (opt, repeated): An unsigned number specifying the Gap To Next Block (opt, repeated): An unsigned number specifying the
number of contiguous missing packets from the end of the previous number of contiguous missing packets from the end of the previous
ACK block to the start of the next. Repeated "Num Blocks" times. ACK block to the start of the next. Repeated "Num Blocks" times.
ACK Block Length (opt, repeated): An unsigned packet number delta ACK Block Length (opt, repeated): An unsigned packet number delta
that indicates the number of contiguous packets being acknowledged that indicates the number of contiguous packets being acknowledged
starting after the end of the previous gap. Repeated "Num Blocks" starting after the end of the previous gap. Repeated "Num Blocks"
times. times.
8.2.2. Timestamp Section 8.13.2. Timestamp Section
The Timestamp Section contains between zero and 255 measurements of The Timestamp Section contains between zero and 255 measurements of
packet receive times relative to the beginning of the connection. packet receive times relative to the beginning of the connection.
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
| [Delta LA (8)]| | [Delta LA (8)]|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| [First Timestamp (32)] | | [First Timestamp (32)] |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|[Delta LA 1(8)]| [Time Since Previous 1 (16)] | |[Delta LA 1(8)]| [Time Since Previous 1 (16)] |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|[Delta LA 2(8)]| [Time Since Previous 2 (16)] | |[Delta LA 2(8)]| [Time Since Previous 2 (16)] |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
... ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|[Delta LA N(8)]| [Time Since Previous N (16)] | |[Delta LA N(8)]| [Time Since Previous N (16)] |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 10: Timestamp Section Figure 9: Timestamp Section
The fields in the Timestamp Section are: The fields in the Timestamp Section are:
Delta Largest Acknowledged (opt): An optional 8-bit unsigned packet Delta Largest Acknowledged (opt): An optional 8-bit unsigned packet
number delta specifying the delta between the largest acknowledged number delta specifying the delta between the largest acknowledged
and the first packet whose timestamp is being reported. In other and the first packet whose timestamp is being reported. In other
words, this first packet number may be computed as (Largest words, this first packet number may be computed as (Largest
Acknowledged - Delta Largest Acknowledged.) Acknowledged - Delta Largest Acknowledged.)
First Timestamp (opt): An optional 32-bit unsigned value specifying First Timestamp (opt): An optional 32-bit unsigned value specifying
skipping to change at page 41, line 13 skipping to change at page 46, line 48
"Num Timestamps - 1" times. "Num Timestamps - 1" times.
Time Since Previous Timestamp 1..N(opt, repeated): An optional Time Since Previous Timestamp 1..N(opt, repeated): An optional
16-bit unsigned value specifying time delta from the previous 16-bit unsigned value specifying time delta from the previous
reported timestamp. It is encoded in the same format as the ACK reported timestamp. It is encoded in the same format as the ACK
Delay. Repeated "Num Timestamps - 1" times. Delay. Repeated "Num Timestamps - 1" times.
The timestamp section lists packet receipt timestamps ordered by The timestamp section lists packet receipt timestamps ordered by
timestamp. timestamp.
8.2.2.1. Time Format 8.13.2.1. Time Format
DISCUSS_AND_REPLACE: Perhaps make this format simpler. DISCUSS_AND_REPLACE: Perhaps make this format simpler.
The time format used in the ACK frame above is a 16-bit unsigned The time format used in the ACK frame above is a 16-bit unsigned
float with 11 explicit bits of mantissa and 5 bits of explicit float with 11 explicit bits of mantissa and 5 bits of explicit
exponent, specifying time in microseconds. The bit format is loosely exponent, specifying time in microseconds. The bit format is loosely
modeled after IEEE 754. For example, 1 microsecond is represented as modeled after IEEE 754. For example, 1 microsecond is represented as
0x1, which has an exponent of zero, presented in the 5 high order 0x1, which has an exponent of zero, presented in the 5 high order
bits, and mantissa of 1, presented in the 11 low order bits. When bits, and mantissa of 1, presented in the 11 low order bits. When
the explicit exponent is greater than zero, an implicit high-order the explicit exponent is greater than zero, an implicit high-order
12th bit of 1 is assumed in the mantissa. For example, a floating 12th bit of 1 is assumed in the mantissa. For example, a floating
value of 0x800 has an explicit exponent of 1, as well as an explicit value of 0x800 has an explicit exponent of 1, as well as an explicit
mantissa of 0, but then has an effective mantissa of 4096 (12th bit mantissa of 0, but then has an effective mantissa of 4096 (12th bit
is assumed to be 1). Additionally, the actual exponent is one-less is assumed to be 1). Additionally, the actual exponent is one-less
than the explicit exponent, and the value represents 4096 than the explicit exponent, and the value represents 4096
microseconds. Any values larger than the representable range are microseconds. Any values larger than the representable range are
clamped to 0xFFFF. clamped to 0xFFFF.
8.2.3. ACK Frames and Packet Protection 8.13.3. ACK Frames and Packet Protection
ACK frames that acknowledge protected packets MUST be carried in a ACK frames that acknowledge protected packets MUST be carried in a
packet that has an equivalent or greater level of packet protection. packet that has an equivalent or greater level of packet protection.
Packets that are protected with 1-RTT keys MUST be acknowledged in Packets that are protected with 1-RTT keys MUST be acknowledged in
packets that are also protected with 1-RTT keys. packets that are also protected with 1-RTT keys.
A packet that is not protected and claims to acknowledge a packet A packet that is not protected and claims to acknowledge a packet
number that was sent with packet protection is not valid. An number that was sent with packet protection is not valid. An
unprotected packet that carries acknowledgments for protected packets unprotected packet that carries acknowledgments for protected packets
skipping to change at page 42, line 30 skipping to change at page 48, line 16
protection keys. protection keys.
For instance, a server acknowledges a TLS ClientHello in the packet For instance, a server acknowledges a TLS ClientHello in the packet
that carries the TLS ServerHello; similarly, a client can acknowledge that carries the TLS ServerHello; similarly, a client can acknowledge
a TLS HelloRetryRequest in the packet containing a second TLS a TLS HelloRetryRequest in the packet containing a second TLS
ClientHello. The complete set of server handshake messages (TLS ClientHello. The complete set of server handshake messages (TLS
ServerHello through to Finished) might be acknowledged by a client in ServerHello through to Finished) might be acknowledged by a client in
protected packets, because it is certain that the server is able to protected packets, because it is certain that the server is able to
decipher the packet. decipher the packet.
8.3. MAX_DATA Frame 8.14. STREAM Frame
The MAX_DATA frame (type=0x04) is used in flow control to inform the
peer of the maximum amount of data that can be sent on the connection
as a whole.
The frame is as follows:
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Maximum Data (64) +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The fields in the MAX_DATA frame are as follows:
Maximum Data: A 64-bit unsigned integer indicating the maximum
amount of data that can be sent on the entire connection, in units
of 1024 octets. That is, the updated connection-level data limit
is determined by multiplying the encoded value by 1024.
All data sent in STREAM frames counts toward this limit, with the
exception of data on stream 0. The sum of the largest received
offsets on all streams - including closed streams, but excluding
stream 0 - MUST NOT exceed the value advertised by a receiver. An
endpoint MUST terminate a connection with a
QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA error if it receives more
data than the maximum data value that it has sent, unless this is a
result of a change in the initial limits (see Section 7.3.2).
8.4. MAX_STREAM_DATA Frame
The MAX_STREAM_DATA frame (type=0x05) is used in flow control to
inform a peer of the maximum amount of data that can be sent on a
stream.
The frame is as follows:
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Stream ID (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Maximum Stream Data (64) +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The fields in the MAX_STREAM_DATA frame are as follows:
Stream ID: The stream ID of the stream that is affected.
Maximum Stream Data: A 64-bit unsigned integer indicating the
maximum amount of data that can be sent on the identified stream,
in units of octets.
When counting data toward this limit, an endpoint accounts for the
largest received offset of data that is sent or received on the
stream. Loss or reordering can mean that the largest received offset
on a stream can be greater than the total size of data received on
that stream. Receiving STREAM frames might not increase the largest
received offset.
The data sent on a stream MUST NOT exceed the largest maximum stream
data value advertised by the receiver. An endpoint MUST terminate a
connection with a QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA error if
it receives more data than the largest maximum stream data that it
has sent for the affected stream, unless this is a result of a change
in the initial limits (see Section 7.3.2).
8.5. MAX_STREAM_ID Frame
The MAX_STREAM_ID frame (type=0x06) informs the peer of the maximum
stream ID that they are permitted to open.
The frame is as follows:
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Maximum Stream ID (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The fields in the MAX_STREAM_ID frame are as follows:
Maximum Stream ID: ID of the maximum peer-initiated stream ID for
the connection.
Loss or reordering can mean that a MAX_STREAM_ID frame can be
received which states a lower stream limit than the client has
previously received. MAX_STREAM_ID frames which do not increase the
maximum stream ID MUST be ignored.
A peer MUST NOT initiate a stream with a higher stream ID than the
greatest maximum stream ID it has received. An endpoint MUST
terminate a connection with a QUIC_TOO_MANY_OPEN_STREAMS error if a
peer initiates a stream with a higher stream ID than it has sent,
unless this is a result of a change in the initial limits (see
Section 7.3.2).
8.6. BLOCKED Frame
A sender sends a BLOCKED frame (type=0x08) when it wishes to send
data, but is unable to due to connection-level flow control (see
Section 11.2.1). BLOCKED frames can be used as input to tuning of
flow control algorithms (see Section 11.1.2).
The BLOCKED frame does not contain a payload.
8.7. STREAM_BLOCKED Frame
A sender sends a STREAM_BLOCKED frame (type=0x09) when it wishes to
send data, but is unable to due to stream-level flow control. This
frame is analogous to BLOCKED (Section 8.6).
The STREAM_BLOCKED frame is as follows:
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Stream ID (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The STREAM_BLOCKED frame contains a single field:
Stream ID: A 32-bit unsigned number indicating the stream which is
flow control blocked.
An endpoint MAY send a STREAM_BLOCKED frame for a stream that exceeds
the maximum stream ID set by its peer (see Section 8.5). This does
not open the stream, but informs the peer that a new stream was
needed, but the stream limit prevented the creation of the stream.
8.8. STREAM_ID_NEEDED Frame
A sender sends a STREAM_ID_NEEDED frame (type=0x0a) when it wishes to
open a stream, but is unable to due to the maximum stream ID limit.
The STREAM_ID_NEEDED frame does not contain a payload.
8.9. RST_STREAM Frame
An endpoint may use a RST_STREAM frame (type=0x01) to abruptly
terminate a stream.
After sending a RST_STREAM, an endpoint ceases transmission of STREAM
frames on the identified stream. A receiver of RST_STREAM can
discard any data that it already received on that stream. An
endpoint sends a RST_STREAM in response to a RST_STREAM unless the
stream is already closed.
The RST_STREAM frame is as follows:
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Stream ID (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Error Code (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Final Offset (64) +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The fields are:
Error code: A 32-bit error code which indicates why the stream is
being closed.
Stream ID: The 32-bit Stream ID of the stream being terminated.
Final offset: A 64-bit unsigned integer indicating the absolute byte
offset of the end of data written on this stream by the RST_STREAM
sender.
8.10. PADDING Frame
The PADDING frame (type=0x00) has no semantic value. PADDING frames STREAM frames implicitly create a stream and carry stream data. The
can be used to increase the size of a packet. Padding can be used to type byte for a STREAM frame contains embedded flags, and is
increase an initial client packet to the minimum required size, or to formatted as "11FSSOOD". These bits are parsed as follows:
provide protection against traffic analysis for protected packets.
A PADDING frame has no content. That is, a PADDING frame consists of o The first two bits must be set to 11, indicating that this is a
the single octet that identifies the frame as a PADDING frame. STREAM frame.
8.11. PING frame o "F" is the FIN bit, which is used for stream termination.
Endpoints can use PING frames (type=0x07) to verify that their peers o The "SS" bits encode the length of the Stream ID header field.
are still alive or to check reachability to the peer. The PING frame The values 00, 01, 02, and 03 indicate lengths of 8, 16, 24, and
contains no additional fields. The receiver of a PING frame simply 32 bits long respectively.
needs to acknowledge the packet containing this frame. The PING
frame SHOULD be used to keep a connection alive when a stream is
open. The default is to send a PING frame after 15 seconds of
quiescence. A PING frame has no additional fields.
8.12. NEW_CONNECTION_ID Frame o The "OO" bits encode the length of the Offset header field. The
values 00, 01, 02, and 03 indicate lengths of 0, 16, 32, and 64
bits long respectively.
A server sends a NEW_CONNECTION_ID to provide the client with o The "D" bit indicates whether a Data Length field is present in
alternative connection IDs that can be used to break linkability when the STREAM header. When set to 0, this field indicates that the
migrating connections (see Section 7.6.1). Stream Data field extends to the end of the packet. When set to
1, this field indicates that Data Length field contains the length
(in bytes) of the Stream Data field. The option to omit the
length should only be used when the packet is a "full-sized"
packet, to avoid the risk of corruption via padding.
The NEW_CONNECTION_ID is as follows: A STREAM frame is shown below.
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence (16) | | Stream ID (8/16/24/32) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Connection ID (64) +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The fields are:
Sequence: A 16-bit sequence number. This value starts at 0 and
increases by 1 for each connection ID that is provided by the
server. The sequence value can wrap; the value 65535 is followed
by 0. When wrapping the sequence field, the server MUST ensure
that a value with the same sequence has been received and
acknowledged by the client. The connection ID that is assigned
during the handshake is assumed to have a sequence of 65535.
Connection ID: A 64-bit connection ID.
8.13. CONNECTION_CLOSE frame
An endpoint sends a CONNECTION_CLOSE frame (type=0x02) to notify its
peer that the connection is being closed. If there are open streams
that haven't been explicitly closed, they are implicitly closed when
the connection is closed. (Ideally, a GOAWAY frame would be sent
with enough time that all streams are torn down.) The frame is as
follows:
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Error Code (32) | | Offset (0/16/32/64) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reason Phrase Length (16) | [Reason Phrase (*)] ... | [Data Length (16)] | Stream Data (*) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The fields of a CONNECTION_CLOSE frame are as follows: Figure 10: STREAM Frame Format
Error Code: A 32-bit error code which indicates the reason for
closing this connection.
Reason Phrase Length: A 16-bit unsigned number specifying the length
of the reason phrase. Note that a CONNECTION_CLOSE frame cannot
be split between packets, so in practice any limits on packet size
will also limit the space available for a reason phrase.
Reason Phrase: A human-readable explanation for why the connection
was closed. This can be zero length if the sender chooses to not
give details beyond the Error Code. This SHOULD be a UTF-8
encoded string [RFC3629].
8.14. GOAWAY Frame
An endpoint uses a GOAWAY frame (type=0x03) to initiate a graceful The STREAM frame contains the following fields:
shutdown of a connection. The endpoints will continue to use any
active streams, but the sender of the GOAWAY will not initiate or
accept any additional streams beyond those indicated. The GOAWAY
frame is as follows:
0 1 2 3 Stream ID: The stream ID of the stream (see Section 10.1).
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Largest Client Stream ID (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Largest Server Stream ID (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The fields of a GOAWAY frame are: Offset: A variable-sized unsigned number specifying the byte offset
in the stream for the data in this STREAM frame. When the offset
length is 0, the offset is 0. The first byte in the stream has an
offset of 0. The largest offset delivered on a stream - the sum
of the re-constructed offset and data length - MUST be less than
2^64.
Largest Client Stream ID: The highest-numbered, client-initiated Data Length: An optional 16-bit unsigned number specifying the
stream on which the endpoint sending the GOAWAY frame either sent length of the Stream Data field in this STREAM frame. This field
data, or received and delivered data. All higher-numbered, is present when the "D" bit is set to 1.
client-initiated streams (that is, odd-numbered streams) are
implicitly reset by sending or receiving the GOAWAY frame.
Largest Server Stream ID: The highest-numbered, server-initiated Stream Data: The bytes from the designated stream to be delivered.
stream on which the endpoint sending the GOAWAY frame either sent
data, or received and delivered data. All higher-numbered,
server-initiated streams (that is, even-numbered streams) are
implicitly reset by sending or receiving the GOAWAY frame.
A GOAWAY frame indicates that any application layer actions on A stream frame's Stream Data MUST NOT be empty, unless the FIN bit is
streams with higher numbers than those indicated can be safely set. When the FIN flag is sent on an empty STREAM frame, the offset
retried because no data was exchanged. An endpoint MUST set the in the STREAM frame MUST be one greater than the last data byte sent
value of the Largest Client or Server Stream ID to be at least as on this stream.
high as the highest-numbered stream on which it either sent data or
received and delivered data to the application protocol that uses
QUIC.
An endpoint MAY choose a larger stream identifier if it wishes to Stream multiplexing is achieved by interleaving STREAM frames from
allow for a number of streams to be created. This is especially multiple streams into one or more QUIC packets. A single QUIC packet
valuable for peer-initiated streams where packets creating new can include multiple STREAM frames from one or more streams.
streams could be in transit; using a larger stream number allows
those streams to complete.
In addition to initiating a graceful shutdown of a connection, GOAWAY Implementation note: One of the benefits of QUIC is avoidance of
MAY be sent immediately prior to sending a CONNECTION_CLOSE frame head-of-line blocking across multiple streams. When a packet loss
that is sent as a result of detecting a fatal error. Higher-numbered occurs, only streams with data in that packet are blocked waiting for
streams than those indicated in the GOAWAY frame can then be retried. a retransmission to be received, while other streams can continue
making progress. Note that when data from multiple streams is
bundled into a single QUIC packet, loss of that packet blocks all
those streams from making progress. An implementation is therefore
advised to bundle as few streams as necessary in outgoing packets
without losing transmission efficiency to underfilled packets.
9. Packetization and Reliability 9. Packetization and Reliability
The Path Maximum Transmission Unit (PMTU) is the maximum size of the The Path Maximum Transmission Unit (PMTU) is the maximum size of the
entire IP header, UDP header, and UDP payload. The UDP payload entire IP header, UDP header, and UDP payload. The UDP payload
includes the QUIC public header, protected payload, and any includes the QUIC public header, protected payload, and any
authentication fields. authentication fields.
All QUIC packets SHOULD be sized to fit within the estimated PMTU to All QUIC packets SHOULD be sized to fit within the estimated PMTU to
avoid IP fragmentation or packet drops. To optimize bandwidth avoid IP fragmentation or packet drops. To optimize bandwidth
skipping to change at page 50, line 37 skipping to change at page 51, line 37
When a packet is detected as lost, the sender re-sends any frames as When a packet is detected as lost, the sender re-sends any frames as
necessary: necessary:
o All application data sent in STREAM frames MUST be retransmitted, o All application data sent in STREAM frames MUST be retransmitted,
unless the endpoint has sent a RST_STREAM for that stream. When unless the endpoint has sent a RST_STREAM for that stream. When
an endpoint sends a RST_STREAM frame, data outstanding on that an endpoint sends a RST_STREAM frame, data outstanding on that
stream SHOULD NOT be retransmitted, since subsequent data on this stream SHOULD NOT be retransmitted, since subsequent data on this
stream is expected to not be delivered by the receiver. stream is expected to not be delivered by the receiver.
o ACK and PADDING frames MUST NOT be retransmitted. ACK frames are o ACK and PADDING frames MUST NOT be retransmitted. ACK frames
cumulative, so new frames containing updated information will be containing updated information will be sent as described in
sent as described in Section 8.2. Section 8.13.
o All other frames MUST be retransmitted. o All other frames MUST be retransmitted.
Upon detecting losses, a sender MUST take appropriate congestion Upon detecting losses, a sender MUST take appropriate congestion
control action. The details of loss detection and congestion control control action. The details of loss detection and congestion control
are described in [QUIC-RECOVERY]. are described in [QUIC-RECOVERY].
A packet MUST NOT be acknowledged until packet protection has been A packet MUST NOT be acknowledged until packet protection has been
successfully removed and all frames contained in the packet have been successfully removed and all frames contained in the packet have been
processed. For STREAM frames, this means the data has been queued processed. For STREAM frames, this means the data has been queued
skipping to change at page 52, line 41 skipping to change at page 53, line 41
Stream ID 0 (0x0) is reserved for the cryptographic handshake. Stream ID 0 (0x0) is reserved for the cryptographic handshake.
Stream 0 MUST NOT be used for application data, and is the first Stream 0 MUST NOT be used for application data, and is the first
client-initiated stream. client-initiated stream.
A QUIC endpoint cannot reuse a Stream ID. Streams MUST be created in A QUIC endpoint cannot reuse a Stream ID. Streams MUST be created in
sequential order. Open streams can be used in any order. Streams sequential order. Open streams can be used in any order. Streams
that are used out of order result in lower-numbered streams in the that are used out of order result in lower-numbered streams in the
same direction being counted as open. same direction being counted as open.
Stream IDs are usually encoded as a 32-bit integer, though the STREAM Stream IDs are usually encoded as a 32-bit integer, though the STREAM
frame (Section 8.1) permits a shorter encoding when the leading bits frame (Section 8.14) permits a shorter encoding when the leading bits
of the stream ID are zero. of the stream ID are zero.
10.2. Life of a Stream 10.2. Life of a Stream
The semantics of QUIC streams is based on HTTP/2 streams, and the The semantics of QUIC streams is based on HTTP/2 streams, and the
lifecycle of a QUIC stream therefore closely follows that of an lifecycle of a QUIC stream therefore closely follows that of an
HTTP/2 stream [RFC7540], with some differences to accommodate the HTTP/2 stream [RFC7540], with some differences to accommodate the
possibility of out-of-order delivery due to the use of multiple possibility of out-of-order delivery due to the use of multiple
streams in QUIC. The lifecycle of a QUIC stream is shown in the streams in QUIC. The lifecycle of a QUIC stream is shown in the
following figure and described below. following figure and described below.
skipping to change at page 54, line 32 skipping to change at page 55, line 32
or a STREAM frame with the FIN flag set also causes a stream to or a STREAM frame with the FIN flag set also causes a stream to
become "half-closed". become "half-closed".
An endpoint might receive MAX_STREAM_DATA or STREAM_BLOCKED frames on An endpoint might receive MAX_STREAM_DATA or STREAM_BLOCKED frames on
peer-initiated streams that are "idle" if there is loss or reordering peer-initiated streams that are "idle" if there is loss or reordering
of packets. Receiving these frames also causes the stream to become of packets. Receiving these frames also causes the stream to become
"open". "open".
An endpoint MUST NOT send a STREAM or RST_STREAM frame for a stream An endpoint MUST NOT send a STREAM or RST_STREAM frame for a stream
ID that is higher than the peers advertised maximum stream ID (see ID that is higher than the peers advertised maximum stream ID (see
Section 8.5). Section 8.7).
10.2.2. open 10.2.2. open
A stream in the "open" state may be used by both peers to send frames A stream in the "open" state may be used by both peers to send frames
of any type. In this state, endpoints can send MAX_STREAM_DATA and of any type. In this state, endpoints can send MAX_STREAM_DATA and
MUST observe the value advertised by its receiving peer (see MUST observe the value advertised by its receiving peer (see
Section 11). Section 11).
Opening a stream causes all lower-numbered streams in the same Opening a stream causes all lower-numbered streams in the same
direction to become open. Thus, opening an odd-numbered stream direction to become open. Thus, opening an odd-numbered stream
skipping to change at page 56, line 44 skipping to change at page 57, line 44
Once a stream reaches this state, no frames can be sent that mention Once a stream reaches this state, no frames can be sent that mention
the stream. Reordering might cause frames to be received after the stream. Reordering might cause frames to be received after
closing, see Section 10.2.4. closing, see Section 10.2.4.
10.3. Stream Concurrency 10.3. Stream Concurrency
An endpoint limits the number of concurrently active incoming streams An endpoint limits the number of concurrently active incoming streams
by adjusting the maximum stream ID. An initial value is set in the by adjusting the maximum stream ID. An initial value is set in the
transport parameters (see Section 7.3.1) and is subsequently transport parameters (see Section 7.3.1) and is subsequently
increased by MAX_STREAM_ID frames (see Section 8.5). increased by MAX_STREAM_ID frames (see Section 8.7).
The maximum stream ID is specific to each endpoint and applies only The maximum stream ID is specific to each endpoint and applies only
to the peer that receives the setting. That is, clients specify the to the peer that receives the setting. That is, clients specify the
maximum stream ID the server can initiate, and servers specify the maximum stream ID the server can initiate, and servers specify the
maximum stream ID the client can initiate. Each endpoint may respond maximum stream ID the client can initiate. Each endpoint may respond
on streams initiated by the other peer, regardless of whether it is on streams initiated by the other peer, regardless of whether it is
permitted to initiated new streams. permitted to initiated new streams.
Endpoints MUST NOT exceed the limit set by their peer. An endpoint Endpoints MUST NOT exceed the limit set by their peer. An endpoint
that receives a STREAM frame with an ID greater than the limit it has that receives a STREAM frame with an ID greater than the limit it has
sent MUST treat this as a stream error of type sent MUST treat this as a stream error of type STREAM_ID_ERROR
QUIC_TOO_MANY_OPEN_STREAMS (Section 12), unless this is a result of a (Section 12), unless this is a result of a change in the initial
change in the initial offsets (see Section 7.3.2). offsets (see Section 7.3.2).
A receiver MUST NOT renege on an advertisement; that is, once a A receiver MUST NOT renege on an advertisement; that is, once a
receiver advertises a stream ID via a MAX_STREAM_ID frame, it MUST receiver advertises a stream ID via a MAX_STREAM_ID frame, it MUST
NOT subsequently advertise a smaller maximum ID. A sender may NOT subsequently advertise a smaller maximum ID. A sender may
receive MAX_STREAM_ID frames out of order; a sender MUST therefore receive MAX_STREAM_ID frames out of order; a sender MUST therefore
ignore any MAX_STREAM_ID that does not increase the maximum. ignore any MAX_STREAM_ID that does not increase the maximum.
10.4. Sending and Receiving Data 10.4. Sending and Receiving Data
Once a stream is created, endpoints may use the stream to send and Once a stream is created, endpoints may use the stream to send and
skipping to change at page 59, line 21 skipping to change at page 60, line 21
the connection or stream which it is willing to receive. the connection or stream which it is willing to receive.
A receiver MAY advertise a larger offset at any point by sending A receiver MAY advertise a larger offset at any point by sending
MAX_DATA or MAX_STREAM_DATA frames. A receiver MUST NOT renege on an MAX_DATA or MAX_STREAM_DATA frames. A receiver MUST NOT renege on an
advertisement; that is, once a receiver advertises an offset, it MUST advertisement; that is, once a receiver advertises an offset, it MUST
NOT subsequently advertise a smaller offset. A sender could receive NOT subsequently advertise a smaller offset. A sender could receive
MAX_DATA or MAX_STREAM_DATA frames out of order; a sender MUST MAX_DATA or MAX_STREAM_DATA frames out of order; a sender MUST
therefore ignore any flow control offset that does not move the therefore ignore any flow control offset that does not move the
window forward. window forward.
A receiver MUST close the connection with a A receiver MUST close the connection with a FLOW_CONTROL_ERROR error
QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA error (Section 12) if the (Section 12) if the peer violates the advertised connection or stream
peer violates the advertised connection or stream data limits. data limits.
A sender MUST send BLOCKED frames to indicate it has data to write A sender MUST send BLOCKED frames to indicate it has data to write
but is blocked by lack of connection or stream flow control credit. but is blocked by lack of connection or stream flow control credit.
BLOCKED frames are expected to be sent infrequently in common cases, BLOCKED frames are expected to be sent infrequently in common cases,
but they are considered useful for debugging and monitoring purposes. but they are considered useful for debugging and monitoring purposes.
A receiver advertises credit for a stream by sending a A receiver advertises credit for a stream by sending a
MAX_STREAM_DATA frame with the Stream ID set appropriately. A MAX_STREAM_DATA frame with the Stream ID set appropriately. A
receiver could use the current offset of data consumed to determine receiver could use the current offset of data consumed to determine
the flow control offset to be advertised. A receiver MAY send the flow control offset to be advertised. A receiver MAY send
skipping to change at page 62, line 15 skipping to change at page 63, line 15
An endpoint will know the final offset for a stream when the stream An endpoint will know the final offset for a stream when the stream
enters the "half-closed (remote)" state. However, if there is enters the "half-closed (remote)" state. However, if there is
reordering or loss, an endpoint might learn the final offset prior to reordering or loss, an endpoint might learn the final offset prior to
entering this state if it is carried on a STREAM frame. entering this state if it is carried on a STREAM frame.
An endpoint MUST NOT send data on a stream at or beyond the final An endpoint MUST NOT send data on a stream at or beyond the final
offset. offset.
Once a final offset for a stream is known, it cannot change. If a Once a final offset for a stream is known, it cannot change. If a
RST_STREAM or STREAM frame causes the final offset to change for a RST_STREAM or STREAM frame causes the final offset to change for a
stream, an endpoint SHOULD respond with a stream, an endpoint SHOULD respond with a FINAL_OFFSET_ERROR error
QUIC_STREAM_DATA_AFTER_TERMINATION error (see Section 12). A (see Section 12). A receiver SHOULD treat receipt of data at or
receiver SHOULD treat receipt of data at or beyond the final offset beyond the final offset as a FINAL_OFFSET_ERROR error, even after a
as a QUIC_STREAM_DATA_AFTER_TERMINATION error, even after a stream is stream is closed. Generating these errors is not mandatory, but only
closed. Generating these errors is not mandatory, but only because because requiring that an endpoint generate these errors also means
requiring that an endpoint generate these errors also means that the that the endpoint needs to maintain the final offset state for closed
endpoint needs to maintain the final offset state for closed streams, streams, which could mean a significant state commitment.
which could mean a significant state commitment.
12. Error Handling 12. Error Handling
An endpoint that detects an error SHOULD signal the existence of that An endpoint that detects an error SHOULD signal the existence of that
error to its peer. Errors can affect an entire connection (see error to its peer. Errors can affect an entire connection (see
Section 12.1), or a single stream (see Section 12.2). Section 12.1), or a single stream (see Section 12.2).
The most appropriate error code (Section 12.3) SHOULD be included in The most appropriate error code (Section 12.3) SHOULD be included in
the frame that signals the error. Where this specification the frame that signals the error. Where this specification
identifies error conditions, it also identifies the error code that identifies error conditions, it also identifies the error code that
skipping to change at page 62, line 45 skipping to change at page 63, line 44
Public Reset is not suitable for any error that can be signaled with Public Reset is not suitable for any error that can be signaled with
a CONNECTION_CLOSE or RST_STREAM frame. Public Reset MUST NOT be a CONNECTION_CLOSE or RST_STREAM frame. Public Reset MUST NOT be
sent by an endpoint that has the state necessary to send a frame on sent by an endpoint that has the state necessary to send a frame on
the connection. the connection.
12.1. Connection Errors 12.1. Connection Errors
Errors that result in the connection being unusable, such as an Errors that result in the connection being unusable, such as an
obvious violation of protocol semantics or corruption of state that obvious violation of protocol semantics or corruption of state that
affects an entire connection, MUST be signaled using a affects an entire connection, MUST be signaled using a
CONNECTION_CLOSE frame (Section 8.13). An endpoint MAY close the CONNECTION_CLOSE frame (Section 8.3). An endpoint MAY close the
connection in this manner, even if the error only affects a single connection in this manner, even if the error only affects a single
stream. stream.
A CONNECTION_CLOSE frame could be sent in a packet that is lost. An A CONNECTION_CLOSE frame could be sent in a packet that is lost. An
endpoint SHOULD be prepared to retransmit a packet containing a endpoint SHOULD be prepared to retransmit a packet containing a
CONNECTION_CLOSE frame if it receives more packets on a terminated CONNECTION_CLOSE frame if it receives more packets on a terminated
connection. Limiting the number of retransmissions and the time over connection. Limiting the number of retransmissions and the time over
which this final packet is sent limits the effort expended on which this final packet is sent limits the effort expended on
terminated connections. terminated connections.
An endpoint that chooses not to retransmit packets containing An endpoint that chooses not to retransmit packets containing
CONNECTION_CLOSE risks a peer missing the first such packet. The CONNECTION_CLOSE risks a peer missing the first such packet. The
only mechanism available to an endpoint that continues to receive only mechanism available to an endpoint that continues to receive
data for a terminated connection is to send a Public Reset packet. data for a terminated connection is to send a Public Reset packet.
An endpoint that receives an invalid CONNECTION_CLOSE frame MUST NOT
signal the existence of the error to its peer.
12.2. Stream Errors 12.2. Stream Errors
If the error affects a single stream, but otherwise leaves the If the error affects a single stream, but otherwise leaves the
connection in a recoverable state, the endpoint can send a RST_STREAM connection in a recoverable state, the endpoint can send a RST_STREAM
frame (Section 8.9) with an appropriate error code to terminate just frame (Section 8.2) with an appropriate error code to terminate just
the affected stream. the affected stream.
Stream 0 is critical to the functioning of the entire connection. If Stream 0 is critical to the functioning of the entire connection. If
stream 0 is closed with either a RST_STREAM or STREAM frame bearing stream 0 is closed with either a RST_STREAM or STREAM frame bearing
the FIN flag, an endpoint MUST generate a connection error of type the FIN flag, an endpoint MUST generate a connection error of type
QUIC_CLOSED_CRITICAL_STREAM. PROTOCOL_VIOLATION.
Some application protocols make other streams critical to that Some application protocols make other streams critical to that
protocol. An application protocol does not need to inform the protocol. An application protocol does not need to inform the
transport that a stream is critical; it can instead generate transport that a stream is critical; it can instead generate
appropriate errors in response to being notified that the critical appropriate errors in response to being notified that the critical
stream is closed. stream is closed.
An endpoint MAY send a RST_STREAM frame in the same packet as a An endpoint MAY send a RST_STREAM frame in the same packet as a
CONNECTION_CLOSE frame. CONNECTION_CLOSE frame.
skipping to change at page 64, line 11 skipping to change at page 65, line 14
0xC0000000-0xFFFFFFFF: Cryptographic error codes. Defined by the 0xC0000000-0xFFFFFFFF: Cryptographic error codes. Defined by the
cryptographic handshake protocol in use. cryptographic handshake protocol in use.
This section lists the defined QUIC transport error codes that may be This section lists the defined QUIC transport error codes that may be
used in a CONNECTION_CLOSE or RST_STREAM frame. Error codes share a used in a CONNECTION_CLOSE or RST_STREAM frame. Error codes share a
common code space. Some error codes apply only to either streams or common code space. Some error codes apply only to either streams or
the entire connection and have no defined semantics in the other the entire connection and have no defined semantics in the other
context. context.
QUIC_INTERNAL_ERROR (0x80000001): Connection has reached an invalid NO_ERROR (0x80000000): An endpoint uses this with CONNECTION_CLOSE
state. to signal that the connection is being closed abruptly in the
absence of any error. An endpoint uses this with RST_STREAM to
QUIC_STREAM_DATA_AFTER_TERMINATION (0x80000002): There were data signal that the stream is no longer wanted or in response to the
frames after the a fin or reset. receipt of a RST_STREAM for that stream.
QUIC_INVALID_PACKET_HEADER (0x80000003): Control frame is malformed.
QUIC_INVALID_FRAME_DATA (0x80000004): Frame data is malformed.
QUIC_MULTIPLE_TERMINATION_OFFSETS (0x80000005): Multiple final
offset values were received on the same stream
QUIC_STREAM_CANCELLED (0x80000006): The stream was cancelled
QUIC_CLOSED_CRITICAL_STREAM (0x80000007): A stream that is critical
to the protocol was closed.
QUIC_MISSING_PAYLOAD (0x80000030): The packet contained no payload.
QUIC_INVALID_STREAM_DATA (0x8000002E): STREAM frame data is
malformed.
QUIC_UNENCRYPTED_STREAM_DATA (0x8000003D): Received STREAM frame
data is not encrypted.
QUIC_MAYBE_CORRUPTED_MEMORY (0x80000059): Received a frame which is
likely the result of memory corruption.
QUIC_INVALID_RST_STREAM_DATA (0x80000006): RST_STREAM frame data is
malformed.
QUIC_INVALID_CONNECTION_CLOSE_DATA (0x80000007): CONNECTION_CLOSE
frame data is malformed.
QUIC_INVALID_GOAWAY_DATA (0x80000008): GOAWAY frame data is
malformed.
QUIC_INVALID_WINDOW_UPDATE_DATA (0x80000039): WINDOW_UPDATE frame
data is malformed.
QUIC_INVALID_BLOCKED_DATA (0x8000003A): BLOCKED frame data is
malformed.
QUIC_INVALID_PATH_CLOSE_DATA (0x8000004E): PATH_CLOSE frame data is
malformed.
QUIC_INVALID_ACK_DATA (0x80000009): ACK frame data is malformed.
QUIC_INVALID_VERSION_NEGOTIATION_PACKET (0x8000000A): Version
negotiation packet is malformed.
QUIC_INVALID_PUBLIC_RST_PACKET (0x8000000b): Public RST packet is
malformed.
QUIC_DECRYPTION_FAILURE (0x8000000c): There was an error decrypting.
QUIC_ENCRYPTION_FAILURE (0x8000000d): There was an error encrypting.
QUIC_PACKET_TOO_LARGE (0x8000000e): The packet exceeded
kMaxPacketSize.
QUIC_PEER_GOING_AWAY (0x80000010): The peer is going away. May be a
client or server.
QUIC_INVALID_STREAM_ID (0x80000011): A stream ID was invalid.
QUIC_INVALID_PRIORITY (0x80000031): A priority was invalid.
QUIC_TOO_MANY_OPEN_STREAMS (0x80000012): Too many streams already
open.
QUIC_TOO_MANY_AVAILABLE_STREAMS (0x8000004c): The peer created too
many available streams.
QUIC_PUBLIC_RESET (0x80000013): Received public reset for this
connection.
QUIC_INVALID_VERSION (0x80000014): Invalid protocol version.
QUIC_INVALID_HEADER_ID (0x80000016): The Header ID for a stream was
too far from the previous.
QUIC_INVALID_NEGOTIATED_VALUE (0x80000017): Negotiable parameter
received during handshake had invalid value.
QUIC_DECOMPRESSION_FAILURE (0x80000018): There was an error
decompressing data.
QUIC_NETWORK_IDLE_TIMEOUT (0x80000019): The connection timed out due
to no network activity.
QUIC_HANDSHAKE_TIMEOUT (0x80000043): The connection timed out
waiting for the handshake to complete.
QUIC_ERROR_MIGRATING_ADDRESS (0x8000001a): There was an error
encountered migrating addresses.
QUIC_ERROR_MIGRATING_PORT (0x80000056): There was an error
encountered migrating port only.
QUIC_EMPTY_STREAM_FRAME_NO_FIN (0x80000032): We received a
STREAM_FRAME with no data and no fin flag set.
QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA (0x8000003b): The peer
received too much data, violating flow control.
QUIC_FLOW_CONTROL_SENT_TOO_MUCH_DATA (0x8000003f): The peer sent too
much data, violating flow control.
QUIC_FLOW_CONTROL_INVALID_WINDOW (0x80000040): The peer received an
invalid flow control window.
QUIC_CONNECTION_IP_POOLED (0x8000003e): The connection has been IP
pooled into an existing connection.
QUIC_TOO_MANY_OUTSTANDING_SENT_PACKETS (0x80000044): The connection
has too many outstanding sent packets.
QUIC_TOO_MANY_OUTSTANDING_RECEIVED_PACKETS (0x80000045): The
connection has too many outstanding received packets.
QUIC_CONNECTION_CANCELLED (0x80000046): The QUIC connection has been INTERNAL_ERROR (0x80000001): The endpoint encountered an internal
cancelled. error and cannot continue with the connection.
QUIC_BAD_PACKET_LOSS_RATE (0x80000047): Disabled QUIC because of CANCELLED (0x80000002): An endpoint sends this with RST_STREAM to
high packet loss rate. indicate that the stream is not wanted and that no application
action was taken for the stream. This error code is not valid for
use with CONNECTION_CLOSE.
QUIC_PUBLIC_RESETS_POST_HANDSHAKE (0x80000049): Disabled QUIC FLOW_CONTROL_ERROR (0x80000003): An endpoint received more data than
because of too many PUBLIC_RESETs post handshake. it permitted in its advertised data limits (see Section 11).
QUIC_TIMEOUTS_WITH_OPEN_STREAMS (0x8000004a): Disabled QUIC because STREAM_ID_ERROR (0x80000004): An endpoint received a frame for a
of too many timeouts with streams open. stream identifier that exceeded its advertised maximum stream ID.
QUIC_TOO_MANY_RTOS (0x80000055): QUIC timed out after too many RTOs. STREAM_STATE_ERROR (0x80000005): An endpoint received a frame for a
stream that was not in a state that permitted that frame (see
Section 10.2).
QUIC_ENCRYPTION_LEVEL_INCORRECT (0x8000002c): A packet was received FINAL_OFFSET_ERROR (0x80000006): An endpoint received a STREAM frame
with the wrong encryption level (i.e. it should have been containing data that exceeded the previously established final
encrypted but was not.) offset. Or an endpoint received a RST_STREAM frame containing a
final offset that was lower than the maximum offset of data that
was already received. Or an endpoint received a RST_STREAM frame
containing a different final offset to the one already
established.
QUIC_VERSION_NEGOTIATION_MISMATCH (0x80000037): This connection FRAME_FORMAT_ERROR (0x80000007): An endpoint received a frame that
involved a version negotiation which appears to have been tampered was badly formatted. For instance, an empty STREAM frame that
with. omitted the FIN flag, or an ACK frame that has more acknowledgment
ranges than the remainder of the packet could carry. This is a
generic error code; an endpoint SHOULD use the more specific frame
format error codes (0x800001XX) if possible.
QUIC_IP_ADDRESS_CHANGED (0x80000050): IP address changed causing TRANSPORT_PARAMETER_ERROR (0x80000008): An endpoint received
connection close. transport parameters that were badly formatted, included an
invalid value, was absent even though it is mandatory, was present
though it is forbidden, or is otherwise in error.
QUIC_ADDRESS_VALIDATION_FAILURE (0x80000051): Client address VERSION_NEGOTIATION_ERROR (0x80000009): An endpoint received
validation failed. transport parameters that contained version negotiation parameters
that disagreed with the version negotiation that it performed.
This error code indicates a potential version downgrade attack.
QUIC_TOO_MANY_FRAME_GAPS (0x8000005d): Stream frames arrived too PROTOCOL_VIOLATION (0x8000000A): An endpoint detected an error with
discontiguously so that stream sequencer buffer maintains too many protocol compliance that was not covered by more specific error
gaps. codes.
QUIC_TOO_MANY_SESSIONS_ON_SERVER (0x80000060): Connection closed FRAME_ERROR (0x800001XX): An endpoint detected an error in a
because server hit max number of sessions allowed. specific frame type. The frame type is included as the last octet
of the error code. For example, an error in a MAX_STREAM_ID frame
would be indicated with the code (0x80000106).
13. Security and Privacy Considerations 13. Security and Privacy Considerations
13.1. Spoofed ACK Attack 13.1. Spoofed ACK Attack
An attacker receives an STK from the server and then releases the IP An attacker receives an STK from the server and then releases the IP
address on which it received the STK. The attacker may, in the address on which it received the STK. The attacker may, in the
future, spoof this same address (which now presumably addresses a future, spoof this same address (which now presumably addresses a
different endpoint), and initiate a 0-RTT connection with a server on different endpoint), and initiate a 0-RTT connection with a server on
the victim's behalf. The attacker then spoofs ACK frames to the the victim's behalf. The attacker then spoofs ACK frames to the
skipping to change at page 70, line 16 skipping to change at page 69, line 16
| Value | Parameter Name | Specification | | Value | Parameter Name | Specification |
+--------+-------------------------+---------------+ +--------+-------------------------+---------------+
| 0x0000 | initial_max_stream_data | Section 7.3.1 | | 0x0000 | initial_max_stream_data | Section 7.3.1 |
| | | | | | | |
| 0x0001 | initial_max_data | Section 7.3.1 | | 0x0001 | initial_max_data | Section 7.3.1 |
| | | | | | | |
| 0x0002 | initial_max_stream_id | Section 7.3.1 | | 0x0002 | initial_max_stream_id | Section 7.3.1 |
| | | | | | | |
| 0x0003 | idle_timeout | Section 7.3.1 | | 0x0003 | idle_timeout | Section 7.3.1 |
| | | | | | | |
| 0x0004 | truncate_connection_id | Section 7.3.1 | | 0x0004 | omit_connection_id | Section 7.3.1 |
| | | | | | | |
| 0x0005 | max_packet_size | Section 7.3.1 | | 0x0005 | max_packet_size | Section 7.3.1 |
+--------+-------------------------+---------------+ +--------+-------------------------+---------------+
Table 4: Initial QUIC Transport Parameters Entries Table 4: Initial QUIC Transport Parameters Entries
15. References 15. References
15.1. Normative References 15.1. Normative References
[I-D.ietf-tls-tls13] [I-D.ietf-tls-tls13]
Rescorla, E., "The Transport Layer Security (TLS) Protocol Rescorla, E., "The Transport Layer Security (TLS) Protocol
Version 1.3", draft-ietf-tls-tls13-20 (work in progress), Version 1.3", draft-ietf-tls-tls13-21 (work in progress),
April 2017. July 2017.
[QUIC-RECOVERY] [QUIC-RECOVERY]
Iyengar, J., Ed. and I. Swett, Ed., "QUIC Loss Detection Iyengar, J., Ed. and I. Swett, Ed., "QUIC Loss Detection
and Congestion Control", draft-ietf-quic-recovery-latest and Congestion Control", draft-ietf-quic-recovery-latest
(work in progress). (work in progress).
[QUIC-TLS] [QUIC-TLS]
Thomson, M., Ed. and S. Turner, Ed., "Using Transport Thomson, M., Ed. and S. Turner, Ed., "Using Transport
Layer Security (TLS) to Secure QUIC", draft-ietf-quic-tls- Layer Security (TLS) to Secure QUIC", draft-ietf-quic-tls-
latest (work in progress). latest (work in progress).
skipping to change at page 71, line 19 skipping to change at page 70, line 19
[RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO
10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November
2003, <http://www.rfc-editor.org/info/rfc3629>. 2003, <http://www.rfc-editor.org/info/rfc3629>.
[RFC4821] Mathis, M. and J. Heffner, "Packetization Layer Path MTU [RFC4821] Mathis, M. and J. Heffner, "Packetization Layer Path MTU
Discovery", RFC 4821, DOI 10.17487/RFC4821, March 2007, Discovery", RFC 4821, DOI 10.17487/RFC4821, March 2007,
<http://www.rfc-editor.org/info/rfc4821>. <http://www.rfc-editor.org/info/rfc4821>.
[RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an
IANA Considerations Section in RFCs", BCP 26, RFC 5226, IANA Considerations Section in RFCs", RFC 5226,
DOI 10.17487/RFC5226, May 2008, DOI 10.17487/RFC5226, May 2008,
<http://www.rfc-editor.org/info/rfc5226>. <http://www.rfc-editor.org/info/rfc5226>.
15.2. Informative References 15.2. Informative References
[EARLY-DESIGN] [EARLY-DESIGN]
Roskind, J., "QUIC: Multiplexed Transport Over UDP", Roskind, J., "QUIC: Multiplexed Transport Over UDP",
December 2013, <https://goo.gl/dMVtFi>. December 2013, <https://goo.gl/dMVtFi>.
[RFC2360] Scott, G., "Guide for Internet Standards Writers", BCP 22, [RFC2360] Scott, G., "Guide for Internet Standards Writers", BCP 22,
skipping to change at page 73, line 5 skipping to change at page 72, line 5
discussions and public ones on the quic@ietf.org and proto- discussions and public ones on the quic@ietf.org and proto-
quic@chromium.org mailing lists. Our thanks to all. quic@chromium.org mailing lists. Our thanks to all.
Appendix C. Change Log Appendix C. Change Log
*RFC Editor's Note:* Please remove this section prior to *RFC Editor's Note:* Please remove this section prior to
publication of a final version of this document. publication of a final version of this document.
Issue and pull request numbers are listed with a leading octothorp. Issue and pull request numbers are listed with a leading octothorp.
C.1. Since draft-ietf-quic-transport-02 C.1. Since draft-ietf-quic-transport-03
o Change STREAM and RST_STREAM layout
o Add MAX_STREAM_ID settings
C.2. Since draft-ietf-quic-transport-02
o The size of the initial packet payload has a fixed minimum (#267, o The size of the initial packet payload has a fixed minimum (#267,
#472) #472)
o Define when Version Negotiation packets are ignored (#284, #294, o Define when Version Negotiation packets are ignored (#284, #294,
#241, #143, #474) #241, #143, #474)
o The 64-bit FNV-1a algorithm is used for integrity protection of o The 64-bit FNV-1a algorithm is used for integrity protection of
unprotected packets (#167, #480, #481, #517) unprotected packets (#167, #480, #481, #517)
skipping to change at page 73, line 44 skipping to change at page 72, line 50
* WINDOW_UPDATE split into MAX_DATA and MAX_STREAM_DATA (#450) * WINDOW_UPDATE split into MAX_DATA and MAX_STREAM_DATA (#450)
* BLOCKED split to match WINDOW_UPDATE split (#454) * BLOCKED split to match WINDOW_UPDATE split (#454)
* Define STREAM_ID_NEEDED frame (#455) * Define STREAM_ID_NEEDED frame (#455)
o A NEW_CONNECTION_ID frame supports connection migration without o A NEW_CONNECTION_ID frame supports connection migration without
linkability (#232, #491, #496) linkability (#232, #491, #496)
o Transport parameters for 0-RTT are retained from a previous o Transport parameters for 0-RTT are retained from a previous
connection (#512) connection (#405, #513, #512)
* A client in 0-RTT no longer required to reset excess streams * A client in 0-RTT no longer required to reset excess streams
(#425, #479) (#425, #479)
o Expanded security considerations (#440, #444, #445, #448) o Expanded security considerations (#440, #444, #445, #448)
C.2. Since draft-ietf-quic-transport-01 C.3. Since draft-ietf-quic-transport-01
o Defined short and long packet headers (#40, #148, #361) o Defined short and long packet headers (#40, #148, #361)
o Defined a versioning scheme and stable fields (#51, #361) o Defined a versioning scheme and stable fields (#51, #361)
o Define reserved version values for "greasing" negotiation (#112, o Define reserved version values for "greasing" negotiation (#112,
#278) #278)
o The initial packet number is randomized (#35, #283) o The initial packet number is randomized (#35, #283)
skipping to change at page 76, line 5 skipping to change at page 75, line 8
o Remove error code and reason phrase from GOAWAY (#352, #355) o Remove error code and reason phrase from GOAWAY (#352, #355)
o GOAWAY includes a final stream number for both directions (#347) o GOAWAY includes a final stream number for both directions (#347)
o Error codes for RST_STREAM and CONNECTION_CLOSE are now at a o Error codes for RST_STREAM and CONNECTION_CLOSE are now at a
consistent offset (#249) consistent offset (#249)
o Defined priority as the responsibility of the application protocol o Defined priority as the responsibility of the application protocol
(#104, #303) (#104, #303)
C.3. Since draft-ietf-quic-transport-00 C.4. Since draft-ietf-quic-transport-00
o Replaced DIVERSIFICATION_NONCE flag with KEY_PHASE flag o Replaced DIVERSIFICATION_NONCE flag with KEY_PHASE flag
o Defined versioning o Defined versioning
o Reworked description of packet and frame layout o Reworked description of packet and frame layout
o Error code space is divided into regions for each component o Error code space is divided into regions for each component
o Use big endian for all numeric values o Use big endian for all numeric values
C.4. Since draft-hamilton-quic-transport-protocol-01 C.5. Since draft-hamilton-quic-transport-protocol-01
o Adopted as base for draft-ietf-quic-tls o Adopted as base for draft-ietf-quic-tls
o Updated authors/editors list o Updated authors/editors list
o Added IANA Considerations section o Added IANA Considerations section
o Moved Contributors and Acknowledgments to appendices o Moved Contributors and Acknowledgments to appendices
Authors' Addresses Authors' Addresses
 End of changes. 142 change blocks. 
676 lines changed or deleted 596 lines changed or added

This html diff was produced by rfcdiff 1.44jr. The latest version is available from http://tools.ietf.org/tools/rfcdiff/