Network Working GroupMASQUE D. Schinazi Internet-Draft Google LLC Intended status: Standards Track L. Pardue Expires:2 August14 November 2021 Cloudflare29 January13 May 2021 Using QUIC Datagrams with HTTP/3draft-ietf-masque-h3-datagram-00draft-ietf-masque-h3-datagram-01 Abstract The QUIC DATAGRAM extension provides application protocols running over QUIC with a mechanism to send unreliable data while leveraging the security and congestion-control properties of QUIC. However, QUIC DATAGRAM frames do not provide a means to demultiplex application contexts. This documentdefinesdescribes how to use QUIC DATAGRAM frames when the application protocol running over QUIC isHTTP/3 by adding an identifier at the start of the frame payload. This allows HTTP messages to convey related information using unreliable DATAGRAM frames, ensuring those frames are properly associatedHTTP/3. It associates datagrams with client-initiated bidirectional streams and defines anHTTP message.optional additional demultiplexing layer. Discussion of this work is encouraged to happen on the MASQUE IETF mailing list (masque@ietf.org (mailto:masque@ietf.org)) or on the GitHub repository which contains the draft: https://github.com/ietf- wg-masque/draft-ietf-masque-h3-datagram. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on2 August14 November 2021. Copyright Notice Copyright (c) 2021 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/ license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . .23 1.1. Conventions and Definitions . . . . . . . . . . . . . . . 3 2.Flow IdentifiersMultiplexing . . . . . . . . . . . . . . . . . . . . . . . . 33. Flow Identifier Allocation2.1. Datagram Contexts . . . . . . . . . . . . . . . . . . . . 34.2.2. Context ID Allocation . . . . . . . . . . . . . . . . . . 4 3. HTTP/3 DATAGRAM Frame Format . . . . . . . . . . . . . . . . 4 4. CAPSULE HTTP/3 Frame Definition . . . . . . . . . . . . . . . 5 4.1. The REGISTER_DATAGRAM_CONTEXT Capsule . . . . . . . . . . 6 4.2. The CLOSE_DATAGRAM_CONTEXT Capsule . . . . . . . . . . . 7 4.3. The DATAGRAM Capsule . . . . . . . . . . . . . . . . . . 8 5. The H3_DATAGRAM HTTP/3 SETTINGS Parameter . . . . . . . . . .49 6.Datagram-Flow-Id Header Field DefinitionHTTP/1.x and HTTP/2 Support . . . . . . . . . .5 7. HTTP Intermediaries. . . . . . . 9 7. Security Considerations . . . . . . . . . . . . . .7. . . . . 10 8.SecurityIANA Considerations . . . . . . . . . . . . . . . . . . .7 9. IANA Considerations .. . 10 8.1. HTTP/3 CAPSULE Frame . . . . . . . . . . . . . . . . . .7 9.1.10 8.2. HTTP SETTINGS Parameter . . . . . . . . . . . . . . . . .7 9.2. HTTP Header Field10 8.3. Capsule Types . . . . . . . . . . . . . . . . . . . .8 9.3. Flow Identifier Parameters. . 10 8.4. Context Extension Keys . . . . . . . . . . . . .8 10.. . . . 11 9. Normative References . . . . . . . . . . . . . . . . . . . .811 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 12 A.1. CONNECT-UDP . . . . . . . . . . . . . . . . . . . . . . . 12 A.2. CONNECT-UDP with Timestamp Extension . . . . . . . . . . 13 A.3. CONNECT-IP with IP compression . . . . . . . . . . . . . 14 A.4. WebTransport . . . . . . . . . . . . . . . . . . . . . . 15 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . .1016 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . .1016 1. Introduction The QUIC DATAGRAM extension [DGRAM] provides application protocols running over QUIC [QUIC] with a mechanism to send unreliable data while leveraging the security and congestion-control properties of QUIC. However, QUIC DATAGRAM frames do not provide a means to demultiplex application contexts. This documentdefinesdescribes how to use QUIC DATAGRAM frames when the application protocol running over QUIC is HTTP/3[H3] by adding an identifier at the start of the frame payload. This allows HTTP messages to convey related information using unreliable DATAGRAM frames, ensuring those frames are properly associated[H3]. It associates datagrams with client-initiated bidirectional streams and defines anHTTP message. This design mimics the use of Stream Types in HTTP/3, which provide aoptional additional demultiplexingidentifier at the start of each unidirectional stream.layer. Discussion of this work is encouraged to happen on the MASQUE IETF mailing list (masque@ietf.org (mailto:masque@ietf.org)) or on the GitHub repository which contains the draft: https://github.com/ietf- wg-masque/draft-ietf-masque-h3-datagram. 1.1. 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. 2.Flow Identifiers Flow identifiers represent bidirectional flowsMultiplexing In order to allow multiple exchanges of datagramswithinto coexist on asinglegiven QUICconnection. These are conceptually similar to streams inconnection, HTTP datagrams contain two layers of multiplexing. First, the QUIC DATAGRAM frame payload starts with an encoded stream identifier that associates thesensedatagram with a given QUIC stream. Second, datagrams carry a context identifier (see Section 2.1) thatthey allowallows multiplexing multiple datagram contexts related to a given HTTP request. Conceptually, the first layer ofapplication data. Flows lack any ofmultiplexing is per-hop, while theordering or reliability guaranteessecond is end-to-end. 2.1. Datagram Contexts Within the scope ofstreams. Beyond this, a sender SHOULD ensure that DATAGRAM frames withinasingle flow are transmitted in order relativegiven HTTP request, contexts provide an additional demultiplexing layer. Contexts determine the encoding of datagrams, and can be used toone another. If multiple DATAGRAM framesimplicitly convey metadata. For example, contexts can bepacked into a single QUIC packet,used for compression to elide some parts of thesender SHOULD group them by flowdatagram: the context identifier then maps topromote fate-sharing withinaspecific flow and improvecompression context that theabilityreceiver can use toprocess batchesreconstruct the elided data. Contexts 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 concept. In other words, if a datagrammessages efficientlytravels through one or more intermediaries on its way from client to server, thereceiver. 3. Flow Identifierstream ID will most likely change from hop to hop, but the context ID will remain the same. Context IDs are opaque to intermediaries. 2.2. Context ID Allocation Implementations of HTTP/3 that support the DATAGRAM extension MUST provide aflow identifiercontext ID allocation service. That service will allow applications co-located with HTTP/3 to request a uniqueflow identifiercontext ID that they can subsequently use for their own purposes. The HTTP/3 implementation will then parse theflow identifiercontext ID of incoming DATAGRAM frames and use it to deliver the frame to the appropriateapplication.application context. Even-numberedflow identifierscontext IDs are client-initiated, whileodd- numbered flow identifiersodd-numbered context IDs are server-initiated. This means that an HTTP/3 client implementation of theflow identifiercontext ID allocation service MUST only provide even-numberedidentifiers,IDs, while a server implementation MUST only provide odd-numberedidentifiers.IDs. Note that, once allocated, anyflow identifiercontext ID can be used by both client and server - only allocation carries separate namespaces to avoid requiring synchronization.The flow allocation service SHOULD also provide a mechanism for applications to indicate they have completed their usage of a flow identifier and will no longer be usingAdditionally, note thatflow identifier, this processthe context ID namespace iscalled "retiring" a flow identifier. Applications MUST NOT retiretied to aflow identifier until after they have received confirmation thatgiven HTTP request: it is possible for thepeer has also stopped using that flow identifier. The flow identifier allocation service MAY reuse previously retired flow identifiers once they have ascertained that there are no packets with DATAGRAM frames using that flow identifier stillsame numeral context ID to be used simultaneously inflight. Reusing flow identifiers can improve performance by transmitting the flow identifier using a shorter variable-length integer encoding. 4.distinct requests. 3. HTTP/3 DATAGRAM Frame Format When used with HTTP/3, the Datagram Data field of QUIC DATAGRAM frames uses the following format (using the notation from the "Notational Conventions" section of [QUIC]): HTTP/3DATAGRAM FrameDatagram {Flow IdentifierQuarter Stream ID (i), Context ID (i), HTTP/3 Datagram Payload (..), } Figure 1: HTTP/3 DATAGRAM Frame FormatFlow Identifier:Quarter Stream ID: A variable-length integer that contains the value of the client-initiated bidirectional stream that this datagram is associated with, divided by four. (The division by four stems from the fact that HTTP requests are sent on client-initiated bidirectional streams, and those have stream IDs that are divisible by four.) Context ID: A variable-length integer indicating theFlow Identifiercontext ID of the datagram (see Section2).2.1). HTTP/3 Datagram Payload: The payload of the datagram, whose semantics are defined by individual applications. Note that this field can be empty.EndpointsIntermediaries parse the Quarter Stream ID field in order to associate the QUIC DATAGRAM frame with a stream. If an intermediary receives a QUIC DATAGRAM frame whose payload is too short to allow parsing the Quarter Stream ID field, the intermediary MUST treatreceiptit as an HTTP/3 connection error of type H3_GENERAL_PROTOCOL_ERROR. Intermediaries MUST ignore any HTTP/3 Datagram fields after the Quarter Stream 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 context within that stream. If an endpoint receives a QUIC DATAGRAM frame whose payload is too short toparseallow parsing theflow identifierQuarter Stream 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 DATAGRAM frame whose payload is long enough to allow parsing the Quarter Stream ID field but too short to allow parsing the Context ID field, the endpoint MUST abruptly terminate the corresponding stream with a stream error of type H3_GENERAL_PROTOCOL_ERROR. If a DATAGRAM frame is received and its Quarter Stream ID maps to a stream that has already been closed, the receiver MUST silently drop that frame. If a DATAGRAM frame is received and its Quarter Stream ID maps to a stream that has not yet been created, the receiver SHALL either drop that frame silently or buffer it temporarily while awaiting the creation of the corresponding stream. 4. CAPSULE HTTP/3 Frame Definition CAPSULE allows reliably sending request-related information end-to- end, even in the presence of HTTP intermediaries. CAPSULE is an HTTP/3 Frame (as opposed to a QUIC frame) which SHALL only be sent in client-initiated bidirectional streams. Intermediaries MUST forward all received CAPSULE frames in their unmodified entirety on the same stream where it would forward DATA frames. Intermediaries MUST NOT send any CAPSULE frames other than the ones it is forwarding. This specification of CAPSULE currently uses HTTP/3 frame type 0xffcab5. If this document is approved, a lower number will be requested from IANA. CAPSULE HTTP/3 Frame { Type (i) = 0xffcab5, Length (i), Capsule Type (i), Capsule Data (..), } Figure 2: CAPSULE HTTP/3 Frame Format The Type and Length fields follows the definition of HTTP/3 frames from [H3]. The payload consists of: Capsule Type: The type of this capsule. Capsule Data: Data whose semantics depends on the Capsule Type. Endpoints which receive a Capsule with an unknown Capsule Type MUST silently drop that Capsule. Intermediaries MUST forward Capsules, even if they do not know the Capsule Type or cannot parse the Capsule Data. 4.1. The REGISTER_DATAGRAM_CONTEXT Capsule The REGISTER_DATAGRAM_CONTEXT capsule (type=0x00) allows an endpoint to inform its peer of the encoding and semantics of datagrams associated with a given context ID. Its Capsule Data field consists of: REGISTER_DATAGRAM_CONTEXT Capsule { Context ID (i), Extension String (..), } Figure 3: REGISTER_DATAGRAM_CONTEXT Capsule Format Context ID: The context ID to register. Extension String: A string of comma-separated key-value pairs to enable extensibility. Keys are registered with IANA, see Section 8.4. The ABNF for the Extension String field is as follows (using syntax from Section 3.2.6 of [RFC7230]): extension-string = [ ext-member *( "," ext-member ) ] ext-member = ext-member-key "=" ext-member-value ext-member-key = token ext-member-value = token Note that these registrations are unilateral and bidirectional: the sender of the frame unilaterally defines the semantics it will apply to the datagrams it sends and receives using this context ID. 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 have either sent or received a REGISTER_DATAGRAM_CONTEXT Capsule with the same Context ID. However, due to reordering, an endpoint that receives a DATAGRAM frame with an unknown Context ID MUST NOT treat it as an error, it SHALL instead drop the DATAGRAM frame silently, or buffer it temporarily while awaiting the corresponding REGISTER_DATAGRAM_CONTEXT Capsule. Endpoints MUST NOT register the same Context ID twice on the same stream. This also applies to Context IDs that have been closed using a CLOSE_DATAGRAM_CONTEXT capsule. Clients MUST NOT register server- initiated Context IDs and servers MUST NOT register client-initiated Context IDs. If an endpoint receives a REGISTER_DATAGRAM_CONTEXT capsule that violates one or more of these requirements, the endpoint MUST abruptly terminate the corresponding stream with a stream error of type H3_GENERAL_PROTOCOL_ERROR. 4.2. The CLOSE_DATAGRAM_CONTEXT Capsule The CLOSE_DATAGRAM_CONTEXT capsule (type=0x01) allows an endpoint to inform its peer that it will no longer send or parse received datagrams associated with a given context ID. Its Capsule Data field consists of: CLOSE_DATAGRAM_CONTEXT Capsule { Context ID (i), Extension String (..), } Figure 4: CLOSE_DATAGRAM_CONTEXT Capsule Format Context ID: The context ID to close. Extension String: A string of comma-separated key-value pairs to enable extensibility, see the definition of the same field in Section 4.1 for details. Note that this close is unilateral and bidirectional: the sender of the frame unilaterally informs its peer of the closure. Endpoints can use CLOSE_DATAGRAM_CONTEXT capsules to close a context that was initially registered by either themselves, or by their peer. Endpoints MAY use the CLOSE_DATAGRAM_CONTEXT capsule to immediately reject a context that was just registered using a REGISTER_DATAGRAM_CONTEXT capsule if they find its Extension String to be unacceptable. After an endpoint has either sent or received a CLOSE_DATAGRAM_CONTEXT frame, it MUST NOT send any DATAGRAM frames with that Context ID. However, due to reordering, an endpoint that receives a DATAGRAM frame with a closed Context ID MUST NOT treat it as an error, it SHALL instead drop the DATAGRAM frame silently. Endpoints MUST NOT close a Context ID that was not previously registered. Endpoints MUST NOT close a Context ID that has already been closed. If an endpoint receives a CLOSE_DATAGRAM_CONTEXT capsule that violates one or more of these requirements, the endpoint MUST abruptly terminate the corresponding stream with a stream error of type H3_GENERAL_PROTOCOL_ERROR. 4.3. The DATAGRAM Capsule The DATAGRAM capsule (type=0x02) allows an 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. Its Capsule Data field consists of: DATAGRAM Capsule { Context ID (i), HTTP/3 Datagram Payload (..), } Figure 5: DATAGRAM Capsule Format Context ID: A variable-length integer indicating the context ID of the datagram (see Section 2.1). HTTP/3 Datagram Payload: The payload of the datagram, whose semantics are defined by individual applications. Note that this field can be empty. Datagrams sent using the DATAGRAM Capsule have the exact same semantics as datagrams sent in QUIC DATAGRAM frames. 5. The H3_DATAGRAM HTTP/3 SETTINGS Parameter Implementations of HTTP/3 that support this mechanism can indicate 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 be either 0 or 1. A value of 0 indicates that this mechanism is not supported. An endpoint that receives the H3_DATAGRAM SETTINGS parameter with a value that is neither 0 or 1 MUST terminate the connection with error H3_SETTINGS_ERROR. An endpoint that sends the H3_DATAGRAM SETTINGS parameter with a value of 1 MUST send the max_datagram_frame_size QUIC Transport Parameter [DGRAM]. An endpoint that receives the H3_DATAGRAM SETTINGS parameter with a value of 1 on a QUIC connection that did not also receive the max_datagram_frame_size QUIC Transport Parameter MUST terminate the connection with error H3_SETTINGS_ERROR. When clients use 0-RTT, they MAY store the value of the server's H3_DATAGRAM SETTINGS parameter. Doing so allows the client to use HTTP/3 datagrams in 0-RTT packets. When servers decide to accept 0-RTT data, they MUST send a H3_DATAGRAM SETTINGS parameter greater than or equal to the value they sent to the client in the connection where they sent them the NewSessionTicket message. If a client stores the value of the H3_DATAGRAM SETTINGS parameter with their 0-RTT state, they MUST validate that the new value of the H3_DATAGRAM SETTINGS parameter sent by the server in the handshake is greater than or equal to the stored value; if not, the client MUST terminate the connection with error H3_SETTINGS_ERROR. In all cases, the maximum permitted value of the H3_DATAGRAM SETTINGS parameter is 1. 6.Datagram-Flow-Id Header Field Definition "Datagram-Flow-Id" is a List Structured Field [STRUCT-FIELD], whose members MUST all be Items of type Integer. Its ABNF is: Datagram-Flow-Id = sf-list The "Datagram-Flow-Id" header field is used to associate one or more datagram flow identifiers with an HTTP message. As a simple example using a single identifier, the definition of an HTTP method could instruct the client to use its flow identifier allocation service to allocate a new flow identifier,HTTP/1.x andthen the client will add the "Datagram-Flow-Id" header field to its request to communicate that value to the server. In this example, the resulting header field could look like: Datagram-Flow-Id = 2 List members are flow identifier elements, whichHTTP/2 Support We canbe named or unnamed. One element in the list is allowed to be unnamed, but all but one elements MUST carry a name. The name of an element is encodedprovide DATAGRAM support in HTTP/2 by defining thekey of the first parameter of that element (parameters are definedCAPSULE frame inSection 3.1.2 of [STRUCT-FIELD]). Each name MUST NOT appear more than onceHTTP/2. We can provide DATAGRAM support inthe list. The value of the first parameter of each named element (whose corresponding key conveys the element name) MUST be of type Boolean and equal to true. The value of the first parameter of the unnamed element MUST NOT be of type Boolean. The ordering of the list does not carry any semantics. For example, an HTTP method that wishes to use four datagram flow identifiers for the lifetime ofHTTP/1.x by defining itsrequestdata streamcould look like this: Datagram-Flow-Id = 42, 44; ecn-ect0, 46; ecn-ect1, 48; ecn-ce In this example, 42 is the unnamed flow identifier, 44 represents the name "ecn-ect0", 46 represents "ecn-ect1", and 48 represents "ecn- ce". Note that, since the list ordering does not carry semantics, this example can be equivalently encoded as: Datagram-Flow-Id = 44; ecn-ect0, 42, 48; ecn-ce, 46; ecn-ect1 Even if a sender attemptsformat tocommunicate the meaning of a flow identifier before it uses it in an HTTP/3 datagram, it is possible that its peer will receive an HTTP/3 datagram withaflow identifier that it does not know as it has not yet received the corresponding "Datagram-Flow-Id" header field. (For example,sequence of length-value capsules. TODO: Refactor thiscould happen if the QUIC STREAM frame that contains the "Datagram-Flow-Id" header field is reordereddocument into "HTTP Datagrams" with definitions for HTTP/1.x, HTTP/2, andarrives afer the DATAGRAM frame.) Endpoints MUST NOT treat that scenario asHTTP/3. 7. Security Considerations Since this feature requires sending anerror; they MUST either silently discard the datagram or bufferHTTP/3 Settings parameter, ituntil they receive the "Datagram- Flow-Id" header field. Distinct HTTP requests MAY refer to the same flow identifier in their respective "Datagram-Flow-Id" header fields. Note that integer structured fields"sticks out". In other words, probing clients canonly encode values up to 10^15-1, therefore the maximum possible value of an element of the "Datagram-Flow-Id" header field is lower then the theoretical maximum value of a flow identifier which is 2^62-1 due to the QUIC variable length integer encoding. If the flow identifier allocation service of an endpoint runs out of values lower than 10^15-1, the endpoint MUST fail the flow identifier allocation. An HTTP message that carries a "Datagram-Flow-Id" header field with a flow identifier value above 10^15-1 is malformed (see Section 8.1.2.6 of [H2]). 7. HTTP Intermediaries HTTP/3 DATAGRAM flow identifiers are specific tolearn whether agiven HTTP/3 connection. However, in some cases, an HTTP request may travel across multiple HTTP connections if there are HTTP intermediaries involved; see Section 2.3 of [RFC7230]. If an intermediary has sent the H3_DATAGRAM SETTINGS parameter with a value of 1 on its client-facing connection, it MUST inspect all HTTP requests from that connection and check for the presence of the "Datagram-Flow-Id" header field. If the HTTP method of the request is not supported by the intermediary, it MUST remove the "Datagram- Flow-Id" header field before forwarding the request. If the intermediaryserver supportsthe method, it MUST either remove the header field or adhere to the requirements leveraged bythis feature. Implementations thatmethod on intermediaries. If an intermediary has sent the H3_DATAGRAM SETTINGSsupport this feature SHOULD always send this Settings parameterwith a value of 1 on its server-facing connection, it MUST inspect all HTTP responses from that connection and check for the presence of the "Datagram-Flow-Id" header field. If the HTTP method of the request is not supported by the intermediary, it MUST remove the "Datagram- Flow-Id" header field before forwarding the response. If the intermediary supports the method, it MUST either remove the header field or adhere to the requirements leveraged by that method on intermediaries. If an intermediary processes distinct HTTP requests that referto avoid leaking thesame flow identifier in their respective "Datagram-Flow-Id" header fields, it MUST ensurefact thatthose requeststhere arerouted to the same backend.applications using HTTP/3 datagrams enabled on this endpoint. 8.SecurityIANA Considerations 8.1. HTTP/3 CAPSULE Frame This documentdoes not have additional security considerations beyond those defined in [QUIC] and [DGRAM]. 9.will request IANAConsiderations 9.1.to register the following entry in the "HTTP/3 Frames" registry: +------------+----------+---------------+ | Frame Type | Value | Specification | +============+==========+===============+ | CAPSULE | 0xffcab5 | This Document | +------------+----------+---------------+ 8.2. HTTP SETTINGS Parameter This document will request IANA to register the following entry in the "HTTP/3 Settings" registry:+--------------+-------+---------------+---------++--------------+----------+---------------+---------+ | Setting Name | Value | Specification | Default |+==============+=======+===============+=========++==============+==========+===============+=========+ | H3_DATAGRAM |0x2760xffd276 | This Document | 0 |+--------------+-------+---------------+---------+ 9.2. HTTP Header Field+--------------+----------+---------------+---------+ 8.3. Capsule Types This documentwill request IANAestablishes a registry for HTTP/3 frame type codes. The "HTTP Capsule Types" registry governs a 62-bit space. Registrations in this registry MUST include the following fields: Type: A name or label for the capsule type. Value: The value of the Capsule Type field (see Section 4) is a 62bit integer. Reference: An optional reference toregistera specification for the"Datagram-Flow-Id" headertype. This fieldinMAY be empty. Registrations follow the"Permanent Message Header Field Names""First Come First Served" policy (see Section 4.4 of [IANA-POLICY]) where two registrations MUST NOT have the same Type. This registrymaintained at <https://www.iana.org/assignments/message-headers>. +-------------------+----------+--------+---------------+initially contains the following entries: +---------------------------+-------+---------------+ |Header Field NameCapsule Type |ProtocolValue |StatusSpecification |Reference+---------------------------+-------+---------------+ |+-------------------+----------+--------+---------------+REGISTER_DATAGRAM_CONTEXT |Datagram-Flow-Id0x00 |httpThis Document | +---------------------------+-------+---------------+ |stdCLOSE_DATAGRAM_CONTEXT | 0x01 | ThisdocumentDocument | +---------------------------+-------+---------------+ | DATAGRAM | 0x02 |+-------------------+----------+--------+---------------+ 9.3. Flow Identifier ParametersThis Document | +---------------------------+-------+---------------+ 8.4. Context Extension Keys REGISTER_DATAGRAM_CONTEXT capsules carry key-value pairs, see Section 4.1. This document will request IANA to create an "HTTP DatagramFlow Identifier Parameters"Context Extension Keys" registry. Registrations in this registry MUST include the following fields: Key: The keyof a parameter that is associated with a datagram flow identifier list member(see Section6).4.1). Keys MUST be validstructured field parameter keys (seetokens as defined in Section3.1.23.2.6 of[STRUCT-FIELD]).[RFC7230]. Description: A brief description of theparameterkey semantics, which MAY be a summary if a specification reference is provided.Is Name: This field MUST be either Yes or No. Yes indicates that this parameter is the name of a named element (see Section 6). No indicates that it is a parameter that is not a name.Reference: An optional reference to a specification for the parameter. This field MAY be empty. Registrations follow the "First Come First Served" policy (see Section 4.4 of [IANA-POLICY]) where two registrations MUST NOT have the same Key. This registry is initially empty.10.9. Normative References [DGRAM] Pauly, T., Kinnear, E., and D. Schinazi, "An Unreliable Datagram Extension to QUIC", Work in Progress, Internet- Draft,draft-ietf-quic-datagram-01, 24 August 2020, <http://www.ietf.org/internet-drafts/draft-ietf-quic- datagram-01.txt>. [H2] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext Transfer Protocol Version 2 (HTTP/2)", RFC 7540, DOI 10.17487/RFC7540, May 2015, <https://www.rfc-editor.org/info/rfc7540>.draft-ietf-quic-datagram-02, 16 February 2021, <https://tools.ietf.org/html/draft-ietf-quic-datagram-02>. [H3] Bishop, M., "Hypertext Transfer Protocol Version 3 (HTTP/3)", Work in Progress, Internet-Draft, draft-ietf-quic-http-33, 15 December 2020, <http://www.ietf.org/ internet-drafts/draft-ietf-quic-http-33.txt>.quic-http-34, 2 February 2021, <https://tools.ietf.org/html/draft-ietf-quic-http-34>. [IANA-POLICY] Cotton, M., Leiba, B., and T. Narten, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 8126, DOI 10.17487/RFC8126, June 2017,<https://www.rfc-editor.org/info/rfc8126>.<https://www.rfc-editor.org/rfc/rfc8126>. [QUIC] Iyengar, J. and M. Thomson, "QUIC: A UDP-Based Multiplexed and Secure Transport", Work in Progress, Internet-Draft, draft-ietf-quic-transport-34, 14 January 2021,<http://www.ietf.org/internet-drafts/draft-ietf-quic- transport-34.txt>.<https://tools.ietf.org/html/draft-ietf-quic-transport- 34>. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997,<https://www.rfc-editor.org/info/rfc2119>.<https://www.rfc-editor.org/rfc/rfc2119>. [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing", RFC 7230, DOI 10.17487/RFC7230, June 2014,<https://www.rfc-editor.org/info/rfc7230>.<https://www.rfc-editor.org/rfc/rfc7230>. [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017,<https://www.rfc-editor.org/info/rfc8174>. [STRUCT-FIELD] Nottingham, M. and P. Kamp, "Structured Field Values<https://www.rfc-editor.org/rfc/rfc8174>. Appendix A. Examples A.1. CONNECT-UDP Client Server STREAM(44): HEADERS --------> :method = CONNECT-UDP :scheme = https :path = / :authority = target.example.org:443 STREAM(44): CAPSULE --------> Capsule Type = REGISTER_DATAGRAM_CONTEXT Context ID = 0 Extension String = "" DATAGRAM --------> Quarter Stream ID = 11 Context ID = 0 Payload = Encapsulated UDP Payload <-------- STREAM(44): HEADERS :status = 200 /* Wait forHTTP", Work in Progress, Internet-Draft, draft-ietf- httpbis-header-structure-19, 3 June 2020, <http://www.ietf.org/internet-drafts/draft-ietf-httpbis- header-structure-19.txt>.target server to respond to UDP packet. */ <-------- DATAGRAM Quarter Stream ID = 11 Context ID = 0 Payload = Encapsulated UDP Payload A.2. CONNECT-UDP with Timestamp Extension Client Server STREAM(44): HEADERS --------> :method = CONNECT-UDP :scheme = https :path = / :authority = target.example.org:443 STREAM(44): CAPSULE --------> Capsule Type = REGISTER_DATAGRAM_CONTEXT Context ID = 0 Extension String = "" DATAGRAM --------> Quarter Stream ID = 11 Context ID = 0 Payload = Encapsulated UDP Payload <-------- STREAM(44): HEADERS :status = 200 /* Wait for target server to respond to UDP packet. */ <-------- DATAGRAM Quarter Stream ID = 11 Context ID = 0 Payload = Encapsulated UDP Payload STREAM(44): CAPSULE --------> Capsule Type = REGISTER_DATAGRAM_CONTEXT Context ID = 2 Extension String = "timestamp" DATAGRAM --------> Quarter Stream ID = 11 Context ID = 2 Payload = Encapsulated UDP Payload With Timestamp A.3. CONNECT-IP with IP compression Client Server STREAM(44): HEADERS --------> :method = CONNECT-IP :scheme = https :path = / :authority = proxy.example.org:443 <-------- STREAM(44): HEADERS :status = 200 /* Exchange CONNECT-IP configuration information. */ STREAM(44): CAPSULE --------> Capsule Type = REGISTER_DATAGRAM_CONTEXT Context ID = 0 Extension String = "" DATAGRAM --------> Quarter Stream ID = 11 Context ID = 0 Payload = Encapsulated IP Packet /* Endpoint happily exchange encapsulated IP packets */ /* using Quarter Stream ID 11 and Context ID 0. */ DATAGRAM --------> Quarter Stream ID = 11 Context ID = 0 Payload = Encapsulated IP Packet /* After performing some analysis on traffic patterns, */ /* the client decides it wants to compress a 5-tuple. */ STREAM(44): CAPSULE --------> Capsule Type = REGISTER_DATAGRAM_CONTEXT Context ID = 2 Extension String = "ip=192.0.2.42,port=443" DATAGRAM --------> Quarter Stream ID = 11 Context ID = 2 Payload = Compressed IP Packet A.4. WebTransport Client Server STREAM(44): HEADERS --------> :method = CONNECT :scheme = https :method = webtransport :path = /hello :authority = webtransport.example.org:443 Origin = https://www.example.org:443 STREAM(44): CAPSULE --------> Capsule Type = REGISTER_DATAGRAM_CONTEXT Context ID = 0 Extension String = "" <-------- STREAM(44): HEADERS :status = 200 /* Both endpoints can now send WebTransport datagrams. */ Acknowledgments The DATAGRAMflowcontext identifier was previously part of the DATAGRAM frame definition itself, theauthorauthors would like to acknowledge the authors of that document and the members of the IETF MASQUE working group for their suggestions. Additionally, theauthorauthors would like to thank Martin Thomson for suggesting the use of an HTTP/3 SETTINGS parameter. Furthermore, the authors would like to thank Ben Schwartz for writing the first proposal that used two layers of indirection. Authors' Addresses David Schinazi Google LLC 1600 Amphitheatre Parkway Mountain View, California 94043, United States of America Email: dschinazi.ietf@gmail.com Lucas Pardue Cloudflare Email: lucaspardue.24.7@gmail.com