| draft-ietf-quic-transport-06.txt | draft-ietf-quic-transport-07.txt | |||
|---|---|---|---|---|
| QUIC J. Iyengar, Ed. | QUIC J. Iyengar, Ed. | |||
| Internet-Draft Google | Internet-Draft Google | |||
| Intended status: Standards Track M. Thomson, Ed. | Intended status: Standards Track M. Thomson, Ed. | |||
| Expires: March 26, 2018 Mozilla | Expires: April 16, 2018 Mozilla | |||
| September 22, 2017 | October 13, 2017 | |||
| QUIC: A UDP-Based Multiplexed and Secure Transport | QUIC: A UDP-Based Multiplexed and Secure Transport | |||
| draft-ietf-quic-transport-06 | draft-ietf-quic-transport-07 | |||
| Abstract | Abstract | |||
| This document defines the core of the QUIC transport protocol. This | This document defines the core of the QUIC transport protocol. This | |||
| document describes connection establishment, packet format, | document describes connection establishment, packet format, | |||
| multiplexing and reliability. Accompanying documents describe the | multiplexing and reliability. Accompanying documents describe the | |||
| cryptographic handshake and loss detection. | cryptographic handshake and loss detection. | |||
| Note to Readers | Note to Readers | |||
| Discussion of this draft takes place on the QUIC working group | Discussion of this draft takes place on the QUIC working group | |||
| mailing list (quic@ietf.org), which is archived at | mailing list (quic@ietf.org), which is archived at | |||
| https://mailarchive.ietf.org/arch/search/?email_list=quic . | https://mailarchive.ietf.org/arch/search/?email_list=quic [1]. | |||
| Working Group information can be found at https://github.com/quicwg ; | Working Group information can be found at https://github.com/quicwg | |||
| source code and issues list for this draft can be found at | [2]; source code and issues list for this draft can be found at | |||
| https://github.com/quicwg/base-drafts/labels/transport . | https://github.com/quicwg/base-drafts/labels/transport [3]. | |||
| Status of This Memo | Status of This Memo | |||
| This Internet-Draft is submitted in full conformance with the | This Internet-Draft is submitted in full conformance with the | |||
| provisions of BCP 78 and BCP 79. | provisions of BCP 78 and BCP 79. | |||
| Internet-Drafts are working documents of the Internet Engineering | Internet-Drafts are working documents of the Internet Engineering | |||
| Task Force (IETF). Note that other groups may also distribute | Task Force (IETF). Note that other groups may also distribute | |||
| working documents as Internet-Drafts. The list of current Internet- | working documents as Internet-Drafts. The list of current Internet- | |||
| Drafts is at http://datatracker.ietf.org/drafts/current/. | Drafts is at 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 March 26, 2018. | This Internet-Draft will expire on April 16, 2018. | |||
| Copyright Notice | Copyright Notice | |||
| Copyright (c) 2017 IETF Trust and the persons identified as the | Copyright (c) 2017 IETF Trust and the persons identified as the | |||
| document authors. All rights reserved. | document authors. All rights reserved. | |||
| This document is subject to BCP 78 and the IETF Trust's Legal | This document is subject to BCP 78 and the IETF Trust's Legal | |||
| Provisions Relating to IETF Documents | Provisions Relating to IETF Documents | |||
| (http://trustee.ietf.org/license-info) in effect on the date of | (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 . . . . . . . . . . . . . . . . . . . . . . . . 4 | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 | |||
| skipping to change at page 2, line 38 ¶ | skipping to change at page 2, line 38 ¶ | |||
| 3.3. Rich Signaling for Congestion Control and Loss Recovery . 7 | 3.3. Rich Signaling for Congestion Control and Loss Recovery . 7 | |||
| 3.4. Stream and Connection Flow Control . . . . . . . . . . . 7 | 3.4. Stream and Connection Flow Control . . . . . . . . . . . 7 | |||
| 3.5. Authenticated and Encrypted Header and Payload . . . . . 7 | 3.5. Authenticated and Encrypted Header and Payload . . . . . 7 | |||
| 3.6. Connection Migration and Resilience to NAT Rebinding . . 8 | 3.6. Connection Migration and Resilience to NAT Rebinding . . 8 | |||
| 3.7. Version Negotiation . . . . . . . . . . . . . . . . . . . 8 | 3.7. Version Negotiation . . . . . . . . . . . . . . . . . . . 8 | |||
| 4. Versions . . . . . . . . . . . . . . . . . . . . . . . . . . 8 | 4. Versions . . . . . . . . . . . . . . . . . . . . . . . . . . 8 | |||
| 5. Packet Types and Formats . . . . . . . . . . . . . . . . . . 9 | 5. Packet Types and Formats . . . . . . . . . . . . . . . . . . 9 | |||
| 5.1. Long Header . . . . . . . . . . . . . . . . . . . . . . . 9 | 5.1. Long Header . . . . . . . . . . . . . . . . . . . . . . . 9 | |||
| 5.2. Short Header . . . . . . . . . . . . . . . . . . . . . . 11 | 5.2. Short Header . . . . . . . . . . . . . . . . . . . . . . 11 | |||
| 5.3. Version Negotiation Packet . . . . . . . . . . . . . . . 13 | 5.3. Version Negotiation Packet . . . . . . . . . . . . . . . 13 | |||
| 5.4. Cleartext Packets . . . . . . . . . . . . . . . . . . . . 14 | 5.4. Cleartext Packets . . . . . . . . . . . . . . . . . . . . 13 | |||
| 5.4.1. Client Initial Packet . . . . . . . . . . . . . . . . 14 | 5.4.1. Client Initial Packet . . . . . . . . . . . . . . . . 14 | |||
| 5.4.2. Server Stateless Retry Packet . . . . . . . . . . . . 15 | 5.4.2. Server Stateless Retry Packet . . . . . . . . . . . . 14 | |||
| 5.4.3. Server Cleartext Packet . . . . . . . . . . . . . . . 16 | 5.4.3. Server Cleartext Packet . . . . . . . . . . . . . . . 15 | |||
| 5.4.4. Client Cleartext Packet . . . . . . . . . . . . . . . 16 | 5.4.4. Client Cleartext Packet . . . . . . . . . . . . . . . 15 | |||
| 5.5. Protected Packets . . . . . . . . . . . . . . . . . . . . 16 | 5.5. Protected Packets . . . . . . . . . . . . . . . . . . . . 16 | |||
| 5.6. Connection ID . . . . . . . . . . . . . . . . . . . . . . 17 | 5.6. Connection ID . . . . . . . . . . . . . . . . . . . . . . 16 | |||
| 5.7. Packet Numbers . . . . . . . . . . . . . . . . . . . . . 17 | 5.7. Packet Numbers . . . . . . . . . . . . . . . . . . . . . 17 | |||
| 5.7.1. Initial Packet Number . . . . . . . . . . . . . . . . 19 | 5.7.1. Initial Packet Number . . . . . . . . . . . . . . . . 18 | |||
| 5.8. Handling Packets from Different Versions . . . . . . . . 19 | 5.8. Handling Packets from Different Versions . . . . . . . . 18 | |||
| 6. Frames and Frame Types . . . . . . . . . . . . . . . . . . . 19 | 6. Frames and Frame Types . . . . . . . . . . . . . . . . . . . 19 | |||
| 7. Life of a Connection . . . . . . . . . . . . . . . . . . . . 21 | 7. Life of a Connection . . . . . . . . . . . . . . . . . . . . 20 | |||
| 7.1. Version Negotiation . . . . . . . . . . . . . . . . . . . 22 | 7.1. Matching Packets to Connections . . . . . . . . . . . . . 21 | |||
| 7.1.1. Using Reserved Versions . . . . . . . . . . . . . . . 23 | 7.2. Version Negotiation . . . . . . . . . . . . . . . . . . . 22 | |||
| 7.2. Cryptographic and Transport Handshake . . . . . . . . . . 23 | 7.2.1. Sending Version Negotiation Packets . . . . . . . . . 22 | |||
| 7.3. Transport Parameters . . . . . . . . . . . . . . . . . . 25 | 7.2.2. Handling Version Negotiation Packets . . . . . . . . 23 | |||
| 7.3.1. Transport Parameter Definitions . . . . . . . . . . . 26 | 7.2.3. Using Reserved Versions . . . . . . . . . . . . . . . 23 | |||
| 7.3.2. Values of Transport Parameters for 0-RTT . . . . . . 27 | 7.3. Cryptographic and Transport Handshake . . . . . . . . . . 24 | |||
| 7.3.3. New Transport Parameters . . . . . . . . . . . . . . 28 | 7.4. Transport Parameters . . . . . . . . . . . . . . . . . . 25 | |||
| 7.3.4. Version Negotiation Validation . . . . . . . . . . . 28 | 7.4.1. Transport Parameter Definitions . . . . . . . . . . . 27 | |||
| 7.4. Stateless Retries . . . . . . . . . . . . . . . . . . . . 29 | 7.4.2. Values of Transport Parameters for 0-RTT . . . . . . 28 | |||
| 7.5. Proof of Source Address Ownership . . . . . . . . . . . . 30 | 7.4.3. New Transport Parameters . . . . . . . . . . . . . . 28 | |||
| 7.5.1. Client Address Validation Procedure . . . . . . . . . 31 | 7.4.4. Version Negotiation Validation . . . . . . . . . . . 29 | |||
| 7.5.2. Address Validation on Session Resumption . . . . . . 31 | 7.5. Stateless Retries . . . . . . . . . . . . . . . . . . . . 30 | |||
| 7.5.3. Address Validation Token Integrity . . . . . . . . . 32 | 7.6. Proof of Source Address Ownership . . . . . . . . . . . . 31 | |||
| 7.6. Connection Migration . . . . . . . . . . . . . . . . . . 32 | 7.6.1. Client Address Validation Procedure . . . . . . . . . 31 | |||
| 7.6.1. Privacy Implications of Connection Migration . . . . 33 | 7.6.2. Address Validation on Session Resumption . . . . . . 32 | |||
| 7.6.2. Address Validation for Migrated Connections . . . . . 34 | 7.6.3. Address Validation Token Integrity . . . . . . . . . 33 | |||
| 7.7. Connection Termination . . . . . . . . . . . . . . . . . 34 | 7.7. Connection Migration . . . . . . . . . . . . . . . . . . 33 | |||
| 7.7.1. Draining Period . . . . . . . . . . . . . . . . . . . 34 | 7.7.1. Privacy Implications of Connection Migration . . . . 33 | |||
| 7.7.2. Application Close . . . . . . . . . . . . . . . . . . 35 | 7.7.2. Address Validation for Migrated Connections . . . . . 35 | |||
| 7.7.3. Idle Timeout . . . . . . . . . . . . . . . . . . . . 35 | 7.8. Connection Termination . . . . . . . . . . . . . . . . . 35 | |||
| 7.7.4. Immediate Close . . . . . . . . . . . . . . . . . . . 35 | 7.8.1. Draining Period . . . . . . . . . . . . . . . . . . . 35 | |||
| 7.7.5. Stateless Reset . . . . . . . . . . . . . . . . . . . 36 | 7.8.2. Idle Timeout . . . . . . . . . . . . . . . . . . . . 35 | |||
| 8. Frame Types and Formats . . . . . . . . . . . . . . . . . . . 38 | 7.8.3. Immediate Close . . . . . . . . . . . . . . . . . . . 36 | |||
| 8.1. PADDING Frame . . . . . . . . . . . . . . . . . . . . . . 38 | 7.8.4. Stateless Reset . . . . . . . . . . . . . . . . . . . 36 | |||
| 8. Frame Types and Formats . . . . . . . . . . . . . . . . . . . 39 | ||||
| 8.1. PADDING Frame . . . . . . . . . . . . . . . . . . . . . . 39 | ||||
| 8.2. RST_STREAM Frame . . . . . . . . . . . . . . . . . . . . 39 | 8.2. RST_STREAM Frame . . . . . . . . . . . . . . . . . . . . 39 | |||
| 8.3. CONNECTION_CLOSE frame . . . . . . . . . . . . . . . . . 39 | 8.3. CONNECTION_CLOSE frame . . . . . . . . . . . . . . . . . 40 | |||
| 8.4. MAX_DATA Frame . . . . . . . . . . . . . . . . . . . . . 40 | 8.4. APPLICATION_CLOSE frame . . . . . . . . . . . . . . . . . 41 | |||
| 8.5. MAX_STREAM_DATA Frame . . . . . . . . . . . . . . . . . . 41 | 8.5. MAX_DATA Frame . . . . . . . . . . . . . . . . . . . . . 41 | |||
| 8.6. MAX_STREAM_ID Frame . . . . . . . . . . . . . . . . . . . 42 | 8.6. MAX_STREAM_DATA Frame . . . . . . . . . . . . . . . . . . 42 | |||
| 8.7. PING frame . . . . . . . . . . . . . . . . . . . . . . . 42 | 8.7. MAX_STREAM_ID Frame . . . . . . . . . . . . . . . . . . . 43 | |||
| 8.8. BLOCKED Frame . . . . . . . . . . . . . . . . . . . . . . 43 | 8.8. PING frame . . . . . . . . . . . . . . . . . . . . . . . 43 | |||
| 8.9. STREAM_BLOCKED Frame . . . . . . . . . . . . . . . . . . 43 | 8.9. BLOCKED Frame . . . . . . . . . . . . . . . . . . . . . . 44 | |||
| 8.10. STREAM_ID_BLOCKED Frame . . . . . . . . . . . . . . . . . 43 | 8.10. STREAM_BLOCKED Frame . . . . . . . . . . . . . . . . . . 44 | |||
| 8.11. NEW_CONNECTION_ID Frame . . . . . . . . . . . . . . . . . 44 | 8.11. STREAM_ID_BLOCKED Frame . . . . . . . . . . . . . . . . . 44 | |||
| 8.12. STOP_SENDING Frame . . . . . . . . . . . . . . . . . . . 44 | 8.12. NEW_CONNECTION_ID Frame . . . . . . . . . . . . . . . . . 45 | |||
| 8.13. ACK Frame . . . . . . . . . . . . . . . . . . . . . . . . 45 | 8.13. STOP_SENDING Frame . . . . . . . . . . . . . . . . . . . 45 | |||
| 8.13.1. ACK Block Section . . . . . . . . . . . . . . . . . 47 | 8.14. ACK Frame . . . . . . . . . . . . . . . . . . . . . . . . 46 | |||
| 8.13.2. Timestamp Section . . . . . . . . . . . . . . . . . 48 | 8.14.1. ACK Block Section . . . . . . . . . . . . . . . . . 48 | |||
| 8.13.3. ACK Frames and Packet Protection . . . . . . . . . . 50 | 8.14.2. ACK Frames and Packet Protection . . . . . . . . . . 50 | |||
| 8.14. STREAM Frame . . . . . . . . . . . . . . . . . . . . . . 51 | 8.15. STREAM Frame . . . . . . . . . . . . . . . . . . . . . . 51 | |||
| 9. Packetization and Reliability . . . . . . . . . . . . . . . . 53 | 9. Packetization and Reliability . . . . . . . . . . . . . . . . 52 | |||
| 9.1. Special Considerations for PMTU Discovery . . . . . . . . 55 | 9.1. Special Considerations for PMTU Discovery . . . . . . . . 55 | |||
| 10. Streams: QUIC's Data Structuring Abstraction . . . . . . . . 55 | 10. Streams: QUIC's Data Structuring Abstraction . . . . . . . . 55 | |||
| 10.1. Stream Identifiers . . . . . . . . . . . . . . . . . . . 56 | 10.1. Stream Identifiers . . . . . . . . . . . . . . . . . . . 56 | |||
| 10.2. Life of a Stream . . . . . . . . . . . . . . . . . . . . 56 | 10.2. Life of a Stream . . . . . . . . . . . . . . . . . . . . 56 | |||
| 10.2.1. idle . . . . . . . . . . . . . . . . . . . . . . . . 58 | 10.2.1. idle . . . . . . . . . . . . . . . . . . . . . . . . 58 | |||
| 10.2.2. open . . . . . . . . . . . . . . . . . . . . . . . . 58 | 10.2.2. open . . . . . . . . . . . . . . . . . . . . . . . . 58 | |||
| 10.2.3. half-closed (local) . . . . . . . . . . . . . . . . 59 | 10.2.3. half-closed (local) . . . . . . . . . . . . . . . . 59 | |||
| 10.2.4. half-closed (remote) . . . . . . . . . . . . . . . . 59 | 10.2.4. half-closed (remote) . . . . . . . . . . . . . . . . 59 | |||
| 10.2.5. closed . . . . . . . . . . . . . . . . . . . . . . . 60 | 10.2.5. closed . . . . . . . . . . . . . . . . . . . . . . . 60 | |||
| 10.3. Solicited State Transitions . . . . . . . . . . . . . . 60 | 10.3. Solicited State Transitions . . . . . . . . . . . . . . 60 | |||
| 10.4. Stream Concurrency . . . . . . . . . . . . . . . . . . . 61 | 10.4. Stream Concurrency . . . . . . . . . . . . . . . . . . . 61 | |||
| 10.5. Sending and Receiving Data . . . . . . . . . . . . . . . 61 | 10.5. Sending and Receiving Data . . . . . . . . . . . . . . . 62 | |||
| 10.6. Stream Prioritization . . . . . . . . . . . . . . . . . 62 | 10.6. Stream Prioritization . . . . . . . . . . . . . . . . . 62 | |||
| 11. Flow Control . . . . . . . . . . . . . . . . . . . . . . . . 63 | 11. Flow Control . . . . . . . . . . . . . . . . . . . . . . . . 63 | |||
| 11.1. Edge Cases and Other Considerations . . . . . . . . . . 64 | 11.1. Edge Cases and Other Considerations . . . . . . . . . . 64 | |||
| 11.1.1. Response to a RST_STREAM . . . . . . . . . . . . . . 65 | 11.1.1. Response to a RST_STREAM . . . . . . . . . . . . . . 65 | |||
| 11.1.2. Data Limit Increments . . . . . . . . . . . . . . . 65 | 11.1.2. Data Limit Increments . . . . . . . . . . . . . . . 65 | |||
| 11.2. Stream Limit Increment . . . . . . . . . . . . . . . . . 65 | 11.2. Stream Limit Increment . . . . . . . . . . . . . . . . . 66 | |||
| 11.2.1. Blocking on Flow Control . . . . . . . . . . . . . . 66 | 11.2.1. Blocking on Flow Control . . . . . . . . . . . . . . 66 | |||
| 11.3. Stream Final Offset . . . . . . . . . . . . . . . . . . 66 | 11.3. Stream Final Offset . . . . . . . . . . . . . . . . . . 66 | |||
| 12. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 67 | 12. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 67 | |||
| 12.1. Connection Errors . . . . . . . . . . . . . . . . . . . 67 | 12.1. Connection Errors . . . . . . . . . . . . . . . . . . . 67 | |||
| 12.2. Stream Errors . . . . . . . . . . . . . . . . . . . . . 68 | 12.2. Stream Errors . . . . . . . . . . . . . . . . . . . . . 68 | |||
| 12.3. Error Codes . . . . . . . . . . . . . . . . . . . . . . 68 | 12.3. Transport Error Codes . . . . . . . . . . . . . . . . . 68 | |||
| 12.4. Application Protocol Error Codes . . . . . . . . . . . . 70 | ||||
| 13. Security and Privacy Considerations . . . . . . . . . . . . . 70 | 13. Security and Privacy Considerations . . . . . . . . . . . . . 70 | |||
| 13.1. Spoofed ACK Attack . . . . . . . . . . . . . . . . . . . 70 | 13.1. Spoofed ACK Attack . . . . . . . . . . . . . . . . . . . 70 | |||
| 13.2. Slowloris Attacks . . . . . . . . . . . . . . . . . . . 70 | 13.2. Slowloris Attacks . . . . . . . . . . . . . . . . . . . 70 | |||
| 13.3. Stream Fragmentation and Reassembly Attacks . . . . . . 71 | 13.3. Stream Fragmentation and Reassembly Attacks . . . . . . 71 | |||
| 13.4. Stream Commitment Attack . . . . . . . . . . . . . . . . 71 | 13.4. Stream Commitment Attack . . . . . . . . . . . . . . . . 71 | |||
| 14. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 72 | 14. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 72 | |||
| 14.1. QUIC Transport Parameter Registry . . . . . . . . . . . 72 | 14.1. QUIC Transport Parameter Registry . . . . . . . . . . . 72 | |||
| 15. References . . . . . . . . . . . . . . . . . . . . . . . . . 73 | 14.2. QUIC Transport Error Codes Registry . . . . . . . . . . 73 | |||
| 15.1. Normative References . . . . . . . . . . . . . . . . . . 73 | 15. References . . . . . . . . . . . . . . . . . . . . . . . . . 75 | |||
| 15.2. Informative References . . . . . . . . . . . . . . . . . 74 | 15.1. Normative References . . . . . . . . . . . . . . . . . . 75 | |||
| 15.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 75 | 15.2. Informative References . . . . . . . . . . . . . . . . . 76 | |||
| Appendix A. Contributors . . . . . . . . . . . . . . . . . . . . 75 | 15.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 77 | |||
| Appendix B. Acknowledgments . . . . . . . . . . . . . . . . . . 75 | Appendix A. Contributors . . . . . . . . . . . . . . . . . . . . 77 | |||
| Appendix C. Change Log . . . . . . . . . . . . . . . . . . . . . 76 | Appendix B. Acknowledgments . . . . . . . . . . . . . . . . . . 77 | |||
| C.1. Since draft-ietf-quic-transport-05 . . . . . . . . . . . 76 | Appendix C. Change Log . . . . . . . . . . . . . . . . . . . . . 78 | |||
| C.2. Since draft-ietf-quic-transport-04 . . . . . . . . . . . 76 | C.1. Since draft-ietf-quic-transport-06 . . . . . . . . . . . 78 | |||
| C.3. Since draft-ietf-quic-transport-03 . . . . . . . . . . . 77 | C.2. Since draft-ietf-quic-transport-05 . . . . . . . . . . . 78 | |||
| C.4. Since draft-ietf-quic-transport-02 . . . . . . . . . . . 77 | C.3. Since draft-ietf-quic-transport-04 . . . . . . . . . . . 78 | |||
| C.5. Since draft-ietf-quic-transport-01 . . . . . . . . . . . 78 | C.4. Since draft-ietf-quic-transport-03 . . . . . . . . . . . 79 | |||
| C.6. Since draft-ietf-quic-transport-00 . . . . . . . . . . . 80 | C.5. Since draft-ietf-quic-transport-02 . . . . . . . . . . . 79 | |||
| C.7. Since draft-hamilton-quic-transport-protocol-01 . . . . . 80 | C.6. Since draft-ietf-quic-transport-01 . . . . . . . . . . . 80 | |||
| Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 80 | C.7. Since draft-ietf-quic-transport-00 . . . . . . . . . . . 82 | |||
| C.8. Since draft-hamilton-quic-transport-protocol-01 . . . . . 82 | ||||
| Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 82 | ||||
| 1. Introduction | 1. Introduction | |||
| QUIC is a multiplexed and secure transport protocol that runs on top | QUIC is a multiplexed and secure transport protocol that runs on top | |||
| of UDP. QUIC aims to provide a flexible set of features that allow | of UDP. QUIC aims to provide a flexible set of features that allow | |||
| it to be a general-purpose transport for multiple applications. | it to be a general-purpose transport for multiple applications. | |||
| QUIC implements techniques learned from experience with TCP, SCTP and | QUIC implements techniques learned from experience with TCP, SCTP and | |||
| other transport protocols. QUIC uses UDP as substrate so as to not | other transport protocols. QUIC uses UDP as substrate so as to not | |||
| require changes to legacy client operating systems and middleboxes to | require changes to legacy client operating systems and middleboxes to | |||
| skipping to change at page 5, line 43 ¶ | skipping to change at page 5, line 49 ¶ | |||
| Connection ID: The 64-bit unsigned number used as an identifier for | Connection ID: The 64-bit unsigned number used as an identifier for | |||
| a QUIC connection. | a QUIC connection. | |||
| QUIC packet: A well-formed UDP payload that can be parsed by a QUIC | QUIC packet: A well-formed UDP payload that can be parsed by a QUIC | |||
| receiver. QUIC packet size in this document refers to the UDP | receiver. QUIC packet size in this document refers to the UDP | |||
| payload size. | payload size. | |||
| 2.1. Notational Conventions | 2.1. Notational Conventions | |||
| Packet and frame diagrams use the format described in [RFC2360] | Packet and frame diagrams use the format described in Section 3.1 of | |||
| Section 3.1, with the following additional conventions: | [RFC2360], with the following additional conventions: | |||
| [x] Indicates that x is optional | [x] Indicates that x is optional | |||
| {x} Indicates that x is encrypted | {x} Indicates that x is encrypted | |||
| x (A) Indicates that x is A bits long | x (A) Indicates that x is A bits long | |||
| x (A/B/C) ... Indicates that x is one of A, B, or C bits long | x (A/B/C) ... Indicates that x is one of A, B, or C bits long | |||
| x (*) ... Indicates that x is variable-length | x (*) ... Indicates that x is variable-length | |||
| 3. A QUIC Overview | 3. A QUIC Overview | |||
| This section briefly describes QUIC's key mechanisms and benefits. | This section briefly describes QUIC's key mechanisms and benefits. | |||
| Key strengths of QUIC include: | Key strengths of QUIC include: | |||
| o Low-latency connection establishment | o Low-latency connection establishment | |||
| skipping to change at page 8, line 26 ¶ | skipping to change at page 8, line 31 ¶ | |||
| client continues to use the same session key for encrypting and | client continues to use the same session key for encrypting and | |||
| decrypting packets. The consistent connection ID can be used to | decrypting packets. The consistent connection ID can be used to | |||
| allow migration of the connection to a new server IP address as well, | allow migration of the connection to a new server IP address as well, | |||
| since the Connection ID remains consistent across changes in the | since the Connection ID remains consistent across changes in the | |||
| client's and the server's network addresses. | client's and the server's network addresses. | |||
| 3.7. Version Negotiation | 3.7. Version Negotiation | |||
| QUIC version negotiation allows for multiple versions of the protocol | QUIC version negotiation allows for multiple versions of the protocol | |||
| to be deployed and used concurrently. Version negotiation is | to be deployed and used concurrently. Version negotiation is | |||
| described in Section 7.1. | described in Section 7.2. | |||
| 4. Versions | 4. Versions | |||
| QUIC versions are identified using a 32-bit unsigned number. | QUIC versions are identified using a 32-bit unsigned number. | |||
| The version 0x00000000 is reserved to represent an invalid version. | The version 0x00000000 is reserved to represent an invalid version. | |||
| This version of the specification is identified by the number | This version of the specification is identified by the number | |||
| 0x00000001. | 0x00000001. | |||
| Version 0x00000001 of QUIC uses TLS as a cryptographic handshake | Version 0x00000001 of QUIC uses TLS as a cryptographic handshake | |||
| skipping to change at page 9, line 34 ¶ | skipping to change at page 9, line 38 ¶ | |||
| are referenced in subsequent mechanisms. | are referenced in subsequent mechanisms. | |||
| All numeric values are encoded in network byte order (that is, big- | All numeric values are encoded in network byte order (that is, big- | |||
| endian) and all field sizes are in bits. When discussing individual | endian) and all field sizes are in bits. When discussing individual | |||
| bits of fields, the least significant bit is referred to as bit 0. | bits of fields, the least significant bit is referred to as bit 0. | |||
| Hexadecimal notation is used for describing the value of fields. | Hexadecimal notation is used for describing the value of fields. | |||
| Any QUIC packet has either a long or a short header, as indicated by | Any QUIC packet has either a long or a short header, as indicated by | |||
| the Header Form bit. Long headers are expected to be used early in | the Header Form bit. Long headers are expected to be used early in | |||
| the connection before version negotiation and establishment of 1-RTT | the connection before version negotiation and establishment of 1-RTT | |||
| keys. Short headers are minimal version-specific headers, which can | keys. Short headers are minimal version-specific headers, which are | |||
| be used after version negotiation and 1-RTT keys are established. | used after version negotiation and 1-RTT keys are established. | |||
| 5.1. Long Header | 5.1. Long Header | |||
| 0 1 2 3 | 0 1 2 3 | |||
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | |||
| +-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+ | |||
| |1| Type (7) | | |1| Type (7) | | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | | | | | | |||
| + Connection ID (64) + | + Connection ID (64) + | |||
| | | | | | | |||
| skipping to change at page 10, line 24 ¶ | skipping to change at page 10, line 24 ¶ | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Version (32) | | | Version (32) | | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Payload (*) ... | | Payload (*) ... | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| Figure 1: Long Header Format | Figure 1: Long Header Format | |||
| Long headers are used for packets that are sent prior to the | Long headers are used for packets that are sent prior to the | |||
| completion of version negotiation and establishment of 1-RTT keys. | completion of version negotiation and establishment of 1-RTT keys. | |||
| Once both conditions are met, a sender SHOULD switch to sending | Once both conditions are met, a sender switches to sending packets | |||
| short-form headers. While inefficient, long headers MAY be used for | using the short header (Section 5.2). The long form allows for | |||
| packets encrypted with 1-RTT keys. The long form allows for special | special packets - such as the Version Negotiation packet - to be | |||
| packets - such as the Version Negotiation packet - to be represented | represented in this uniform fixed-length packet format. A long | |||
| in this uniform fixed-length packet format. A long header contains | header contains the following fields: | |||
| the following fields: | ||||
| Header Form: The most significant bit (0x80) of octet 0 (the first | Header Form: The most significant bit (0x80) of octet 0 (the first | |||
| octet) is set to 1 for long headers. | octet) is set to 1 for long headers. | |||
| Long Packet Type: The remaining seven bits of octet 0 contain the | Long Packet Type: The remaining seven bits of octet 0 contain the | |||
| packet type. This field can indicate one of 128 packet types. | packet type. This field can indicate one of 128 packet types. | |||
| The types specified for this version are listed in Table 1. | The types specified for this version are listed in Table 1. | |||
| Connection ID: Octets 1 through 8 contain the connection ID. | Connection ID: Octets 1 through 8 contain the connection ID. | |||
| Section 5.6 describes the use of this field in more detail. | Section 5.6 describes the use of this field in more detail. | |||
| skipping to change at page 11, line 5 ¶ | skipping to change at page 11, line 5 ¶ | |||
| Version: Octets 13 to 16 contain the selected protocol version. | Version: Octets 13 to 16 contain the selected protocol version. | |||
| This field indicates which version of QUIC is in use and | This field indicates which version of QUIC is in use and | |||
| determines how the rest of the protocol fields are interpreted. | determines how the rest of the protocol fields are interpreted. | |||
| Payload: Octets from 17 onwards (the rest of QUIC packet) are the | Payload: Octets from 17 onwards (the rest of QUIC packet) are the | |||
| payload of the packet. | payload of the packet. | |||
| The following packet types are defined: | The following packet types are defined: | |||
| +------+-------------------------------+---------------+ | +------+------------------------+---------------+ | |||
| | Type | Name | Section | | | Type | Name | Section | | |||
| +------+-------------------------------+---------------+ | +------+------------------------+---------------+ | |||
| | 0x01 | Version Negotiation | Section 5.3 | | | 0x01 | Version Negotiation | Section 5.3 | | |||
| | | | | | | | | | | |||
| | 0x02 | Client Initial | Section 5.4.1 | | | 0x02 | Client Initial | Section 5.4.1 | | |||
| | | | | | | | | | | |||
| | 0x03 | Server Stateless Retry | Section 5.4.2 | | | 0x03 | Server Stateless Retry | Section 5.4.2 | | |||
| | | | | | | | | | | |||
| | 0x04 | Server Cleartext | Section 5.4.3 | | | 0x04 | Server Cleartext | Section 5.4.3 | | |||
| | | | | | | | | | | |||
| | 0x05 | Client Cleartext | Section 5.4.4 | | | 0x05 | Client Cleartext | Section 5.4.4 | | |||
| | | | | | | | | | | |||
| | 0x06 | 0-RTT Protected | Section 5.5 | | | 0x06 | 0-RTT Protected | Section 5.5 | | |||
| | | | | | +------+------------------------+---------------+ | |||
| | 0x07 | 1-RTT Protected (key phase 0) | Section 5.5 | | ||||
| | | | | | ||||
| | 0x08 | 1-RTT Protected (key phase 1) | Section 5.5 | | ||||
| +------+-------------------------------+---------------+ | ||||
| Table 1: Long Header Packet Types | Table 1: Long Header Packet Types | |||
| The header form, packet type, connection ID, packet number and | The header form, packet type, connection ID, packet number and | |||
| version fields of a long header packet are version-independent. The | version fields of a long header packet are version-independent. The | |||
| types of packets defined in Table 1 are version-specific. See | types of packets defined in Table 1 are version-specific. See | |||
| Section 5.8 for details on how packets from different versions of | Section 5.8 for details on how packets from different versions of | |||
| QUIC are interpreted. | QUIC are interpreted. | |||
| (TODO: Should the list of packet types be version-independent?) | ||||
| The interpretation of the fields and the payload are specific to a | The interpretation of the fields and the payload are specific to a | |||
| version and packet type. Type-specific semantics for this version | version and packet type. Type-specific semantics for this version | |||
| are described in the following sections. | are described in the following sections. | |||
| 5.2. Short Header | 5.2. Short Header | |||
| 0 1 2 3 | 0 1 2 3 | |||
| 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 | |||
| +-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+ | |||
| |0|C|K| Type (5)| | |0|C|K| Type (5)| | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | | | | | | |||
| + [Connection ID (64)] + | + [Connection ID (64)] + | |||
| | | | | | | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Packet Number (8/16/32) ... | | Packet Number (8/16/32) ... | |||
| skipping to change at page 12, line 30 ¶ | skipping to change at page 12, line 12 ¶ | |||
| The short header can be used after the version and 1-RTT keys are | The short header can be used after the version and 1-RTT keys are | |||
| negotiated. This header form has the following fields: | negotiated. This header form has the following fields: | |||
| Header Form: The most significant bit (0x80) of octet 0 is set to 0 | Header Form: The most significant bit (0x80) of octet 0 is set to 0 | |||
| for the short header. | for the short header. | |||
| Connection ID Flag: The second bit (0x40) of octet 0 indicates | Connection ID Flag: The second bit (0x40) of octet 0 indicates | |||
| whether the Connection ID field is present. If set to 1, then the | whether the Connection ID field is present. If set to 1, then the | |||
| Connection ID field is present; if set to 0, the Connection ID | Connection ID field is present; if set to 0, the Connection ID | |||
| field is omitted. The Connection ID field can only be omitted if | field is omitted. The Connection ID field can only be omitted if | |||
| the omit_connection_id transport parameter (Section 7.3.1) is | the omit_connection_id transport parameter (Section 7.4.1) is | |||
| specified by the intended recipient of the packet. | specified by the intended recipient of the packet. | |||
| Key Phase Bit: The third bit (0x20) of octet 0 indicates the key | Key Phase Bit: The third bit (0x20) of octet 0 indicates the key | |||
| phase, which allows a recipient of a packet to identify the packet | phase, which allows a recipient of a packet to identify the packet | |||
| protection keys that are used to protect the packet. See | protection keys that are used to protect the packet. See | |||
| [QUIC-TLS] for details. | [QUIC-TLS] for details. | |||
| Short Packet Type: The remaining 5 bits of octet 0 include one of 32 | Short Packet Type: The remaining 5 bits of octet 0 include one of 32 | |||
| packet types. Table 2 lists the types that are defined for short | packet types. Table 2 lists the types that are defined for short | |||
| packets. | packets. | |||
| skipping to change at page 14, line 19 ¶ | skipping to change at page 13, line 41 ¶ | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | [Supported Version 2 (32)] ... | | [Supported Version 2 (32)] ... | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| ... | ... | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | [Supported Version N (32)] ... | | [Supported Version N (32)] ... | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| Figure 3: Version Negotiation Packet | Figure 3: Version Negotiation Packet | |||
| See Section 7.1 for a description of the version negotiation process. | See Section 7.2 for a description of the version negotiation process. | |||
| 5.4. Cleartext Packets | 5.4. Cleartext Packets | |||
| Cleartext packets are sent during the handshake prior to key | Cleartext packets are sent during the handshake prior to key | |||
| negotiation. | negotiation. | |||
| All cleartext packets contain the current QUIC version in the version | All cleartext packets contain the current QUIC version in the version | |||
| field. | field. | |||
| The payload of cleartext packets also includes an integrity check, | In order to prevent tampering by version-unaware middleboxes, | |||
| which is described in [QUIC-TLS]. | Cleartext packets are protected with a connection and version | |||
| specific key, as described in [QUIC-TLS]. This protection does not | ||||
| provide confidentiality or integrity against on-path attackers, but | ||||
| provides some level of protection against off-path attackers. | ||||
| 5.4.1. Client Initial Packet | 5.4.1. Client Initial Packet | |||
| The Client Initial packet uses long headers with a type value of | The Client Initial packet uses long headers with a type value of | |||
| 0x02. It carries the first cryptographic handshake message sent by | 0x02. It carries the first cryptographic handshake message sent by | |||
| the client. | the client. | |||
| The client populates the connection ID field with randomly selected | The client populates the connection ID field with randomly selected | |||
| values, unless it has received a packet from the server. If the | values, unless it has received a packet from the server. If the | |||
| client has received a packet from the server, the connection ID field | client has received a packet from the server, the connection ID field | |||
| uses the value provided by the server. | uses the value provided by the server. | |||
| The packet number used for Client Initial packets is initialized with | The first Client Initial packet that is sent by a client contains a | |||
| a random value each time the new contents are created for the packet. | random 31-bit value. All subsequent packets contain a packet number | |||
| Retransmissions of the packet contents increment the packet number by | that is incremented by one, see (Section 5.7). | |||
| one, see (Section 5.7). | ||||
| The payload of a Client Initial packet consists of a STREAM frame (or | The payload of a Client Initial packet consists of a STREAM frame (or | |||
| frames) for stream 0 containing a cryptographic handshake message, | frames) for stream 0 containing a cryptographic handshake message, | |||
| with enough PADDING frames that the packet is at least 1200 octets | with enough PADDING frames that the packet is at least 1200 octets | |||
| (see Section 9). The stream in this packet always starts at an | (see Section 9). The stream in this packet always starts at an | |||
| offset of 0 (see Section 7.4) and the complete cyptographic handshake | offset of 0 (see Section 7.5) and the complete cryptographic | |||
| message MUST fit in a single packet (see Section 7.2). | handshake message MUST fit in a single packet (see Section 7.3). | |||
| The client uses the Client Initial Packet type for any packet that | The client uses the Client Initial Packet type for any packet that | |||
| contains an initial cryptographic handshake message. This includes | contains an initial cryptographic handshake message. This includes | |||
| all cases where a new packet containing the initial cryptographic | all cases where a new packet containing the initial cryptographic | |||
| message needs to be created, this includes the packets sent after | message needs to be created, this includes the packets sent after | |||
| receiving a Version Negotiation (Section 5.3) or Server Stateless | receiving a Version Negotiation (Section 5.3) or Server Stateless | |||
| Retry packet (Section 5.4.2). | Retry packet (Section 5.4.2). | |||
| 5.4.2. Server Stateless Retry Packet | 5.4.2. Server Stateless Retry Packet | |||
| A Server Stateless Retry packet uses long headers with a type value | A Server Stateless Retry packet uses long headers with a type value | |||
| of 0x03. It carries cryptographic handshake messages and | of 0x03. It carries cryptographic handshake messages and | |||
| acknowledgments. It is used by a server that wishes to perform a | acknowledgments. It is used by a server that wishes to perform a | |||
| stateless retry (see Section 7.4). | stateless retry (see Section 7.5). | |||
| The packet number and connection ID fields echo the corresponding | The packet number and connection ID fields echo the corresponding | |||
| fields from the triggering client packet. This allows a client to | fields from the triggering client packet. This allows a client to | |||
| verify that the server received its packet. | verify that the server received its packet. | |||
| A Server Stateless Retry packet is never explicitly acknowledged in | A Server Stateless Retry packet is never explicitly acknowledged in | |||
| an ACK frame by a client. Receiving another Client Initial packet | an ACK frame by a client. Receiving another Client Initial packet | |||
| implicitly acknowledges a Server Stateless Retry packet. | implicitly acknowledges a Server Stateless Retry packet. | |||
| After receiving a Server Stateless Retry packet, the client uses a | After receiving a Server Stateless Retry packet, the client uses a | |||
| new Client Initial packet containing the next cryptographic handshake | new Client Initial packet containing the next cryptographic handshake | |||
| message. The client retains the state of its cryptographic | message. The client retains the state of its cryptographic | |||
| handshake, but discards all transport state. The new Client Initial | handshake, but discards all transport state. The Client Initial | |||
| packet includes a newly randomized packet number, STREAM frames on | packet that is generated in response to a Server Stateless Retry | |||
| stream 0 that start again at an offset of 0, and the original | packet includes STREAM frames on stream 0 that start again at an | |||
| connection ID. | offset of 0. | |||
| Continuing the cryptographic handshake is necessary to ensure that an | Continuing the cryptographic handshake is necessary to ensure that an | |||
| attacker cannot force a downgrade of any cryptographic parameters. | attacker cannot force a downgrade of any cryptographic parameters. | |||
| In addition to continuing the cryptographic handshake, the client | In addition to continuing the cryptographic handshake, the client | |||
| MUST remember the results of any version negotiation that occurred | MUST remember the results of any version negotiation that occurred | |||
| (see Section 7.1). The client MAY also retain any observed RTT or | (see Section 7.2). The client MAY also retain any observed RTT or | |||
| congestion state that it has accumulated for the flow, but other | congestion state that it has accumulated for the flow, but other | |||
| transport state MUST be discarded. | transport state MUST be discarded. | |||
| The payload of the Server Stateless Retry packet contains STREAM | The payload of the Server Stateless Retry packet contains a single | |||
| frames and could contain PADDING and ACK frames. A server can only | STREAM frame on stream 0 with offset 0 containing the server's | |||
| send a single Server Stateless Retry packet in response to each | cryptographic stateless retry material. It MUST NOT contain any | |||
| Client Initial packet that is receives. | other frames. The next STREAM frame sent by the server will also | |||
| start at stream offset 0. | ||||
| 5.4.3. Server Cleartext Packet | 5.4.3. Server Cleartext Packet | |||
| A Server Cleartext packet uses long headers with a type value of | A Server Cleartext packet uses long headers with a type value of | |||
| 0x04. It is used to carry acknowledgments and cryptographic | 0x04. It is used to carry acknowledgments and cryptographic | |||
| handshake messages from the server. | handshake messages from the server. | |||
| The connection ID field in a Server Cleartext packet contains a | The connection ID field in a Server Cleartext packet contains a | |||
| connection ID that is chosen by the server (see Section 5.6). | connection ID that is chosen by the server (see Section 5.6). | |||
| skipping to change at page 16, line 41 ¶ | skipping to change at page 16, line 19 ¶ | |||
| higher than the last Client Initial, 0-RTT Protected or Client | higher than the last Client Initial, 0-RTT Protected or Client | |||
| Cleartext packet that was sent. The packet number is incremented for | Cleartext packet that was sent. The packet number is incremented for | |||
| each subsequent packet, see Section 5.7. | each subsequent packet, see Section 5.7. | |||
| The payload of this packet contains STREAM frames and could contain | The payload of this packet contains STREAM frames and could contain | |||
| PADDING and ACK frames. | PADDING and ACK frames. | |||
| 5.5. Protected Packets | 5.5. Protected Packets | |||
| Packets that are protected with 0-RTT keys are sent with long | Packets that are protected with 0-RTT keys are sent with long | |||
| headers. Packets that are protected with 1-RTT keys MAY be sent with | headers; all packets protected with 1-RTT keys are sent with short | |||
| long headers. The different packet types explicitly indicate the | headers. The different packet types explicitly indicate the | |||
| encryption level and therefore the keys that are used to remove | encryption level and therefore the keys that are used to remove | |||
| packet protection. | packet protection. | |||
| Packets protected with 0-RTT keys use a type value of 0x06. The | Packets protected with 0-RTT keys use a type value of 0x06. The | |||
| connection ID field for a 0-RTT packet is selected by the client. | connection ID field for a 0-RTT packet is selected by the client. | |||
| The client can send 0-RTT packets after having received a packet from | The client can send 0-RTT packets after receiving a Server Cleartext | |||
| the server if that packet does not complete the handshake. Even if | packet (Section 5.4.3), if that packet does not complete the | |||
| the client receives a different connection ID from the server, it | handshake. Even if the client receives a different connection ID in | |||
| MUST NOT update the connection ID it uses for 0-RTT packets. This | the Server Cleartext packet, it MUST continue to use the connection | |||
| enables consistent routing for all 0-RTT packets. | ID selected by the client for 0-RTT packets, see Section 5.6. | |||
| Packets protected with 1-RTT keys that use long headers use a type | ||||
| value of 0x07 for key phase 0 and 0x08 for key phase 1; see | ||||
| [QUIC-TLS] for more details on the use of key phases. The connection | ||||
| ID field for these packet types MUST contain the value selected by | ||||
| the server, see Section 5.6. | ||||
| The version field for protected packets is the current QUIC version. | The version field for protected packets is the current QUIC version. | |||
| The packet number field contains a packet number, which increases | The packet number field contains a packet number, which increases | |||
| with each packet sent, see Section 5.7 for details. | with each packet sent, see Section 5.7 for details. | |||
| The payload is protected using authenticated encryption. [QUIC-TLS] | The payload is protected using authenticated encryption. [QUIC-TLS] | |||
| describes packet protection in detail. After decryption, the | describes packet protection in detail. After decryption, the | |||
| plaintext consists of a sequence of frames, as described in | plaintext consists of a sequence of frames, as described in | |||
| Section 6. | Section 6. | |||
| skipping to change at page 17, line 33 ¶ | skipping to change at page 17, line 6 ¶ | |||
| 5.6. Connection ID | 5.6. Connection ID | |||
| QUIC connections are identified by their 64-bit Connection ID. All | QUIC connections are identified by their 64-bit Connection ID. All | |||
| long headers contain a Connection ID. Short headers indicate the | long headers contain a Connection ID. Short headers indicate the | |||
| presence of a Connection ID using the CONNECTION_ID flag. When | presence of a Connection ID using the CONNECTION_ID flag. When | |||
| present, the Connection ID is in the same location in all packet | present, the Connection ID is in the same location in all packet | |||
| headers, making it straightforward for middleboxes, such as load | headers, making it straightforward for middleboxes, such as load | |||
| balancers, to locate and use it. | balancers, to locate and use it. | |||
| The client MUST choose a random connection ID and use it in Client | The client MUST choose a random connection ID and use it in Client | |||
| Initial packets (Section 5.4.1) and 0-RTT packets (Section 5.5). If | Initial packets (Section 5.4.1) and 0-RTT packets (Section 5.5). | |||
| the client has received any packet from the server, it uses the | ||||
| connection ID it received from the server for all packets other than | ||||
| 0-RTT packets. | ||||
| When the server receives a Client Initial packet and decides to | When the server receives a Client Initial packet and decides to | |||
| proceed with the handshake, it chooses a new value for the connection | proceed with the handshake, it chooses a new value for the connection | |||
| ID and sends that in a Server Cleartext packet. The server MAY | ID and sends that in a Server Cleartext packet (Section 5.4.3). The | |||
| choose to use the value that the client initially selects. | server MAY choose to use the value that the client initially selects. | |||
| Once the client receives the connection ID that the server has | Once the client receives the connection ID that the server has | |||
| chosen, it uses this for all subsequent packets that it sends, except | chosen, it MUST use it for all subsequent Client Cleartext | |||
| for any 0-RTT packets, which all have the same connection ID. | (Section 5.4.4) and 1-RTT (Section 5.5) packets but not for 0-RTT | |||
| packets (Section 5.5). | ||||
| Server's Version Negotiation (Section 5.3) and Stateless Retry | ||||
| (Section 5.4.2) packets MUST use connection ID selected by the | ||||
| client. | ||||
| 5.7. Packet Numbers | 5.7. Packet Numbers | |||
| The packet number is a 64-bit unsigned number and is used as part of | The packet number is a 64-bit unsigned number and is used as part of | |||
| a cryptographic nonce for packet encryption. Each endpoint maintains | a cryptographic nonce for packet encryption. Each endpoint maintains | |||
| a separate packet number for sending and receiving. The packet | a separate packet number for sending and receiving. The packet | |||
| number for sending MUST increase by at least one after sending any | number for sending MUST increase by at least one after sending any | |||
| packet, unless otherwise specified (see Section 5.7.1). | packet, unless otherwise specified (see Section 5.7.1). | |||
| A QUIC endpoint MUST NOT reuse a packet number within the same | A QUIC endpoint MUST NOT reuse a packet number within the same | |||
| connection (that is, under the same cryptographic keys). If the | connection (that is, under the same cryptographic keys). If the | |||
| packet number for sending reaches 2^64 - 1, the sender MUST close the | packet number for sending reaches 2^64 - 1, the sender MUST close the | |||
| connection without sending a CONNECTION_CLOSE frame or any further | connection without sending a CONNECTION_CLOSE frame or any further | |||
| packets; a server MAY send a Stateless Reset (Section 7.7.5) in | packets; a server MAY send a Stateless Reset (Section 7.8.4) in | |||
| response to further packets that it receives. | response to further packets that it receives. | |||
| To reduce the number of bits required to represent the packet number | To reduce the number of bits required to represent the packet number | |||
| over the wire, only the least significant bits of the packet number | over the wire, only the least significant bits of the packet number | |||
| are transmitted. The actual packet number for each packet is | are transmitted. The actual packet number for each packet is | |||
| reconstructed at the receiver based on the largest packet number | reconstructed at the receiver based on the largest packet number | |||
| received on a successfully authenticated packet. | received on a successfully authenticated packet. | |||
| A packet number is decoded by finding the packet number value that is | A packet number is decoded by finding the packet number value that is | |||
| closest to the next expected packet. The next expected packet is the | closest to the next expected packet. The next expected packet is the | |||
| skipping to change at page 19, line 16 ¶ | skipping to change at page 18, line 35 ¶ | |||
| The initial value for packet number MUST be selected from an uniform | The initial value for packet number MUST be selected from an uniform | |||
| random distribution between 0 and 2^31-1. That is, the lower 31 bits | random distribution between 0 and 2^31-1. That is, the lower 31 bits | |||
| of the packet number are randomized. [RFC4086] provides guidance on | of the packet number are randomized. [RFC4086] provides guidance on | |||
| the generation of random values. | the generation of random values. | |||
| The first set of packets sent by an endpoint MUST include the low | The first set of packets sent by an endpoint MUST include the low | |||
| 32-bits of the packet number. Once any packet has been acknowledged, | 32-bits of the packet number. Once any packet has been acknowledged, | |||
| subsequent packets can use a shorter packet number encoding. | subsequent packets can use a shorter packet number encoding. | |||
| A client that receives a Version Negotiation (Section 5.3) or Server | ||||
| Stateless Retry packet (Section 5.4.2) MUST generate a new initial | ||||
| packet number. This ensures that the first transmission attempt for | ||||
| a Client Initial packet (Section 5.4.1) always contains a randomized | ||||
| packet number, but packets that contain retransmissions increment the | ||||
| packet number. | ||||
| A client MUST NOT generate a new initial packet number if it discards | ||||
| the server packet. This might happen if the information the client | ||||
| retransmits its Client Initial packet. | ||||
| 5.8. Handling Packets from Different Versions | 5.8. Handling Packets from Different Versions | |||
| Between different versions the following things are guaranteed to | Between different versions the following things are guaranteed to | |||
| remain constant: | remain constant: | |||
| o the location of the header form flag, | o the location of the header form flag, | |||
| o the location of the Connection ID flag in short headers, | o the location of the Connection ID flag in short headers, | |||
| o the location and size of the Connection ID field in both header | o the location and size of the Connection ID field in both header | |||
| forms, | forms, | |||
| o the location and size of the Version field in long headers, and | o the location and size of the Version field in long headers, | |||
| o the location and size of the Packet Number field in long headers. | o the location and size of the Packet Number field in long headers, | |||
| and | ||||
| o the type, format and semantics of the Version Negotiation packet. | ||||
| Implementations MUST assume that an unsupported version uses an | Implementations MUST assume that an unsupported version uses an | |||
| unknown packet format. All other fields MUST be ignored when | unknown packet format. All other fields MUST be ignored when | |||
| processing a packet that contains an unsupported version. | processing a packet that contains an unsupported version. | |||
| 6. Frames and Frame Types | 6. Frames and Frame Types | |||
| The payload of cleartext packets and the plaintext after decryption | The payload of cleartext packets and the plaintext after decryption | |||
| of protected payloads consists of a sequence of frames, as shown in | of protected payloads consists of a sequence of frames, as shown in | |||
| Figure 4. | Figure 4. | |||
| skipping to change at page 21, line 14 ¶ | skipping to change at page 20, line 14 ¶ | |||
| +-------------+-------------------+--------------+ | +-------------+-------------------+--------------+ | |||
| | Type Value | Frame Type Name | Definition | | | Type Value | Frame Type Name | Definition | | |||
| +-------------+-------------------+--------------+ | +-------------+-------------------+--------------+ | |||
| | 0x00 | PADDING | Section 8.1 | | | 0x00 | PADDING | Section 8.1 | | |||
| | | | | | | | | | | |||
| | 0x01 | RST_STREAM | Section 8.2 | | | 0x01 | RST_STREAM | Section 8.2 | | |||
| | | | | | | | | | | |||
| | 0x02 | CONNECTION_CLOSE | Section 8.3 | | | 0x02 | CONNECTION_CLOSE | Section 8.3 | | |||
| | | | | | | | | | | |||
| | 0x04 | MAX_DATA | Section 8.4 | | | 0x03 | APPLICATION_CLOSE | Section 8.4 | | |||
| | | | | | | | | | | |||
| | 0x05 | MAX_STREAM_DATA | Section 8.5 | | | 0x04 | MAX_DATA | Section 8.5 | | |||
| | | | | | | | | | | |||
| | 0x06 | MAX_STREAM_ID | Section 8.6 | | | 0x05 | MAX_STREAM_DATA | Section 8.6 | | |||
| | | | | | | | | | | |||
| | 0x07 | PING | Section 8.7 | | | 0x06 | MAX_STREAM_ID | Section 8.7 | | |||
| | | | | | | | | | | |||
| | 0x08 | BLOCKED | Section 8.8 | | | 0x07 | PING | Section 8.8 | | |||
| | | | | | | | | | | |||
| | 0x09 | STREAM_BLOCKED | Section 8.9 | | | 0x08 | BLOCKED | Section 8.9 | | |||
| | | | | | | | | | | |||
| | 0x0a | STREAM_ID_BLOCKED | Section 8.10 | | | 0x09 | STREAM_BLOCKED | Section 8.10 | | |||
| | | | | | | | | | | |||
| | 0x0b | NEW_CONNECTION_ID | Section 8.11 | | | 0x0a | STREAM_ID_BLOCKED | Section 8.11 | | |||
| | | | | | | | | | | |||
| | 0x0c | STOP_SENDING | Section 8.12 | | | 0x0b | NEW_CONNECTION_ID | Section 8.12 | | |||
| | | | | | | | | | | |||
| | 0xa0 - 0xbf | ACK | Section 8.13 | | | 0x0c | STOP_SENDING | Section 8.13 | | |||
| | | | | | | | | | | |||
| | 0xc0 - 0xff | STREAM | Section 8.14 | | | 0xa0 - 0xbf | ACK | Section 8.14 | | |||
| | | | | | ||||
| | 0xc0 - 0xff | STREAM | Section 8.15 | | ||||
| +-------------+-------------------+--------------+ | +-------------+-------------------+--------------+ | |||
| Table 3: Frame Types | Table 3: Frame Types | |||
| 7. Life of a Connection | 7. Life of a Connection | |||
| A QUIC connection is a single conversation between two QUIC | A QUIC connection is a single conversation between two QUIC | |||
| endpoints. QUIC's connection establishment intertwines version | endpoints. QUIC's connection establishment intertwines version | |||
| negotiation with the cryptographic and transport handshakes to reduce | negotiation with the cryptographic and transport handshakes to reduce | |||
| connection establishment latency, as described in Section 7.2. Once | connection establishment latency, as described in Section 7.3. Once | |||
| established, a connection may migrate to a different IP or port at | established, a connection may migrate to a different IP or port at | |||
| either endpoint, due to NAT rebinding or mobility, as described in | either endpoint, due to NAT rebinding or mobility, as described in | |||
| Section 7.6. Finally a connection may be terminated by either | Section 7.7. Finally a connection may be terminated by either | |||
| endpoint, as described in Section 7.7. | endpoint, as described in Section 7.8. | |||
| 7.1. Version Negotiation | 7.1. Matching Packets to Connections | |||
| Incoming packets are classified on receipt. Packets can either be | ||||
| associated with an existing connection, be discarded, or - for | ||||
| servers - potentially create a new connection. | ||||
| Packets that can be associated with an existing connection are | ||||
| handled according to the current state of that connection. Packets | ||||
| are associated with existing connections using connection ID if it is | ||||
| present; this might include connection IDs that were advertised using | ||||
| NEW_CONNECTION_ID (Section 8.12). Packets without connection IDs and | ||||
| long-form packets for connections that have incomplete cryptographic | ||||
| handshakes are associated with an existing connection using the tuple | ||||
| of source and destination IP addresses and ports. | ||||
| A packet that uses the short header could be associated with an | ||||
| existing connection with an incomplete cryptographic handshake. Such | ||||
| a packet could be a valid packet that has been reordered with respect | ||||
| to the long-form packets that will complete the cryptographic | ||||
| handshake. This might happen after the final set of cryptographic | ||||
| handshake messages from either peer. These packets are expected to | ||||
| be correlated with a connection using the tuple of IP addresses and | ||||
| ports. Packets that might be reordered in this fashion SHOULD be | ||||
| buffered in anticipation of the handshake completing. | ||||
| 0-RTT packets might be received prior to a Client Initial packet at a | ||||
| server. If the version of these packets is acceptable to the server, | ||||
| it MAY buffer these packets in anticipation of receiving a reordered | ||||
| Client Initial packet. | ||||
| Buffering ensures that data is not lost, which improves performance; | ||||
| conversely, discarding these packets could create false loss signals | ||||
| for the congestion controllers. However, limiting the number and | ||||
| size of buffered packets might be needed to prevent exposure to | ||||
| denial of service. | ||||
| For clients, any packet that cannot be associated with an existing | ||||
| connection SHOULD be discarded if it is not buffered. Discarded | ||||
| packets MAY be logged for diagnostic or security purposes. | ||||
| For servers, packets that aren't associated with a connection | ||||
| potentially create a new connection. However, only packets that use | ||||
| the long packet header and that are at least the minimum size defined | ||||
| for the protocol version can be initial packets. A server MAY | ||||
| discard packets with a short header or packets that are smaller than | ||||
| the smallest minimum size for any version that the server supports. | ||||
| A server that discards a packet that cannot be associated with a | ||||
| connection MAY also generate a stateless reset (Section 7.8.4). | ||||
| This version of QUIC defines a minimum size for initial packets of | ||||
| 1200 octets (see Section 9). Versions of QUIC that define smaller | ||||
| minimum initial packet sizes need to be aware that initial packets | ||||
| will be discarded without action by servers that only support | ||||
| versions with larger minimums. Clients that support multiple QUIC | ||||
| versions can avoid this problem by ensuring that they increase the | ||||
| size of their initial packets to the largest minimum size across all | ||||
| of the QUIC versions they support. Servers need to recognize initial | ||||
| packets that are the minimum size of all QUIC versions they support. | ||||
| 7.2. Version Negotiation | ||||
| QUIC's connection establishment begins with version negotiation, | QUIC's connection establishment begins with version negotiation, | |||
| since all communication between the endpoints, including packet and | since all communication between the endpoints, including packet and | |||
| frame formats, relies on the two endpoints agreeing on a version. | frame formats, relies on the two endpoints agreeing on a version. | |||
| A QUIC connection begins with a client sending a handshake packet. | A QUIC connection begins with a client sending a Client Initial | |||
| The details of the handshake mechanisms are described in Section 7.2, | packet (Section 5.4.1). The details of the handshake mechanisms are | |||
| but all of the initial packets sent from the client to the server | described in Section 7.3, but all of the initial packets sent from | |||
| MUST use the long header format and MUST specify the version of the | the client to the server MUST use the long header format - which | |||
| protocol being used. | includes the version of the protocol being used - and they MUST be | |||
| padded to at least 1200 octets. | ||||
| When the server receives a packet from a client with the long header | The server receives this packet and determines whether it potentially | |||
| format, it compares the client's version to the versions it supports. | creates a new connection (see Section 7.1). If the packet might | |||
| generate a new connection, the server then checks whether it | ||||
| understands the version that the client has selected. | ||||
| If the packet contains a version that is acceptable to the server, | ||||
| the server proceeds with the handshake (Section 7.3). This commits | ||||
| the server to the version that the client selected. | ||||
| 7.2.1. Sending Version Negotiation Packets | ||||
| If the version selected by the client is not acceptable to the | If the version selected by the client is not acceptable to the | |||
| server, the server discards the incoming packet and responds with a | server, the server responds with a Version Negotiation packet | |||
| Version Negotiation packet (Section 5.3). This includes a list of | (Section 5.3). This includes a list of versions that the server will | |||
| versions that the server will accept. | accept. | |||
| To avoid packet amplification attacks a server MUST NOT send a | A server sends a Version Negotiation packet for any packet with an | |||
| Version Negotiation packet that is larger than the packet it responds | unacceptable version if that packet could create a new connection. | |||
| to. It is anticipated that this is ample space for all QUIC versions | This allows a server to process packets with unsupported versions | |||
| that a single server might need to advertise. | without retaining state. Though either the Client Initial packet or | |||
| the version negotiation packet that is sent in response could be | ||||
| lost, the client will send new packets until it successfully receives | ||||
| a response or it abandons the connection attempt. | ||||
| A server sends a Version Negotiation packet for every packet that it | 7.2.2. Handling Version Negotiation Packets | |||
| receives with an unacceptable version. This allows a server to | ||||
| process packets with unsupported versions without retaining state. | ||||
| Though either the initial client packet or the version negotiation | ||||
| packet that is sent in response could be lost, the client will send | ||||
| new packets until it successfully receives a response. | ||||
| If the packet contains a version that is acceptable to the server, | When the client receives a Version Negotiation packet, it first | |||
| the server proceeds with the handshake (Section 7.2). This commits | checks that the packet number and connection ID match the values the | |||
| the server to the version that the client selected. | client sent in a previous packet on the same connection. If this | |||
| check fails, the packet MUST be discarded. | ||||
| When the client receives a Version Negotiation packet from the | Once the Version Negotiation packet is determined to be valid, the | |||
| server, it should select an acceptable protocol version. If the | client then selects an acceptable protocol version from the list | |||
| server lists an acceptable version, the client selects that version | provided by the server. The client then attempts to create a | |||
| and reattempts to create a connection using that version. Though the | connection using that version. Though the contents of the Client | |||
| contents of a packet might not change in response to version | Initial packet the client sends might not change in response to | |||
| negotiation, a client MUST increase the packet number it uses on | version negotiation, a client MUST increase the packet number it uses | |||
| every packet it sends. Packets MUST continue to use long headers and | on every packet it sends. Packets MUST continue to use long headers | |||
| MUST include the new negotiated protocol version. | and MUST include the new negotiated protocol version. | |||
| The client MUST use the long header format and include its selected | The client MUST use the long header format and include its selected | |||
| version on all packets until it has 1-RTT keys and it has received a | version on all packets until it has 1-RTT keys and it has received a | |||
| packet from the server which is not a Version Negotiation packet. | packet from the server which is not a Version Negotiation packet. | |||
| A client MUST NOT change the version it uses unless it is in response | A client MUST NOT change the version it uses unless it is in response | |||
| to a Version Negotiation packet from the server. Once a client | to a Version Negotiation packet from the server. Once a client | |||
| receives a packet from the server which is not a Version Negotiation | receives a packet from the server which is not a Version Negotiation | |||
| packet, it MUST ignore other Version Negotiation packets on the same | packet, it MUST discard other Version Negotiation packets on the same | |||
| connection. Similarly, a client MUST ignore a Version Negotiation | connection. Similarly, a client MUST ignore a Version Negotiation | |||
| packet if it has already received and acted on a Version Negotiation | packet if it has already received and acted on a Version Negotiation | |||
| packet. | packet. | |||
| A client MUST ignore a Version Negotiation packet that lists the | A client MUST ignore a Version Negotiation packet that lists the | |||
| client's chosen version. | client's chosen version. | |||
| Version negotiation uses unprotected data. The result of the | Version negotiation packets have no cryptographic protection. The | |||
| negotiation MUST be revalidated as part of the cryptographic | result of the negotiation MUST be revalidated as part of the | |||
| handshake (see Section 7.3.4). | cryptographic handshake (see Section 7.4.4). | |||
| 7.1.1. Using Reserved Versions | 7.2.3. Using Reserved Versions | |||
| For a server to use a new version in the future, clients must | For a server to use a new version in the future, clients must | |||
| correctly handle unsupported versions. To help ensure this, a server | correctly handle unsupported versions. To help ensure this, a server | |||
| SHOULD include a reserved version (see Section 4) while generating a | SHOULD include a reserved version (see Section 4) while generating a | |||
| Version Negotiation packet. | Version Negotiation packet. | |||
| The design of version negotiation permits a server to avoid | The design of version negotiation permits a server to avoid | |||
| maintaining state for packets that it rejects in this fashion. | maintaining state for packets that it rejects in this fashion. | |||
| However, when the server generates a Version Negotiation packet, it | However, when the server generates a Version Negotiation packet, it | |||
| cannot randomly generate a reserved version number. This is because | cannot randomly generate a reserved version number. This is because | |||
| the server is required to include the same value in its transport | the server is required to include the same value in its transport | |||
| parameters (see Section 7.3.4). To avoid the selected version number | parameters (see Section 7.4.4). To avoid the selected version number | |||
| changing during connection establishment, the reserved version SHOULD | changing during connection establishment, the reserved version SHOULD | |||
| be generated as a function of values that will be available to the | be generated as a function of values that will be available to the | |||
| server when later generating its handshake packets. | server when later generating its handshake packets. | |||
| A pseudorandom function that takes client address information (IP and | A pseudorandom function that takes client address information (IP and | |||
| port) and the client selected version as input would ensure that | port) and the client selected version as input would ensure that | |||
| there is sufficient variability in the values that a server uses. | there is sufficient variability in the values that a server uses. | |||
| A client MAY send a packet using a reserved version number. This can | A client MAY send a packet using a reserved version number. This can | |||
| be used to solicit a list of supported versions from a server. | be used to solicit a list of supported versions from a server. | |||
| 7.2. Cryptographic and Transport Handshake | 7.3. Cryptographic and Transport Handshake | |||
| QUIC relies on a combined cryptographic and transport handshake to | QUIC relies on a combined cryptographic and transport handshake to | |||
| minimize connection establishment latency. QUIC allocates stream 0 | minimize connection establishment latency. QUIC allocates stream 0 | |||
| for the cryptographic handshake. Version 0x00000001 of QUIC uses TLS | for the cryptographic handshake. Version 0x00000001 of QUIC uses TLS | |||
| 1.3 as described in [QUIC-TLS]; a different QUIC version number could | 1.3 as described in [QUIC-TLS]; a different QUIC version number could | |||
| indicate that a different cryptographic handshake protocol is in use. | indicate that a different cryptographic handshake protocol is in use. | |||
| QUIC provides this stream with reliable, ordered delivery of data. | QUIC provides this stream with reliable, ordered delivery of data. | |||
| In return, the cryptographic handshake provides QUIC with: | In return, the cryptographic handshake provides QUIC with: | |||
| skipping to change at page 24, line 22 ¶ | skipping to change at page 24, line 40 ¶ | |||
| * a client is optionally authenticated, | * a client is optionally authenticated, | |||
| * every connection produces distinct and unrelated keys, | * every connection produces distinct and unrelated keys, | |||
| * keying material is usable for packet protection for both 0-RTT | * keying material is usable for packet protection for both 0-RTT | |||
| and 1-RTT packets, and | and 1-RTT packets, and | |||
| * 1-RTT keys have forward secrecy | * 1-RTT keys have forward secrecy | |||
| o authenticated values for the transport parameters of the peer (see | o authenticated values for the transport parameters of the peer (see | |||
| Section 7.3) | Section 7.4) | |||
| o authenticated confirmation of version negotiation (see | o authenticated confirmation of version negotiation (see | |||
| Section 7.3.4) | Section 7.4.4) | |||
| o authenticated negotiation of an application protocol (TLS uses | o authenticated negotiation of an application protocol (TLS uses | |||
| ALPN [RFC7301] for this purpose) | ALPN [RFC7301] for this purpose) | |||
| o for the server, the ability to carry data that provides assurance | o for the server, the ability to carry data that provides assurance | |||
| that the client can receive packets that are addressed with the | that the client can receive packets that are addressed with the | |||
| transport address that is claimed by the client (see Section 7.5) | transport address that is claimed by the client (see Section 7.6) | |||
| The initial cryptographic handshake message MUST be sent in a single | The initial cryptographic handshake message MUST be sent in a single | |||
| packet. Any second attempt that is triggered by address validation | packet. Any second attempt that is triggered by address validation | |||
| MUST also be sent within a single packet. This avoids having to | MUST also be sent within a single packet. This avoids having to | |||
| reassemble a message from multiple packets. Reassembling messages | reassemble a message from multiple packets. Reassembling messages | |||
| requires that a server maintain state prior to establishing a | requires that a server maintain state prior to establishing a | |||
| connection, exposing the server to a denial of service risk. | connection, exposing the server to a denial of service risk. | |||
| The first client packet of the cryptographic handshake protocol MUST | The first client packet of the cryptographic handshake protocol MUST | |||
| fit within a 1232 octet QUIC packet payload. This includes overheads | fit within a 1232 octet QUIC packet payload. This includes overheads | |||
| that reduce the space available to the cryptographic handshake | that reduce the space available to the cryptographic handshake | |||
| protocol. | protocol. | |||
| Details of how TLS is integrated with QUIC is provided in more detail | Details of how TLS is integrated with QUIC is provided in more detail | |||
| in [QUIC-TLS]. | in [QUIC-TLS]. | |||
| 7.3. Transport Parameters | 7.4. Transport Parameters | |||
| During connection establishment, both endpoints make authenticated | During connection establishment, both endpoints make authenticated | |||
| declarations of their transport parameters. These declarations are | declarations of their transport parameters. These declarations are | |||
| made unilaterally by each endpoint. Endpoints are required to comply | made unilaterally by each endpoint. Endpoints are required to comply | |||
| with the restrictions implied by these parameters; the description of | with the restrictions implied by these parameters; the description of | |||
| each parameter includes rules for its handling. | each parameter includes rules for its handling. | |||
| The format of the transport parameters is the TransportParameters | The format of the transport parameters is the TransportParameters | |||
| struct from Figure 6. This is described using the presentation | struct from Figure 6. This is described using the presentation | |||
| language from Section 3 of [I-D.ietf-tls-tls13]. | language from Section 3 of [I-D.ietf-tls-tls13]. | |||
| skipping to change at page 26, line 14 ¶ | skipping to change at page 26, line 49 ¶ | |||
| The "extension_data" field of the quic_transport_parameters extension | The "extension_data" field of the quic_transport_parameters extension | |||
| defined in [QUIC-TLS] contains a TransportParameters value. TLS | defined in [QUIC-TLS] contains a TransportParameters value. TLS | |||
| encoding rules are therefore used to encode the transport parameters. | encoding rules are therefore used to encode the transport parameters. | |||
| QUIC encodes transport parameters into a sequence of octets, which | QUIC encodes transport parameters into a sequence of octets, which | |||
| are then included in the cryptographic handshake. Once the handshake | are then included in the cryptographic handshake. Once the handshake | |||
| completes, the transport parameters declared by the peer are | completes, the transport parameters declared by the peer are | |||
| available. Each endpoint validates the value provided by its peer. | available. Each endpoint validates the value provided by its peer. | |||
| In particular, version negotiation MUST be validated (see | In particular, version negotiation MUST be validated (see | |||
| Section 7.3.4) before the connection establishment is considered | Section 7.4.4) before the connection establishment is considered | |||
| properly complete. | properly complete. | |||
| Definitions for each of the defined transport parameters are included | Definitions for each of the defined transport parameters are included | |||
| in Section 7.3.1. | in Section 7.4.1. Any given parameter MUST appear at most once in a | |||
| given transport parameters extension. An endpoint MUST treat receipt | ||||
| of duplicate transport parameters as a connection error of type | ||||
| TRANSPORT_PARAMETER_ERROR. | ||||
| 7.3.1. Transport Parameter Definitions | 7.4.1. Transport Parameter Definitions | |||
| An endpoint MUST include the following parameters in its encoded | An endpoint MUST include the following parameters in its encoded | |||
| TransportParameters: | TransportParameters: | |||
| initial_max_stream_data (0x0000): The initial stream maximum data | initial_max_stream_data (0x0000): The initial stream maximum data | |||
| parameter contains the initial value for the maximum data that can | parameter contains the initial value for the maximum data that can | |||
| be sent on any newly created stream. This parameter is encoded as | be sent on any newly created stream. This parameter is encoded as | |||
| an unsigned 32-bit integer in units of octets. This is equivalent | an unsigned 32-bit integer in units of octets. This is equivalent | |||
| to an implicit MAX_STREAM_DATA frame (Section 8.5) being sent on | to an implicit MAX_STREAM_DATA frame (Section 8.6) being sent on | |||
| all streams immediately after opening. | all streams immediately after opening. | |||
| initial_max_data (0x0001): The initial maximum data parameter | initial_max_data (0x0001): The initial maximum data parameter | |||
| contains the initial value for the maximum amount of data that can | contains the initial value for the maximum amount of data that can | |||
| be sent on the connection. This parameter is encoded as an | be sent on the connection. This parameter is encoded as an | |||
| unsigned 32-bit integer in units of 1024 octets. That is, the | unsigned 32-bit integer in units of 1024 octets. That is, the | |||
| value here is multiplied by 1024 to determine the actual maximum | value here is multiplied by 1024 to determine the actual maximum | |||
| value. This is equivalent to sending a MAX_DATA (Section 8.4) for | value. This is equivalent to sending a MAX_DATA (Section 8.5) for | |||
| the connection immediately after completing the handshake. | the connection immediately after completing the handshake. | |||
| initial_max_stream_id (0x0002): The initial maximum stream ID | initial_max_stream_id (0x0002): The initial maximum stream ID | |||
| parameter contains the initial maximum stream number the peer may | parameter contains the initial maximum stream number the peer may | |||
| initiate, encoded as an unsigned 32-bit integer. This is | initiate, encoded as an unsigned 32-bit integer. This is | |||
| equivalent to sending a MAX_STREAM_ID (Section 8.6) immediately | equivalent to sending a MAX_STREAM_ID (Section 8.7) immediately | |||
| after completing the handshake. | after completing the handshake. | |||
| idle_timeout (0x0003): The idle timeout is a value in seconds that | idle_timeout (0x0003): The idle timeout is a value in seconds that | |||
| is encoded as an unsigned 16-bit integer. The maximum value is | is encoded as an unsigned 16-bit integer. The maximum value is | |||
| 600 seconds (10 minutes). | 600 seconds (10 minutes). | |||
| A server MUST include the following transport parameters: | A server MUST include the following transport parameters: | |||
| stateless_reset_token (0x0006): The Stateless Reset Token is used in | stateless_reset_token (0x0006): The Stateless Reset Token is used in | |||
| verifying a stateless reset, see Section 7.7.5. This parameter is | verifying a stateless reset, see Section 7.8.4. This parameter is | |||
| a sequence of 16 octets. | a sequence of 16 octets. | |||
| A client MUST NOT include a stateless reset token. A server MUST | A client MUST NOT include a stateless reset token. A server MUST | |||
| treat receipt of a stateless_reset_token transport parameter as a | treat receipt of a stateless_reset_token transport parameter as a | |||
| connection error of type TRANSPORT_PARAMETER_ERROR. | connection error of type TRANSPORT_PARAMETER_ERROR. | |||
| An endpoint MAY use the following transport parameters: | An endpoint MAY use the following transport parameters: | |||
| omit_connection_id (0x0004): The omit connection identifier | omit_connection_id (0x0004): The omit connection identifier | |||
| parameter indicates that packets sent to the endpoint that | parameter indicates that packets sent to the endpoint that | |||
| skipping to change at page 27, line 32 ¶ | skipping to change at page 28, line 22 ¶ | |||
| every packet. | every packet. | |||
| max_packet_size (0x0005): The maximum packet size parameter places a | max_packet_size (0x0005): The maximum packet size parameter places a | |||
| limit on the size of packets that the endpoint is willing to | limit on the size of packets that the endpoint is willing to | |||
| receive, encoded as an unsigned 16-bit integer. This indicates | receive, encoded as an unsigned 16-bit integer. This indicates | |||
| that packets larger than this limit will be dropped. The default | that packets larger than this limit will be dropped. The default | |||
| for this parameter is the maximum permitted UDP payload of 65527. | for this parameter is the maximum permitted UDP payload of 65527. | |||
| Values below 1200 are invalid. This limit only applies to | Values below 1200 are invalid. This limit only applies to | |||
| protected packets (Section 5.5). | protected packets (Section 5.5). | |||
| 7.3.2. Values of Transport Parameters for 0-RTT | 7.4.2. Values of Transport Parameters for 0-RTT | |||
| Transport parameters from the server MUST be remembered by the client | Transport parameters from the server MUST be remembered by the client | |||
| for use with 0-RTT data. If the TLS NewSessionTicket message | for use with 0-RTT data. If the TLS NewSessionTicket message | |||
| includes the quic_transport_parameters extension, then those values | includes the quic_transport_parameters extension, then those values | |||
| are used for the server values when establishing a new connection | are used for the server values when establishing a new connection | |||
| using that ticket. Otherwise, the transport parameters that the | using that ticket. Otherwise, the transport parameters that the | |||
| server advertises during connection establishment are used. | server advertises during connection establishment are used. | |||
| A server can remember the transport parameters that it advertised, or | A server can remember the transport parameters that it advertised, or | |||
| store an integrity-protected copy of the values in the ticket and | store an integrity-protected copy of the values in the ticket and | |||
| skipping to change at page 28, line 10 ¶ | skipping to change at page 28, line 48 ¶ | |||
| data is accepted by the server, the server MUST NOT reduce any limits | data is accepted by the server, the server MUST NOT reduce any limits | |||
| or alter any values that might be violated by the client with its | or alter any values that might be violated by the client with its | |||
| 0-RTT data. In particular, a server that accepts 0-RTT data MUST NOT | 0-RTT data. In particular, a server that accepts 0-RTT data MUST NOT | |||
| set values for initial_max_data or initial_max_stream_data that are | set values for initial_max_data or initial_max_stream_data that are | |||
| smaller than the remembered value of those parameters. Similarly, a | smaller than the remembered value of those parameters. Similarly, a | |||
| server MUST NOT reduce the value of initial_max_stream_id. | server MUST NOT reduce the value of initial_max_stream_id. | |||
| A server MUST reject 0-RTT data or even abort a handshake if the | A server MUST reject 0-RTT data or even abort a handshake if the | |||
| implied values for transport parameters cannot be supported. | implied values for transport parameters cannot be supported. | |||
| 7.3.3. New Transport Parameters | 7.4.3. 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. | optional protocol feature that is negotiated using the parameter. | |||
| New transport parameters can be registered according to the rules in | New transport parameters can be registered according to the rules in | |||
| Section 14.1. | Section 14.1. | |||
| 7.3.4. Version Negotiation Validation | 7.4.4. Version Negotiation Validation | |||
| The transport parameters include three fields that encode version | The transport parameters include three fields that encode version | |||
| information. These retroactively authenticate the version | information. These retroactively authenticate the version | |||
| negotiation (see Section 7.1) that is performed prior to the | negotiation (see Section 7.2) that is performed prior to the | |||
| cryptographic handshake. | cryptographic handshake. | |||
| The cryptographic handshake provides integrity protection for the | The cryptographic handshake provides integrity protection for the | |||
| negotiated version as part of the transport parameters (see | negotiated version as part of the transport parameters (see | |||
| Section 7.3). As a result, modification of version negotiation | Section 7.4). As a result, modification of version negotiation | |||
| packets by an attacker can be detected. | packets by an attacker can be detected. | |||
| The client includes two fields in the transport parameters: | The client includes two fields in the transport parameters: | |||
| o The negotiated_version is the version that was finally selected | o The negotiated_version is the version that was finally selected | |||
| for use. This MUST be identical to the value that is on the | for use. This MUST be identical to the value that is on the | |||
| packet that carries the ClientHello. A server that receives a | packet that carries the ClientHello. A server that receives a | |||
| negotiated_version that does not match the version of QUIC that is | negotiated_version that does not match the version of QUIC that is | |||
| in use MUST terminate the connection with a | in use MUST terminate the connection with a | |||
| VERSION_NEGOTIATION_ERROR error code. | VERSION_NEGOTIATION_ERROR error code. | |||
| skipping to change at page 29, line 41 ¶ | skipping to change at page 30, line 31 ¶ | |||
| When an endpoint accepts multiple QUIC versions, it can potentially | When an endpoint accepts multiple QUIC versions, it can potentially | |||
| interpret transport parameters as they are defined by any of the QUIC | interpret transport parameters as they are defined by any of the QUIC | |||
| versions it supports. The version field in the QUIC packet header is | versions it supports. The version field in the QUIC packet header is | |||
| authenticated using transport parameters. The position and the | authenticated using transport parameters. The position and the | |||
| format of the version fields in transport parameters MUST either be | format of the version fields in transport parameters MUST either be | |||
| identical across different QUIC versions, or be unambiguously | identical across different QUIC versions, or be unambiguously | |||
| different to ensure no confusion about their interpretation. One way | different to ensure no confusion about their interpretation. One way | |||
| that a new format could be introduced is to define a TLS extension | that a new format could be introduced is to define a TLS extension | |||
| with a different codepoint. | with a different codepoint. | |||
| 7.4. Stateless Retries | 7.5. Stateless Retries | |||
| A server can process an initial cryptographic handshake messages from | A server can process an initial cryptographic handshake messages from | |||
| a client without committing any state. This allows a server to | a client without committing any state. This allows a server to | |||
| perform address validation (Section 7.5, or to defer connection | perform address validation (Section 7.6, or to defer connection | |||
| establishment costs. | establishment costs. | |||
| A server that generates a response to an initial packet without | A server that generates a response to an initial packet without | |||
| retaining connection state MUST use the Server Stateless Retry packet | retaining connection state MUST use the Server Stateless Retry packet | |||
| (Section 5.4.2). This packet causes a client to reset its transport | (Section 5.4.2). This packet causes a client to reset its transport | |||
| state and to continue the connection attempt with new connection | state and to continue the connection attempt with new connection | |||
| state while maintaining the state of the cryptographic handshake. | state while maintaining the state of the cryptographic handshake. | |||
| A server MUST NOT send multiple Server Stateless Retry packets in | A server MUST NOT send multiple Server Stateless Retry packets in | |||
| response to a client handshake packet. Thus, any cryptographic | response to a client handshake packet. Thus, any cryptographic | |||
| handshake message that is sent MUST fit within a single packet. | handshake message that is sent MUST fit within a single packet. | |||
| In TLS, the Server Stateless Retry packet type is used to carry the | In TLS, the Server Stateless Retry packet type is used to carry the | |||
| HelloRetryRequest message. | HelloRetryRequest message. | |||
| 7.5. Proof of Source Address Ownership | 7.6. Proof of Source Address Ownership | |||
| Transport protocols commonly spend a round trip checking that a | Transport protocols commonly spend a round trip checking that a | |||
| client owns the transport address (IP and port) that it claims. | client owns the transport address (IP and port) that it claims. | |||
| Verifying that a client can receive packets sent to its claimed | Verifying that a client can receive packets sent to its claimed | |||
| transport address protects against spoofing of this information by | transport address protects against spoofing of this information by | |||
| malicious clients. | malicious clients. | |||
| This technique is used primarily to avoid QUIC from being used for | This technique is used primarily to avoid QUIC from being used for | |||
| traffic amplification attack. In such an attack, a packet is sent to | traffic amplification attack. In such an attack, a packet is sent to | |||
| a server with spoofed source address information that identifies a | a server with spoofed source address information that identifies a | |||
| victim. If a server generates more or larger packets in response to | victim. If a server generates more or larger packets in response to | |||
| that packet, the attacker can use the server to send more data toward | that packet, the attacker can use the server to send more data toward | |||
| the victim than it would be able to send on its own. | the victim than it would be able to send on its own. | |||
| Several methods are used in QUIC to mitigate this attack. Firstly, | Several methods are used in QUIC to mitigate this attack. Firstly, | |||
| the initial handshake packet is padded to at least 1280 octets. This | the initial handshake packet is padded to at least 1200 octets. This | |||
| allows a server to send a similar amount of data without risking | allows a server to send a similar amount of data without risking | |||
| causing an amplification attack toward an unproven remote address. | causing an amplification attack toward an unproven remote address. | |||
| A server eventually confirms that a client has received its messages | A server eventually confirms that a client has received its messages | |||
| when the cryptographic handshake successfully completes. This might | when the cryptographic handshake successfully completes. This might | |||
| be insufficient, either because the server wishes to avoid the | be insufficient, either because the server wishes to avoid the | |||
| computational cost of completing the handshake, or it might be that | computational cost of completing the handshake, or it might be that | |||
| the size of the packets that are sent during the handshake is too | the size of the packets that are sent during the handshake is too | |||
| large. This is especially important for 0-RTT, where the server | large. This is especially important for 0-RTT, where the server | |||
| might wish to provide application data traffic - such as a response | might wish to provide application data traffic - such as a response | |||
| skipping to change at page 31, line 5 ¶ | skipping to change at page 31, line 44 ¶ | |||
| To send additional data prior to completing the cryptographic | To send additional data prior to completing the cryptographic | |||
| handshake, the server then needs to validate that the client owns the | handshake, the server then needs to validate that the client owns the | |||
| address that it claims. | address that it claims. | |||
| Source address validation is therefore performed during the | Source address validation is therefore performed during the | |||
| establishment of a connection. TLS provides the tools that support | establishment of a connection. TLS provides the tools that support | |||
| the feature, but basic validation is performed by the core transport | the feature, but basic validation is performed by the core transport | |||
| protocol. | protocol. | |||
| 7.5.1. Client Address Validation Procedure | 7.6.1. Client Address Validation Procedure | |||
| QUIC uses token-based address validation. Any time the server wishes | QUIC uses token-based address validation. Any time the server wishes | |||
| to validate a client address, it provides the client with a token. | to validate a client address, it provides the client with a token. | |||
| As long as the token cannot be easily guessed (see Section 7.5.3), if | As long as the token cannot be easily guessed (see Section 7.6.3), if | |||
| the client is able to return that token, it proves to the server that | the client is able to return that token, it proves to the server that | |||
| it received the token. | it received the token. | |||
| During the processing of the cryptographic handshake messages from a | During the processing of the cryptographic handshake messages from a | |||
| client, TLS will request that QUIC make a decision about whether to | client, TLS will request that QUIC make a decision about whether to | |||
| proceed based on the information it has. TLS will provide QUIC with | proceed based on the information it has. TLS will provide QUIC with | |||
| any token that was provided by the client. For an initial packet, | any token that was provided by the client. For an initial packet, | |||
| QUIC can decide to abort the connection, allow it to proceed, or | QUIC can decide to abort the connection, allow it to proceed, or | |||
| request address validation. | request address validation. | |||
| skipping to change at page 31, line 42 ¶ | skipping to change at page 32, line 34 ¶ | |||
| asks QUIC a second time whether the token is acceptable. In | asks QUIC a second time whether the token is acceptable. In | |||
| response, QUIC can either abort the connection or permit it to | response, QUIC can either abort the connection or permit it to | |||
| proceed. | proceed. | |||
| A connection MAY be accepted without address validation - or with | A connection MAY be accepted without address validation - or with | |||
| only limited validation - but a server SHOULD limit the data it sends | only limited validation - but a server SHOULD limit the data it sends | |||
| toward an unvalidated address. Successful completion of the | toward an unvalidated address. Successful completion of the | |||
| cryptographic handshake implicitly provides proof that the client has | cryptographic handshake implicitly provides proof that the client has | |||
| received packets from the server. | received packets from the server. | |||
| 7.5.2. Address Validation on Session Resumption | 7.6.2. Address Validation on Session Resumption | |||
| 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. | |||
| A different type of token is needed when resuming. Unlike the token | A different type of token is needed when resuming. Unlike the token | |||
| that is created during a handshake, there might be some time between | that is created during a handshake, there might be some time between | |||
| when the token is created and when the token is subsequently used. | when the token is created and when the token is subsequently used. | |||
| skipping to change at page 32, line 4 ¶ | skipping to change at page 32, line 45 ¶ | |||
| 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. | |||
| A different type of token is needed when resuming. Unlike the token | A different type of token is needed when resuming. Unlike the token | |||
| that is created during a handshake, there might be some time between | that is created during a handshake, there might be some time between | |||
| when the token is created and when the token is subsequently used. | when the token is created and when the token is subsequently used. | |||
| Thus, a resumption token SHOULD include an expiration time. It is | Thus, a resumption token SHOULD include an expiration time. It is | |||
| also unlikely that the client port number is the same on two | also 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. | |||
| This token can be provided to the cryptographic handshake immediately | This token can be provided to the cryptographic handshake immediately | |||
| after establishing a connection. QUIC might also generate an updated | after establishing a connection. QUIC might also generate an updated | |||
| token if significant time passes or the client address changes for | token if significant time passes or the client address changes for | |||
| any reason (see Section 7.6). The cryptographic handshake is | any reason (see Section 7.7). The cryptographic handshake is | |||
| responsible for providing the client with the token. In TLS the | responsible for providing the client with the token. In TLS the | |||
| token is included in the ticket that is used for resumption and | token is included in the ticket that is used for resumption and | |||
| 0-RTT, which is carried in a NewSessionTicket message. | 0-RTT, which is carried in a NewSessionTicket message. | |||
| 7.5.3. Address Validation Token Integrity | 7.6.3. 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 32, line 42 ¶ | skipping to change at page 33, line 33 ¶ | |||
| In TLS the address validation token is often bundled with the | In TLS the address validation token is often bundled with the | |||
| information that TLS requires, such as the resumption secret. In | information that TLS requires, such as the resumption secret. In | |||
| this case, adding integrity protection can be delegated to the | this case, adding integrity protection can be delegated to the | |||
| cryptographic handshake protocol, avoiding redundant protection. If | cryptographic handshake protocol, avoiding redundant protection. If | |||
| integrity protection is delegated to the cryptographic handshake, an | integrity protection is delegated to the cryptographic handshake, an | |||
| integrity failure will result in immediate cryptographic handshake | integrity failure will result in immediate cryptographic handshake | |||
| failure. If integrity protection is performed by QUIC, QUIC MUST | failure. If integrity protection is performed by QUIC, QUIC MUST | |||
| abort the connection if the integrity check fails with a | abort the connection if the integrity check fails with a | |||
| PROTOCOL_VIOLATION error code. | PROTOCOL_VIOLATION error code. | |||
| 7.6. Connection Migration | 7.7. Connection Migration | |||
| QUIC connections are identified by their 64-bit Connection ID. | QUIC connections are identified by their 64-bit Connection ID. | |||
| QUIC's consistent connection ID allows connections to survive changes | QUIC's consistent connection ID allows connections to survive changes | |||
| to the client's IP and/or port, such as those caused by client or | to the client's IP and/or port, such as those caused by client or | |||
| server migrating to a new network. Connection migration allows a | server migrating to a new network. Connection migration allows a | |||
| client to retain any shared state with a connection when they move | client to retain any shared state with a connection when they move | |||
| networks. This includes state that can be hard to recover such as | networks. This includes state that can be hard to recover such as | |||
| outstanding requests, which might otherwise be lost with no easy way | outstanding requests, which might otherwise be lost with no easy way | |||
| to retry them. | to retry them. | |||
| 7.6.1. Privacy Implications of Connection Migration | 7.7.1. Privacy Implications of Connection Migration | |||
| Using a stable connection ID on multiple network paths allows a | Using a stable connection ID on multiple network paths allows a | |||
| passive observer to correlate activity between those paths. A client | passive observer to correlate activity between those paths. A client | |||
| that moves between networks might not wish to have their activity | that moves between networks might not wish to have their activity | |||
| correlated by any entity other than a server. The NEW_CONNECTION_ID | correlated by any entity other than a server. The NEW_CONNECTION_ID | |||
| message can be sent by a server to provide an unlinkable connection | message can be sent by a server to provide an unlinkable connection | |||
| ID for use in case the client wishes to explicitly break linkability | ID for use in case the client wishes to explicitly break linkability | |||
| between two points of network attachment. | between two points of network attachment. | |||
| A client might need to send packets on multiple networks without | A client might need to send packets on multiple networks without | |||
| receiving any response from the server. To ensure that the client is | receiving any response from the server. To ensure that the client is | |||
| not linkable across each of these changes, a new connection ID and | not linkable across each of these changes, a new connection ID and | |||
| packet number gap are needed for each network. To support this, a | packet number gap are needed for each network. To support this, a | |||
| server sends multiple NEW_CONNECTION_ID messages. Each | server sends multiple NEW_CONNECTION_ID messages. Each | |||
| NEW_CONNECTION_ID is marked with a sequence number. Connection IDs | NEW_CONNECTION_ID is marked with a sequence number. Connection IDs | |||
| MUST be used in the order in which they are numbered. | MUST be used in the order in which they are numbered. | |||
| A client which wishes to break linkability upon changing networks | A client which wishes to break linkability upon changing networks | |||
| MUST use the connection ID provided by the server as well as | MUST use the connection ID provided by the server as well as | |||
| incrementing the packet sequence number by an externally | incrementing the packet sequence number by an externally | |||
| unpredictable value computed as described in Section 7.6.1.1. Packet | unpredictable value computed as described in Section 7.7.1.1. Packet | |||
| number gaps are cumulative. A client might skip connection IDs, but | number gaps are cumulative. A client might skip connection IDs, but | |||
| it MUST ensure that it applies the associated packet number gaps for | it MUST ensure that it applies the associated packet number gaps for | |||
| connection IDs that it skips in addition to the packet number gap | connection IDs that it skips in addition to the packet number gap | |||
| associated with the connection ID that it does use. | associated with the connection ID that it does use. | |||
| A server that receives a packet that is marked with a new connection | A server that receives a packet that is marked with a new connection | |||
| ID recovers the packet number by adding the cumulative packet number | ID recovers the packet number by adding the cumulative packet number | |||
| gap to its expected packet number. A server SHOULD discard packets | gap to its expected packet number. A server SHOULD discard packets | |||
| that contain a smaller gap than it advertised. | that contain a smaller gap than it advertised. | |||
| For instance, a server might provide a packet number gap of 7 | For instance, a server might provide a packet number gap of 7 | |||
| associated with a new connection ID. If the server received packet | associated with a new connection ID. If the server received packet | |||
| 10 using the previous connection ID, it should expect packets on the | 10 using the previous connection ID, it should expect packets on the | |||
| new connection ID to start at 18. A packet with the new connection | new connection ID to start at 18. A packet with the new connection | |||
| ID and a packet number of 17 is discarded as being in error. | ID and a packet number of 17 is discarded as being in error. | |||
| 7.6.1.1. Packet Number Gap | 7.7.1.1. Packet Number Gap | |||
| In order to avoid linkage, the packet number gap MUST be externally | In order to avoid linkage, the packet number gap MUST be externally | |||
| indistinguishable from random. The packet number gap for a | indistinguishable from random. The packet number gap for a | |||
| connection ID with sequence number is computed by encoding the | connection ID with sequence number is computed by encoding the | |||
| sequence number as a 32-bit integer in big-endian format, and then | sequence number as a 32-bit integer in big-endian format, and then | |||
| computing: | computing: | |||
| Gap = HKDF-Expand-Label(packet_number_secret, | Gap = HKDF-Expand-Label(packet_number_secret, | |||
| "QUIC packet sequence gap", sequence, 4) | "QUIC packet sequence gap", sequence, 4) | |||
| The output of HKDF-Expand-Label is interpreted as a big-endian | The output of HKDF-Expand-Label is interpreted as a big-endian | |||
| number. "packet_number_secret" is derived from the TLS key exchange, | number. "packet_number_secret" is derived from the TLS key exchange, | |||
| as described in [QUIC-TLS] Section 5.6. | as described in Section 5.6 of [QUIC-TLS]. | |||
| 7.6.2. Address Validation for Migrated Connections | 7.7.2. Address Validation for Migrated Connections | |||
| TODO: see issue #161 | TODO: see issue #161 | |||
| 7.7. Connection Termination | 7.8. Connection Termination | |||
| Connections should remain open until they become idle for a pre- | Connections should remain open until they become idle for a pre- | |||
| negotiated period of time. A QUIC connection, once established, can | negotiated period of time. A QUIC connection, once established, can | |||
| be terminated in one of four ways: | be terminated in one of three ways: | |||
| o application close (Section 7.7.2) | ||||
| o idle timeout (Section 7.7.3) | o idle timeout (Section 7.8.2) | |||
| o immediate close (Section 7.7.4) | o immediate close (Section 7.8.3) | |||
| o stateless reset (Section 7.7.5) | o stateless reset (Section 7.8.4) | |||
| 7.7.1. Draining Period | 7.8.1. Draining Period | |||
| After a connection is closed for any reason, an endpoint might | After a connection is closed for any reason, an endpoint might | |||
| receive packets from its peer. These packets might have been sent | receive packets from its peer. These packets might have been sent | |||
| prior to receiving any close signal, or they might be retransmissions | prior to receiving any close signal, or they might be retransmissions | |||
| of packets for which acknowledgments were lost. | of packets for which acknowledgments were lost. | |||
| The draining period persists for three times the current | The draining period persists for three times the current | |||
| Retransmission Timeout (RTO) interval as defined in [QUIC-RECOVERY]. | Retransmission Timeout (RTO) interval as defined in [QUIC-RECOVERY]. | |||
| During this period, new packets can be acknowledged, but no new | During this period, new packets can be acknowledged, but no new | |||
| application data can be sent on the connection. | application data can be sent on the connection. | |||
| Different treatment is given to packets that are received while a | Different treatment is given to packets that are received while a | |||
| connection is in the draining period depending on how the connection | connection is in the draining period depending on how the connection | |||
| was closed. In all cases, it is possible to acknowledge packets that | was closed. | |||
| are received as normal, but other reactions might be preferable | ||||
| depending on how the connection was closed. An endpoint that is in a | An endpoint that is in a draining period MUST NOT send packets unless | |||
| draining period MUST NOT send packets containing frames other than | they contain a CONNECTION_CLOSE or APPLICATION_CLOSE frame. | |||
| ACK, PADDING, or CONNECTION_CLOSE. | ||||
| Once the draining period has ended, an endpoint SHOULD discard per- | Once the draining period has ended, an endpoint SHOULD discard per- | |||
| connection state. This results in new packets on the connection | connection state. This results in new packets on the connection | |||
| being discarded. An endpoint MAY send a stateless reset in response | being discarded. An endpoint MAY send a stateless reset in response | |||
| to any further incoming packets. | to any further incoming packets. | |||
| The draining period does not apply when a stateless reset | The draining period does not apply when a stateless reset | |||
| (Section 7.7.5) is used. | (Section 7.8.4) is sent. | |||
| 7.7.2. Application Close | ||||
| An application protocol can arrange to close a connection. This | ||||
| might be after negotiating a graceful shutdown. The application | ||||
| protocol exchanges whatever messages that are needed to cause both | ||||
| endpoints to agree to close the connection, after which the | ||||
| application requests that the connection be closed. A negotiated | ||||
| shutdown might not result in exchanging messages that are visible to | ||||
| the transport. | ||||
| In the draining period, an endpoint that has been closed by an | ||||
| application SHOULD generate and send ACK frames as normal. This | ||||
| allows the peer to receive acknowledgements where previous | ||||
| acknowledgements were lost. | ||||
| 7.7.3. Idle Timeout | 7.8.2. Idle Timeout | |||
| A connection that remains idle for longer than the idle timeout (see | A connection that remains idle for longer than the idle timeout (see | |||
| Section 7.3.1) becomes closed. Either peer removes connection state | Section 7.4.1) becomes closed. Either peer removes connection state | |||
| if they have neither sent nor received a packet for this time. | if they have neither sent nor received a packet for this time. | |||
| The time at which an idle timeout takes effect won't be perfectly | The time at which an idle timeout takes effect won't be perfectly | |||
| synchronized on peers. A connection enters the draining period when | synchronized on peers. A connection enters the draining period when | |||
| the idle timeout expires. During this time, an endpoint that | the idle timeout expires. During this time, an endpoint that | |||
| receives new packets MAY choose to restore the connection. | receives new packets MAY choose to restore the connection. | |||
| Alternatively, an endpoint that receives packets MAY signal the | Alternatively, an endpoint that receives packets MAY signal the | |||
| timeout using an immediate close. | timeout using an immediate close. | |||
| 7.7.4. Immediate Close | 7.8.3. Immediate Close | |||
| An endpoint sends a CONNECTION_CLOSE frame to terminate the | An endpoint sends a CONNECTION_CLOSE or APPLICATION_CLOSE frame to | |||
| connection immediately. A CONNECTION_CLOSE causes all open streams | terminate the connection immediately. Either frame causes all open | |||
| to immediately become closed; open streams can be assumed to be | streams to immediately become closed; open streams can be assumed to | |||
| implicitly reset. After sending or receiving a CONNECTION_CLOSE | be implicitly reset. After sending or receiving a CONNECTION_CLOSE | |||
| frame, endpoints immediately enter a draining period. | frame, endpoints immediately enter a draining period. | |||
| During the draining period, an endpoint that sends a CONNECTION_CLOSE | During the draining period, an endpoint that sends a CONNECTION_CLOSE | |||
| frame SHOULD respond to any subsequent packet that it receives with | or APPLICATION_CLOSE frame SHOULD respond to any subsequent packet | |||
| another packet containing a CONNECTION_CLOSE frame. To reduce the | that it receives with another packet containing either close frame. | |||
| state that an endpoint maintains in this case, it MAY send the exact | To reduce the state that an endpoint maintains in this case, it MAY | |||
| same packet. However, endpoints SHOULD limit the number of | send the exact same packet. However, endpoints SHOULD limit the | |||
| CONNECTION_CLOSE messages they generate. For instance, an endpoint | number of packets they generate containing either close frame. For | |||
| could progressively increase the number of packets that it receives | instance, an endpoint could progressively increase the number of | |||
| before sending additional CONNECTION_CLOSE frames. | packets that it receives before sending additional packets. | |||
| Note: Allowing retransmission of a packet contradicts other advice | Note: Allowing retransmission of a packet contradicts other advice | |||
| in this document that recommends the creation of new packet | 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. | |||
| An endpoint can cease sending CONNECTION_CLOSE frames if it receives | An immediate close can be used after an application protocol has | |||
| either a CONNECTION_CLOSE or an acknowledgement for a packet that | arranged to close a connection. This might be after the application | |||
| contained a CONNECTION_CLOSE. | protocols negotiates a graceful shutdown. The application protocol | |||
| exchanges whatever messages that are needed to cause both endpoints | ||||
| to agree to close the connection, after which the application | ||||
| requests that the connection be closed. The application protocol can | ||||
| use an APPLICATION_CLOSE message with an appropriate error code to | ||||
| signal closure. | ||||
| 7.7.5. Stateless Reset | 7.8.4. Stateless Reset | |||
| A stateless reset is provided as an option of last resort for a | A stateless reset is provided as an option of last resort for a | |||
| server that does not have access to the state of a connection. A | server that does not have access to the state of a connection. A | |||
| server crash or outage might result in clients continuing to send | server crash or outage might result in clients continuing to send | |||
| data to a server that is unable to properly continue the connection. | data to a server that is unable to properly continue the connection. | |||
| A server that wishes to communicate a fatal connection error MUST use | A server that wishes to communicate a fatal connection error MUST use | |||
| a CONNECTION_CLOSE frame if it has sufficient state to do so. | a CONNECTION_CLOSE or APPLICATION_CLOSE frame if it has sufficient | |||
| state to do so. | ||||
| To support this process, the server sends a stateless_reset_token | To support this process, the server sends a stateless_reset_token | |||
| value during the handshake in the transport parameters. This value | value during the handshake in the transport parameters. This value | |||
| is protected by encryption, so only client and server know this | is protected by encryption, so only client and server know this | |||
| value. | value. | |||
| A server that receives packets that it cannot process sends a packet | A server that receives packets that it cannot process sends a packet | |||
| in the following layout: | in the following layout: | |||
| 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 | |||
| +-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+ | |||
| |0|C|K| 00001 | | |0|C|K| 00001 | | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | | | | | | |||
| + [Connection ID (64)] + | + [Connection ID (64)] + | |||
| | | | | | | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Packet Number (8/16/32) | | ||||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||
| | Random Octets (*) ... | ||||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||
| | | | | | | |||
| + + | + + | |||
| | | | | | | |||
| + Stateless Reset Token (128) + | + Stateless Reset Token (128) + | |||
| | | | | | | |||
| + + | + + | |||
| | | | | | | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Random Octets (*) ... | ||||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||
| This packet SHOULD use the short header form with the shortest | ||||
| possible packet number encoding. This minimizes the perceived gap | ||||
| between the last packet that the server sent and this packet. The | ||||
| leading octet of the Stateless Reset Token will be interpreted as a | ||||
| packet number. A server MAY use a different short header type, | ||||
| indicating a different packet number length, but this allows for the | ||||
| message to be identified as a stateless reset more easily using | ||||
| heuristics. | ||||
| A server copies the connection ID field from the packet that triggers | A server copies the connection ID field from the packet that triggers | |||
| the stateless reset. A server omits the connection ID if explicitly | the stateless reset. A server omits the connection ID if explicitly | |||
| configured to do so, or if the client packet did not include a | configured to do so, or if the client packet did not include a | |||
| connection ID. | connection ID. | |||
| The Packet Number field is set to a randomized value. The server | ||||
| SHOULD send a packet with a short header and a type of 0x01. This | ||||
| produces the shortest possible packet number encoding, which | ||||
| minimizes the perceived gap between the last packet that the server | ||||
| sent and this packet. A server MAY use a different short header | ||||
| type, indicating a different packet number length, but a longer | ||||
| packet number encoding might allow this message to be identified as a | ||||
| stateless reset more easily using heuristics. | ||||
| After the first short header octet and optional connection ID, the | After the first short header octet and optional connection ID, the | |||
| server includes the value of the Stateless Reset Token that it | server includes the value of the Stateless Reset Token that it | |||
| included in its transport parameters. | included in its transport parameters. | |||
| After the Stateless Reset Token, the server pads the message with an | After the Packet Number, the server pads the message with an | |||
| arbitrary number of octets containing random values. | arbitrary number of octets containing random values. | |||
| Finally, the last 16 octets of the packet are set to the value of the | ||||
| Stateless Reset Token. | ||||
| This design ensures that a stateless reset packet is - to the extent | This design ensures that a stateless reset packet is - to the extent | |||
| possible - indistinguishable from a regular packet. | possible - indistinguishable from a regular packet. | |||
| A stateless reset is not appropriate for signaling error conditions. | A stateless reset is not appropriate for signaling error conditions. | |||
| An endpoint that wishes to communicate a fatal connection error MUST | An endpoint that wishes to communicate a fatal connection error MUST | |||
| use a CONNECTION_CLOSE frame if it has sufficient state to do so. | use a CONNECTION_CLOSE or APPLICATION_CLOSE frame if it has | |||
| sufficient state to do so. | ||||
| 7.7.5.1. Detecting a Stateless Reset | 7.8.4.1. Detecting a Stateless Reset | |||
| A client detects a potential stateless reset when a packet with a | A client detects a potential stateless reset when a packet with a | |||
| short header cannot be decrypted. The client then performs a | short header either cannot be decrypted or is marked as a duplicate | |||
| constant-time comparison of the 16 octets that follow the Connection | packet. The client then compares the last 16 octets of the packet | |||
| ID with the Stateless Reset Token provided by the server in its | with the Stateless Reset Token provided by the server in its | |||
| transport parameters. If this comparison is successful, the | transport parameters. If these values are identical, the client MUST | |||
| connection MUST be terminated immediately. Otherwise, the packet can | enter the draining period and not send any further packets on this | |||
| be discarded. | connection. If the comparison fails, the packet can be discarded. | |||
| 7.7.5.2. Calculating a Stateless Reset Token | 7.8.4.2. Calculating a Stateless Reset Token | |||
| The stateless reset token MUST be difficult to guess. In order to | The stateless reset token MUST be difficult to guess. In order to | |||
| create a Stateless Reset Token, a server could randomly generate | create a Stateless Reset Token, a server could randomly generate | |||
| [RFC4086] a secret for every connection that it creates. However, | [RFC4086] a secret for every connection that it creates. However, | |||
| this presents a coordination problem when there are multiple servers | this presents a coordination problem when there are multiple servers | |||
| in a cluster or a storage problem for a server that might lose state. | in a cluster or a storage problem for a server that might lose state. | |||
| Stateless reset specifically exists to handle the case where state is | Stateless reset specifically exists to handle the case where state is | |||
| lost, so this approach is suboptimal. | lost, so this approach is suboptimal. | |||
| A single static key can be used across all connections to the same | A single static key can be used across all connections to the same | |||
| skipping to change at page 38, line 24 ¶ | skipping to change at page 39, line 13 ¶ | |||
| Stateless Reset Token for that connection. | Stateless Reset Token for that connection. | |||
| A server that loses state can use the same method to generate a valid | A server that loses state can use the same method to generate a valid | |||
| Stateless Reset Secret. The connection ID comes from the packet that | Stateless Reset Secret. The connection ID comes from the packet that | |||
| the server receives. | the server receives. | |||
| This design relies on the client always sending a connection ID in | This design relies on the client always sending a connection ID in | |||
| its packets so that the server can use the connection ID from a | its packets so that the server can use the connection ID from a | |||
| packet to reset the connection. A server that uses this design | packet to reset the connection. A server that uses this design | |||
| cannot allow clients to omit a connection ID (that is, it cannot use | cannot allow clients to omit a connection ID (that is, it cannot use | |||
| the truncate_connection_id transport parameter Section 7.3.1). | the truncate_connection_id transport parameter Section 7.4.1). | |||
| Revealing the Stateless Reset Token allows any entity to terminate | Revealing the Stateless Reset Token allows any entity to terminate | |||
| the connection, so a value can only be used once. This method for | the connection, so a value can only be used once. This method for | |||
| choosing the Stateless Reset Token means that the combination of | choosing the Stateless Reset Token means that the combination of | |||
| server instance, connection ID, and static key cannot occur for | server instance, connection ID, and static key cannot occur for | |||
| another connection. A connection ID from a connection that is reset | another connection. A connection ID from a connection that is reset | |||
| by revealing the Stateless Reset Token cannot be reused for new | by revealing the Stateless Reset Token cannot be reused for new | |||
| connections at the same server without first changing to use a | connections at the same server without first changing to use a | |||
| different static key or server identifier. | different static key or server identifier. | |||
| Note that Stateless Reset messages do not have any cryptographic | ||||
| protection. | ||||
| 8. Frame Types and Formats | 8. Frame Types and Formats | |||
| As described in Section 6, Regular packets contain one or more | As described in Section 6, Regular packets contain one or more | |||
| frames. We now describe the various QUIC frame types that can be | frames. We now describe the various QUIC frame types that can be | |||
| present in a Regular packet. The use of these frames and various | present in a Regular packet. The use of these frames and various | |||
| frame header bits are described in subsequent sections. | frame header bits are described in subsequent sections. | |||
| 8.1. PADDING Frame | 8.1. PADDING Frame | |||
| The PADDING frame (type=0x00) has no semantic value. PADDING frames | The PADDING frame (type=0x00) has no semantic value. PADDING frames | |||
| skipping to change at page 39, line 22 ¶ | skipping to change at page 40, line 12 ¶ | |||
| of RST_STREAM can discard any data that it already received on that | of RST_STREAM can discard any data that it already received on that | |||
| stream. | stream. | |||
| The RST_STREAM frame is as follows: | The RST_STREAM frame is as follows: | |||
| 0 1 2 3 | 0 1 2 3 | |||
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Stream ID (32) | | | Stream ID (32) | | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Error Code (32) | | | Application Error Code (16) | | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | | | | | | |||
| + Final Offset (64) + | + Final Offset (64) + | |||
| | | | | | | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| The fields are: | The fields are: | |||
| Stream ID: The 32-bit Stream ID of the stream being terminated. | Stream ID: The 32-bit Stream ID of the stream being terminated. | |||
| Error code: A 32-bit error code which indicates why the stream is | Application Protocol Error Code: A 16-bit application protocol error | |||
| being closed. | code (see Section 12.4) which indicates why the stream is being | |||
| closed. | ||||
| Final offset: A 64-bit unsigned integer indicating the absolute byte | Final Offset: A 64-bit unsigned integer indicating the absolute byte | |||
| offset of the end of data written on this stream by the RST_STREAM | offset of the end of data written on this stream by the RST_STREAM | |||
| sender. | sender. | |||
| 8.3. CONNECTION_CLOSE frame | 8.3. CONNECTION_CLOSE frame | |||
| An endpoint sends a CONNECTION_CLOSE frame (type=0x02) to notify its | An endpoint sends a CONNECTION_CLOSE frame (type=0x02) to notify its | |||
| peer that the connection is being closed. If there are open streams | peer that the connection is being closed. CONNECTION_CLOSE is used | |||
| that haven't been explicitly closed, they are implicitly closed when | to signal errors at the QUIC layer, or the absence of errors (with | |||
| the connection is closed. The frame is as follows: | the NO_ERROR code). | |||
| If there are open streams that haven't been explicitly closed, they | ||||
| are implicitly closed when the connection is closed. | ||||
| The CONNECTION_CLOSE frame is as follows: | ||||
| 0 1 2 3 | 0 1 2 3 | |||
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Error Code (32) | | | Error Code (16) | Reason Phrase Length (16) | | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Reason Phrase Length (16) | [Reason Phrase (*)] ... | | Reason Phrase (*) ... | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| The fields of a CONNECTION_CLOSE frame are as follows: | The fields of a CONNECTION_CLOSE frame are as follows: | |||
| Error Code: A 32-bit error code which indicates the reason for | Error Code: A 16-bit error code which indicates the reason for | |||
| closing this connection. | closing this connection. CONNECTION_CLOSE uses codes from the | |||
| space defined in Section 12.3 (APPLICATION_CLOSE uses codes from | ||||
| the application protocol error code space, see Section 12.4). | ||||
| Reason Phrase Length: A 16-bit unsigned number specifying the length | Reason Phrase Length: A 16-bit unsigned number specifying the length | |||
| of the reason phrase in bytes. Note that a CONNECTION_CLOSE frame | of the reason phrase in bytes. Note that a CONNECTION_CLOSE frame | |||
| cannot be split between packets, so in practice any limits on | cannot be split between packets, so in practice any limits on | |||
| packet size will also limit the space available for a reason | packet size will also limit the space available for a reason | |||
| phrase. | 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]. | |||
| 8.4. MAX_DATA Frame | 8.4. APPLICATION_CLOSE frame | |||
| An APPLICATION_CLOSE frame (type=0x03) uses the same format as the | ||||
| CONNECTION_CLOSE frame (Section 8.3), except that it uses error codes | ||||
| from the application protocol error code space (Section 12.4) instead | ||||
| of the transport error code space. | ||||
| Other than the error code space, the format and semantics of the | ||||
| APPLICATION_CLOSE frame are identical to the CONNECTION_CLOSE frame. | ||||
| 8.5. MAX_DATA Frame | ||||
| The MAX_DATA frame (type=0x04) is used in flow control to inform the | The MAX_DATA frame (type=0x04) is used in flow control to inform the | |||
| peer of the maximum amount of data that can be sent on the connection | peer of the maximum amount of data that can be sent on the connection | |||
| as a whole. | as a whole. | |||
| The frame is as follows: | The frame is as follows: | |||
| 0 1 2 3 | 0 1 2 3 | |||
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| skipping to change at page 41, line 12 ¶ | skipping to change at page 42, line 12 ¶ | |||
| of 1024 octets. That is, the updated connection-level data limit | of 1024 octets. That is, the updated connection-level data limit | |||
| is determined by multiplying the encoded value by 1024. | is determined by multiplying the encoded value by 1024. | |||
| All data sent in STREAM frames counts toward this limit, with the | All data sent in STREAM frames counts toward this limit, with the | |||
| exception of data on stream 0. The sum of the largest received | exception of data on stream 0. The sum of the largest received | |||
| offsets on all streams - including closed streams, but excluding | offsets on all streams - including closed streams, but excluding | |||
| stream 0 - MUST NOT exceed the value advertised by a receiver. An | stream 0 - MUST NOT exceed the value advertised by a receiver. An | |||
| endpoint MUST terminate a connection with a | endpoint MUST terminate a connection with a | |||
| QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA error if it receives more | QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA error if it receives more | |||
| data than the maximum data value that it has sent, unless this is a | data than the maximum data value that it has sent, unless this is a | |||
| result of a change in the initial limits (see Section 7.3.2). | result of a change in the initial limits (see Section 7.4.2). | |||
| 8.5. MAX_STREAM_DATA Frame | 8.6. MAX_STREAM_DATA Frame | |||
| The MAX_STREAM_DATA frame (type=0x05) is used in flow control to | The MAX_STREAM_DATA frame (type=0x05) is used in flow control to | |||
| inform a peer of the maximum amount of data that can be sent on a | inform a peer of the maximum amount of data that can be sent on a | |||
| stream. | stream. | |||
| The frame is as follows: | The frame is as follows: | |||
| 0 1 2 3 | 0 1 2 3 | |||
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| skipping to change at page 41, line 52 ¶ | skipping to change at page 42, line 52 ¶ | |||
| stream. Loss or reordering can mean that the largest received offset | stream. Loss or reordering can mean that the largest received offset | |||
| on a stream can be greater than the total size of data received on | on a stream can be greater than the total size of data received on | |||
| that stream. Receiving STREAM frames might not increase the largest | that stream. Receiving STREAM frames might not increase the largest | |||
| received offset. | received offset. | |||
| The data sent on a stream MUST NOT exceed the largest maximum stream | The data sent on a stream MUST NOT exceed the largest maximum stream | |||
| data value advertised by the receiver. An endpoint MUST terminate a | data value advertised by the receiver. An endpoint MUST terminate a | |||
| connection with a FLOW_CONTROL_ERROR error if it receives more data | connection with a FLOW_CONTROL_ERROR error if it receives more data | |||
| than the largest maximum stream data that it has sent for the | than the largest maximum stream data that it has sent for the | |||
| affected stream, unless this is a result of a change in the initial | affected stream, unless this is a result of a change in the initial | |||
| limits (see Section 7.3.2). | limits (see Section 7.4.2). | |||
| 8.6. MAX_STREAM_ID Frame | 8.7. MAX_STREAM_ID Frame | |||
| The MAX_STREAM_ID frame (type=0x06) informs the peer of the maximum | The MAX_STREAM_ID frame (type=0x06) informs the peer of the maximum | |||
| stream ID that they are permitted to open. | stream ID that they are permitted to open. | |||
| The frame is as follows: | The frame is as follows: | |||
| 0 1 2 3 | 0 1 2 3 | |||
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Maximum Stream ID (32) | | | Maximum Stream ID (32) | | |||
| skipping to change at page 42, line 33 ¶ | skipping to change at page 43, line 33 ¶ | |||
| Loss or reordering can mean that a MAX_STREAM_ID frame can be | Loss or reordering can mean that a MAX_STREAM_ID frame can be | |||
| received which states a lower stream limit than the client has | received which states a lower stream limit than the client has | |||
| previously received. MAX_STREAM_ID frames which do not increase the | previously received. MAX_STREAM_ID frames which do not increase the | |||
| maximum stream ID MUST be ignored. | maximum stream ID MUST be ignored. | |||
| A peer MUST NOT initiate a stream with a higher stream ID than the | A peer MUST NOT initiate a stream with a higher stream ID than the | |||
| greatest maximum stream ID it has received. An endpoint MUST | greatest maximum stream ID it has received. An endpoint MUST | |||
| terminate a connection with a STREAM_ID_ERROR error if a peer | terminate a connection with a STREAM_ID_ERROR error if a peer | |||
| initiates a stream with a higher stream ID than it has sent, unless | initiates a stream with a higher stream ID than it has sent, unless | |||
| this is a result of a change in the initial limits (see | this is a result of a change in the initial limits (see | |||
| Section 7.3.2). | Section 7.4.2). | |||
| 8.7. PING frame | 8.8. PING frame | |||
| Endpoints can use PING frames (type=0x07) to verify that their peers | Endpoints can use PING frames (type=0x07) to verify that their peers | |||
| are still alive or to check reachability to the peer. The PING frame | are still alive or to check reachability to the peer. The PING frame | |||
| contains no additional fields. The receiver of a PING frame simply | contains no additional fields. The receiver of a PING frame simply | |||
| needs to acknowledge the packet containing this frame. | needs to acknowledge the packet containing this frame. | |||
| A PING frame has no additional fields. | A PING frame has no additional fields. | |||
| The PING frame can be used to keep a connection alive when an | The PING frame can be used to keep a connection alive when an | |||
| application or application protocol wishes to prevent the connection | application or application protocol wishes to prevent the connection | |||
| from timing out. An application protocol SHOULD provide guidance | from timing out. An application protocol SHOULD provide guidance | |||
| about the conditions under which generating a PING is recommended. | about the conditions under which generating a PING is recommended. | |||
| This guidance SHOULD indicate whether it is the client or the server | This guidance SHOULD indicate whether it is the client or the server | |||
| that is expected to send the PING. Having both endpoints send PING | that is expected to send the PING. Having both endpoints send PING | |||
| frames without coordination can produce an excessive number of | frames without coordination can produce an excessive number of | |||
| packets and poor performance. | packets and poor performance. | |||
| A connection will time out if no packets are sent or received for a | A connection will time out if no packets are sent or received for a | |||
| period longer than the time specified in the idle_timeout transport | period longer than the time specified in the idle_timeout transport | |||
| parameter (see Section 7.7). However, state in middleboxes might | parameter (see Section 7.8). However, state in middleboxes might | |||
| time out earlier than that. Though REQ-5 in [RFC4787] recommends a 2 | time out earlier than that. Though REQ-5 in [RFC4787] recommends a 2 | |||
| minute timeout interval, experience shows that sending packets every | minute timeout interval, experience shows that sending packets every | |||
| 15 to 30 seconds is necessary to prevent the majority of middleboxes | 15 to 30 seconds is necessary to prevent the majority of middleboxes | |||
| from losing state for UDP flows. | from losing state for UDP flows. | |||
| 8.8. BLOCKED Frame | 8.9. BLOCKED Frame | |||
| A sender sends a BLOCKED frame (type=0x08) when it wishes to send | A sender sends a BLOCKED frame (type=0x08) when it wishes to send | |||
| data, but is unable to due to connection-level flow control (see | data, but is unable to due to connection-level flow control (see | |||
| Section 11.2.1). BLOCKED frames can be used as input to tuning of | Section 11.2.1). BLOCKED frames can be used as input to tuning of | |||
| flow control algorithms (see Section 11.1.2). | flow control algorithms (see Section 11.1.2). | |||
| The BLOCKED frame does not contain a payload. | The BLOCKED frame does not contain a payload. | |||
| 8.9. STREAM_BLOCKED Frame | 8.10. STREAM_BLOCKED Frame | |||
| A sender sends a STREAM_BLOCKED frame (type=0x09) when it wishes to | A sender sends a STREAM_BLOCKED frame (type=0x09) when it wishes to | |||
| send data, but is unable to due to stream-level flow control. This | send data, but is unable to due to stream-level flow control. This | |||
| frame is analogous to BLOCKED (Section 8.8). | frame is analogous to BLOCKED (Section 8.9). | |||
| The STREAM_BLOCKED frame is as follows: | The STREAM_BLOCKED frame is as follows: | |||
| 0 1 2 3 | 0 1 2 3 | |||
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Stream ID (32) | | | Stream ID (32) | | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| The STREAM_BLOCKED frame contains a single field: | The STREAM_BLOCKED frame contains a single field: | |||
| Stream ID: A 32-bit unsigned number indicating the stream which is | Stream ID: A 32-bit unsigned number indicating the stream which is | |||
| flow control blocked. | flow control blocked. | |||
| 8.10. STREAM_ID_BLOCKED Frame | 8.11. STREAM_ID_BLOCKED Frame | |||
| A sender MAY send a STREAM_ID_BLOCKED frame (type=0x0a) when it | A sender MAY send a STREAM_ID_BLOCKED frame (type=0x0a) when it | |||
| wishes to open a stream, but is unable to due to the maximum stream | wishes to open a stream, but is unable to due to the maximum stream | |||
| ID limit set by its peer (see Section 8.6). This does not open the | ID limit set by its peer (see Section 8.7). This does not open the | |||
| stream, but informs the peer that a new stream was needed, but the | stream, but informs the peer that a new stream was needed, but the | |||
| stream limit prevented the creation of the stream. | stream limit prevented the creation of the stream. | |||
| The STREAM_ID_BLOCKED frame does not contain a payload. | The STREAM_ID_BLOCKED frame does not contain a payload. | |||
| 8.11. NEW_CONNECTION_ID Frame | 8.12. NEW_CONNECTION_ID Frame | |||
| A server sends a NEW_CONNECTION_ID frame (type=0x0b) to provide the | A server sends a NEW_CONNECTION_ID frame (type=0x0b) to provide the | |||
| client with alternative connection IDs that can be used to break | client with alternative connection IDs that can be used to break | |||
| linkability when migrating connections (see Section 7.6.1). | linkability when migrating connections (see Section 7.7.1). | |||
| The NEW_CONNECTION_ID is as follows: | The NEW_CONNECTION_ID is as follows: | |||
| 0 1 2 3 | 0 1 2 3 | |||
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Sequence (16) | | | Sequence (16) | | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | | | | | | |||
| + Connection ID (64) + | + Connection ID (64) + | |||
| skipping to change at page 44, line 45 ¶ | skipping to change at page 45, line 45 ¶ | |||
| server. The sequence value can wrap; the value 65535 is followed | server. The sequence value can wrap; the value 65535 is followed | |||
| by 0. When wrapping the sequence field, the server MUST ensure | by 0. When wrapping the sequence field, the server MUST ensure | |||
| that a value with the same sequence has been received and | that a value with the same sequence has been received and | |||
| acknowledged by the client. The connection ID that is assigned | acknowledged by the client. The connection ID that is assigned | |||
| during the handshake is assumed to have a sequence of 65535. | during the handshake is assumed to have a sequence of 65535. | |||
| Connection ID: A 64-bit connection ID. | Connection ID: A 64-bit connection ID. | |||
| Stateless Reset Token: A 128-bit value that will be used to for a | Stateless Reset Token: A 128-bit value that will be used to for a | |||
| stateless reset when the associated connection ID is used (see | stateless reset when the associated connection ID is used (see | |||
| Section 7.7.5). | Section 7.8.4). | |||
| 8.12. STOP_SENDING Frame | 8.13. STOP_SENDING Frame | |||
| An endpoint may use a STOP_SENDING frame (type=0x0c) to communicate | An endpoint may use a STOP_SENDING frame (type=0x0c) to communicate | |||
| that incoming data is being discarded on receipt at application | that incoming data is being discarded on receipt at application | |||
| request. This signals a peer to abruptly terminate transmission on a | request. This signals a peer to abruptly terminate transmission on a | |||
| stream. The frame is as follows: | stream. | |||
| The STOP_SENDING frame is as follows: | ||||
| 0 1 2 3 | 0 1 2 3 | |||
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Stream ID (32) | | | Stream ID (32) | | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Error Code (32) | | | Application Error Code (16) | | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| The fields are: | The fields are: | |||
| Stream ID: The 32-bit Stream ID of the stream being ignored. | Stream ID: The 32-bit Stream ID of the stream being ignored. | |||
| Error Code: The application-specified reason the sender is ignoring | Application Error Code: A 16-bit, application-specified reason the | |||
| the stream. | sender is ignoring the stream (see Section 12.4). | |||
| 8.13. ACK Frame | 8.14. ACK Frame | |||
| Receivers send ACK frames to inform senders which packets they have | Receivers send ACK frames to inform senders which packets they have | |||
| received and processed, as well as which packets are considered | received and processed, as well as which packets are considered | |||
| missing. The ACK frame contains between 1 and 256 ACK blocks. ACK | missing. The ACK frame contains between 1 and 256 ACK blocks. ACK | |||
| blocks are ranges of acknowledged packets. Implementations SHOULD | blocks are ranges of acknowledged packets. Implementations MUST NOT | |||
| NOT generate ACK packets in response to packets which only contain | generate packets that only contain ACK frames in response to packets | |||
| ACKs. However, they SHOULD ACK those packets when sending ACKs for | which only contain ACK frames. However, they SHOULD acknowledge | |||
| other packets. | packets containing only ACK frames when sending ACK frames in | |||
| response to other packets. | ||||
| To limit ACK blocks to those that have not yet been received by the | To limit ACK blocks to those that have not yet been received by the | |||
| sender, the receiver SHOULD track which ACK frames have been | sender, the receiver SHOULD track which ACK frames have been | |||
| acknowledged by its peer. Once an ACK frame has been acknowledged, | acknowledged by its peer. Once an ACK frame has been acknowledged, | |||
| the packets it acknowledges SHOULD not be acknowledged again. | the packets it acknowledges SHOULD NOT be acknowledged again. | |||
| A receiver that is only sending ACK frames will not receive | A receiver that is only sending ACK frames will not receive | |||
| acknowledgments for its packets. Sending an occasional MAX_DATA or | acknowledgments for its packets. Sending an occasional MAX_DATA or | |||
| MAX_STREAM_DATA frame as data is received will ensure that | MAX_STREAM_DATA frame as data is received will ensure that | |||
| acknowledgements are generated by a peer. Otherwise, an endpoint MAY | acknowledgements are generated by a peer. Otherwise, an endpoint MAY | |||
| send a PING frame once per RTT to solicit an acknowledgment. | send a PING frame once per RTT to solicit an acknowledgment. | |||
| To limit receiver state or the size of ACK frames, a receiver MAY | To limit receiver state or the size of ACK frames, a receiver MAY | |||
| limit the number of ACK blocks it sends. A receiver can do this even | limit the number of ACK blocks it sends. A receiver can do this even | |||
| without receiving acknowledgment of its ACK frames, with the | without receiving acknowledgment of its ACK frames, with the | |||
| skipping to change at page 46, line 9 ¶ | skipping to change at page 47, line 13 ¶ | |||
| past. | past. | |||
| Unlike TCP SACKs, QUIC ACK blocks are irrevocable. Once a packet has | Unlike TCP SACKs, QUIC ACK blocks are irrevocable. Once a packet has | |||
| been acknowledged, even if it does not appear in a future ACK frame, | been acknowledged, even if it does not appear in a future ACK frame, | |||
| it remains acknowledged. | it remains acknowledged. | |||
| A client MUST NOT acknowledge Version Negotiation or Server Stateless | A client MUST NOT acknowledge Version Negotiation or Server Stateless | |||
| Retry packets. These packet types contain packet numbers selected by | Retry packets. These packet types contain packet numbers selected by | |||
| the client, not the server. | the client, not the server. | |||
| QUIC ACK frames contain a timestamp section with up to 255 | ||||
| timestamps. Timestamps enable better congestion control, but are not | ||||
| required for correct loss recovery, and old timestamps are less | ||||
| valuable, so it is not guaranteed every timestamp will be received by | ||||
| the sender. A receiver SHOULD send a timestamp exactly once for each | ||||
| received packet containing retransmittable frames. A receiver MAY | ||||
| send timestamps for non-retransmittable packets. A receiver MUST not | ||||
| send timestamps in unprotected packets. | ||||
| A sender MAY intentionally skip packet numbers to introduce entropy | A sender MAY intentionally skip packet numbers to introduce entropy | |||
| into the connection, to avoid opportunistic acknowledgement attacks. | into the connection, to avoid opportunistic acknowledgement attacks. | |||
| The sender SHOULD close the connection if an unsent packet number is | The sender SHOULD close the connection if an unsent packet number is | |||
| acknowledged. The format of the ACK frame is efficient at expressing | acknowledged. The format of the ACK frame is efficient at expressing | |||
| blocks of missing packets; skipping packet numbers between 1 and 255 | blocks of missing packets; skipping packet numbers between 1 and 255 | |||
| effectively provides up to 8 bits of efficient entropy on demand, | effectively provides up to 8 bits of efficient entropy on demand, | |||
| which should be adequate protection against most opportunistic | which should be adequate protection against most opportunistic | |||
| acknowledgement attacks. | acknowledgement attacks. | |||
| The type byte for a ACK frame contains embedded flags, and is | The type byte for a ACK frame contains embedded flags, and is | |||
| skipping to change at page 47, line 8 ¶ | skipping to change at page 48, line 8 ¶ | |||
| o The two "MM" bits encode the length of the ACK Block Length | o The two "MM" bits encode the length of the ACK Block Length | |||
| fields. The values 00, 01, 02, and 03 indicate lengths of 8, 16, | fields. The values 00, 01, 02, and 03 indicate lengths of 8, 16, | |||
| 32, and 64 bits respectively. | 32, and 64 bits respectively. | |||
| An ACK frame is shown below. | An ACK frame is shown below. | |||
| 0 1 2 3 | 0 1 2 3 | |||
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| |[Num Blocks(8)]| NumTS (8) | | |[Num Blocks(8)]| | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Largest Acknowledged (8/16/32/64) ... | | Largest Acknowledged (8/16/32/64) ... | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | ACK Delay (16) | | | ACK Delay (16) | | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | ACK Block Section (*) ... | | ACK Block Section (*) ... | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Timestamp Section (*) ... | ||||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||
| Figure 7: ACK Frame Format | Figure 7: ACK Frame Format | |||
| The fields in the ACK frame are as follows: | The fields in the ACK frame are as follows: | |||
| Num Blocks (opt): An optional 8-bit unsigned value specifying the | Num Blocks (opt): An optional 8-bit unsigned value specifying the | |||
| number of additional ACK blocks (besides the required First ACK | number of additional ACK blocks (besides the required First ACK | |||
| Block) in this ACK frame. Only present if the 'N' flag bit is 1. | Block) in this ACK frame. Only present if the 'N' flag bit is 1. | |||
| Num Timestamps: An unsigned 8-bit number specifying the total number | ||||
| of <packet number, timestamp> pairs in the Timestamp Section. | ||||
| Largest Acknowledged: A variable-sized unsigned value representing | Largest Acknowledged: A variable-sized unsigned value representing | |||
| the largest packet number the peer is acknowledging in this packet | the largest packet number the peer is acknowledging in this packet | |||
| (typically the largest that the peer has seen thus far.) | (typically the largest that the peer has seen thus far.) | |||
| ACK Delay: The time from when the largest acknowledged packet, as | ACK Delay: The time from when the largest acknowledged packet, as | |||
| indicated in the Largest Acknowledged field, was received by this | indicated in the Largest Acknowledged field, was received by this | |||
| peer to when this ACK was sent. | peer to when this ACK was sent. | |||
| ACK Block Section: Contains one or more blocks of packet numbers | ACK Block Section: Contains one or more blocks of packet numbers | |||
| which have been successfully received, see Section 8.13.1. | which have been successfully received, see Section 8.14.1. | |||
| Timestamp Section: Contains zero or more timestamps reporting | ||||
| transit delay of received packets. See Section 8.13.2. | ||||
| 8.13.1. ACK Block Section | 8.14.1. ACK Block Section | |||
| The ACK Block Section contains between one and 256 blocks of packet | The ACK Block Section contains between one and 256 blocks of packet | |||
| numbers which have been successfully received. If the Num Blocks | numbers which have been successfully received. If the Num Blocks | |||
| field is absent, only the First ACK Block length is present in this | field is absent, only the First ACK Block length is present in this | |||
| section. Otherwise, the Num Blocks field indicates how many | section. Otherwise, the Num Blocks field indicates how many | |||
| additional blocks follow the First ACK Block Length field. | additional blocks follow the First ACK Block Length field. | |||
| 0 1 2 3 | 0 1 2 3 | |||
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| skipping to change at page 48, line 36 ¶ | skipping to change at page 49, line 36 ¶ | |||
| Gap To Next Block (opt, repeated): An unsigned number specifying the | Gap To Next Block (opt, repeated): An unsigned number specifying the | |||
| number of contiguous missing packets from the end of the previous | number of contiguous missing packets from the end of the previous | |||
| ACK block to the start of the next. Repeated "Num Blocks" times. | ACK block to the start of the next. Repeated "Num Blocks" times. | |||
| ACK Block Length (opt, repeated): An unsigned packet number delta | ACK Block Length (opt, repeated): An unsigned packet number delta | |||
| that indicates the number of contiguous packets being acknowledged | that indicates the number of contiguous packets being acknowledged | |||
| starting after the end of the previous gap. Repeated "Num Blocks" | starting after the end of the previous gap. Repeated "Num Blocks" | |||
| times. | times. | |||
| 8.13.2. Timestamp Section | 8.14.1.1. Time Format | |||
| The Timestamp Section contains between zero and 255 measurements of | ||||
| packet receive times relative to the beginning of the connection. | ||||
| 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 | ||||
| +-+-+-+-+-+-+-+-+ | ||||
| | [Delta LA (8)]| | ||||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||
| | [First Timestamp (32)] | | ||||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||
| |[Delta LA 1(8)]| [Time Since Previous 1 (16)] | | ||||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||
| |[Delta LA 2(8)]| [Time Since Previous 2 (16)] | | ||||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||
| ... | ||||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||
| |[Delta LA N(8)]| [Time Since Previous N (16)] | | ||||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||
| Figure 9: Timestamp Section | ||||
| The fields in the Timestamp Section are: | ||||
| Delta Largest Acknowledged (opt): An optional 8-bit unsigned packet | ||||
| number delta specifying the delta between the largest acknowledged | ||||
| and the first packet whose timestamp is being reported. In other | ||||
| words, this first packet number may be computed as (Largest | ||||
| Acknowledged - Delta Largest Acknowledged.) | ||||
| First Timestamp (opt): An optional 32-bit unsigned value specifying | ||||
| the time delta in microseconds, from the beginning of the | ||||
| connection to the arrival of the packet indicated by Delta Largest | ||||
| Acknowledged. | ||||
| Delta Largest Acked 1..N (opt, repeated): This field has the same | ||||
| semantics and format as "Delta Largest Acknowledged". Repeated | ||||
| "Num Timestamps - 1" times. | ||||
| Time Since Previous Timestamp 1..N(opt, repeated): An optional | ||||
| 16-bit unsigned value specifying time delta from the previous | ||||
| reported timestamp. It is encoded in the same format as the ACK | ||||
| Delay. Repeated "Num Timestamps - 1" times. | ||||
| The timestamp section lists packet receipt timestamps ordered by | ||||
| timestamp. | ||||
| 8.13.2.1. Time Format | ||||
| DISCUSS_AND_REPLACE: Perhaps make this format simpler. | DISCUSS_AND_REPLACE: Perhaps make this format simpler. | |||
| The time format used in the ACK frame above is a 16-bit unsigned | The time format used in the ACK frame above is a 16-bit unsigned | |||
| float with 11 explicit bits of mantissa and 5 bits of explicit | float with 11 explicit bits of mantissa and 5 bits of explicit | |||
| exponent, specifying time in microseconds. The bit format is loosely | exponent, specifying time in microseconds. The bit format is loosely | |||
| modeled after IEEE 754. For example, 1 microsecond is represented as | modeled after IEEE 754. For example, 1 microsecond is represented as | |||
| 0x1, which has an exponent of zero, presented in the 5 high order | 0x1, which has an exponent of zero, presented in the 5 high order | |||
| bits, and mantissa of 1, presented in the 11 low order bits. When | bits, and mantissa of 1, presented in the 11 low order bits. When | |||
| the explicit exponent is greater than zero, an implicit high-order | the explicit exponent is greater than zero, an implicit high-order | |||
| 12th bit of 1 is assumed in the mantissa. For example, a floating | 12th bit of 1 is assumed in the mantissa. For example, a floating | |||
| value of 0x800 has an explicit exponent of 1, as well as an explicit | value of 0x800 has an explicit exponent of 1, as well as an explicit | |||
| mantissa of 0, but then has an effective mantissa of 4096 (12th bit | mantissa of 0, but then has an effective mantissa of 4096 (12th bit | |||
| is assumed to be 1). Additionally, the actual exponent is one-less | is assumed to be 1). Additionally, the actual exponent is one-less | |||
| than the explicit exponent, and the value represents 4096 | than the explicit exponent, and the value represents 4096 | |||
| microseconds. Any values larger than the representable range are | microseconds. Any values larger than the representable range are | |||
| clamped to 0xFFFF. | clamped to 0xFFFF. | |||
| 8.13.3. ACK Frames and Packet Protection | 8.14.2. ACK Frames and Packet Protection | |||
| ACK frames that acknowledge protected packets MUST be carried in a | ACK frames that acknowledge protected packets MUST be carried in a | |||
| packet that has an equivalent or greater level of packet protection. | packet that has an equivalent or greater level of packet protection. | |||
| Packets that are protected with 1-RTT keys MUST be acknowledged in | Packets that are protected with 1-RTT keys MUST be acknowledged in | |||
| packets that are also protected with 1-RTT keys. | packets that are also protected with 1-RTT keys. | |||
| A packet that is not protected and claims to acknowledge a packet | A packet that is not protected and claims to acknowledge a packet | |||
| number that was sent with packet protection is not valid. An | number that was sent with packet protection is not valid. An | |||
| unprotected packet that carries acknowledgments for protected packets | unprotected packet that carries acknowledgments for protected packets | |||
| skipping to change at page 51, line 16 ¶ | skipping to change at page 51, line 5 ¶ | |||
| protection keys. | protection keys. | |||
| For instance, a server acknowledges a TLS ClientHello in the packet | For instance, a server acknowledges a TLS ClientHello in the packet | |||
| that carries the TLS ServerHello; similarly, a client can acknowledge | that carries the TLS ServerHello; similarly, a client can acknowledge | |||
| a TLS HelloRetryRequest in the packet containing a second TLS | a TLS HelloRetryRequest in the packet containing a second TLS | |||
| ClientHello. The complete set of server handshake messages (TLS | ClientHello. The complete set of server handshake messages (TLS | |||
| ServerHello through to Finished) might be acknowledged by a client in | ServerHello through to Finished) might be acknowledged by a client in | |||
| protected packets, because it is certain that the server is able to | protected packets, because it is certain that the server is able to | |||
| decipher the packet. | decipher the packet. | |||
| 8.14. STREAM Frame | 8.15. STREAM Frame | |||
| STREAM frames implicitly create a stream and carry stream data. The | STREAM frames implicitly create a stream and carry stream data. The | |||
| type byte for a STREAM frame contains embedded flags, and is | type byte for a STREAM frame contains embedded flags, and is | |||
| formatted as "11FSSOOD". These bits are parsed as follows: | formatted as "11FSSOOD". These bits are parsed as follows: | |||
| o The first two bits must be set to 11, indicating that this is a | o The first two bits must be set to 11, indicating that this is a | |||
| STREAM frame. | STREAM frame. | |||
| o "F" is the FIN bit, which is used for stream termination. | o "F" is the FIN bit, which is used for stream termination. | |||
| skipping to change at page 52, line 15 ¶ | skipping to change at page 51, line 44 ¶ | |||
| 0 1 2 3 | 0 1 2 3 | |||
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Stream ID (8/16/24/32) ... | | Stream ID (8/16/24/32) ... | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | Offset (0/16/32/64) ... | | Offset (0/16/32/64) ... | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| | [Data Length (16)] | Stream Data (*) ... | | [Data Length (16)] | Stream Data (*) ... | |||
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
| Figure 10: STREAM Frame Format | Figure 9: STREAM Frame Format | |||
| The STREAM frame contains the following fields: | The STREAM frame contains the following fields: | |||
| Stream ID: The stream ID of the stream (see Section 10.1). | Stream ID: The stream ID of the stream (see Section 10.1). | |||
| Offset: A variable-sized unsigned number specifying the byte offset | Offset: A variable-sized unsigned number specifying the byte offset | |||
| in the stream for the data in this STREAM frame. When the offset | in the stream for the data in this STREAM frame. When the offset | |||
| length is 0, the offset is 0. The first byte in the stream has an | length is 0, the offset is 0. The first byte in the stream has an | |||
| offset of 0. The largest offset delivered on a stream - the sum | offset of 0. The largest offset delivered on a stream - the sum | |||
| of the re-constructed offset and data length - MUST be less than | of the re-constructed offset and data length - MUST be less than | |||
| skipping to change at page 53, line 15 ¶ | skipping to change at page 52, line 43 ¶ | |||
| 9. Packetization and Reliability | 9. Packetization and Reliability | |||
| The Path Maximum Transmission Unit (PMTU) is the maximum size of the | The Path Maximum Transmission Unit (PMTU) is the maximum size of the | |||
| entire IP header, UDP header, and UDP payload. The UDP payload | entire IP header, UDP header, and UDP payload. The UDP payload | |||
| includes the QUIC packet header, protected payload, and any | includes the QUIC packet header, protected payload, and any | |||
| authentication fields. | authentication fields. | |||
| All QUIC packets SHOULD be sized to fit within the estimated PMTU to | All QUIC packets SHOULD be sized to fit within the estimated PMTU to | |||
| avoid IP fragmentation or packet drops. To optimize bandwidth | avoid IP fragmentation or packet drops. To optimize bandwidth | |||
| efficiency, endpoints SHOULD use Packetization Layer PMTU Discovery | efficiency, endpoints SHOULD use Packetization Layer PMTU Discovery | |||
| ([RFC4821]) and MAY use PMTU Discovery ([RFC1191], [RFC1981]) for | ([PLPMTUD]) and MAY use PMTU Discovery ([PMTUDv4], [PMTUDv6]) for | |||
| detecting the PMTU, setting the PMTU appropriately, and storing the | detecting the PMTU, setting the PMTU appropriately, and storing the | |||
| result of previous PMTU determinations. | result of previous PMTU determinations. | |||
| In the absence of these mechanisms, QUIC endpoints SHOULD NOT send IP | In the absence of these mechanisms, QUIC endpoints SHOULD NOT send IP | |||
| packets larger than 1280 octets. Assuming the minimum IP header | packets larger than 1280 octets. Assuming the minimum IP header | |||
| size, this results in a QUIC packet size of 1232 octets for IPv6 and | size, this results in a QUIC packet size of 1232 octets for IPv6 and | |||
| 1252 octets for IPv4. | 1252 octets for IPv4. | |||
| QUIC endpoints that implement any kind of PMTU discovery SHOULD | QUIC endpoints that implement any kind of PMTU discovery SHOULD | |||
| maintain an estimate for each combination of local and remote IP | maintain an estimate for each combination of local and remote IP | |||
| skipping to change at page 54, line 38 ¶ | skipping to change at page 54, line 19 ¶ | |||
| necessary: | necessary: | |||
| o All application data sent in STREAM frames MUST be retransmitted, | o All application data sent in STREAM frames MUST be retransmitted, | |||
| unless the endpoint has sent a RST_STREAM for that stream. When | unless the endpoint has sent a RST_STREAM for that stream. When | |||
| an endpoint sends a RST_STREAM frame, data outstanding on that | an endpoint sends a RST_STREAM frame, data outstanding on that | |||
| stream SHOULD NOT be retransmitted, since subsequent data on this | stream SHOULD NOT be retransmitted, since subsequent data on this | |||
| stream is expected to not be delivered by the receiver. | stream is expected to not be delivered by the receiver. | |||
| o ACK and PADDING frames MUST NOT be retransmitted. ACK frames | o ACK and PADDING frames MUST NOT be retransmitted. ACK frames | |||
| containing updated information will be sent as described in | containing updated information will be sent as described in | |||
| Section 8.13. | Section 8.14. | |||
| o STOP_SENDING frames MUST be retransmitted, unless the stream has | o STOP_SENDING frames MUST be retransmitted, unless the stream has | |||
| become closed in the appropriate direction. See Section 10.3. | become closed in the appropriate direction. See Section 10.3. | |||
| o The most recent MAX_STREAM_DATA frame for a stream MUST be | ||||
| retransmitted. Any previous unacknowledged MAX_STREAM_DATA frame | ||||
| for the same stream SHOULD NOT be retransmitted since a newer | ||||
| MAX_STREAM_DATA frame for a stream obviates the need for | ||||
| delivering older ones. Similarly, the most recent MAX_DATA frame | ||||
| MUST be retransmitted; previous unacknowledged ones SHOULD NOT be | ||||
| retransmitted. | ||||
| o All other frames MUST be retransmitted. | o All other frames MUST be retransmitted. | |||
| Upon detecting losses, a sender MUST take appropriate congestion | Upon detecting losses, a sender MUST take appropriate congestion | |||
| control action. The details of loss detection and congestion control | control action. The details of loss detection and congestion control | |||
| are described in [QUIC-RECOVERY]. | are described in [QUIC-RECOVERY]. | |||
| A packet MUST NOT be acknowledged until packet protection has been | A packet MUST NOT be acknowledged until packet protection has been | |||
| successfully removed and all frames contained in the packet have been | successfully removed and all frames contained in the packet have been | |||
| processed. For STREAM frames, this means the data has been queued | processed. For STREAM frames, this means the data has been queued | |||
| (but not necessarily delivered to the application). This also means | (but not necessarily delivered to the application). This also means | |||
| skipping to change at page 56, line 31 ¶ | skipping to change at page 56, line 18 ¶ | |||
| stream ID it is willing to accept at a given time. | stream ID it is willing to accept at a given time. | |||
| An alternative view of QUIC streams is as an elastic "message" | An alternative view of QUIC streams is as an elastic "message" | |||
| abstraction, similar to the way ephemeral streams are used in SST | abstraction, similar to the way ephemeral streams are used in SST | |||
| [SST], which may be a more appealing description for some | [SST], which may be a more appealing description for some | |||
| applications. | applications. | |||
| 10.1. Stream Identifiers | 10.1. Stream Identifiers | |||
| Streams are identified by an unsigned 32-bit integer, referred to as | Streams are identified by an unsigned 32-bit integer, referred to as | |||
| the Stream ID. To avoid Stream ID collision, clients initiate | the Stream ID. To avoid Stream ID collision, clients MUST initiate | |||
| streams using odd-numbered Stream IDs; streams initiated by the | streams using odd-numbered Stream IDs; servers MUST initiate streams | |||
| server use even-numbered Stream IDs. | using even-numbered Stream IDs. If an endpoint receives a frame | |||
| which corresponds to a stream which is allocated to it (i.e., odd- | ||||
| numbered for the client or even-numbered for the server) but which it | ||||
| has not yet created, it MUST close the connection with error code | ||||
| STREAM_STATE_ERROR. | ||||
| Stream ID 0 (0x0) is reserved for the cryptographic handshake. | Stream ID 0 (0x0) is reserved for the cryptographic handshake. | |||
| Stream 0 MUST NOT be used for application data, and is the first | Stream 0 MUST NOT be used for application data, and is the first | |||
| client-initiated stream. | client-initiated stream. | |||
| A QUIC endpoint cannot reuse a Stream ID. Streams MUST be created in | A QUIC endpoint MUST NOT reuse a Stream ID. Streams MUST be created | |||
| sequential order. Open streams can be used in any order. Streams | in sequential order. Open streams can be used in any order. Streams | |||
| that are used out of order result in lower-numbered streams in the | that are used out of order result in lower-numbered streams in the | |||
| same direction being counted as open. | same direction being counted as open. | |||
| Stream IDs are usually encoded as a 32-bit integer, though the STREAM | Stream IDs are usually encoded as a 32-bit integer, though the STREAM | |||
| frame (Section 8.14) permits a shorter encoding when the leading bits | frame (Section 8.15) permits a shorter encoding when the leading bits | |||
| of the stream ID are zero. | of the stream ID are zero. | |||
| 10.2. Life of a Stream | 10.2. Life of a Stream | |||
| The semantics of QUIC streams is based on HTTP/2 streams, and the | The semantics of QUIC streams is based on HTTP/2 streams, and the | |||
| lifecycle of a QUIC stream therefore closely follows that of an | lifecycle of a QUIC stream therefore closely follows that of an | |||
| HTTP/2 stream [RFC7540], with some differences to accommodate the | HTTP/2 stream [RFC7540], with some differences to accommodate the | |||
| possibility of out-of-order delivery due to the use of multiple | possibility of out-of-order delivery due to the use of multiple | |||
| streams in QUIC. The lifecycle of a QUIC stream is shown in the | streams in QUIC. The lifecycle of a QUIC stream is shown in the | |||
| following figure and described below. | following figure and described below. | |||
| skipping to change at page 57, line 44 ¶ | skipping to change at page 57, line 41 ¶ | |||
| send: endpoint sends this frame | send: endpoint sends this frame | |||
| recv: endpoint receives this frame | recv: endpoint receives this frame | |||
| STREAM: a STREAM frame | STREAM: a STREAM frame | |||
| FIN: FIN flag in a STREAM frame | FIN: FIN flag in a STREAM frame | |||
| RST: RST_STREAM frame | RST: RST_STREAM frame | |||
| MSD: MAX_STREAM_DATA frame | MSD: MAX_STREAM_DATA frame | |||
| SB: STREAM_BLOCKED frame | SB: STREAM_BLOCKED frame | |||
| Figure 11: Lifecycle of a stream | Figure 10: Lifecycle of a stream | |||
| Note that this diagram shows stream state transitions and the frames | Note that this diagram shows stream state transitions and the frames | |||
| and flags that affect those transitions only. It is possible for a | and flags that affect those transitions only. It is possible for a | |||
| single frame to cause two transitions: receiving a RST_STREAM frame, | single frame to cause two transitions: receiving a RST_STREAM frame, | |||
| or a STREAM frame with the FIN flag cause the stream state to move | or a STREAM frame with the FIN flag cause the stream state to move | |||
| from "idle" to "open" and then immediately to one of the "half- | from "idle" to "open" and then immediately to one of the "half- | |||
| closed" states. | closed" states. | |||
| The recipient of a frame that changes stream state will have a | The recipient of a frame that changes stream state will have a | |||
| delayed view of the state of a stream while the frame is in transit. | delayed view of the state of a stream while the frame is in transit. | |||
| skipping to change at page 58, line 36 ¶ | skipping to change at page 58, line 32 ¶ | |||
| or a STREAM frame with the FIN flag set also causes a stream to | or a STREAM frame with the FIN flag set also causes a stream to | |||
| become "half-closed". | become "half-closed". | |||
| An endpoint might receive MAX_STREAM_DATA or STREAM_BLOCKED frames on | An endpoint might receive MAX_STREAM_DATA or STREAM_BLOCKED frames on | |||
| peer-initiated streams that are "idle" if there is loss or reordering | peer-initiated streams that are "idle" if there is loss or reordering | |||
| of packets. Receiving these frames also causes the stream to become | of packets. Receiving these frames also causes the stream to become | |||
| "open". | "open". | |||
| An endpoint MUST NOT send a STREAM or RST_STREAM frame for a stream | An endpoint MUST NOT send a STREAM or RST_STREAM frame for a stream | |||
| ID that is higher than the peers advertised maximum stream ID (see | ID that is higher than the peers advertised maximum stream ID (see | |||
| Section 8.6). | Section 8.7). | |||
| 10.2.2. open | 10.2.2. open | |||
| A stream in the "open" state may be used by both peers to send frames | A stream in the "open" state may be used by both peers to send frames | |||
| of any type. In this state, endpoints can send MAX_STREAM_DATA and | of any type. In this state, endpoints can send MAX_STREAM_DATA and | |||
| MUST observe the value advertised by its receiving peer (see | MUST observe the value advertised by its receiving peer (see | |||
| Section 11). | Section 11). | |||
| Opening a stream causes all lower-numbered streams in the same | Opening a stream causes all lower-numbered streams in the same | |||
| direction to become open. Thus, opening an odd-numbered stream | direction to become open. Thus, opening an odd-numbered stream | |||
| skipping to change at page 59, line 32 ¶ | skipping to change at page 59, line 27 ¶ | |||
| Any frame type that mentions a stream ID can be sent in this state. | Any frame type that mentions a stream ID can be sent in this state. | |||
| 10.2.3. half-closed (local) | 10.2.3. half-closed (local) | |||
| A stream that is in the "half-closed (local)" state MUST NOT be used | A stream that is in the "half-closed (local)" state MUST NOT be used | |||
| for sending on new STREAM frames. Retransmission of data that has | for sending on new STREAM frames. Retransmission of data that has | |||
| already been sent on STREAM frames is permitted. An endpoint MAY | already been sent on STREAM frames is permitted. An endpoint MAY | |||
| also send MAX_STREAM_DATA and STOP_SENDING in this state. | also send MAX_STREAM_DATA and STOP_SENDING in this state. | |||
| An application can decide to abandon a stream in this state. An | ||||
| endpoint can send RST_STREAM for a stream that was closed with the | ||||
| FIN flag. The final offset carried in this RST_STREAM frame MUST be | ||||
| the same as the previously established final offset. | ||||
| An endpoint that closes a stream MUST NOT send data beyond the final | An endpoint that closes a stream MUST NOT send data beyond the final | |||
| offset that it has chosen, see Section 10.2.5 for details. | offset that it has chosen, see Section 10.2.5 for details. | |||
| A stream transitions from this state to "closed" when a STREAM frame | A stream transitions from this state to "closed" when a STREAM frame | |||
| that contains a FIN flag is received and all prior data has arrived, | that contains a FIN flag is received and all prior data has arrived, | |||
| or when a RST_STREAM frame is received. | or when a RST_STREAM frame is received. | |||
| An endpoint can receive any frame that mentions a stream ID in this | An endpoint can receive any frame that mentions a stream ID in this | |||
| state. Providing flow-control credit using MAX_STREAM_DATA frames is | state. Providing flow-control credit using MAX_STREAM_DATA frames is | |||
| necessary to continue receiving flow-controlled frames. In this | necessary to continue receiving flow-controlled frames. In this | |||
| skipping to change at page 60, line 15 ¶ | skipping to change at page 60, line 15 ¶ | |||
| Once all data has been either received or discarded, a sender is no | Once all data has been either received or discarded, a sender is no | |||
| longer obligated to update the maximum received data for the | longer obligated to update the maximum received data for the | |||
| connection. | connection. | |||
| Due to reordering, an endpoint could continue receiving frames for | Due to reordering, an endpoint could continue receiving frames for | |||
| the stream even after the stream is closed for sending. Frames | the stream even after the stream is closed for sending. Frames | |||
| received after a peer closes a stream SHOULD be discarded. An | received after a peer closes a stream SHOULD be discarded. An | |||
| endpoint MAY choose to limit the period over which it ignores frames | endpoint MAY choose to limit the period over which it ignores frames | |||
| and treat frames that arrive after this time as being in error. | and treat frames that arrive after this time as being in error. | |||
| An endpoint may receive a RST_STREAM in this state, such as when the | ||||
| peer resets the stream after sending a FIN on it. In this case, the | ||||
| endpoint MAY discard any data that it already received on that | ||||
| stream. The endpoint SHOULD close the connection with a | ||||
| FINAL_OFFSET_ERROR if the received RST_STREAM carries a different | ||||
| offset from the one already established. | ||||
| An endpoint will know the final offset of the data it receives on a | An endpoint will know the final offset of the data it receives on a | |||
| stream when it reaches the "half-closed (remote)" state, see | stream when it reaches the "half-closed (remote)" state, see | |||
| Section 11.3 for details. | Section 11.3 for details. | |||
| A stream in this state can be used by the endpoint to send any frame | A stream in this state can be used by the endpoint to send any frame | |||
| that mentions a stream ID. In this state, the endpoint MUST observe | that mentions a stream ID. In this state, the endpoint MUST observe | |||
| advertised stream and connection data limits (see Section 11). | advertised stream and connection data limits (see Section 11). | |||
| A stream transitions from this state to "closed" by completing | A stream transitions from this state to "closed" by completing | |||
| transmission of all data. This includes sending all data carried in | transmission of all data. This includes sending all data carried in | |||
| STREAM frames including the terminal STREAM frame that contains a FIN | STREAM frames including the terminal STREAM frame that contains a FIN | |||
| flag. | flag. | |||
| A stream also becomes "closed" when the endpoint sends a RST_STREAM | A stream also becomes "closed" when the endpoint sends a RST_STREAM | |||
| frame. | frame. | |||
| 10.2.5. closed | 10.2.5. closed | |||
| The "closed" state is the terminal state for a stream. | The "closed" state is the terminal state for a stream. Reordering | |||
| might cause frames to be received after closing, see Section 10.2.4. | ||||
| Once a stream reaches this state, no frames can be sent that mention | If the application resets a stream that is already in the "closed" | |||
| the stream. Reordering might cause frames to be received after | state, a RST_STREAM frame MAY still be sent in order to cancel | |||
| closing, see Section 10.2.4. | retransmissions of previously-sent STREAM frames. | |||
| 10.3. Solicited State Transitions | 10.3. Solicited State Transitions | |||
| If an endpoint is no longer interested in the data being received, it | If an endpoint is no longer interested in the data it is receiving on | |||
| MAY send a STOP_SENDING frame on a stream in the "open" or "half- | a stream, it MAY send a STOP_SENDING frame identifying that stream to | |||
| closed (local)" state to prompt closure of the stream in the opposite | prompt closure of the stream in the opposite direction. This | |||
| direction. This typically indicates that the receiving application | typically indicates that the receiving application is no longer | |||
| is no longer reading from the stream, but is not a guarantee that | reading data it receives from the stream, but is not a guarantee that | |||
| incoming data will be ignored. | incoming data will be ignored. | |||
| STREAM frames received after sending STOP_SENDING are still counted | STREAM frames received after sending STOP_SENDING are still counted | |||
| toward the connection and stream flow-control windows, even though | toward the connection and stream flow-control windows, even though | |||
| these frames will be discarded upon receipt. This avoids potential | these frames will be discarded upon receipt. This avoids potential | |||
| ambiguity about which STREAM frames count toward flow control. | ambiguity about which STREAM frames count toward flow control. | |||
| Upon receipt of a STOP_SENDING frame on a stream in the "open" or | STOP_SENDING can only be sent for any stream that is not "idle", | |||
| "half-closed (remote)" states, an endpoint MUST send a RST_STREAM | however it is mostly useful for streams in the "open" or "half-closed | |||
| with an error code of QUIC_RECEIVED_RST. If the STOP_SENDING frame | (local)" states. A STOP_SENDING frame requests that the receiving | |||
| is received on a stream that is already in the "half-closed (local)" | endpoint send a RST_STREAM frame. An endpoint that receives a | |||
| or "closed" states, a RST_STREAM frame MAY still be sent in order to | STOP_SENDING frame MUST send a RST_STREAM frame for that stream with | |||
| cancel retransmission of previously-sent STREAM frames. | an error code of STOPPING. If the STOP_SENDING frame is received on | |||
| a stream that is already in the "half-closed (local)" or "closed" | ||||
| states, a RST_STREAM frame MAY still be sent in order to cancel | ||||
| retransmission of previously-sent STREAM frames. | ||||
| While STOP_SENDING frames are retransmittable, an implementation MAY | While STOP_SENDING frames are retransmittable, an implementation MAY | |||
| choose not to retransmit a lost STOP_SENDING frame if the stream has | choose not to retransmit a lost STOP_SENDING frame if the stream has | |||
| already been closed in the appropriate direction since the frame was | already been closed in the appropriate direction since the frame was | |||
| first generated. See Section 9. | first generated. See Section 9. | |||
| 10.4. Stream Concurrency | 10.4. Stream Concurrency | |||
| An endpoint limits the number of concurrently active incoming streams | An endpoint limits the number of concurrently active incoming streams | |||
| by adjusting the maximum stream ID. An initial value is set in the | by adjusting the maximum stream ID. An initial value is set in the | |||
| transport parameters (see Section 7.3.1) and is subsequently | transport parameters (see Section 7.4.1) and is subsequently | |||
| increased by MAX_STREAM_ID frames (see Section 8.6). | increased by MAX_STREAM_ID frames (see Section 8.7). | |||
| The maximum stream ID is specific to each endpoint and applies only | The maximum stream ID is specific to each endpoint and applies only | |||
| to the peer that receives the setting. That is, clients specify the | to the peer that receives the setting. That is, clients specify the | |||
| maximum stream ID the server can initiate, and servers specify the | maximum stream ID the server can initiate, and servers specify the | |||
| maximum stream ID the client can initiate. Each endpoint may respond | maximum stream ID the client can initiate. Each endpoint may respond | |||
| on streams initiated by the other peer, regardless of whether it is | on streams initiated by the other peer, regardless of whether it is | |||
| permitted to initiated new streams. | permitted to initiated new streams. | |||
| Endpoints MUST NOT exceed the limit set by their peer. An endpoint | Endpoints MUST NOT exceed the limit set by their peer. An endpoint | |||
| that receives a STREAM frame with an ID greater than the limit it has | that receives a STREAM frame with an ID greater than the limit it has | |||
| sent MUST treat this as a stream error of type STREAM_ID_ERROR | sent MUST treat this as a stream error of type STREAM_ID_ERROR | |||
| (Section 12), unless this is a result of a change in the initial | (Section 12), unless this is a result of a change in the initial | |||
| offsets (see Section 7.3.2). | offsets (see Section 7.4.2). | |||
| A receiver MUST NOT renege on an advertisement; that is, once a | A receiver MUST NOT renege on an advertisement; that is, once a | |||
| receiver advertises a stream ID via a MAX_STREAM_ID frame, it MUST | receiver advertises a stream ID via a MAX_STREAM_ID frame, it MUST | |||
| NOT subsequently advertise a smaller maximum ID. A sender may | NOT subsequently advertise a smaller maximum ID. A sender may | |||
| receive MAX_STREAM_ID frames out of order; a sender MUST therefore | receive MAX_STREAM_ID frames out of order; a sender MUST therefore | |||
| ignore any MAX_STREAM_ID that does not increase the maximum. | ignore any MAX_STREAM_ID that does not increase the maximum. | |||
| 10.5. Sending and Receiving Data | 10.5. Sending and Receiving Data | |||
| Once a stream is created, endpoints may use the stream to send and | Once a stream is created, endpoints may use the stream to send and | |||
| skipping to change at page 62, line 18 ¶ | skipping to change at page 62, line 28 ¶ | |||
| a stream has the stream offset 0. The largest offset delivered on a | a stream has the stream offset 0. The largest offset delivered on a | |||
| stream MUST be less than 2^64. A receiver MUST ensure that received | stream MUST be less than 2^64. A receiver MUST ensure that received | |||
| stream data is delivered to the application as an ordered byte- | stream data is delivered to the application as an ordered byte- | |||
| stream. Data received out of order MUST be buffered for later | stream. Data received out of order MUST be buffered for later | |||
| delivery, as long as it is not in violation of the receiver's flow | delivery, as long as it is not in violation of the receiver's flow | |||
| control limits. | control limits. | |||
| An endpoint MUST NOT send data on any stream without ensuring that it | An endpoint MUST NOT send data on any stream without ensuring that it | |||
| is within the data limits set by its peer. The cryptographic | is within the data limits set by its peer. The cryptographic | |||
| handshake stream, Stream 0, is exempt from the connection-level data | handshake stream, Stream 0, is exempt from the connection-level data | |||
| limits established by MAX_DATA. Stream 0 is still subject to stream- | limits established by MAX_DATA. Data on stream 0 other than the | |||
| level data limits and MAX_STREAM_DATA. | initial cryptographic handshake message is still subject to stream- | |||
| level data limits and MAX_STREAM_DATA. This message is exempt from | ||||
| flow control because it needs to be sent in a single packet | ||||
| regardless of the server's flow control state. This rule applies | ||||
| even for 0-RTT handshakes where the remembered value of | ||||
| MAX_STREAM_DATA would not permit sending a full initial cryptographic | ||||
| handshake message. | ||||
| Flow control is described in detail in Section 11, and congestion | Flow control is described in detail in Section 11, and congestion | |||
| control is described in the companion document [QUIC-RECOVERY]. | control is described in the companion document [QUIC-RECOVERY]. | |||
| 10.6. Stream Prioritization | 10.6. Stream Prioritization | |||
| Stream multiplexing has a significant effect on application | Stream multiplexing has a significant effect on application | |||
| performance if resources allocated to streams are correctly | performance if resources allocated to streams are correctly | |||
| prioritized. Experience with other multiplexed protocols, such as | prioritized. Experience with other multiplexed protocols, such as | |||
| HTTP/2 [RFC7540], shows that effective prioritization strategies have | HTTP/2 [RFC7540], shows that effective prioritization strategies have | |||
| skipping to change at page 63, line 17 ¶ | skipping to change at page 63, line 31 ¶ | |||
| prioritizing frames other than STREAM frames ensures that loss | prioritizing frames other than STREAM frames ensures that loss | |||
| recovery, congestion control, and flow control operate effectively. | recovery, congestion control, and flow control operate effectively. | |||
| Stream 0 MUST be prioritized over other streams prior to the | Stream 0 MUST be prioritized over other streams prior to the | |||
| completion of the cryptographic handshake. This includes the | completion of the cryptographic handshake. This includes the | |||
| retransmission of the second flight of client handshake messages, | retransmission of the second flight of client handshake messages, | |||
| that is, the TLS Finished and any client authentication messages. | that is, the TLS Finished and any client authentication messages. | |||
| STREAM frames that are determined to be lost SHOULD be retransmitted | STREAM frames that are determined to be lost SHOULD be retransmitted | |||
| before sending new data, unless application priorities indicate | before sending new data, unless application priorities indicate | |||
| otherwise. Retransmitting lost STREAM frames can fill in gaps, which | otherwise. Retransmitting lost stream data can fill in gaps, which | |||
| allows the peer to consume already received data and free up flow | allows the peer to consume already received data and free up flow | |||
| control window. | control window. | |||
| 11. Flow Control | 11. Flow Control | |||
| It is necessary to limit the amount of data that a sender may have | It is necessary to limit the amount of data that a sender may have | |||
| outstanding at any time, so as to prevent a fast sender from | outstanding at any time, so as to prevent a fast sender from | |||
| overwhelming a slow receiver, or to prevent a malicious sender from | overwhelming a slow receiver, or to prevent a malicious sender from | |||
| consuming significant resources at a receiver. This section | consuming significant resources at a receiver. This section | |||
| describes QUIC's flow-control mechanisms. | describes QUIC's flow-control mechanisms. | |||
| skipping to change at page 67, line 18 ¶ | skipping to change at page 67, line 34 ¶ | |||
| An endpoint that detects an error SHOULD signal the existence of that | An endpoint that detects an error SHOULD signal the existence of that | |||
| error to its peer. Errors can affect an entire connection (see | error to its peer. Errors can affect an entire connection (see | |||
| Section 12.1), or a single stream (see Section 12.2). | Section 12.1), or a single stream (see Section 12.2). | |||
| The most appropriate error code (Section 12.3) SHOULD be included in | The most appropriate error code (Section 12.3) SHOULD be included in | |||
| the frame that signals the error. Where this specification | the frame that signals the error. Where this specification | |||
| identifies error conditions, it also identifies the error code that | identifies error conditions, it also identifies the error code that | |||
| is used. | is used. | |||
| A stateless reset (Section 7.7.5) is not suitable for any error that | A stateless reset (Section 7.8.4) is not suitable for any error that | |||
| can be signaled with a CONNECTION_CLOSE or RST_STREAM frame. A | can be signaled with a CONNECTION_CLOSE, APPLICATION_CLOSE, or | |||
| stateless reset MUST NOT be used by an endpoint that has the state | RST_STREAM frame. A stateless reset MUST NOT be used by an endpoint | |||
| necessary to send a frame on the connection. | that has the state necessary to send a frame on the connection. | |||
| 12.1. Connection Errors | 12.1. Connection Errors | |||
| Errors that result in the connection being unusable, such as an | Errors that result in the connection being unusable, such as an | |||
| obvious violation of protocol semantics or corruption of state that | obvious violation of protocol semantics or corruption of state that | |||
| affects an entire connection, MUST be signaled using a | affects an entire connection, MUST be signaled using a | |||
| CONNECTION_CLOSE frame (Section 8.3). An endpoint MAY close the | CONNECTION_CLOSE or APPLICATION_CLOSE frame (Section 8.3, | |||
| connection in this manner, even if the error only affects a single | Section 8.4). An endpoint MAY close the connection in this manner | |||
| stream. | even if the error only affects a single stream. | |||
| A CONNECTION_CLOSE frame could be sent in a packet that is lost. An | Application protocols can signal application-specific protocol errors | |||
| endpoint SHOULD be prepared to retransmit a packet containing a | using the APPLICATION_CLOSE frame. Errors that are specific to the | |||
| CONNECTION_CLOSE frame if it receives more packets on a terminated | transport, including all those described in this document, are | |||
| connection. Limiting the number of retransmissions and the time over | carried in a CONNECTION_CLOSE frame. Other than the type of error | |||
| which this final packet is sent limits the effort expended on | code they carry, these frames are identical in format and semantics. | |||
| terminated connections. | ||||
| A CONNECTION_CLOSE or APPLICATION_CLOSE frame could be sent in a | ||||
| packet that is lost. An endpoint SHOULD be prepared to retransmit a | ||||
| packet containing either frame type if it receives more packets on a | ||||
| terminated connection. Limiting the number of retransmissions and | ||||
| the time over which this final packet is sent limits the effort | ||||
| expended on terminated connections. | ||||
| An endpoint that chooses not to retransmit packets containing | An endpoint that chooses not to retransmit packets containing | |||
| CONNECTION_CLOSE risks a peer missing the first such packet. The | CONNECTION_CLOSE or APPLICATION_CLOSE risks a peer missing the first | |||
| only mechanism available to an endpoint that continues to receive | such packet. The only mechanism available to an endpoint that | |||
| data for a terminated connection is to use the stateless reset | continues to receive data for a terminated connection is to use the | |||
| process (Section 7.7.5). | stateless reset process (Section 7.8.4). | |||
| An endpoint that receives an invalid CONNECTION_CLOSE frame MUST NOT | An endpoint that receives an invalid CONNECTION_CLOSE or | |||
| signal the existence of the error to its peer. | APPLICATION_CLOSE frame MUST NOT signal the existence of the error to | |||
| its peer. | ||||
| 12.2. Stream Errors | 12.2. Stream Errors | |||
| If the error affects a single stream, but otherwise leaves the | If the error affects a single stream, but otherwise leaves the | |||
| connection in a recoverable state, the endpoint can send a RST_STREAM | connection in a recoverable state, the endpoint can send a RST_STREAM | |||
| frame (Section 8.2) with an appropriate error code to terminate just | frame (Section 8.2) with an appropriate error code to terminate just | |||
| the affected stream. | the affected stream. | |||
| Stream 0 is critical to the functioning of the entire connection. If | Stream 0 is critical to the functioning of the entire connection. If | |||
| stream 0 is closed with either a RST_STREAM or STREAM frame bearing | stream 0 is closed with either a RST_STREAM or STREAM frame bearing | |||
| the FIN flag, an endpoint MUST generate a connection error of type | the FIN flag, an endpoint MUST generate a connection error of type | |||
| PROTOCOL_VIOLATION. | PROTOCOL_VIOLATION. | |||
| Some application protocols make other streams critical to that | RST_STREAM MUST be instigated by the application and MUST carry an | |||
| protocol. An application protocol does not need to inform the | application error code. Resetting a stream without knowledge of the | |||
| transport that a stream is critical; it can instead generate | application protocol could cause the protocol to enter an | |||
| appropriate errors in response to being notified that the critical | unrecoverable state. Application protocols might require certain | |||
| stream is closed. | streams to be reliably delivered in order to guarantee consistent | |||
| state between endpoints. | ||||
| An endpoint MAY send a RST_STREAM frame in the same packet as a | ||||
| CONNECTION_CLOSE frame. | ||||
| 12.3. Error Codes | ||||
| Error codes are 32 bits long, with the first two bits indicating the | ||||
| source of the error code: | ||||
| 0x00000000-0x3FFFFFFF: Application-specific error codes. Defined by | ||||
| each application-layer protocol. | ||||
| 0x40000000-0x7FFFFFFF: Reserved for host-local error codes. These | ||||
| codes MUST NOT be sent to a peer, but MAY be used in API return | ||||
| codes and logs. | ||||
| 0x80000000-0xBFFFFFFF: QUIC transport error codes, including packet | 12.3. Transport Error Codes | |||
| protection errors. Applicable to all uses of QUIC. | ||||
| 0xC0000000-0xFFFFFFFF: Cryptographic error codes. Defined by the | QUIC error codes are 16-bit unsigned integers. | |||
| cryptographic handshake protocol in use. | ||||
| This section lists the defined QUIC transport error codes that may be | This section lists the defined QUIC transport error codes that may be | |||
| used in a CONNECTION_CLOSE or RST_STREAM frame. Error codes share a | used in a CONNECTION_CLOSE frame. These errors apply to the entire | |||
| common code space. Some error codes apply only to either streams or | connection. | |||
| the entire connection and have no defined semantics in the other | ||||
| context. | ||||
| NO_ERROR (0x80000000): An endpoint uses this with CONNECTION_CLOSE | ||||
| to signal that the connection is being closed abruptly in the | ||||
| absence of any error. An endpoint uses this with RST_STREAM to | ||||
| signal that the stream is no longer wanted or in response to the | ||||
| receipt of a RST_STREAM for that stream. | ||||
| INTERNAL_ERROR (0x80000001): The endpoint encountered an internal | NO_ERROR (0x0): An endpoint uses this with CONNECTION_CLOSE to | |||
| error and cannot continue with the connection. | signal that the connection is being closed abruptly in the absence | |||
| of any error. | ||||
| CANCELLED (0x80000002): An endpoint sends this with RST_STREAM to | INTERNAL_ERROR (0x1): The endpoint encountered an internal error and | |||
| indicate that the stream is not wanted and that no application | cannot continue with the connection. | |||
| action was taken for the stream. This error code is not valid for | ||||
| use with CONNECTION_CLOSE. | ||||
| FLOW_CONTROL_ERROR (0x80000003): An endpoint received more data than | FLOW_CONTROL_ERROR (0x3): An endpoint received more data than it | |||
| it permitted in its advertised data limits (see Section 11). | permitted in its advertised data limits (see Section 11). | |||
| STREAM_ID_ERROR (0x80000004): An endpoint received a frame for a | STREAM_ID_ERROR (0x4): An endpoint received a frame for a stream | |||
| stream identifier that exceeded its advertised maximum stream ID. | identifier that exceeded its advertised maximum stream ID. | |||
| STREAM_STATE_ERROR (0x80000005): An endpoint received a frame for a | STREAM_STATE_ERROR (0x5): An endpoint received a frame for a stream | |||
| stream that was not in a state that permitted that frame (see | that was not in a state that permitted that frame (see | |||
| Section 10.2). | Section 10.2). | |||
| FINAL_OFFSET_ERROR (0x80000006): An endpoint received a STREAM frame | FINAL_OFFSET_ERROR (0x6): An endpoint received a STREAM frame | |||
| containing data that exceeded the previously established final | containing data that exceeded the previously established final | |||
| offset. Or an endpoint received a RST_STREAM frame containing a | offset. Or an endpoint received a RST_STREAM frame containing a | |||
| final offset that was lower than the maximum offset of data that | final offset that was lower than the maximum offset of data that | |||
| was already received. Or an endpoint received a RST_STREAM frame | was already received. Or an endpoint received a RST_STREAM frame | |||
| containing a different final offset to the one already | containing a different final offset to the one already | |||
| established. | established. | |||
| FRAME_FORMAT_ERROR (0x80000007): An endpoint received a frame that | FRAME_FORMAT_ERROR (0x7): An endpoint received a frame that was | |||
| was badly formatted. For instance, an empty STREAM frame that | badly formatted. For instance, an empty STREAM frame that omitted | |||
| omitted the FIN flag, or an ACK frame that has more acknowledgment | the FIN flag, or an ACK frame that has more acknowledgment ranges | |||
| ranges than the remainder of the packet could carry. This is a | than the remainder of the packet could carry. This is a generic | |||
| generic error code; an endpoint SHOULD use the more specific frame | error code; an endpoint SHOULD use the more specific frame format | |||
| format error codes (0x800001XX) if possible. | error codes (0x1XX) if possible. | |||
| TRANSPORT_PARAMETER_ERROR (0x80000008): An endpoint received | TRANSPORT_PARAMETER_ERROR (0x8): An endpoint received transport | |||
| transport parameters that were badly formatted, included an | parameters that were badly formatted, included an invalid value, | |||
| invalid value, was absent even though it is mandatory, was present | was absent even though it is mandatory, was present though it is | |||
| though it is forbidden, or is otherwise in error. | forbidden, or is otherwise in error. | |||
| VERSION_NEGOTIATION_ERROR (0x80000009): An endpoint received | VERSION_NEGOTIATION_ERROR (0x9): An endpoint received transport | |||
| transport parameters that contained version negotiation parameters | parameters that contained version negotiation parameters that | |||
| that disagreed with the version negotiation that it performed. | disagreed with the version negotiation that it performed. This | |||
| This error code indicates a potential version downgrade attack. | error code indicates a potential version downgrade attack. | |||
| PROTOCOL_VIOLATION (0x8000000A): 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. | |||
| QUIC_RECEIVED_RST (0x80000035): Terminating stream because peer sent | FRAME_ERROR (0x1XX): An endpoint detected an error in a specific | |||
| a RST_STREAM or STOP_SENDING. | frame type. The frame type is included as the last octet of the | |||
| error code. For example, an error in a MAX_STREAM_ID frame would | ||||
| be indicated with the code (0x106). | ||||
| FRAME_ERROR (0x800001XX): An endpoint detected an error in a | See Section 14.2 for details of registering new error codes. | |||
| specific frame type. The frame type is included as the last octet | ||||
| of the error code. For example, an error in a MAX_STREAM_ID frame | 12.4. Application Protocol Error Codes | |||
| would be indicated with the code (0x80000106). | ||||
| Application protocol error codes are 16-bit unsigned integers, but | ||||
| the management of application error codes are left to application | ||||
| protocols. Application protocol error codes are used for the | ||||
| RST_STREAM (Section 8.2) and APPLICATION_CLOSE (Section 8.4) frames. | ||||
| There is no restriction on the use of the 16-bit error code space for | ||||
| application protocols. However, QUIC reserves the error code with a | ||||
| value of 0 to mean STOPPING. The application error code of STOPPING | ||||
| (0) is used by the transport to cancel a stream in response to | ||||
| receipt of a STOP_SENDING frame. | ||||
| 13. Security and Privacy Considerations | 13. Security and Privacy Considerations | |||
| 13.1. Spoofed ACK Attack | 13.1. Spoofed ACK Attack | |||
| An attacker receives an STK from the server and then releases the IP | An attacker receives an STK from the server and then releases the IP | |||
| address on which it received the STK. The attacker may, in the | address on which it received the STK. The attacker may, in the | |||
| future, spoof this same address (which now presumably addresses a | future, spoof this same address (which now presumably addresses a | |||
| different endpoint), and initiate a 0-RTT connection with a server on | different endpoint), and initiate a 0-RTT connection with a server on | |||
| the victim's behalf. The attacker then spoofs ACK frames to the | the victim's behalf. The attacker then spoofs ACK frames to the | |||
| skipping to change at page 72, line 22 ¶ | skipping to change at page 72, line 22 ¶ | |||
| 14.1. QUIC Transport Parameter Registry | 14.1. QUIC Transport Parameter Registry | |||
| IANA [SHALL add/has added] a registry for "QUIC Transport Parameters" | IANA [SHALL add/has added] a registry for "QUIC Transport Parameters" | |||
| under a "QUIC Protocol" heading. | under a "QUIC Protocol" heading. | |||
| The "QUIC Transport Parameters" registry governs a 16-bit space. | The "QUIC Transport Parameters" registry governs a 16-bit space. | |||
| This space is split into two spaces that are governed by different | This space is split into two spaces that are governed by different | |||
| policies. Values with the first byte in the range 0x00 to 0xfe (in | policies. Values with the first byte in the range 0x00 to 0xfe (in | |||
| hexadecimal) are assigned via the Specification Required policy | hexadecimal) are assigned via the Specification Required policy | |||
| [RFC5226]. Values with the first byte 0xff are reserved for Private | [RFC8126]. Values with the first byte 0xff are reserved for Private | |||
| Use [RFC5226]. | Use [RFC8126]. | |||
| Registrations MUST include the following fields: | Registrations MUST include the following fields: | |||
| Value: The numeric value of the assignment (registrations will be | Value: The numeric value of the assignment (registrations will be | |||
| between 0x0000 and 0xfeff). | between 0x0000 and 0xfeff). | |||
| Parameter Name: A short mnemonic for the parameter. | Parameter Name: A short mnemonic for the parameter. | |||
| Specification: A reference to a publicly available specification for | Specification: A reference to a publicly available specification for | |||
| the value. | the value. | |||
| skipping to change at page 73, line 8 ¶ | skipping to change at page 73, line 8 ¶ | |||
| readily accessible. The expert(s) are encouraged to be biased | readily accessible. The expert(s) are encouraged to be biased | |||
| towards approving registrations unless they are abusive, frivolous, | towards approving registrations unless they are abusive, frivolous, | |||
| or actively harmful (not merely aesthetically displeasing, or | or actively harmful (not merely aesthetically displeasing, or | |||
| architecturally dubious). | architecturally dubious). | |||
| The initial contents of this registry are shown in Table 4. | The initial contents of this registry are shown in Table 4. | |||
| +--------+-------------------------+---------------+ | +--------+-------------------------+---------------+ | |||
| | Value | Parameter Name | Specification | | | Value | Parameter Name | Specification | | |||
| +--------+-------------------------+---------------+ | +--------+-------------------------+---------------+ | |||
| | 0x0000 | initial_max_stream_data | Section 7.3.1 | | | 0x0000 | initial_max_stream_data | Section 7.4.1 | | |||
| | | | | | | | | | | |||
| | 0x0001 | initial_max_data | Section 7.3.1 | | | 0x0001 | initial_max_data | Section 7.4.1 | | |||
| | | | | | | | | | | |||
| | 0x0002 | initial_max_stream_id | Section 7.3.1 | | | 0x0002 | initial_max_stream_id | Section 7.4.1 | | |||
| | | | | | | | | | | |||
| | 0x0003 | idle_timeout | Section 7.3.1 | | | 0x0003 | idle_timeout | Section 7.4.1 | | |||
| | | | | | | | | | | |||
| | 0x0004 | omit_connection_id | Section 7.3.1 | | | 0x0004 | omit_connection_id | Section 7.4.1 | | |||
| | | | | | | | | | | |||
| | 0x0005 | max_packet_size | Section 7.3.1 | | | 0x0005 | max_packet_size | Section 7.4.1 | | |||
| | | | | | | | | | | |||
| | 0x0006 | stateless_reset_token | Section 7.3.1 | | | 0x0006 | stateless_reset_token | Section 7.4.1 | | |||
| +--------+-------------------------+---------------+ | +--------+-------------------------+---------------+ | |||
| Table 4: Initial QUIC Transport Parameters Entries | Table 4: Initial QUIC Transport Parameters Entries | |||
| 14.2. QUIC Transport Error Codes Registry | ||||
| IANA [SHALL add/has added] a registry for "QUIC Transport Error | ||||
| Codes" under a "QUIC Protocol" heading. | ||||
| The "QUIC Transport Error Codes" registry governs a 16-bit space. | ||||
| This space is split into two spaces that are governed by different | ||||
| policies. Values with the first byte in the range 0x00 to 0xfe (in | ||||
| 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: | ||||
| Value: The numeric value of the assignment (registrations will be | ||||
| between 0x0000 and 0xfeff). | ||||
| Code: A short mnemonic for the parameter. | ||||
| Description: A brief description of the error code semantics, which | ||||
| MAY be a summary if a specification reference is provided. | ||||
| Specification: A reference to a publicly available specification for | ||||
| the value. | ||||
| The initial contents of this registry are shown in Table 5. Note | ||||
| that FRAME_ERROR takes the range from 0x100 to 0x1FF and private use | ||||
| occupies the range from 0xFE00 to 0xFFFF. | ||||
| +-----------+------------------------+---------------+--------------+ | ||||
| | Value | Error | Description | Specificatio | | ||||
| | | | | n | | ||||
| +-----------+------------------------+---------------+--------------+ | ||||
| | 0x0 | NO_ERROR | No error | Section 12.3 | | ||||
| | | | | | | ||||
| | 0x1 | INTERNAL_ERROR | Implementatio | Section 12.3 | | ||||
| | | | n error | | | ||||
| | | | | | | ||||
| | 0x3 | FLOW_CONTROL_ERROR | Flow control | Section 12.3 | | ||||
| | | | error | | | ||||
| | | | | | | ||||
| | 0x4 | STREAM_ID_ERROR | Invalid | Section 12.3 | | ||||
| | | | stream ID | | | ||||
| | | | | | | ||||
| | 0x5 | STREAM_STATE_ERROR | Frame | Section 12.3 | | ||||
| | | | received in | | | ||||
| | | | invalid | | | ||||
| | | | stream state | | | ||||
| | | | | | | ||||
| | 0x6 | FINAL_OFFSET_ERROR | Change to | Section 12.3 | | ||||
| | | | final stream | | | ||||
| | | | offset | | | ||||
| | | | | | | ||||
| | 0x7 | FRAME_FORMAT_ERROR | Generic frame | Section 12.3 | | ||||
| | | | format error | | | ||||
| | | | | | | ||||
| | 0x8 | TRANSPORT_PARAMETER_ER | Error in | Section 12.3 | | ||||
| | | ROR | transport | | | ||||
| | | | parameters | | | ||||
| | | | | | | ||||
| | 0x9 | VERSION_NEGOTIATION_ER | Version | Section 12.3 | | ||||
| | | ROR | negotiation | | | ||||
| | | | failure | | | ||||
| | | | | | | ||||
| | 0xA | PROTOCOL_VIOLATION | Generic | Section 12.3 | | ||||
| | | | protocol | | | ||||
| | | | violation | | | ||||
| | | | | | | ||||
| | 0x100-0x1 | FRAME_ERROR | Specific | Section 12.3 | | ||||
| | FF | | frame format | | | ||||
| | | | error | | | ||||
| +-----------+------------------------+---------------+--------------+ | ||||
| Table 5: Initial QUIC Transport Error Codes Entries | ||||
| 15. References | 15. References | |||
| 15.1. Normative References | 15.1. Normative References | |||
| [I-D.ietf-tls-tls13] | [I-D.ietf-tls-tls13] | |||
| Rescorla, E., "The Transport Layer Security (TLS) Protocol | Rescorla, E., "The Transport Layer Security (TLS) Protocol | |||
| Version 1.3", draft-ietf-tls-tls13-21 (work in progress), | Version 1.3", draft-ietf-tls-tls13-21 (work in progress), | |||
| July 2017. | July 2017. | |||
| [PLPMTUD] Mathis, M. and J. Heffner, "Packetization Layer Path MTU | ||||
| Discovery", RFC 4821, DOI 10.17487/RFC4821, March 2007, | ||||
| <https://www.rfc-editor.org/info/rfc4821>. | ||||
| [PMTUDv4] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191, | ||||
| DOI 10.17487/RFC1191, November 1990, | ||||
| <https://www.rfc-editor.org/info/rfc1191>. | ||||
| [PMTUDv6] McCann, J., Deering, S., Mogul, J., and R. Hinden, Ed., | ||||
| "Path MTU Discovery for IP version 6", STD 87, RFC 8201, | ||||
| DOI 10.17487/RFC8201, July 2017, | ||||
| <https://www.rfc-editor.org/info/rfc8201>. | ||||
| [QUIC-RECOVERY] | [QUIC-RECOVERY] | |||
| Iyengar, J., Ed. and I. Swett, Ed., "QUIC Loss Detection | Iyengar, J., Ed. and I. Swett, Ed., "QUIC Loss Detection | |||
| and Congestion Control", draft-ietf-quic-recovery (work in | and Congestion Control", draft-ietf-quic-recovery-07 (work | |||
| progress), September 2017. | in progress), October 2017. | |||
| [QUIC-TLS] | [QUIC-TLS] | |||
| Thomson, M., Ed. and S. Turner, Ed., "Using Transport | Thomson, M., Ed. and S. Turner, Ed., "Using Transport | |||
| Layer Security (TLS) to Secure QUIC", draft-ietf-quic-tls | Layer Security (TLS) to Secure QUIC", draft-ietf-quic- | |||
| (work in progress), September 2017. | tls-07 (work in progress), October 2017. | |||
| [RFC1191] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191, | [RFC1191] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191, | |||
| DOI 10.17487/RFC1191, November 1990, <https://www.rfc- | DOI 10.17487/RFC1191, November 1990, | |||
| editor.org/info/rfc1191>. | <https://www.rfc-editor.org/info/rfc1191>. | |||
| [RFC1981] McCann, J., Deering, S., and J. Mogul, "Path MTU Discovery | ||||
| for IP version 6", RFC 1981, DOI 10.17487/RFC1981, August | ||||
| 1996, <https://www.rfc-editor.org/info/rfc1981>. | ||||
| [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | |||
| Requirement Levels", BCP 14, RFC 2119, | Requirement Levels", BCP 14, RFC 2119, | |||
| DOI 10.17487/RFC2119, March 1997, <https://www.rfc- | DOI 10.17487/RFC2119, March 1997, | |||
| editor.org/info/rfc2119>. | <https://www.rfc-editor.org/info/rfc2119>. | |||
| [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO | [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO | |||
| 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November | 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November | |||
| 2003, <https://www.rfc-editor.org/info/rfc3629>. | 2003, <https://www.rfc-editor.org/info/rfc3629>. | |||
| [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, | [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, | |||
| "Randomness Requirements for Security", BCP 106, RFC 4086, | "Randomness Requirements for Security", BCP 106, RFC 4086, | |||
| DOI 10.17487/RFC4086, June 2005, <https://www.rfc- | DOI 10.17487/RFC4086, June 2005, | |||
| editor.org/info/rfc4086>. | <https://www.rfc-editor.org/info/rfc4086>. | |||
| [RFC4821] Mathis, M. and J. Heffner, "Packetization Layer Path MTU | ||||
| Discovery", RFC 4821, DOI 10.17487/RFC4821, March 2007, | ||||
| <https://www.rfc-editor.org/info/rfc4821>. | ||||
| [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an | [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for | |||
| IANA Considerations Section in RFCs", RFC 5226, | Writing an IANA Considerations Section in RFCs", BCP 26, | |||
| DOI 10.17487/RFC5226, May 2008, <https://www.rfc- | RFC 8126, DOI 10.17487/RFC8126, June 2017, | |||
| editor.org/info/rfc5226>. | <https://www.rfc-editor.org/info/rfc8126>. | |||
| 15.2. Informative References | 15.2. Informative References | |||
| [EARLY-DESIGN] | [EARLY-DESIGN] | |||
| Roskind, J., "QUIC: Multiplexed Transport Over UDP", | Roskind, J., "QUIC: Multiplexed Transport Over UDP", | |||
| December 2013, <https://goo.gl/dMVtFi>. | December 2013, <https://goo.gl/dMVtFi>. | |||
| [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- | [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- | |||
| Hashing for Message Authentication", RFC 2104, | Hashing for Message Authentication", RFC 2104, | |||
| DOI 10.17487/RFC2104, February 1997, <https://www.rfc- | DOI 10.17487/RFC2104, February 1997, | |||
| editor.org/info/rfc2104>. | <https://www.rfc-editor.org/info/rfc2104>. | |||
| [RFC2360] Scott, G., "Guide for Internet Standards Writers", BCP 22, | [RFC2360] Scott, G., "Guide for Internet Standards Writers", BCP 22, | |||
| RFC 2360, DOI 10.17487/RFC2360, June 1998, | RFC 2360, DOI 10.17487/RFC2360, June 1998, | |||
| <https://www.rfc-editor.org/info/rfc2360>. | <https://www.rfc-editor.org/info/rfc2360>. | |||
| [RFC4787] Audet, F., Ed. and C. Jennings, "Network Address | [RFC4787] Audet, F., Ed. and C. Jennings, "Network Address | |||
| Translation (NAT) Behavioral Requirements for Unicast | Translation (NAT) Behavioral Requirements for Unicast | |||
| UDP", BCP 127, RFC 4787, DOI 10.17487/RFC4787, January | UDP", BCP 127, RFC 4787, DOI 10.17487/RFC4787, January | |||
| 2007, <https://www.rfc-editor.org/info/rfc4787>. | 2007, <https://www.rfc-editor.org/info/rfc4787>. | |||
| [RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand | [RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand | |||
| Key Derivation Function (HKDF)", RFC 5869, | Key Derivation Function (HKDF)", RFC 5869, | |||
| DOI 10.17487/RFC5869, May 2010, <https://www.rfc- | DOI 10.17487/RFC5869, May 2010, | |||
| editor.org/info/rfc5869>. | <https://www.rfc-editor.org/info/rfc5869>. | |||
| [RFC6824] Ford, A., Raiciu, C., Handley, M., and O. Bonaventure, | [RFC6824] Ford, A., Raiciu, C., Handley, M., and O. Bonaventure, | |||
| "TCP Extensions for Multipath Operation with Multiple | "TCP Extensions for Multipath Operation with Multiple | |||
| Addresses", RFC 6824, DOI 10.17487/RFC6824, January 2013, | Addresses", RFC 6824, DOI 10.17487/RFC6824, January 2013, | |||
| <https://www.rfc-editor.org/info/rfc6824>. | <https://www.rfc-editor.org/info/rfc6824>. | |||
| [RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan, | [RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan, | |||
| "Transport Layer Security (TLS) Application-Layer Protocol | "Transport Layer Security (TLS) Application-Layer Protocol | |||
| Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301, | Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301, | |||
| July 2014, <https://www.rfc-editor.org/info/rfc7301>. | July 2014, <https://www.rfc-editor.org/info/rfc7301>. | |||
| [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext | [RFC7540] 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, <https://www.rfc- | DOI 10.17487/RFC7540, May 2015, | |||
| editor.org/info/rfc7540>. | <https://www.rfc-editor.org/info/rfc7540>. | |||
| [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/>. | |||
| [SST] Ford, B., "Structured streams", ACM SIGCOMM Computer | [SST] Ford, B., "Structured streams", ACM SIGCOMM Computer | |||
| Communication Review Vol. 37, pp. 361, | Communication Review Vol. 37, pp. 361, | |||
| DOI 10.1145/1282427.1282421, October 2007. | DOI 10.1145/1282427.1282421, October 2007. | |||
| 15.3. URIs | 15.3. URIs | |||
| [1] https://github.com/quicwg/base-drafts/wiki/QUIC-Versions | [1] https://mailarchive.ietf.org/arch/search/?email_list=quic | |||
| [2] https://github.com/quicwg | ||||
| [3] https://github.com/quicwg/base-drafts/labels/transport | ||||
| [4] https://github.com/quicwg/base-drafts/wiki/QUIC-Versions | ||||
| Appendix A. Contributors | Appendix A. Contributors | |||
| The original authors of this specification were Ryan Hamilton, Jana | The original authors of this specification were Ryan Hamilton, Jana | |||
| Iyengar, Ian Swett, and Alyssa Wilk. | Iyengar, Ian Swett, and Alyssa Wilk. | |||
| The original design and rationale behind this protocol draw | The original design and rationale behind this protocol draw | |||
| significantly from work by Jim Roskind [EARLY-DESIGN]. In | significantly from work by Jim Roskind [EARLY-DESIGN]. In | |||
| alphabetical order, the contributors to the pre-IETF QUIC project at | alphabetical order, the contributors to the pre-IETF QUIC project at | |||
| Google are: Britt Cyr, Jeremy Dorfman, Ryan Hamilton, Jana Iyengar, | Google are: Britt Cyr, Jeremy Dorfman, Ryan Hamilton, Jana Iyengar, | |||
| skipping to change at page 76, line 16 ¶ | skipping to change at page 78, line 12 ¶ | |||
| discussions and public ones on the quic@ietf.org and proto- | discussions and public ones on the quic@ietf.org and proto- | |||
| quic@chromium.org mailing lists. Our thanks to all. | quic@chromium.org mailing lists. Our thanks to all. | |||
| Appendix C. Change Log | Appendix C. Change Log | |||
| *RFC Editor's Note:* Please remove this section prior to | *RFC Editor's Note:* Please remove this section prior to | |||
| publication of a final version of this document. | publication of a final version of this document. | |||
| Issue and pull request numbers are listed with a leading octothorp. | Issue and pull request numbers are listed with a leading octothorp. | |||
| C.1. Since draft-ietf-quic-transport-05 | C.1. Since draft-ietf-quic-transport-06 | |||
| o Replaced FNV-1a with AES-GCM for all "Cleartext" packets. | ||||
| C.2. Since draft-ietf-quic-transport-05 | ||||
| o Stateless token is server-only (#726) | o Stateless token is server-only (#726) | |||
| o Refactor section on connection termination (#733, #748, #328, | o Refactor section on connection termination (#733, #748, #328, | |||
| #177) | #177) | |||
| o Limit size of Version Negotiation packet (#585) | o Limit size of Version Negotiation packet (#585) | |||
| o Clarify when and what to ack (#736) | o Clarify when and what to ack (#736) | |||
| o Renamed STREAM_ID_NEEDED to STREAM_ID_BLOCKED | o Renamed STREAM_ID_NEEDED to STREAM_ID_BLOCKED | |||
| o Clarify Keep-alive requirements (#729) | o Clarify Keep-alive requirements (#729) | |||
| C.2. Since draft-ietf-quic-transport-04 | C.3. Since draft-ietf-quic-transport-04 | |||
| o Introduce STOP_SENDING frame, RST_STREAM only resets in one | o Introduce STOP_SENDING frame, RST_STREAM only resets in one | |||
| direction (#165) | direction (#165) | |||
| o Removed GOAWAY; application protocols are responsible for graceful | o Removed GOAWAY; application protocols are responsible for graceful | |||
| shutdown (#696) | shutdown (#696) | |||
| o Reduced the number of error codes (#96, #177, #184, #211) | o Reduced the number of error codes (#96, #177, #184, #211) | |||
| o Version validation fields can't move or change (#121) | o Version validation fields can't move or change (#121) | |||
| skipping to change at page 77, line 16 ¶ | skipping to change at page 79, line 16 ¶ | |||
| o Increased the maximum length of the Largest Acknowledged field in | o Increased the maximum length of the Largest Acknowledged field in | |||
| ACK frames to 64 bits (#629) | ACK frames to 64 bits (#629) | |||
| o truncate_connection_id is renamed to omit_connection_id (#659) | o truncate_connection_id is renamed to omit_connection_id (#659) | |||
| o CONNECTION_CLOSE terminates the connection like TCP RST (#330, | o CONNECTION_CLOSE terminates the connection like TCP RST (#330, | |||
| #328) | #328) | |||
| o Update labels used in HKDF-Expand-Label to match TLS 1.3 (#642) | o Update labels used in HKDF-Expand-Label to match TLS 1.3 (#642) | |||
| C.3. Since draft-ietf-quic-transport-03 | C.4. Since draft-ietf-quic-transport-03 | |||
| o Change STREAM and RST_STREAM layout | o Change STREAM and RST_STREAM layout | |||
| o Add MAX_STREAM_ID settings | o Add MAX_STREAM_ID settings | |||
| C.4. Since draft-ietf-quic-transport-02 | C.5. Since draft-ietf-quic-transport-02 | |||
| o The size of the initial packet payload has a fixed minimum (#267, | o The size of the initial packet payload has a fixed minimum (#267, | |||
| #472) | #472) | |||
| o Define when Version Negotiation packets are ignored (#284, #294, | o Define when Version Negotiation packets are ignored (#284, #294, | |||
| #241, #143, #474) | #241, #143, #474) | |||
| o The 64-bit FNV-1a algorithm is used for integrity protection of | o The 64-bit FNV-1a algorithm is used for integrity protection of | |||
| unprotected packets (#167, #480, #481, #517) | unprotected packets (#167, #480, #481, #517) | |||
| skipping to change at page 78, line 19 ¶ | skipping to change at page 80, line 19 ¶ | |||
| linkability (#232, #491, #496) | linkability (#232, #491, #496) | |||
| o Transport parameters for 0-RTT are retained from a previous | o Transport parameters for 0-RTT are retained from a previous | |||
| connection (#405, #513, #512) | connection (#405, #513, #512) | |||
| * A client in 0-RTT no longer required to reset excess streams | * A client in 0-RTT no longer required to reset excess streams | |||
| (#425, #479) | (#425, #479) | |||
| o Expanded security considerations (#440, #444, #445, #448) | o Expanded security considerations (#440, #444, #445, #448) | |||
| C.5. Since draft-ietf-quic-transport-01 | C.6. Since draft-ietf-quic-transport-01 | |||
| o Defined short and long packet headers (#40, #148, #361) | o Defined short and long packet headers (#40, #148, #361) | |||
| o Defined a versioning scheme and stable fields (#51, #361) | o Defined a versioning scheme and stable fields (#51, #361) | |||
| o Define reserved version values for "greasing" negotiation (#112, | o Define reserved version values for "greasing" negotiation (#112, | |||
| #278) | #278) | |||
| o The initial packet number is randomized (#35, #283) | o The initial packet number is randomized (#35, #283) | |||
| skipping to change at page 80, line 17 ¶ | skipping to change at page 82, line 17 ¶ | |||
| o Remove error code and reason phrase from GOAWAY (#352, #355) | o Remove error code and reason phrase from GOAWAY (#352, #355) | |||
| o GOAWAY includes a final stream number for both directions (#347) | o GOAWAY includes a final stream number for both directions (#347) | |||
| o Error codes for RST_STREAM and CONNECTION_CLOSE are now at a | o Error codes for RST_STREAM and CONNECTION_CLOSE are now at a | |||
| consistent offset (#249) | consistent offset (#249) | |||
| o Defined priority as the responsibility of the application protocol | o Defined priority as the responsibility of the application protocol | |||
| (#104, #303) | (#104, #303) | |||
| C.6. Since draft-ietf-quic-transport-00 | C.7. Since draft-ietf-quic-transport-00 | |||
| o Replaced DIVERSIFICATION_NONCE flag with KEY_PHASE flag | o Replaced DIVERSIFICATION_NONCE flag with KEY_PHASE flag | |||
| o Defined versioning | o Defined versioning | |||
| o Reworked description of packet and frame layout | o Reworked description of packet and frame layout | |||
| o Error code space is divided into regions for each component | o Error code space is divided into regions for each component | |||
| o Use big endian for all numeric values | o Use big endian for all numeric values | |||
| C.7. Since draft-hamilton-quic-transport-protocol-01 | C.8. Since draft-hamilton-quic-transport-protocol-01 | |||
| o Adopted as base for draft-ietf-quic-tls | o Adopted as base for draft-ietf-quic-tls | |||
| o Updated authors/editors list | o Updated authors/editors list | |||
| o Added IANA Considerations section | o Added IANA Considerations section | |||
| o Moved Contributors and Acknowledgments to appendices | o Moved Contributors and Acknowledgments to appendices | |||
| Authors' Addresses | Authors' Addresses | |||
| End of changes. 235 change blocks. | ||||
| 592 lines changed or deleted | 725 lines changed or added | |||
This html diff was produced by rfcdiff 1.45. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||