<?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.5 (Ruby 3.2.2) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-vvv-quic-namespaces-00" category="info" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.19.4 -->
  <front>
    <title>Stream Namespaces for QUIC</title>
    <seriesInfo name="Internet-Draft" value="draft-vvv-quic-namespaces-00"/>
    <author fullname="Victor Vasiliev">
      <organization>Google</organization>
      <address>
        <email>vasilvv@google.com</email>
      </address>
    </author>
    <date year="2024" month="February" day="21"/>
    <area>tsv</area>
    <workgroup>QUIC Working Group</workgroup>
    <keyword>QUIC</keyword>
    <keyword>namespaces</keyword>
    <abstract>
      <?line 35?>

<t>QUIC Stream Namespaces provide an extension to the QUIC protocol that enables
multiplexing multiple logical groups of streams within the same connection,
while providing flow control isolation.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-vvv-quic-namespaces/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        quic Working Group mailing list (<eref target="mailto:quic@ietf.org"/>),
        which is archived at <eref target="https://example.com/WG"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/quic/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/https://github.com/vasilvv/draft-vvv-quic-namespaces"/>.</t>
    </note>
  </front>
  <middle>
    <?line 42?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>QUIC <xref target="RFC9000"/> provides an ordered bytestream abstraction called streams.
Streams are subject to various flow control mechanisms that allow a network
endpoint to control how much resources a peer is allowed to consume.  Some of
the flow control mechanisms are scoped to a single stream; others are global to
the entire connection.  The connection-level flow control mechanisms are a good
fit in cases when all of the streams originate from the same entity; however,
in cases when multiple logical entities share the same connection, a single
global limit may lead to one entity starving another.  This document provides a
mechanism by which a single QUIC connection can have multiple namespaces, each
with its own resource limits for streams.</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="namespaces">
      <name>Namespaces</name>
      <t>A QUIC namespace is a 62-bit unique ID number. In the initial state, every
namespace ID is assumed to exist, but have a MAX_STREAMS number associated with
it set to 0 for all types of streams, and a MAX_DATA value of 0 in both
directions. A peer opens a namespace by sending a combination of MAX_DATA and
MAX_STREAMS frames for that namespace. The recepient may response with either
its own MAX_DATA and MAX_STREAMS, confirming the response, or it may close the
namespace. Frames that do not have a namespace ID associated with them are said
to be a part of <em>the default namespace</em>.</t>
      <t>Note that there is no way to set a namespace-specific initial_max_stream_data
parameters; those remain connection-global.</t>
    </section>
    <section anchor="frames">
      <name>Frames</name>
      <section anchor="ns-frame">
        <name>NS frame</name>
        <t>An NS frame (frame type=0x29c5) is a frame that alters the meaning of the frame
that comes immediately after it.  If the subsequent frame has a stream ID in it,
that ID refers to the stream with the corresponding ID in the specified
namespace. If the subsequent frame alters connection-global flow control
limits, those limits are altered for the namespace in question, instead of the
default namespace.</t>
        <figure anchor="fig-NS">
          <name>NS Frame Format</name>
          <artwork><![CDATA[
NS Frame {
  Type (i) = 0x29c5,
  Namespace ID (i),
}
]]></artwork>
        </figure>
        <t>The following frames are allowed to follow the NS frame: STREAM, RESET_STREAM,
STOP_SENDING, MAX_DATA, MAX_STREAM_DATA, MAX_STREAMS, DATA_BLOCKED,
STREAM_DATA_BLOCKED, STREAMS_BLOCKED.  Extensions that define their own frames
can define their own semantics of interacting with namespaces.  If a frame that
is not listed above and does not have extension semantics defined for it is
prefixed with an NS frame, the recepient <bcp14>MUST</bcp14> close the connection with a
PROTOCOL_VIOLATION error code. Same applies to an NS frame that is not followed
by anything.</t>
        <t>Note that this intentionally does not define NS prefix for the DATAGRAM frames
