<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.1 (Ruby 3.2.2) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-thomson-webtrans-session-limit-01" category="info" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.18.1 -->
  <front>
    <title abbrev="WebTransport Session Limits">Applying Per-Session Limits for WebTransport</title>
    <seriesInfo name="Internet-Draft" value="draft-thomson-webtrans-session-limit-01"/>
    <author fullname="Martin Thomson">
      <organization>Mozilla</organization>
      <address>
        <email>mt@lowentropy.net</email>
      </address>
    </author>
    <author fullname="Eric Kinnear">
      <organization>Apple Inc.</organization>
      <address>
        <email>ekinnear@apple.com</email>
      </address>
    </author>
    <date year="2023" month="October" day="11"/>
    <area>Applications and Real-Time</area>
    <workgroup>WebTransport</workgroup>
    <keyword>next generation</keyword>
    <keyword>unicorn</keyword>
    <keyword>sparkling distributed ledger</keyword>
    <abstract>
      <?line 44?>

<t>Limits to how a WebTransport session uses QUIC resources like streams or data
can help reduce the effect that one WebTransport session has on other uses of
the same HTTP/3 connection.  This describes mechanisms for limiting the number
of streams and quantity of data that can be consumed by each WebTransport
session.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        The latest revision of this draft can be found at <eref target="https://martinthomson.github.io/wt-session-limits/draft-thomson-webtrans-session-limit.html"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-thomson-webtrans-session-limit/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        WebTransport Working Group mailing list (<eref target="mailto:webtransport@ietf.org"/>),
        which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/webtransport/"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/webtransport/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/martinthomson/wt-session-limits"/>.</t>
    </note>
  </front>
  <middle>
    <?line 53?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>WebTransport in HTTP/3 <xref target="WTH3"/> provides applications with all the functionality
of QUIC <xref target="QUIC"/> streams.  In the case where a single connection includes a
WebTransport session that needs to coexist with other WebTransport sessions or
HTTP requests, the core draft does not offer any way to place limits on stream
usage.</t>
      <t>This document describes an additional layer of session-level flow control that
governs the creation of streams and sets a session-level limit on the amount of
data that can be exchanged in a session.</t>
      <t>This document does not define a framework for prioritizing the streams created
for a WebTransport session with other streams.</t>
      <t>Note that this document is intended as input for <xref target="WTH3"/>. Although it is
possible to define this as an extension to that protocol, integration of this
design is simpler; see <xref target="negotiation"/>.</t>
    </section>
    <section anchor="conventions-and-definitions">
      <name>Conventions and Definitions</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 BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
      <?line -18?>

</section>
    <section anchor="protocol-definition">
      <name>Protocol Definition</name>
      <t>This document uses the following flow control capsules defined in <xref target="WTH2"/>:</t>
      <ul spacing="normal">
        <li>
          <t>WT_MAX_DATA (<xref section="5.5" sectionFormat="of" target="WTH2"/>)</t>
        </li>
        <li>
          <t>WT_MAX_STREAMS (<xref section="5.7" sectionFormat="of" target="WTH2"/>)</t>
        </li>
        <li>
          <t>WT_DATA_BLOCKED (<xref section="5.8" sectionFormat="of" target="WTH2"/>)</t>
        </li>
        <li>
          <t>WT_STREAMS_BLOCKED (<xref section="5.10" sectionFormat="of" target="WTH2"/>)</t>
        </li>
      </ul>
      <t>These capsules are unchanged, except that where the WebTransport over HTTP/2
capsules refer to streams that flow over the HTTP/2 stream containing the
entire WebTransport session, these capsules refer to separate limits as
described in subsequent sections.</t>
      <t>These capsules use the codepoints allocated in <xref target="WTH2"/>.</t>
      <section anchor="stream-limits">
        <name>Stream Limits</name>
        <t>The WT_MAX_STREAMS capsule establishes a limit on the number of streams within a
WebTransport session.  Like the QUIC MAX_STREAMS frame (<xref section="19.11" sectionFormat="of" target="QUIC"/>), this capsule has two types that provide separate limits for
unidirectional and bidirectional streams that are initiated by a peer.</t>
        <t>The session-level stream limit applies in addition to the QUIC MAX_STREAMS
frame, which provides a connection-level stream limit.  New streams can only be
created within the session if both the stream- and the connection-level limit
permit; see <xref section="4.6" sectionFormat="of" target="QUIC"/> for details on how QUIC stream limits are
applied.</t>
        <t>Unlike the WT_MAX_STREAMS capsule or the QUIC MAX_STREAMS frame, there is no
simple relationship between the value in this frame and stream IDs in QUIC
STREAM frames.  This especially applies if there are other users of streams on
the connection.</t>
        <t>The WT_STREAMS_BLOCKED capsule is sent to indicate that an endpoint was unable
to create a stream due to the session-level stream limit.</t>
      </section>
      <section anchor="data-limits">
        <name>Data Limits</name>
        <t>The WT_MAX_DATA capsule establishes a limit on the amount of data that can be
