<?xml version="1.0" encoding="utf-8"?>
<?xml-model href="rfc7991bis.rnc"?>
<!DOCTYPE rfc [
        <!ENTITY nbsp    "&#160;">
        <!ENTITY zwsp   "&#8203;">
        <!ENTITY nbhy   "&#8209;">
        <!ENTITY wj     "&#8288;">
]>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude"
     ipr="trust200902" submissionType="IETF" category="std" version="3" docName="draft-misell-quic-bdp-token-01">
    <front>
        <title abbrev="QUIC BDP Tokens">QUIC Bandwidth Delay Product Tokens</title>
        <seriesInfo name="Internet-Draft" status="standard" value="draft-misell-quic-bdp-token-01"/>
        <author fullname="Q Misell" initials="Q" surname="Misell">
            <organization abbrev="AS207960">AS207960 Cyfyngedig</organization>
            <address>
                <postal>
                    <street>13 Pen-y-lan Terrace</street>
                    <city>Caerdydd</city>
                    <code>CF23 9EU</code>
                    <country>United Kingdom</country>
                </postal>
                <email>q@as207970.net</email>
                <email>q@magicalcodewit.ch</email>
                <uri>https://magicalcodewit.ch</uri>
            </address>
        </author>
        <area>tsv</area>
        <workgroup>QUIC</workgroup>
        <abstract>
            <t>This document describes a method to store previously calculated Congestion Control parameters on a QUIC
                client to allow additional capacity on high Bandwidth Delay Product paths to be used with Careful Resume.</t>
        </abstract>

        <note removeInRFC="true">
            <name>Discussion</name>
            <t>Source for this draft and an issue tracker can be found at
                <eref target="https://github.com/theenbyperor/quic-bdp-token"/>.</t>
        </note>
    </front>

    <middle>
        <section>
            <name>Introduction</name>
            <t>This document describes a method for a QUIC server to send calculated Congestion Control parameters
                to a client for storage and later use on a future connection with Careful Resume
                <xref target="I-D.ietf-tsvwg-careful-resume"/>. It also allows the client to inspect CC parameters,
                and allows the client not use them with new connections if its aware of a change in the BDP of the path.</t>

            <section>
                <name>Requirements Language</name>
                <t>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 <xref target="BCP14"/> when, and only when, they appear in all capitals,
                    as shown here.</t>
            </section>
        </section>
        <section>
            <name>BDP Tokens</name>
            <t>The address validation token is overloaded to also store Congestion Control information.
                This has the neat advantage that a QUIC client unaware of this document will still be able to make use
                of this specification without modification. QUIC <xref target="RFC9000"/> defines an address validation
                token as an opaque blob that the client should not inspect. This document extends this by providing some
                structure to the token, whilst still providing fields for server specific information that is opaque to
                the client.</t>
            <t>The format of a token containing BDP information is defined as follows:</t>
            <figure align="left" suppress-title="false">
                <name>BDP Token</name>
                <artwork name="" type="" align="left" alt="">
