draft-ietf-masque-h3-datagram-04.txt   draft-ietf-masque-h3-datagram-05.txt 
MASQUE D. Schinazi MASQUE D. Schinazi
Internet-Draft Google LLC Internet-Draft Google LLC
Intended status: Standards Track L. Pardue Intended status: Standards Track L. Pardue
Expires: 10 April 2022 Cloudflare Expires: 28 April 2022 Cloudflare
7 October 2021 25 October 2021
Using Datagrams with HTTP Using Datagrams with HTTP
draft-ietf-masque-h3-datagram-04 draft-ietf-masque-h3-datagram-05
Abstract Abstract
The QUIC DATAGRAM extension provides application protocols running The QUIC DATAGRAM extension provides application protocols running
over QUIC with a mechanism to send unreliable data while leveraging over QUIC with a mechanism to send unreliable data while leveraging
the security and congestion-control properties of QUIC. However, the security and congestion-control properties of QUIC. However,
QUIC DATAGRAM frames do not provide a means to demultiplex QUIC DATAGRAM frames do not provide a means to demultiplex
application contexts. This document describes how to use QUIC application contexts. This document describes how to use QUIC
DATAGRAM frames when the application protocol running over QUIC is DATAGRAM frames when the application protocol running over QUIC is
HTTP/3. It associates datagrams with client-initiated bidirectional HTTP/3. It associates datagrams with client-initiated bidirectional
skipping to change at page 2, line 4 skipping to change at page 2, line 4
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on 10 April 2022. This Internet-Draft will expire on 28 April 2022.
Copyright Notice Copyright Notice
Copyright (c) 2021 IETF Trust and the persons identified as the Copyright (c) 2021 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents (https://trustee.ietf.org/ Provisions Relating to IETF Documents (https://trustee.ietf.org/
license-info) in effect on the date of publication of this document. license-info) in effect on the date of publication of this document.
Please review these documents carefully, as they describe your rights Please review these documents carefully, as they describe your rights
skipping to change at page 2, line 34 skipping to change at page 2, line 34
2. Multiplexing . . . . . . . . . . . . . . . . . . . . . . . . 4 2. Multiplexing . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1. Datagram Contexts . . . . . . . . . . . . . . . . . . . . 4 2.1. Datagram Contexts . . . . . . . . . . . . . . . . . . . . 4
2.2. Datagram Formats . . . . . . . . . . . . . . . . . . . . 5 2.2. Datagram Formats . . . . . . . . . . . . . . . . . . . . 5
2.3. Context ID Allocation . . . . . . . . . . . . . . . . . . 5 2.3. Context ID Allocation . . . . . . . . . . . . . . . . . . 5
3. HTTP/3 DATAGRAM Format . . . . . . . . . . . . . . . . . . . 6 3. HTTP/3 DATAGRAM Format . . . . . . . . . . . . . . . . . . . 6
4. Capsules . . . . . . . . . . . . . . . . . . . . . . . . . . 7 4. Capsules . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.1. Capsule Protocol . . . . . . . . . . . . . . . . . . . . 8 4.1. Capsule Protocol . . . . . . . . . . . . . . . . . . . . 8
4.2. Requirements . . . . . . . . . . . . . . . . . . . . . . 9 4.2. Requirements . . . . . . . . . . . . . . . . . . . . . . 9
4.3. Intermediary Processing . . . . . . . . . . . . . . . . . 9 4.3. Intermediary Processing . . . . . . . . . . . . . . . . . 9
4.4. Capsule Types . . . . . . . . . . . . . . . . . . . . . . 10 4.4. Capsule Types . . . . . . . . . . . . . . . . . . . . . . 10
4.4.1. The REGISTER_DATAGRAM_CONTEXT Capsule . . . . . . . . 10 4.4.1. The Datagram Registration Capsules . . . . . . . . . 10
4.4.2. The REGISTER_DATAGRAM_NO_CONTEXT Capsule . . . . . . 11 4.4.2. The Datagram Close Capsule . . . . . . . . . . . . . 11
4.4.3. The CLOSE_DATAGRAM_CONTEXT Capsule . . . . . . . . . 12 4.4.3. The Datagram Capsules . . . . . . . . . . . . . . . . 13
4.4.4. The DATAGRAM Capsule . . . . . . . . . . . . . . . . 14 5. The H3_DATAGRAM HTTP/3 SETTINGS Parameter . . . . . . . . . . 14
5. The H3_DATAGRAM HTTP/3 SETTINGS Parameter . . . . . . . . . . 16 5.1. Note About Draft Versions . . . . . . . . . . . . . . . . 15
5.1. Note About Draft Versions . . . . . . . . . . . . . . . . 16 6. The Sec-Use-Datagram-Contexts HTTP Header . . . . . . . . . . 15
6. Prioritization . . . . . . . . . . . . . . . . . . . . . . . 16 7. Prioritization . . . . . . . . . . . . . . . . . . . . . . . 16
7. Security Considerations . . . . . . . . . . . . . . . . . . . 17 8. Security Considerations . . . . . . . . . . . . . . . . . . . 17
8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17
8.1. HTTP/3 SETTINGS Parameter . . . . . . . . . . . . . . . . 17 9.1. HTTP/3 SETTINGS Parameter . . . . . . . . . . . . . . . . 17
8.2. Capsule Types . . . . . . . . . . . . . . . . . . . . . . 17 9.2. HTTP Header Field Name . . . . . . . . . . . . . . . . . 17
8.3. Datagram Format Types . . . . . . . . . . . . . . . . . . 18 9.3. Capsule Types . . . . . . . . . . . . . . . . . . . . . . 18
8.4. Context Close Codes . . . . . . . . . . . . . . . . . . . 19 9.4. Datagram Format Types . . . . . . . . . . . . . . . . . . 18
9. References . . . . . . . . . . . . . . . . . . . . . . . . . 19 9.5. Context Close Codes . . . . . . . . . . . . . . . . . . . 19
9.1. Normative References . . . . . . . . . . . . . . . . . . 19 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 20
9.2. Informative References . . . . . . . . . . . . . . . . . 20 10.1. Normative References . . . . . . . . . . . . . . . . . . 20
10.2. Informative References . . . . . . . . . . . . . . . . . 21
Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 21 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 21
A.1. CONNECT-UDP . . . . . . . . . . . . . . . . . . . . . . . 21 A.1. CONNECT-UDP . . . . . . . . . . . . . . . . . . . . . . . 21
A.2. CONNECT-UDP with Timestamp Extension . . . . . . . . . . 21 A.2. CONNECT-UDP with Delayed Timestamp Extension . . . . . . 22
A.3. CONNECT-IP with IP compression . . . . . . . . . . . . . 22 A.2.1. With Delay . . . . . . . . . . . . . . . . . . . . . 22
A.4. WebTransport . . . . . . . . . . . . . . . . . . . . . . 24 A.3. Successful Optimistic . . . . . . . . . . . . . . . . . . 23
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 24 A.4. Optimistic but Unsupported . . . . . . . . . . . . . . . 24
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 24 A.5. CONNECT-IP with IP compression . . . . . . . . . . . . . 25
A.6. WebTransport . . . . . . . . . . . . . . . . . . . . . . 26
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 27
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 27
1. Introduction 1. Introduction
The QUIC DATAGRAM extension [DGRAM] provides application protocols The QUIC DATAGRAM extension [DGRAM] provides application protocols
running over QUIC [QUIC] with a mechanism to send unreliable data running over QUIC [QUIC] with a mechanism to send unreliable data
while leveraging the security and congestion-control properties of while leveraging the security and congestion-control properties of
QUIC. However, QUIC DATAGRAM frames do not provide a means to QUIC. However, QUIC DATAGRAM frames do not provide a means to
demultiplex application contexts. This document describes how to use demultiplex application contexts. This document describes how to use
QUIC DATAGRAM frames when the application protocol running over QUIC QUIC DATAGRAM frames when the application protocol running over QUIC
is HTTP/3 [H3]. It associates datagrams with client-initiated is HTTP/3 [H3]. It associates datagrams with client-initiated
bidirectional streams and defines an optional additional bidirectional streams and defines an optional additional
demultiplexing layer. Additionally, this document defines how to demultiplexing layer. Additionally, this document defines how to
convey datagrams over prior versions of HTTP. convey datagrams over prior versions of HTTP.
This document is structured as follows: This document is structured as follows:
* Section 2 presents core concepts for multiplexing across HTTP * Section 2 presents core concepts for multiplexing across HTTP
versions. versions.
- Section 2.1 defines datagram contexts, an optional end-to-end - Section 2.1 defines datagram contexts, an optional end-to-end
multiplexing concept scoped to each HTTP request. multiplexing concept scoped to each HTTP request. Whether
contexts are in use is defined in Section 6.
- Section 2.2 defines datagram formats, which are scoped to - Section 2.2 defines datagram formats, which are scoped to
contexts. Formats communicate the format and encoding of contexts. Formats communicate the format and encoding of
datagrams sent using the associated context. datagrams sent using the associated context.
- Contexts are identified using a variable-length integer. - Contexts are identified using a variable-length integer.
Requirements for allocating identifier values are detailed in Requirements for allocating identifier values are detailed in
Section 2.3. Section 2.3.
* Section 3 defines how QUIC DATAGRAM frames are used with HTTP/3. * Section 3 defines how QUIC DATAGRAM frames are used with HTTP/3.
skipping to change at page 3, line 51 skipping to change at page 4, line 8
advertise support of the frame. advertise support of the frame.
* Section 4 introduces the Capsule Protocol and the "data stream" * Section 4 introduces the Capsule Protocol and the "data stream"
concept. Data streams are initiated using special-purpose HTTP concept. Data streams are initiated using special-purpose HTTP
requests, after which Capsules, an end-to-end message, can be requests, after which Capsules, an end-to-end message, can be
sent. sent.
- The following Capsule types are defined, together with guidance - The following Capsule types are defined, together with guidance
for defining new types: for defining new types:
o REGISTER_DATAGRAM_CONTEXT Section 4.4.1 o Datagram registration capsules Section 4.4.1
o REGISTER_DATAGRAM_NO_CONTEXT Section 4.4.2
o CLOSE_DATAGRAM_CONTEXT Section 4.4.3 o Datagram close capsule Section 4.4.2
o DATAGRAM Section 4.4.4 o Datagram capsules Section 4.4.3
1.1. Conventions and Definitions 1.1. Conventions and Definitions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP "OPTIONAL" in this document are to be interpreted as described in BCP
14 [RFC2119] [RFC8174] when, and only when, they appear in all 14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here. capitals, as shown here.
2. Multiplexing 2. Multiplexing
skipping to change at page 4, line 44 skipping to change at page 4, line 48
2.1. Datagram Contexts 2.1. Datagram Contexts
Within the scope of a given HTTP request, contexts provide an Within the scope of a given HTTP request, contexts provide an
additional demultiplexing layer. Contexts determine the encoding of additional demultiplexing layer. Contexts determine the encoding of
datagrams, and can be used to implicitly convey metadata. For datagrams, and can be used to implicitly convey metadata. For
example, contexts can be used for compression to elide some parts of example, contexts can be used for compression to elide some parts of
the datagram: the context identifier then maps to a compression the datagram: the context identifier then maps to a compression
context that the receiver can use to reconstruct the elided data. context that the receiver can use to reconstruct the elided data.
Contexts are optional, whether to use them or not is decided by the
client on each request stream using registration capsules, see
Section 4.4.1 and Section 4.4.2. When contexts are used, they are
identified within the scope of a given request by a numeric value,
referred to as the context ID. A context ID is a 62-bit integer (0
to 2^62-1).
While stream IDs are a per-hop concept, context IDs are an end-to-end While stream IDs are a per-hop concept, context IDs are an end-to-end
concept. In other words, if a datagram travels through one or more concept. In other words, if a datagram travels through one or more
intermediaries on its way from client to server, the stream ID will intermediaries on its way from client to server, the stream ID will
most likely change from hop to hop, but the context ID will remain most likely change from hop to hop, but the context ID will remain
the same. Context IDs are opaque to intermediaries. the same. Context IDs are opaque to intermediaries.
Contexts are OPTIONAL to implement for both endpoints.
Intermediaries do not require any context-specific software to enable
contexts. When contexts are supported by the implementation, their
use is optional and can be selected on each stream. Endpoints inform
their peer of whether they wish to use contexts via the Sec-Use-
Datagram-Contexts HTTP header, see Section 6.
When contexts are used, they are identified within the scope of a
given request by a numeric value, referred to as the context ID. A
context ID is a 62-bit integer (0 to 2^62-1).
2.2. Datagram Formats 2.2. Datagram Formats
When an endpoint registers a datagram context (or the lack of When an endpoint registers a datagram context (or the lack of
contexts), it communicates the format (i.e., the semantics and contexts), it communicates the format (i.e., the semantics and
encoding) of datagrams sent using this context. This is encoding) of datagrams sent using this context. This is
acccomplished by sending a Datagram Format Type as part of the acccomplished by sending a Datagram Format Type as part of the
registration capsule, see Section 4.4.1 and Section 4.4.2. This type datagram registration capsule, see Section 4.4.1. This type
identifier is registered with IANA (see Section 8.3) and allows identifier is registered with IANA (see Section 9.4) and allows
applications that use HTTP Datagrams to indicate what the content of applications that use HTTP Datagrams to indicate what the content of
datagrams are. Registration capsules carry a Datagram Format datagrams are. Registration capsules carry a Datagram Format
Additional Data field which allows sending some additional Additional Data field which allows sending some additional
information that would impact the format of datagrams. information that would impact the format of datagrams.
For example, a protocol which proxies IP packets can define a For example, a protocol which proxies IP packets can define a
Datagram Format Type which represents an IP packet. The Datagram Format Type which represents an IP packet. The
corresponding Datagram Format Additional Data field would be empty. corresponding Datagram Format Additional Data field would be empty.
An extension to such a protocol that wishes to compress IP addresses An extension to such a protocol that wishes to compress IP addresses
could define a distinct Datagram Format Type and exchange two IP could define a distinct Datagram Format Type and exchange two IP
addresses via the Datagram Format Additional Data field. Then any addresses via the Datagram Format Additional Data field. Then any
datagrams with that type would contain the IP packet with addresses datagrams with that type would contain the IP packet with addresses
elided. elided.
2.3. Context ID Allocation 2.3. Context ID Allocation
Implementations of HTTP Datagrams MUST provide a context ID Implementations of HTTP Datagrams that support datagram contexts MUST
allocation service. That service will allow applications co-located provide a context ID allocation service. That service will allow
with HTTP to request a unique context ID that they can subsequently applications co-located with HTTP to request a unique context ID that
use for their own purposes. The HTTP implementation will then parse they can subsequently use for their own purposes. The HTTP
the context ID of incoming HTTP Datagrams and use it to deliver the implementation will then parse the context ID of incoming HTTP
frame to the appropriate application context. Datagrams and use it to deliver the frame to the appropriate
application context.
Even-numbered context IDs are client-initiated, while odd-numbered Even-numbered context IDs are client-initiated, while odd-numbered
context IDs are server-initiated. This means that an HTTP client context IDs are server-initiated. This means that an HTTP client
implementation of the context ID allocation service MUST only provide implementation of the context ID allocation service MUST only provide
even-numbered IDs, while a server implementation MUST only provide even-numbered IDs, while a server implementation MUST only provide
odd-numbered IDs. Note that, once allocated, any context ID can be odd-numbered IDs. Note that, once allocated, any context ID can be
used by both client and server - only allocation carries separate used by both client and server - only allocation carries separate
namespaces to avoid requiring synchronization. Additionally, note namespaces to avoid requiring synchronization. Additionally, note
that the context ID namespace is tied to a given HTTP request: it is that the context ID namespace is tied to a given HTTP request: it is
possible for the same numeral context ID to be used simultaneously in possible for the same numeral context ID to be used simultaneously in
skipping to change at page 6, line 31 skipping to change at page 6, line 36
associated with, divided by four (the division by four stems from associated with, divided by four (the division by four stems from
the fact that HTTP requests are sent on client-initiated the fact that HTTP requests are sent on client-initiated
bidirectional streams, and those have stream IDs that are bidirectional streams, and those have stream IDs that are
divisible by four). The largest legal QUIC stream ID value is divisible by four). The largest legal QUIC stream ID value is
2^62-1, so the largest legal value of Quarter Stream ID is 2^62-1 2^62-1, so the largest legal value of Quarter Stream ID is 2^62-1
/ 4. Receipt of a frame that includes a larger value MUST be / 4. Receipt of a frame that includes a larger value MUST be
treated as a connection error of type FRAME_ENCODING_ERROR. treated as a connection error of type FRAME_ENCODING_ERROR.
Context ID: A variable-length integer indicating the context ID of Context ID: A variable-length integer indicating the context ID of
the datagram (see Section 2.1). Whether or not this field is the datagram (see Section 2.1). Whether or not this field is
present depends on which registration capsules were exchanged on present depends on whether datagram contexts are in use on this
the associated stream: if a REGISTER_DATAGRAM_CONTEXT capsule (see stream, see Section 6. If this QUIC DATAGRAM frame is reordered
Section 4.4.1) has been sent or received on this stream, then the and arrives before the receiver knows whether datagram contexts
field is present; if a REGISTER_DATAGRAM_NO_CONTEXT capsule (see are in use on this stream, then the receiver cannot parse this
Section 4.4.2) has been sent or received, then this field is datagram and the receiver MUST either drop that datagram silently
absent; if neither has been sent or received, then it is not yet or buffer it temporarily.
possible to parse this datagram and the receiver MUST either drop
that datagram silently or buffer it temporarily while awaiting the
registration capsule.
HTTP Datagram Payload: The payload of the datagram, whose semantics HTTP Datagram Payload: The payload of the datagram, whose semantics
are defined by individual applications. Note that this field can are defined by individual applications. Note that this field can
be empty. be empty.
Intermediaries parse the Quarter Stream ID field in order to Intermediaries parse the Quarter Stream ID field in order to
associate the QUIC DATAGRAM frame with a stream. If an intermediary associate the QUIC DATAGRAM frame with a stream. If an intermediary
receives a QUIC DATAGRAM frame whose payload is too short to allow receives a QUIC DATAGRAM frame whose payload is too short to allow
parsing the Quarter Stream ID field, the intermediary MUST treat it parsing the Quarter Stream ID field, the intermediary MUST treat it
as an HTTP/3 connection error of type H3_GENERAL_PROTOCOL_ERROR. The as an HTTP/3 connection error of type H3_GENERAL_PROTOCOL_ERROR. The
Context ID field is optional and whether it is present or not is Context ID field is optional and whether it is present or not is
decided end-to-end by the client, see Section 4.4.2. Therefore decided end-to-end by the endpoints, see Section 6. Therefore
intermediaries cannot know whether the Context ID field is present or intermediaries cannot know whether the Context ID field is present or
absent and they MUST ignore any HTTP/3 Datagram fields after the absent and they MUST ignore any HTTP/3 Datagram fields after the
Quarter Stream ID. Quarter Stream ID.
Endpoints parse both the Quarter Stream ID field and the Context ID Endpoints parse both the Quarter Stream ID field and the Context ID
field in order to associate the QUIC DATAGRAM frame with a stream and field in order to associate the QUIC DATAGRAM frame with a stream and
context within that stream. If an endpoint receives a QUIC DATAGRAM context within that stream. If an endpoint receives a QUIC DATAGRAM
frame whose payload is too short to allow parsing the Quarter Stream frame whose payload is too short to allow parsing the Quarter Stream
ID field, the endpoint MUST treat it as an HTTP/3 connection error of ID field, the endpoint MUST treat it as an HTTP/3 connection error of
type H3_GENERAL_PROTOCOL_ERROR. If an endpoint receives a QUIC type H3_GENERAL_PROTOCOL_ERROR. If an endpoint receives a QUIC
skipping to change at page 9, line 45 skipping to change at page 9, line 45
intermediaries in participant mode: opaque capsules are forwarded intermediaries in participant mode: opaque capsules are forwarded
unmodified while transparent ones can be parsed, added, or removed by unmodified while transparent ones can be parsed, added, or removed by
intermediaries. Intermediaries MAY modify the contents of the intermediaries. Intermediaries MAY modify the contents of the
Capsule Data field of transparent capsule types. Capsule Data field of transparent capsule types.
Unless otherwise specified, all Capsule Types are defined as opaque Unless otherwise specified, all Capsule Types are defined as opaque
to intermediaries. Intermediaries MUST forward all received opaque to intermediaries. Intermediaries MUST forward all received opaque
CAPSULE frames in their unmodified entirety. Intermediaries MUST NOT CAPSULE frames in their unmodified entirety. Intermediaries MUST NOT
send any opaque CAPSULE frames other than the ones it is forwarding. send any opaque CAPSULE frames other than the ones it is forwarding.
All Capsule Types defined in this document are opaque, with the All Capsule Types defined in this document are opaque, with the
exception of the DATAGRAM Capsule, see Section 4.4.4. Definitions of exception of the datagram capsules, see Section 4.4.3. Definitions
new Capsule Types MAY specify that the newly introduced type is of new Capsule Types MAY specify that the newly introduced type is
transparent. Intermediaries MUST treat unknown Capsule Types as transparent. Intermediaries MUST treat unknown Capsule Types as
opaque. opaque.
Intermediaries respect the order of opaque CAPSULE frames: if an Intermediaries respect the order of opaque CAPSULE frames: if an
intermediary receives two opaque CAPSULE frames in a given order, it intermediary receives two opaque CAPSULE frames in a given order, it
MUST forward them in the same order. MUST forward them in the same order.
Endpoints which receive a Capsule with an unknown Capsule Type MUST Endpoints which receive a Capsule with an unknown Capsule Type MUST
silently drop that Capsule. silently drop that Capsule.
4.4. Capsule Types 4.4. Capsule Types
4.4.1. The REGISTER_DATAGRAM_CONTEXT Capsule 4.4.1. The Datagram Registration Capsules
The REGISTER_DATAGRAM_CONTEXT capsule (see Section 8.2 for the value This document defines the REGISTER_DATAGRAM and
of the capsule type) allows an endpoint to inform its peer of the REGISTER_DATAGRAM_CONTEXT capsules types, known collectively as the
encoding and semantics of datagrams associated with a given context datagram registration capsules (see Section 9.3 for the value of the
ID. capsule types). The REGISTER_DATAGRAM capsule is used by endpoints
to inform their peer of the encoding and semantics of all datagrams
associated with a stream. The REGISTER_DATAGRAM_CONTEXT capsule is
used by endpoints to inform their peer of the encoding and semantics
of all datagrams associated with a given context ID on this stream.
REGISTER_DATAGRAM_CONTEXT Capsule { Datagram Registration Capsule {
Type (i) = REGISTER_DATAGRAM_CONTEXT, Type (i) = REGISTER_DATAGRAM or REGISTER_DATAGRAM_CONTEXT,
Length (i), Length (i),
Context ID (i), [Context ID (i)],
Datagram Format Type (i), Datagram Format Type (i),
Datagram Format Additional Data (..), Datagram Format Additional Data (..),
} }
Figure 4: REGISTER_DATAGRAM_CONTEXT Capsule Format Figure 4: REGISTER_DATAGRAM_CONTEXT Capsule Format
Context ID: The context ID to register. Context ID: A variable-length integer indicating the context ID to
register (see Section 2.1). This field is present in
REGISTER_DATAGRAM_CONTEXT capsules but not in REGISTER_DATAGRAM
capsules. If a REGISTER_DATAGRAM capsule is used on a stream
where datagram contexts are in use, it is associated with context
ID 0. REGISTER_DATAGRAM_CONTEXT capsules MUST NOT carry context
ID 0 as that context ID is conveyed using the REGISTER_DATAGRAM
capsule.
Datagram Format Type: A variable-length integer that defines the Datagram Format Type: A variable-length integer that defines the
semantics and encoding of the HTTP Datagram Payload field of semantics and encoding of the HTTP Datagram Payload field of
datagrams with this context ID, see Section 2.2. datagrams with this context ID, see Section 2.2.
Datagram Format Additional Data: This field carries additional Datagram Format Additional Data: This field carries additional
information that impact the format of datagrams with this context information that impact the format of datagrams with this context
ID, see Section 2.2. ID, see Section 2.2.
Note that these registrations are unilateral and bidirectional: the Note that these registrations are unilateral and bidirectional: the
sender of the frame unilaterally defines the semantics it will apply sender of the capsule unilaterally defines the semantics it will
to the datagrams it sends and receives using this context ID. Once a apply to the datagrams it sends and receives using this context ID.
context ID is registered, it can be used in both directions. Once a context ID is registered, it can be used in both directions.
Endpoints MUST NOT send DATAGRAM frames using a Context ID until they Endpoints MUST NOT send HTTP Datagrams until they have either sent or
have either sent or received a REGISTER_DATAGRAM_CONTEXT Capsule with received a datagram registration capsule with the same Context ID.
the same Context ID. However, reordering can cause DATAGRAM frames However, reordering can cause HTTP Datagrams to be received with an
to be received with an unknown Context ID. Receipt of such frames unknown Context ID. Receipt of such HTTP datagrams MUST NOT be
MUST NOT be treated as an error. Endpoints SHALL drop the DATAGRAM treated as an error. Endpoints SHALL drop the HTTP Datagram
frame silently, or buffer it temporarily while awaiting the silently, or buffer it temporarily while awaiting the corresponding
corresponding REGISTER_DATAGRAM_CONTEXT Capsule. Intermediaries datagram registration capsule. Intermediaries SHALL drop the HTTP
SHALL drop the DATAGRAM frame silently, MAY buffer it, or forward it Datagram silently, MAY buffer it, or forward it on immediately.
on immediately.
Endpoints MUST NOT register the same Context ID twice on the same Endpoints MUST NOT register the same Context ID twice on the same
stream. This also applies to Context IDs that have been closed using stream. This also applies to Context IDs that have been closed using
a CLOSE_DATAGRAM_CONTEXT capsule. Clients MUST NOT register server- a CLOSE_DATAGRAM_CONTEXT capsule. Clients MUST NOT register server-
initiated Context IDs and servers MUST NOT register client-initiated initiated Context IDs and servers MUST NOT register client-initiated
Context IDs. If an endpoint receives a REGISTER_DATAGRAM_CONTEXT Context IDs. If an endpoint receives a REGISTER_DATAGRAM_CONTEXT
capsule that violates one or more of these requirements, the endpoint capsule that violates one or more of these requirements, the endpoint
MUST abruptly terminate the corresponding stream with a stream error MUST abruptly terminate the corresponding stream with a stream error
of type H3_GENERAL_PROTOCOL_ERROR. of type H3_GENERAL_PROTOCOL_ERROR.
Servers MUST NOT send a REGISTER_DATAGRAM_CONTEXT capsule on a stream If datagrams contexts are not in use, the client is responsible for
before they have received at least one REGISTER_DATAGRAM_CONTEXT choosing the datagram format and informing the server via a
capsule or one REGISTER_DATAGRAM_NO_CONTEXT capsule from the client REGISTER_DATAGRAM capsule. Servers MUST NOT send the
on that stream. This ensures that clients control whether datagrams REGISTER_DATAGRAM capsule. If a client receives a REGISTER_DATAGRAM
are allowed for a given request. If a client receives a capsule, the client MUST abruptly terminate the corresponding stream
REGISTER_DATAGRAM_CONTEXT capsule on a stream where the client has with a stream error of type H3_GENERAL_PROTOCOL_ERROR.
not yet sent a REGISTER_DATAGRAM_CONTEXT capsule, the client MUST
abruptly terminate the corresponding stream with a stream error of
type H3_GENERAL_PROTOCOL_ERROR.
Servers MUST NOT send a REGISTER_DATAGRAM_CONTEXT capsule on a stream
where it has received a REGISTER_DATAGRAM_NO_CONTEXT capsule. If a
client receives a REGISTER_DATAGRAM_CONTEXT capsule on a stream where
the client has sent a REGISTER_DATAGRAM_NO_CONTEXT capsule, the
client MUST abruptly terminate the corresponding stream with a stream
error of type H3_GENERAL_PROTOCOL_ERROR.
4.4.2. The REGISTER_DATAGRAM_NO_CONTEXT Capsule
The REGISTER_DATAGRAM_NO_CONTEXT capsule (see Section 8.2 for the
value of the capsule type) allows a client to inform the server that
datagram contexts will not be used with this stream. It also informs
the server of the encoding and semantics of datagrams associated with
this stream.
REGISTER_DATAGRAM_NO_CONTEXT Capsule {
Type (i) = REGISTER_DATAGRAM_NO_CONTEXT,
Length (i),
Datagram Format Type (i),
Datagram Format Additional Data (..),
}
Figure 5: REGISTER_DATAGRAM_NO_CONTEXT Capsule Format
Datagram Format Type: A variable-length integer that defines the
semantics and encoding of the HTTP Datagram Payload field of
datagrams, see Section 2.2.
Datagram Format Additional Data: This field carries additional
information that impact the format of datagrams, see Section 2.2.
Note that this registration is unilateral and bidirectional: the
client unilaterally defines the semantics it will apply to the
datagrams it sends and receives with this stream.
Endpoints MUST NOT send DATAGRAM frames without a Context ID until
they have either sent or received a REGISTER_DATAGRAM_NO_CONTEXT
Capsule. However, due to reordering, an endpoint that receives a
DATAGRAM frame before receiving either a REGISTER_DATAGRAM_CONTEXT
capsule or a REGISTER_DATAGRAM_NO_CONTEXT capsule MUST NOT treat it
as an error, it SHALL instead drop the DATAGRAM frame silently, or
buffer it temporarily while awaiting a REGISTER_DATAGRAM_NO_CONTEXT
capsule or the corresponding REGISTER_DATAGRAM_CONTEXT capsule.
Servers MUST NOT send the REGISTER_DATAGRAM_NO_CONTEXT capsule. If a
client receives a REGISTER_DATAGRAM_NO_CONTEXT capsule, the client
MUST abruptly terminate the corresponding stream with a stream error
of type H3_GENERAL_PROTOCOL_ERROR.
Clients MUST NOT send more than one REGISTER_DATAGRAM_NO_CONTEXT
capsule on a stream. If a server receives a second
REGISTER_DATAGRAM_NO_CONTEXT capsule on the same stream, the server
MUST abruptly terminate the corresponding stream with a stream error
of type H3_GENERAL_PROTOCOL_ERROR.
Clients MUST NOT send both REGISTER_DATAGRAM_CONTEXT capsules and
REGISTER_DATAGRAM_NO_CONTEXT capsules on the same stream. If a
server receives both a REGISTER_DATAGRAM_CONTEXT capsule and a
REGISTER_DATAGRAM_NO_CONTEXT capsule on the same stream, the server
MUST abruptly terminate the corresponding stream with a stream error
of type H3_GENERAL_PROTOCOL_ERROR.
Extensions MAY define a different mechanism to communicate whether
contexts are in use, and they MAY do so in a way which is opaque to
intermediaries.
4.4.3. The CLOSE_DATAGRAM_CONTEXT Capsule 4.4.2. The Datagram Close Capsule
The CLOSE_DATAGRAM_CONTEXT capsule (see Section 8.2 for the value of The CLOSE_DATAGRAM_CONTEXT capsule (see Section 9.3 for the value of
the capsule type) allows an endpoint to inform its peer that it will the capsule type) allows an endpoint to inform its peer that it will
no longer send or parse received datagrams associated with a given no longer send or parse received datagrams associated with a given
context ID. context ID.
CLOSE_DATAGRAM_CONTEXT Capsule { CLOSE_DATAGRAM_CONTEXT Capsule {
Type (i) = CLOSE_DATAGRAM_CONTEXT, Type (i) = CLOSE_DATAGRAM_CONTEXT,
Length (i), Length (i),
Context ID (i), Context ID (i),
Close Code (i), Close Code (i),
Close Details (..), Close Details (..),
} }
Figure 6: CLOSE_DATAGRAM_CONTEXT Capsule Format Figure 5: CLOSE_DATAGRAM_CONTEXT Capsule Format
Context ID: The context ID to close. Context ID: The context ID to close.
Close Code: The close code allows an endpoint to provide additional Close Code: The close code allows an endpoint to provide additional
information as to why a datagram context was closed. information as to why a datagram context was closed.
Section 4.4.3.1 defines a set of codes, the circumstances under Section 4.4.2.1 defines a set of codes, the circumstances under
which an implementation sends them, and how receivers react. which an implementation sends them, and how receivers react.
Close Details: This is meant for debugging purposes. It consists of Close Details: This is meant for debugging purposes. It consists of
a human-readable string encoded in UTF-8. a human-readable string encoded in UTF-8.
Note that this close is unilateral and bidirectional: the sender of Note that this close is unilateral and bidirectional: the sender of
the frame unilaterally informs its peer of the closure. Endpoints the frame unilaterally informs its peer of the closure. Endpoints
can use CLOSE_DATAGRAM_CONTEXT capsules to close a context that was can use CLOSE_DATAGRAM_CONTEXT capsules to close a context that was
initially registered by either themselves, or by their peer. initially registered by either themselves, or by their peer.
Endpoints MAY use the CLOSE_DATAGRAM_CONTEXT capsule to immediately Endpoints MAY use the CLOSE_DATAGRAM_CONTEXT capsule to immediately
reject a context that was just registered using a reject a context that was just registered using a
REGISTER_DATAGRAM_CONTEXT capsule if they find its Datagram Format REGISTER_DATAGRAM_CONTEXT capsule if they find its Datagram Format
Type field to be unacceptable. Type field to be unacceptable.
After an endpoint has either sent or received a After an endpoint has either sent or received a
CLOSE_DATAGRAM_CONTEXT frame, it MUST NOT send any DATAGRAM frames CLOSE_DATAGRAM_CONTEXT frame, it MUST NOT send any HTTP Datagrams
with that Context ID. However, due to reordering, an endpoint that with that Context ID. However, due to reordering, an endpoint that
receives a DATAGRAM frame with a closed Context ID MUST NOT treat it receives an HTTP Datagram with a closed Context ID MUST NOT treat it
as an error, it SHALL instead drop the DATAGRAM frame silently. as an error, it SHALL instead drop the HTTP Datagram silently.
Endpoints MUST NOT close a Context ID that was not previously Endpoints MUST NOT close a Context ID that was not previously
registered. Endpoints MUST NOT close a Context ID that has already registered. Endpoints MUST NOT close a Context ID that has already
been closed. If an endpoint receives a CLOSE_DATAGRAM_CONTEXT been closed. If an endpoint receives a CLOSE_DATAGRAM_CONTEXT
capsule that violates one or more of these requirements, the endpoint capsule that violates one or more of these requirements, the endpoint
MUST abruptly terminate the corresponding stream with a stream error MUST abruptly terminate the corresponding stream with a stream error
of type H3_GENERAL_PROTOCOL_ERROR. of type H3_GENERAL_PROTOCOL_ERROR.
4.4.3.1. Close Codes 4.4.2.1. Close Codes
Close codes are intended to allow implementations to react Close codes are intended to allow implementations to react
differently when they receive them - for example, some close codes differently when they receive them - for example, some close codes
require the receiver to not open another context under certain require the receiver to not open another context under certain
conditions. conditions.
This specification defines the close codes below. Their numeric This specification defines the close codes below. Their numeric
values are in Section 8.4. Extensions to this mechanism MAY define values are in Section 9.5. Extensions to this mechanism MAY define
new close codes and they SHOULD state how receivers react to them. new close codes and they SHOULD state how receivers react to them.
NO_ERROR: This indicates that a context was closed without any NO_ERROR: This indicates that a context was closed without any
action specified for the receiver. action specified for the receiver.
UNKNOWN_FORMAT: This indicates that the sender does not know how to UNKNOWN_FORMAT: This indicates that the sender does not know how to
interpret the datagram format type associated with this context. interpret the datagram format type associated with this context.
The endpoint that had originally registered this context MUST NOT The endpoint that had originally registered this context MUST NOT
try to register another context with the same datagram format type try to register another context with the same datagram format type
on this stream. on this stream.
skipping to change at page 14, line 30 skipping to change at page 13, line 15
originally registered this context MUST NOT try to register originally registered this context MUST NOT try to register
another context with the same datagram format type and datagram another context with the same datagram format type and datagram
format data on this stream. format data on this stream.
RESOURCE_LIMIT: This indicates that the context was closed to save RESOURCE_LIMIT: This indicates that the context was closed to save
resources. The recipient SHOULD limit its future registration of resources. The recipient SHOULD limit its future registration of
resource-intensive contexts. resource-intensive contexts.
Receipt of an unknown close code MUST be treated as if the NO_ERROR Receipt of an unknown close code MUST be treated as if the NO_ERROR
code was present. Close codes are registered with IANA, see code was present. Close codes are registered with IANA, see
Section 8.4. Section 9.5.
4.4.4. The DATAGRAM Capsule 4.4.3. The Datagram Capsules
The DATAGRAM capsule (see Section 8.2 for the value of the capsule This document defines the DATAGRAM and DATAGRAM_WITH_CONTEXT capsules
type) allows an endpoint to send a datagram frame over an HTTP types, known collectively as the datagram capsules (see Section 9.3
stream. This is particularly useful when using a version of HTTP for the value of the capsule types). These capsules allow an
that does not support QUIC DATAGRAM frames. endpoint to send a datagram frame over an HTTP stream. This is
particularly useful when using a version of HTTP that does not
support QUIC DATAGRAM frames.
DATAGRAM Capsule { Datagram Capsule {
Type (i) = DATAGRAM, Type (i) = DATAGRAM or DATAGRAM_WITH_CONTEXT,
Length (i), Length (i),
[Context ID (i)], [Context ID (i)],
HTTP Datagram Payload (..), HTTP Datagram Payload (..),
} }
Figure 7: DATAGRAM Capsule Format Figure 6: DATAGRAM Capsule Format
Context ID: A variable-length integer indicating the context ID of Context ID: A variable-length integer indicating the context ID of
the datagram (see Section 2.1). Whether or not this field is the datagram (see Section 2.1). This field is present in
present depends on which registration capsules were exchanged on DATAGRAM_WITH_CONTEXT capsules but not in DATAGRAM capsules. If a
the associated stream: if a REGISTER_DATAGRAM_CONTEXT capsule (see DATAGRAM capsule is used on a stream where datagram contexts are
Section 4.4.1) has been sent or received on this stream, then the in use, it is associated with context ID 0. DATAGRAM_WITH_CONTEXT
field is present; if a REGISTER_DATAGRAM_NO_CONTEXT capsule (see capsules MUST NOT carry context ID 0 as that context ID is
Section 4.4.2) has been sent or received, then this field is conveyed using the DATAGRAM capsule.
absent; if neither has been sent or received, then it is not yet
possible to parse this datagram and the receiver MUST either drop
that datagram silently or buffer it temporarily while awaiting the
registration capsule.
HTTP Datagram Payload: The payload of the datagram, whose semantics HTTP Datagram Payload: The payload of the datagram, whose semantics
are defined by individual applications. Note that this field can are defined by individual applications. Note that this field can
be empty. be empty.
Datagrams sent using the DATAGRAM Capsule have the exact same Datagrams sent using the datagram capsule have the exact same
semantics as datagrams sent in QUIC DATAGRAM frames. In particular, semantics as datagrams sent in QUIC DATAGRAM frames. In particular,
the restrictions on when it is allowed to send an HTTP Datagram and the restrictions on when it is allowed to send an HTTP Datagram and
how to process them from Section 3 also apply to HTTP Datagrams sent how to process them from Section 3 also apply to HTTP Datagrams sent
and received using the DATAGRAM capsule. and received using the datagram capsules.
The DATAGRAM Capsule is transparent to intermediaries, meaning that The datagram capsules are transparent to intermediaries, meaning that
intermediaries MAY parse it and send DATAGRAM Capsules that they did intermediaries MAY parse them and send datagram capsules that they
not receive. This allows an intermediary to reencode HTTP Datagrams did not receive. This allows an intermediary to reencode HTTP
as it forwards them: in other words, an intermediary MAY send a Datagrams as it forwards them: in other words, an intermediary MAY
DATAGRAM Capsule to forward an HTTP Datagram which was received in a send a datagram capsule to forward an HTTP Datagram which was
QUIC DATAGRAM frame, and vice versa. received in a QUIC DATAGRAM frame, and vice versa.
Note that while DATAGRAM capsules are sent on a stream, Note that while datagram capsules are sent on a stream,
intermediaries can reencode HTTP Datagrams into QUIC DATAGRAM frames intermediaries can reencode HTTP Datagrams into QUIC DATAGRAM frames
over the next hop, and those could be dropped. Because of this, over the next hop, and those could be dropped. Because of this,
applications have to always consider HTTP Datagrams to be unreliable, applications have to always consider HTTP Datagrams to be unreliable,
even if they were initially sent in a capsule. even if they were initially sent in a capsule.
If an intermediary receives an HTTP Datagram in a QUIC DATAGRAM frame If an intermediary receives an HTTP Datagram in a QUIC DATAGRAM frame
and is forwarding it on a connection that supports QUIC DATAGRAM and is forwarding it on a connection that supports QUIC DATAGRAM
frames, the intermediary SHOULD NOT convert that HTTP Datagram to a frames, the intermediary SHOULD NOT convert that HTTP Datagram to a
DATAGRAM capsule. If the HTTP Datagram is too large to fit in a DATAGRAM capsule. If the HTTP Datagram is too large to fit in a
DATAGRAM frame (for example because the path MTU of that QUIC DATAGRAM frame (for example because the path MTU of that QUIC
connection is too low or if the maximum UDP payload size advertised connection is too low or if the maximum UDP payload size advertised
on that connection is too low), the intermediary SHOULD drop the HTTP on that connection is too low), the intermediary SHOULD drop the HTTP
Datagram instead of converting it to a DATAGRAM capsule. This Datagram instead of converting it to a DATAGRAM capsule. This
preserves the end-to-end unreliability characteristic that methods preserves the end-to-end unreliability characteristic that methods
such as Datagram Packetization Layer Path MTU Discovery (DPLPMTUD) such as Datagram Packetization Layer Path MTU Discovery (DPLPMTUD)
depend on [RFC8899]. An intermediary that converts QUIC DATAGRAM depend on [RFC8899]. An intermediary that converts QUIC DATAGRAM
frames to DATAGRAM capsules allows HTTP Datagrams to be arbitrarily frames to datagram capsules allows HTTP Datagrams to be arbitrarily
large without suffering any loss; this can misrepresent the true path large without suffering any loss; this can misrepresent the true path
properties, defeating methods such a DPLPMTUD. properties, defeating methods such a DPLPMTUD.
5. The H3_DATAGRAM HTTP/3 SETTINGS Parameter 5. The H3_DATAGRAM HTTP/3 SETTINGS Parameter
Implementations of HTTP/3 that support HTTP Datagrams can indicate Implementations of HTTP/3 that support HTTP Datagrams can indicate
that to their peer by sending the H3_DATAGRAM SETTINGS parameter with that to their peer by sending the H3_DATAGRAM SETTINGS parameter with
a value of 1. The value of the H3_DATAGRAM SETTINGS parameter MUST a value of 1. The value of the H3_DATAGRAM SETTINGS parameter MUST
be either 0 or 1. A value of 0 indicates that HTTP Datagrams are not be either 0 or 1. A value of 0 indicates that HTTP Datagrams are not
supported. An endpoint that receives the H3_DATAGRAM SETTINGS supported. An endpoint that receives the H3_DATAGRAM SETTINGS
skipping to change at page 16, line 47 skipping to change at page 15, line 26
Identifier field of a Setting in the HTTP/3 SETTINGS frame) for the Identifier field of a Setting in the HTTP/3 SETTINGS frame) for the
H3_DATAGRAM Settings Parameter. This allows new draft revisions to H3_DATAGRAM Settings Parameter. This allows new draft revisions to
make incompatible changes. Multiple draft versions MAY be supported make incompatible changes. Multiple draft versions MAY be supported
by either endpoint in a connection. Such endpoints MUST send by either endpoint in a connection. Such endpoints MUST send
multiple values for H3_DATAGRAM. Once an endpoint has sent and multiple values for H3_DATAGRAM. Once an endpoint has sent and
received SETTINGS, it MUST compute the intersection of the values it received SETTINGS, it MUST compute the intersection of the values it
has sent and received, and then it MUST select and use the most has sent and received, and then it MUST select and use the most
recent draft version from the intersection set. This ensures that recent draft version from the intersection set. This ensures that
both endpoints negotiate the same draft version. both endpoints negotiate the same draft version.
6. Prioritization 6. The Sec-Use-Datagram-Contexts HTTP Header
Endpoints indicate their support for datagram contexts by sending the
Sec-Use-Datagram-Contexts header with a value of ?1. If the header
is missing or has a value different from ?1, that indicates that its
sender does not wish to use datagram contexts. Endpoints that wish
to use datagram contexts SHALL send the Sec-Use-Datagram-Contexts
header with a value of ?1 on requests and responses that use the
capsule protocol.
"Sec-Use-Datagram-Contexts" is an Item Structured Header [RFC8941].
Its value MUST be a Boolean, its ABNF is:
Sec-Use-Datagram-Contexts = sf-boolean
The REGISTER_DATAGRAM_CONTEXT, DATAGRAM_WITH_CONTEXT, and
CLOSE_DATAGRAM_CONTEXT capsules as refered to as context-related
capsules. Endpoints which do not wish to use contexts MUST NOT send
context-related capsules, and MUST silently ignore any received
context-related capsules.
Both endpoints unilaterally decide whether they wish to use datagram
contexts on a given stream. Contexts are used on a given stream if
and only if both endpoints indicate they wish to use them on this
stream. Once an endpoint has received the HTTP request or response,
it knows whether datagram contexts are in use on this stream or not.
Conceptually, when datagram contexts are not in use on a stream, all
datagrams use context ID 0, which is client-initiated. This means
that the client chooses the datagram format for all datagrams when
datagram contexts are not in use.
If datagram contexts are not in use on a stream, endpoints MUST NOT
send context-related capsules to the peer on that stream. Clients
MAY optimistically send context-related capsules before learning
whether the server wishes to support datagram contexts or not.
This allows a client to optimistically use extensions that rely on
datagram contexts without knowing a priori whether the server
supports them, and without incurring a latency cost to negotiate
extension support. In this scenario, the client would send its
request with the Sec-Use-Datagram-Contexts header set to ?1, and
register two datagram contexts: the main context would use context ID
0 and the extension context would use context ID 2. The client then
sends a REGISTER_DATAGRAM capsule to register the main context, and a
REGISTER_DATAGRAM_CONTEXT to register the extension context. The
client can then immediately send DATAGRAM capsules to send main
datagrams and DATAGRAM_WITH_CONTEXT capsules to send extension
datagrams.
* If the server wishes to use datagram contexts, it will set Sec-
Use-Datagram-Contexts to ?1 on its response and correctly parse
all the received capsules.
* If the server does not wish to use datagram contexts (for example
if the server implementation does not support them), it will not
set Sec-Use-Datagram-Contexts to ?1 on its response. It will then
parse the REGISTER_DATAGRAM and DATAGRAM capsules without datagram
contexts being in use on this stream, and parse the main datagrams
correctly while silently dropping the extension datagrams. Once
the client receives the server's response, it will know datagram
contexts are not in use, and then will be able to send HTTP
Datagrams via the QUIC DATAGRAM frame.
Extensions MAY define a different mechanism to communicate whether
contexts are in use, and they MAY do so in a way which is opaque to
intermediaries.
7. Prioritization
Data streams (see Section 4.1) can be prioritized using any means Data streams (see Section 4.1) can be prioritized using any means
suited to stream or request prioritization. For example, see suited to stream or request prioritization. For example, see
Section 11 of [PRIORITY]. Section 11 of [PRIORITY].
Prioritization of HTTP/3 datagrams is not defined in this document. Prioritization of HTTP/3 datagrams is not defined in this document.
Future extensions MAY define how to prioritize datagrams, and MAY Future extensions MAY define how to prioritize datagrams, and MAY
define signaling to allow endpoints to communicate their define signaling to allow endpoints to communicate their
prioritization preferences. prioritization preferences.
7. Security Considerations 8. Security Considerations
Since this feature requires sending an HTTP/3 Settings parameter, it Since this feature requires sending an HTTP/3 Settings parameter, it
"sticks out". In other words, probing clients can learn whether a "sticks out". In other words, probing clients can learn whether a
server supports this feature. Implementations that support this server supports this feature. Implementations that support this
feature SHOULD always send this Settings parameter to avoid leaking feature SHOULD always send this Settings parameter to avoid leaking
the fact that there are applications using HTTP/3 datagrams enabled the fact that there are applications using HTTP/3 datagrams enabled
on this endpoint. on this endpoint.
8. IANA Considerations 9. IANA Considerations
8.1. HTTP/3 SETTINGS Parameter 9.1. HTTP/3 SETTINGS Parameter
This document will request IANA to register the following entry in This document will request IANA to register the following entry in
the "HTTP/3 Settings" registry: the "HTTP/3 Settings" registry:
+==============+==========+===============+=========+ +==============+==========+===============+=========+
| Setting Name | Value | Specification | Default | | Setting Name | Value | Specification | Default |
+==============+==========+===============+=========+ +==============+==========+===============+=========+
| H3_DATAGRAM | 0xffd277 | This Document | 0 | | H3_DATAGRAM | 0xffd277 | This Document | 0 |
+--------------+----------+---------------+---------+ +--------------+----------+---------------+---------+
Table 1: New HTTP/3 Settings Table 1: New HTTP/3 Settings
8.2. Capsule Types 9.2. HTTP Header Field Name
This document will request IANA to register the following entry in
the "HTTP Field Name" registry:
Field Name: Sec-Use-Datagram-Contexts
Template: None
Status: provisional (permanent if this document is approved)
Reference: This document
Comments: None
9.3. Capsule Types
This document establishes a registry for HTTP capsule type codes. This document establishes a registry for HTTP capsule type codes.
The "HTTP Capsule Types" registry governs a 62-bit space. The "HTTP Capsule Types" registry governs a 62-bit space.
Registrations in this registry MUST include the following fields: Registrations in this registry MUST include the following fields:
Type: A name or label for the capsule type. Type: A name or label for the capsule type.
Value: The value of the Capsule Type field (see Section 4.1) is a Value: The value of the Capsule Type field (see Section 4.1) is a
62-bit integer. 62-bit integer.
Reference: An optional reference to a specification for the type. Reference: An optional reference to a specification for the type.
This field MAY be empty. This field MAY be empty.
Registrations follow the "First Come First Served" policy (see Registrations follow the "First Come First Served" policy (see
Section 4.4 of [IANA-POLICY]) where two registrations MUST NOT have Section 4.4 of [IANA-POLICY]) where two registrations MUST NOT have
the same Type. the same Type.
This registry initially contains the following entries: This registry initially contains the following entries:
+==============================+==========+===============+ +===========================+==========+===============+
| Capsule Type | Value | Specification | | Capsule Type | Value | Specification |
+==============================+==========+===============+ +===========================+==========+===============+
| DATAGRAM | 0xff37a0 | This Document | | REGISTER_DATAGRAM_CONTEXT | 0xff37a1 | This Document |
+------------------------------+----------+---------------+ +---------------------------+----------+---------------+
| REGISTER_DATAGRAM_CONTEXT | 0xff37a1 | This Document | | REGISTER_DATAGRAM | 0xff37a2 | This Document |
+------------------------------+----------+---------------+ +---------------------------+----------+---------------+
| REGISTER_DATAGRAM_NO_CONTEXT | 0xff37a2 | This Document | | CLOSE_DATAGRAM_CONTEXT | 0xff37a3 | This Document |
+------------------------------+----------+---------------+ +---------------------------+----------+---------------+
| CLOSE_DATAGRAM_CONTEXT | 0xff37a3 | This Document | | DATAGRAM_WITH_CONTEXT | 0xff37a4 | This Document |
+------------------------------+----------+---------------+ +---------------------------+----------+---------------+
| DATAGRAM | 0xff37a5 | This Document |
+---------------------------+----------+---------------+
Table 2: Initial Capsule Types Registry Entries Table 2: Initial Capsule Types Registry Entries
Capsule types with a value of the form 41 * N + 23 for integer values Capsule types with a value of the form 41 * N + 23 for integer values
of N are reserved to exercise the requirement that unknown capsule of N are reserved to exercise the requirement that unknown capsule
types be ignored. These capsules have no semantics and can carry types be ignored. These capsules have no semantics and can carry
arbitrary values. These values MUST NOT be assigned by IANA and MUST arbitrary values. These values MUST NOT be assigned by IANA and MUST
NOT appear in the listing of assigned values. NOT appear in the listing of assigned values.
8.3. Datagram Format Types 9.4. Datagram Format Types
This document establishes a registry for HTTP datagram format type This document establishes a registry for HTTP datagram format type
codes. The "HTTP Datagram Format Types" registry governs a 62-bit codes. The "HTTP Datagram Format Types" registry governs a 62-bit
space. Registrations in this registry MUST include the following space. Registrations in this registry MUST include the following
fields: fields:
Type: A name or label for the datagram format type. Type: A name or label for the datagram format type.
Value: The value of the Datagram Format Type field (see Section 2.2) Value: The value of the Datagram Format Type field (see Section 2.2)
is a 62-bit integer. is a 62-bit integer.
skipping to change at page 19, line 5 skipping to change at page 19, line 26
This registry is initially empty. This registry is initially empty.
Datagram format types with a value of the form 41 * N + 17 for Datagram format types with a value of the form 41 * N + 17 for
integer values of N are reserved to exercise the requirement that integer values of N are reserved to exercise the requirement that
unknown datagram format types be ignored. These format types have no unknown datagram format types be ignored. These format types have no
semantics and can carry arbitrary values. These values MUST NOT be semantics and can carry arbitrary values. These values MUST NOT be
assigned by IANA and MUST NOT appear in the listing of assigned assigned by IANA and MUST NOT appear in the listing of assigned
values. values.
8.4. Context Close Codes 9.5. Context Close Codes
This document establishes a registry for HTTP context close codes. This document establishes a registry for HTTP context close codes.
The "HTTP Context Close Codes" registry governs a 62-bit space. The "HTTP Context Close Codes" registry governs a 62-bit space.
Registrations in this registry MUST include the following fields: Registrations in this registry MUST include the following fields:
Type: A name or label for the close code. Type: A name or label for the close code.
Value: The value of the Close Code field (see Section 4.4.3) is a Value: The value of the Close Code field (see Section 4.4.2) is a
62-bit integer. 62-bit integer.
Reference: An optional reference to a specification for the Reference: An optional reference to a specification for the
parameter. This field MAY be empty. parameter. This field MAY be empty.
Registrations follow the "First Come First Served" policy (see Registrations follow the "First Come First Served" policy (see
Section 4.4 of [IANA-POLICY]) where two registrations MUST NOT have Section 4.4 of [IANA-POLICY]) where two registrations MUST NOT have
the same Type nor Value. the same Type nor Value.
This registry initially contains the following entries: This registry initially contains the following entries:
skipping to change at page 19, line 46 skipping to change at page 20, line 26
Table 3: Initial Context Close Code Registry Table 3: Initial Context Close Code Registry
Entries Entries
Context close codes with a value of the form 41 * N + 19 for integer Context close codes with a value of the form 41 * N + 19 for integer
values of N are reserved to exercise the requirement that unknown values of N are reserved to exercise the requirement that unknown
context close codes be treated as NO_ERROR. These values MUST NOT be context close codes be treated as NO_ERROR. These values MUST NOT be
assigned by IANA and MUST NOT appear in the listing of assigned assigned by IANA and MUST NOT appear in the listing of assigned
values. values.
9. References 10. References
9.1. Normative References 10.1. Normative References
[DGRAM] Pauly, T., Kinnear, E., and D. Schinazi, "An Unreliable [DGRAM] Pauly, T., Kinnear, E., and D. Schinazi, "An Unreliable
Datagram Extension to QUIC", Work in Progress, Internet- Datagram Extension to QUIC", Work in Progress, Internet-
Draft, draft-ietf-quic-datagram-06, 5 October 2021, Draft, draft-ietf-quic-datagram-06, 5 October 2021,
<https://datatracker.ietf.org/doc/html/draft-ietf-quic- <https://datatracker.ietf.org/doc/html/draft-ietf-quic-
datagram-06>. datagram-06>.
[H3] Bishop, M., "Hypertext Transfer Protocol Version 3 [H3] Bishop, M., "Hypertext Transfer Protocol Version 3
(HTTP/3)", Work in Progress, Internet-Draft, draft-ietf- (HTTP/3)", Work in Progress, Internet-Draft, draft-ietf-
quic-http-34, 2 February 2021, quic-http-34, 2 February 2021,
skipping to change at page 20, line 37 skipping to change at page 21, line 14
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/rfc/rfc2119>. <https://www.rfc-editor.org/rfc/rfc2119>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/rfc/rfc8174>. May 2017, <https://www.rfc-editor.org/rfc/rfc8174>.
9.2. Informative References [RFC8941] Nottingham, M. and P-H. Kamp, "Structured Field Values for
HTTP", RFC 8941, DOI 10.17487/RFC8941, February 2021,
<https://www.rfc-editor.org/rfc/rfc8941>.
10.2. Informative References
[PRIORITY] Oku, K. and L. Pardue, "Extensible Prioritization Scheme [PRIORITY] Oku, K. and L. Pardue, "Extensible Prioritization Scheme
for HTTP", Work in Progress, Internet-Draft, draft-ietf- for HTTP", Work in Progress, Internet-Draft, draft-ietf-
httpbis-priority-06, 30 September 2021, httpbis-priority-07, 25 October 2021,
<https://datatracker.ietf.org/doc/html/draft-ietf-httpbis- <https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-
priority-06>. priority-07>.
[RFC8899] Fairhurst, G., Jones, T., Tüxen, M., Rüngeler, I., and T. [RFC8899] Fairhurst, G., Jones, T., Tüxen, M., Rüngeler, I., and T.
Völker, "Packetization Layer Path MTU Discovery for Völker, "Packetization Layer Path MTU Discovery for
Datagram Transports", RFC 8899, DOI 10.17487/RFC8899, Datagram Transports", RFC 8899, DOI 10.17487/RFC8899,
September 2020, <https://www.rfc-editor.org/rfc/rfc8899>. September 2020, <https://www.rfc-editor.org/rfc/rfc8899>.
Appendix A. Examples Appendix A. Examples
A.1. CONNECT-UDP A.1. CONNECT-UDP
In this example, the client does not support any CONNECT-UDP nor HTTP
Datagram extensions, and therefore has no use for datagram contexts
on this stream.
Client Server Client Server
STREAM(44): HEADERS --------> STREAM(44): HEADERS -------->
:method = CONNECT-UDP :method = CONNECT
:protocol = connect-udp
:scheme = https :scheme = https
:path = / :path = /target.example.org/443/
:authority = target.example.org:443 :authority = proxy.example.org:443
STREAM(44): DATA --------> STREAM(44): DATA -------->
Capsule Type = REGISTER_DATAGRAM_CONTEXT Capsule Type = REGISTER_DATAGRAM
Context ID = 0
Datagram Format Type = UDP_PAYLOAD Datagram Format Type = UDP_PAYLOAD
Datagram Format Additional Data = "" Datagram Format Additional Data = ""
DATAGRAM --------> DATAGRAM -------->
Quarter Stream ID = 11 Quarter Stream ID = 11
Context ID = 0
Payload = Encapsulated UDP Payload Payload = Encapsulated UDP Payload
<-------- STREAM(44): HEADERS <-------- STREAM(44): HEADERS
:status = 200 :status = 200
/* Wait for target server to respond to UDP packet. */ /* Wait for target server to respond to UDP packet. */
<-------- DATAGRAM <-------- DATAGRAM
Quarter Stream ID = 11 Quarter Stream ID = 11
Context ID = 0
Payload = Encapsulated UDP Payload Payload = Encapsulated UDP Payload
A.2. CONNECT-UDP with Timestamp Extension A.2. CONNECT-UDP with Delayed Timestamp Extension
In these examples, the client supports a CONNECT-UDP Timestamp
Extension, which uses a different Datagram Format Type that carries a
timestamp followed by the encapsulated UDP payload.
A.2.1. With Delay
In this instance, the client prefers to wait a round trip to learn
whether the server supports datagram contexts.
Client Server Client Server
STREAM(44): HEADERS --------> STREAM(44): HEADERS -------->
:method = CONNECT-UDP :method = CONNECT
:protocol = connect-udp
:scheme = https :scheme = https
:path = / :path = /target.example.org/443/
:authority = target.example.org:443 :authority = proxy.example.org:443
Sec-Use-Datagram-Contexts = ?1
<-------- STREAM(44): HEADERS
:status = 200
Sec-Use-Datagram-Contexts = ?1
STREAM(44): DATA --------> STREAM(44): DATA -------->
Capsule Type = REGISTER_DATAGRAM_CONTEXT Capsule Type = REGISTER_DATAGRAM_CONTEXT
Context ID = 0 Context ID = 0
Datagram Format Type = UDP_PAYLOAD Datagram Format Type = UDP_PAYLOAD
Datagram Format Additional Data = "" Datagram Format Additional Data = ""
DATAGRAM --------> DATAGRAM -------->
Quarter Stream ID = 11 Quarter Stream ID = 11
Context ID = 0 Context ID = 0
Payload = Encapsulated UDP Payload Payload = Encapsulated UDP Payload
<-------- DATAGRAM
Quarter Stream ID = 11
Context ID = 0
Payload = Encapsulated UDP Payload
STREAM(44): DATA -------->
Capsule Type = REGISTER_DATAGRAM_CONTEXT
Context ID = 2
Datagram Format Type = UDP_PAYLOAD_WITH_TIMESTAMP
Datagram Format Additional Data = ""
DATAGRAM -------->
Quarter Stream ID = 11
Context ID = 2
Payload = Encapsulated UDP Payload With Timestamp
A.3. Successful Optimistic
In this instance, the client does not wish to spend a round trip
waiting to learn whether the server supports datagram contexts. It
registers its context optimistically in such a way that the server
will react well whether it supports contexts or not. In this case,
the server does support datagram contexts.
Client Server
STREAM(44): HEADERS -------->
:method = CONNECT
:protocol = connect-udp
:scheme = https
:path = /target.example.org/443/
:authority = proxy.example.org:443
Sec-Use-Datagram-Contexts = ?1
STREAM(44): DATA -------->
Capsule Type = REGISTER_DATAGRAM
Datagram Format Type = UDP_PAYLOAD
Datagram Format Additional Data = ""
STREAM(44): DATA -------->
Capsule Type = DATAGRAM
Payload = Encapsulated UDP Payload
<-------- STREAM(44): HEADERS <-------- STREAM(44): HEADERS
:status = 200 :status = 200
Sec-Use-Datagram-Contexts = ?1
/* Wait for target server to respond to UDP packet. */ /* Datagram contexts are in use on this stream */
<-------- DATAGRAM <-------- DATAGRAM
Quarter Stream ID = 11 Quarter Stream ID = 11
Context ID = 0 Context ID = 0
Payload = Encapsulated UDP Payload Payload = Encapsulated UDP Payload
STREAM(44): DATA --------> STREAM(44): DATA -------->
Capsule Type = REGISTER_DATAGRAM_CONTEXT Capsule Type = REGISTER_DATAGRAM_CONTEXT
Context ID = 2 Context ID = 2
Datagram Format Type = UDP_PAYLOAD_WITH_TIMESTAMP Datagram Format Type = UDP_PAYLOAD_WITH_TIMESTAMP
Datagram Format Additional Data = "" Datagram Format Additional Data = ""
DATAGRAM --------> DATAGRAM -------->
Quarter Stream ID = 11 Quarter Stream ID = 11
Context ID = 2 Context ID = 2
Payload = Encapsulated UDP Payload With Timestamp Payload = Encapsulated UDP Payload With Timestamp
A.3. CONNECT-IP with IP compression A.4. Optimistic but Unsupported
In this instance, the client does not wish to spend a round trip
waiting to learn whether the server supports datagram contexts. It
registers its context optimistically in such a way that the server
will react well whether it supports contexts or not. In this case,
the server does not support datagram contexts.
Client Server Client Server
STREAM(44): HEADERS --------> STREAM(44): HEADERS -------->
:method = CONNECT-IP :method = CONNECT
:protocol = connect-udp
:scheme = https
:path = /target.example.org/443/
:authority = proxy.example.org:443
Sec-Use-Datagram-Contexts = ?1
STREAM(44): DATA -------->
Capsule Type = REGISTER_DATAGRAM
Datagram Format Type = UDP_PAYLOAD
Datagram Format Additional Data = ""
STREAM(44): DATA -------->
Capsule Type = DATAGRAM
Payload = Encapsulated UDP Payload
<-------- STREAM(44): HEADERS
:status = 200
/* Datagram contexts are not in use on this stream */
<-------- DATAGRAM
Quarter Stream ID = 11
Payload = Encapsulated UDP Payload
DATAGRAM -------->
Quarter Stream ID = 11
Payload = Encapsulated UDP Payload
A.5. CONNECT-IP with IP compression
Client Server
STREAM(44): HEADERS -------->
:method = CONNECT
:protocol = connect-ip
:scheme = https :scheme = https
:path = / :path = /
:authority = proxy.example.org:443 :authority = proxy.example.org:443
Sec-Use-Datagram-Contexts = ?1
<-------- STREAM(44): HEADERS <-------- STREAM(44): HEADERS
:status = 200 :status = 200
Sec-Use-Datagram-Contexts = ?1
/* Exchange CONNECT-IP configuration information. */ /* Exchange CONNECT-IP configuration information. */
STREAM(44): DATA --------> STREAM(44): DATA -------->
Capsule Type = REGISTER_DATAGRAM_CONTEXT Capsule Type = REGISTER_DATAGRAM_CONTEXT
Context ID = 0 Context ID = 0
Datagram Format Type = IP_PACKET Datagram Format Type = IP_PACKET
Datagram Format Additional Data = "" Datagram Format Additional Data = ""
DATAGRAM --------> DATAGRAM -------->
skipping to change at page 24, line 5 skipping to change at page 26, line 40
Capsule Type = REGISTER_DATAGRAM_CONTEXT Capsule Type = REGISTER_DATAGRAM_CONTEXT
Context ID = 2 Context ID = 2
Datagram Format Type = COMPRESSED_IP_PACKET Datagram Format Type = COMPRESSED_IP_PACKET
Datagram Format Additional Data = "192.0.2.6,192.0.2.7" Datagram Format Additional Data = "192.0.2.6,192.0.2.7"
DATAGRAM --------> DATAGRAM -------->
Quarter Stream ID = 11 Quarter Stream ID = 11
Context ID = 2 Context ID = 2
Payload = Compressed IP Packet Payload = Compressed IP Packet
A.4. WebTransport A.6. WebTransport
Client Server Client Server
STREAM(44): HEADERS --------> STREAM(44): HEADERS -------->
:method = CONNECT :method = CONNECT
:scheme = https :scheme = https
:method = webtransport :method = webtransport
:path = /hello :path = /hello
:authority = webtransport.example.org:443 :authority = webtransport.example.org:443
Origin = https://www.example.org:443 Origin = https://www.example.org:443
STREAM(44): DATA --------> STREAM(44): DATA -------->
Capsule Type = REGISTER_DATAGRAM_NO_CONTEXT Capsule Type = REGISTER_DATAGRAM
Datagram Format Type = WEBTRANSPORT_DATAGRAM Datagram Format Type = WEBTRANSPORT_DATAGRAM
Datagram Format Additional Data = "" Datagram Format Additional Data = ""
<-------- STREAM(44): HEADERS <-------- STREAM(44): HEADERS
:status = 200 :status = 200
/* Both endpoints can now send WebTransport datagrams. */ /* Both endpoints can now send WebTransport datagrams. */
Acknowledgments Acknowledgments
 End of changes. 77 change blocks. 
234 lines changed or deleted 373 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/