draft-ietf-quic-transport-04.txt   draft-ietf-quic-transport-05.txt 
QUIC J. Iyengar, Ed. QUIC 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: February 16, 2018 Mozilla
June 13, 2017 August 15, 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-05
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 February 16, 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 2, line 41 skipping to change at page 2, line 41
3.6. Connection Migration and Resilience to NAT Rebinding . . 8 3.6. Connection Migration and Resilience to NAT Rebinding . . 8
3.7. Version Negotiation . . . . . . . . . . . . . . . . . . . 8 3.7. Version Negotiation . . . . . . . . . . . . . . . . . . . 8
4. Versions . . . . . . . . . . . . . . . . . . . . . . . . . . 8 4. Versions . . . . . . . . . . . . . . . . . . . . . . . . . . 8
5. Packet Types and Formats . . . . . . . . . . . . . . . . . . 9 5. Packet Types and Formats . . . . . . . . . . . . . . . . . . 9
5.1. Long Header . . . . . . . . . . . . . . . . . . . . . . . 9 5.1. Long Header . . . . . . . . . . . . . . . . . . . . . . . 9
5.2. Short Header . . . . . . . . . . . . . . . . . . . . . . 11 5.2. Short Header . . . . . . . . . . . . . . . . . . . . . . 11
5.3. Version Negotiation Packet . . . . . . . . . . . . . . . 13 5.3. Version Negotiation Packet . . . . . . . . . . . . . . . 13
5.4. Cleartext Packets . . . . . . . . . . . . . . . . . . . . 14 5.4. Cleartext Packets . . . . . . . . . . . . . . . . . . . . 14
5.4.1. Client Initial Packet . . . . . . . . . . . . . . . . 14 5.4.1. Client Initial Packet . . . . . . . . . . . . . . . . 14
5.4.2. Server Stateless Retry Packet . . . . . . . . . . . . 15 5.4.2. Server Stateless Retry Packet . . . . . . . . . . . . 15
5.4.3. Server Cleartext Packet . . . . . . . . . . . . . . . 15 5.4.3. Server Cleartext Packet . . . . . . . . . . . . . . . 16
5.4.4. Client Cleartext Packet . . . . . . . . . . . . . . . 16 5.4.4. Client Cleartext Packet . . . . . . . . . . . . . . . 16
5.5. Protected Packets . . . . . . . . . . . . . . . . . . . . 16 5.5. Protected Packets . . . . . . . . . . . . . . . . . . . . 16
5.6. Public Reset Packet . . . . . . . . . . . . . . . . . . . 17 5.6. Connection ID . . . . . . . . . . . . . . . . . . . . . . 17
5.6.1. Public Reset Proof . . . . . . . . . . . . . . . . . 18 5.7. Packet Numbers . . . . . . . . . . . . . . . . . . . . . 17
5.7. Connection ID . . . . . . . . . . . . . . . . . . . . . . 18 5.7.1. Initial Packet Number . . . . . . . . . . . . . . . . 19
5.8. Packet Numbers . . . . . . . . . . . . . . . . . . . . . 18 5.8. Handling Packets from Different Versions . . . . . . . . 19
5.8.1. Initial Packet Number . . . . . . . . . . . . . . . . 19 6. Frames and Frame Types . . . . . . . . . . . . . . . . . . . 19
5.9. Handling Packets from Different Versions . . . . . . . . 20 7. Life of a Connection . . . . . . . . . . . . . . . . . . . . 21
6. Frames and Frame Types . . . . . . . . . . . . . . . . . . . 20 7.1. Version Negotiation . . . . . . . . . . . . . . . . . . . 22
7. Life of a Connection . . . . . . . . . . . . . . . . . . . . 22 7.1.1. Using Reserved Versions . . . . . . . . . . . . . . . 23
7.1. Version Negotiation . . . . . . . . . . . . . . . . . . . 23 7.2. Cryptographic and Transport Handshake . . . . . . . . . . 23
7.1.1. Using Reserved Versions . . . . . . . . . . . . . . . 24 7.3. Transport Parameters . . . . . . . . . . . . . . . . . . 24
7.2. Cryptographic and Transport Handshake . . . . . . . . . . 24 7.3.1. Transport Parameter Definitions . . . . . . . . . . . 26
7.3. Transport Parameters . . . . . . . . . . . . . . . . . . 25 7.3.2. Values of Transport Parameters for 0-RTT . . . . . . 27
7.3.1. Transport Parameter Definitions . . . . . . . . . . . 27 7.3.3. New Transport Parameters . . . . . . . . . . . . . . 27
7.3.2. Values of Transport Parameters for 0-RTT . . . . . . 28
7.3.3. New Transport Parameters . . . . . . . . . . . . . . 28
7.3.4. Version Negotiation Validation . . . . . . . . . . . 28 7.3.4. Version Negotiation Validation . . . . . . . . . . . 28
7.4. Stateless Retries . . . . . . . . . . . . . . . . . . . . 30 7.4. Stateless Retries . . . . . . . . . . . . . . . . . . . . 29
7.5. Proof of Source Address Ownership . . . . . . . . . . . . 30 7.5. Proof of Source Address Ownership . . . . . . . . . . . . 29
7.5.1. Client Address Validation Procedure . . . . . . . . . 31 7.5.1. Client Address Validation Procedure . . . . . . . . . 30
7.5.2. Address Validation on Session Resumption . . . . . . 32 7.5.2. Address Validation on Session Resumption . . . . . . 31
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 . . . . . . . . . . . . . . . . . . 32
7.6.1. Privacy Implications of Connection Migration . . . . 33 7.6.1. Privacy Implications of Connection Migration . . . . 32
7.6.2. Address Validation for Migrated Connections . . . . . 34 7.6.2. Address Validation for Migrated Connections . . . . . 33
7.7. Connection Termination . . . . . . . . . . . . . . . . . 34 7.7. Connection Termination . . . . . . . . . . . . . . . . . 34
8. Frame Types and Formats . . . . . . . . . . . . . . . . . . . 35 7.8. Stateless Reset . . . . . . . . . . . . . . . . . . . . . 34
8.1. STREAM Frame . . . . . . . . . . . . . . . . . . . . . . 35 7.8.1. Detecting a Stateless Reset . . . . . . . . . . . . . 36
8.2. ACK Frame . . . . . . . . . . . . . . . . . . . . . . . . 37 7.8.2. Calculating a Stateless Reset Token . . . . . . . . . 36
8.2.1. ACK Block Section . . . . . . . . . . . . . . . . . . 39 8. Frame Types and Formats . . . . . . . . . . . . . . . . . . . 37
8.2.2. Timestamp Section . . . . . . . . . . . . . . . . . . 40 8.1. PADDING Frame . . . . . . . . . . . . . . . . . . . . . . 37
8.2.3. ACK Frames and Packet Protection . . . . . . . . . . 41 8.2. RST_STREAM Frame . . . . . . . . . . . . . . . . . . . . 37
8.3. MAX_DATA Frame . . . . . . . . . . . . . . . . . . . . . 42 8.3. CONNECTION_CLOSE frame . . . . . . . . . . . . . . . . . 38
8.4. MAX_STREAM_DATA Frame . . . . . . . . . . . . . . . . . . 43 8.4. MAX_DATA Frame . . . . . . . . . . . . . . . . . . . . . 39
8.5. MAX_STREAM_ID Frame . . . . . . . . . . . . . . . . . . . 44 8.5. MAX_STREAM_DATA Frame . . . . . . . . . . . . . . . . . . 39
8.6. BLOCKED Frame . . . . . . . . . . . . . . . . . . . . . . 44 8.6. MAX_STREAM_ID Frame . . . . . . . . . . . . . . . . . . . 40
8.7. STREAM_BLOCKED Frame . . . . . . . . . . . . . . . . . . 44 8.7. PING frame . . . . . . . . . . . . . . . . . . . . . . . 41
8.8. STREAM_ID_NEEDED Frame . . . . . . . . . . . . . . . . . 45 8.8. BLOCKED Frame . . . . . . . . . . . . . . . . . . . . . . 41
8.9. RST_STREAM Frame . . . . . . . . . . . . . . . . . . . . 45 8.9. STREAM_BLOCKED Frame . . . . . . . . . . . . . . . . . . 41
8.10. PADDING Frame . . . . . . . . . . . . . . . . . . . . . . 46 8.10. STREAM_ID_NEEDED Frame . . . . . . . . . . . . . . . . . 42
8.11. PING frame . . . . . . . . . . . . . . . . . . . . . . . 46 8.11. NEW_CONNECTION_ID Frame . . . . . . . . . . . . . . . . . 42
8.12. NEW_CONNECTION_ID Frame . . . . . . . . . . . . . . . . . 46 8.12. STOP_SENDING Frame . . . . . . . . . . . . . . . . . . . 43
8.13. CONNECTION_CLOSE frame . . . . . . . . . . . . . . . . . 47 8.13. ACK Frame . . . . . . . . . . . . . . . . . . . . . . . . 43
8.14. GOAWAY Frame . . . . . . . . . . . . . . . . . . . . . . 48 8.13.1. ACK Block Section . . . . . . . . . . . . . . . . . 46
9. Packetization and Reliability . . . . . . . . . . . . . . . . 49 8.13.2. Timestamp Section . . . . . . . . . . . . . . . . . 46
9.1. Special Considerations for PMTU Discovery . . . . . . . . 51 8.13.3. ACK Frames and Packet Protection . . . . . . . . . . 48
10. Streams: QUIC's Data Structuring Abstraction . . . . . . . . 51 8.14. STREAM Frame . . . . . . . . . . . . . . . . . . . . . . 49
10.1. Stream Identifiers . . . . . . . . . . . . . . . . . . . 52 9. Packetization and Reliability . . . . . . . . . . . . . . . . 51
10.2. Life of a Stream . . . . . . . . . . . . . . . . . . . . 52 9.1. Special Considerations for PMTU Discovery . . . . . . . . 53
10.2.1. idle . . . . . . . . . . . . . . . . . . . . . . . . 54 10. Streams: QUIC's Data Structuring Abstraction . . . . . . . . 53
10.2.2. open . . . . . . . . . . . . . . . . . . . . . . . . 54 10.1. Stream Identifiers . . . . . . . . . . . . . . . . . . . 54
10.2.3. half-closed (local) . . . . . . . . . . . . . . . . 55 10.2. Life of a Stream . . . . . . . . . . . . . . . . . . . . 54
10.2.4. half-closed (remote) . . . . . . . . . . . . . . . . 55 10.2.1. idle . . . . . . . . . . . . . . . . . . . . . . . . 56
10.2.5. closed . . . . . . . . . . . . . . . . . . . . . . . 56 10.2.2. open . . . . . . . . . . . . . . . . . . . . . . . . 56
10.3. Stream Concurrency . . . . . . . . . . . . . . . . . . . 56 10.2.3. half-closed (local) . . . . . . . . . . . . . . . . 57
10.4. Sending and Receiving Data . . . . . . . . . . . . . . . 57 10.2.4. half-closed (remote) . . . . . . . . . . . . . . . . 57
10.5. Stream Prioritization . . . . . . . . . . . . . . . . . 57 10.2.5. closed . . . . . . . . . . . . . . . . . . . . . . . 58
11. Flow Control . . . . . . . . . . . . . . . . . . . . . . . . 58 10.3. Solicited State Transitions . . . . . . . . . . . . . . 58
11.1. Edge Cases and Other Considerations . . . . . . . . . . 59 10.4. Stream Concurrency . . . . . . . . . . . . . . . . . . . 59
11.1.1. Response to a RST_STREAM . . . . . . . . . . . . . . 60 10.5. Sending and Receiving Data . . . . . . . . . . . . . . . 59
11.1.2. Data Limit Increments . . . . . . . . . . . . . . . 60 10.6. Stream Prioritization . . . . . . . . . . . . . . . . . 60
11.2. Stream Limit Increment . . . . . . . . . . . . . . . . . 61 11. Flow Control . . . . . . . . . . . . . . . . . . . . . . . . 61
11.2.1. Blocking on Flow Control . . . . . . . . . . . . . . 61 11.1. Edge Cases and Other Considerations . . . . . . . . . . 62
11.3. Stream Final Offset . . . . . . . . . . . . . . . . . . 61 11.1.1. Response to a RST_STREAM . . . . . . . . . . . . . . 63
12. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 62 11.1.2. Data Limit Increments . . . . . . . . . . . . . . . 63
12.1. Connection Errors . . . . . . . . . . . . . . . . . . . 62 11.2. Stream Limit Increment . . . . . . . . . . . . . . . . . 63
12.2. Stream Errors . . . . . . . . . . . . . . . . . . . . . 63 11.2.1. Blocking on Flow Control . . . . . . . . . . . . . . 64
12.3. Error Codes . . . . . . . . . . . . . . . . . . . . . . 63 11.3. Stream Final Offset . . . . . . . . . . . . . . . . . . 64
13. Security and Privacy Considerations . . . . . . . . . . . . . 67 12. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 65
13.1. Spoofed ACK Attack . . . . . . . . . . . . . . . . . . . 67 12.1. Connection Errors . . . . . . . . . . . . . . . . . . . 65
12.2. Stream Errors . . . . . . . . . . . . . . . . . . . . . 66
12.3. Error Codes . . . . . . . . . . . . . . . . . . . . . . 66
13. Security and Privacy Considerations . . . . . . . . . . . . . 68
13.1. Spoofed ACK Attack . . . . . . . . . . . . . . . . . . . 68
13.2. Slowloris Attacks . . . . . . . . . . . . . . . . . . . 68 13.2. Slowloris Attacks . . . . . . . . . . . . . . . . . . . 68
13.3. Stream Fragmentation and Reassembly Attacks . . . . . . 68 13.3. Stream Fragmentation and Reassembly Attacks . . . . . . 69
13.4. Stream Commitment Attack . . . . . . . . . . . . . . . . 68 13.4. Stream Commitment Attack . . . . . . . . . . . . . . . . 69
14. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 69 14. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 70
14.1. QUIC Transport Parameter Registry . . . . . . . . . . . 69 14.1. QUIC Transport Parameter Registry . . . . . . . . . . . 70
15. References . . . . . . . . . . . . . . . . . . . . . . . . . 70 15. References . . . . . . . . . . . . . . . . . . . . . . . . . 71
15.1. Normative References . . . . . . . . . . . . . . . . . . 70 15.1. Normative References . . . . . . . . . . . . . . . . . . 71
15.2. Informative References . . . . . . . . . . . . . . . . . 71 15.2. Informative References . . . . . . . . . . . . . . . . . 72
15.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 72 15.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Appendix A. Contributors . . . . . . . . . . . . . . . . . . . . 72 Appendix A. Contributors . . . . . . . . . . . . . . . . . . . . 73
Appendix B. Acknowledgments . . . . . . . . . . . . . . . . . . 72 Appendix B. Acknowledgments . . . . . . . . . . . . . . . . . . 73
Appendix C. Change Log . . . . . . . . . . . . . . . . . . . . . 72 Appendix C. Change Log . . . . . . . . . . . . . . . . . . . . . 74
C.1. Since draft-ietf-quic-transport-02 . . . . . . . . . . . 73 C.1. Since draft-ietf-quic-transport-04 . . . . . . . . . . . 74
C.2. Since draft-ietf-quic-transport-01 . . . . . . . . . . . 74 C.2. Since draft-ietf-quic-transport-03 . . . . . . . . . . . 74
C.3. Since draft-ietf-quic-transport-00 . . . . . . . . . . . 76 C.3. Since draft-ietf-quic-transport-02 . . . . . . . . . . . 75
C.4. Since draft-hamilton-quic-transport-protocol-01 . . . . . 76 C.4. Since draft-ietf-quic-transport-01 . . . . . . . . . . . 76
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 76 C.5. Since draft-ietf-quic-transport-00 . . . . . . . . . . . 78
C.6. Since draft-hamilton-quic-transport-protocol-01 . . . . . 78
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 78
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. QUIC uses UDP as substrate so as to not
be compatible with legacy clients and middleboxes. QUIC require changes to legacy client operating systems and middleboxes to
authenticates all of its headers and encrypts most of the data it be deployable. QUIC authenticates all of its headers and encrypts
exchanges, including its signaling. This allows the protocol to most of the data it exchanges, including its signaling. This allows
evolve without incurring a dependency on upgrades to middleboxes. the protocol to evolve without incurring a dependency on upgrades to
This document describes the core QUIC protocol, including the middleboxes. This document describes the core QUIC protocol,
conceptual design, wire format, and mechanisms of the QUIC protocol including the conceptual design, wire format, and mechanisms of the
for connection establishment, stream multiplexing, stream and QUIC protocol for connection establishment, stream multiplexing,
connection-level flow control, and data reliability. stream and connection-level flow control, and data reliability.
Accompanying documents describe QUIC's loss detection and congestion Accompanying documents describe QUIC's loss detection and congestion
control [QUIC-RECOVERY], and the use of TLS 1.3 for key negotiation control [QUIC-RECOVERY], and the use of TLS 1.3 for key negotiation
[QUIC-TLS]. [QUIC-TLS].
2. Conventions and Definitions 2. Conventions and Definitions
The words "MUST", "MUST NOT", "SHOULD", and "MAY" are used in this The words "MUST", "MUST NOT", "SHOULD", and "MAY" are used in this
document. It's not shouting; when they are capitalized, they have document. It's not shouting; when they are capitalized, they have
the special meaning defined in [RFC2119]. the special meaning defined in [RFC2119].
skipping to change at page 8, line 8 skipping to change at page 8, line 8
[RFC6824] and in its subsequent deployability issues. [RFC6824] and in its subsequent deployability issues.
Generally, QUIC packets are always authenticated and the payload is Generally, QUIC packets are always authenticated and the payload is
typically fully encrypted. The parts of the packet header which are typically fully encrypted. The parts of the packet header which are
not encrypted are still authenticated by the receiver, so as to not encrypted are still authenticated by the receiver, so as to
thwart any packet injection or manipulation by third parties. Some thwart any packet injection or manipulation by third parties. Some
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
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 9, line 38 skipping to change at page 9, line 34
are referenced in subsequent mechanisms. are referenced in subsequent mechanisms.
All numeric values are encoded in network byte order (that is, big- All numeric values are encoded in network byte order (that is, big-
endian) and all field sizes are in bits. When discussing individual endian) and all field sizes are in bits. When discussing individual
bits of fields, the least significant bit is referred to as bit 0. bits of fields, the least significant bit is referred to as bit 0.
Hexadecimal notation is used for describing the value of fields. Hexadecimal notation is used for describing the value of fields.
Any QUIC packet has either a long or a short header, as indicated by Any QUIC packet has either a long or a short header, as indicated by
the Header Form bit. Long headers are expected to be used early in the Header Form bit. Long headers are expected to be used early in
the connection before version negotiation and establishment of 1-RTT the connection before version negotiation and establishment of 1-RTT
keys, and for public resets. Short headers are minimal version- keys. Short headers are minimal version-specific headers, which can
specific headers, which can be used after version negotiation and be used after version negotiation and 1-RTT keys are established.
1-RTT keys are established.
5.1. Long Header 5.1. Long Header
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
+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
|1| Type (7) | |1| Type (7) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | |
+ Connection ID (64) + + Connection ID (64) +
| | | |
skipping to change at page 10, line 27 skipping to change at page 10, line 27
| Payload (*) ... | Payload (*) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 1: Long Header Format Figure 1: Long Header Format
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 packet - to be represented
to be represented in this uniform fixed-length packet format. A long in this uniform fixed-length packet format. A long header contains
header contains the following fields: 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.6 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.7 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 |
| | | | | | | |
| 03 | Server Stateless Retry | Section 5.4.2 | | 0x02 | Client Initial | Section 5.4.1 |
| | | | | | | |
| 04 | Server Cleartext | Section 5.4.3 | | 0x03 | Server Stateless Retry | Section 5.4.2 |
| | | | | | | |
| 05 | Client Cleartext | Section 5.4.4 | | 0x04 | Server Cleartext | Section 5.4.3 |
| | | | | | | |
| 06 | 0-RTT Protected | Section 5.5 | | 0x05 | Client Cleartext | Section 5.4.4 |
| | | | | | | |
| 07 | 1-RTT Protected (key phase 0) | Section 5.5 | | 0x06 | 0-RTT Protected | Section 5.5 |
| | | | | | | |
| 08 | 1-RTT Protected (key phase 1) | Section 5.5 | | 0x07 | 1-RTT Protected (key phase 0) | Section 5.5 |
| | | | | | | |
| 09 | Public Reset | Section 5.6 | | 0x08 | 1-RTT Protected (key phase 1) | Section 5.5 |
+------+-------------------------------+---------------+ +------+-------------------------------+---------------+
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.8 for details on how packets from different versions of
QUIC are interpreted. QUIC are interpreted.
(TODO: Should the list of packet types be version-independent?) (TODO: Should the list of packet types be version-independent?)
The interpretation of the fields and the payload are specific to a The interpretation of the fields and the payload are specific to a
version and packet type. Type-specific semantics for this version version and packet type. Type-specific semantics for this version
are described in the following sections. are described in the following sections.
5.2. Short Header 5.2. Short Header
0 1 2 3 0 1 2 3
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.6 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.8 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
A Version Negotiation packet has long headers with a type value of A Version Negotiation packet has long headers with a type value of
0x01 and is sent only by servers. The Version Negotiation packet is 0x01 and is sent only by servers. The Version Negotiation packet is
a response to a client packet that contains a version that is not a response to a client packet that contains a version that is not
supported by the server. supported by the server.
The packet number, connection ID and version fields echo The packet number, connection ID and version fields echo
corresponding values from the triggering client packet. This allows corresponding values from the triggering client packet. This allows
clients some assurance that the server received the packet and that clients some assurance that the server received the packet and that
the Version Negotiation packet was not carried in a packet with a the Version Negotiation packet was not carried in a packet with a
spoofed source address. spoofed source address.
A Version Negotiation packet is never explicitly acknowledged in an
ACK frame by a client. Receiving another Client Initial packet
implicitly acknowledges a Version Negotiation packet.
The payload of the Version Negotiation packet is a list of 32-bit The payload of the Version Negotiation packet is a list of 32-bit
versions which the server supports, as shown below. versions which the server supports, as 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Supported Version 1 (32) ... | Supported Version 1 (32) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| [Supported Version 2 (32)] ... | [Supported Version 2 (32)] ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
skipping to change at page 14, line 46 skipping to change at page 14, line 46
the client. the client.
The client populates the connection ID field with randomly selected The client populates the connection ID field with randomly selected
values, unless it has received a packet from the server. If the values, unless it has received a packet from the server. If the
client has received a packet from the server, the connection ID field client has received a packet from the server, the connection ID field
uses the value provided by the server. uses the value provided by the server.
The packet number used for Client Initial packets is initialized with The packet number used for Client Initial packets is initialized with
a random value each time the new contents are created for the packet. a random value each time the new contents are created for the packet.
Retransmissions of the packet contents increment the packet number by Retransmissions of the packet contents increment the packet number by
one, see (Section 5.8). one, see (Section 5.7).
The payload of a Client Initial packet consists of a STREAM frame (or The payload of a Client Initial packet consists of a STREAM frame (or
frames) for stream 0 containing a cryptographic handshake message, frames) for stream 0 containing a cryptographic handshake message,
plus any PADDING frames necessary to ensure that the packet is at with enough PADDING frames that the packet is at least 1200 octets
least the minimum PMTU size (see Section 9). The stream in this (see Section 9). The stream in this packet always starts at an
packet always starts at an offset of 0 (see Section 7.4) and the offset of 0 (see Section 7.4) and the complete cyptographic handshake
complete cyptographic handshake message MUST fit in a single packet message MUST fit in a single packet (see Section 7.2).
(see Section 7.2).
The client uses the Client Initial Packet type for any packet that The client uses the Client Initial Packet type for any packet that
contains an initial cryptographic handshake message. This includes contains an initial cryptographic handshake message. This includes
all cases where a new packet containing the initial cryptographic all cases where a new packet containing the initial cryptographic
message needs to be created, this includes the packets sent after message needs to be created, this includes the packets sent after
receiving a Version Negotiation (Section 5.3) or Server Stateless receiving a Version Negotiation (Section 5.3) or Server Stateless
Retry packet (Section 5.4.2). Retry packet (Section 5.4.2).
5.4.2. Server Stateless Retry Packet 5.4.2. Server Stateless Retry Packet
A Server Stateless Retry packet uses long headers with a type value A Server Stateless Retry packet uses long headers with a type value
of 0x03. It carries cryptographic handshake messages and of 0x03. It carries cryptographic handshake messages and
acknowledgments. It is used by a server that wishes to perform a acknowledgments. It is used by a server that wishes to perform a
stateless retry (see Section 7.4). stateless retry (see Section 7.4).
The packet number and connection ID fields echo the corresponding The packet number and connection ID fields echo the corresponding
fields from the triggering client packet. This allows a client to fields from the triggering client packet. This allows a client to
verify that the server received its packet. verify that the server received its packet.
A Server Stateless Retry packet is never explicitly acknowledged in
an ACK frame by a client. Receiving another Client Initial packet
implicitly acknowledges a Server Stateless Retry packet.
After receiving a Server Stateless Retry packet, the client uses a After receiving a Server Stateless Retry packet, the client uses a
new Client Initial packet containing the next cryptographic handshake new Client Initial packet containing the next cryptographic handshake
message. The client retains the state of its cryptographic message. The client retains the state of its cryptographic
handshake, but discards all transport state. In effect, the next handshake, but discards all transport state. In effect, the next
cryptographic handshake message is sent on a new connection. The new cryptographic handshake message is sent on a new connection. The new
Client Initial packet is sent in a packet with a newly randomized Client Initial packet is sent in a packet with a newly randomized
packet number and starting at a stream offset of 0. packet number and starting at a stream offset of 0.
Continuing the cryptographic handshake is necessary to ensure that an Continuing the cryptographic handshake is necessary to ensure that an
attacker cannot force a downgrade of any cryptographic parameters. attacker cannot force a downgrade of any cryptographic parameters.
skipping to change at page 16, line 6 skipping to change at page 16, line 12
send a single Server Stateless Retry packet in response to each send a single Server Stateless Retry packet in response to each
Client Initial packet that is receives. Client Initial packet that is receives.
5.4.3. Server Cleartext Packet 5.4.3. Server Cleartext Packet
A Server Cleartext packet uses long headers with a type value of A Server Cleartext packet uses long headers with a type value of
0x04. It is used to carry acknowledgments and cryptographic 0x04. It is used to carry acknowledgments and cryptographic
handshake messages from the server. handshake messages from the server.
The connection ID field in a Server Cleartext packet contains a The connection ID field in a Server Cleartext packet contains a
connection ID that is chosen by the server (see Section 5.7). connection ID that is chosen by the server (see Section 5.6).
The first Server Cleartext packet contains a randomized packet The first Server Cleartext packet contains a randomized packet
number. This value is increased for each subsequent packet sent by number. This value is increased for each subsequent packet sent by
the server as described in Section 5.8. the server as described in Section 5.7.
The payload of this packet contains STREAM frames and could contain The payload of this packet contains STREAM frames and could contain
PADDING and ACK frames. PADDING and ACK frames.
5.4.4. Client Cleartext Packet 5.4.4. Client Cleartext Packet
A Client Cleartext packet uses long headers with a type value of A Client Cleartext packet uses long headers with a type value of
0x05, and is sent when the client has received a Server Cleartext 0x05, and is sent when the client has received a Server Cleartext
packet from the server. packet from the server.
The connection ID field in a Client Cleartext packet contains a The connection ID field in a Client Cleartext packet contains a
server-selected connection ID, see Section 5.7. server-selected connection ID, see Section 5.6.
The Client Cleartext packet includes a packet number that is one The Client Cleartext packet includes a packet number that is one
higher than the last Client Initial, 0-RTT Protected or Client higher than the last Client Initial, 0-RTT Protected or Client
Cleartext packet that was sent. The packet number is incremented for Cleartext packet that was sent. The packet number is incremented for
each subsequent packet, see Section 5.8. each subsequent packet, see Section 5.7.
The payload of this packet contains STREAM frames and could contain The payload of this packet contains STREAM frames and could contain
PADDING and ACK frames. PADDING and ACK frames.
5.5. Protected Packets 5.5. Protected Packets
Packets that are protected with 0-RTT keys are sent with long Packets that are protected with 0-RTT keys are sent with long
headers. Packets that are protected with 1-RTT keys MAY be sent with headers. Packets that are protected with 1-RTT keys MAY be sent with
long headers. The different packet types explicitly indicate the long headers. The different packet types explicitly indicate the
encryption level and therefore the keys that are used to remove encryption level and therefore the keys that are used to remove
skipping to change at page 17, line 5 skipping to change at page 17, line 11
The client can send 0-RTT packets after having received a packet from The client can send 0-RTT packets after having received a packet from
the server if that packet does not complete the handshake. Even if the server if that packet does not complete the handshake. Even if
the client receives a different connection ID from the server, it the client receives a different connection ID from the server, it
MUST NOT update the connection ID it uses for 0-RTT packets. This MUST NOT update the connection ID it uses for 0-RTT packets. This
enables consistent routing for all 0-RTT packets. enables consistent routing for all 0-RTT packets.
Packets protected with 1-RTT keys that use long headers use a type Packets protected with 1-RTT keys that use long headers use a type
value of 0x07 for key phase 0 and 0x08 for key phase 1; see value of 0x07 for key phase 0 and 0x08 for key phase 1; see
[QUIC-TLS] for more details on the use of key phases. The connection [QUIC-TLS] for more details on the use of key phases. The connection
ID field for these packet types MUST contain the value selected by ID field for these packet types MUST contain the value selected by
the server, see Section 5.7. the server, see Section 5.6.
The version field for protected packets is the current QUIC version. The version field for protected packets is the current QUIC version.
The packet number field contains a packet number, which increases The packet number field contains a packet number, which increases
with each packet sent, see Section 5.8 for details. with each packet sent, see Section 5.7 for details.
The payload is protected using authenticated encryption. [QUIC-TLS] The payload is protected using authenticated encryption. [QUIC-TLS]
describes packet protection in detail. After decryption, the describes packet protection in detail. After decryption, the
plaintext consists of a sequence of frames, as described in plaintext consists of a sequence of frames, as described in
Section 6. Section 6.
5.6. Public Reset Packet 5.6. Connection ID
A Public Reset packet is only sent by servers and is used to abruptly
terminate communications. Public Reset is provided as an option of
last resort for a server that does not have access to the state of a
connection. This is intended for use by a server that has lost state
(for example, through a crash or outage). A server that wishes to
communicate a fatal connection error MUST use a CONNECTION_CLOSE
frame if it has sufficient state to do so.
A Public Reset packet uses long headers with a type value of 0x09.
The connection ID and packet number of fields together contain octets
1 through 12 from the packet that triggered the reset. For a client
that sends a connection ID on every packet, the Connection ID field
is simply an echo of the client's Connection ID, and the Packet
Number field includes an echo of the client's packet number.
Depending on the client's packet number length it might also include
0, 2, or 3 additional octets from the protected payload of the client
packet.
The version field contains the current QUIC version.
A Public Reset packet sent by a server indicates that it does not
have the state necessary to continue with a connection. In this
case, the server will include the fields that prove that it
originally participated in the connection (see Section 5.6.1 for
details).
Upon receipt of a Public Reset packet that contains a valid proof, a
client MUST tear down state associated with the connection. The
client MUST then cease sending packets on the connection and SHOULD
discard any subsequent packets that arrive. A Public Reset that does
not contain a valid proof MUST be ignored.
5.6.1. Public Reset Proof
TODO: Details to be added.
5.7. Connection ID
QUIC connections are identified by their 64-bit Connection ID. All QUIC connections are identified by their 64-bit Connection ID. All
long headers contain a Connection ID. Short headers indicate the long headers contain a Connection ID. Short headers indicate the
presence of a Connection ID using the CONNECTION_ID flag. When presence of a Connection ID using the CONNECTION_ID flag. When
present, the Connection ID is in the same location in all packet present, the Connection ID is in the same location in all packet
headers, making it straightforward for middleboxes, such as load headers, making it straightforward for middleboxes, such as load
balancers, to locate and use it. balancers, to locate and use it.
The client MUST choose a random connection ID and use it in Client The client MUST choose a random connection ID and use it in Client
Initial packets (Section 5.4.1) and 0-RTT packets (Section 5.5). If Initial packets (Section 5.4.1) and 0-RTT packets (Section 5.5). If
skipping to change at page 18, line 33 skipping to change at page 17, line 47
When the server receives a Client Initial packet and decides to When the server receives a Client Initial packet and decides to
proceed with the handshake, it chooses a new value for the connection proceed with the handshake, it chooses a new value for the connection
ID and sends that in a Server Cleartext packet. The server MAY ID and sends that in a Server Cleartext packet. The server MAY
choose to use the value that the client initially selects. choose to use the value that the client initially selects.
Once the client receives the connection ID that the server has Once the client receives the connection ID that the server has
chosen, it uses this for all subsequent packets that it sends, except chosen, it uses this for all subsequent packets that it sends, except
for any 0-RTT packets, which all have the same connection ID. for any 0-RTT packets, which all have the same connection ID.
5.8. Packet Numbers 5.7. Packet Numbers
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.7.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. The actual packet number for each packet is
number for each packet is reconstructed at the receiver based on the reconstructed at the receiver based on the largest packet number
largest packet number received on a successfully authenticated 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.
Version Negotiation (Section 5.3), Server Stateless Retry Version Negotiation (Section 5.3) and Server Stateless Retry
(Section 5.4.2), and Public Reset (Section 5.6) packets have special (Section 5.4.2) packets have special rules for populating the packet
rules for populating the packet number field. number field.
5.8.1. Initial Packet Number 5.7.1. Initial Packet Number
The initial value for packet number MUST be selected from an uniform The initial value for packet number MUST be selected from an uniform
random distribution between 0 and 2^31-1. That is, the lower 31 bits random distribution between 0 and 2^31-1. That is, the lower 31 bits
of the packet number are randomized. [RFC4086] provides guidance on of the packet number are randomized. [RFC4086] provides guidance on
the generation of random values. the generation of random values.
The first set of packets sent by an endpoint MUST include the low The first set of packets sent by an endpoint MUST include the low
32-bits of the packet number. Once any packet has been acknowledged, 32-bits of the packet number. Once any packet has been acknowledged,
subsequent packets can use a shorter packet number encoding. subsequent packets can use a shorter packet number encoding.
skipping to change at page 20, line 9 skipping to change at page 19, line 27
Stateless Retry packet (Section 5.4.2) MUST generate a new initial Stateless Retry packet (Section 5.4.2) MUST generate a new initial
packet number. This ensures that the first transmission attempt for packet number. This ensures that the first transmission attempt for
a Client Initial packet (Section 5.4.1) always contains a randomized a Client Initial packet (Section 5.4.1) always contains a randomized
packet number, but packets that contain retransmissions increment the packet number, but packets that contain retransmissions increment the
packet number. packet number.
A client MUST NOT generate a new initial packet number if it discards A client MUST NOT generate a new initial packet number if it discards
the server packet. This might happen if the information the client the server packet. This might happen if the information the client
retransmits its Client Initial packet. retransmits its Client Initial packet.
5.9. Handling Packets from Different Versions 5.8. Handling Packets from Different Versions
Between different versions the following things are guaranteed to Between different versions the following things are guaranteed to
remain constant: remain constant:
o the location of the header form flag, o the location of the header form flag,
o the location of the Connection ID flag in short headers, o the location of the Connection ID flag in short headers,
o the location and size of the Connection ID field in both header o the location and size of the Connection ID field in both header
forms, forms,
skipping to change at page 22, line 8 skipping to change at page 21, 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 | | 0x04 | MAX_DATA | Section 8.4 |
| | | | | | | |
| 0x04 | MAX_DATA | Section 8.3 | | 0x05 | MAX_STREAM_DATA | Section 8.5 |
| | | | | | | |
| 0x05 | MAX_STREAM_DATA | Section 8.4 | | 0x06 | MAX_STREAM_ID | Section 8.6 |
| | | | | | | |
| 0x06 | MAX_STREAM_ID | Section 8.5 | | 0x07 | PING | Section 8.7 |
| | | | | | | |
| 0x07 | PING | Section 8.11 | | 0x08 | BLOCKED | Section 8.8 |
| | | | | | | |
| 0x08 | BLOCKED | Section 8.6 | | 0x09 | STREAM_BLOCKED | Section 8.9 |
| | | | | | | |
| 0x09 | STREAM_BLOCKED | Section 8.7 | | 0x0a | STREAM_ID_NEEDED | Section 8.10 |
| | | | | | | |
| 0x0a | STREAM_ID_NEEDED | Section 8.8 | | 0x0b | NEW_CONNECTION_ID | Section 8.11 |
| | | | | | | |
| 0x0b | NEW_CONNECTION_ID | Section 8.12 | | 0x0c | STOP_SENDING | 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 25, 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),
stateless_reset_token(6),
(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 26, 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.5) 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.4) 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.6) 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).
stateless_reset_token (0x0005): The Stateless Reset Token is used in
verifying a stateless reset, see Section 7.8. This parameter is a
sequence of 16 octets.
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 1200 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
server advertises during connection establishment are used. server advertises during connection establishment are used.
skipping to change at page 29, line 14 skipping to change at page 28, 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 28, 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.
When an endpoint accepts multiple QUIC versions, it can potentially
interpret transport parameters as they are defined by any of the QUIC
versions it supports. The version field in the QUIC packet header is
authenticated using transport parameters. The position and the
format of the version fields in transport parameters MUST either be
identical across different QUIC versions, or be unambiguously
different to ensure no confusion about their interpretation. One way
that a new format could be introduced is to define a TLS extension
with a different codepoint.
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 32, line 27
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 33, line 26 skipping to change at page 32, line 50
7.6.1. Privacy Implications of Connection Migration 7.6.1. Privacy Implications of Connection Migration
Using a stable connection ID on multiple network paths allows a Using a stable connection ID on multiple network paths allows a
passive observer to correlate activity between those paths. A client passive observer to correlate activity between those paths. A client
that moves between networks might not wish to have their activity that moves between networks might not wish to have their activity
correlated by any entity other than a server. The NEW_CONNECTION_ID correlated by any entity other than a server. The NEW_CONNECTION_ID
message can be sent by a server to provide an unlinkable connection message can be sent by a server to provide an unlinkable connection
ID for use in case the client wishes to explicitly break linkability ID for use in case the client wishes to explicitly break linkability
between two points of network attachment. between two points of network attachment.
A client which wishes to break linkability upon changing networks
MUST use the NEW_CONNECTION_ID as well as incrementing the packet
sequence number by an externally unpredictable value computed as
described in Section 7.6.1.1. Packet number gaps are cumulative. A
client might skip connection IDs, but it MUST ensure that it applies
the associated packet number gaps in addition to the packet number
gap associated with the connection ID that it does use.
A client might need to send packets on multiple networks without A client might need to send packets on multiple networks without
receiving any response from the server. To ensure that the client is receiving any response from the server. To ensure that the client is
not linkable across each of these changes, a new connection ID and not linkable across each of these changes, a new connection ID and
packet number gap are needed for each network. To support this, a packet number gap are needed for each network. To support this, a
server sends multiple NEW_CONNECTION_ID messages. Each server sends multiple NEW_CONNECTION_ID messages. Each
NEW_CONNECTION_ID is marked with a sequence number. Connection IDs NEW_CONNECTION_ID is marked with a sequence number. Connection IDs
MUST be used in the order in which they are numbered. MUST be used in the order in which they are numbered.
A client which wishes to break linkability upon changing networks
MUST use the connection ID provided by the server as well as
incrementing the packet sequence number by an externally
unpredictable value computed as described in Section 7.6.1.1. Packet
number gaps are cumulative. A client might skip connection IDs, but
it MUST ensure that it applies the associated packet number gaps for
connection IDs that it skips in addition to the packet number gap
associated with the connection ID that it does use.
A server that receives a packet that is marked with a new connection A server that receives a packet that is marked with a new connection
ID recovers the packet number by adding the cumulative packet number ID recovers the packet number by adding the cumulative packet number
gap to its expected packet number. A server SHOULD discard packets gap to its expected packet number. A server SHOULD discard packets
that contain a smaller gap than it advertised. that contain a smaller gap than it advertised.
For instance, a server might provide a packet number gap of 7 For instance, a server might provide a packet number gap of 7
associated with a new connection ID. If the server received packet associated with a new connection ID. If the server received packet
10 using the previous connection ID, it should expect packets on the 10 using the previous connection ID, it should expect packets on the
new connection ID to start at 18. A packet with the new connection new connection ID to start at 18. A packet with the new connection
ID and a packet number of 17 is discarded as being in error. ID and a packet number of 17 is discarded as being in error.
skipping to change at page 34, line 31 skipping to change at page 34, line 12
TODO: see issue #161 TODO: see issue #161
7.7. Connection Termination 7.7. Connection Termination
Connections should remain open until they become idle for a pre- Connections should remain open until they become idle for a pre-
negotiated period of time. A QUIC connection, once established, can negotiated period of time. A QUIC connection, once established, can
be terminated in one of three ways: be terminated in one of three ways:
1. Explicit Shutdown: An endpoint sends a CONNECTION_CLOSE frame to 1. Explicit Shutdown: An endpoint sends a CONNECTION_CLOSE frame to
initiate a connection termination. An endpoint may send a GOAWAY terminate the connection. An endpoint MAY use application-layer
frame to the peer prior to a CONNECTION_CLOSE to indicate that mechanisms prior to a CONNECTION_CLOSE to indicate that the
the connection will soon be terminated. A GOAWAY frame signals connection will soon be terminated. On termination of the active
to the peer that any active streams will continue to be streams, a CONNECTION_CLOSE may be sent. If an endpoint sends a
processed, but the sender of the GOAWAY will not initiate any CONNECTION_CLOSE frame while unterminated streams are active (no
additional streams and will not accept any new incoming streams. FIN bit or RST_STREAM frames have been sent or received for one
On termination of the active streams, a CONNECTION_CLOSE may be or more streams), then the peer must assume that the streams were
sent. If an endpoint sends a CONNECTION_CLOSE frame while incomplete and were abnormally terminated.
unterminated streams are active (no FIN bit or RST_STREAM frames
have been sent or received for one or more streams), then the
peer must assume that the streams were incomplete and were
abnormally terminated.
2. Implicit Shutdown: The default idle timeout is a required 2. Implicit Shutdown: The default idle timeout is a required
parameter in connection negotiation. The maximum is 10 minutes. parameter in connection negotiation. The maximum is 10 minutes.
If there is no network activity for the duration of the idle If there is no network activity for the duration of the idle
timeout, the connection is closed. By default a CONNECTION_CLOSE timeout, the connection is closed. By default a CONNECTION_CLOSE
frame will be sent. A silent close option can be enabled when it frame will be sent. A silent close option can be enabled when it
is expensive to send an explicit close, such as mobile networks is expensive to send an explicit close, such as mobile networks
that must wake up the radio. that must wake up the radio.
3. Abrupt Shutdown: An endpoint may send a Public Reset packet at 3. Stateless Reset: An endpoint that loses state can use this
any time during the connection to abruptly terminate an active procedure to cause the connection to terminate early, see
connection. A Public Reset packet SHOULD only be used as a final Section 7.8 for details.
recourse. Commonly, a public reset is expected to be sent when a
packet on an established connection is received by an endpoint
that is unable decrypt the packet. For instance, if a server
reboots mid-connection and loses any cryptographic state
associated with open connections, and then receives a packet on
an open connection, it should send a Public Reset packet in
return. (TODO: articulate rules around when a public reset
should be sent.)
TODO: Connections that are terminated are added to a TIME_WAIT list After receiving either a CONNECTION_CLOSE frame or a Public Reset, an
at the server, so as to absorb any straggler packets in the network. endpoint MUST NOT send additional packets on that connection. After
Discuss TIME_WAIT list. sending either a CONNECTION_CLOSE frame or a Public Reset packet,
implementations MUST NOT send any non-closing packets on that
connection. If additional packets are received after this time and
before idle_timeout seconds has passed, implementations SHOULD
respond to them by sending a CONNECTION_CLOSE (which MAY just be a
duplicate of the previous CONNECTION_CLOSE packet) but MAY also send
a Public Reset packet. Implementations SHOULD throttle these
responses, for instance by exponentially backing off the number of
packets which are received before sending a response. After this
time, implementations SHOULD respond to unexpected packets with a
Public Reset packet.
7.8. Stateless Reset
A stateless reset is provided as an option of last resort for a
server that does not have access to the state of a connection. A
server crash or outage might result in clients continuing to send
data to a server that is unable to properly continue the connection.
A server that wishes to communicate a fatal connection error MUST use
a CONNECTION_CLOSE frame if it has sufficient state to do so.
To support this process, the server sends a stateless_reset_token
value during the handshake in the transport parameters. This value
is protected by encryption, so only client and server know this
value.
A server that receives packets that it cannot process sends a packet
in the following layout:
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|C|K| 00001 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ [Connection ID (64)] +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Stateless Reset Token (128) +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Random Octets (*) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This packet SHOULD use the short header form with the shortest
possible packet number encoding. This minimizes the perceived gap
between the last packet that the server sent and this packet. The
leading octet of the Stateless Reset Token will be interpreted as a
packet number. A server MAY use a different short header type,
indicating a different packet number length, but this allows for the
message to be identified as a stateless reset more easily using
heuristics.
A server copies the connection ID field from the packet that triggers
the stateless reset. A server omits the connection ID if explicitly
configured to do so, or if the client packet did not include a
connection ID.
After the first short header octet and optional connection ID, the
server includes the value of the Stateless Reset Token that it
included in its transport parameters.
After the Stateless Reset Token, the endpoint pads the message with
an arbitrary number of octets containing random values.
This design ensures that a stateless reset packet is - to the extent
possible - indistinguishable from a regular packet.
A stateless reset is not appropriate for signaling error conditions.
An endpoint that wishes to communicate a fatal connection error MUST
use a CONNECTION_CLOSE frame if it has sufficient state to do so.
7.8.1. Detecting a Stateless Reset
A client detects a potential stateless reset when a packet with a
short header cannot be decrypted. The client then performs a
constant-time comparison of the 16 octets that follow the Connection
ID with the Stateless Reset Token provided by the server in its
transport parameters. If this comparison is successful, the
connection MUST be terminated immediately. Otherwise, the packet can
be discarded.
7.8.2. Calculating a Stateless Reset Token
The stateless reset token MUST be difficult to guess. In order to
create a Stateless Reset Token, a server could randomly generate
[RFC4086] a secret for every connection that it creates. However,
this presents a coordination problem when there are multiple servers
in a cluster or a storage problem for a server that might lose state.
Stateless reset specifically exists to handle the case where state is
lost, so this approach is suboptimal.
A single static key can be used across all connections to the same
endpoint by generating the proof using a second iteration of a
preimage-resistant function that takes three inputs: the static key,
a the connection ID for the connection (see Section 5.6), and an
identifier for the server instance. A server could use HMAC
[RFC2104] (for example, HMAC(static_key, server_id || connection_id))
or HKDF [RFC5869] (for example, using the static key as input keying
material, with server and connection identifiers as salt). The
output of this function is truncated to 16 octets to produce the
Stateless Reset Token for that connection.
A server that loses state can use the same method to generate a valid
Stateless Reset Secret. The connection ID comes from the packet that
the server receives.
This design relies on the client always sending a connection ID in
its packets so that the server can use the connection ID from a
packet to reset the connection. A server that uses this design
cannot allow clients to omit a connection ID (that is, it cannot use
the truncate_connection_id transport parameter Section 7.3.1).
Revealing the Stateless Reset Token allows any entity to terminate
the connection, so a value can only be used once. This method for
choosing the Stateless Reset Token means that the combination of
server instance, connection ID, and static key cannot occur for
another connection. A connection ID from a connection that is reset
by revealing the Stateless Reset Token cannot be reused for new
connections at the same server without first changing to use a
different static key or server identifier.
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. 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. MAX_DATA 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) +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 7: STREAM Frame Format The fields in the MAX_DATA frame are as follows:
The STREAM frame contains the following fields: 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.
Stream ID: The stream ID of the stream (see Section 10.1). 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).
Offset: A variable-sized unsigned number specifying the byte offset 8.5. MAX_STREAM_DATA Frame
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.
Stream Data: The bytes from the designated stream to be delivered. 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.
Data Length: An optional 16-bit unsigned number specifying the The frame is as follows:
length of the Stream Data field in this STREAM frame. This field
is present when the "D" bit is set to 1.
A STREAM frame MUST have either non-zero data length or the FIN bit 0 1 2 3
set. When the FIN flag is sent on an empty STREAM frame, the offset 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
in the STREAM frame MUST be one greater than the last data byte sent +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
on this stream. | Stream ID (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Maximum Stream Data (64) +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Stream multiplexing is achieved by interleaving STREAM frames from The fields in the MAX_STREAM_DATA frame are as follows:
multiple streams into one or more QUIC packets. A single QUIC packet
can include multiple STREAM frames from one or more streams.
Implementation note: One of the benefits of QUIC is avoidance of Stream ID: The stream ID of the stream that is affected.
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 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.6. 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.7. 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.8. 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.9. 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.8).
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.6). 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.10. 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.11. 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) +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Stateless Reset Token (128) +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
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.
Stateless Reset Token: A 128-bit value that will be used to for a
stateless reset when the associated connection ID is used (see
Section 7.8).
8.12. STOP_SENDING Frame
An endpoint may use a STOP_SENDING frame (type=0x0c) to communicate
that incoming data is being discarded on receipt at application
request. This signals a peer to abruptly terminate transmission 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) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Error Code (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The fields are:
Stream ID: The 32-bit Stream ID of the stream being ignored.
Error Code: The application-specified reason the sender is ignoring
the stream.
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.
A client MUST NOT acknowledge Version Negotiation or Server Stateless
Retry packets. These packet types contain packet numbers selected by
the client, not the server.
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 44, line 51
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 47, 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 49, 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 is the offset of the next byte that would be
value of the Largest Client or Server Stream ID to be at least as sent.
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 packet 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
efficiency, endpoints SHOULD use Packetization Layer PMTU Discovery efficiency, endpoints SHOULD use Packetization Layer PMTU Discovery
([RFC4821]) and MAY use PMTU Discovery ([RFC1191], [RFC1981]) for ([RFC4821]) and MAY use PMTU Discovery ([RFC1191], [RFC1981]) for
detecting the PMTU, setting the PMTU appropriately, and storing the detecting the PMTU, setting the PMTU appropriately, and storing the
result of previous PMTU determinations. result of previous PMTU determinations.
In the absence of these mechanisms, QUIC endpoints SHOULD NOT send IP In the absence of these mechanisms, QUIC endpoints SHOULD NOT send IP
skipping to change at page 49, line 36 skipping to change at page 51, line 36
addresses (as each pairing could have a different maximum MTU in the addresses (as each pairing could have a different maximum MTU in the
path). path).
QUIC depends on the network path supporting a MTU of at least 1280 QUIC depends on the network path supporting a MTU of at least 1280
octets. This is the IPv6 minimum and therefore also supported by octets. This is the IPv6 minimum and therefore also supported by
most modern IPv4 networks. An endpoint MUST NOT reduce their MTU most modern IPv4 networks. An endpoint MUST NOT reduce their MTU
below this number, even if it receives signals that indicate a below this number, even if it receives signals that indicate a
smaller limit might exist. smaller limit might exist.
Clients MUST ensure that the first packet in a connection, and any Clients MUST ensure that the first packet in a connection, and any
retransmissions of those octets, has a QUIC packet size of least 1232 retransmissions of those octets, has a QUIC packet size of least 1200
octets for an IPv6 packet and 1252 octets for an IPv4 packet. In the octets. The packet size for a QUIC packet includes the QUIC header
absence of extensions to the IP header, padding to exactly these and integrity check, but not the UDP or IP header.
values will result in an IP packet that is 1280 octets.
The initial client packet SHOULD be padded to exactly these values The initial client packet SHOULD be padded to exactly 1200 octets
unless the client has a reasonable assurance that the PMTU is larger. unless the client has a reasonable assurance that the PMTU is larger.
Sending a packet of this size ensures that the network path supports Sending a packet of this size ensures that the network path supports
an MTU of this size and helps reduce the amplitude of amplification an MTU of this size and helps reduce the amplitude of amplification
attacks caused by server responses toward an unverified client attacks caused by server responses toward an unverified client
address. address.
Servers MUST ignore an initial plaintext packet from a client if its Servers MUST ignore an initial plaintext packet from a client if its
total size is less than 1232 octets for IPv6 or 1252 octets for IPv4. total size is less than 1200 octets.
If a QUIC endpoint determines that the PMTU between any pair of local If a QUIC endpoint determines that the PMTU between any pair of local
and remote IP addresses has fallen below 1280 octets, it MUST and remote IP addresses has fallen below 1280 octets, it MUST
immediately cease sending QUIC packets on the affected path. This immediately cease sending QUIC packets on the affected path. This
could result in termination of the connection if an alternative path could result in termination of the connection if an alternative path
cannot be found. cannot be found.
A sender bundles one or more frames in a Regular QUIC packet (see A sender bundles one or more frames in a Regular QUIC packet (see
Section 6). Section 6).
skipping to change at page 50, line 37 skipping to change at page 52, line 36
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 STOP_SENDING frames MUST be retransmitted, unless the stream has
become closed in the appropriate direction. See Section 10.3.
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 54, line 45
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 56, line 36
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.6).
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 55, line 6 skipping to change at page 57, line 11
become open and the same applies to even numbered streams. Endpoints become open and the same applies to even numbered streams. Endpoints
open streams in increasing numeric order, but loss or reordering can open streams in increasing numeric order, but loss or reordering can
cause packets that open streams to arrive out of order. cause packets that open streams to arrive out of order.
From the "open" state, either endpoint can send a frame with the FIN From the "open" state, either endpoint can send a frame with the FIN
flag set, which causes the stream to transition into one of the flag set, which causes the stream to transition into one of the
"half-closed" states. This flag can be set on the frame that opens "half-closed" states. This flag can be set on the frame that opens
the stream, which causes the stream to immediately become "half- the stream, which causes the stream to immediately become "half-
closed". Once an endpoint has completed sending all stream data and closed". Once an endpoint has completed sending all stream data and
a STREAM frame with a FIN flag, the stream state becomes "half-closed a STREAM frame with a FIN flag, the stream state becomes "half-closed
(local)". When an endpoint receives all stream data a FIN flag the (local)". When an endpoint receives all stream data and a FIN flag
stream state becomes "half-closed (remote)". An endpoint MUST NOT the stream state becomes "half-closed (remote)". An endpoint MUST
consider the stream state to have changed until all data has been NOT consider the stream state to have changed until all data has been
sent, received or discarded. sent or received.
A RST_STREAM frame on an "open" stream causes the stream to become A RST_STREAM frame on an "open" stream also causes the stream to
"half-closed". A stream that becomes "open" as a result of sending become "half-closed". A stream that becomes "open" as a result of
or receiving RST_STREAM immediately becomes "half-closed". Sending a sending or receiving RST_STREAM immediately becomes "half-closed".
RST_STREAM frame causes the stream to become "half-closed (local)"; Sending a RST_STREAM frame causes the stream to become "half-closed
receiving RST_STREAM causes the stream to become "half-closed (local)"; receiving RST_STREAM causes the stream to become "half-
(remote)". closed (remote)".
Any frame type that mentions a stream ID can be sent in this state. Any frame type that mentions a stream ID can be sent in this state.
10.2.3. half-closed (local) 10.2.3. half-closed (local)
A stream that is in the "half-closed (local)" state MUST NOT be used A stream that is in the "half-closed (local)" state MUST NOT be used
for sending on new STREAM frames. Retransmission of data that has for sending on new STREAM frames. Retransmission of data that has
already been sent on STREAM frames is permitted. An endpoint MAY already been sent on STREAM frames is permitted. An endpoint MAY
also send MAX_STREAM_DATA and RST_STREAM in this state. also send MAX_STREAM_DATA and STOP_SENDING in this state.
An endpoint that closes a stream MUST NOT send data beyond the final An endpoint that closes a stream MUST NOT send data beyond the final
offset that it has chosen, see Section 10.2.5 for details. offset that it has chosen, see Section 10.2.5 for details.
A stream transitions from this state to "closed" when a STREAM frame A stream transitions from this state to "closed" when a STREAM frame
that contains a FIN flag is received and all prior data has arrived, that contains a FIN flag is received and all prior data has arrived,
or when a RST_STREAM frame is received. or when a RST_STREAM frame is received.
An endpoint can receive any frame that mentions a stream ID in this An endpoint can receive any frame that mentions a stream ID in this
state. Providing flow-control credit using MAX_STREAM_DATA frames is state. Providing flow-control credit using MAX_STREAM_DATA frames is
skipping to change at page 56, line 5 skipping to change at page 58, line 9
A stream is "half-closed (remote)" when the stream is no longer being A stream is "half-closed (remote)" when the stream is no longer being
used by the peer to send any data. An endpoint will have either used by the peer to send any data. An endpoint will have either
received all data that a peer has sent or will have received a received all data that a peer has sent or will have received a
RST_STREAM frame and discarded any received data. RST_STREAM frame and discarded any received data.
Once all data has been either received or discarded, a sender is no Once all data has been either received or discarded, a sender is no
longer obligated to update the maximum received data for the longer obligated to update the maximum received data for the
connection. connection.
An endpoint that receives a RST_STREAM frame (and which has not sent
a FIN or a RST_STREAM) MUST immediately respond with a RST_STREAM
frame, and MUST NOT send any more data on the stream.
Due to reordering, an endpoint could continue receiving frames for Due to reordering, an endpoint could continue receiving frames for
the stream even after the stream is closed for sending. Frames the stream even after the stream is closed for sending. Frames
received after a peer closes a stream SHOULD be discarded. An received after a peer closes a stream SHOULD be discarded. An
endpoint MAY choose to limit the period over which it ignores frames endpoint MAY choose to limit the period over which it ignores frames
and treat frames that arrive after this time as being in error. and treat frames that arrive after this time as being in error.
An endpoint will know the final offset of the data it receives on a An endpoint will know the final offset of the data it receives on a
stream when it reaches the "half-closed (remote)" state, see stream when it reaches the "half-closed (remote)" state, see
Section 11.3 for details. Section 11.3 for details.
A stream in this state can be used by the endpoint to send any frame A stream in this state can be used by the endpoint to send any frame
that mentions a stream ID. In this state, the endpoint MUST observe that mentions a stream ID. In this state, the endpoint MUST observe
advertised stream and connection data limits (see Section 11). advertised stream and connection data limits (see Section 11).
A stream transitions from this state to "closed" by completing A stream transitions from this state to "closed" by completing
transmission of all data. This includes sending all data carried in transmission of all data. This includes sending all data carried in
STREAM frames up including the terminal STREAM frame that contains a STREAM frames including the terminal STREAM frame that contains a FIN
FIN flag. flag.
A stream becomes "closed" when the endpoint sends and receives A stream also becomes "closed" when the endpoint sends a RST_STREAM
acknowledgment of a RST_STREAM frame. frame.
10.2.5. closed 10.2.5. closed
The "closed" state is the terminal state for a stream. The "closed" state is the terminal state for a stream.
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. Solicited State Transitions
If an endpoint is no longer interested in the data being received, it
MAY send a STOP_SENDING frame on a stream in the "open" or "half-
closed (local)" state to prompt closure of the stream in the opposite
direction. This typically indicates that the receiving application
is no longer reading from the stream, but is not a guarantee that
incoming data will be ignored.
STREAM frames received after sending STOP_SENDING are still counted
toward the connection and stream flow-control windows, even though
these frames will be discarded upon receipt. This avoids potential
ambiguity about which STREAM frames count toward flow control.
Upon receipt of a STOP_SENDING frame on a stream in the "open" or
"half-closed (remote)" states, an endpoint MUST send a RST_STREAM
with an error code of QUIC_RECEIVED_RST. If the STOP_SENDING frame
is received on a stream that is already in the "half-closed (local)"
or "closed" states, a RST_STREAM frame MAY still be sent in order to
cancel retransmission of previously-sent STREAM frames.
While STOP_SENDING frames are retransmittable, an implementation MAY
choose not to retransmit a lost STOP_SENDING frame if the stream has
already been closed in the appropriate direction since the frame was
first generated. See Section 9.
10.4. 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.6).
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.5. 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
receive data. Each endpoint may send a series of STREAM frames receive data. Each endpoint may send a series of STREAM frames
encapsulating data on a stream until the stream is terminated in that encapsulating data on a stream until the stream is terminated in that
direction. Streams are an ordered byte-stream abstraction, and they direction. Streams are an ordered byte-stream abstraction, and they
have no other structure within them. STREAM frame boundaries are not have no other structure within them. STREAM frame boundaries are not
expected to be preserved in retransmissions from the sender or during expected to be preserved in retransmissions from the sender or during
delivery to the application at the receiver. delivery to the application at the receiver.
When new data is to be sent on a stream, a sender MUST set the When new data is to be sent on a stream, a sender MUST set the
skipping to change at page 57, line 46 skipping to change at page 60, line 24
An endpoint MUST NOT send data on any stream without ensuring that it An endpoint MUST NOT send data on any stream without ensuring that it
is within the data limits set by its peer. The cryptographic is within the data limits set by its peer. The cryptographic
handshake stream, Stream 0, is exempt from the connection-level data handshake stream, Stream 0, is exempt from the connection-level data
limits established by MAX_DATA. Stream 0 is still subject to stream- limits established by MAX_DATA. Stream 0 is still subject to stream-
level data limits and MAX_STREAM_DATA. level data limits and MAX_STREAM_DATA.
Flow control is described in detail in Section 11, and congestion Flow control is described in detail in Section 11, and congestion
control is described in the companion document [QUIC-RECOVERY]. control is described in the companion document [QUIC-RECOVERY].
10.5. Stream Prioritization 10.6. Stream Prioritization
Stream multiplexing has a significant effect on application Stream multiplexing has a significant effect on application
performance if resources allocated to streams are correctly performance if resources allocated to streams are correctly
prioritized. Experience with other multiplexed protocols, such as prioritized. Experience with other multiplexed protocols, such as
HTTP/2 [RFC7540], shows that effective prioritization strategies have HTTP/2 [RFC7540], shows that effective prioritization strategies have
a significant positive impact on performance. a significant positive impact on performance.
QUIC does not provide frames for exchanging prioritization QUIC does not provide frames for exchanging prioritization
information. Instead it relies on receiving priority information information. Instead it relies on receiving priority information
from the application that uses QUIC. Protocols that use QUIC are from the application that uses QUIC. Protocols that use QUIC are
skipping to change at page 59, line 21 skipping to change at page 61, line 50
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 60, line 32 skipping to change at page 63, line 10
To avoid this de-synchronization, a RST_STREAM sender MUST include To avoid this de-synchronization, a RST_STREAM sender MUST include
the final byte offset sent on the stream in the RST_STREAM frame. On the final byte offset sent on the stream in the RST_STREAM frame. On
receiving a RST_STREAM frame, a receiver definitively knows how many receiving a RST_STREAM frame, a receiver definitively knows how many
bytes were sent on that stream before the RST_STREAM frame, and the bytes were sent on that stream before the RST_STREAM frame, and the
receiver MUST use the final offset to account for all bytes sent on receiver MUST use the final offset to account for all bytes sent on
the stream in its connection level flow controller. the stream in its connection level flow controller.
11.1.1. Response to a RST_STREAM 11.1.1. Response to a RST_STREAM
Since streams are bidirectional, a sender of a RST_STREAM needs to RST_STREAM terminates one direction of a stream abruptly. Whether
know how many bytes the peer has sent on the stream. If an endpoint any action or response can or should be taken on the data already
receives a RST_STREAM frame and has sent neither a FIN nor a received is an application-specific issue, but it will often be the
RST_STREAM, it MUST send a RST_STREAM in response, bearing the offset case that upon receipt of a RST_STREAM an endpoint will choose to
of the last byte sent on this stream as the final offset. stop sending data in its own direction. If the sender of a
RST_STREAM wishes to explicitly state that no future data will be
processed, that endpoint MAY send a STOP_SENDING frame at the same
time.
11.1.2. Data Limit Increments 11.1.2. Data Limit Increments
This document leaves when and how many bytes to advertise in a This document leaves when and how many bytes to advertise in a
MAX_DATA or MAX_STREAM_DATA to implementations, but offers a few MAX_DATA or MAX_STREAM_DATA to implementations, but offers a few
considerations. These frames contribute to connection overhead. considerations. These frames contribute to connection overhead.
Therefore frequently sending frames with small changes is Therefore frequently sending frames with small changes is
undesirable. At the same time, infrequent updates require larger undesirable. At the same time, infrequent updates require larger
increments to limits if blocking is to be avoided. Thus, larger increments to limits if blocking is to be avoided. Thus, larger
updates require a receiver to commit to larger resource commitments. updates require a receiver to commit to larger resource commitments.
skipping to change at page 62, line 15 skipping to change at page 64, line 47
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
is used. is used.
Public Reset is not suitable for any error that can be signaled with A stateless reset (Section 7.8) is not suitable for any error that
a CONNECTION_CLOSE or RST_STREAM frame. Public Reset MUST NOT be can be signaled with a CONNECTION_CLOSE or RST_STREAM frame. A
sent by an endpoint that has the state necessary to send a frame on stateless reset MUST NOT be used by an endpoint that has the state
the connection. necessary to send a frame on 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 use the stateless reset
process (Section 7.8).
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 66, line 50
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 INTERNAL_ERROR (0x80000001): The endpoint encountered an internal
connection has too many outstanding received packets. error and cannot continue with the connection.
QUIC_CONNECTION_CANCELLED (0x80000046): The QUIC connection has been CANCELLED (0x80000002): An endpoint sends this with RST_STREAM to
cancelled. 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_BAD_PACKET_LOSS_RATE (0x80000047): Disabled QUIC because of FLOW_CONTROL_ERROR (0x80000003): An endpoint received more data than
high packet loss rate. it permitted in its advertised data limits (see Section 11).
QUIC_PUBLIC_RESETS_POST_HANDSHAKE (0x80000049): Disabled QUIC STREAM_ID_ERROR (0x80000004): An endpoint received a frame for a
because of too many PUBLIC_RESETs post handshake. stream identifier that exceeded its advertised maximum stream ID.
QUIC_TIMEOUTS_WITH_OPEN_STREAMS (0x8000004a): Disabled QUIC because STREAM_STATE_ERROR (0x80000005): An endpoint received a frame for a
of too many timeouts with streams open. stream that was not in a state that permitted that frame (see
Section 10.2).
QUIC_TOO_MANY_RTOS (0x80000055): QUIC timed out after too many RTOs. FINAL_OFFSET_ERROR (0x80000006): An endpoint received a STREAM frame
containing data that exceeded the previously established final
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_ENCRYPTION_LEVEL_INCORRECT (0x8000002c): A packet was received FRAME_FORMAT_ERROR (0x80000007): An endpoint received a frame that
with the wrong encryption level (i.e. it should have been was badly formatted. For instance, an empty STREAM frame that
encrypted but was not.) 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_VERSION_NEGOTIATION_MISMATCH (0x80000037): This connection TRANSPORT_PARAMETER_ERROR (0x80000008): An endpoint received
involved a version negotiation which appears to have been tampered transport parameters that were badly formatted, included an
with. invalid value, was absent even though it is mandatory, was present
though it is forbidden, or is otherwise in error.
QUIC_IP_ADDRESS_CHANGED (0x80000050): IP address changed causing VERSION_NEGOTIATION_ERROR (0x80000009): An endpoint received
connection close. 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_ADDRESS_VALIDATION_FAILURE (0x80000051): Client address PROTOCOL_VIOLATION (0x8000000A): An endpoint detected an error with
validation failed. protocol compliance that was not covered by more specific error
codes.
QUIC_TOO_MANY_FRAME_GAPS (0x8000005d): Stream frames arrived too QUIC_RECEIVED_RST (0x80000035): Terminating stream because peer sent
discontiguously so that stream sequencer buffer maintains too many a RST_STREAM or STOP_SENDING.
gaps.
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 69, line 14 skipping to change at page 70, line 6
Normally, clients will open streams sequentially, as explained in Normally, clients will open streams sequentially, as explained in
Section 10.1. However, when several streams are initiated at short Section 10.1. However, when several streams are initiated at short
intervals, transmission error may cause STREAM DATA frames opening intervals, transmission error may cause STREAM DATA frames opening
streams to be received out of sequence. A receiver is obligated to streams to be received out of sequence. A receiver is obligated to
open intervening streams if a higher-numbered stream ID is received. open intervening streams if a higher-numbered stream ID is received.
Thus, on a new connection, opening stream 2000001 opens 1 million Thus, on a new connection, opening stream 2000001 opens 1 million
streams, as required by the specification. streams, as required by the specification.
The number of active streams is limited by the concurrent stream The number of active streams is limited by the concurrent stream
limit transport parameter, as explained in Section 10.3. If chosen limit transport parameter, as explained in Section 10.4. If chosen
judisciously, this limit mitigates the effect of the stream judisciously, this limit mitigates the effect of the stream
commitment attack. However, setting the limit too low could affect commitment attack. However, setting the limit too low could affect
performance when applications expect to open large number of streams. performance when applications expect to open large number of streams.
14. IANA Considerations 14. IANA Considerations
14.1. QUIC Transport Parameter Registry 14.1. QUIC Transport Parameter Registry
IANA [SHALL add/has added] a registry for "QUIC Transport Parameters" IANA [SHALL add/has added] a registry for "QUIC Transport Parameters"
under a "QUIC Protocol" heading. under a "QUIC Protocol" heading.
skipping to change at page 70, line 16 skipping to change at page 71, 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 |
| | | |
| 0x0006 | stateless_reset_token | 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 (work in and Congestion Control", draft-ietf-quic-recovery (work in
progress), June 2017. progress), August 2017.
[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
(work in progress), June 2017. (work in progress), August 2017.
[RFC1191] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191, [RFC1191] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191,
DOI 10.17487/RFC1191, November 1990, DOI 10.17487/RFC1191, November 1990,
<http://www.rfc-editor.org/info/rfc1191>. <http://www.rfc-editor.org/info/rfc1191>.
[RFC1981] McCann, J., Deering, S., and J. Mogul, "Path MTU Discovery [RFC1981] McCann, J., Deering, S., and J. Mogul, "Path MTU Discovery
for IP version 6", RFC 1981, DOI 10.17487/RFC1981, August for IP version 6", RFC 1981, DOI 10.17487/RFC1981, August
1996, <http://www.rfc-editor.org/info/rfc1981>. 1996, <http://www.rfc-editor.org/info/rfc1981>.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<http://www.rfc-editor.org/info/rfc2119>. <http://www.rfc-editor.org/info/rfc2119>.
[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>.
[RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker,
"Randomness Requirements for Security", BCP 106, RFC 4086,
DOI 10.17487/RFC4086, June 2005,
<http://www.rfc-editor.org/info/rfc4086>.
[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>.
[RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-
Hashing for Message Authentication", RFC 2104,
DOI 10.17487/RFC2104, February 1997,
<http://www.rfc-editor.org/info/rfc2104>.
[RFC2360] Scott, G., "Guide for Internet Standards Writers", BCP 22, [RFC2360] Scott, G., "Guide for Internet Standards Writers", BCP 22,
RFC 2360, DOI 10.17487/RFC2360, June 1998, RFC 2360, DOI 10.17487/RFC2360, June 1998,
<http://www.rfc-editor.org/info/rfc2360>. <http://www.rfc-editor.org/info/rfc2360>.
[RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, [RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand
"Randomness Requirements for Security", BCP 106, RFC 4086, Key Derivation Function (HKDF)", RFC 5869,
DOI 10.17487/RFC4086, June 2005, DOI 10.17487/RFC5869, May 2010,
<http://www.rfc-editor.org/info/rfc4086>. <http://www.rfc-editor.org/info/rfc5869>.
[RFC6824] Ford, A., Raiciu, C., Handley, M., and O. Bonaventure, [RFC6824] Ford, A., Raiciu, C., Handley, M., and O. Bonaventure,
"TCP Extensions for Multipath Operation with Multiple "TCP Extensions for Multipath Operation with Multiple
Addresses", RFC 6824, DOI 10.17487/RFC6824, January 2013, Addresses", RFC 6824, DOI 10.17487/RFC6824, January 2013,
<http://www.rfc-editor.org/info/rfc6824>. <http://www.rfc-editor.org/info/rfc6824>.
[RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan, [RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan,
"Transport Layer Security (TLS) Application-Layer Protocol "Transport Layer Security (TLS) Application-Layer Protocol
Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301, Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301,
July 2014, <http://www.rfc-editor.org/info/rfc7301>. July 2014, <http://www.rfc-editor.org/info/rfc7301>.
skipping to change at page 73, line 5 skipping to change at page 74, line 12
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-04
o Introduce STOP_SENDING frame, RST_STREAM only resets in one
direction (#165)
o Removed GOAWAY; application protocols are responsible for graceful
shutdown (#696)
o Reduced the number of error codes (#96, #177, #184, #211)
o Version validation fields can't move or change (#121)
o Removed versions from the transport parameters in a
NewSessionTicket message (#547)
o Clarify the meaning of "bytes in flight" (#550)
o Public reset is now stateless reset and not visible to the path
(#215)
o Reordered bits and fields in STREAM frame (#620)
o Clarifications to the stream state machine (#572, #571)
o Increased the maximum length of the Largest Acknowledged field in
ACK frames to 64 bits (#629)
o truncate_connection_id is renamed to omit_connection_id (#659)
o CONNECTION_CLOSE terminates the connection like TCP RST (#330,
#328)
o Update labels used in HKDF-Expand-Label to match TLS 1.3 (#642)
C.2. Since draft-ietf-quic-transport-03
o Change STREAM and RST_STREAM layout
o Add MAX_STREAM_ID settings
C.3. 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 75, line 44
* 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.4. 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 78, line 5
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.5. 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.6. 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. 202 change blocks. 
865 lines changed or deleted 944 lines changed or added

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