RFC 9369: QUIC Version 2
- M. Duke
Abstract
This document specifies QUIC version 2, which is identical to QUIC version 1 except for some trivial details. Its purpose is to combat various ossification vectors and exercise the version negotiation framework. It also serves as a template for the minimum changes in any future version of QUIC.¶
Note that "version 2" is an informal name for this proposal that indicates it is the second version of QUIC to be published as a Standards Track document. The protocol specified here uses a version number other than 2 in the wire image, in order to minimize ossification risks.¶
Status of This Memo
This is an Internet Standards Track document.¶
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.¶
Information about the current status of this document, any
errata, and how to provide feedback on it may be obtained at
https://
Copyright Notice
Copyright (c) 2023 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(https://
1. Introduction
QUIC version 1 [QUIC] has numerous extension points, including the version number that occupies the second through fifth bytes of every long header (see [QUIC-INVARIANTS]). If experimental versions are rare, and QUIC version 1 constitutes the vast majority of QUIC traffic, there is the potential for middleboxes to ossify on the version bytes that are usually 0x00000001.¶
In QUIC version 1, Initial packets are encrypted with the version
Finally, [QUIC-VN] describes two mechanisms endpoints can use to negotiate which QUIC version to select. The "incompatible" version negotiation method can support switching from any QUIC version to any other version with full generality, at the cost of an additional round trip at the start of the connection. "Compatible" version negotiation eliminates the round-trip penalty but levies some restrictions on how much the two versions can differ semantically.¶
QUIC version 2 is meant to mitigate ossification concerns and exercise the version negotiation mechanisms. The changes provide an example of the minimum set of changes necessary to specify a new QUIC version. However, note that the choice of the version number on the wire is randomly chosen instead of "2", and the two bits that identify each Long Header packet type are different from version 1; both of these properties are meant to combat ossification and are not strictly required of a new QUIC version.¶
Any endpoint that supports two versions needs to implement version negotiation to protect against downgrade attacks.¶
2. Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
3. Differences with QUIC Version 1
Except for a few differences, QUIC version 2 endpoints MUST implement the QUIC version 1 specification as described in [QUIC], [QUIC-TLS], and [QUIC-RECOVERY]. The remainder of this section lists the differences.¶
3.1. Version Field
The Version field of long headers is 0x6b3343cf. This was generated by taking the first four bytes of the sha256sum of "QUICv2 version number".¶
3.2. Long Header Packet Types
All version 2 Long Header packet types are different. The Type field values are:¶
3.3. Cryptography Changes
3.3.1. Initial Salt
The salt used to derive Initial keys in Section 5.2 of [QUIC-TLS] changes to:¶
This is the first 20 bytes of the sha256sum of "QUICv2 salt".¶
3.3.2. HMAC-based Key Derivation Function (HKDF) Labels
The labels used in [QUIC-TLS] to derive packet protection keys (Section 5.1), header protection keys (Section 5.4), Retry Integrity Tag keys (Section 5.8), and key updates (Section 6.1) change from "quic key" to "quicv2 key", from "quic iv" to "quicv2 iv", from "quic hp" to "quicv2 hp", and from "quic ku" to "quicv2 ku" to meet the guidance for new versions in Section 9.6 of that document.¶
3.3.3. Retry Integrity Tag
The key and nonce used for the Retry Integrity Tag (Section 5.8 of [QUIC-TLS]) change to:¶
The secret is the sha256sum of "QUICv2 retry secret". The key and nonce are derived from this secret with the labels "quicv2 key" and "quicv2 iv", respectively.¶
4. Version Negotiation Considerations
QUIC version 2 is not intended to deprecate version 1. Endpoints that support version 2 might continue support for version 1 to maximize compatibility with other endpoints. In particular, HTTP clients often use Alt-Svc [RFC7838] to discover QUIC support. As this mechanism does not currently distinguish between QUIC versions, HTTP servers SHOULD support multiple versions to reduce the probability of incompatibility and the cost associated with QUIC version negotiation or TCP fallback. For example, an origin advertising support for "h3" in Alt-Svc should support QUIC version 1, as it was the original QUIC version used by HTTP/3; therefore, some clients will only support that version.¶
Any QUIC endpoint that supports QUIC version 2 MUST send, process, and validate
the version
Note that version 2 meets the definition in [QUIC-VN] of a compatible version with version 1, and version 1 is compatible with version 2. Therefore, servers can use compatible negotiation to switch a connection between the two versions. Endpoints that support both versions SHOULD support compatible version negotiation to avoid a round trip.¶
4.1. Compatible Negotiation Requirements
Compatible version negotiation between versions 1 and 2 follows the same requirements in either direction. This section uses the terms "original version" and "negotiated version" from [QUIC-VN].¶
If the server sends a Retry packet, it MUST use the original version. The client ignores Retry packets using other versions. The client MUST NOT use a different version in the subsequent Initial packet that contains the Retry token. The server MAY encode the QUIC version in its Retry token to validate that the client did not switch versions, and drop the packet if it switched, to enforce client compliance.¶
QUIC version 2 uses the same transport parameters to authenticate the Retry as QUIC version 1. After switching to a negotiated version after a Retry, the server MUST include the relevant transport parameters to validate that the server sent the Retry and the connection IDs used in the exchange, as described in Section 7.3 of [QUIC].¶
The server cannot send CRYPTO frames until it has processed the client's transport parameters. The server MUST send all CRYPTO frames using the negotiated version.¶
The client learns the negotiated version by observing the first long header Version field that differs from the original version. If the client receives a CRYPTO frame from the server in the original version, it indicates that the negotiated version is equal to the original version.¶
Before the server is able to process transport parameters from the client, it might need to respond to Initial packets from the client. For these packets, the server uses the original version.¶
Once the client has learned the negotiated version, it SHOULD send subsequent Initial packets using that version. The server MUST NOT discard its original version Initial receive keys until it successfully processes a Handshake packet with the negotiated version.¶
Both endpoints MUST send Handshake and 1-RTT packets using the negotiated version. An endpoint MUST drop packets using any other version. Endpoints have no need to generate the keying material that would allow them to decrypt or authenticate such packets.¶
The client MUST NOT send 0-RTT packets using the negotiated version, even after processing a packet of that version from the server. Servers can accept 0-RTT and then process 0-RTT packets from the original version.¶
5. TLS Resumption and NEW_TOKEN Tokens
TLS session tickets and NEW_TOKEN tokens are specific to the QUIC version of the connection that provided them. Clients MUST NOT use a session ticket or token from a QUIC version 1 connection to initiate a QUIC version 2 connection, and vice versa. When a connection includes compatible version negotiation, any issued server tokens are considered to originate from the negotiated version, not the original one.¶
Servers MUST validate the originating version of any session ticket or token and not accept one issued from a different version. A rejected ticket results in falling back to a full TLS handshake, without 0-RTT. A rejected token results in the client address remaining unverified, which limits the amount of data the server can send.¶
After compatible version negotiation, any resulting session ticket maps to the negotiated version rather than the original one.¶
6. Ossification Considerations
QUIC version 2 provides protection against some forms of ossification. Devices
that assume that all long headers will encode version 1, or that the version 1
Initial key derivation formula will remain version
However, many middleboxes, such as firewalls, focus on the first packet in a connection, which will often remain in the version 1 format due to the considerations above.¶
Clients interested in combating middlebox ossification can initiate a connection using version 2 if they are reasonably certain the server supports it and if they are willing to suffer a round-trip penalty if they are incorrect. In particular, a server that issues a session ticket for version 2 indicates an intent to maintain version 2 support while the ticket remains valid, even if support cannot be guaranteed.¶
7. Applicability
QUIC version 2 provides no change from QUIC version 1
for the capabilities available to applications. Therefore, all Application
Unless otherwise stated, all QUIC extensions defined to work with version 1 also work with version 2.¶
8. Security Considerations
QUIC version 2 introduces no changes to the security or privacy properties of QUIC version 1.¶
The mandatory version negotiation mechanism guards against downgrade attacks, but downgrades have no security implications, as the version properties are identical.¶
Support for QUIC version 2 can help an observer to fingerprint both client and server devices.¶
9. IANA Considerations
IANA has added the following entries to the "QUIC Versions"
registry maintained at
<https://
10. References
10.1. Normative References
- [QUIC]
-
Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based Multiplexed and Secure Transport", RFC 9000, DOI 10
.17487 , , <https:///RFC9000 www >..rfc -editor .org /info /rfc9000 - [QUIC-RECOVERY]
-
Iyengar, J., Ed. and I. Swett, Ed., "QUIC Loss Detection and Congestion Control", RFC 9002, DOI 10
.17487 , , <https:///RFC9002 www >..rfc -editor .org /info /rfc9002 - [QUIC-TLS]
-
Thomson, M., Ed. and S. Turner, Ed., "Using TLS to Secure QUIC", RFC 9001, DOI 10
.17487 , , <https:///RFC9001 www >..rfc -editor .org /info /rfc9001 - [QUIC-VN]
-
Schinazi, D. and E. Rescorla, "Compatible Version Negotiation for QUIC", RFC 9368, DOI 10
.17487 , , <https:///RFC9368 www >..rfc -editor .org /info /rfc9368 - [RFC2119]
-
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10
.17487 , , <https:///RFC2119 www >..rfc -editor .org /info /rfc2119 - [RFC8174]
-
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10
.17487 , , <https:///RFC8174 www >..rfc -editor .org /info /rfc8174
10.2. Informative References
- [HTTP/3]
-
Bishop, M., Ed., "HTTP/3", RFC 9114, DOI 10
.17487 , , <https:///RFC9114 www >..rfc -editor .org /info /rfc9114 - [QUIC
-INVARIANTS] -
Thomson, M., "Version
-Independent Properties of QUIC" , RFC 8999, DOI 10.17487 , , <https:///RFC8999 www >..rfc -editor .org /info /rfc8999 - [RFC7301]
-
Friedl, S., Popov, A., Langley, A., and E. Stephan, "Transport Layer Security (TLS) Application
-Layer Protocol Negotiation Extension" , RFC 7301, DOI 10.17487 , , <https:///RFC7301 www >..rfc -editor .org /info /rfc7301 - [RFC7838]
-
Nottingham, M., McManus, P., and J. Reschke, "HTTP Alternative Services", RFC 7838, DOI 10
.17487 , , <https:///RFC7838 www >..rfc -editor .org /info /rfc7838 - [RFC9250]
-
Huitema, C., Dickinson, S., and A. Mankin, "DNS over Dedicated QUIC Connections", RFC 9250, DOI 10
.17487 , , <https:///RFC9250 www >..rfc -editor .org /info /rfc9250
Appendix A. Sample Packet Protection
This section shows examples of packet protection so that implementations can be
verified incrementally. Samples of Initial packets from both the client and server
plus a Retry packet are defined. These packets use an 8-byte client-chosen
Destination Connection ID of 0x8394c8f03e515
A.1. Keys
The labels generated during the execution of the HKDF
client in: 00200f746c73313
server in: 00200f746c73313
quicv2 key: 001010746c73313
quicv2 iv: 000c0f746c73313
quicv2 hp: 00100f746c73313
The initial secret is common:¶
The secrets for protecting client packets are:¶
The secrets for protecting server packets are:¶
A.2. Client Initial
The client sends an Initial packet. The unprotected payload of this packet contains the following CRYPTO frame, plus enough PADDING frames to make a 1162-byte payload:¶
The unprotected header indicates a length of 1182 bytes: the 4-byte packet number, 1162 bytes of frames, and the 16-byte authentication tag. The header includes the connection ID and a packet number of 2:¶
Protecting the payload produces an output that is sampled for header protection. Because the header uses a 4-byte packet number encoding, the first 16 bytes of the protected payload is sampled and then applied to the header as follows:¶
The resulting protected packet is:¶
A.3. Server Initial
The server sends the following payload in response, including an ACK frame, a CRYPTO frame, and no PADDING frames:¶
The header from the server includes a new connection ID and a 2-byte packet number encoding for a packet number of 1:¶
As a result, after protection, the header protection sample is taken, starting from the third protected byte:¶
The final protected packet is then:¶
A.4. Retry
This shows a Retry packet that might be sent in response to the Initial packet
in Appendix A.2. The integrity check includes the client-chosen
connection ID value of 0x8394c8f03e515
A.5. ChaCha20-Poly1305 Short Header Packet
This example shows some of the steps required to protect a packet with
a short header. It uses AEAD
In this example, TLS produces an application write secret from which a server
uses HKDF
The following shows the steps involved in protecting a minimal packet with an empty Destination Connection ID. This packet contains a single PING frame (that is, a payload of just 0x01) and has a packet number of 654360564. In this example, using a packet number of length 3 (that is, 49140 is encoded) avoids having to pad the payload of the packet; PADDING frames would be needed if the packet number is encoded on fewer bytes.¶
The resulting ciphertext is the minimum size possible. One byte is skipped to produce the sample for header protection.¶
The protected packet is the smallest possible packet size of 21 bytes.¶
Acknowledgments
The author would like to thank Christian Huitema, Lucas Pardue, Kyle Rose, Anthony Rossi, Zahed Sarker, David Schinazi, Tatsuhiro Tsujikawa, and Martin Thomson for their helpful suggestions.¶