<xref target="RFC9221"/>, as datagrams already have pre-defined mechanisms for multiplexing
(such as <xref target="RFC9297"/>) that may conflict with QUIC stream namespaces, and there
is no technical advantage of using an NS frame with datagrams over doing
multiplexing within the datagram payload.</t>
      </section>
      <section anchor="closenamespace-frame">
        <name>CLOSE_NAMESPACE frame</name>
        <t>A CLOSE_NAMESPACE frame indicates to the peer that the sender will not process
any further data received for a given namespace.  The sender can discard all of
the state related to the namespace after sending this frame.</t>
        <figure anchor="fig-close-namespace">
          <name>CLOSE_NAMESPACE Frame Format</name>
          <artwork><![CDATA[
CLOSE_NAMESPACE Frame {
  Type (i) = 0x29c6,
  Namespace ID (i),
}
]]></artwork>
        </figure>
      </section>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>TODO Security</t>
      <t>TODO: discuss the issue where the peer has to remember flow control limits for arbitrary unexpected namespaces.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>TODO: add a transport parameter to negotiate this feature.</t>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references anchor="sec-normative-references">
        <name>Normative References</name>
        <reference anchor="RFC9000">
          <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>
        <reference anchor="RFC9221">
          <front>
            <title>An Unreliable Datagram Extension to QUIC</title>
            <author fullname="T. Pauly" initials="T." surname="Pauly"/>
            <author fullname="E. Kinnear" initials="E." surname="Kinnear"/>
            <author fullname="D. Schinazi" initials="D." surname="Schinazi"/>
            <date month="March" year="2022"/>
            <abstract>
              <t>This document defines an extension to the QUIC transport protocol to add support for sending and receiving unreliable datagrams over a QUIC connection.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9221"/>
          <seriesInfo name="DOI" value="10.17487/RFC9221"/>
        </reference>
      </references>
      <references anchor="sec-informative-references">
        <name>Informative References</name>
        <reference anchor="RFC9297">
          <front>
            <title>HTTP Datagrams and the Capsule Protocol</title>
            <author fullname="D. Schinazi" initials="D." surname="Schinazi"/>
            <author fullname="L. Pardue" initials="L." surname="Pardue"/>
            <date month="August" year="2022"/>
            <abstract>
              <t>This document describes HTTP Datagrams, a convention for conveying multiplexed, potentially unreliable datagrams inside an HTTP connection.</t>
              <t>In HTTP/3, HTTP Datagrams can be sent unreliably using the QUIC DATAGRAM extension. When the QUIC DATAGRAM frame is unavailable or undesirable, HTTP Datagrams can be sent using the Capsule Protocol, which is a more general convention for conveying data in HTTP connections.</t>
              <t>HTTP Datagrams and the Capsule Protocol are intended for use by HTTP extensions, not applications.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9297"/>
          <seriesInfo name="DOI" value="10.17487/RFC9297"/>
        </reference>
      </references>
    </references>
    <?line 154?>

<section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>TODO acknowledge.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA41Y23IbuRF9x1cg8os3RcqS4+yu6fV6uRLtVUUSHZH2ZiuV
UoEzIIl4BuACGEqMSv6WfEu+LKcbc6Mlp/IkAgP05XT36YaGw6GIJhZ6JA9m
0WtVyktV6rBRmQ5y6bz864ezkwORqahXzu9G0tilEyJ3mcW5kcy9Wsbhdrsd
/l6ZbGjby8OjIxGqRWlCMM7G3QaHzybzt8JW5UL7kcghciQyZ4O2oQojGX2l
xXYk/yQUDME6bMWN859W3lWbERsif8Xa2JV8R3vik97hQD4Scsif6W9ngdhq
W0GFlLUEshCrZMu+JClLZYp05Cej4/LQ+RV2lc/WI7mOcRNGz57pW1VuCn2Y
ufLZr+9Is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