sent within a WebTransport session.  This limit counts all data that is sent on
streams of the corresponding type, excluding the stream header (see Sections <xref target="WTH3" section="4.2" sectionFormat="bare"/> and <xref target="WTH3" section="4.2" sectionFormat="bare"/> of <xref target="WTH3"/>).  The stream header is excluded from this limit so that
this limit does not prevent the sending of information that is essential in
linking new streams to a specific WebTransport session.</t>
        <t>Implementing WT_MAX_DATA requires that the QUIC stack provide the WebTransport
implementation with information about the final size of streams; see <xref section="4.5" sectionFormat="of" target="QUIC"/>.</t>
        <t>The WT_DATA_BLOCKED capsule is sent to indicate that an endpoint was unable to
send data due to a limit set by the WT_MAX_DATA capsule.</t>
        <t>Because WebTransport over HTTP/3 uses a native QUIC stream for each WebTransport
stream, per-stream data limits are provided by QUIC natively.  The
WT_MAX_STREAM_DATA and WT_STREAM_DATA_BLOCKED capsules are not used and so are
prohibited.  Endpoints <bcp14>MUST</bcp14> treat receipt of a WT_MAX_STREAM_DATA or a
WT_STREAM_DATA_BLOCKED capsule as a session error.</t>
      </section>
    </section>
    <section anchor="negotiation">
      <name>Negotiation</name>
      <t>If the use of flow control capsules are merged into the main specification
<xref target="WTH3"/>, their use will be negotiated along with the use of WebTransport over
HTTP/3.  This is the simplest approach.</t>
      <t>Alternatively, if this remains as an optional extension, new HTTP/3 settings
will be needed to negotiate the use of these features.  In the abstract, we
could define settings that carry initial values for the three variables that
are controlled by the session-level flow control capsules defined here.  The
presence of any of those settings would indicate that these limits will be
respected if the capsule is sent.</t>
      <t>Both peers need to indicate the setting before these capsules apply.  If only
one peer advertises any of these settings, that might indicate that they are
willing to receive and respect session-level flow control capsules.  However,
such an endpoint cannot know when to start applying the limit.</t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>Aside from new exposure to the usual programming errors arising from increased
protocol complexity, it is believed that the introduction of these capabilities
only improves security as it provides better control over endpoint resource
allocation.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>This document has no IANA actions.</t>
    </section>
  </middle>
  <back>
    <references anchor="sec-normative-references">
      <name>Normative References</name>
      <reference anchor="WTH3">
        <front>
          <title>WebTransport over HTTP/3</title>
          <author fullname="Alan Frindell" initials="A." surname="Frindell">
            <organization>Facebook</organization>
          </author>
          <author fullname="Eric Kinnear" initials="E." surname="Kinnear">
            <organization>Apple Inc.</organization>
          </author>
          <author fullname="Victor Vasiliev" initials="V." surname="Vasiliev">
            <organization>Google</organization>
          </author>
          <date day="13" month="June" year="2023"/>
          <abstract>
            <t>   WebTransport [OVERVIEW] is a protocol framework that enables clients
   constrained by the Web security model to communicate with a remote
   server using a secure multiplexed transport.  This document describes
   a WebTransport protocol that is based on HTTP/3 [HTTP3] and provides
   support for unidirectional streams, bidirectional streams and
   datagrams, all multiplexed within the same HTTP/3 connection.

            </t>
          </abstract>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-webtrans-http3-07"/>
      </reference>
      <reference anchor="WTH2">
        <front>
          <title>WebTransport over HTTP/2</title>
          <author fullname="Alan Frindell" initials="A." surname="Frindell">
            <organization>Facebook Inc.</organization>
          </author>
          <author fullname="Eric Kinnear" initials="E." surname="Kinnear">
            <organization>Apple Inc.</organization>
          </author>
          <author fullname="Tommy Pauly" initials="T." surname="Pauly">
            <organization>Apple Inc.</organization>
          </author>
          <author fullname="Martin Thomson" initials="M." surname="Thomson">
            <organization>Mozilla</organization>
          </author>
          <author fullname="Victor Vasiliev" initials="V." surname="Vasiliev">
            <organization>Google</organization>
          </author>
          <author fullname="Guowu Xie" initials="G." surname="Xie">
            <organization>Facebook Inc.</organization>
          </author>
          <date day="10" month="July" year="2023"/>
          <abstract>
            <t>   WebTransport defines a set of low-level communications features
   designed for client-server interactions that are initiated by Web
   clients.  This document describes a protocol that can provide many of
   the capabilities of WebTransport over HTTP/2.  This protocol enables
   the use of WebTransport when a UDP-based protocol is not available.

            </t>
          </abstract>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-webtrans-http2-06"/>
      </reference>
      <reference anchor="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>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="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>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">
        <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>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>
    <?line 192?>

<section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>TODO acknowledge.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA51Z7XLbuBX9j6dAlT+bHUmOnaSbuNvdKLaz8aw/UluZdKfT
yUAkJGFMAlyAtKJ48i59lj5Zz70gKVJSMpn+iSkSuJ/nnnuBjEYjUZoy08dy
MCmKbG3sQr7TfnSrQzDOyguTmzLIufPyg55NvbKhcL4cCDWbeX2Pbd3Xsr9t
IBJV6oXz62Np7NwJkbrEqhzaUq/m5ahcujw4O1rpWUkyRiHuH2W0f/TkUIRq
lht+V64L7Ds/m76R8pFUWXBQbmyqC41/bDk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