Stream Namespaces for QUIC
Internet-Draft draft-vvv-quic-namespaces-00
Victor Vasiliev
Google
vasilvv@google.com
21 February 2024
tsv
QUIC Working Group
QUIC
namespaces
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.
About This Document
Status information for this document may be found at https://datatracker.ietf.org/doc/draft-vvv-quic-namespaces/.
Discussion of this document takes place on the quic Working Group mailing list (mailto:quic@ietf.org), which is archived at https://example.com/WG. Subscribe at https://www.ietf.org/mailman/listinfo/quic/.
Source for this draft and an issue tracker can be found at https://github.com/https://github.com/vasilvv/draft-vvv-quic-namespaces.
Introduction
QUIC [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.
Conventions and Definitions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
Namespaces
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 the default namespace.
Note that there is no way to set a namespace-specific initial_max_stream_data parameters; those remain connection-global.
Frames
NS frame
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.
NS Frame Format

NS Frame {
  Type (i) = 0x29c5,
  Namespace ID (i),
}

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 MUST close the connection with a PROTOCOL_VIOLATION error code. Same applies to an NS frame that is not followed by anything.
Note that this intentionally does not define NS prefix for the DATAGRAM frames [RFC9221], as datagrams already have pre-defined mechanisms for multiplexing (such as [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.
CLOSE_NAMESPACE frame
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.
CLOSE_NAMESPACE Frame Format

CLOSE_NAMESPACE Frame {
  Type (i) = 0x29c6,
  Namespace ID (i),
}

Security Considerations
TODO Security
TODO: discuss the issue where the peer has to remember flow control limits for arbitrary unexpected namespaces.
IANA Considerations
TODO: add a transport parameter to negotiate this feature.
References
Normative References
[RFC9000]

QUIC: A UDP-Based Multiplexed and Secure Transport
J. Iyengar, Ed.
M. Thomson, Ed.
May 2021
RFC 9000
DOI 10.17487/RFC9000
[RFC2119]

Key words for use in RFCs to Indicate Requirement Levels
S. Bradner
March 1997
BCP 14
RFC 2119
DOI 10.17487/RFC2119
[RFC8174]

Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words
B. Leiba
May 2017
BCP 14
RFC 8174
DOI 10.17487/RFC8174
[RFC9221]

An Unreliable Datagram Extension to QUIC
T. Pauly
E. Kinnear
D. Schinazi
March 2022
RFC 9221
DOI 10.17487/RFC9221
Informative References
[RFC9297]

HTTP Datagrams and the Capsule Protocol
D. Schinazi
L. Pardue
August 2022
RFC 9297
DOI 10.17487/RFC9297
Acknowledgments
TODO acknowledge.