<?xml version='1.0' encoding='utf-8'?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" category="std" consensus="true" docName="draft-ietf-quic-v2-10" indexInclude="true" ipr="trust200902" number="9369" prepTime="2023-05-31T10:25:35" scripts="Common,Latin" sortRefs="true" submissionType="IETF" symRefs="true" tocDepth="3" tocInclude="true" xml:lang="en">
  <link href="https://datatracker.ietf.org/doc/draft-ietf-quic-v2-10" rel="prev"/>
  <link href="https://dx.doi.org/10.17487/rfc9369" rel="alternate"/>
  <link href="urn:issn:2070-1721" rel="alternate"/>
  <front>
    <title abbrev="QUICv2">QUIC Version 2</title>
    <seriesInfo name="RFC" value="9369" stream="IETF"/>
    <author initials="M." surname="Duke" fullname="Martin Duke">
      <organization showOnFrontPage="true">Google LLC</organization>
      <address>
        <email>martin.h.duke@gmail.com</email>
      </address>
    </author>
    <date month="05" year="2023"/>
    <area>Transport</area>
    <workgroup>QUIC</workgroup>
    <abstract pn="section-abstract">
      <t indent="0" pn="section-abstract-1">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.</t>
      <t indent="0" pn="section-abstract-2"> 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.</t>
    </abstract>
    <boilerplate>
      <section anchor="status-of-memo" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.1">
        <name slugifiedName="name-status-of-this-memo">Status of This Memo</name>
        <t indent="0" pn="section-boilerplate.1-1">
            This is an Internet Standards Track document.
        </t>
        <t indent="0" pn="section-boilerplate.1-2">
            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.
        </t>
        <t indent="0" pn="section-boilerplate.1-3">
            Information about the current status of this document, any
            errata, and how to provide feedback on it may be obtained at
            <eref target="https://www.rfc-editor.org/info/rfc9369" brackets="none"/>.
        </t>
      </section>
      <section anchor="copyright" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.2">
        <name slugifiedName="name-copyright-notice">Copyright Notice</name>
        <t indent="0" pn="section-boilerplate.2-1">
            Copyright (c) 2023 IETF Trust and the persons identified as the
            document authors. All rights reserved.
        </t>
        <t indent="0" pn="section-boilerplate.2-2">
            This document is subject to BCP 78 and the IETF Trust's Legal
            Provisions Relating to IETF Documents
            (<eref target="https://trustee.ietf.org/license-info" brackets="none"/>) in effect on the date of
            publication of this document. Please review these documents
            carefully, as they describe your rights and restrictions with
            respect to this document. Code Components extracted from this
            document must include Revised BSD License text as described in
            Section 4.e of the Trust Legal Provisions and are provided without
            warranty as described in the Revised BSD License.
        </t>
      </section>
    </boilerplate>
    <toc>
      <section anchor="toc" numbered="false" removeInRFC="false" toc="exclude" pn="section-toc.1">
        <name slugifiedName="name-table-of-contents">Table of Contents</name>
        <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1">
          <li pn="section-toc.1-1.1">
            <t indent="0" keepWithNext="true" pn="section-toc.1-1.1.1"><xref derivedContent="1" format="counter" sectionFormat="of" target="section-1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-introduction">Introduction</xref></t>
          </li>
          <li pn="section-toc.1-1.2">
            <t indent="0" keepWithNext="true" pn="section-toc.1-1.2.1"><xref derivedContent="2" format="counter" sectionFormat="of" target="section-2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-conventions">Conventions</xref></t>
          </li>
          <li pn="section-toc.1-1.3">
            <t indent="0" pn="section-toc.1-1.3.1"><xref derivedContent="3" format="counter" sectionFormat="of" target="section-3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-differences-with-quic-versi">Differences with QUIC Version 1</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.3.2">
              <li pn="section-toc.1-1.3.2.1">
                <t indent="0" keepWithNext="true" pn="section-toc.1-1.3.2.1.1"><xref derivedContent="3.1" format="counter" sectionFormat="of" target="section-3.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-version-field">Version Field</xref></t>
              </li>
              <li pn="section-toc.1-1.3.2.2">
                <t indent="0" pn="section-toc.1-1.3.2.2.1"><xref derivedContent="3.2" format="counter" sectionFormat="of" target="section-3.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-long-header-packet-types">Long Header Packet Types</xref></t>
              </li>
              <li pn="section-toc.1-1.3.2.3">
                <t indent="0" pn="section-toc.1-1.3.2.3.1"><xref derivedContent="3.3" format="counter" sectionFormat="of" target="section-3.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-cryptography-changes">Cryptography Changes</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.3.2.3.2">
                  <li pn="section-toc.1-1.3.2.3.2.1">
                    <t indent="0" pn="section-toc.1-1.3.2.3.2.1.1"><xref derivedContent="3.3.1" format="counter" sectionFormat="of" target="section-3.3.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-initial-salt">Initial Salt</xref></t>
                  </li>
                  <li pn="section-toc.1-1.3.2.3.2.2">
                    <t indent="0" pn="section-toc.1-1.3.2.3.2.2.1"><xref derivedContent="3.3.2" format="counter" sectionFormat="of" target="section-3.3.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-hmac-based-key-derivation-f">HMAC-based Key Derivation Function (HKDF) Labels</xref></t>
                  </li>
                  <li pn="section-toc.1-1.3.2.3.2.3">
                    <t indent="0" pn="section-toc.1-1.3.2.3.2.3.1"><xref derivedContent="3.3.3" format="counter" sectionFormat="of" target="section-3.3.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-retry-integrity-tag">Retry Integrity Tag</xref></t>
                  </li>
                </ul>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.4">
            <t indent="0" pn="section-toc.1-1.4.1"><xref derivedContent="4" format="counter" sectionFormat="of" target="section-4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-version-negotiation-conside">Version Negotiation Considerations</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.4.2">
              <li pn="section-toc.1-1.4.2.1">
                <t indent="0" pn="section-toc.1-1.4.2.1.1"><xref derivedContent="4.1" format="counter" sectionFormat="of" target="section-4.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-compatible-negotiation-requ">Compatible Negotiation Requirements</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.5">
            <t indent="0" pn="section-toc.1-1.5.1"><xref derivedContent="5" format="counter" sectionFormat="of" target="section-5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-tls-resumption-and-new_toke">TLS Resumption and NEW_TOKEN Tokens</xref></t>
          </li>
          <li pn="section-toc.1-1.6">
            <t indent="0" pn="section-toc.1-1.6.1"><xref derivedContent="6" format="counter" sectionFormat="of" target="section-6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-ossification-considerations">Ossification Considerations</xref></t>
          </li>
          <li pn="section-toc.1-1.7">
            <t indent="0" pn="section-toc.1-1.7.1"><xref derivedContent="7" format="counter" sectionFormat="of" target="section-7"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-applicability">Applicability</xref></t>
          </li>
          <li pn="section-toc.1-1.8">
            <t indent="0" pn="section-toc.1-1.8.1"><xref derivedContent="8" format="counter" sectionFormat="of" target="section-8"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-security-considerations">Security Considerations</xref></t>
          </li>
          <li pn="section-toc.1-1.9">
            <t indent="0" pn="section-toc.1-1.9.1"><xref derivedContent="9" format="counter" sectionFormat="of" target="section-9"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-iana-considerations">IANA Considerations</xref></t>
          </li>
          <li pn="section-toc.1-1.10">
            <t indent="0" pn="section-toc.1-1.10.1"><xref derivedContent="10" format="counter" sectionFormat="of" target="section-10"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-references">References</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.10.2">
              <li pn="section-toc.1-1.10.2.1">
                <t indent="0" pn="section-toc.1-1.10.2.1.1"><xref derivedContent="10.1" format="counter" sectionFormat="of" target="section-10.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-normative-references">Normative References</xref></t>
              </li>
              <li pn="section-toc.1-1.10.2.2">
                <t indent="0" pn="section-toc.1-1.10.2.2.1"><xref derivedContent="10.2" format="counter" sectionFormat="of" target="section-10.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-informative-references">Informative References</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.11">
            <t indent="0" pn="section-toc.1-1.11.1"><xref derivedContent="Appendix A" format="default" sectionFormat="of" target="section-appendix.a"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-sample-packet-protection">Sample Packet Protection</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.11.2">
              <li pn="section-toc.1-1.11.2.1">
                <t indent="0" pn="section-toc.1-1.11.2.1.1"><xref derivedContent="A.1" format="counter" sectionFormat="of" target="section-appendix.a.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-keys">Keys</xref></t>
              </li>
              <li pn="section-toc.1-1.11.2.2">
                <t indent="0" pn="section-toc.1-1.11.2.2.1"><xref derivedContent="A.2" format="counter" sectionFormat="of" target="section-appendix.a.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-client-initial">Client Initial</xref></t>
              </li>
              <li pn="section-toc.1-1.11.2.3">
                <t indent="0" pn="section-toc.1-1.11.2.3.1"><xref derivedContent="A.3" format="counter" sectionFormat="of" target="section-appendix.a.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-server-initial">Server Initial</xref></t>
              </li>
              <li pn="section-toc.1-1.11.2.4">
                <t indent="0" pn="section-toc.1-1.11.2.4.1"><xref derivedContent="A.4" format="counter" sectionFormat="of" target="section-appendix.a.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-retry">Retry</xref></t>
              </li>
              <li pn="section-toc.1-1.11.2.5">
                <t indent="0" pn="section-toc.1-1.11.2.5.1"><xref derivedContent="A.5" format="counter" sectionFormat="of" target="section-appendix.a.5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-chacha20-poly1305-short-hea">ChaCha20-Poly1305 Short Header Packet</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.12">
            <t indent="0" pn="section-toc.1-1.12.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.b"/><xref derivedContent="" format="title" sectionFormat="of" target="name-acknowledgments">Acknowledgments</xref></t>
          </li>
          <li pn="section-toc.1-1.13">
            <t indent="0" pn="section-toc.1-1.13.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.c"/><xref derivedContent="" format="title" sectionFormat="of" target="name-authors-address">Author's Address</xref></t>
          </li>
        </ul>
      </section>
    </toc>
  </front>
  <middle>
    <section anchor="introduction" numbered="true" removeInRFC="false" toc="include" pn="section-1">
      <name slugifiedName="name-introduction">Introduction</name>
      <t indent="0" pn="section-1-1">QUIC version 1 <xref target="RFC9000" format="default" sectionFormat="of" derivedContent="QUIC"/> has numerous extension points, including the version
