draft-ietf-quic-transport-24.txt   draft-ietf-quic-transport-latest.txt 
QUIC Working Group J. Iyengar, Ed. QUIC Working Group J. Iyengar, Ed.
Internet-Draft Fastly Internet-Draft Fastly
Intended status: Standards Track M. Thomson, Ed. Intended status: Standards Track M. Thomson, Ed.
Expires: May 7, 2020 Mozilla Expires: July 20, 2020 Mozilla
November 4, 2019 January 17, 2020
QUIC: A UDP-Based Multiplexed and Secure Transport QUIC: A UDP-Based Multiplexed and Secure Transport
draft-ietf-quic-transport-24 draft-ietf-quic-transport-latest
Abstract Abstract
This document defines the core of the QUIC transport protocol. This document defines the core of the QUIC transport protocol.
Accompanying documents describe QUIC's loss detection and congestion Accompanying documents describe QUIC's loss detection and congestion
control and the use of TLS for key negotiation. control and the use of TLS for key negotiation.
Note to Readers Note to Readers
Discussion of this draft takes place on the QUIC working group Discussion of this draft takes place on the QUIC working group
skipping to change at page 1, line 43 skipping to change at page 1, line 43
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 https://datatracker.ietf.org/drafts/current/. Drafts is at https://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 May 7, 2020. This Internet-Draft will expire on July 20, 2020.
Copyright Notice Copyright Notice
Copyright (c) 2019 IETF Trust and the persons identified as the Copyright (c) 2020 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
(https://trustee.ietf.org/license-info) in effect on the date of (https://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
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 6 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1. Document Structure . . . . . . . . . . . . . . . . . . . 6 1.1. Document Structure . . . . . . . . . . . . . . . . . . . 6
1.2. Terms and Definitions . . . . . . . . . . . . . . . . . . 8 1.2. Terms and Definitions . . . . . . . . . . . . . . . . . . 8
1.3. Notational Conventions . . . . . . . . . . . . . . . . . 8 1.3. Notational Conventions . . . . . . . . . . . . . . . . . 9
2. Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2. Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1. Stream Types and Identifiers . . . . . . . . . . . . . . 9 2.1. Stream Types and Identifiers . . . . . . . . . . . . . . 9
2.2. Sending and Receiving Data . . . . . . . . . . . . . . . 10 2.2. Sending and Receiving Data . . . . . . . . . . . . . . . 10
2.3. Stream Prioritization . . . . . . . . . . . . . . . . . . 11 2.3. Stream Prioritization . . . . . . . . . . . . . . . . . . 11
2.4. Required Operations on Streams . . . . . . . . . . . . . 11 2.4. Required Operations on Streams . . . . . . . . . . . . . 11
3. Stream States . . . . . . . . . . . . . . . . . . . . . . . . 12 3. Stream States . . . . . . . . . . . . . . . . . . . . . . . . 12
3.1. Sending Stream States . . . . . . . . . . . . . . . . . . 12 3.1. Sending Stream States . . . . . . . . . . . . . . . . . . 13
3.2. Receiving Stream States . . . . . . . . . . . . . . . . . 14 3.2. Receiving Stream States . . . . . . . . . . . . . . . . . 15
3.3. Permitted Frame Types . . . . . . . . . . . . . . . . . . 17 3.3. Permitted Frame Types . . . . . . . . . . . . . . . . . . 17
3.4. Bidirectional Stream States . . . . . . . . . . . . . . . 17 3.4. Bidirectional Stream States . . . . . . . . . . . . . . . 18
3.5. Solicited State Transitions . . . . . . . . . . . . . . . 19 3.5. Solicited State Transitions . . . . . . . . . . . . . . . 19
4. Flow Control . . . . . . . . . . . . . . . . . . . . . . . . 20 4. Flow Control . . . . . . . . . . . . . . . . . . . . . . . . 20
4.1. Data Flow Control . . . . . . . . . . . . . . . . . . . . 20 4.1. Data Flow Control . . . . . . . . . . . . . . . . . . . . 21
4.2. Flow Credit Increments . . . . . . . . . . . . . . . . . 21 4.2. Flow Credit Increments . . . . . . . . . . . . . . . . . 22
4.3. Handling Stream Cancellation . . . . . . . . . . . . . . 22 4.3. Handling Stream Cancellation . . . . . . . . . . . . . . 23
4.4. Stream Final Size . . . . . . . . . . . . . . . . . . . . 23 4.4. Stream Final Size . . . . . . . . . . . . . . . . . . . . 23
4.5. Controlling Concurrency . . . . . . . . . . . . . . . . . 23 4.5. Controlling Concurrency . . . . . . . . . . . . . . . . . 24
5. Connections . . . . . . . . . . . . . . . . . . . . . . . . . 24 5. Connections . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.1. Connection ID . . . . . . . . . . . . . . . . . . . . . . 24 5.1. Connection ID . . . . . . . . . . . . . . . . . . . . . . 25
5.1.1. Issuing Connection IDs . . . . . . . . . . . . . . . 25 5.1.1. Issuing Connection IDs . . . . . . . . . . . . . . . 26
5.1.2. Consuming and Retiring Connection IDs . . . . . . . . 26 5.1.2. Consuming and Retiring Connection IDs . . . . . . . . 27
5.2. Matching Packets to Connections . . . . . . . . . . . . . 27 5.2. Matching Packets to Connections . . . . . . . . . . . . . 28
5.2.1. Client Packet Handling . . . . . . . . . . . . . . . 28 5.2.1. Client Packet Handling . . . . . . . . . . . . . . . 29
5.2.2. Server Packet Handling . . . . . . . . . . . . . . . 28 5.2.2. Server Packet Handling . . . . . . . . . . . . . . . 29
5.3. Life of a QUIC Connection . . . . . . . . . . . . . . . . 29 5.3. Life of a QUIC Connection . . . . . . . . . . . . . . . . 30
5.4. Required Operations on Connections . . . . . . . . . . . 29 5.4. Required Operations on Connections . . . . . . . . . . . 31
6. Version Negotiation . . . . . . . . . . . . . . . . . . . . . 30 6. Version Negotiation . . . . . . . . . . . . . . . . . . . . . 32
6.1. Sending Version Negotiation Packets . . . . . . . . . . . 30 6.1. Sending Version Negotiation Packets . . . . . . . . . . . 32
6.2. Handling Version Negotiation Packets . . . . . . . . . . 31 6.2. Handling Version Negotiation Packets . . . . . . . . . . 32
6.2.1. Version Negotiation Between Draft Versions . . . . . 31 6.2.1. Version Negotiation Between Draft Versions . . . . . 33
6.3. Using Reserved Versions . . . . . . . . . . . . . . . . . 31 6.3. Using Reserved Versions . . . . . . . . . . . . . . . . . 33
7. Cryptographic and Transport Handshake . . . . . . . . . . . . 32 7. Cryptographic and Transport Handshake . . . . . . . . . . . . 34
7.1. Example Handshake Flows . . . . . . . . . . . . . . . . . 33 7.1. Example Handshake Flows . . . . . . . . . . . . . . . . . 35
7.2. Negotiating Connection IDs . . . . . . . . . . . . . . . 34 7.2. Negotiating Connection IDs . . . . . . . . . . . . . . . 36
7.3. Transport Parameters . . . . . . . . . . . . . . . . . . 36 7.3. Transport Parameters . . . . . . . . . . . . . . . . . . 37
7.3.1. Values of Transport Parameters for 0-RTT . . . . . . 36 7.3.1. Values of Transport Parameters for 0-RTT . . . . . . 38
7.3.2. New Transport Parameters . . . . . . . . . . . . . . 38 7.3.2. New Transport Parameters . . . . . . . . . . . . . . 39
7.4. Cryptographic Message Buffering . . . . . . . . . . . . . 38 7.4. Cryptographic Message Buffering . . . . . . . . . . . . . 40
8. Address Validation . . . . . . . . . . . . . . . . . . . . . 38 8. Address Validation . . . . . . . . . . . . . . . . . . . . . 40
8.1. Address Validation During Connection Establishment . . . 39 8.1. Address Validation During Connection Establishment . . . 40
8.1.1. Address Validation using Retry Packets . . . . . . . 40 8.1.1. Token Construction . . . . . . . . . . . . . . . . . 41
8.1.2. Address Validation for Future Connections . . . . . . 41 8.1.2. Address Validation using Retry Packets . . . . . . . 42
8.1.3. Address Validation Token Integrity . . . . . . . . . 43 8.1.3. Address Validation for Future Connections . . . . . . 43
8.2. Path Validation . . . . . . . . . . . . . . . . . . . . . 43 8.1.4. Address Validation Token Integrity . . . . . . . . . 45
8.3. Initiating Path Validation . . . . . . . . . . . . . . . 44 8.2. Path Validation . . . . . . . . . . . . . . . . . . . . . 46
8.4. Path Validation Responses . . . . . . . . . . . . . . . . 44 8.3. Initiating Path Validation . . . . . . . . . . . . . . . 46
8.5. Successful Path Validation . . . . . . . . . . . . . . . 44 8.4. Path Validation Responses . . . . . . . . . . . . . . . . 47
8.6. Failed Path Validation . . . . . . . . . . . . . . . . . 45 8.5. Successful Path Validation . . . . . . . . . . . . . . . 47
9. Connection Migration . . . . . . . . . . . . . . . . . . . . 45 8.6. Failed Path Validation . . . . . . . . . . . . . . . . . 47
9.1. Probing a New Path . . . . . . . . . . . . . . . . . . . 46 9. Connection Migration . . . . . . . . . . . . . . . . . . . . 48
9.2. Initiating Connection Migration . . . . . . . . . . . . . 47 9.1. Probing a New Path . . . . . . . . . . . . . . . . . . . 49
9.3. Responding to Connection Migration . . . . . . . . . . . 47 9.2. Initiating Connection Migration . . . . . . . . . . . . . 49
9.3.1. Peer Address Spoofing . . . . . . . . . . . . . . . . 48 9.3. Responding to Connection Migration . . . . . . . . . . . 50
9.3.2. On-Path Address Spoofing . . . . . . . . . . . . . . 48 9.3.1. Peer Address Spoofing . . . . . . . . . . . . . . . . 51
9.3.3. Off-Path Packet Forwarding . . . . . . . . . . . . . 49 9.3.2. On-Path Address Spoofing . . . . . . . . . . . . . . 51
9.4. Loss Detection and Congestion Control . . . . . . . . . . 50 9.3.3. Off-Path Packet Forwarding . . . . . . . . . . . . . 52
9.5. Privacy Implications of Connection Migration . . . . . . 51 9.4. Loss Detection and Congestion Control . . . . . . . . . . 53
9.6. Server's Preferred Address . . . . . . . . . . . . . . . 52 9.5. Privacy Implications of Connection Migration . . . . . . 54
9.6.1. Communicating a Preferred Address . . . . . . . . . . 52 9.6. Server's Preferred Address . . . . . . . . . . . . . . . 55
9.6.2. Responding to Connection Migration . . . . . . . . . 53 9.6.1. Communicating a Preferred Address . . . . . . . . . . 55
9.6.3. Interaction of Client Migration and Preferred Address 53 9.6.2. Responding to Connection Migration . . . . . . . . . 55
9.7. Use of IPv6 Flow-Label and Migration . . . . . . . . . . 54 9.6.3. Interaction of Client Migration and Preferred Address 56
10. Connection Termination . . . . . . . . . . . . . . . . . . . 54 9.7. Use of IPv6 Flow-Label and Migration . . . . . . . . . . 56
10.1. Closing and Draining Connection States . . . . . . . . . 54 10. Connection Termination . . . . . . . . . . . . . . . . . . . 57
10.2. Idle Timeout . . . . . . . . . . . . . . . . . . . . . . 56 10.1. Closing and Draining Connection States . . . . . . . . . 57
10.3. Immediate Close . . . . . . . . . . . . . . . . . . . . 56 10.2. Idle Timeout . . . . . . . . . . . . . . . . . . . . . . 58
10.4. Stateless Reset . . . . . . . . . . . . . . . . . . . . 58 10.3. Immediate Close . . . . . . . . . . . . . . . . . . . . 59
10.4.1. Detecting a Stateless Reset . . . . . . . . . . . . 60 10.4. Stateless Reset . . . . . . . . . . . . . . . . . . . . 61
10.4.2. Calculating a Stateless Reset Token . . . . . . . . 61 10.4.1. Detecting a Stateless Reset . . . . . . . . . . . . 63
10.4.3. Looping . . . . . . . . . . . . . . . . . . . . . . 62 10.4.2. Calculating a Stateless Reset Token . . . . . . . . 64
11. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 63 10.4.3. Looping . . . . . . . . . . . . . . . . . . . . . . 65
11.1. Connection Errors . . . . . . . . . . . . . . . . . . . 63 11. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 66
11.2. Stream Errors . . . . . . . . . . . . . . . . . . . . . 64 11.1. Connection Errors . . . . . . . . . . . . . . . . . . . 66
12. Packets and Frames . . . . . . . . . . . . . . . . . . . . . 64 11.2. Stream Errors . . . . . . . . . . . . . . . . . . . . . 67
12.1. Protected Packets . . . . . . . . . . . . . . . . . . . 65 12. Packets and Frames . . . . . . . . . . . . . . . . . . . . . 67
12.2. Coalescing Packets . . . . . . . . . . . . . . . . . . . 65 12.1. Protected Packets . . . . . . . . . . . . . . . . . . . 68
12.3. Packet Numbers . . . . . . . . . . . . . . . . . . . . . 66 12.2. Coalescing Packets . . . . . . . . . . . . . . . . . . . 68
12.4. Frames and Frame Types . . . . . . . . . . . . . . . . . 68 12.3. Packet Numbers . . . . . . . . . . . . . . . . . . . . . 69
13. Packetization and Reliability . . . . . . . . . . . . . . . . 70 12.4. Frames and Frame Types . . . . . . . . . . . . . . . . . 71
13.1. Packet Processing . . . . . . . . . . . . . . . . . . . 71 13. Packetization and Reliability . . . . . . . . . . . . . . . . 73
13.2. Generating Acknowledgements . . . . . . . . . . . . . . 71 13.1. Packet Processing . . . . . . . . . . . . . . . . . . . 74
13.2.1. Sending ACK Frames . . . . . . . . . . . . . . . . . 71 13.2. Generating Acknowledgements . . . . . . . . . . . . . . 74
13.2.2. Managing ACK Ranges . . . . . . . . . . . . . . . . 73 13.2.1. Sending ACK Frames . . . . . . . . . . . . . . . . . 75
13.2.3. Receiver Tracking of ACK Frames . . . . . . . . . . 73 13.2.2. Managing ACK Ranges . . . . . . . . . . . . . . . . 76
13.2.4. Limiting ACK Ranges . . . . . . . . . . . . . . . . 73 13.2.3. Receiver Tracking of ACK Frames . . . . . . . . . . 77
13.2.5. Measuring and Reporting Host Delay . . . . . . . . . 74 13.2.4. Limiting ACK Ranges . . . . . . . . . . . . . . . . 77
13.2.6. ACK Frames and Packet Protection . . . . . . . . . . 74 13.2.5. Measuring and Reporting Host Delay . . . . . . . . . 77
13.3. Retransmission of Information . . . . . . . . . . . . . 74 13.2.6. ACK Frames and Packet Protection . . . . . . . . . . 78
13.4. Explicit Congestion Notification . . . . . . . . . . . . 77 13.3. Retransmission of Information . . . . . . . . . . . . . 78
13.4.1. ECN Counts . . . . . . . . . . . . . . . . . . . . . 77 13.4. Explicit Congestion Notification . . . . . . . . . . . . 80
13.4.2. ECN Validation . . . . . . . . . . . . . . . . . . . 78 13.4.1. ECN Counts . . . . . . . . . . . . . . . . . . . . . 81
14. Packet Size . . . . . . . . . . . . . . . . . . . . . . . . . 80 13.4.2. ECN Validation . . . . . . . . . . . . . . . . . . . 81
14.1. Path Maximum Transmission Unit (PMTU) . . . . . . . . . 80 14. Packet Size . . . . . . . . . . . . . . . . . . . . . . . . . 83
14.2. ICMP Packet Too Big Messages . . . . . . . . . . . . . . 81 14.1. Path Maximum Transmission Unit (PMTU) . . . . . . . . . 84
14.3. Datagram Packetization Layer PMTU Discovery . . . . . . 82 14.2. ICMP Packet Too Big Messages . . . . . . . . . . . . . . 85
14.3.1. PMTU Probes Containing Source Connection ID . . . . 83 14.3. Datagram Packetization Layer PMTU Discovery . . . . . . 86
15. Versions . . . . . . . . . . . . . . . . . . . . . . . . . . 83 14.3.1. PMTU Probes Containing Source Connection ID . . . . 86
16. Variable-Length Integer Encoding . . . . . . . . . . . . . . 84 15. Versions . . . . . . . . . . . . . . . . . . . . . . . . . . 87
17. Packet Formats . . . . . . . . . . . . . . . . . . . . . . . 85 16. Variable-Length Integer Encoding . . . . . . . . . . . . . . 88
17.1. Packet Number Encoding and Decoding . . . . . . . . . . 85 17. Packet Formats . . . . . . . . . . . . . . . . . . . . . . . 88
17.2. Long Header Packets . . . . . . . . . . . . . . . . . . 86 17.1. Packet Number Encoding and Decoding . . . . . . . . . . 89
17.2.1. Version Negotiation Packet . . . . . . . . . . . . . 89 17.2. Long Header Packets . . . . . . . . . . . . . . . . . . 90
17.2.2. Initial Packet . . . . . . . . . . . . . . . . . . . 90 17.2.1. Version Negotiation Packet . . . . . . . . . . . . . 92
17.2.3. 0-RTT . . . . . . . . . . . . . . . . . . . . . . . 92 17.2.2. Initial Packet . . . . . . . . . . . . . . . . . . . 94
17.2.4. Handshake Packet . . . . . . . . . . . . . . . . . . 94 17.2.3. 0-RTT . . . . . . . . . . . . . . . . . . . . . . . 96
17.2.5. Retry Packet . . . . . . . . . . . . . . . . . . . . 95 17.2.4. Handshake Packet . . . . . . . . . . . . . . . . . . 98
17.3. Short Header Packets . . . . . . . . . . . . . . . . . . 98 17.2.5. Retry Packet . . . . . . . . . . . . . . . . . . . . 99
17.3.1. Latency Spin Bit . . . . . . . . . . . . . . . . . . 99 17.3. Short Header Packets . . . . . . . . . . . . . . . . . . 101
18. Transport Parameter Encoding . . . . . . . . . . . . . . . . 100 17.3.1. Latency Spin Bit . . . . . . . . . . . . . . . . . . 103
18.1. Reserved Transport Parameters . . . . . . . . . . . . . 101 18. Transport Parameter Encoding . . . . . . . . . . . . . . . . 104
18.2. Transport Parameter Definitions . . . . . . . . . . . . 101 18.1. Reserved Transport Parameters . . . . . . . . . . . . . 105
19. Frame Types and Formats . . . . . . . . . . . . . . . . . . . 106 18.2. Transport Parameter Definitions . . . . . . . . . . . . 105
19.1. PADDING Frame . . . . . . . . . . . . . . . . . . . . . 106 19. Frame Types and Formats . . . . . . . . . . . . . . . . . . . 110
19.2. PING Frame . . . . . . . . . . . . . . . . . . . . . . . 106 19.1. PADDING Frame . . . . . . . . . . . . . . . . . . . . . 110
19.3. ACK Frames . . . . . . . . . . . . . . . . . . . . . . . 107 19.2. PING Frame . . . . . . . . . . . . . . . . . . . . . . . 110
19.3.1. ACK Ranges . . . . . . . . . . . . . . . . . . . . . 108 19.3. ACK Frames . . . . . . . . . . . . . . . . . . . . . . . 111
19.3.2. ECN Counts . . . . . . . . . . . . . . . . . . . . . 110 19.3.1. ACK Ranges . . . . . . . . . . . . . . . . . . . . . 112
19.4. RESET_STREAM Frame . . . . . . . . . . . . . . . . . . . 111 19.3.2. ECN Counts . . . . . . . . . . . . . . . . . . . . . 114
19.5. STOP_SENDING Frame . . . . . . . . . . . . . . . . . . . 111 19.4. RESET_STREAM Frame . . . . . . . . . . . . . . . . . . . 115
19.6. CRYPTO Frame . . . . . . . . . . . . . . . . . . . . . . 112 19.5. STOP_SENDING Frame . . . . . . . . . . . . . . . . . . . 116
19.7. NEW_TOKEN Frame . . . . . . . . . . . . . . . . . . . . 113 19.6. CRYPTO Frame . . . . . . . . . . . . . . . . . . . . . . 116
19.8. STREAM Frames . . . . . . . . . . . . . . . . . . . . . 114 19.7. NEW_TOKEN Frame . . . . . . . . . . . . . . . . . . . . 117
19.9. MAX_DATA Frame . . . . . . . . . . . . . . . . . . . . . 115 19.8. STREAM Frames . . . . . . . . . . . . . . . . . . . . . 118
19.10. MAX_STREAM_DATA Frame . . . . . . . . . . . . . . . . . 116 19.9. MAX_DATA Frame . . . . . . . . . . . . . . . . . . . . . 120
19.11. MAX_STREAMS Frames . . . . . . . . . . . . . . . . . . . 117 19.10. MAX_STREAM_DATA Frame . . . . . . . . . . . . . . . . . 120
19.12. DATA_BLOCKED Frame . . . . . . . . . . . . . . . . . . . 118 19.11. MAX_STREAMS Frames . . . . . . . . . . . . . . . . . . . 121
19.13. STREAM_DATA_BLOCKED Frame . . . . . . . . . . . . . . . 118 19.12. DATA_BLOCKED Frame . . . . . . . . . . . . . . . . . . . 122
19.14. STREAMS_BLOCKED Frames . . . . . . . . . . . . . . . . . 119 19.13. STREAM_DATA_BLOCKED Frame . . . . . . . . . . . . . . . 123
19.15. NEW_CONNECTION_ID Frame . . . . . . . . . . . . . . . . 120 19.14. STREAMS_BLOCKED Frames . . . . . . . . . . . . . . . . . 123
19.16. RETIRE_CONNECTION_ID Frame . . . . . . . . . . . . . . . 121 19.15. NEW_CONNECTION_ID Frame . . . . . . . . . . . . . . . . 124
19.17. PATH_CHALLENGE Frame . . . . . . . . . . . . . . . . . . 122 19.16. RETIRE_CONNECTION_ID Frame . . . . . . . . . . . . . . . 126
19.18. PATH_RESPONSE Frame . . . . . . . . . . . . . . . . . . 123 19.17. PATH_CHALLENGE Frame . . . . . . . . . . . . . . . . . . 127
19.19. CONNECTION_CLOSE Frames . . . . . . . . . . . . . . . . 123 19.18. PATH_RESPONSE Frame . . . . . . . . . . . . . . . . . . 128
19.20. Extension Frames . . . . . . . . . . . . . . . . . . . . 124 19.19. CONNECTION_CLOSE Frames . . . . . . . . . . . . . . . . 128
20. Transport Error Codes . . . . . . . . . . . . . . . . . . . . 124 19.20. HANDSHAKE_DONE frame . . . . . . . . . . . . . . . . . . 129
20.1. Application Protocol Error Codes . . . . . . . . . . . . 126 19.21. Extension Frames . . . . . . . . . . . . . . . . . . . . 129
21. Security Considerations . . . . . . . . . . . . . . . . . . . 126 20. Transport Error Codes . . . . . . . . . . . . . . . . . . . . 130
21.1. Handshake Denial of Service . . . . . . . . . . . . . . 126 20.1. Application Protocol Error Codes . . . . . . . . . . . . 132
21.2. Amplification Attack . . . . . . . . . . . . . . . . . . 127 21. Security Considerations . . . . . . . . . . . . . . . . . . . 132
21.3. Optimistic ACK Attack . . . . . . . . . . . . . . . . . 127 21.1. Handshake Denial of Service . . . . . . . . . . . . . . 132
21.4. Slowloris Attacks . . . . . . . . . . . . . . . . . . . 128 21.2. Amplification Attack . . . . . . . . . . . . . . . . . . 133
21.5. Stream Fragmentation and Reassembly Attacks . . . . . . 128 21.3. Optimistic ACK Attack . . . . . . . . . . . . . . . . . 133
21.6. Stream Commitment Attack . . . . . . . . . . . . . . . . 129 21.4. Slowloris Attacks . . . . . . . . . . . . . . . . . . . 133
21.7. Peer Denial of Service . . . . . . . . . . . . . . . . . 129 21.5. Stream Fragmentation and Reassembly Attacks . . . . . . 134
21.8. Explicit Congestion Notification Attacks . . . . . . . . 130 21.6. Stream Commitment Attack . . . . . . . . . . . . . . . . 134
21.9. Stateless Reset Oracle . . . . . . . . . . . . . . . . . 130 21.7. Peer Denial of Service . . . . . . . . . . . . . . . . . 135
21.10. Version Downgrade . . . . . . . . . . . . . . . . . . . 130 21.8. Explicit Congestion Notification Attacks . . . . . . . . 135
21.11. Targeted Attacks by Routing . . . . . . . . . . . . . . 131 21.9. Stateless Reset Oracle . . . . . . . . . . . . . . . . . 135
22. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 131 21.10. Version Downgrade . . . . . . . . . . . . . . . . . . . 136
22.1. QUIC Transport Parameter Registry . . . . . . . . . . . 131 21.11. Targeted Attacks by Routing . . . . . . . . . . . . . . 136
22.2. QUIC Frame Type Registry . . . . . . . . . . . . . . . . 132 22. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 136
22.3. QUIC Transport Error Codes Registry . . . . . . . . . . 133 22.1. Registration Policies for QUIC Registries . . . . . . . 137
23. References . . . . . . . . . . . . . . . . . . . . . . . . . 135 22.1.1. Provisional Registrations . . . . . . . . . . . . . 137
23.1. Normative References . . . . . . . . . . . . . . . . . . 136 22.1.2. Selecting Codepoints . . . . . . . . . . . . . . . . 138
23.2. Informative References . . . . . . . . . . . . . . . . . 137 22.1.3. Reclaiming Provisional Codepoints . . . . . . . . . 138
Appendix A. Sample Packet Number Decoding Algorithm . . . . . . 139 22.1.4. Permanent Registrations . . . . . . . . . . . . . . 139
Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 140 22.2. QUIC Transport Parameter Registry . . . . . . . . . . . 139
B.1. Since draft-ietf-quic-transport-23 . . . . . . . . . . . 140 22.3. QUIC Frame Type Registry . . . . . . . . . . . . . . . . 140
B.2. Since draft-ietf-quic-transport-22 . . . . . . . . . . . 140 22.4. QUIC Transport Error Codes Registry . . . . . . . . . . 141
B.3. Since draft-ietf-quic-transport-21 . . . . . . . . . . . 141 23. References . . . . . . . . . . . . . . . . . . . . . . . . . 143
B.4. Since draft-ietf-quic-transport-20 . . . . . . . . . . . 142 23.1. Normative References . . . . . . . . . . . . . . . . . . 143
B.5. Since draft-ietf-quic-transport-19 . . . . . . . . . . . 143 23.2. Informative References . . . . . . . . . . . . . . . . . 144
B.6. Since draft-ietf-quic-transport-18 . . . . . . . . . . . 143 Appendix A. Sample Packet Number Decoding Algorithm . . . . . . 146
B.7. Since draft-ietf-quic-transport-17 . . . . . . . . . . . 144 Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 147
B.8. Since draft-ietf-quic-transport-16 . . . . . . . . . . . 144 B.1. Since draft-ietf-quic-transport-23 . . . . . . . . . . . 147
B.9. Since draft-ietf-quic-transport-15 . . . . . . . . . . . 146 B.2. Since draft-ietf-quic-transport-22 . . . . . . . . . . . 148
B.10. Since draft-ietf-quic-transport-14 . . . . . . . . . . . 146 B.3. Since draft-ietf-quic-transport-21 . . . . . . . . . . . 149
B.11. Since draft-ietf-quic-transport-13 . . . . . . . . . . . 146 B.4. Since draft-ietf-quic-transport-20 . . . . . . . . . . . 149
B.12. Since draft-ietf-quic-transport-12 . . . . . . . . . . . 147 B.5. Since draft-ietf-quic-transport-19 . . . . . . . . . . . 150
B.13. Since draft-ietf-quic-transport-11 . . . . . . . . . . . 148 B.6. Since draft-ietf-quic-transport-18 . . . . . . . . . . . 151
B.14. Since draft-ietf-quic-transport-10 . . . . . . . . . . . 148 B.7. Since draft-ietf-quic-transport-17 . . . . . . . . . . . 151
B.15. Since draft-ietf-quic-transport-09 . . . . . . . . . . . 149 B.8. Since draft-ietf-quic-transport-16 . . . . . . . . . . . 152
B.16. Since draft-ietf-quic-transport-08 . . . . . . . . . . . 149 B.9. Since draft-ietf-quic-transport-15 . . . . . . . . . . . 153
B.17. Since draft-ietf-quic-transport-07 . . . . . . . . . . . 150 B.10. Since draft-ietf-quic-transport-14 . . . . . . . . . . . 153
B.18. Since draft-ietf-quic-transport-06 . . . . . . . . . . . 151 B.11. Since draft-ietf-quic-transport-13 . . . . . . . . . . . 154
B.19. Since draft-ietf-quic-transport-05 . . . . . . . . . . . 151 B.12. Since draft-ietf-quic-transport-12 . . . . . . . . . . . 154
B.20. Since draft-ietf-quic-transport-04 . . . . . . . . . . . 151 B.13. Since draft-ietf-quic-transport-11 . . . . . . . . . . . 155
B.21. Since draft-ietf-quic-transport-03 . . . . . . . . . . . 152 B.14. Since draft-ietf-quic-transport-10 . . . . . . . . . . . 156
B.22. Since draft-ietf-quic-transport-02 . . . . . . . . . . . 152 B.15. Since draft-ietf-quic-transport-09 . . . . . . . . . . . 156
B.23. Since draft-ietf-quic-transport-01 . . . . . . . . . . . 153 B.16. Since draft-ietf-quic-transport-08 . . . . . . . . . . . 157
B.24. Since draft-ietf-quic-transport-00 . . . . . . . . . . . 155 B.17. Since draft-ietf-quic-transport-07 . . . . . . . . . . . 157
B.25. Since draft-hamilton-quic-transport-protocol-01 . . . . . 155 B.18. Since draft-ietf-quic-transport-06 . . . . . . . . . . . 158
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 156 B.19. Since draft-ietf-quic-transport-05 . . . . . . . . . . . 159
Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 156 B.20. Since draft-ietf-quic-transport-04 . . . . . . . . . . . 159
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 156 B.21. Since draft-ietf-quic-transport-03 . . . . . . . . . . . 160
B.22. Since draft-ietf-quic-transport-02 . . . . . . . . . . . 160
B.23. Since draft-ietf-quic-transport-01 . . . . . . . . . . . 161
B.24. Since draft-ietf-quic-transport-00 . . . . . . . . . . . 163
B.25. Since draft-hamilton-quic-transport-protocol-01 . . . . . 163
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 163
Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 164
1. Introduction 1. Introduction
QUIC is a multiplexed and secure general-purpose transport protocol QUIC is a multiplexed and secure general-purpose transport protocol
that provides: that provides:
o Stream multiplexing o Stream multiplexing
o Stream and connection-level flow control o Stream and connection-level flow control
skipping to change at page 6, line 37 skipping to change at page 6, line 44
o Authenticated and encrypted header and payload o Authenticated and encrypted header and payload
QUIC uses UDP as a substrate to avoid requiring changes to legacy QUIC uses UDP as a substrate to avoid requiring changes to legacy
client operating systems and middleboxes. QUIC authenticates all of client operating systems and middleboxes. QUIC authenticates all of
its headers and encrypts most of the data it exchanges, including its its headers and encrypts most of the data it exchanges, including its
signaling, to avoid incurring a dependency on middleboxes. signaling, to avoid incurring a dependency on middleboxes.
1.1. Document Structure 1.1. Document Structure
This document describes the core QUIC protocol and is structured as This document describes the core QUIC protocol and is structured as
follows. follows:
o Streams are the basic service abstraction that QUIC provides. o Streams are the basic service abstraction that QUIC provides.
* Section 2 describes core concepts related to streams, * Section 2 describes core concepts related to streams,
* Section 3 provides a reference model for stream states, and * Section 3 provides a reference model for stream states, and
* Section 4 outlines the operation of flow control. * Section 4 outlines the operation of flow control.
o Connections are the context in which QUIC endpoints communicate. o Connections are the context in which QUIC endpoints communicate.
* Section 5 describes core concepts related to connections, * Section 5 describes core concepts related to connections,
* Section 6 describes version negotiation, * Section 6 describes version negotiation,
* Section 7 details the process for establishing connections, * Section 7 details the process for establishing connections,
* Section 8 specifies critical denial of service mitigation * Section 8 specifies critical denial of service mitigation
mechanisms, mechanisms,
* Section 9 describes how endpoints migrate a connection to a new * Section 9 describes how endpoints migrate a connection to a new
network path, network path,
* Section 10 lists the options for terminating an open * Section 10 lists the options for terminating an open
connection, and connection, and
skipping to change at page 8, line 34 skipping to change at page 8, line 37
send an acknowledgment (see Section 13.2.1). send an acknowledgment (see Section 13.2.1).
Endpoint: An entity that can participate in a QUIC connection by Endpoint: An entity that can participate in a QUIC connection by
generating, receiving, and processing QUIC packets. There are generating, receiving, and processing QUIC packets. There are
only two types of endpoint in QUIC: client and server. only two types of endpoint in QUIC: client and server.
Client: The endpoint initiating a QUIC connection. Client: The endpoint initiating a QUIC connection.
Server: The endpoint accepting incoming QUIC connections. Server: The endpoint accepting incoming QUIC connections.
Address: When used without qualification, the tuple of IP version,
IP address, UDP protocol, and UDP port number that represents one
end of a network path.
Connection ID: An opaque identifier that is used to identify a QUIC Connection ID: An opaque identifier that is used to identify a QUIC
connection at an endpoint. Each endpoint sets a value for its connection at an endpoint. Each endpoint sets a value for its
peer to include in packets sent towards the endpoint. peer to include in packets sent towards the endpoint.
Stream: A unidirectional or bidirectional channel of ordered bytes Stream: A unidirectional or bidirectional channel of ordered bytes
within a QUIC connection. A QUIC connection can carry multiple within a QUIC connection. A QUIC connection can carry multiple
simultaneous streams. simultaneous streams.
Application: An entity that uses QUIC to send and receive data. Application: An entity that uses QUIC to send and receive data.
skipping to change at page 25, line 37 skipping to change at page 26, line 27
response to an Initial packet. response to an Initial packet.
A zero-length connection ID can be used when a connection ID is not A zero-length connection ID can be used when a connection ID is not
needed to route to the correct endpoint. However, multiplexing needed to route to the correct endpoint. However, multiplexing
connections on the same local IP address and port while using zero- connections on the same local IP address and port while using zero-
length connection IDs will cause failures in the presence of peer length connection IDs will cause failures in the presence of peer
connection migration, NAT rebinding, and client port reuse; and connection migration, NAT rebinding, and client port reuse; and
therefore MUST NOT be done unless an endpoint is certain that those therefore MUST NOT be done unless an endpoint is certain that those
protocol features are not in use. protocol features are not in use.
When an endpoint has requested a non-zero-length connection ID, it When an endpoint uses a non-zero-length connection ID, it needs to
needs to ensure that the peer has a supply of connection IDs from ensure that the peer has a supply of connection IDs from which to
which to choose for packets sent to the endpoint. These connection choose for packets sent to the endpoint. These connection IDs are
IDs are supplied by the endpoint using the NEW_CONNECTION_ID frame supplied by the endpoint using the NEW_CONNECTION_ID frame
(Section 19.15). (Section 19.15).
5.1.1. Issuing Connection IDs 5.1.1. Issuing Connection IDs
Each Connection ID has an associated sequence number to assist in Each Connection ID has an associated sequence number to assist in
deduplicating messages. The initial connection ID issued by an deduplicating messages. The initial connection ID issued by an
endpoint is sent in the Source Connection ID field of the long packet endpoint is sent in the Source Connection ID field of the long packet
header (Section 17.2) during the handshake. The sequence number of header (Section 17.2) during the handshake. The sequence number of
the initial connection ID is 0. If the preferred_address transport the initial connection ID is 0. If the preferred_address transport
parameter is sent, the sequence number of the supplied connection ID parameter is sent, the sequence number of the supplied connection ID
skipping to change at page 26, line 23 skipping to change at page 27, line 12
When an endpoint issues a connection ID, it MUST accept packets that When an endpoint issues a connection ID, it MUST accept packets that
carry this connection ID for the duration of the connection or until carry this connection ID for the duration of the connection or until
its peer invalidates the connection ID via a RETIRE_CONNECTION_ID its peer invalidates the connection ID via a RETIRE_CONNECTION_ID
frame (Section 19.16). Connection IDs that are issued and not frame (Section 19.16). Connection IDs that are issued and not
retired are considered active; any active connection ID can be used. retired are considered active; any active connection ID can be used.
An endpoint SHOULD ensure that its peer has a sufficient number of An endpoint SHOULD ensure that its peer has a sufficient number of
available and unused connection IDs. Endpoints store received available and unused connection IDs. Endpoints store received
connection IDs for future use and advertise the number of connection connection IDs for future use and advertise the number of connection
IDs they are willing to store with the active_connection_id_limit IDs they are willing to store with the active_connection_id_limit
transport parameter. An endpoint SHOULD NOT provide more connection transport parameter. An endpoint MUST NOT provide more connection
IDs than the peer's limit. IDs than the peer's limit. An endpoint that receives more connection
IDs than its advertised active_connection_id_limit MUST close the
connection with an error of type CONNECTION_ID_LIMIT_ERROR.
An endpoint SHOULD supply a new connection ID when it receives a An endpoint SHOULD supply a new connection ID when the peer retires a
packet with a previously unused connection ID or when the peer connection ID. If an endpoint provided fewer connection IDs than the
retires one, unless providing the new connection ID would exceed the peer's active_connection_id_limit, it MAY supply a new connection ID
peer's limit. An endpoint MAY limit the frequency or the total when it receives a packet with a previously unused connection ID. An
number of connection IDs issued for each connection to avoid the risk endpoint MAY limit the frequency or the total number of connection
of running out of connection IDs; see Section 10.4.2. IDs issued for each connection to avoid the risk of running out of
connection IDs; see Section 10.4.2.
An endpoint that initiates migration and requires non-zero-length An endpoint that initiates migration and requires non-zero-length
connection IDs SHOULD ensure that the pool of connection IDs connection IDs SHOULD ensure that the pool of connection IDs
available to its peer allows the peer to use a new connection ID on available to its peer allows the peer to use a new connection ID on
migration, as the peer will close the connection if the pool is migration, as the peer will close the connection if the pool is
exhausted. exhausted.
5.1.2. Consuming and Retiring Connection IDs 5.1.2. Consuming and Retiring Connection IDs
An endpoint can change the connection ID it uses for a peer to An endpoint can change the connection ID it uses for a peer to
skipping to change at page 27, line 12 skipping to change at page 28, line 7
be used again and requests that the peer replace it with a new be used again and requests that the peer replace it with a new
connection ID using a NEW_CONNECTION_ID frame. connection ID using a NEW_CONNECTION_ID frame.
As discussed in Section 9.5, each connection ID MUST be used on As discussed in Section 9.5, each connection ID MUST be used on
packets sent from only one local address. An endpoint that migrates packets sent from only one local address. An endpoint that migrates
away from a local address SHOULD retire all connection IDs used on away from a local address SHOULD retire all connection IDs used on
that address once it no longer plans to use that address. that address once it no longer plans to use that address.
An endpoint can cause its peer to retire connection IDs by sending a An endpoint can cause its peer to retire connection IDs by sending a
NEW_CONNECTION_ID frame with an increased Retire Prior To field. NEW_CONNECTION_ID frame with an increased Retire Prior To field.
Upon receipt, the peer MUST retire the corresponding connection IDs Upon receipt, the peer MUST first retire the corresponding connection
and send corresponding RETIRE_CONNECTION_ID frames. Failing to IDs using RETIRE_CONNECTION_ID frames and then add the newly provided
retire the connection IDs within approximately one PTO can cause connection ID to the set of active connection IDs. Failure to retire
packets to be delayed, lost, or cause the original endpoint to send a the connection IDs within approximately one PTO can cause packets to
stateless reset in response to a connection ID it can no longer route be delayed, lost, or cause the original endpoint to send a stateless
reset in response to a connection ID it can no longer route
correctly. correctly.
An endpoint MAY discard a connection ID for which retirement has been An endpoint MAY discard a connection ID for which retirement has been
requested once an interval of no less than 3 PTO has elapsed since an requested once an interval of no less than 3 PTO has elapsed since an
acknowledgement is received for the NEW_CONNECTION_ID frame acknowledgement is received for the NEW_CONNECTION_ID frame
requesting that retirement. Until then, the endpoint SHOULD be requesting that retirement. Until then, the endpoint SHOULD be
prepared to receive packets that contain the connection ID that it prepared to receive packets that contain the connection ID that it
has requested be retired. Subsequent incoming packets using that has requested be retired. Subsequent incoming packets using that
connection ID could elicit a response with the corresponding connection ID could elicit a response with the corresponding
stateless reset token. stateless reset token.
5.2. Matching Packets to Connections 5.2. Matching Packets to Connections
Incoming packets are classified on receipt. Packets can either be Incoming packets are classified on receipt. Packets can either be
associated with an existing connection, or - for servers - associated with an existing connection, or - for servers -
potentially create a new connection. potentially create a new connection.
Hosts try to associate a packet with an existing connection. If the Endpoints try to associate a packet with an existing connection. If
packet has a non-zero-length Destination Connection ID corresponding the packet has a non-zero-length Destination Connection ID
to an existing connection, QUIC processes that packet accordingly. corresponding to an existing connection, QUIC processes that packet
Note that more than one connection ID can be associated with a accordingly. Note that more than one connection ID can be associated
connection; see Section 5.1. with a connection; see Section 5.1.
If the Destination Connection ID is zero length and the packet If the Destination Connection ID is zero length and the addressing
matches the local address and port of a connection where the host information in the packet matches the addressing information the
used zero-length connection IDs, QUIC processes the packet as part of endpoint uses to identify a connection with a zero-length connection
that connection. ID, QUIC processes the packet as part of that connection. An
endpoint can use just destination IP and port or both source and
destination addresses for identification, though this makes
connections fragile as described in Section 5.1.
Endpoints can send a Stateless Reset (Section 10.4) for any packets Endpoints can send a Stateless Reset (Section 10.4) for any packets
that cannot be attributed to an existing connection. A stateless that cannot be attributed to an existing connection. A stateless
reset allows a peer to more quickly identify when a connection reset allows a peer to more quickly identify when a connection
becomes unusable. becomes unusable.
Packets that are matched to an existing connection are discarded if Packets that are matched to an existing connection are discarded if
the packets are inconsistent with the state of that connection. For the packets are inconsistent with the state of that connection. For
example, packets are discarded if they indicate a different protocol example, packets are discarded if they indicate a different protocol
version than that of the connection, or if the removal of packet version than that of the connection, or if the removal of packet
skipping to change at page 29, line 23 skipping to change at page 30, line 23
If the packet is a 0-RTT packet, the server MAY buffer a limited If the packet is a 0-RTT packet, the server MAY buffer a limited
number of these packets in anticipation of a late-arriving Initial number of these packets in anticipation of a late-arriving Initial
packet. Clients are not able to send Handshake packets prior to packet. Clients are not able to send Handshake packets prior to
receiving a server response, so servers SHOULD ignore any such receiving a server response, so servers SHOULD ignore any such
packets. packets.
Servers MUST drop incoming packets under all other circumstances. Servers MUST drop incoming packets under all other circumstances.
5.3. Life of a QUIC Connection 5.3. Life of a QUIC Connection
TBD. A QUIC connection is a stateful interaction between a client and
server, the primary purpose of which is to support the exchange of
data by an application protocol. Streams (Section 2) are the primary
means by which an application protocol exchanges information.
Each connection starts with a handshake phase, during which client
and server establish a shared secret using the cryptographic
handshake protocol [QUIC-TLS] and negotiate the application protocol.
The handshake (Section 7) confirms that both endpoints are willing to
communicate (Section 8.1) and establishes parameters for the
connection (Section 7.3).
An application protocol can also operate in a limited fashion during
the handshake phase. 0-RTT allows application messages to be sent by
a client before receiving any messages from the server. However,
0-RTT lacks certain key security guarantees. In particular, there is
no protection against replay attacks in 0-RTT; see [QUIC-TLS].
Separately, a server can also send application data to a client
before it receives the final cryptographic handshake messages that
allow it to confirm the identity and liveness of the client. These
capabilities allow an application protocol to offer the option to
trade some security guarantees for reduced latency.
The use of connection IDs (Section 5.1) allows connections to migrate
to a new network path, both as a direct choice of an endpoint and
when forced by a change in a middlebox. Section 9 describes
mitigations for the security and privacy issues associated with
migration.
For connections that are no longer needed or desired, there are
several ways for a client and server to terminate a connection
(Section 10).
5.4. Required Operations on Connections 5.4. Required Operations on Connections
There are certain operations which an application MUST be able to There are certain operations which an application MUST be able to
perform when interacting with the QUIC transport. This document does perform when interacting with the QUIC transport. This document does
not specify an API, but any implementation of this version of QUIC not specify an API, but any implementation of this version of QUIC
MUST expose the ability to perform the operations described in this MUST expose the ability to perform the operations described in this
section on a QUIC connection. section on a QUIC connection.
When implementing the client role, applications need to be able to: When implementing the client role, applications need to be able to:
skipping to change at page 31, line 22 skipping to change at page 33, line 8
When a client receives a Version Negotiation packet, it MUST abandon When a client receives a Version Negotiation packet, it MUST abandon
the current connection attempt. Version Negotiation packets are the current connection attempt. Version Negotiation packets are
designed to allow future versions of QUIC to negotiate the version in designed to allow future versions of QUIC to negotiate the version in
use between endpoints. Future versions of QUIC might change how use between endpoints. Future versions of QUIC might change how
implementations that support multiple versions of QUIC react to implementations that support multiple versions of QUIC react to
Version Negotiation packets when attempting to establish a connection Version Negotiation packets when attempting to establish a connection
using this version. How to perform version negotiation is left as using this version. How to perform version negotiation is left as
future work defined by future versions of QUIC. In particular, that future work defined by future versions of QUIC. In particular, that
future work will need to ensure robustness against version downgrade future work will need to ensure robustness against version downgrade
attacks Section 21.10. attacks; see Section 21.10.
6.2.1. Version Negotiation Between Draft Versions 6.2.1. Version Negotiation Between Draft Versions
[[RFC editor: please remove this section before publication.]] [[RFC editor: please remove this section before publication.]]
When a draft implementation receives a Version Negotiation packet, it When a draft implementation receives a Version Negotiation packet, it
MAY use it to attempt a new connection with one of the versions MAY use it to attempt a new connection with one of the versions
listed in the packet, instead of abandoning the current connection listed in the packet, instead of abandoning the current connection
attempt Section 6.2. attempt; see Section 6.2.
The client MUST check that the Destination and Source Connection ID The client MUST check that the Destination and Source Connection ID
fields match the Source and Destination Connection ID fields in a fields match the Source and Destination Connection ID fields in a
packet that the client sent. If this check fails, the packet MUST be packet that the client sent. If this check fails, the packet MUST be
discarded. discarded.
Once the Version Negotiation packet is determined to be valid, the Once the Version Negotiation packet is determined to be valid, the
client then selects an acceptable protocol version from the list client then selects an acceptable protocol version from the list
provided by the server. The client then attempts to create a new provided by the server. The client then attempts to create a new
connection using that version. The new connection MUST use a new connection using that version. The new connection MUST use a new
skipping to change at page 33, line 19 skipping to change at page 35, line 10
Endpoints MUST explicitly negotiate an application protocol. This Endpoints MUST explicitly negotiate an application protocol. This
avoids situations where there is a disagreement about the protocol avoids situations where there is a disagreement about the protocol
that is in use. that is in use.
7.1. Example Handshake Flows 7.1. Example Handshake Flows
Details of how TLS is integrated with QUIC are provided in Details of how TLS is integrated with QUIC are provided in
[QUIC-TLS], but some examples are provided here. An extension of [QUIC-TLS], but some examples are provided here. An extension of
this exchange to support client address validation is shown in this exchange to support client address validation is shown in
Section 8.1.1. Section 8.1.2.
Once any address validation exchanges are complete, the cryptographic Once any address validation exchanges are complete, the cryptographic
handshake is used to agree on cryptographic keys. The cryptographic handshake is used to agree on cryptographic keys. The cryptographic
handshake is carried in Initial (Section 17.2.2) and Handshake handshake is carried in Initial (Section 17.2.2) and Handshake
(Section 17.2.4) packets. (Section 17.2.4) packets.
Figure 3 provides an overview of the 1-RTT handshake. Each line Figure 3 provides an overview of the 1-RTT handshake. Each line
shows a QUIC packet with the packet type and packet number shown shows a QUIC packet with the packet type and packet number shown
first, followed by the frames that are typically contained in those first, followed by the frames that are typically contained in those
packets. So, for instance the first packet is of type Initial, with packets. So, for instance the first packet is of type Initial, with
skipping to change at page 38, line 17 skipping to change at page 39, line 46
7.3.2. New Transport Parameters 7.3.2. New Transport Parameters
New transport parameters can be used to negotiate new protocol New transport parameters can be used to negotiate new protocol
behavior. An endpoint MUST ignore transport parameters that it does behavior. An endpoint MUST ignore transport parameters that it does
not support. Absence of a transport parameter therefore disables any not support. Absence of a transport parameter therefore disables any
optional protocol feature that is negotiated using the parameter. As optional protocol feature that is negotiated using the parameter. As
described in Section 18.1, some identifiers are reserved in order to described in Section 18.1, some identifiers are reserved in order to
exercise this requirement. exercise this requirement.
New transport parameters can be registered according to the rules in New transport parameters can be registered according to the rules in
Section 22.1. Section 22.2.
7.4. Cryptographic Message Buffering 7.4. Cryptographic Message Buffering
Implementations need to maintain a buffer of CRYPTO data received out Implementations need to maintain a buffer of CRYPTO data received out
of order. Because there is no flow control of CRYPTO frames, an of order. Because there is no flow control of CRYPTO frames, an
endpoint could potentially force its peer to buffer an unbounded endpoint could potentially force its peer to buffer an unbounded
amount of data. amount of data.
Implementations MUST support buffering at least 4096 bytes of data Implementations MUST support buffering at least 4096 bytes of data
received in CRYPTO frames out of order. Endpoints MAY choose to received in CRYPTO frames out of order. Endpoints MAY choose to
skipping to change at page 39, line 49 skipping to change at page 41, line 34
clients SHOULD send a packet upon a probe timeout, as described in clients SHOULD send a packet upon a probe timeout, as described in
[QUIC-RECOVERY]. If the client has no data to retransmit and does [QUIC-RECOVERY]. If the client has no data to retransmit and does
not have Handshake keys, it SHOULD send an Initial packet in a UDP not have Handshake keys, it SHOULD send an Initial packet in a UDP
datagram of at least 1200 bytes. If the client has Handshake keys, datagram of at least 1200 bytes. If the client has Handshake keys,
it SHOULD send a Handshake packet. it SHOULD send a Handshake packet.
A server might wish to validate the client address before starting A server might wish to validate the client address before starting
the cryptographic handshake. QUIC uses a token in the Initial packet the cryptographic handshake. QUIC uses a token in the Initial packet
to provide address validation prior to completing the handshake. to provide address validation prior to completing the handshake.
This token is delivered to the client during connection establishment This token is delivered to the client during connection establishment
with a Retry packet (see Section 8.1.1) or in a previous connection with a Retry packet (see Section 8.1.2) or in a previous connection
using the NEW_TOKEN frame (see Section 8.1.2). using the NEW_TOKEN frame (see Section 8.1.3).
In addition to sending limits imposed prior to address validation, In addition to sending limits imposed prior to address validation,
servers are also constrained in what they can send by the limits set servers are also constrained in what they can send by the limits set
by the congestion controller. Clients are only constrained by the by the congestion controller. Clients are only constrained by the
congestion controller. congestion controller.
8.1.1. Address Validation using Retry Packets 8.1.1. Token Construction
A token sent in a NEW_TOKEN frames or a Retry packet MUST be
constructed in a way that allows the server to identity how it was
provided to a client. These tokens are carried in the same field,
but require different handling from servers.
8.1.2. Address Validation using Retry Packets
Upon receiving the client's Initial packet, the server can request Upon receiving the client's Initial packet, the server can request
address validation by sending a Retry packet (Section 17.2.5) address validation by sending a Retry packet (Section 17.2.5)
containing a token. This token MUST be repeated by the client in all containing a token. This token MUST be repeated by the client in all
Initial packets it sends for that connection after it receives the Initial packets it sends for that connection after it receives the
Retry packet. In response to processing an Initial containing a Retry packet. In response to processing an Initial containing a
token, a server can either abort the connection or permit it to token, a server can either abort the connection or permit it to
proceed. proceed.
As long as it is not possible for an attacker to generate a valid As long as it is not possible for an attacker to generate a valid
token for its own address (see Section 8.1.3) and the client is able token for its own address (see Section 8.1.4) and the client is able
to return that token, it proves to the server that it received the to return that token, it proves to the server that it received the
token. token.
A server can also use a Retry packet to defer the state and A server can also use a Retry packet to defer the state and
processing costs of connection establishment. Requiring the server processing costs of connection establishment. Requiring the server
to provide a different connection ID, along with the to provide a different connection ID, along with the
original_connection_id transport parameter defined in Section 18.2, original_connection_id transport parameter defined in Section 18.2,
forces the server to demonstrate that it, or an entity it cooperates forces the server to demonstrate that it, or an entity it cooperates
with, received the original Initial packet from the client. with, received the original Initial packet from the client.
Providing a different connection ID also grants a server some control Providing a different connection ID also grants a server some control
over how subsequent packets are routed. This can be used to direct over how subsequent packets are routed. This can be used to direct
connections to a different server instance. connections to a different server instance.
If a server receives a client Initial that can be unprotected but
contains an invalid Retry token, it knows the client will not accept
another Retry token. The server can discard such a packet and allow
the client to time out to detect handshake failure, but that could
impose a significant latency penalty on the client. A server MAY
proceed with the connection without verifying the token, though the
server MUST NOT consider the client address validated. If a server
chooses not to proceed with the handshake, it SHOULD immediately
close (Section 10.3) the connection with an INVALID_TOKEN error.
Note that a server has not established any state for the connection
at this point and so does not enter the closing period.
A flow showing the use of a Retry packet is shown in Figure 5. A flow showing the use of a Retry packet is shown in Figure 5.
Client Server Client Server
Initial[0]: CRYPTO[CH] -> Initial[0]: CRYPTO[CH] ->
<- Retry+Token <- Retry+Token
Initial+Token[1]: CRYPTO[CH] -> Initial+Token[1]: CRYPTO[CH] ->
Initial[0]: CRYPTO[SH] ACK[1] Initial[0]: CRYPTO[SH] ACK[1]
Handshake[0]: CRYPTO[EE, CERT, CV, FIN] Handshake[0]: CRYPTO[EE, CERT, CV, FIN]
<- 1-RTT[0]: STREAM[1, "..."] <- 1-RTT[0]: STREAM[1, "..."]
Figure 5: Example Handshake with Retry Figure 5: Example Handshake with Retry
8.1.2. Address Validation for Future Connections 8.1.3. Address Validation for Future Connections
A server MAY provide clients with an address validation token during A server MAY provide clients with an address validation token during
one connection that can be used on a subsequent connection. Address one connection that can be used on a subsequent connection. Address
validation is especially important with 0-RTT because a server validation is especially important with 0-RTT because a server
potentially sends a significant amount of data to a client in potentially sends a significant amount of data to a client in
response to 0-RTT data. response to 0-RTT data.
The server uses the NEW_TOKEN frame Section 19.7 to provide the The server uses the NEW_TOKEN frame Section 19.7 to provide the
client with an address validation token that can be used to validate client with an address validation token that can be used to validate
future connections. The client includes this token in Initial future connections. The client includes this token in Initial
packets to provide address validation in a future connection. The packets to provide address validation in a future connection. The
client MUST include the token in all Initial packets it sends, unless client MUST include the token in all Initial packets it sends, unless
a Retry replaces the token with a newer one. The client MUST NOT use a Retry replaces the token with a newer one. The client MUST NOT use
the token provided in a Retry for future connections. Servers MAY the token provided in a Retry for future connections. Servers MAY
discard any Initial packet that does not carry the expected token. discard any Initial packet that does not carry the expected token.
A token SHOULD be constructed in a way that allows the server to
distinguish it from tokens that are sent in Retry packets as they are
carried in the same field.
The token MUST NOT include information that would allow it to be
linked by an on-path observer to the connection on which it was
issued. For example, it cannot include the connection ID or
addressing information unless the values are encrypted.
Unlike the token that is created for a Retry packet, there might be Unlike the token that is created for a Retry packet, there might be
some time between when the token is created and when the token is some time between when the token is created and when the token is
subsequently used. Thus, a token SHOULD have an expiration time, subsequently used. Thus, a token SHOULD have an expiration time,
which could be either an explicit expiration time or an issued which could be either an explicit expiration time or an issued
timestamp that can be used to dynamically calculate the expiration timestamp that can be used to dynamically calculate the expiration
time. A server can store the expiration time or include it in an time. A server can store the expiration time or include it in an
encrypted form in the token. encrypted form in the token.
A token issued with NEW_TOKEN MUST NOT include information that would
allow values to be linked by an on-path observer to the connection on
which it was issued, unless the values are encrypted. For example,
it cannot include the previous connection ID or addressing
information. A server MUST ensure that every NEW_TOKEN frame it
sends is unique across all clients, with the exception of those sent
to repair losses of previously sent NEW_TOKEN frames. Information
that allows the server to distinguish between tokens from Retry and
NEW_TOKEN MAY be accessible to entities other than the server.
It is unlikely that the client port number is the same on two It is unlikely that the client port number is the same on two
different connections; validating the port is therefore unlikely to different connections; validating the port is therefore unlikely to
be successful. be successful.
If the client has a token received in a NEW_TOKEN frame on a previous A token received in a NEW_TOKEN frame is applicable to any server
connection to what it believes to be the same server, it SHOULD that the connection is considered authoritative for (e.g., server
include that value in the Token field of its Initial packet. names included in the certificate). When connecting to a server for
which the client retains an applicable and unused token, it SHOULD
include that token in the Token field of its Initial packet.
Including a token might allow the server to validate the client Including a token might allow the server to validate the client
address without an additional round trip. address without an additional round trip. A client MUST NOT include
a token that is not applicable to the server that it is connecting
to, unless the client has the knowledge that the server that issued
the token and the server the client is connecting to are jointly
managing the tokens. A client MAY use a token from any previous
connection to that server.
A token allows a server to correlate activity between the connection A token allows a server to correlate activity between the connection
where the token was issued and any connection where it is used. where the token was issued and any connection where it is used.
Clients that want to break continuity of identity with a server MAY Clients that want to break continuity of identity with a server MAY
discard tokens provided using the NEW_TOKEN frame. A token obtained discard tokens provided using the NEW_TOKEN frame. In comparison, a
in a Retry packet MUST be used immediately during the connection token obtained in a Retry packet MUST be used immediately during the
attempt and cannot be used in subsequent connection attempts. connection attempt and cannot be used in subsequent connection
attempts.
A client SHOULD NOT reuse a token in different connections. Reusing A client SHOULD NOT reuse a NEW_TOKEN token for different connection
a token allows connections to be linked by entities on the network attempts. Reusing a token allows connections to be linked by
path; see Section 9.5. A client MUST NOT reuse a token if it entities on the network path; see Section 9.5. A client MUST NOT
believes that its point of network attachment has changed since the reuse a token if it believes that its point of network attachment has
token was last used; that is, if there is a change in its local IP changed since the token was last used; that is, if there is a change
address or network interface. A client needs to start the connection in its local IP address or network interface. A client needs to
process over if there is any change in its local address prior to start the connection process over if there is any change in its local
completing the handshake. address prior to completing the handshake.
Clients might receive multiple tokens on a single connection. Aside Clients might receive multiple tokens on a single connection. Aside
from preventing linkability, any token can be used in any connection from preventing linkability, any token can be used in any connection
attempt. Servers can send additional tokens to either enable address attempt. Servers can send additional tokens to either enable address
validation for multiple connection attempts or to replace older validation for multiple connection attempts or to replace older
tokens that might become invalid. For a client, this ambiguity means tokens that might become invalid. For a client, this ambiguity means
that sending the most recent unused token is most likely to be that sending the most recent unused token is most likely to be
effective. Though saving and using older tokens has no negative effective. Though saving and using older tokens has no negative
consequences, clients can regard older tokens as being less likely be consequences, clients can regard older tokens as being less likely be
useful to the server for address validation. useful to the server for address validation.
skipping to change at page 43, line 5 skipping to change at page 45, line 25
In a stateless design, a server can use encrypted and authenticated In a stateless design, a server can use encrypted and authenticated
tokens to pass information to clients that the server can later tokens to pass information to clients that the server can later
recover and use to validate a client address. Tokens are not recover and use to validate a client address. Tokens are not
integrated into the cryptographic handshake and so they are not integrated into the cryptographic handshake and so they are not
authenticated. For instance, a client might be able to reuse a authenticated. For instance, a client might be able to reuse a
token. To avoid attacks that exploit this property, a server can token. To avoid attacks that exploit this property, a server can
limit its use of tokens to only the information needed to validate limit its use of tokens to only the information needed to validate
client addresses. client addresses.
Clients MAY use tokens obtained on one connection for any connection
attempt using the same version. When selecting a token to use,
clients do not need to consider other properties of the connection
that is being attempted, including the choice of possible application
protocols, session tickets, or other connection properties.
Attackers could replay tokens to use servers as amplifiers in DDoS Attackers could replay tokens to use servers as amplifiers in DDoS
attacks. To protect against such attacks, servers SHOULD ensure that attacks. To protect against such attacks, servers SHOULD ensure that
tokens sent in Retry packets are only accepted for a short time. tokens sent in Retry packets are only accepted for a short time.
Tokens that are provided in NEW_TOKEN frames (see Section 19.7) need Tokens that are provided in NEW_TOKEN frames (see Section 19.7) need
to be valid for longer, but SHOULD NOT be accepted multiple times in to be valid for longer, but SHOULD NOT be accepted multiple times in
a short period. Servers are encouraged to allow tokens to be used a short period. Servers are encouraged to allow tokens to be used
only once, if possible. only once, if possible.
8.1.3. Address Validation Token Integrity 8.1.4. Address Validation Token Integrity
An address validation token MUST be difficult to guess. Including a An address validation token MUST be difficult to guess. Including a
large enough random value in the token would be sufficient, but this large enough random value in the token would be sufficient, but this
depends on the server remembering the value it sends to clients. depends on the server remembering the value it sends to clients.
A token-based scheme allows the server to offload any state A token-based scheme allows the server to offload any state
associated with validation to the client. For this design to work, associated with validation to the client. For this design to work,
the token MUST be covered by integrity protection against the token MUST be covered by integrity protection against
modification or falsification by clients. Without integrity modification or falsification by clients. Without integrity
protection, malicious clients could generate or guess values for protection, malicious clients could generate or guess values for
skipping to change at page 46, line 46 skipping to change at page 49, line 25
9.1. Probing a New Path 9.1. Probing a New Path
An endpoint MAY probe for peer reachability from a new local address An endpoint MAY probe for peer reachability from a new local address
using path validation Section 8.2 prior to migrating the connection using path validation Section 8.2 prior to migrating the connection
to the new local address. Failure of path validation simply means to the new local address. Failure of path validation simply means
that the new path is not usable for this connection. Failure to that the new path is not usable for this connection. Failure to
validate a path does not cause the connection to end unless there are validate a path does not cause the connection to end unless there are
no valid alternative paths available. no valid alternative paths available.
An endpoint uses a new connection ID for probes sent from a new local An endpoint uses a new connection ID for probes sent from a new local
address, see Section 9.5 for further discussion. An endpoint that address; see Section 9.5 for further discussion. An endpoint that
uses a new local address needs to ensure that at least one new uses a new local address needs to ensure that at least one new
connection ID is available at the peer. That can be achieved by connection ID is available at the peer. That can be achieved by
including a NEW_CONNECTION_ID frame in the probe. including a NEW_CONNECTION_ID frame in the probe.
Receiving a PATH_CHALLENGE frame from a peer indicates that the peer Receiving a PATH_CHALLENGE frame from a peer indicates that the peer
is probing for reachability on a path. An endpoint sends a is probing for reachability on a path. An endpoint sends a
PATH_RESPONSE in response as per Section 8.2. PATH_RESPONSE in response as per Section 8.2.
PATH_CHALLENGE, PATH_RESPONSE, NEW_CONNECTION_ID, and PADDING frames PATH_CHALLENGE, PATH_RESPONSE, NEW_CONNECTION_ID, and PADDING frames
are "probing frames", and all other frames are "non-probing frames". are "probing frames", and all other frames are "non-probing frames".
skipping to change at page 47, line 52 skipping to change at page 50, line 32
frame indicates that the peer has migrated to that address. frame indicates that the peer has migrated to that address.
In response to such a packet, an endpoint MUST start sending In response to such a packet, an endpoint MUST start sending
subsequent packets to the new peer address and MUST initiate path subsequent packets to the new peer address and MUST initiate path
validation (Section 8.2) to verify the peer's ownership of the validation (Section 8.2) to verify the peer's ownership of the
unvalidated address. unvalidated address.
An endpoint MAY send data to an unvalidated peer address, but it MUST An endpoint MAY send data to an unvalidated peer address, but it MUST
protect against potential attacks as described in Section 9.3.1 and protect against potential attacks as described in Section 9.3.1 and
Section 9.3.2. An endpoint MAY skip validation of a peer address if Section 9.3.2. An endpoint MAY skip validation of a peer address if
that address has been seen recently. that address has been seen recently. In particular, if an endpoint
returns to a previously-validated path after detecting some form of
spurious migration, skipping address validation and restoring loss
detection and congestion state can reduce the performance impact of
the attack.
An endpoint only changes the address that it sends packets to in An endpoint only changes the address that it sends packets to in
response to the highest-numbered non-probing packet. This ensures response to the highest-numbered non-probing packet. This ensures
that an endpoint does not send packets to an old peer address in the that an endpoint does not send packets to an old peer address in the
case that it receives reordered packets. case that it receives reordered packets.
After changing the address to which it sends non-probing packets, an After changing the address to which it sends non-probing packets, an
endpoint could abandon any path validation for other addresses. endpoint could abandon any path validation for other addresses.
Receiving a packet from a new peer address might be the result of a Receiving a packet from a new peer address might be the result of a
skipping to change at page 50, line 24 skipping to change at page 53, line 12
An endpoint could also use heuristics to improve detection of this An endpoint could also use heuristics to improve detection of this
style of attack. For instance, NAT rebinding is improbable if style of attack. For instance, NAT rebinding is improbable if
packets were recently received on the old path, similarly rebinding packets were recently received on the old path, similarly rebinding
is rare on IPv6 paths. Endpoints can also look for duplicated is rare on IPv6 paths. Endpoints can also look for duplicated
packets. Conversely, a change in connection ID is more likely to packets. Conversely, a change in connection ID is more likely to
indicate an intentional migration rather than an attack. indicate an intentional migration rather than an attack.
9.4. Loss Detection and Congestion Control 9.4. Loss Detection and Congestion Control
The capacity available on the new path might not be the same as the The capacity available on the new path might not be the same as the
old path. Packets sent on the old path SHOULD NOT contribute to old path. Packets sent on the old path MUST NOT contribute to
congestion control or RTT estimation for the new path. congestion control or RTT estimation for the new path.
On confirming a peer's ownership of its new address, an endpoint MUST On confirming a peer's ownership of its new address, an endpoint MUST
immediately reset the congestion controller and round-trip time immediately reset the congestion controller and round-trip time
estimator for the new path to initial values (see Sections A.3 and estimator for the new path to initial values (see Sections A.3 and
B.3 in [QUIC-RECOVERY]) unless it has knowledge that a previous send B.3 in [QUIC-RECOVERY]) unless it has knowledge that a previous send
rate or round-trip time estimate is valid for the new path. For rate or round-trip time estimate is valid for the new path. For
instance, an endpoint might infer that a change in only the client's instance, an endpoint might infer that a change in only the client's
port number is indicative of a NAT rebinding, meaning that the new port number is indicative of a NAT rebinding, meaning that the new
path is likely to have similar bandwidth and round-trip time. path is likely to have similar bandwidth and round-trip time.
skipping to change at page 56, line 38 skipping to change at page 59, line 31
that it is likely that only applications or application protocols that it is likely that only applications or application protocols
will know what information can be retried. will know what information can be retried.
10.3. Immediate Close 10.3. Immediate Close
An endpoint sends a CONNECTION_CLOSE frame (Section 19.19) to An endpoint sends a CONNECTION_CLOSE frame (Section 19.19) to
terminate the connection immediately. A CONNECTION_CLOSE frame terminate the connection immediately. A CONNECTION_CLOSE frame
causes all streams to immediately become closed; open streams can be causes all streams to immediately become closed; open streams can be
assumed to be implicitly reset. assumed to be implicitly reset.
After sending a CONNECTION_CLOSE frame, endpoints immediately enter After sending a CONNECTION_CLOSE frame, an endpoint immediately
the closing state. During the closing period, an endpoint that sends enters the closing state.
a CONNECTION_CLOSE frame SHOULD respond to any packet that it
receives with another packet containing a CONNECTION_CLOSE frame. To During the closing period, an endpoint that sends a CONNECTION_CLOSE
minimize the state that an endpoint maintains for a closing frame SHOULD respond to any incoming packet that can be decrypted
connection, endpoints MAY send the exact same packet. However, with another packet containing a CONNECTION_CLOSE frame. Such an
endpoints SHOULD limit the number of packets they generate containing endpoint SHOULD limit the number of packets it generates containing a
a CONNECTION_CLOSE frame. For instance, an endpoint could CONNECTION_CLOSE frame. For instance, an endpoint could wait for a
progressively increase the number of packets that it receives before progressively increasing number of received packets or amount of time
sending additional packets or increase the time between packets. before responding to a received packet.
An endpoint is allowed to drop the packet protection keys when
entering the closing period (Section 10.1) and send a packet
containing a CONNECTION_CLOSE in response to any UDP datagram that is
received. However, an endpoint without the packet protection keys
cannot identify and discard invalid packets. To avoid creating an
unwitting amplification attack, such endpoints MUST reduce the
frequency with which it sends packets containing a CONNECTION_CLOSE
frame. To minimize the state that an endpoint maintains for a
closing connection, endpoints MAY send the exact same packet.
Note: Allowing retransmission of a closing packet contradicts other Note: Allowing retransmission of a closing packet contradicts other
advice in this document that recommends the creation of new packet advice in this document that recommends the creation of new packet
numbers for every packet. Sending new packet numbers is primarily numbers for every packet. Sending new packet numbers is primarily
of advantage to loss recovery and congestion control, which are of advantage to loss recovery and congestion control, which are
not expected to be relevant for a closed connection. not expected to be relevant for a closed connection.
Retransmitting the final packet requires less state. Retransmitting the final packet requires less state.
New packets from unverified addresses could be used to create an New packets from unverified addresses could be used to create an
amplification attack (see Section 8). To avoid this, endpoints MUST amplification attack (see Section 8). To avoid this, endpoints MUST
skipping to change at page 57, line 34 skipping to change at page 60, line 39
protocols negotiates a graceful shutdown. The application protocol protocols negotiates a graceful shutdown. The application protocol
exchanges whatever messages that are needed to cause both endpoints exchanges whatever messages that are needed to cause both endpoints
to agree to close the connection, after which the application to agree to close the connection, after which the application
requests that the connection be closed. The application protocol can requests that the connection be closed. The application protocol can
use a CONNECTION_CLOSE frame with an appropriate error code to signal use a CONNECTION_CLOSE frame with an appropriate error code to signal
closure. closure.
When sending CONNECTION_CLOSE, the goal is to ensure that the peer When sending CONNECTION_CLOSE, the goal is to ensure that the peer
will process the frame. Generally, this means sending the frame in a will process the frame. Generally, this means sending the frame in a
packet with the highest level of packet protection to avoid the packet with the highest level of packet protection to avoid the
packet being discarded. However, during the handshake, it is packet being discarded. After the handshake is confirmed (see
possible that more advanced packet protection keys are not available Section 4.1.2 of [QUIC-TLS]), an endpoint MUST send any
to the peer, so the frame MAY be replicated in a packet that uses a CONNECTION_CLOSE frames in a 1-RTT packet. However, prior to
lower packet protection level. confirming the handshake, it is possible that more advanced packet
protection keys are not available to the peer, so the frame MAY be
After the handshake is confirmed, an endpoint MUST send any replicated in a packet that uses a lower packet protection level.
CONNECTION_CLOSE frames in a 1-RTT packet. Prior to handshake
confirmation, the peer might not have 1-RTT keys, so the endpoint
SHOULD send CONNECTION_CLOSE frames in a Handshake packet. If the
endpoint does not have Handshake keys, it SHOULD send
CONNECTION_CLOSE frames in an Initial packet.
A client will always know whether the server has Handshake keys (see A client will always know whether the server has Handshake keys (see
Section 17.2.2.1), but it is possible that a server does not know Section 17.2.2.1), but it is possible that a server does not know
whether the client has Handshake keys. Under these circumstances, a whether the client has Handshake keys. Under these circumstances, a
server SHOULD send a CONNECTION_CLOSE frame in both Handshake and server SHOULD send a CONNECTION_CLOSE frame in both Handshake and
Initial packets to ensure that at least one of them is processable by Initial packets to ensure that at least one of them is processable by
the client. These packets can be coalesced into a single UDP the client. Similarly, a peer might be unable to read 1-RTT packets,
datagram (see Section 12.2). so an endpoint SHOULD send CONNECTION_CLOSE in Handshake and 1-RTT
packets prior to confirming the handshake. These packets can be
coalesced into a single UDP datagram; see Section 12.2.
10.4. Stateless Reset 10.4. Stateless Reset
A stateless reset is provided as an option of last resort for an A stateless reset is provided as an option of last resort for an
endpoint that does not have access to the state of a connection. A endpoint that does not have access to the state of a connection. A
crash or outage might result in peers continuing to send data to an crash or outage might result in peers continuing to send data to an
endpoint that is unable to properly continue the connection. An endpoint that is unable to properly continue the connection. An
endpoint MAY send a stateless reset in response to receiving a packet endpoint MAY send a stateless reset in response to receiving a packet
that it cannot associate with an active connection. that it cannot associate with an active connection.
skipping to change at page 64, line 24 skipping to change at page 67, line 24
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 a An endpoint that chooses not to retransmit packets containing a
CONNECTION_CLOSE frame risks a peer missing the first such packet. CONNECTION_CLOSE frame risks a peer missing the first such packet.
The only mechanism available to an endpoint that continues to receive The only mechanism available to an endpoint that continues to receive
data for a terminated connection is to use the stateless reset data for a terminated connection is to use the stateless reset
process (Section 10.4). process (Section 10.4).
An endpoint that receives an invalid CONNECTION_CLOSE frame MUST NOT
signal the existence of the error to its peer.
11.2. Stream Errors 11.2. Stream Errors
If an application-level error affects a single stream, but otherwise If an application-level error affects a single stream, but otherwise
leaves the connection in a recoverable state, the endpoint can send a leaves the connection in a recoverable state, the endpoint can send a
RESET_STREAM frame (Section 19.4) with an appropriate error code to RESET_STREAM frame (Section 19.4) with an appropriate error code to
terminate just the affected stream. terminate just the affected stream.
RESET_STREAM MUST be instigated by the protocol using QUIC. Resetting a stream without the involvement of the application
RESET_STREAM carries an application error code. Only the application protocol could cause the application protocol to enter an
protocol is able to cause a stream to be terminated. A local unrecoverable state. RESET_STREAM MUST only be instigated by the
instance of the application protocol uses a direct API call and a application protocol that uses QUIC.
remote instance uses the STOP_SENDING frame, which triggers an
RESET_STREAM carries an application error code, for which the
semantics are defined by the application protocol. Only the
application protocol is able to cause a stream to be terminated. A
local instance of the application protocol uses a direct API call and
a remote instance uses the STOP_SENDING frame, which triggers an
automatic RESET_STREAM. automatic RESET_STREAM.
Resetting a stream without knowledge of the application protocol
could cause the protocol to enter an unrecoverable state.
Application protocols might require certain streams to be reliably
delivered in order to guarantee consistent state between endpoints.
Application protocols SHOULD define rules for handling streams that Application protocols SHOULD define rules for handling streams that
are prematurely cancelled by either endpoint. are prematurely cancelled by either endpoint.
12. Packets and Frames 12. Packets and Frames
QUIC endpoints communicate by exchanging packets. Packets have QUIC endpoints communicate by exchanging packets. Packets have
confidentiality and integrity protection (see Section 12.1) and are confidentiality and integrity protection (see Section 12.1) and are
carried in UDP datagrams (see Section 12.2). carried in UDP datagrams (see Section 12.2).
This version of QUIC uses the long packet header (see Section 17.2) This version of QUIC uses the long packet header (see Section 17.2)
skipping to change at page 65, line 18 skipping to change at page 68, line 18
(Section 17.2.4), and Retry (Section 17.2.5). Version negotiation (Section 17.2.4), and Retry (Section 17.2.5). Version negotiation
uses a version-independent packet with a long header (see uses a version-independent packet with a long header (see
Section 17.2.1). Section 17.2.1).
Packets with the short header (Section 17.3) are designed for minimal Packets with the short header (Section 17.3) are designed for minimal
overhead and are used after a connection is established and 1-RTT overhead and are used after a connection is established and 1-RTT
keys are available. keys are available.
12.1. Protected Packets 12.1. Protected Packets
All QUIC packets except Version Negotiation and Retry packets use All QUIC packets except Version Negotiation packets use authenticated
authenticated encryption with additional data (AEAD) [RFC5116] to encryption with additional data (AEAD) [RFC5116] to provide
provide confidentiality and integrity protection. Details of packet confidentiality and integrity protection. Retry packets use an AEAD
protection are found in [QUIC-TLS]; this section includes an overview to provide integrity protection. Details of packet protection are
of the process. found in [QUIC-TLS]; this section includes an overview of the
process.
Initial packets are protected using keys that are statically derived. Initial packets are protected using keys that are statically derived.
This packet protection is not effective confidentiality protection. This packet protection is not effective confidentiality protection.
Initial protection only exists to ensure that the sender of the Initial protection only exists to ensure that the sender of the
packet is on the network path. Any entity that receives the Initial packet is on the network path. Any entity that receives the Initial
packet from a client can recover the keys necessary to remove packet packet from a client can recover the keys necessary to remove packet
protection or to generate packets that will be successfully protection or to generate packets that will be successfully
authenticated. authenticated.
All other packets are protected with keys derived from the All other packets are protected with keys derived from the
skipping to change at page 69, line 8 skipping to change at page 72, line 8
Figure 8: Generic Frame Layout Figure 8: Generic Frame Layout
The frame types defined in this specification are listed in Table 3. The frame types defined in this specification are listed in Table 3.
The Frame Type in ACK, STREAM, MAX_STREAMS, STREAMS_BLOCKED, and The Frame Type in ACK, STREAM, MAX_STREAMS, STREAMS_BLOCKED, and
CONNECTION_CLOSE frames is used to carry other frame-specific flags. CONNECTION_CLOSE frames is used to carry other frame-specific flags.
For all other frames, the Frame Type field simply identifies the For all other frames, the Frame Type field simply identifies the
frame. These frames are explained in more detail in Section 19. frame. These frames are explained in more detail in Section 19.
+-------------+----------------------+----------------+ +-------------+----------------------+----------------+---------+
| Type Value | Frame Type Name | Definition | | Type Value | Frame Type Name | Definition | Packets |
+-------------+----------------------+----------------+ +-------------+----------------------+----------------+---------+
| 0x00 | PADDING | Section 19.1 | | 0x00 | PADDING | Section 19.1 | IH01 |
| | | | | | | | |
| 0x01 | PING | Section 19.2 | | 0x01 | PING | Section 19.2 | IH01 |
| | | | | | | | |
| 0x02 - 0x03 | ACK | Section 19.3 | | 0x02 - 0x03 | ACK | Section 19.3 | IH_1 |
| | | | | | | | |
| 0x04 | RESET_STREAM | Section 19.4 | | 0x04 | RESET_STREAM | Section 19.4 | __01 |
| | | | | | | | |
| 0x05 | STOP_SENDING | Section 19.5 | | 0x05 | STOP_SENDING | Section 19.5 | __01 |
| | | | | | | | |
| 0x06 | CRYPTO | Section 19.6 | | 0x06 | CRYPTO | Section 19.6 | IH_1 |
| | | | | | | | |
| 0x07 | NEW_TOKEN | Section 19.7 | | 0x07 | NEW_TOKEN | Section 19.7 | ___1 |
| | | | | | | | |
| 0x08 - 0x0f | STREAM | Section 19.8 | | 0x08 - 0x0f | STREAM | Section 19.8 | __01 |
| | | | | | | | |
| 0x10 | MAX_DATA | Section 19.9 | | 0x10 | MAX_DATA | Section 19.9 | __01 |
| | | | | | | | |
| 0x11 | MAX_STREAM_DATA | Section 19.10 | | 0x11 | MAX_STREAM_DATA | Section 19.10 | __01 |
| | | | | | | | |
| 0x12 - 0x13 | MAX_STREAMS | Section 19.11 | | 0x12 - 0x13 | MAX_STREAMS | Section 19.11 | __01 |
| | | | | | | | |
| 0x14 | DATA_BLOCKED | Section 19.12 | | 0x14 | DATA_BLOCKED | Section 19.12 | __01 |
| | | | | | | | |
| 0x15 | STREAM_DATA_BLOCKED | Section 19.13 | | 0x15 | STREAM_DATA_BLOCKED | Section 19.13 | __01 |
| | | | | | | | |
| 0x16 - 0x17 | STREAMS_BLOCKED | Section 19.14 | | 0x16 - 0x17 | STREAMS_BLOCKED | Section 19.14 | __01 |
| | | | | | | | |
| 0x18 | NEW_CONNECTION_ID | Section 19.15 | | 0x18 | NEW_CONNECTION_ID | Section 19.15 | __01 |
| | | | | | | | |
| 0x19 | RETIRE_CONNECTION_ID | Section 19.16 | | 0x19 | RETIRE_CONNECTION_ID | Section 19.16 | __01 |
| | | | | | | | |
| 0x1a | PATH_CHALLENGE | Section 19.17 | | 0x1a | PATH_CHALLENGE | Section 19.17 | __01 |
| | | | | | | | |
| 0x1b | PATH_RESPONSE | Section 19.18 | | 0x1b | PATH_RESPONSE | Section 19.18 | __01 |
| | | | | | | | |
| 0x1c - 0x1d | CONNECTION_CLOSE | Section 19.19 | | 0x1c - 0x1d | CONNECTION_CLOSE | Section 19.19 | IH_1* |
+-------------+----------------------+----------------+ | | | | |
| 0x1e | HANDSHAKE_DONE | Section 19.20 | ___1 |
+-------------+----------------------+----------------+---------+
Table 3: Frame Types Table 3: Frame Types
The "Packets" column in Table 3 does not form part of the IANA
registry (see Section 22.3). This column summarizes the types of
packets that each frame type can appear in, indicated as up to four
characters indicating:
I: Initial (Section 17.2.2)
H: Handshake (Section 17.2.4)
0: 0-RTT (Section 17.2.3)
1: 1-RTT (Section 17.3)
*: A CONNECTION_CLOSE frame of type 0x1c can appear in Initial,
Handshake, and 1-RTT packets, whereas a CONNECTION_CLOSE of type
0x1d can only appear in a 1-RTT packet.
Section 4 of [QUIC-TLS] provides more detail about these
restrictions. Note that all frames can appear in 1-RTT packets.
An endpoint MUST treat the receipt of a frame of unknown type as a An endpoint MUST treat the receipt of a frame of unknown type as a
connection error of type FRAME_ENCODING_ERROR. connection error of type FRAME_ENCODING_ERROR.
All QUIC frames are idempotent in this version of QUIC. That is, a All QUIC frames are idempotent in this version of QUIC. That is, a
valid frame does not cause undesirable side effects or errors when valid frame does not cause undesirable side effects or errors when
received more than once. received more than once.
The Frame Type field uses a variable length integer encoding (see The Frame Type field uses a variable length integer encoding (see
Section 16) with one exception. To ensure simple and efficient Section 16) with one exception. To ensure simple and efficient
implementations of frame parsing, a frame type MUST use the shortest implementations of frame parsing, a frame type MUST use the shortest
skipping to change at page 73, line 22 skipping to change at page 76, line 44
When an ACK frame is sent, one or more ranges of acknowledged packets When an ACK frame is sent, one or more ranges of acknowledged packets
are included. Including older packets reduces the chance of spurious are included. Including older packets reduces the chance of spurious
retransmits caused by losing previously sent ACK frames, at the cost retransmits caused by losing previously sent ACK frames, at the cost
of larger ACK frames. of larger ACK frames.
ACK frames SHOULD always acknowledge the most recently received ACK frames SHOULD always acknowledge the most recently received
packets, and the more out-of-order the packets are, the more packets, and the more out-of-order the packets are, the more
important it is to send an updated ACK frame quickly, to prevent the important it is to send an updated ACK frame quickly, to prevent the
peer from declaring a packet as lost and spuriously retransmitting peer from declaring a packet as lost and spuriously retransmitting
the frames it contains. the frames it contains. An ACK frame is expected to fit within a
single QUIC packet. If it does not, then older ranges (those with
the smallest packet numbers) are omitted.
Section 13.2.3 and Section 13.2.4 describe an exemplary approach for Section 13.2.3 and Section 13.2.4 describe an exemplary approach for
determining what packets to acknowledge in each ACK frame. determining what packets to acknowledge in each ACK frame.
13.2.3. Receiver Tracking of ACK Frames 13.2.3. Receiver Tracking of ACK Frames
When a packet containing an ACK frame is sent, the largest When a packet containing an ACK frame is sent, the largest
acknowledged in that frame may be saved. When a packet containing an acknowledged in that frame may be saved. When a packet containing an
ACK frame is acknowledged, the receiver can stop acknowledging ACK frame is acknowledged, the receiver can stop acknowledging
packets less than or equal to the largest acknowledged in the sent packets less than or equal to the largest acknowledged in the sent
skipping to change at page 77, line 5 skipping to change at page 80, line 30
containing them is lost. containing them is lost.
o NEW_TOKEN frames are retransmitted if the packet containing them o NEW_TOKEN frames are retransmitted if the packet containing them
is lost. No special support is made for detecting reordered and is lost. No special support is made for detecting reordered and
duplicated NEW_TOKEN frames other than a direct comparison of the duplicated NEW_TOKEN frames other than a direct comparison of the
frame contents. frame contents.
o PING and PADDING frames contain no information, so lost PING or o PING and PADDING frames contain no information, so lost PING or
PADDING frames do not require repair. PADDING frames do not require repair.
o The HANDSHAKE_DONE frame MUST be retransmitted until it is
acknowledged.
Endpoints SHOULD prioritize retransmission of data over sending new Endpoints SHOULD prioritize retransmission of data over sending new
data, unless priorities specified by the application indicate data, unless priorities specified by the application indicate
otherwise (see Section 2.3). otherwise (see Section 2.3).
Even though a sender is encouraged to assemble frames containing up- Even though a sender is encouraged to assemble frames containing up-
to-date information every time it sends a packet, it is not forbidden to-date information every time it sends a packet, it is not forbidden
to retransmit copies of frames from lost packets. A receiver MUST to retransmit copies of frames from lost packets. A receiver MUST
accept packets containing an outdated frame, such as a MAX_DATA frame accept packets containing an outdated frame, such as a MAX_DATA frame
carrying a smaller maximum data than one found in an older packet. carrying a smaller maximum data than one found in an older packet.
skipping to change at page 80, line 19 skipping to change at page 83, line 45
at any point in the connection. at any point in the connection.
Even if validation fails, an endpoint MAY revalidate ECN on the same Even if validation fails, an endpoint MAY revalidate ECN on the same
path at any later time in the connection. path at any later time in the connection.
14. Packet Size 14. Packet Size
The QUIC packet size includes the QUIC header and protected payload, The QUIC packet size includes the QUIC header and protected payload,
but not the UDP or IP header. but not the UDP or IP header.
Clients MUST ensure they send the first Initial packet in a single IP A client MUST expand the payload of all UDP datagrams carrying
packet. Similarly, the first Initial packet sent after receiving a Initial packets to at least 1200 bytes, by adding PADDING frames to
Retry packet MUST be sent in a single IP packet. the Initial packet or by coalescing the Initial packet (see
The payload of a UDP datagram carrying the first Initial packet MUST
be expanded to at least 1200 bytes, by adding PADDING frames to the
Initial packet and/or by coalescing the Initial packet (see
Section 12.2). Sending a UDP datagram of this size ensures that the Section 12.2). Sending a UDP datagram of this size ensures that the
network path supports a reasonable Maximum Transmission Unit (MTU), network path from the client to the server supports a reasonable
and helps reduce the amplitude of amplification attacks caused by Maximum Transmission Unit (MTU). Padding datagrams also helps reduce
server responses toward an unverified client address; see Section 8. the amplitude of amplification attacks caused by server responses
toward an unverified client address; see Section 8.
The datagram containing the first Initial packet from a client MAY Datagrams containing Initial packets MAY exceed 1200 bytes if the
exceed 1200 bytes if the client believes that the Path Maximum client believes that the Path Maximum Transmission Unit (PMTU)
Transmission Unit (PMTU) supports the size that it chooses. supports the size that it chooses.
UDP datagrams MUST NOT be fragmented at the IP layer. In IPv4
[IPv4], the DF bit MUST be set to prevent fragmentation on the path.
A server MAY send a CONNECTION_CLOSE frame with error code A server MAY send a CONNECTION_CLOSE frame with error code
PROTOCOL_VIOLATION in response to the first Initial packet it PROTOCOL_VIOLATION in response to an Initial packet it receives from
receives from a client if the UDP datagram is smaller than 1200 a client if the UDP datagram is smaller than 1200 bytes. It MUST NOT
bytes. It MUST NOT send any other frame type in response, or send any other frame type in response, or otherwise behave as if any
otherwise behave as if any part of the offending packet was processed part of the offending packet was processed as valid.
as valid.
The server MUST also limit the number of bytes it sends before The server MUST also limit the number of bytes it sends before
validating the address of the client; see Section 8. validating the address of the client; see Section 8.
14.1. Path Maximum Transmission Unit (PMTU) 14.1. Path Maximum Transmission Unit (PMTU)
The PMTU is the maximum size of the entire IP packet including the IP The PMTU is the maximum size of the entire IP packet including the IP
header, UDP header, and UDP payload. The UDP payload includes the header, UDP header, and UDP payload. The UDP payload includes the
QUIC packet header, protected payload, and any authentication fields. QUIC packet header, protected payload, and any authentication fields.
The PMTU can depend upon the current path characteristics. The PMTU can depend upon the current path characteristics.
skipping to change at page 83, line 49 skipping to change at page 87, line 30
Versions with the most significant 16 bits of the version number Versions with the most significant 16 bits of the version number
cleared are reserved for use in future IETF consensus documents. cleared are reserved for use in future IETF consensus documents.
Versions that follow the pattern 0x?a?a?a?a are reserved for use in Versions that follow the pattern 0x?a?a?a?a are reserved for use in
forcing version negotiation to be exercised. That is, any version forcing version negotiation to be exercised. That is, any version
number where the low four bits of all bytes is 1010 (in binary). A number where the low four bits of all bytes is 1010 (in binary). A
client or server MAY advertise support for any of these reserved client or server MAY advertise support for any of these reserved
versions. versions.
Reserved version numbers will probably never represent a real Reserved version numbers will never represent a real protocol; a
protocol; a client MAY use one of these version numbers with the client MAY use one of these version numbers with the expectation that
expectation that the server will initiate version negotiation; a the server will initiate version negotiation; a server MAY advertise
server MAY advertise support for one of these versions and can expect support for one of these versions and can expect that clients ignore
that clients ignore the value. the value.
[[RFC editor: please remove the remainder of this section before [[RFC editor: please remove the remainder of this section before
publication.]] publication.]]
The version number for the final version of this specification The version number for the final version of this specification
(0x00000001), is reserved for the version of the protocol that is (0x00000001), is reserved for the version of the protocol that is
published as an RFC. published as an RFC.
Version numbers used to identify IETF drafts are created by adding Version numbers used to identify IETF drafts are created by adding
the draft number to 0xff000000. For example, draft-ietf-quic- the draft number to 0xff000000. For example, draft-ietf-quic-
skipping to change at page 92, line 18 skipping to change at page 95, line 41
message needs to be created, such as the packets sent after receiving message needs to be created, such as the packets sent after receiving
a Retry packet (Section 17.2.5). a Retry packet (Section 17.2.5).
A server sends its first Initial packet in response to a client A server sends its first Initial packet in response to a client
Initial. A server may send multiple Initial packets. The Initial. A server may send multiple Initial packets. The
cryptographic key exchange could require multiple round trips or cryptographic key exchange could require multiple round trips or
retransmissions of this data. retransmissions of this data.
The payload of an Initial packet includes a CRYPTO frame (or frames) The payload of an Initial packet includes a CRYPTO frame (or frames)
containing a cryptographic handshake message, ACK frames, or both. containing a cryptographic handshake message, ACK frames, or both.
PADDING and CONNECTION_CLOSE frames are also permitted. An endpoint PING, PADDING, and CONNECTION_CLOSE frames are also permitted. An
that receives an Initial packet containing other frames can either endpoint that receives an Initial packet containing other frames can
discard the packet as spurious or treat it as a connection error. either discard the packet as spurious or treat it as a connection
error.
The first packet sent by a client always includes a CRYPTO frame that The first packet sent by a client always includes a CRYPTO frame that
contains the start or all of the first cryptographic handshake contains the start or all of the first cryptographic handshake
message. The first CRYPTO frame sent always begins at an offset of 0 message. The first CRYPTO frame sent always begins at an offset of 0
(see Section 7). (see Section 7).
Note that if the server sends a HelloRetryRequest, the client will Note that if the server sends a HelloRetryRequest, the client will
send another series of Initial packets. These Initial packets will send another series of Initial packets. These Initial packets will
continue the cryptographic handshake and will contain CRYPTO frames continue the cryptographic handshake and will contain CRYPTO frames
starting at an offset matching the size of the CRYPTO frames sent in starting at an offset matching the size of the CRYPTO frames sent in
the first flight of Initial packets. the first flight of Initial packets.
17.2.2.1. Abandoning Initial Packets 17.2.2.1. Abandoning Initial Packets
A client stops both sending and processing Initial packets when it A client stops both sending and processing Initial packets when it
sends its first Handshake packet. A server stops sending and sends its first Handshake packet. A server stops sending and
processing Initial packets when it receives its first Handshake processing Initial packets when it receives its first Handshake
packet. Though packets might still be in flight or awaiting packet. Though packets might still be in flight or awaiting
acknowledgment, no further Initial packets need to be exchanged acknowledgment, no further Initial packets need to be exchanged
beyond this point. Initial packet protection keys are discarded (see beyond this point. Initial packet protection keys are discarded (see
Section 4.9.1 of [QUIC-TLS]) along with any loss recovery and Section 4.10.1 of [QUIC-TLS]) along with any loss recovery and
congestion control state (see Section 6.5 of [QUIC-RECOVERY]). congestion control state (see Section 6.5 of [QUIC-RECOVERY]).
Any data in CRYPTO frames is discarded - and no longer retransmitted Any data in CRYPTO frames is discarded - and no longer retransmitted
- when Initial keys are discarded. - when Initial keys are discarded.
17.2.3. 0-RTT 17.2.3. 0-RTT
A 0-RTT packet uses long headers with a type value of 0x1, followed A 0-RTT packet uses long headers with a type value of 0x1, followed
by the Length and Packet Number fields. The first byte contains the by the Length and Packet Number fields. The first byte contains the
Reserved and Packet Number Length bits. It is used to carry "early" Reserved and Packet Number Length bits. It is used to carry "early"
skipping to change at page 95, line 15 skipping to change at page 99, line 10
The Destination Connection ID field in a Handshake packet contains a The Destination Connection ID field in a Handshake packet contains a
connection ID that is chosen by the recipient of the packet; the connection ID that is chosen by the recipient of the packet; the
Source Connection ID includes the connection ID that the sender of Source Connection ID includes the connection ID that the sender of
the packet wishes to use (see Section 7.2). the packet wishes to use (see Section 7.2).
Handshake packets are their own packet number space, and thus the Handshake packets are their own packet number space, and thus the
first Handshake packet sent by a server contains a packet number of first Handshake packet sent by a server contains a packet number of
0. 0.
The payload of this packet contains CRYPTO frames and could contain The payload of this packet contains CRYPTO frames and could contain
PADDING, or ACK frames. Handshake packets MAY contain PING, PADDING, or ACK frames. Handshake packets MAY contain
CONNECTION_CLOSE frames. Endpoints MUST treat receipt of Handshake CONNECTION_CLOSE frames. Endpoints MUST treat receipt of Handshake
packets with other frames as a connection error. packets with other frames as a connection error.
Like Initial packets (see Section 17.2.2.1), data in CRYPTO frames at Like Initial packets (see Section 17.2.2.1), data in CRYPTO frames at
the Handshake encryption level is discarded - and no longer the Handshake encryption level is discarded - and no longer
retransmitted - when Handshake protection keys are discarded. retransmitted - when Handshake protection keys are discarded.
17.2.5. Retry Packet 17.2.5. Retry Packet
A Retry packet uses a long packet header with a type value of 0x3. A Retry packet uses a long packet header with a type value of 0x3.
skipping to change at page 95, line 44 skipping to change at page 99, line 39
| Version (32) | | Version (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| DCID Len (8) | | DCID Len (8) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination Connection ID (0..160) ... | Destination Connection ID (0..160) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SCID Len (8) | | SCID Len (8) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Connection ID (0..160) ... | Source Connection ID (0..160) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ODCID Len (8) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Original Destination Connection ID (0..160) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Retry Token (*) ... | Retry Token (*) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Retry Integrity Tag (128) +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 13: Retry Packet Figure 13: Retry Packet
A Retry packet (shown in Figure 13) does not contain any protected A Retry packet (shown in Figure 13) does not contain any protected
fields. The value in the Unused field is selected randomly by the fields. The value in the Unused field is selected randomly by the
server. In addition to the long header, it contains these additional server. In addition to the long header, it contains these additional
fields: fields:
ODCID Len: The ODCID Len contains the length in bytes of the
Original Destination Connection ID field that follows it. This
length is encoded as a 8-bit unsigned integer. In QUIC version 1,
this value MUST NOT exceed 20 bytes. Clients that receive a
version 1 Retry Packet with a value larger than 20 MUST drop the
packet.
Original Destination Connection ID: The Original Destination
Connection ID contains the value of the Destination Connection ID
from the Initial packet that this Retry is in response to. The
length of this field is given in ODCID Len.
Retry Token: An opaque token that the server can use to validate the Retry Token: An opaque token that the server can use to validate the
client's address. client's address.
Retry Integrity Tag: See the Retry Packet Integrity section of
[QUIC-TLS].
The server populates the Destination Connection ID with the The server populates the Destination Connection ID with the
connection ID that the client included in the Source Connection ID of connection ID that the client included in the Source Connection ID of
the Initial packet. the Initial packet.
The server includes a connection ID of its choice in the Source The server includes a connection ID of its choice in the Source
Connection ID field. This value MUST not be equal to the Destination Connection ID field. This value MUST not be equal to the Destination
Connection ID field of the packet sent by the client. A client MUST Connection ID field of the packet sent by the client. A client MUST
discard a Retry packet that contains a Source Connection ID field discard a Retry packet that contains a Source Connection ID field
that is identical to the Destination Connection ID field of its that is identical to the Destination Connection ID field of its
Initial packet. The client MUST use the value from the Source Initial packet. The client MUST use the value from the Source
skipping to change at page 96, line 49 skipping to change at page 100, line 40
packets. A server can either discard or buffer 0-RTT packets that it packets. A server can either discard or buffer 0-RTT packets that it
receives. A server can send multiple Retry packets as it receives receives. A server can send multiple Retry packets as it receives
Initial or 0-RTT packets. A server MUST NOT send more than one Retry Initial or 0-RTT packets. A server MUST NOT send more than one Retry
packet in response to a single UDP datagram. packet in response to a single UDP datagram.
A client MUST accept and process at most one Retry packet for each A client MUST accept and process at most one Retry packet for each
connection attempt. After the client has received and processed an connection attempt. After the client has received and processed an
Initial or Retry packet from the server, it MUST discard any Initial or Retry packet from the server, it MUST discard any
subsequent Retry packets that it receives. subsequent Retry packets that it receives.
Clients MUST discard Retry packets that contain an Original Clients MUST discard Retry packets that have a Retry Integrity Tag
Destination Connection ID field that does not match the Destination that cannot be validated, see the Retry Packet Integrity section of
Connection ID from its Initial packet. This prevents an off-path [QUIC-TLS]. This diminishes an off-path attacker's ability to inject
attacker from injecting a Retry packet. a Retry packet and protects against accidental corruption of Retry
packets. A client MUST discard a Retry packet with a zero-length
Retry Token field.
The client responds to a Retry packet with an Initial packet that The client responds to a Retry packet with an Initial packet that
includes the provided Retry Token to continue connection includes the provided Retry Token to continue connection
establishment. establishment.
A client sets the Destination Connection ID field of this Initial A client sets the Destination Connection ID field of this Initial
packet to the value from the Source Connection ID in the Retry packet to the value from the Source Connection ID in the Retry
packet. Changing Destination Connection ID also results in a change packet. Changing Destination Connection ID also results in a change
to the keys used to protect the Initial packet. It also sets the to the keys used to protect the Initial packet. It also sets the
Token field to the token provided in the Retry. The client MUST NOT Token field to the token provided in the Retry. The client MUST NOT
change the Source Connection ID because the server could include the change the Source Connection ID because the server could include the
connection ID as part of its token validation logic (see connection ID as part of its token validation logic (see
Section 8.1.3). Section 8.1.4).
The next Initial packet from the client uses the connection ID and The next Initial packet from the client uses the connection ID and
token values from the Retry packet (see Section 7.2). Aside from token values from the Retry packet (see Section 7.2). Aside from
this, the Initial packet sent by the client is subject to the same this, the Initial packet sent by the client is subject to the same
restrictions as the first Initial packet. A client MUST use the same restrictions as the first Initial packet. A client MUST use the same
cryptographic handshake message it includes in this packet. A server cryptographic handshake message it includes in this packet. A server
MAY treat a packet that contains a different cryptographic handshake MAY treat a packet that contains a different cryptographic handshake
message as a connection error or discard it. message as a connection error or discard it.
A client MAY attempt 0-RTT after receiving a Retry packet by sending A client MAY attempt 0-RTT after receiving a Retry packet by sending
skipping to change at page 97, line 38 skipping to change at page 101, line 31
MUST NOT change the cryptographic handshake message it sends in MUST NOT change the cryptographic handshake message it sends in
response to receiving a Retry. response to receiving a Retry.
A client MUST NOT reset the packet number for any packet number space A client MUST NOT reset the packet number for any packet number space
after processing a Retry packet; Section 17.2.3 contains more after processing a Retry packet; Section 17.2.3 contains more
information on this. information on this.
A server acknowledges the use of a Retry packet for a connection A server acknowledges the use of a Retry packet for a connection
using the original_connection_id transport parameter (see using the original_connection_id transport parameter (see
Section 18.2). If the server sends a Retry packet, it MUST include Section 18.2). If the server sends a Retry packet, it MUST include
the value of the Original Destination Connection ID field of the the Destination Connection ID field from the client's first Initial
Retry packet (that is, the Destination Connection ID field from the packet in the transport parameter.
client's first Initial packet) in the transport parameter.
If the client received and processed a Retry packet, it MUST validate If the client received and processed a Retry packet, it MUST validate
that the original_connection_id transport parameter is present and that the original_connection_id transport parameter is present and
correct; otherwise, it MUST validate that the transport parameter is correct; otherwise, it MUST validate that the transport parameter is
absent. A client MUST treat a failed validation as a connection absent. A client MUST treat a failed validation as a connection
error of type TRANSPORT_PARAMETER_ERROR. error of type TRANSPORT_PARAMETER_ERROR.
A Retry packet does not include a packet number and cannot be A Retry packet does not include a packet number and cannot be
explicitly acknowledged by a client. explicitly acknowledged by a client.
skipping to change at page 99, line 50 skipping to change at page 103, line 45
in [QUIC-MANAGEABILITY]. in [QUIC-MANAGEABILITY].
The spin bit is an OPTIONAL feature of QUIC. A QUIC stack that The spin bit is an OPTIONAL feature of QUIC. A QUIC stack that
chooses to support the spin bit MUST implement it as specified in chooses to support the spin bit MUST implement it as specified in
this section. this section.
Each endpoint unilaterally decides if the spin bit is enabled or Each endpoint unilaterally decides if the spin bit is enabled or
disabled for a connection. Implementations MUST allow administrators disabled for a connection. Implementations MUST allow administrators
of clients and servers to disable the spin bit either globally or on of clients and servers to disable the spin bit either globally or on
a per-connection basis. Even when the spin bit is not disabled by a per-connection basis. Even when the spin bit is not disabled by
the administrator, implementations MUST disable the spin bit for a the administrator, endpoints MUST disable their use of the spin bit
given connection with a certain likelihood. The random selection for a random selection of at least one in every 16 network paths, or
process SHOULD be designed such that on average the spin bit is for one in every 16 connection IDs. As each endpoint disables the
disabled for at least one eighth of network paths. The selection spin bit independently, this ensures that the spin bit signal is
process performed at the beginning of the connection SHOULD be disabled on approximately one in eight network paths.
applied for all paths used by the connection.
When the spin bit is disabled, endpoints MAY set the spin bit to any When the spin bit is disabled, endpoints MAY set the spin bit to any
value, and MUST ignore any incoming value. It is RECOMMENDED that value, and MUST ignore any incoming value. It is RECOMMENDED that
endpoints set the spin bit to a random value either chosen endpoints set the spin bit to a random value either chosen
independently for each packet or chosen independently for each independently for each packet or chosen independently for each
connection ID. connection ID.
If the spin bit is enabled for the connection, the endpoint maintains If the spin bit is enabled for the connection, the endpoint maintains
a spin value and sets the spin bit in the short header to the a spin value and sets the spin bit in the short header to the
currently stored value when a packet with a short header is sent out. currently stored value when a packet with a short header is sent out.
skipping to change at page 105, line 39 skipping to change at page 109, line 39
+ Stateless Reset Token (128) + + Stateless Reset Token (128) +
| | | |
+ + + +
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 17: Preferred Address format Figure 17: Preferred Address format
active_connection_id_limit (0x000e): The maximum number of active_connection_id_limit (0x000e): The maximum number of
connection IDs from the peer that an endpoint is willing to store. connection IDs from the peer that an endpoint is willing to store.
This value includes only connection IDs sent in NEW_CONNECTION_ID This value includes the connection ID received during the
frames. If this parameter is absent, a default of 0 is assumed. handshake, that received in the preferred_address transport
parameter, and those received in NEW_CONNECTION_ID frames. Unless
a zero-length connection ID is being used, the value of the
active_connection_id_limit parameter MUST be no less than 2. If
this transport parameter is absent, a default of 2 is assumed.
When a zero-length connection ID is being used, the
active_connection_id_limit parameter MUST NOT be sent.
If present, transport parameters that set initial flow control limits If present, transport parameters that set initial flow control limits
(initial_max_stream_data_bidi_local, (initial_max_stream_data_bidi_local,
initial_max_stream_data_bidi_remote, and initial_max_stream_data_uni) initial_max_stream_data_bidi_remote, and initial_max_stream_data_uni)
are equivalent to sending a MAX_STREAM_DATA frame (Section 19.10) on are equivalent to sending a MAX_STREAM_DATA frame (Section 19.10) on
every stream of the corresponding type immediately after opening. If every stream of the corresponding type immediately after opening. If
the transport parameter is absent, streams of that type start with a the transport parameter is absent, streams of that type start with a
flow control limit of 0. flow control limit of 0.
A client MUST NOT include server-only transport parameters A client MUST NOT include server-only transport parameters
skipping to change at page 107, line 20 skipping to change at page 111, line 22
the frame type is 0x03, ACK frames also contain the sum of QUIC the frame type is 0x03, ACK frames also contain the sum of QUIC
packets with associated ECN marks received on the connection up until packets with associated ECN marks received on the connection up until
this point. QUIC implementations MUST properly handle both types this point. QUIC implementations MUST properly handle both types
and, if they have enabled ECN for packets they send, they SHOULD use and, if they have enabled ECN for packets they send, they SHOULD use
the information in the ECN section to manage their congestion state. the information in the ECN section to manage their congestion state.
QUIC acknowledgements are irrevocable. Once acknowledged, a packet QUIC acknowledgements are irrevocable. Once acknowledged, a packet
remains acknowledged, even if it does not appear in a future ACK remains acknowledged, even if it does not appear in a future ACK
frame. This is unlike TCP SACKs ([RFC2018]). frame. This is unlike TCP SACKs ([RFC2018]).
It is expected that a sender will reuse the same packet number across Packets from different packet number spaces can be identified using
different packet number spaces. ACK frames only acknowledge the the same numeric value. An acknowledgment for a packet needs to
packet numbers that were transmitted by the sender in the same packet indicate both a packet number and a packet number space. This is
number space of the packet that the ACK was received in. accomplished by having each ACK frame only acknowledge packet numbers
in the same space as the packet in which the ACK frame is contained.
Version Negotiation and Retry packets cannot be acknowledged because Version Negotiation and Retry packets cannot be acknowledged because
they do not contain a packet number. Rather than relying on ACK they do not contain a packet number. Rather than relying on ACK
frames, these packets are implicitly acknowledged by the next Initial frames, these packets are implicitly acknowledged by the next Initial
packet sent by the client. packet sent by the client.
An ACK frame is as follows: An ACK frame is shown in Figure 18.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Largest Acknowledged (i) ... | Largest Acknowledged (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ACK Delay (i) ... | ACK Delay (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ACK Range Count (i) ... | ACK Range Count (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
skipping to change at page 108, line 47 skipping to change at page 112, line 49
ECN Counts: The three ECN Counts; see Section 19.3.2. ECN Counts: The three ECN Counts; see Section 19.3.2.
19.3.1. ACK Ranges 19.3.1. ACK Ranges
The ACK Ranges field consists of alternating Gap and ACK Range values The ACK Ranges field consists of alternating Gap and ACK Range values
in descending packet number order. The number of Gap and ACK Range in descending packet number order. The number of Gap and ACK Range
values is determined by the ACK Range Count field; one of each value values is determined by the ACK Range Count field; one of each value
is present for each value in the ACK Range Count field. is present for each value in the ACK Range Count field.
ACK Ranges are structured as follows: ACK Ranges are structured as shown in Figure 19.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| [Gap (i)] ... | [Gap (i)] ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| [ACK Range (i)] ... | [ACK Range (i)] ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| [Gap (i)] ... | [Gap (i)] ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
skipping to change at page 110, line 28 skipping to change at page 114, line 28
a connection error of type FRAME_ENCODING_ERROR. a connection error of type FRAME_ENCODING_ERROR.
19.3.2. ECN Counts 19.3.2. ECN Counts
The ACK frame uses the least significant bit (that is, type 0x03) to The ACK frame uses the least significant bit (that is, type 0x03) to
indicate ECN feedback and report receipt of QUIC packets with indicate ECN feedback and report receipt of QUIC packets with
associated ECN codepoints of ECT(0), ECT(1), or CE in the packet's IP associated ECN codepoints of ECT(0), ECT(1), or CE in the packet's IP
header. ECN Counts are only present when the ACK frame type is 0x03. header. ECN Counts are only present when the ACK frame type is 0x03.
ECN Counts are only parsed when the ACK frame type is 0x03. There ECN Counts are only parsed when the ACK frame type is 0x03. There
are 3 ECN counts, as follows: are 3 ECN counts, as shown in Figure 20.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ECT(0) Count (i) ... | ECT(0) Count (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ECT(1) Count (i) ... | ECT(1) Count (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ECN-CE Count (i) ... | ECN-CE Count (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 20: ECN Count Format
The three ECN Counts are: The three ECN Counts are:
ECT(0) Count: A variable-length integer representing the total ECT(0) Count: A variable-length integer representing the total
number of packets received with the ECT(0) codepoint in the packet number of packets received with the ECT(0) codepoint in the packet
number space of the ACK frame. number space of the ACK frame.
ECT(1) Count: A variable-length integer representing the total ECT(1) Count: A variable-length integer representing the total
number of packets received with the ECT(1) codepoint in the packet number of packets received with the ECT(1) codepoint in the packet
number space of the ACK frame. number space of the ACK frame.
skipping to change at page 111, line 20 skipping to change at page 115, line 24
terminate the sending part of a stream. terminate the sending part of a stream.
After sending a RESET_STREAM, an endpoint ceases transmission and After sending a RESET_STREAM, an endpoint ceases transmission and
retransmission of STREAM frames on the identified stream. A receiver retransmission of STREAM frames on the identified stream. A receiver
of RESET_STREAM can discard any data that it already received on that of RESET_STREAM can discard any data that it already received on that
stream. stream.
An endpoint that receives a RESET_STREAM frame for a send-only stream An endpoint that receives a RESET_STREAM frame for a send-only stream
MUST terminate the connection with error STREAM_STATE_ERROR. MUST terminate the connection with error STREAM_STATE_ERROR.
The RESET_STREAM frame is as follows: The RESET_STREAM frame is shown in Figure 21.
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 (i) ... | Stream ID (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Application Error Code (i) ... | Application Error Code (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Final Size (i) ... | Final Size (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 21: RESET_STREAM Frame Format
RESET_STREAM frames contain the following fields: RESET_STREAM frames contain the following fields:
Stream ID: A variable-length integer encoding of the Stream ID of Stream ID: A variable-length integer encoding of the Stream ID of
the stream being terminated. the stream being terminated.
Application Protocol Error Code: A variable-length integer Application Protocol Error Code: A variable-length integer
containing the application protocol error code (see Section 20.1) containing the application protocol error code (see Section 20.1)
which indicates why the stream is being closed. which indicates why the stream is being closed.
Final Size: A variable-length integer indicating the final size of Final Size: A variable-length integer indicating the final size of
skipping to change at page 112, line 8 skipping to change at page 116, line 18
incoming data is being discarded on receipt at application request. incoming data is being discarded on receipt at application request.
STOP_SENDING requests that a peer cease transmission on a stream. STOP_SENDING requests that a peer cease transmission on a stream.
A STOP_SENDING frame can be sent for streams in the Recv or Size A STOP_SENDING frame can be sent for streams in the Recv or Size
Known states (see Section 3.1). Receiving a STOP_SENDING frame for a Known states (see Section 3.1). Receiving a STOP_SENDING frame for a
locally-initiated stream that has not yet been created MUST be locally-initiated stream that has not yet been created MUST be
treated as a connection error of type STREAM_STATE_ERROR. An treated as a connection error of type STREAM_STATE_ERROR. An
endpoint that receives a STOP_SENDING frame for a receive-only stream endpoint that receives a STOP_SENDING frame for a receive-only stream
MUST terminate the connection with error STREAM_STATE_ERROR. MUST terminate the connection with error STREAM_STATE_ERROR.
The STOP_SENDING frame is as follows: The STOP_SENDING frame is shown in Figure 22.
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 (i) ... | Stream ID (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Application Error Code (i) ... | Application Error Code (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 22: STOP_SENDING Frame Format
STOP_SENDING frames contain the following fields: STOP_SENDING frames contain the following fields:
Stream ID: A variable-length integer carrying the Stream ID of the Stream ID: A variable-length integer carrying the Stream ID of the
stream being ignored. stream being ignored.
Application Error Code: A variable-length integer containing the Application Error Code: A variable-length integer containing the
application-specified reason the sender is ignoring the stream application-specified reason the sender is ignoring the stream
(see Section 20.1). (see Section 20.1).
19.6. CRYPTO Frame 19.6. CRYPTO Frame
The CRYPTO frame (type=0x06) is used to transmit cryptographic The CRYPTO frame (type=0x06) is used to transmit cryptographic
handshake messages. It can be sent in all packet types except 0-RTT. handshake messages. It can be sent in all packet types except 0-RTT.
The CRYPTO frame offers the cryptographic protocol an in-order stream The CRYPTO frame offers the cryptographic protocol an in-order stream
of bytes. CRYPTO frames are functionally identical to STREAM frames, of bytes. CRYPTO frames are functionally identical to STREAM frames,
except that they do not bear a stream identifier; they are not flow except that they do not bear a stream identifier; they are not flow
controlled; and they do not carry markers for optional offset, controlled; and they do not carry markers for optional offset,
optional length, and the end of the stream. optional length, and the end of the stream.
The CRYPTO frame is as follows: The CRYPTO frame is shown in Figure 23.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Offset (i) ... | Offset (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Length (i) ... | Length (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Crypto Data (*) ... | Crypto Data (*) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 20: CRYPTO Frame Format Figure 23: CRYPTO Frame Format
CRYPTO frames contain the following fields: CRYPTO frames contain the following fields:
Offset: A variable-length integer specifying the byte offset in the Offset: A variable-length integer specifying the byte offset in the
stream for the data in this CRYPTO frame. stream for the data in this CRYPTO frame.
Length: A variable-length integer specifying the length of the Length: A variable-length integer specifying the length of the
Crypto Data field in this CRYPTO frame. Crypto Data field in this CRYPTO frame.
Crypto Data: The cryptographic message data. Crypto Data: The cryptographic message data.
There is a separate flow of cryptographic handshake data in each There is a separate flow of cryptographic handshake data in each
encryption level, each of which starts at an offset of 0. This encryption level, each of which starts at an offset of 0. This
implies that each encryption level is treated as a separate CRYPTO implies that each encryption level is treated as a separate CRYPTO
stream of data. stream of data.
The largest offset delivered on a stream - the sum of the offset and The largest offset delivered on a stream - the sum of the offset and
data length - cannot exceed 2^62-1. Receipt of a frame that exceeds data length - cannot exceed 2^62-1. Receipt of a frame that exceeds
this limit MUST be treated as a connection error of type this limit MUST be treated as a connection error of type
FRAME_ENCODING_ERROR. FRAME_ENCODING_ERROR or CRYPTO_BUFFER_EXCEEDED.
Unlike STREAM frames, which include a Stream ID indicating to which Unlike STREAM frames, which include a Stream ID indicating to which
stream the data belongs, the CRYPTO frame carries data for a single stream the data belongs, the CRYPTO frame carries data for a single
stream per encryption level. The stream does not have an explicit stream per encryption level. The stream does not have an explicit
end, so CRYPTO frames do not have a FIN bit. end, so CRYPTO frames do not have a FIN bit.
19.7. NEW_TOKEN Frame 19.7. NEW_TOKEN Frame
A server sends a NEW_TOKEN frame (type=0x07) to provide the client A server sends a NEW_TOKEN frame (type=0x07) to provide the client
with a token to send in the header of an Initial packet for a future with a token to send in the header of an Initial packet for a future
connection. connection.
The NEW_TOKEN frame is as follows: The NEW_TOKEN frame is shown in Figure 24.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Token Length (i) ... | Token Length (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Token (*) ... | Token (*) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 24: NEW_TOKEN Frame Format
NEW_TOKEN frames contain the following fields: NEW_TOKEN frames contain the following fields:
Token Length: A variable-length integer specifying the length of the Token Length: A variable-length integer specifying the length of the
token in bytes. token in bytes.
Token: An opaque blob that the client may use with a future Initial Token: An opaque blob that the client may use with a future Initial
packet. The token MUST NOT be empty. An endpoint MUST treat packet. The token MUST NOT be empty. An endpoint MUST treat
receipt of a NEW_TOKEN frame with an empty Token field as a receipt of a NEW_TOKEN frame with an empty Token field as a
connection error of type FRAME_ENCODING_ERROR. connection error of type FRAME_ENCODING_ERROR.
An endpoint might receive multiple NEW_TOKEN frames that contain the An endpoint might receive multiple NEW_TOKEN frames that contain the
same token value. Endpoints are responsible for discarding duplicate same token value if packets containing the frame are incorrectly
values, which might be used to link connection attempts; see determined to be lost. Endpoints are responsible for discarding
Section 8.1.2. duplicate values, which might be used to link connection attempts;
see Section 8.1.3.
Clients MUST NOT send NEW_TOKEN frames. Servers MUST treat receipt Clients MUST NOT send NEW_TOKEN frames. Servers MUST treat receipt
of a NEW_TOKEN frame as a connection error of type of a NEW_TOKEN frame as a connection error of type
PROTOCOL_VIOLATION. PROTOCOL_VIOLATION.
19.8. STREAM Frames 19.8. STREAM Frames
STREAM frames implicitly create a stream and carry stream data. The STREAM frames implicitly create a stream and carry stream data. The
STREAM frame takes the form 0b00001XXX (or the set of values from STREAM frame takes the form 0b00001XXX (or the set of values from
0x08 to 0x0f). The value of the three low-order bits of the frame 0x08 to 0x0f). The value of the three low-order bits of the frame
skipping to change at page 114, line 40 skipping to change at page 119, line 12
field is absent and the Stream Data field extends to the end of field is absent and the Stream Data field extends to the end of
the packet. If this bit is set to 1, the Length field is present. the packet. If this bit is set to 1, the Length field is present.
o The FIN bit (0x01) of the frame type is set only on frames that o The FIN bit (0x01) of the frame type is set only on frames that
contain the final size of the stream. Setting this bit indicates contain the final size of the stream. Setting this bit indicates
that the frame marks the end of the stream. that the frame marks the end of the stream.
An endpoint that receives a STREAM frame for a send-only stream MUST An endpoint that receives a STREAM frame for a send-only stream MUST
terminate the connection with error STREAM_STATE_ERROR. terminate the connection with error STREAM_STATE_ERROR.
The STREAM frames are as follows: The STREAM frames are shown in Figure 25.
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 (i) ... | Stream ID (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| [Offset (i)] ... | [Offset (i)] ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| [Length (i)] ... | [Length (i)] ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Stream Data (*) ... | Stream Data (*) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 21: STREAM Frame Format Figure 25: STREAM Frame Format
STREAM frames contain the following fields: STREAM frames contain the following fields:
Stream ID: A variable-length integer indicating the stream ID of the Stream ID: A variable-length integer indicating the stream ID of the
stream (see Section 2.1). stream (see Section 2.1).
Offset: A variable-length integer specifying the byte offset in the Offset: A variable-length integer specifying the byte offset in the
stream for the data in this STREAM frame. This field is present stream for the data in this STREAM frame. This field is present
when the OFF bit is set to 1. When the Offset field is absent, when the OFF bit is set to 1. When the Offset field is absent,
the offset is 0. the offset is 0.
skipping to change at page 115, line 52 skipping to change at page 120, line 13
credit for that data. Receipt of a frame that exceeds this limit credit for that data. Receipt of a frame that exceeds this limit
MUST be treated as a connection error of type FRAME_ENCODING_ERROR or MUST be treated as a connection error of type FRAME_ENCODING_ERROR or
FLOW_CONTROL_ERROR. FLOW_CONTROL_ERROR.
19.9. MAX_DATA Frame 19.9. MAX_DATA Frame
The MAX_DATA frame (type=0x10) is used in flow control to inform the The MAX_DATA frame (type=0x10) is used in flow control to inform the
peer of the maximum amount of data that can be sent on the connection peer of the maximum amount of data that can be sent on the connection
as a whole. as a whole.
The MAX_DATA frame is as follows: The MAX_DATA frame is shown in Figure 26.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Maximum Data (i) ... | Maximum Data (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 26: MAX_DATA Frame Format
MAX_DATA frames contain the following fields: MAX_DATA frames contain the following fields:
Maximum Data: A variable-length integer indicating the maximum Maximum Data: A variable-length integer indicating the maximum
amount of data that can be sent on the entire connection, in units amount of data that can be sent on the entire connection, in units
of bytes. of bytes.
All data sent in STREAM frames counts toward this limit. The sum of All data sent in STREAM frames counts toward this limit. The sum of
the largest received offsets on all streams - including streams in the largest received offsets on all streams - including streams in
terminal states - MUST NOT exceed the value advertised by a receiver. terminal states - MUST NOT exceed the value advertised by a receiver.
An endpoint MUST terminate a connection with a FLOW_CONTROL_ERROR An endpoint MUST terminate a connection with a FLOW_CONTROL_ERROR
skipping to change at page 116, line 38 skipping to change at page 120, line 50
inform a peer of the maximum amount of data that can be sent on a inform a peer of the maximum amount of data that can be sent on a
stream. stream.
A MAX_STREAM_DATA frame can be sent for streams in the Recv state A MAX_STREAM_DATA frame can be sent for streams in the Recv state
(see Section 3.1). Receiving a MAX_STREAM_DATA frame for a locally- (see Section 3.1). Receiving a MAX_STREAM_DATA frame for a locally-
initiated stream that has not yet been created MUST be treated as a initiated stream that has not yet been created MUST be treated as a
connection error of type STREAM_STATE_ERROR. An endpoint that connection error of type STREAM_STATE_ERROR. An endpoint that
receives a MAX_STREAM_DATA frame for a receive-only stream MUST receives a MAX_STREAM_DATA frame for a receive-only stream MUST
terminate the connection with error STREAM_STATE_ERROR. terminate the connection with error STREAM_STATE_ERROR.
The MAX_STREAM_DATA frame is as follows: The MAX_STREAM_DATA frame is shown in Figure 27.
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 (i) ... | Stream ID (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Maximum Stream Data (i) ... | Maximum Stream Data (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 27: MAX_STREAM_DATA Frame Format
MAX_STREAM_DATA frames contain the following fields: MAX_STREAM_DATA frames contain the following fields:
Stream ID: The stream ID of the stream that is affected encoded as a Stream ID: The stream ID of the stream that is affected encoded as a
variable-length integer. variable-length integer.
Maximum Stream Data: A variable-length integer indicating the Maximum Stream Data: A variable-length integer indicating the
maximum amount of data that can be sent on the identified stream, maximum amount of data that can be sent on the identified stream,
in units of bytes. in units of bytes.
When counting data toward this limit, an endpoint accounts for the When counting data toward this limit, an endpoint accounts for the
skipping to change at page 117, line 31 skipping to change at page 121, line 46
limits (see Section 7.3.1). limits (see Section 7.3.1).
19.11. MAX_STREAMS Frames 19.11. MAX_STREAMS Frames
The MAX_STREAMS frames (type=0x12 and 0x13) inform the peer of the The MAX_STREAMS frames (type=0x12 and 0x13) inform the peer of the
cumulative number of streams of a given type it is permitted to open. cumulative number of streams of a given type it is permitted to open.
A MAX_STREAMS frame with a type of 0x12 applies to bidirectional A MAX_STREAMS frame with a type of 0x12 applies to bidirectional
streams, and a MAX_STREAMS frame with a type of 0x13 applies to streams, and a MAX_STREAMS frame with a type of 0x13 applies to
unidirectional streams. unidirectional streams.
The MAX_STREAMS frames are as follows: The MAX_STREAMS frames are shown in Figure 28;
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Maximum Streams (i) ... | Maximum Streams (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 28: MAX_STREAMS Frame Format
MAX_STREAMS frames contain the following fields: MAX_STREAMS frames contain the following fields:
Maximum Streams: A count of the cumulative number of streams of the Maximum Streams: A count of the cumulative number of streams of the
corresponding type that can be opened over the lifetime of the corresponding type that can be opened over the lifetime of the
connection. Stream IDs cannot exceed 2^62-1, as it is not connection. Stream IDs cannot exceed 2^62-1, as it is not
possible to encode stream IDs larger than this value. Receipt of possible to encode stream IDs larger than this value. Receipt of
a frame that permits opening of a stream larger than this limit a frame that permits opening of a stream larger than this limit
MUST be treated as a FRAME_ENCODING_ERROR. MUST be treated as a FRAME_ENCODING_ERROR.
Loss or reordering can cause a MAX_STREAMS frame to be received which Loss or reordering can cause a MAX_STREAMS frame to be received which
skipping to change at page 118, line 24 skipping to change at page 122, line 45
concurrently. The limit includes streams that have been closed as concurrently. The limit includes streams that have been closed as
well as those that are open. well as those that are open.
19.12. DATA_BLOCKED Frame 19.12. DATA_BLOCKED Frame
A sender SHOULD send a DATA_BLOCKED frame (type=0x14) when it wishes A sender SHOULD send a DATA_BLOCKED frame (type=0x14) when it wishes
to send data, but is unable to due to connection-level flow control to send data, but is unable to due to connection-level flow control
(see Section 4). DATA_BLOCKED frames can be used as input to tuning (see Section 4). DATA_BLOCKED frames can be used as input to tuning
of flow control algorithms (see Section 4.2). of flow control algorithms (see Section 4.2).
The DATA_BLOCKED frame is as follows: The DATA_BLOCKED frame is shown in Figure 29.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Data Limit (i) ... | Data Limit (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 29: DATA_BLOCKED Frame Format
DATA_BLOCKED frames contain the following fields: DATA_BLOCKED frames contain the following fields:
Data Limit: A variable-length integer indicating the connection- Data Limit: A variable-length integer indicating the connection-
level limit at which blocking occurred. level limit at which blocking occurred.
19.13. STREAM_DATA_BLOCKED Frame 19.13. STREAM_DATA_BLOCKED Frame
A sender SHOULD send a STREAM_DATA_BLOCKED frame (type=0x15) when it A sender SHOULD send a STREAM_DATA_BLOCKED frame (type=0x15) when it
wishes to send data, but is unable to due to stream-level flow wishes to send data, but is unable to due to stream-level flow
control. This frame is analogous to DATA_BLOCKED (Section 19.12). control. This frame is analogous to DATA_BLOCKED (Section 19.12).
An endpoint that receives a STREAM_DATA_BLOCKED frame for a send-only An endpoint that receives a STREAM_DATA_BLOCKED frame for a send-only
stream MUST terminate the connection with error STREAM_STATE_ERROR. stream MUST terminate the connection with error STREAM_STATE_ERROR.
The STREAM_DATA_BLOCKED frame is as follows: The STREAM_DATA_BLOCKED frame is shown in Figure 30.
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 (i) ... | Stream ID (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Stream Data Limit (i) ... | Stream Data Limit (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 30: STREAM_DATA_BLOCKED Frame Format
STREAM_DATA_BLOCKED frames contain the following fields: STREAM_DATA_BLOCKED frames contain the following fields:
Stream ID: A variable-length integer indicating the stream which is Stream ID: A variable-length integer indicating the stream which is
flow control blocked. flow control blocked.
Stream Data Limit: A variable-length integer indicating the offset Stream Data Limit: A variable-length integer indicating the offset
of the stream at which the blocking occurred. of the stream at which the blocking occurred.
19.14. STREAMS_BLOCKED Frames 19.14. STREAMS_BLOCKED Frames
skipping to change at page 119, line 34 skipping to change at page 124, line 11
it wishes to open a stream, but is unable to due to the maximum it wishes to open a stream, but is unable to due to the maximum
stream limit set by its peer (see Section 19.11). A STREAMS_BLOCKED stream limit set by its peer (see Section 19.11). A STREAMS_BLOCKED
frame of type 0x16 is used to indicate reaching the bidirectional frame of type 0x16 is used to indicate reaching the bidirectional
stream limit, and a STREAMS_BLOCKED frame of type 0x17 indicates stream limit, and a STREAMS_BLOCKED frame of type 0x17 indicates
reaching the unidirectional stream limit. reaching the unidirectional stream limit.
A STREAMS_BLOCKED frame does not open the stream, but informs the A STREAMS_BLOCKED frame does not open the stream, but informs the
peer that a new stream was needed and the stream limit prevented the peer that a new stream was needed and the stream limit prevented the
creation of the stream. creation of the stream.
The STREAMS_BLOCKED frames are as follows: The STREAMS_BLOCKED frames are shown in Figure 31.
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 Limit (i) ... | Stream Limit (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 31: STREAMS_BLOCKED Frame Format
STREAMS_BLOCKED frames contain the following fields: STREAMS_BLOCKED frames contain the following fields:
Stream Limit: A variable-length integer indicating the stream limit Stream Limit: A variable-length integer indicating the stream limit
at the time the frame was sent. Stream IDs cannot exceed 2^62-1, at the time the frame was sent. Stream IDs cannot exceed 2^62-1,
as it is not possible to encode stream IDs larger than this value. as it is not possible to encode stream IDs larger than this value.
Receipt of a frame that encodes a larger stream ID MUST be treated Receipt of a frame that encodes a larger stream ID MUST be treated
as a STREAM_LIMIT_ERROR or a FRAME_ENCODING_ERROR. as a STREAM_LIMIT_ERROR or a FRAME_ENCODING_ERROR.
19.15. NEW_CONNECTION_ID Frame 19.15. NEW_CONNECTION_ID Frame
An endpoint sends a NEW_CONNECTION_ID frame (type=0x18) to provide An endpoint sends a NEW_CONNECTION_ID frame (type=0x18) to provide
its peer with alternative connection IDs that can be used to break its peer with alternative connection IDs that can be used to break
linkability when migrating connections (see Section 9.5). linkability when migrating connections (see Section 9.5).
The NEW_CONNECTION_ID frame is as follows: The NEW_CONNECTION_ID frame is shown in Figure 32.
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 Number (i) ... | Sequence Number (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Retire Prior To (i) ... | Retire Prior To (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Length (8) | | | Length (8) | |
+-+-+-+-+-+-+-+-+ Connection ID (8..160) + +-+-+-+-+-+-+-+-+ Connection ID (8..160) +
skipping to change at page 120, line 33 skipping to change at page 125, line 25
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | |
+ + + +
| | | |
+ Stateless Reset Token (128) + + Stateless Reset Token (128) +
| | | |
+ + + +
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 32: NEW_CONNECTION_ID Frame Format
NEW_CONNECTION_ID frames contain the following fields: NEW_CONNECTION_ID frames contain the following fields:
Sequence Number: The sequence number assigned to the connection ID Sequence Number: The sequence number assigned to the connection ID
by the sender. See Section 5.1.1. by the sender. See Section 5.1.1.
Retire Prior To: A variable-length integer indicating which Retire Prior To: A variable-length integer indicating which
connection IDs should be retired. See Section 5.1.2. connection IDs should be retired. See Section 5.1.2.
Length: An 8-bit unsigned integer containing the length of the Length: An 8-bit unsigned integer containing the length of the
connection ID. Values less than 1 and greater than 20 are invalid connection ID. Values less than 1 and greater than 20 are invalid
skipping to change at page 121, line 25 skipping to change at page 126, line 17
of the same frame multiple times MUST NOT be treated as a connection of the same frame multiple times MUST NOT be treated as a connection
error. A receiver can use the sequence number supplied in the error. A receiver can use the sequence number supplied in the
NEW_CONNECTION_ID frame to identify new connection IDs from old ones. NEW_CONNECTION_ID frame to identify new connection IDs from old ones.
If an endpoint receives a NEW_CONNECTION_ID frame that repeats a If an endpoint receives a NEW_CONNECTION_ID frame that repeats a
previously issued connection ID with a different Stateless Reset previously issued connection ID with a different Stateless Reset
Token or a different sequence number, or if a sequence number is used Token or a different sequence number, or if a sequence number is used
for different connection IDs, the endpoint MAY treat that receipt as for different connection IDs, the endpoint MAY treat that receipt as
a connection error of type PROTOCOL_VIOLATION. a connection error of type PROTOCOL_VIOLATION.
The Retire Prior To field is a request for the peer to retire all The Retire Prior To field counts connection IDs established during
connection IDs with a sequence number less than the specified value. connection setup and the preferred_address transport parameter (see
This includes the initial and preferred_address transport parameter Section 5.1.2). The Retire Prior To field MUST be less than or equal
connection IDs. The peer SHOULD retire the corresponding connection to the Sequence Number field. Receiving a value greater than the
IDs and send the corresponding RETIRE_CONNECTION_ID frames in a Sequence Number MUST be treated as a connection error of type
timely manner. FRAME_ENCODING_ERROR.
The Retire Prior To field MUST be less than or equal to the Sequence
Number field. Receiving a value greater than the Sequence Number
MUST be treated as a connection error of type FRAME_ENCODING_ERROR.
Once a sender indicates a Retire Prior To value, smaller values sent Once a sender indicates a Retire Prior To value, smaller values sent
in subsequent NEW_CONNECTION_ID frames have no effect. A receiver in subsequent NEW_CONNECTION_ID frames have no effect. A receiver
MUST ignore any Retire Prior To fields that do not increase the MUST ignore any Retire Prior To fields that do not increase the
largest received Retire Prior To value. largest received Retire Prior To value.
An endpoint that receives a NEW_CONNECTION_ID frame with a sequence
number smaller than the Retire Prior To field of a previously
received NEW_CONNECTION_ID frame MUST immediately send a
corresponding RETIRE_CONNECTION_ID frame that retires the newly
received connection ID.
19.16. RETIRE_CONNECTION_ID Frame 19.16. RETIRE_CONNECTION_ID Frame
An endpoint sends a RETIRE_CONNECTION_ID frame (type=0x19) to An endpoint sends a RETIRE_CONNECTION_ID frame (type=0x19) to
indicate that it will no longer use a connection ID that was issued indicate that it will no longer use a connection ID that was issued
by its peer. This may include the connection ID provided during the by its peer. This may include the connection ID provided during the
handshake. Sending a RETIRE_CONNECTION_ID frame also serves as a handshake. Sending a RETIRE_CONNECTION_ID frame also serves as a
request to the peer to send additional connection IDs for future use request to the peer to send additional connection IDs for future use
(see Section 5.1). New connection IDs can be delivered to a peer (see Section 5.1). New connection IDs can be delivered to a peer
using the NEW_CONNECTION_ID frame (Section 19.15). using the NEW_CONNECTION_ID frame (Section 19.15).
Retiring a connection ID invalidates the stateless reset token Retiring a connection ID invalidates the stateless reset token
associated with that connection ID. associated with that connection ID.
The RETIRE_CONNECTION_ID frame is as follows: The RETIRE_CONNECTION_ID frame is shown in Figure 33.
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 Number (i) ... | Sequence Number (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 33: RETIRE_CONNECTION_ID Frame Format
RETIRE_CONNECTION_ID frames contain the following fields: RETIRE_CONNECTION_ID frames contain the following fields:
Sequence Number: The sequence number of the connection ID being Sequence Number: The sequence number of the connection ID being
retired. See Section 5.1.2. retired. See Section 5.1.2.
Receipt of a RETIRE_CONNECTION_ID frame containing a sequence number Receipt of a RETIRE_CONNECTION_ID frame containing a sequence number
greater than any previously sent to the peer MAY be treated as a greater than any previously sent to the peer MUST be treated as a
connection error of type PROTOCOL_VIOLATION. connection error of type PROTOCOL_VIOLATION.
The sequence number specified in a RETIRE_CONNECTION_ID frame MUST The sequence number specified in a RETIRE_CONNECTION_ID frame MUST
NOT refer to the Destination Connection ID field of the packet in NOT refer to the Destination Connection ID field of the packet in
which the frame is contained. The peer MAY treat this as a which the frame is contained. The peer MAY treat this as a
connection error of type FRAME_ENCODING_ERROR. connection error of type FRAME_ENCODING_ERROR.
An endpoint cannot send this frame if it was provided with a zero- An endpoint cannot send this frame if it was provided with a zero-
length connection ID by its peer. An endpoint that provides a zero- length connection ID by its peer. An endpoint that provides a zero-
length connection ID MUST treat receipt of a RETIRE_CONNECTION_ID length connection ID MUST treat receipt of a RETIRE_CONNECTION_ID
frame as a connection error of type PROTOCOL_VIOLATION. frame as a connection error of type PROTOCOL_VIOLATION.
19.17. PATH_CHALLENGE Frame 19.17. PATH_CHALLENGE Frame
Endpoints can use PATH_CHALLENGE frames (type=0x1a) to check Endpoints can use PATH_CHALLENGE frames (type=0x1a) to check
reachability to the peer and for path validation during connection reachability to the peer and for path validation during connection
migration. migration.
The PATH_CHALLENGE frames are as follows: The PATH_CHALLENGE frame is shown in Figure 34.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | |
+ Data (64) + + Data (64) +
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 34: PATH_CHALLENGE Frame Format
PATH_CHALLENGE frames contain the following fields: PATH_CHALLENGE frames contain the following fields:
Data: This 8-byte field contains arbitrary data. Data: This 8-byte field contains arbitrary data.
A PATH_CHALLENGE frame containing 8 bytes that are hard to guess is A PATH_CHALLENGE frame containing 8 bytes that are hard to guess is
sufficient to ensure that it is easier to receive the packet than it sufficient to ensure that it is easier to receive the packet than it
is to guess the value correctly. is to guess the value correctly.
The recipient of this frame MUST generate a PATH_RESPONSE frame The recipient of this frame MUST generate a PATH_RESPONSE frame
(Section 19.18) containing the same Data. (Section 19.18) containing the same Data.
skipping to change at page 123, line 34 skipping to change at page 128, line 34
An endpoint sends a CONNECTION_CLOSE frame (type=0x1c or 0x1d) to An endpoint sends a CONNECTION_CLOSE frame (type=0x1c or 0x1d) to
notify its peer that the connection is being closed. The notify its peer that the connection is being closed. The
CONNECTION_CLOSE with a frame type of 0x1c is used to signal errors CONNECTION_CLOSE with a frame type of 0x1c is used to signal errors
at only the QUIC layer, or the absence of errors (with the NO_ERROR at only the QUIC layer, or the absence of errors (with the NO_ERROR
code). The CONNECTION_CLOSE frame with a type of 0x1d is used to code). The CONNECTION_CLOSE frame with a type of 0x1d is used to
signal an error with the application that uses QUIC. signal an error with the application that uses QUIC.
If there are open streams that haven't been explicitly closed, they If there are open streams that haven't been explicitly closed, they
are implicitly closed when the connection is closed. are implicitly closed when the connection is closed.
The CONNECTION_CLOSE frames are as follows: The CONNECTION_CLOSE frames are shown in Figure 35.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Error Code (i) ... | Error Code (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| [ Frame Type (i) ] ... | [ Frame Type (i) ] ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reason Phrase Length (i) ... | Reason Phrase Length (i) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reason Phrase (*) ... | Reason Phrase (*) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 35: CONNECTION_CLOSE Frame Format
CONNECTION_CLOSE frames contain the following fields: CONNECTION_CLOSE frames contain the following fields:
Error Code: A variable length integer error code which indicates the Error Code: A variable length integer error code which indicates the
reason for closing this connection. A CONNECTION_CLOSE frame of reason for closing this connection. A CONNECTION_CLOSE frame of
type 0x1c uses codes from the space defined in Section 20. A type 0x1c uses codes from the space defined in Section 20. A
CONNECTION_CLOSE frame of type 0x1d uses codes from the CONNECTION_CLOSE frame of type 0x1d uses codes from the
application protocol error code space; see Section 20.1 application protocol error code space; see Section 20.1
Frame Type: A variable-length integer encoding the type of frame Frame Type: A variable-length integer encoding the type of frame
that triggered the error. A value of 0 (equivalent to the mention that triggered the error. A value of 0 (equivalent to the mention
skipping to change at page 124, line 23 skipping to change at page 129, line 27
Reason Phrase Length: A variable-length integer specifying the Reason Phrase Length: A variable-length integer specifying the
length of the reason phrase in bytes. Because a CONNECTION_CLOSE length of the reason phrase in bytes. Because a CONNECTION_CLOSE
frame cannot be split between packets, any limits on packet size frame cannot be split between packets, any limits on packet size
will also limit the space available for a reason phrase. will also limit the space available for a reason phrase.
Reason Phrase: A human-readable explanation for why the connection Reason Phrase: A human-readable explanation for why the connection
was closed. This can be zero length if the sender chooses to not 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 give details beyond the Error Code. This SHOULD be a UTF-8
encoded string [RFC3629]. encoded string [RFC3629].
19.20. Extension Frames The application-specific variant of CONNECTION_CLOSE (type 0x1d) can
only be sent using an 1-RTT packet ([QUIC-TLS], Section 4). When an
application wishes to abandon a connection during the handshake, an
endpoint can send a CONNECTION_CLOSE frame (type 0x1c) with an error
code of 0x15a ("user_canceled" alert; see [TLS13]) in an Initial or a
Handshake packet.
19.20. HANDSHAKE_DONE frame
The server uses the HANDSHAKE_DONE frame (type=0x1e) to signal
confirmation of the handshake to the client. The HANDSHAKE_DONE
frame contains no additional fields.
This frame can only be sent by the server. Servers MUST NOT send a
HANDSHAKE_DONE frame before completing the handshake. A server MUST
treat receipt of a HANDSHAKE_DONE frame as a connection error of type
PROTOCOL_VIOLATION.
19.21. Extension Frames
QUIC frames do not use a self-describing encoding. An endpoint QUIC frames do not use a self-describing encoding. An endpoint
therefore needs to understand the syntax of all frames before it can therefore needs to understand the syntax of all frames before it can
successfully process a packet. This allows for efficient encoding of successfully process a packet. This allows for efficient encoding of
frames, but it means that an endpoint cannot send a frame of a type frames, but it means that an endpoint cannot send a frame of a type
that is unknown to its peer. that is unknown to its peer.
An extension to QUIC that wishes to use a new type of frame MUST An extension to QUIC that wishes to use a new type of frame MUST
first ensure that a peer is able to understand the frame. An first ensure that a peer is able to understand the frame. An
endpoint can use a transport parameter to signal its willingness to endpoint can use a transport parameter to signal its willingness to
receive one or more extension frame types with the one transport receive one or more extension frame types with the one transport
parameter. parameter.
Extension frames MUST be congestion controlled and MUST cause an ACK Extension frames MUST be congestion controlled and MUST cause an ACK
frame to be sent. The exception is extension frames that replace or frame to be sent. The exception is extension frames that replace or
supplement the ACK frame. Extension frames are not included in flow supplement the ACK frame. Extension frames are not included in flow
control unless specified in the extension. control unless specified in the extension.
An IANA registry is used to manage the assignment of frame types; see An IANA registry is used to manage the assignment of frame types; see
Section 22.2. Section 22.3.
20. Transport Error Codes 20. Transport Error Codes
QUIC error codes are 62-bit unsigned integers. QUIC error codes are 62-bit unsigned integers.
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 frame. These errors apply to the entire used in a CONNECTION_CLOSE frame. These errors apply to the entire
connection. connection.
NO_ERROR (0x0): An endpoint uses this with CONNECTION_CLOSE to NO_ERROR (0x0): An endpoint uses this with CONNECTION_CLOSE to
skipping to change at page 125, line 43 skipping to change at page 131, line 17
FRAME_ENCODING_ERROR (0x7): An endpoint received a frame that was FRAME_ENCODING_ERROR (0x7): An endpoint received a frame that was
badly formatted. For instance, a frame of an unknown type, or an badly formatted. For instance, a frame of an unknown type, or an
ACK frame that has more acknowledgment ranges than the remainder ACK frame that has more acknowledgment ranges than the remainder
of the packet could carry. of the packet could carry.
TRANSPORT_PARAMETER_ERROR (0x8): An endpoint received transport TRANSPORT_PARAMETER_ERROR (0x8): An endpoint received transport
parameters that were badly formatted, included an invalid value, parameters that were badly formatted, included an invalid value,
was absent even though it is mandatory, was present though it is was absent even though it is mandatory, was present though it is
forbidden, or is otherwise in error. forbidden, or is otherwise in error.
CONNECTION_ID_LIMIT_ERROR (0x9): The number of connection IDs
provided by the peer exceeds the advertised
active_connection_id_limit.
PROTOCOL_VIOLATION (0xA): An endpoint detected an error with PROTOCOL_VIOLATION (0xA): An endpoint detected an error with
protocol compliance that was not covered by more specific error protocol compliance that was not covered by more specific error
codes. codes.
INVALID_TOKEN (0xB): A server received a Retry Token in a client
Initial that is invalid.
CRYPTO_BUFFER_EXCEEDED (0xD): An endpoint has received more data in CRYPTO_BUFFER_EXCEEDED (0xD): An endpoint has received more data in
CRYPTO frames than it can buffer. CRYPTO frames than it can buffer.
CRYPTO_ERROR (0x1XX): The cryptographic handshake failed. A range CRYPTO_ERROR (0x1XX): The cryptographic handshake failed. A range
of 256 values is reserved for carrying error codes specific to the of 256 values is reserved for carrying error codes specific to the
cryptographic handshake that is used. Codes for errors occurring cryptographic handshake that is used. Codes for errors occurring
when TLS is used for the crypto handshake are described in when TLS is used for the crypto handshake are described in
Section 4.8 of [QUIC-TLS]. Section 4.8 of [QUIC-TLS].
See Section 22.3 for details of registering new error codes. See Section 22.4 for details of registering new error codes.
In defining these error codes, several principles are applied. Error In defining these error codes, several principles are applied. Error
conditions that might require specific action on the part of a conditions that might require specific action on the part of a
recipient are given unique codes. Errors that represent common recipient are given unique codes. Errors that represent common
conditions are given specific codes. Absent either of these conditions are given specific codes. Absent either of these
conditions, error codes are used to identify a general function of conditions, error codes are used to identify a general function of
the stack, like flow control or transport parameter handling. the stack, like flow control or transport parameter handling.
Finally, generic errors are provided for conditions where Finally, generic errors are provided for conditions where
implementations are unable or unwilling to use more specific codes. implementations are unable or unwilling to use more specific codes.
skipping to change at page 127, line 43 skipping to change at page 133, line 30
An attacker might be able to receive an address validation token An attacker might be able to receive an address validation token
(Section 8) from a server and then release the IP address it used to (Section 8) from a server and then release the IP address it used to
acquire that token. At a later time, the attacker may initiate a acquire that token. At a later time, the attacker may initiate a
0-RTT connection with a server by spoofing this same address, which 0-RTT connection with a server by spoofing this same address, which
might now address a different (victim) endpoint. The attacker can might now address a different (victim) endpoint. The attacker can
thus potentially cause the server to send an initial congestion thus potentially cause the server to send an initial congestion
window's worth of data towards the victim. window's worth of data towards the victim.
Servers SHOULD provide mitigations for this attack by limiting the Servers SHOULD provide mitigations for this attack by limiting the
usage and lifetime of address validation tokens (see Section 8.1.2). usage and lifetime of address validation tokens (see Section 8.1.3).
21.3. Optimistic ACK Attack 21.3. Optimistic ACK Attack
An endpoint that acknowledges packets it has not received might cause An endpoint that acknowledges packets it has not received might cause
a congestion controller to permit sending at rates beyond what the a congestion controller to permit sending at rates beyond what the
network supports. An endpoint MAY skip packet numbers when sending network supports. An endpoint MAY skip packet numbers when sending
packets to detect this behavior. An endpoint can then immediately packets to detect this behavior. An endpoint can then immediately
close the connection with a connection error of type close the connection with a connection error of type
PROTOCOL_VIOLATION (see Section 10.3). PROTOCOL_VIOLATION (see Section 10.3).
skipping to change at page 130, line 48 skipping to change at page 136, line 25
while an active instance retains connection state; even if an while an active instance retains connection state; even if an
instance retains connection state, the change in routing and instance retains connection state, the change in routing and
resulting stateless reset will result in the connection being resulting stateless reset will result in the connection being
terminated. If there is no chance in the packet being routed to the terminated. If there is no chance in the packet being routed to the
correct instance, it is better to send a stateless reset than wait correct instance, it is better to send a stateless reset than wait
for connections to time out. However, this is acceptable only if the for connections to time out. However, this is acceptable only if the
routing cannot be influenced by an attacker. routing cannot be influenced by an attacker.
21.10. Version Downgrade 21.10. Version Downgrade
This document defines QUIC Version Negotiation packets Section 6, This document defines QUIC Version Negotiation packets in Section 6,
which can be used to negotiate the QUIC version used between two which can be used to negotiate the QUIC version used between two
endpoints. However, this document does not specify how this endpoints. However, this document does not specify how this
negotiation will be performed between this version and subsequent negotiation will be performed between this version and subsequent
future versions. In particular, Version Negotiation packets do not future versions. In particular, Version Negotiation packets do not
contain any mechanism to prevent version downgrade attacks. Future contain any mechanism to prevent version downgrade attacks. Future
versions of QUIC that use Version Negotiation packets MUST define a versions of QUIC that use Version Negotiation packets MUST define a
mechanism that is robust against version downgrade attacks. mechanism that is robust against version downgrade attacks.
21.11. Targeted Attacks by Routing 21.11. Targeted Attacks by Routing
Deployments should limit the ability of an attacker to target a new Deployments should limit the ability of an attacker to target a new
connection to a particular server instance. This means that client- connection to a particular server instance. This means that client-
controlled fields, such as the initial Destination Connection ID used controlled fields, such as the initial Destination Connection ID used
on Initial and 0-RTT packets SHOULD NOT be used by themselves to make on Initial and 0-RTT packets SHOULD NOT be used by themselves to make
routing decisions. Ideally, routing decisions are made independently routing decisions. Ideally, routing decisions are made independently
of client-selected values; a Source Connection ID can be selected to of client-selected values; a Source Connection ID can be selected to
route later packets to the same server. route later packets to the same server.
22. IANA Considerations 22. IANA Considerations
22.1. QUIC Transport Parameter Registry This document establishes several registries for the management of
codepoints in QUIC. These registries operate on a common set of
policies as defined in Section 22.1.
IANA [SHALL add/has added] a registry for "QUIC Transport Parameters" 22.1. Registration Policies for QUIC Registries
under a "QUIC Protocol" heading.
The "QUIC Transport Parameters" registry governs a 16-bit space. All QUIC registries allow for both provisional and permanent
This space is split into two spaces that are governed by different registration of codepoints. This section documents policies that are
policies. Values with the first byte in the range 0x00 to 0xfe (in common to these registries.
hexadecimal) are assigned via the Specification Required policy
[RFC8126]. Values with the first byte 0xff are reserved for Private
Use [RFC8126].
Registrations MUST include the following fields: 22.1.1. Provisional Registrations
Value: The numeric value of the assignment (registrations will be Provisional registration of codepoints are intended to allow for
between 0x0000 and 0xfeff). private use and experimentation with extensions to QUIC. Provisional
registrations only require the inclusion of the codepoint value and
contact information. However, provisional registrations could be
reclaimed and reassigned for another purpose.
Parameter Name: A short mnemonic for the parameter. Provisional registrations require Expert Review, as defined in
Section 4.5 of [RFC8126]. Designated expert(s) are advised that only
registrations for an excessive proportion of remaining codepoint
space or the very first unassigned value (see Section 22.1.2) can be
rejected.
Provisional registrations will include a date field that indicates
when the registration was last updated. A request to update the date
on any provisional registration can be made without review from the
designated expert(s).
All QUIC registries include the following fields to support
provisional registration:
Value: The assigned codepoint.
Status: "Permanent" or "Provisional".
Specification: A reference to a publicly available specification for Specification: A reference to a publicly available specification for
the value. the value.
The nominated expert(s) verify that a specification exists and is Date: The date of last update to the registration.
Contact: Contact details for the registrant.
Notes: Supplementary notes about the registration.
Provisional registrations MAY omit the Specification and Notes
fields, plus any additional fields that might be required for a
permanent registration. The Date field is not required as part of
requesting a registration as it is set to the date the registration
is created or updated.
22.1.2. Selecting Codepoints
New uses of codepoints from QUIC registries SHOULD use a randomly
selected codepoint that excludes both existing allocations and the
first unallocated codepoint in the selected space. Requests for
multiple codepoints MAY use a contiguous range. This minimizes the
risk that differing semantics are attributed to the same codepoint by
different implementations. Use of the first codepoint in a range is
intended for use by specifications that are developed through the
standards process [STD] and its allocation MUST be negotiated with
IANA before use.
For codepoints that are encoded in variable-length integers
(Section 16), such as frame types, codepoints that encode to four or
eight bytes (that is, values 2^14 and above) SHOULD be used unless
the usage is especially sensitive to having a longer encoding.
Applications to register codepoints in QUIC registries MAY include a
codepoint as part of the registration. IANA MUST allocate the
selected codepoint unless that codepoint is already assigned or the
codepoint is the first unallocated codepoint in the registry.
22.1.3. Reclaiming Provisional Codepoints
A request might be made to remove an unused provisional registration
from the registry to reclaim space in a registry, or portion of the
registry (such as the 64-16383 range for codepoints that use
variable-length encodings). This SHOULD be done only for the
codepoints with the earliest recorded date and entries that have been
updated less than a year prior SHOULD NOT be reclaimed.
A request to remove a codepoint MUST be reviewed by the designated
expert(s). The expert(s) MUST attempt to determine whether the
codepoint is still in use. Experts are advised to contact the listed
contacts for the registration, plus as wide a set of protocol
implementers as possible in order to determine whether any use of the
codepoint is known. The expert(s) are advised to allow at least four
weeks for responses.
If any use of the codepoints is identified by this search or a
request to update the registration is made, the codepoint MUST NOT be
reclaimed. Instead, the date on the registration is updated. A note
might be added for the registration recording relevant information
that was learned.
If no use of the codepoint was identified and no request was made to
update the registration, the codepoint MAY be removed from the
registry.
This process also applies to requests to change a provisional
registration into a permanent registration, except that the goal is
not to determine whether there is no use of the codepoint, but to
determine that the registration is an accurate representation of any
deployed usage.
22.1.4. Permanent Registrations
Permanent registrations in QUIC registries use the Specification
Required policy [RFC8126], unless otherwise specified. The
designated expert(s) verify that a specification exists and is
readily accessible. Expert(s) are encouraged to be biased towards readily accessible. Expert(s) are encouraged to be biased towards
approving registrations unless they are abusive, frivolous, or approving registrations unless they are abusive, frivolous, or
actively harmful (not merely aesthetically displeasing, or actively harmful (not merely aesthetically displeasing, or
architecturally dubious). architecturally dubious). The creation of a registry MAY specify
additional constraints on permanent registrations.
The creation of a registries MAY identify a range of codepoints where
registrations are governed by a different registration policy. For
instance, the registries for 62-bit codepoints in this document have
stricter policies for codepoints in the range from 0 to 63.
Any stricter requirements for permanent registrations do not prevent
provisional registrations for affected codepoints. For instance, a
provisional registration for a frame type Section 22.3 of 61 could be
requested.
All registrations made by Standards Track publications MUST be
permanent.
All registrations in this document are assigned a permanent status
and list as contact both the IESG (ietf@ietf.org) and the QUIC
working group (quic@ietf.org).
22.2. QUIC Transport Parameter Registry
IANA [SHALL add/has added] a registry for "QUIC Transport Parameters"
under a "QUIC" heading.
The "QUIC Transport Parameters" registry governs a 16-bit space.
This registry follows the registration policy from Section 22.1.
Permanent registrations in this registry are assigned using the
Specification Required policy [RFC8126].
In addition to the fields in Section 22.1.1, permanent registrations
in this registry MUST include the following fields:
Parameter Name: A short mnemonic for the parameter.
The initial contents of this registry are shown in Table 6. The initial contents of this registry are shown in Table 6.
+--------+-------------------------------------+---------------+ +--------+-------------------------------------+---------------+
| Value | Parameter Name | Specification | | Value | Parameter Name | Specification |
+--------+-------------------------------------+---------------+ +--------+-------------------------------------+---------------+
| 0x0000 | original_connection_id | Section 18.2 | | 0x0000 | original_connection_id | Section 18.2 |
| | | | | | | |
| 0x0001 | idle_timeout | Section 18.2 | | 0x0001 | idle_timeout | Section 18.2 |
| | | | | | | |
skipping to change at page 132, line 42 skipping to change at page 140, line 44
| 0x000c | disable_active_migration | Section 18.2 | | 0x000c | disable_active_migration | Section 18.2 |
| | | | | | | |
| 0x000d | preferred_address | Section 18.2 | | 0x000d | preferred_address | Section 18.2 |
| | | | | | | |
| 0x000e | active_connection_id_limit | Section 18.2 | | 0x000e | active_connection_id_limit | Section 18.2 |
+--------+-------------------------------------+---------------+ +--------+-------------------------------------+---------------+
Table 6: Initial QUIC Transport Parameters Entries Table 6: Initial QUIC Transport Parameters Entries
Additionally, each value of the format "31 * N + 27" for integer Additionally, each value of the format "31 * N + 27" for integer
values of N (that is, "27", "58", "89", ...) MUST NOT be assigned by values of N (that is, "27", "58", "89", ...) are reserved and MUST
IANA. NOT be assigned by IANA.
22.2. QUIC Frame Type Registry 22.3. QUIC Frame Type Registry
IANA [SHALL add/has added] a registry for "QUIC Frame Types" under a IANA [SHALL add/has added] a registry for "QUIC Frame Types" under a
"QUIC Protocol" heading. "QUIC" heading.
The "QUIC Frame Types" registry governs a 62-bit space. This space
is split into three spaces that are governed by different policies.
Values between 0x00 and 0x3f (in hexadecimal) are assigned via the
Standards Action or IESG Review policies [RFC8126]. Values from 0x40
to 0x3fff operate on the Specification Required policy [RFC8126].
All other values are assigned to Private Use [RFC8126].
Registrations MUST include the following fields: The "QUIC Frame Types" registry governs a 62-bit space. This
registry follows the registration policy from Section 22.1.
Permanent registrations in this registry are assigned using the
Specification Required policy [RFC8126], except for values between
0x00 and 0x3f (in hexadecimal; inclusive), which are assigned using
Standards Action or IESG Approval as defined in Section 4.9 and 4.10
of [RFC8126].
Value: The numeric value of the assignment (registrations will be In addition to the fields in Section 22.1.1, permanent registrations
between 0x00 and 0x3fff). A range of values MAY be assigned. in this registry MUST include the following fields:
Frame Name: A short mnemonic for the frame type. Frame Name: A short mnemonic for the frame type.
Specification: A reference to a publicly available specification for In addition to the advice in Section 22.1, specifications for new
the value. permanent registrations SHOULD describe the means by which an
endpoint might determine that it can send the identified type of
The nominated expert(s) verify that a specification exists and is frame. An accompanying transport parameter registration (see
readily accessible. Specifications for new registrations need to Section 22.2) is expected for most registrations. Specifications for
describe the means by which an endpoint might determine that it can permanent registrations also needs to describe the format and
send the identified type of frame. An accompanying transport
parameter registration (see Section 22.1) is expected for most
registrations. The specification needs to describe the format and
assigned semantics of any fields in the frame. assigned semantics of any fields in the frame.
Expert(s) are encouraged to be biased towards approving registrations
unless they are abusive, frivolous, or actively harmful (not merely
aesthetically displeasing, or architecturally dubious).
The initial contents of this registry are tabulated in Table 3. The initial contents of this registry are tabulated in Table 3.
22.3. QUIC Transport Error Codes Registry 22.4. QUIC Transport Error Codes Registry
IANA [SHALL add/has added] a registry for "QUIC Transport Error IANA [SHALL add/has added] a registry for "QUIC Transport Error
Codes" under a "QUIC Protocol" heading. Codes" under a "QUIC" heading.
The "QUIC Transport Error Codes" registry governs a 62-bit space. The "QUIC Transport Error Codes" registry governs a 62-bit space.
This space is split into three spaces that are governed by different This space is split into three spaces that are governed by different
policies. Values between 0x00 and 0x3f (in hexadecimal) are assigned policies. Permanent registrations in this registry are assigned
via the Standards Action or IESG Review policies [RFC8126]. Values using the Specification Required policy [RFC8126], except for values
from 0x40 to 0x3fff operate on the Specification Required policy between 0x00 and 0x3f (in hexadecimal; inclusive), which are assigned
[RFC8126]. All other values are assigned to Private Use [RFC8126]. using Standards Action or IESG Approval as defined in Section 4.9 and
4.10 of [RFC8126].
Registrations MUST include the following fields:
Value: The numeric value of the assignment (registrations will be In addition to the fields in Section 22.1.1, permanent registrations
between 0x0000 and 0x3fff). in this registry MUST include the following fields:
Code: A short mnemonic for the parameter. Code: A short mnemonic for the parameter.
Description: A brief description of the error code semantics, which Description: A brief description of the error code semantics, which
MAY be a summary if a specification reference is provided. MAY be a summary if a specification reference is provided.
Specification: A reference to a publicly available specification for
the value.
The nominated expert(s) verify that a specification exists and is
readily accessible. Expert(s) are encouraged to be biased towards
approving registrations unless they are abusive, frivolous, or
actively harmful (not merely aesthetically displeasing, or
architecturally dubious).
The initial contents of this registry are shown in Table 7. The initial contents of this registry are shown in Table 7.
+------+---------------------------+----------------+---------------+ +------+---------------------------+----------------+---------------+
| Valu | Error | Description | Specification | | Valu | Error | Description | Specification |
| e | | | | | e | | | |
+------+---------------------------+----------------+---------------+ +------+---------------------------+----------------+---------------+
| 0x0 | NO_ERROR | No error | Section 20 | | 0x0 | NO_ERROR | No error | Section 20 |
| | | | | | | | | |
| 0x1 | INTERNAL_ERROR | Implementation | Section 20 | | 0x1 | INTERNAL_ERROR | Implementation | Section 20 |
| | | error | | | | | error | |
skipping to change at page 135, line 37 skipping to change at page 142, line 34
| 0x6 | FINAL_SIZE_ERROR | Change to | Section 20 | | 0x6 | FINAL_SIZE_ERROR | Change to | Section 20 |
| | | final size | | | | | final size | |
| | | | | | | | | |
| 0x7 | FRAME_ENCODING_ERROR | Frame encoding | Section 20 | | 0x7 | FRAME_ENCODING_ERROR | Frame encoding | Section 20 |
| | | error | | | | | error | |
| | | | | | | | | |
| 0x8 | TRANSPORT_PARAMETER_ERROR | Error in | Section 20 | | 0x8 | TRANSPORT_PARAMETER_ERROR | Error in | Section 20 |
| | | transport | | | | | transport | |
| | | parameters | | | | | parameters | |
| | | | | | | | | |
| 0x9 | CONNECTION_ID_LIMIT_ERROR | Too many | Section 20 |
| | | connection IDs | |
| | | received | |
| | | | |
| 0xA | PROTOCOL_VIOLATION | Generic | Section 20 | | 0xA | PROTOCOL_VIOLATION | Generic | Section 20 |
| | | protocol | | | | | protocol | |
| | | violation | | | | | violation | |
| | | | | | | | | |
| 0xB | INVALID_TOKEN | Invalid Token | Section 20 |
| | | Received | |
| | | | |
| 0xD | CRYPTO_BUFFER_EXCEEDED | CRYPTO data | Section 20 | | 0xD | CRYPTO_BUFFER_EXCEEDED | CRYPTO data | Section 20 |
| | | buffer | | | | | buffer | |
| | | overflowed | | | | | overflowed | |
+------+---------------------------+----------------+---------------+ +------+---------------------------+----------------+---------------+
Table 7: Initial QUIC Transport Error Codes Entries Table 7: Initial QUIC Transport Error Codes Entries
23. References 23. References
23.1. Normative References 23.1. Normative References
[DPLPMTUD] [DPLPMTUD]
Fairhurst, G., Jones, T., Tuexen, M., Ruengeler, I., and Fairhurst, G., Jones, T., Tuexen, M., Ruengeler, I., and
T. Voelker, "Packetization Layer Path MTU Discovery for T. Voelker, "Packetization Layer Path MTU Discovery for
Datagram Transports", draft-ietf-tsvwg-datagram-plpmtud-08 Datagram Transports", draft-ietf-tsvwg-datagram-plpmtud-12
(work in progress), June 2019. (work in progress), December 2019.
[IPv4] Postel, J., "Internet Protocol", STD 5, RFC 791,
DOI 10.17487/RFC0791, September 1981,
<https://www.rfc-editor.org/info/rfc791>.
[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-24 (work and Congestion Control", draft-ietf-quic-recovery-latest
in progress). (work in progress).
[QUIC-TLS] [QUIC-TLS]
Thomson, M., Ed. and S. Turner, Ed., "Using Transport Thomson, M., Ed. and S. Turner, Ed., "Using Transport
Layer Security (TLS) to Secure QUIC", draft-ietf-quic- Layer Security (TLS) to Secure QUIC", draft-ietf-quic-tls-
tls-24 (work in progress). latest (work in progress).
[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,
<https://www.rfc-editor.org/info/rfc1191>. <https://www.rfc-editor.org/info/rfc1191>.
[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,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
skipping to change at page 137, line 50 skipping to change at page 145, line 7
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>.
[HTTP2] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext [HTTP2] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext
Transfer Protocol Version 2 (HTTP/2)", RFC 7540, Transfer Protocol Version 2 (HTTP/2)", RFC 7540,
DOI 10.17487/RFC7540, May 2015, DOI 10.17487/RFC7540, May 2015,
<https://www.rfc-editor.org/info/rfc7540>. <https://www.rfc-editor.org/info/rfc7540>.
[QUIC-INVARIANTS] [QUIC-INVARIANTS]
Thomson, M., "Version-Independent Properties of QUIC", Thomson, M., "Version-Independent Properties of QUIC",
draft-ietf-quic-invariants-07 (work in progress). draft-ietf-quic-invariants-latest (work in progress).
[QUIC-MANAGEABILITY] [QUIC-MANAGEABILITY]
Kuehlewind, M. and B. Trammell, "Manageability of the QUIC Kuehlewind, M. and B. Trammell, "Manageability of the QUIC
Transport Protocol", draft-ietf-quic-manageability-05 Transport Protocol", draft-ietf-quic-manageability-06
(work in progress), July 2019. (work in progress), January 2020.
[RFC1812] Baker, F., Ed., "Requirements for IP Version 4 Routers", [RFC1812] Baker, F., Ed., "Requirements for IP Version 4 Routers",
RFC 1812, DOI 10.17487/RFC1812, June 1995, RFC 1812, DOI 10.17487/RFC1812, June 1995,
<https://www.rfc-editor.org/info/rfc1812>. <https://www.rfc-editor.org/info/rfc1812>.
[RFC2018] Mathis, M., Mahdavi, J., Floyd, S., and A. Romanow, "TCP [RFC2018] Mathis, M., Mahdavi, J., Floyd, S., and A. Romanow, "TCP
Selective Acknowledgment Options", RFC 2018, Selective Acknowledgment Options", RFC 2018,
DOI 10.17487/RFC2018, October 1996, DOI 10.17487/RFC2018, October 1996,
<https://www.rfc-editor.org/info/rfc2018>. <https://www.rfc-editor.org/info/rfc2018>.
skipping to change at page 139, line 20 skipping to change at page 146, line 25
[RFC8200] Deering, S. and R. Hinden, "Internet Protocol, Version 6 [RFC8200] Deering, S. and R. Hinden, "Internet Protocol, Version 6
(IPv6) Specification", STD 86, RFC 8200, (IPv6) Specification", STD 86, RFC 8200,
DOI 10.17487/RFC8200, July 2017, DOI 10.17487/RFC8200, July 2017,
<https://www.rfc-editor.org/info/rfc8200>. <https://www.rfc-editor.org/info/rfc8200>.
[SLOWLORIS] [SLOWLORIS]
RSnake Hansen, R., "Welcome to Slowloris...", June 2009, RSnake Hansen, R., "Welcome to Slowloris...", June 2009,
<https://web.archive.org/web/20150315054838/ <https://web.archive.org/web/20150315054838/
http://ha.ckers.org/slowloris/>. http://ha.ckers.org/slowloris/>.
[STD] Bradner, S., "The Internet Standards Process -- Revision
3", BCP 9, RFC 2026, DOI 10.17487/RFC2026, October 1996,
<https://www.rfc-editor.org/info/rfc2026>.
Appendix A. Sample Packet Number Decoding Algorithm Appendix A. Sample Packet Number Decoding Algorithm
The following pseudo-code shows how an implementation can decode The pseudo-code in Figure 36 shows how an implementation can decode
packet numbers after header protection has been removed. packet numbers after header protection has been removed.
DecodePacketNumber(largest_pn, truncated_pn, pn_nbits): DecodePacketNumber(largest_pn, truncated_pn, pn_nbits):
expected_pn = largest_pn + 1 expected_pn = largest_pn + 1
pn_win = 1 << pn_nbits pn_win = 1 << pn_nbits
pn_hwin = pn_win / 2 pn_hwin = pn_win / 2
pn_mask = pn_win - 1 pn_mask = pn_win - 1
// The incoming packet number should be greater than // The incoming packet number should be greater than
// expected_pn - pn_hwin and less than or equal to // expected_pn - pn_hwin and less than or equal to
// expected_pn + pn_hwin // expected_pn + pn_hwin
// //
// This means we can't just strip the trailing bits from // This means we can't just strip the trailing bits from
// expected_pn and add the truncated_pn because that might // expected_pn and add the truncated_pn because that might
// yield a value outside the window. // yield a value outside the window.
// //
// The following code calculates a candidate value and // The following code calculates a candidate value and
// makes sure it's within the packet number window. // makes sure it's within the packet number window.
// Note the extra checks to prevent overflow and underflow.
candidate_pn = (expected_pn & ~pn_mask) | truncated_pn candidate_pn = (expected_pn & ~pn_mask) | truncated_pn
if candidate_pn <= expected_pn - pn_hwin: if candidate_pn <= expected_pn - pn_hwin and
candidate_pn < (1 << 62) - pn_win:
return candidate_pn + pn_win return candidate_pn + pn_win
// Note the extra check for underflow when candidate_pn
// is near zero.
if candidate_pn > expected_pn + pn_hwin and if candidate_pn > expected_pn + pn_hwin and
candidate_pn > pn_win: candidate_pn >= pn_win:
return candidate_pn - pn_win return candidate_pn - pn_win
return candidate_pn return candidate_pn
Figure 36: Sample Packet Number Decoding Algorithm
Appendix B. Change Log Appendix B. 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.
B.1. Since draft-ietf-quic-transport-23 B.1. Since draft-ietf-quic-transport-23
o Allow ClientHello to span multiple packets (#2928, #3045)
o Client Initial size constraints apply to UDP datagram payload o Client Initial size constraints apply to UDP datagram payload
(#3053, #3051) (#3053, #3051)
o Stateless reset changes (#2152, #2993) o Stateless reset changes (#2152, #2993)
* tokens need to be compared in constant time * tokens need to be compared in constant time
* detection uses UDP datagrams, not packets * detection uses UDP datagrams, not packets
* tokens cannot be reused (#2785, #2968) * tokens cannot be reused (#2785, #2968)
skipping to change at page 140, line 39 skipping to change at page 148, line 19
(#2778, #2969) (#2778, #2969)
o Stronger requirements for connection ID retirement (#3046, #3096) o Stronger requirements for connection ID retirement (#3046, #3096)
o NEW_TOKEN cannot be empty (#2978, #2977) o NEW_TOKEN cannot be empty (#2978, #2977)
o PING can be sent at any encryption level (#3034, #3035) o PING can be sent at any encryption level (#3034, #3035)
o CONNECTION_CLOSE is not ack-eliciting (#3097, #3098) o CONNECTION_CLOSE is not ack-eliciting (#3097, #3098)
o Frame encoding error conditions updated (#3027, #3042)
o Non-ack-eliciting packets cannot be sent in response to non-ack- o Non-ack-eliciting packets cannot be sent in response to non-ack-
eliciting packets (#3100, #3104) eliciting packets (#3100, #3104)
o Servers have to change connection IDs in Retry (#2837, #3147)
B.2. Since draft-ietf-quic-transport-22 B.2. Since draft-ietf-quic-transport-22
o Rules for preventing correlation by connection ID tightened o Rules for preventing correlation by connection ID tightened
(#2084, #2929) (#2084, #2929)
o Clarified use of CONNECTION_CLOSE in Handshake packets (#2151, o Clarified use of CONNECTION_CLOSE in Handshake packets (#2151,
#2541, #2688) #2541, #2688)
o Discourage regressions of largest acknowledged in ACK (#2205, o Discourage regressions of largest acknowledged in ACK (#2205,
#2752) #2752)
 End of changes. 153 change blocks. 
509 lines changed or deleted 813 lines changed or added

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