BDP Token {
    Address Validation Length (i),
    Address Validation (..),
    Congestion Control Data Length (i),
    Congestion Control Data Value (..),
    Capacity (i),
    RTT (i),
    Requested Capacity (i)
}
                </artwork>
            </figure>
            <t>The fields are as follows:</t>
            <dl>
                <dt>Address Validation Length</dt>
                <dd>
                    A variable-length integer specifying the length of the Address Validation field, in bytes.
                    A value of 0 indicates that the server is not using address validation and is using the token purely
                    for CC information.
                </dd>
                <dt>Address Validation</dt>
                <dd>
                    Opaque information specific to the server that it will use for address validation.
                    The construction of this field <bcp14>MUST</bcp14> comply with the requirements of QUIC
                    <xref target="RFC9000"/> section 8.1.
                </dd>
                <dt>Congestion Control Data Length</dt>
                <dd>
                    A variable-length integer specifying the length of the Congestion Control Data field, in bytes.
                    A value of 0 indicates that the server does not intend to store Congestion Control data on the
                    client, and that the Saved Capacity and
                    Saved RTT fields are merely informative.
                </dd>
                <dt>Congestion Control Data</dt>
                <dd>
                    Opaque information specific to the server that it will use to prime its congestion controller state.
                    This field <bcp14>SHOULD</bcp14> contain expiration/lifetime information, and any additional
                    information that the server may need to validate that the same path is being used, such as an
                    endpoint token as defined in Careful Resume <xref target="I-D.ietf-tsvwg-careful-resume"/>.
                    The data <bcp14>MUST</bcp14> be signed, or otherwise protected against modification by the client.
                </dd>
                <dt>Capacity</dt>
                <dd>
                    The estimated capacity of the path in bytes, encoded as a variable-length integer.
                    The exact Congestion Control state value used to fill this field is left to server preference.
                </dd>
                <dt>RTT</dt>
                <dd>
                    The RTT of the path in microseconds, encoded as a variable-length integer.
                    The exact Congestion Control state value used to fill this field is left to server preference.
                </dd>
                <dt>Requested Capacity</dt>
                <dd>
                    In a token sent by the server, this field is set to the same value as the Capacity field.
                    If the client becomes aware of a change in the available bandwidth of the path, it can adjust this
                    field to request a lower capacity be used by the server when priming its congestion controller state.
                </dd>
            </dl>
            <t>The Capacity and RTT fields are merely hints to the client and the server
                <bcp14>MUST</bcp14> not use these fields when priming its congestion controller state. If it wishes
                to use these parameters it will have to also include them in its CC Data structure, as data in this
                field is protected against modification by the client.</t>
            <section>
                <name>Client interaction</name>
                <t>If the client becomes aware of a change in the available bandwidth of the path, it can use the Requested
                    Capacity field to signal to the server a change it its available bandwidth.
                    The server <bcp14>MUST</bcp14> not accept a value higher than that of the Capacity field, as this could
                    cause an overload of the network path.</t>
                <t>If the client sets the Requested Bandwidth field to 0 then it is signalling that the server should not
                    attempt to prime its congestion controller from previous state and should instead treat this connection
                    as an entirely new congestion control context.</t>
            </section>
            <section>
                <name>Invalid BDP tokens</name>
                <t>If the server is unable to decode the token received from the client as a valid BDP token then this
                    <bcp14>MUST</bcp14> be treated as a connection error BDP_TOKEN_ERROR (0x1312). A token which is
                    merely expired <bcp14>MUST NOT</bcp14> trigger a connection error, instead it should be silently
                    discarded.</t>
            </section>
        </section>
        <section>
            <name>Extension signalling</name>
            <t>The server can send the above extended BDP token to all clients without further negotiation. However
                a client needs some way to know that there is meaningful structure to a token its received from the
                server. To this end a new transport parameter is defined.</t>
            <dl>
                <dt>bdp_token (0x1312)</dt>
                <dd>
                    The bdp_token transport parameter is a boolean value that indicates that the server is using
                    BDP tokens. It can have the following values:<br/>
                    - 0, default value: BDP Tokens are not in use.<br/>
                    - 1: BDP Tokens are in use.
                </dd>
            </dl>
        </section>

        <section anchor="IANA">
            <name>IANA Considerations</name>
            <section>
                <name>QUIC Transport Parameters</name>
                <t>Per this document, one new entry has been added to the "QUIC Transport Parameters" registry defined in
                    <xref target="RFC9000"/> section 22.3. This entry is defined below:</t>
                <table>
                    <name>New entries</name>
                    <thead>
                        <tr>
                            <th>Value</th>
                            <th>Status</th>
                            <th>Specification</th>
                            <th>Parameter name</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>0x1312</td>
                            <td>Provisional</td>
                            <td>This document</td>
                            <td>bdp_frame</td>
                        </tr>
                    </tbody>
                </table>
            </section>
            <section>
                <name>QUIC Transport Error Codes</name>
                <t>Per this document, one new entry has been added to the "QUIC Transport Error Codes" registry defined in
                    <xref target="RFC9000"/> section 22.5. This entry is defined below:</t>
                <table>
                    <name>New entries</name>
                    <thead>
                        <tr>
                            <th>Value</th>
                            <th>Status</th>
                            <th>Code</th>
                            <th>Description</th>
                            <th>Specification</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>0x1312</td>
                            <td>Provisional</td>
                            <td>BDP_TOKEN_ERROR</td>
                            <td>The BDP token received from the client is invalid.</td>
                            <td>This document</td>
                        </tr>
                    </tbody>
                </table>
            </section>
        </section>

        <section anchor="Security">
            <name>Security Considerations</name>
            <t>The Congestion Control Data field <bcp14>MUST</bcp14> be protected against manipulation by malicious or
                mis-behaving clients. A client that can modify Congestion Control calculations could cause an overload
                of the network path.</t>
            <t>The Capacity and RTT fields are hints to the client and not protected from modification by a client. The
                server <bcp14>MUST</bcp14> ignore these when processing a received BDP token.</t>
        </section>
    </middle>

    <back>
        <references>
            <name>References</name>
            <references>
                <name>Normative References</name>

                <referencegroup anchor="BCP14" target="https://www.rfc-editor.org/info/bcp14">
                    <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.2119.xml"/>
                    <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8174.xml"/>
                </referencegroup>
                <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.9000.xml"/>
            </references>
            <references>
                <name>Informative References</name>

                <xi:include href="https://datatracker.ietf.org/doc/bibxml3/draft-ietf-tsvwg-careful-resume-04.xml"/>
            </references>
        </references>
    </back>
</rfc>