number that occupies the second through fifth bytes of every long header (see
<xref target="RFC8999" format="default" sectionFormat="of" derivedContent="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.</t>
      <t indent="0" pn="section-1-2">In QUIC version 1, Initial packets are encrypted with the version-specific salt,
as described in <xref section="5.2" sectionFormat="of" target="RFC9001" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9001#section-5.2" derivedContent="QUIC-TLS"/>. Protecting Initial packets in this
way allows observers to inspect their contents, which includes the TLS Client
Hello or Server Hello messages. Again, there is the potential for middleboxes to
      ossify on the version 1 key derivation and packet formats.</t>
      <t indent="0" pn="section-1-3">Finally, <xref target="RFC9368" format="default" sectionFormat="of" derivedContent="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.</t>
      <t indent="0" pn="section-1-4">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.</t>
      <t indent="0" pn="section-1-5">Any endpoint that supports two versions needs to implement version negotiation
to protect against downgrade attacks.</t>
    </section>
    <section anchor="conventions" numbered="true" removeInRFC="false" toc="include" pn="section-2">
      <name slugifiedName="name-conventions">Conventions</name>
      <t indent="0" pn="section-2-1">
    The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
    described in BCP 14 <xref target="RFC2119" format="default" sectionFormat="of" derivedContent="RFC2119"/> <xref target="RFC8174" format="default" sectionFormat="of" derivedContent="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
      </t>
    </section>
    <section anchor="differences-with-quic-version-1" numbered="true" removeInRFC="false" toc="include" pn="section-3">
      <name slugifiedName="name-differences-with-quic-versi">Differences with QUIC Version 1</name>
      <t indent="0" pn="section-3-1">Except for a few differences, QUIC version 2 endpoints <bcp14>MUST</bcp14> implement the QUIC
version 1 specification as described in <xref target="RFC9000" format="default" sectionFormat="of" derivedContent="QUIC"/>, <xref target="RFC9001" format="default" sectionFormat="of" derivedContent="QUIC-TLS"/>, and
<xref target="RFC9002" format="default" sectionFormat="of" derivedContent="QUIC-RECOVERY"/>. The remainder of this section lists the differences.</t>
      <section anchor="version-field" numbered="true" removeInRFC="false" toc="include" pn="section-3.1">
        <name slugifiedName="name-version-field">Version Field</name>
        <t indent="0" pn="section-3.1-1">The Version field of long headers is 0x6b3343cf. This was generated by taking
the first four bytes of the sha256sum of "QUICv2 version number".</t>
      </section>
      <section anchor="long-header-packet-types" numbered="true" removeInRFC="false" toc="include" pn="section-3.2">
        <name slugifiedName="name-long-header-packet-types">Long Header Packet Types</name>
        <t indent="0" pn="section-3.2-1">All version 2 Long Header packet types are different. The Type field values are:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-3.2-2">
          <li pn="section-3.2-2.1">Initial: 0b01</li>
          <li pn="section-3.2-2.2">0-RTT: 0b10</li>
          <li pn="section-3.2-2.3">Handshake: 0b11</li>
          <li pn="section-3.2-2.4">Retry: 0b00</li>
        </ul>
      </section>
      <section anchor="cryptography-changes" numbered="true" removeInRFC="false" toc="include" pn="section-3.3">
        <name slugifiedName="name-cryptography-changes">Cryptography Changes</name>
        <section anchor="initial-salt" numbered="true" removeInRFC="false" toc="include" pn="section-3.3.1">
          <name slugifiedName="name-initial-salt">Initial Salt</name>
          <t indent="0" pn="section-3.3.1-1">The salt used to derive Initial keys in <xref section="5.2" sectionFormat="of" target="RFC9001" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9001#section-5.2" derivedContent="QUIC-TLS"/> changes to:</t>
          <artwork align="left" pn="section-3.3.1-2">
initial_salt = 0x0dede3def700a6db819381be6e269dcbf9bd2ed9
</artwork>
          <t indent="0" pn="section-3.3.1-3">This is the first 20 bytes of the sha256sum of "QUICv2 salt".</t>
        </section>
        <section anchor="hkdf-labels" numbered="true" removeInRFC="false" toc="include" pn="section-3.3.2">
          <name slugifiedName="name-hmac-based-key-derivation-f">HMAC-based Key Derivation Function (HKDF) Labels</name>
          <t indent="0" pn="section-3.3.2-1">The labels used in <xref target="RFC9001" format="default" sectionFormat="of" derivedContent="QUIC-TLS"/> to derive packet protection keys (Section
<xref section="5.1" sectionFormat="bare" target="RFC9001" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9001#section-5.1" derivedContent="QUIC-TLS"/>), header protection keys
(Section <xref section="5.4" sectionFormat="bare" target="RFC9001" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9001#section-5.4" derivedContent="QUIC-TLS"/>), Retry Integrity
Tag keys (Section <xref section="5.8" sectionFormat="bare" target="RFC9001" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9001#section-5.8" derivedContent="QUIC-TLS"/>), and key
updates (Section <xref section="6.1" sectionFormat="bare" target="RFC9001" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9001#section-6.1" derivedContent="QUIC-TLS"/>) 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 <xref section="9.6" sectionFormat="bare" target="RFC9001" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9001#section-9.6" derivedContent="QUIC-TLS"/> of that
document.</t>
        </section>
        <section anchor="retry-integrity-tag" numbered="true" removeInRFC="false" toc="include" pn="section-3.3.3">
          <name slugifiedName="name-retry-integrity-tag">Retry Integrity Tag</name>
          <t indent="0" pn="section-3.3.3-1">The key and nonce used for the Retry Integrity Tag (<xref section="5.8" sectionFormat="of" target="RFC9001" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9001#section-5.8" derivedContent="QUIC-TLS"/>)
change to:</t>
          <artwork align="left" pn="section-3.3.3-2">
secret =
  0xc4dd2484d681aefa4ff4d69c2c20299984a765a5d3c31982f38fc74162155e9f
key = 0x8fb4b01b56ac48e260fbcbcead7ccc92
nonce = 0xd86969bc2d7c6d9990efb04a
</artwork>
          <t indent="0" pn="section-3.3.3-3">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.</t>
        </section>
      </section>
    </section>
    <section anchor="version-negotiation-considerations" numbered="true" removeInRFC="false" toc="include" pn="section-4">
      <name slugifiedName="name-version-negotiation-conside">Version Negotiation Considerations</name>
      <t indent="0" pn="section-4-1">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 <xref target="RFC7838" format="default" sectionFormat="of" derivedContent="RFC7838"/> to
discover QUIC support. As this mechanism does not currently distinguish between
QUIC versions, HTTP servers <bcp14>SHOULD</bcp14> 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.</t>
      <t indent="0" pn="section-4-2">Any QUIC endpoint that supports QUIC version 2 <bcp14>MUST</bcp14> send, process, and validate
the version_information transport parameter specified in <xref target="RFC9368" format="default" sectionFormat="of" derivedContent="QUIC-VN"/> to prevent
version downgrade attacks.</t>
      <t indent="0" pn="section-4-3">Note that version 2 meets the definition in <xref target="RFC9368" format="default" sectionFormat="of" derivedContent="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 <bcp14>SHOULD</bcp14> support compatible version
negotiation to avoid a round trip.</t>
      <section anchor="compatible-negotiation-requirements" numbered="true" removeInRFC="false" toc="include" pn="section-4.1">
        <name slugifiedName="name-compatible-negotiation-requ">Compatible Negotiation Requirements</name>
        <t indent="0" pn="section-4.1-1">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 <xref target="RFC9368" format="default" sectionFormat="of" derivedContent="QUIC-VN"/>.</t>
        <t indent="0" pn="section-4.1-2">If the server sends a Retry packet, it <bcp14>MUST</bcp14> use the original version. The
client ignores Retry packets using other versions. The client <bcp14>MUST NOT</bcp14> use a
different version in the subsequent Initial packet that contains the Retry
token. The server <bcp14>MAY</bcp14> 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.</t>
        <t indent="0" pn="section-4.1-3">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 <bcp14>MUST</bcp14> include the relevant transport parameters to validate that the
server sent the Retry and the connection IDs used in the exchange, as described
in <xref section="7.3" sectionFormat="of" target="RFC9000" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9000#section-7.3" derivedContent="QUIC"/>.</t>
        <t indent="0" pn="section-4.1-4">The server cannot send CRYPTO frames until it has processed the client's
transport parameters. The server <bcp14>MUST</bcp14> send all CRYPTO frames using
the negotiated version.</t>
        <t indent="0" pn="section-4.1-5">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.</t>
        <t indent="0" pn="section-4.1-6">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.</t>
        <t indent="0" pn="section-4.1-7">Once the client has learned the negotiated version, it <bcp14>SHOULD</bcp14> send subsequent
Initial packets using that version. The server <bcp14>MUST NOT</bcp14> discard its original
version Initial receive keys until it successfully processes a Handshake
packet with the negotiated version.</t>
        <t indent="0" pn="section-4.1-8">Both endpoints <bcp14>MUST</bcp14> send Handshake and 1-RTT packets using the negotiated
version. An endpoint <bcp14>MUST</bcp14> 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.</t>
        <t indent="0" pn="section-4.1-9">The client <bcp14>MUST NOT</bcp14> 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.</t>
      </section>
    </section>
    <section anchor="tls-resumption-and-newtoken-tokens" numbered="true" removeInRFC="false" toc="include" pn="section-5">
      <name slugifiedName="name-tls-resumption-and-new_toke">TLS Resumption and NEW_TOKEN Tokens</name>
      <t indent="0" pn="section-5-1">TLS session tickets and NEW_TOKEN tokens are specific to the QUIC version of the connection that provided them. Clients <bcp14>MUST NOT</bcp14> 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.</t>
      <t indent="0" pn="section-5-2">Servers <bcp14>MUST</bcp14> 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.</t>
      <t indent="0" pn="section-5-3">After compatible version negotiation, any resulting session ticket
maps to the negotiated version rather than the original one.</t>
    </section>
    <section anchor="ossification-considerations" numbered="true" removeInRFC="false" toc="include" pn="section-6">
      <name slugifiedName="name-ossification-considerations">Ossification Considerations</name>
      <t indent="0" pn="section-6-1">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-invariant, will not correctly
process version 2 packets.</t>
      <t indent="0" pn="section-6-2">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.</t>
      <t indent="0" pn="section-6-3">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.</t>
    </section>
    <section anchor="applicability" numbered="true" removeInRFC="false" toc="include" pn="section-7">
      <name slugifiedName="name-applicability">Applicability</name>
      <t indent="0" pn="section-7-1"> QUIC version 2 provides no change from QUIC version 1
 for the capabilities available to applications. Therefore, all Application-Layer
Protocol Negotiation (ALPN) <xref target="RFC7301" format="default" sectionFormat="of" derivedContent="RFC7301"/> codepoints specified to operate over
QUIC version 1 can also operate over this version of QUIC. In particular, both
the "h3" <xref target="RFC9114" format="default" sectionFormat="of" derivedContent="HTTP/3"/> and "doq" <xref target="RFC9250" format="default" sectionFormat="of" derivedContent="RFC9250"/> ALPNs can operate over
QUIC version 2.</t>
      <t indent="0" pn="section-7-2">Unless otherwise stated, all QUIC extensions defined to work with version 1 also
work with version 2.</t>
    </section>
    <section anchor="security-considerations" numbered="true" removeInRFC="false" toc="include" pn="section-8">
      <name slugifiedName="name-security-considerations">Security Considerations</name>
      <t indent="0" pn="section-8-1">QUIC version 2 introduces no changes to the security or privacy properties of
QUIC version 1.</t>
      <t indent="0" pn="section-8-2">The mandatory version negotiation mechanism guards against downgrade attacks,
but downgrades have no security implications, as the version properties are
identical.</t>
      <t indent="0" pn="section-8-3">Support for QUIC version 2 can help an observer to fingerprint both client and
server devices.</t>
    </section>
    <section anchor="iana-considerations" numbered="true" removeInRFC="false" toc="include" pn="section-9">
      <name slugifiedName="name-iana-considerations">IANA Considerations</name>
      <t indent="0" pn="section-9-1">IANA has added the following entries to the "QUIC Versions"
registry maintained at
<eref target="https://www.iana.org/assignments/quic" brackets="angle"/>.</t>
      <dl spacing="compact" indent="3" newline="false" pn="section-9-2">
        <dt pn="section-9-2.1">Value:</dt>
        <dd pn="section-9-2.2">0x6b3343cf</dd>
        <dt pn="section-9-2.3">Status:</dt>
        <dd pn="section-9-2.4">permanent</dd>
        <dt pn="section-9-2.5">Specification:</dt>
        <dd pn="section-9-2.6">RFC 9369</dd>
        <dt pn="section-9-2.7">Change Controller:</dt>
        <dd pn="section-9-2.8">IETF</dd>
        <dt pn="section-9-2.9">Contact:</dt>
        <dd pn="section-9-2.10">QUIC WG</dd>
      </dl>
      <dl spacing="compact" indent="3" newline="false" pn="section-9-3">
        <dt pn="section-9-3.1">Value:</dt>
        <dd pn="section-9-3.2">0x709a50c4</dd>
        <dt pn="section-9-3.3">Status:</dt>
        <dd pn="section-9-3.4">provisional</dd>
        <dt pn="section-9-3.5">Specification:</dt>
        <dd pn="section-9-3.6">RFC 9369</dd>
        <dt pn="section-9-3.7">Change Controller:</dt>
        <dd pn="section-9-3.8">IETF</dd>
        <dt pn="section-9-3.9">Contact:</dt>
        <dd pn="section-9-3.10">QUIC WG</dd>
        <dt pn="section-9-3.11">Notes:</dt>
        <dd pn="section-9-3.12">QUIC v2 draft codepoint</dd>
      </dl>
    </section>
  </middle>
  <back>
    <displayreference target="RFC9000" to="QUIC"/>
    <displayreference target="RFC9001" to="QUIC-TLS"/>
    <displayreference target="RFC9368" to="QUIC-VN"/>
    <displayreference target="RFC9002" to="QUIC-RECOVERY"/>
    <displayreference target="RFC9114" to="HTTP/3"/>
    <displayreference target="RFC8999" to="QUIC-INVARIANTS"/>
    <references pn="section-10">
      <name slugifiedName="name-references">References</name>
      <references pn="section-10.1">
        <name slugifiedName="name-normative-references">Normative References</name>
        <reference anchor="RFC9000" target="https://www.rfc-editor.org/info/rfc9000" quoteTitle="true" derivedAnchor="QUIC">
          <front>
            <title>QUIC: A UDP-Based Multiplexed and Secure Transport</title>
            <author fullname="J. Iyengar" initials="J." role="editor" surname="Iyengar"/>
            <author fullname="M. Thomson" initials="M." role="editor" surname="Thomson"/>
            <date month="May" year="2021"/>
            <abstract>
              <t indent="0">This document defines the core of the QUIC transport protocol.  QUIC provides applications with flow-controlled streams for structured communication, low-latency connection establishment, and network path migration.  QUIC includes security measures that ensure confidentiality, integrity, and availability in a range of deployment circumstances.  Accompanying documents describe the integration of TLS for key negotiation, loss detection, and an exemplary congestion control algorithm.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9000"/>
          <seriesInfo name="DOI" value="10.17487/RFC9000"/>
        </reference>
        <reference anchor="RFC9002" target="https://www.rfc-editor.org/info/rfc9002" quoteTitle="true" derivedAnchor="QUIC-RECOVERY">
          <front>
            <title>QUIC Loss Detection and Congestion Control</title>
            <author fullname="J. Iyengar" initials="J." role="editor" surname="Iyengar"/>
            <author fullname="I. Swett" initials="I." role="editor" surname="Swett"/>
            <date month="May" year="2021"/>
            <abstract>
              <t indent="0">This document describes loss detection and congestion control mechanisms for QUIC.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9002"/>
          <seriesInfo name="DOI" value="10.17487/RFC9002"/>
        </reference>
        <reference anchor="RFC9001" target="https://www.rfc-editor.org/info/rfc9001" quoteTitle="true" derivedAnchor="QUIC-TLS">
          <front>
            <title>Using TLS to Secure QUIC</title>
            <author fullname="M. Thomson" initials="M." role="editor" surname="Thomson"/>
            <author fullname="S. Turner" initials="S." role="editor" surname="Turner"/>
            <date month="May" year="2021"/>
            <abstract>
              <t indent="0">This document describes how Transport Layer Security (TLS) is used to secure QUIC.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9001"/>
          <seriesInfo name="DOI" value="10.17487/RFC9001"/>
        </reference>
        <reference anchor="RFC9368" target="https://www.rfc-editor.org/info/rfc9368" quoteTitle="true" derivedAnchor="QUIC-VN">
          <front>
            <title>Compatible Version Negotiation for QUIC</title>
            <author initials="D." surname="Schinazi" fullname="David Schinazi">
              <organization showOnFrontPage="true">Google LLC</organization>
            </author>
            <author initials="E." surname="Rescorla" fullname="Eric Rescorla">
              <organization showOnFrontPage="true">Mozilla</organization>
            </author>
            <date month="May" year="2023"/>
          </front>
          <seriesInfo name="RFC" value="9368"/>
          <seriesInfo name="DOI" value="10.17487/RFC9368"/>
        </reference>
        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119" quoteTitle="true" derivedAnchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
            <abstract>
              <t indent="0">In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized.  This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174" quoteTitle="true" derivedAnchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
            <abstract>
              <t indent="0">RFC 2119 specifies common key words that may be used in protocol specifications.  This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
      </references>
      <references pn="section-10.2">
        <name slugifiedName="name-informative-references">Informative References</name>
        <reference anchor="RFC9114" target="https://www.rfc-editor.org/info/rfc9114" quoteTitle="true" derivedAnchor="HTTP/3">
          <front>
            <title>HTTP/3</title>
            <author fullname="M. Bishop" initials="M." role="editor" surname="Bishop"/>
            <date month="June" year="2022"/>
            <abstract>
              <t indent="0">The QUIC transport protocol has several features that are desirable in a transport for HTTP, such as stream multiplexing, per-stream flow control, and low-latency connection establishment.  This document describes a mapping of HTTP semantics over QUIC.  This document also identifies HTTP/2 features that are subsumed by QUIC and describes how HTTP/2 extensions can be ported to HTTP/3.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9114"/>
          <seriesInfo name="DOI" value="10.17487/RFC9114"/>
        </reference>
        <reference anchor="RFC8999" target="https://www.rfc-editor.org/info/rfc8999" quoteTitle="true" derivedAnchor="QUIC-INVARIANTS">
          <front>
            <title>Version-Independent Properties of QUIC</title>
            <author fullname="M. Thomson" initials="M." surname="Thomson"/>
            <date month="May" year="2021"/>
            <abstract>
              <t indent="0">This document defines the properties of the QUIC transport protocol that are common to all versions of the protocol.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8999"/>
          <seriesInfo name="DOI" value="10.17487/RFC8999"/>
        </reference>
        <reference anchor="RFC7301" target="https://www.rfc-editor.org/info/rfc7301" quoteTitle="true" derivedAnchor="RFC7301">
          <front>
            <title>Transport Layer Security (TLS) Application-Layer Protocol Negotiation Extension</title>
            <author fullname="S. Friedl" initials="S." surname="Friedl"/>
            <author fullname="A. Popov" initials="A." surname="Popov"/>
            <author fullname="A. Langley" initials="A." surname="Langley"/>
            <author fullname="E. Stephan" initials="E." surname="Stephan"/>
            <date month="July" year="2014"/>
            <abstract>
              <t indent="0">This document describes a Transport Layer Security (TLS) extension for application-layer protocol negotiation within the TLS handshake.  For instances in which multiple application protocols are supported on the same TCP or UDP port, this extension allows the application layer to negotiate which protocol will be used within the TLS connection.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7301"/>
          <seriesInfo name="DOI" value="10.17487/RFC7301"/>
        </reference>
        <reference anchor="RFC7838" target="https://www.rfc-editor.org/info/rfc7838" quoteTitle="true" derivedAnchor="RFC7838">
          <front>
            <title>HTTP Alternative Services</title>
            <author fullname="M. Nottingham" initials="M." surname="Nottingham"/>
            <author fullname="P. McManus" initials="P." surname="McManus"/>
            <author fullname="J. Reschke" initials="J." surname="Reschke"/>
            <date month="April" year="2016"/>
            <abstract>
              <t indent="0">This document specifies "Alternative Services" for HTTP, which allow an origin's resources to be authoritatively available at a separate network location, possibly accessed with a different protocol configuration.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7838"/>
          <seriesInfo name="DOI" value="10.17487/RFC7838"/>
        </reference>
        <reference anchor="RFC9250" target="https://www.rfc-editor.org/info/rfc9250" quoteTitle="true" derivedAnchor="RFC9250">
          <front>
            <title>DNS over Dedicated QUIC Connections</title>
            <author fullname="C. Huitema" initials="C." surname="Huitema"/>
            <author fullname="S. Dickinson" initials="S." surname="Dickinson"/>
            <author fullname="A. Mankin" initials="A." surname="Mankin"/>
            <date month="May" year="2022"/>
            <abstract>
              <t indent="0">This document describes the use of QUIC to provide transport confidentiality for DNS.  The encryption provided by QUIC has similar properties to those provided by TLS, while QUIC transport eliminates the head-of-line blocking issues inherent with TCP and provides more efficient packet-loss recovery than UDP.  DNS over QUIC (DoQ) has privacy properties similar to DNS over TLS (DoT) specified in RFC 7858, and latency characteristics similar to classic DNS over UDP.  This specification describes the use of DoQ as a general-purpose transport for DNS and includes the use of DoQ for stub to recursive, recursive to authoritative, and zone transfer scenarios.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9250"/>
          <seriesInfo name="DOI" value="10.17487/RFC9250"/>
        </reference>
      </references>
    </references>
    <section anchor="test-vectors" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a">
      <name slugifiedName="name-sample-packet-protection">Sample Packet Protection</name>
      <t indent="0" pn="section-appendix.a-1">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 0x8394c8f03e515708. Some intermediate values are
included. All values are shown in hexadecimal.</t>
      <section anchor="keys" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.1">
        <name slugifiedName="name-keys">Keys</name>
        <t indent="0" pn="section-appendix.a.1-1">The labels generated during the execution of the HKDF-Expand-Label function
(that is, HkdfLabel.label) and part of the value given to the HKDF-Expand
function in order to produce its output are:</t>
        <t indent="0" pn="section-appendix.a.1-2">client in:  00200f746c73313320636c69656e7420696e00</t>
        <t indent="0" pn="section-appendix.a.1-3">server in:  00200f746c7331332073657276657220696e00</t>
        <t indent="0" pn="section-appendix.a.1-4">quicv2 key:  001010746c73313320717569637632206b657900</t>
        <t indent="0" pn="section-appendix.a.1-5">quicv2 iv:  000c0f746c7331332071756963763220697600</t>
        <t indent="0" pn="section-appendix.a.1-6">quicv2 hp:  00100f746c7331332071756963763220687000</t>
        <t indent="0" pn="section-appendix.a.1-7">The initial secret is common:</t>
        <artwork align="left" pn="section-appendix.a.1-8">
initial_secret = HKDF-Extract(initial_salt, cid)
    = 2062e8b3cd8d52092614b8071d0aa1fb
      7c2e3ac193f78b280e72d8f5751f6aba
</artwork>
        <t indent="0" pn="section-appendix.a.1-9">The secrets for protecting client packets are:</t>
        <artwork align="left" pn="section-appendix.a.1-10">
client_initial_secret
    = HKDF-Expand-Label(initial_secret, "client in", "", 32)
    = 14ec9d6eb9fd7af83bf5a668bc17a7e2
      83766aade7ecd0891f70f9ff7f4bf47b

key = HKDF-Expand-Label(client_initial_secret, "quicv2 key", "", 16)
    = 8b1a0bc121284290a29e0971b5cd045d

iv  = HKDF-Expand-Label(client_initial_secret, "quicv2 iv", "", 12)
    = 91f73e2351d8fa91660e909f

hp  = HKDF-Expand-Label(client_initial_secret, "quicv2 hp", "", 16)
    = 45b95e15235d6f45a6b19cbcb0294ba9
</artwork>
        <t indent="0" pn="section-appendix.a.1-11">The secrets for protecting server packets are:</t>
        <artwork align="left" pn="section-appendix.a.1-12">
server_initial_secret
    = HKDF-Expand-Label(initial_secret, "server in", "", 32)
    = 0263db1782731bf4588e7e4d93b74639
      07cb8cd8200b5da55a8bd488eafc37c1

key = HKDF-Expand-Label(server_initial_secret, "quicv2 key", "", 16)
    = 82db637861d55e1d011f19ea71d5d2a7

iv  = HKDF-Expand-Label(server_initial_secret, "quicv2 iv", "", 12)
    = dd13c276499c0249d3310652

hp  = HKDF-Expand-Label(server_initial_secret, "quicv2 hp", "", 16)
    = edf6d05c83121201b436e16877593c3a
</artwork>
      </section>
      <section anchor="sample-client-initial" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.2">
        <name slugifiedName="name-client-initial">Client Initial</name>
        <t indent="0" pn="section-appendix.a.2-1">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:</t>
        <artwork align="left" pn="section-appendix.a.2-2">
060040f1010000ed0303ebf8fa56f129 39b9584a3896472ec40bb863cfd3e868
04fe3a47f06a2b69484c000004130113 02010000c000000010000e00000b6578
616d706c652e636f6dff01000100000a 00080006001d00170018001000070005
04616c706e0005000501000000000033 00260024001d00209370b2c9caa47fba
baf4559fedba753de171fa71f50f1ce1 5d43e994ec74d748002b000302030400
0d0010000e0403050306030203080408 050806002d00020101001c0002400100
3900320408ffffffffffffffff050480 00ffff07048000ffff08011001048000
75300901100f088394c8f03e51570806 048000ffff
</artwork>
        <t indent="0" pn="section-appendix.a.2-3">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:</t>
        <artwork align="left" pn="section-appendix.a.2-4">
d36b3343cf088394c8f03e5157080000449e00000002
</artwork>
        <t indent="0" pn="section-appendix.a.2-5">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:</t>
        <artwork align="left" pn="section-appendix.a.2-6">
sample = ffe67b6abcdb4298b485dd04de806071

mask = AES-ECB(hp, sample)[0..4]
     = 94a0c95e80

header[0] ^= mask[0] &amp; 0x0f
     = d7
header[18..21] ^= mask[1..4]
     = a0c95e82
header = d76b3343cf088394c8f03e5157080000449ea0c95e82
</artwork>
        <t indent="0" pn="section-appendix.a.2-7">The resulting protected packet is:</t>
        <artwork align="left" pn="section-appendix.a.2-8">
d76b3343cf088394c8f03e5157080000 449ea0c95e82ffe67b6abcdb4298b485
dd04de806071bf03dceebfa162e75d6c 96058bdbfb127cdfcbf903388e99ad04
9f9a3dd4425ae4d0992cfff18ecf0fdb 5a842d09747052f17ac2053d21f57c5d
250f2c4f0e0202b70785b7946e992e58 a59ac52dea6774d4f03b55545243cf1a
12834e3f249a78d395e0d18f4d766004 f1a2674802a747eaa901c3f10cda5500
cb9122faa9f1df66c392079a1b40f0de 1c6054196a11cbea40afb6ef5253cd68
18f6625efce3b6def6ba7e4b37a40f77 32e093daa7d52190935b8da58976ff33
12ae50b187c1433c0f028edcc4c2838b 6a9bfc226ca4b4530e7a4ccee1bfa2a3
d396ae5a3fb512384b2fdd851f784a65 e03f2c4fbe11a53c7777c023462239dd
6f7521a3f6c7d5dd3ec9b3f233773d4b 46d23cc375eb198c63301c21801f6520
bcfb7966fc49b393f0061d974a2706df 8c4a9449f11d7f3d2dcbb90c6b877045
636e7c0c0fe4eb0f697545460c806910 d2c355f1d253bc9d2452aaa549e27a1f
ac7cf4ed77f322e8fa894b6a83810a34 b361901751a6f5eb65a0326e07de7c12
16ccce2d0193f958bb3850a833f7ae43 2b65bc5a53975c155aa4bcb4f7b2c4e5
4df16efaf6ddea94e2c50b4cd1dfe060 17e0e9d02900cffe1935e0491d77ffb4
fdf85290fdd893d577b1131a610ef6a5 c32b2ee0293617a37cbb08b847741c3b
8017c25ca9052ca1079d8b78aebd4787 6d330a30f6a8c6d61dd1ab5589329de7
14d19d61370f8149748c72f132f0fc99 f34d766c6938597040d8f9e2bb522ff9
9c63a344d6a2ae8aa8e51b7b90a4a806 105fcbca31506c446151adfeceb51b91
abfe43960977c87471cf9ad4074d30e1 0d6a7f03c63bd5d4317f68ff325ba3bd
80bf4dc8b52a0ba031758022eb025cdd 770b44d6d6cf0670f4e990b22347a7db
848265e3e5eb72dfe8299ad7481a4083 22cac55786e52f633b2fb6b614eaed18
d703dd84045a274ae8bfa73379661388 d6991fe39b0d93debb41700b41f90a15
c4d526250235ddcd6776fc77bc97e7a4 17ebcb31600d01e57f32162a8560cacc
7e27a096d37a1a86952ec71bd89a3e9a 30a2a26162984d7740f81193e8238e61
f6b5b984d4d3dfa033c1bb7e4f0037fe bf406d91c0dccf32acf423cfa1e70710
10d3f270121b493ce85054ef58bada42 310138fe081adb04e2bd901f2f13458b
3d6758158197107c14ebb193230cd115 7380aa79cae1374a7c1e5bbcb80ee23e
06ebfde206bfb0fcbc0edc4ebec30966 1bdd908d532eb0c6adc38b7ca7331dce
8dfce39ab71e7c32d318d136b6100671 a1ae6a6600e3899f31f0eed19e3417d1
34b90c9058f8632c798d4490da498730 7cba922d61c39805d072b589bd52fdf1
e86215c2d54e6670e07383a27bbffb5a ddf47d66aa85a0c6f9f32e59d85a44dd
5d3b22dc2be80919b490437ae4f36a0a e55edf1d0b5cb4e9a3ecabee93dfc6e3
8d209d0fa6536d27a5d6fbb17641cde2 7525d61093f1b28072d111b2b4ae5f89
d5974ee12e5cf7d5da4d6a31123041f3 3e61407e76cffcdcfd7e19ba58cf4b53
6f4c4938ae79324dc402894b44faf8af bab35282ab659d13c93f70412e85cb19
9a37ddec600545473cfb5a05e08d0b20 9973b2172b4d21fb69745a262ccde96b
a18b2faa745b6fe189cf772a9f84cbfc
</artwork>
      </section>
      <section anchor="server-initial" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.3">
        <name slugifiedName="name-server-initial">Server Initial</name>
        <t indent="0" pn="section-appendix.a.3-1">The server sends the following payload in response, including an ACK frame, a
CRYPTO frame, and no PADDING frames:</t>
        <artwork align="left" pn="section-appendix.a.3-2">
02000000000600405a020000560303ee fce7f7b37ba1d1632e96677825ddf739
88cfc79825df566dc5430b9a045a1200 130100002e00330024001d00209d3c94
0d89690b84d08a60993c144eca684d10 81287c834d5311bcf32bb9da1a002b00
020304
</artwork>
        <t indent="0" pn="section-appendix.a.3-3">The header from the server includes a new connection ID and a 2-byte packet
number encoding for a packet number of 1:</t>
        <artwork align="left" pn="section-appendix.a.3-4">
d16b3343cf0008f067a5502a4262b50040750001
</artwork>
        <t indent="0" pn="section-appendix.a.3-5">As a result, after protection, the header protection sample is taken, starting
from the third protected byte:</t>
        <artwork align="left" pn="section-appendix.a.3-6">
sample = 6f05d8a4398c47089698baeea26b91eb
mask   = 4dd92e91ea
header = dc6b3343cf0008f067a5502a4262b5004075d92f
</artwork>
        <t indent="0" pn="section-appendix.a.3-7">The final protected packet is then:</t>
        <artwork align="left" pn="section-appendix.a.3-8">
dc6b3343cf0008f067a5502a4262b500 4075d92faaf16f05d8a4398c47089698
baeea26b91eb761d9b89237bbf872630 17915358230035f7fd3945d88965cf17
f9af6e16886c61bfc703106fbaf3cb4c fa52382dd16a393e42757507698075b2
c984c707f0a0812d8cd5a6881eaf21ce da98f4bd23f6fe1a3e2c43edd9ce7ca8
4bed8521e2e140
</artwork>
      </section>
      <section anchor="retry" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.4">
        <name slugifiedName="name-retry">Retry</name>
        <t indent="0" pn="section-appendix.a.4-1">This shows a Retry packet that might be sent in response to the Initial packet
in <xref target="sample-client-initial" format="default" sectionFormat="of" derivedContent="Appendix A.2"/>. The integrity check includes the client-chosen
connection ID value of 0x8394c8f03e515708, but that value is not
included in the final Retry packet:</t>
        <artwork align="left" pn="section-appendix.a.4-2">
cf6b3343cf0008f067a5502a4262b574 6f6b656ec8646ce8bfe33952d9555436
65dcc7b6
</artwork>
      </section>
      <section anchor="chacha20-poly1305-short-header-packet" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.5">
        <name slugifiedName="name-chacha20-poly1305-short-hea">ChaCha20-Poly1305 Short Header Packet</name>
        <t indent="0" pn="section-appendix.a.5-1">This example shows some of the steps required to protect a packet with
	a short header.  It uses AEAD_CHACHA20_POLY1305.</t>
        <t indent="0" pn="section-appendix.a.5-2">In this example, TLS produces an application write secret from which a server
uses HKDF-Expand-Label to produce four values: a key, an Initialization Vector (IV), a header
protection key, and the secret that will be used after keys are updated (this
last value is not used further in this example).</t>
        <artwork align="left" pn="section-appendix.a.5-3">
secret
    = 9ac312a7f877468ebe69422748ad00a1
      5443f18203a07d6060f688f30f21632b

key = HKDF-Expand-Label(secret, "quicv2 key", "", 32)
    = 3bfcddd72bcf02541d7fa0dd1f5f9eee
      a817e09a6963a0e6c7df0f9a1bab90f2

iv  = HKDF-Expand-Label(secret, "quicv2 iv", "", 12)
    = a6b5bc6ab7dafce30ffff5dd

hp  = HKDF-Expand-Label(secret, "quicv2 hp", "", 32)
    = d659760d2ba434a226fd37b35c69e2da
      8211d10c4f12538787d65645d5d1b8e2

ku  = HKDF-Expand-Label(secret, "quicv2 ku", "", 32)
    = c69374c49e3d2a9466fa689e49d476db
      5d0dfbc87d32ceeaa6343fd0ae4c7d88
</artwork>
        <t indent="0" pn="section-appendix.a.5-4">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.</t>
        <artwork align="left" pn="section-appendix.a.5-5">
pn                 = 654360564 (decimal)
nonce              = a6b5bc6ab7dafce328ff4a29
unprotected header = 4200bff4
payload plaintext  = 01
payload ciphertext = 0ae7b6b932bc27d786f4bc2bb20f2162ba
</artwork>
        <t indent="0" pn="section-appendix.a.5-6">The resulting ciphertext is the minimum size possible. One byte is skipped to
produce the sample for header protection.</t>
        <artwork align="left" pn="section-appendix.a.5-7">
sample = e7b6b932bc27d786f4bc2bb20f2162ba
mask   = 97580e32bf
header = 5558b1c6
</artwork>
        <t indent="0" pn="section-appendix.a.5-8">The protected packet is the smallest possible packet size of 21 bytes.</t>
        <artwork align="left" pn="section-appendix.a.5-9">
packet = 5558b1c60ae7b6b932bc27d786f4bc2bb20f2162ba
</artwork>
      </section>
    </section>
    <section anchor="acknowledgments" numbered="false" toc="include" removeInRFC="false" pn="section-appendix.b">
      <name slugifiedName="name-acknowledgments">Acknowledgments</name>
      <t indent="0" pn="section-appendix.b-1">The author would like to thank <contact fullname="Christian Huitema"/>, <contact fullname="Lucas Pardue"/>, <contact fullname="Kyle Rose"/>,
<contact fullname="Anthony Rossi"/>, <contact fullname="Zahed Sarker"/>, <contact fullname="David Schinazi"/>, <contact fullname="Tatsuhiro Tsujikawa"/>, and <contact fullname="Martin Thomson"/> for their helpful suggestions.</t>
    </section>
    <section anchor="authors-addresses" numbered="false" removeInRFC="false" toc="include" pn="section-appendix.c">
      <name slugifiedName="name-authors-address">Author's Address</name>
      <author initials="M." surname="Duke" fullname="Martin Duke">
        <organization showOnFrontPage="true">Google LLC</organization>
        <address>
          <email>martin.h.duke@gmail.com</email>
        </address>
      </author>
    </section>
  </back>
</rfc>
