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 . . . . . . . . . . . . . . . . . . . .8 Acknowledgments11 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 12 A.1. CONNECT-UDP . . .10 Authors' Addresses. . . . . . . . . . . . . . . . . . . . 12 A.2. CONNECT-UDP with Timestamp Extension . . .10 1. Introduction The QUIC DATAGRAM extension [DGRAM] provides application protocols running over QUIC [QUIC]. . . . . . . 13 A.3. CONNECT-IP witha 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 document defines how to use QUIC DATAGRAM frames when the application protocol running over QUIC is HTTP/3 [H3] by adding an identifier atIP compression . . . . . . . . . . . . . 14 A.4. WebTransport . . . . . . . . . . . . . . . . . . . . . . 15 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 16 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 16 1. Introduction The QUIC DATAGRAM extension [DGRAM] provides application protocols running over QUIC [QUIC] with a mechanism to send unreliable data while leveraging thestartsecurity and congestion-control properties ofthe frame payload.QUIC. However, QUIC DATAGRAM frames do not provide a means to demultiplex application contexts. Thisallows HTTP messagesdocument describes how toconvey related information using unreliableuse QUIC DATAGRAMframes, ensuring thoseframesare properly associatedwhen the application protocol running over QUIC is HTTP/3 [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, thesenseQUIC DATAGRAM frame payload starts with an encoded stream identifier thatthey allowassociates the datagram with a given QUIC stream. Second, datagrams carry a context identifier (see Section 2.1) that allows 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,asender SHOULD ensure that DATAGRAM frames within a single 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.Endpoints MUST treat receipt ofIntermediaries 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 toparseallow parsing theflow identifier asQuarter Stream ID field, the intermediary MUST treat it as an HTTP/3 connection error of type H3_GENERAL_PROTOCOL_ERROR.5. The H3_DATAGRAM HTTP/3 SETTINGS Parameter Implementations ofIntermediaries MUST ignore any HTTP/3that support this mechanism can indicate thatDatagram fields after the Quarter Stream ID. Endpoints parse both the Quarter Stream ID field and the Context ID field in order totheir peer by sendingassociate theH3_DATAGRAM SETTINGS parameterQUIC DATAGRAM frame with avalue of 1. The value of the H3_DATAGRAM SETTINGS parameter MUST be either 0 or 1. A value of 0 indicatesstream and context within thatthis mechanism is not supported. Anstream. If an endpointthatreceivesthe H3_DATAGRAM SETTINGS parameter withavalue thatQUIC DATAGRAM frame whose payload isneither 0 or 1 MUST terminatetoo short to allow parsing the Quarter Stream ID field, the endpoint MUST treat it as an HTTP/3 connectionwitherrorH3_SETTINGS_ERROR. Anof type H3_GENERAL_PROTOCOL_ERROR. If an endpointthat sends the H3_DATAGRAM SETTINGS parameter withreceives avalue of 1 MUST send the max_datagram_frame_sizeQUICTransport Parameter [DGRAM]. AnDATAGRAM 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 endpointthat receivesMUST abruptly terminate theH3_DATAGRAM SETTINGS parametercorresponding stream with avaluestream error of1 ontype H3_GENERAL_PROTOCOL_ERROR. If aQUIC connectionDATAGRAM frame is received and its Quarter Stream ID maps to a stream thatdid not also receivehas already been closed, themax_datagram_frame_size QUIC Transport Parameterreceiver MUSTterminatesilently drop that frame. If a DATAGRAM frame is received and its Quarter Stream ID maps to a stream that has not yet been created, theconnection with error H3_SETTINGS_ERROR. When clients use 0-RTT, they MAY storereceiver SHALL either drop that frame silently or buffer it temporarily while awaiting thevaluecreation of theserver's H3_DATAGRAM SETTINGS parameter. Doing socorresponding stream. 4. CAPSULE HTTP/3 Frame Definition CAPSULE allows reliably sending request-related information end-to- end, even in theclient to usepresence of HTTP intermediaries. CAPSULE is an HTTP/3datagrams in 0-RTT packets. When servers decideFrame (as opposed toaccept 0-RTT data, they MUST sendaH3_DATAGRAM SETTINGS parameter greater than or equal to the value theyQUIC frame) which SHALL only be sentto the clientin client-initiated bidirectional streams. Intermediaries MUST forward all received CAPSULE frames in their unmodified entirety on theconnectionsame stream wherethey sent themit would forward DATA frames. Intermediaries MUST NOT send any CAPSULE frames other than theNewSessionTicket message.ones it is forwarding. This specification of CAPSULE currently uses HTTP/3 frame type 0xffcab5. If this document is approved, aclient storeslower 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 thevaluedefinition of HTTP/3 frames from [H3]. The payload consists of: Capsule Type: The type of this capsule. Capsule Data: Data whose semantics depends on theH3_DATAGRAM SETTINGS parameterCapsule Type. Endpoints which receive a Capsule withtheir 0-RTT state, theyan unknown Capsule Type MUSTvalidatesilently drop thatthe 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 clientCapsule. Intermediaries MUSTterminateforward Capsules, even if they do not know theconnection with error H3_SETTINGS_ERROR. In all cases,Capsule Type or cannot parse themaximum permitted valueCapsule Data. 4.1. The REGISTER_DATAGRAM_CONTEXT Capsule The REGISTER_DATAGRAM_CONTEXT capsule (type=0x00) allows an endpoint to inform its peer of theH3_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 Itemsencoding and semantics oftype Integer.datagrams associated with a given context ID. ItsABNF is: Datagram-Flow-Id = sf-list The "Datagram-Flow-Id" headerCapsule Data fieldis usedconsists of: REGISTER_DATAGRAM_CONTEXT Capsule { Context ID (i), Extension String (..), } Figure 3: REGISTER_DATAGRAM_CONTEXT Capsule Format Context ID: The context ID toassociate one or more datagram flow identifiersregister. Extension String: A string of comma-separated key-value pairs to enable extensibility. Keys are registered withan HTTP message. As a simple example using a single identifier,IANA, see Section 8.4. The ABNF for thedefinitionExtension String field is as follows (using syntax from Section 3.2.6 ofan HTTP method could instruct the client to use its flow identifier allocation service to allocate a new flow identifier,[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 andthenbidirectional: theclient will addsender of the"Datagram-Flow-Id" header field to its request to communicate that valueframe unilaterally defines the semantics it will apply to theserver. Indatagrams it sends and receives using thisexample, the resulting header field could look like: Datagram-Flow-Id = 2 List members are flow identifier elements, whichcontext ID. Once a context ID is registered, it can benamed or unnamed. One elementused inthe list is allowed to be unnamed, but all but one elementsboth directions. Endpoints MUSTcarryNOT send DATAGRAM frames using aname. The name of an element is encoded in the key ofContext ID until they have either sent or received a REGISTER_DATAGRAM_CONTEXT Capsule with thefirst parameter ofsame Context ID. However, due to reordering, an endpoint thatelement (parameters are defined in Section 3.1.2 of [STRUCT-FIELD]). Each namereceives a DATAGRAM frame with an unknown Context ID MUST NOTappear more than once intreat it as an error, it SHALL instead drop thelist. The value ofDATAGRAM frame silently, or buffer it temporarily while awaiting thefirst parameter of each named element (whosecorrespondingkey conveysREGISTER_DATAGRAM_CONTEXT Capsule. Endpoints MUST NOT register the same Context ID twice on theelement name)same stream. This also applies to Context IDs that have been closed using a CLOSE_DATAGRAM_CONTEXT capsule. Clients MUSTbe of type BooleanNOT register server- initiated Context IDs andequal to true. The value of the first parameterservers MUST NOT register client-initiated Context IDs. If an endpoint receives a REGISTER_DATAGRAM_CONTEXT capsule that violates one or more of these requirements, theunnamed elementendpoint MUSTNOT beabruptly terminate the corresponding stream with a stream error of typeBoolean.H3_GENERAL_PROTOCOL_ERROR. 4.2. Theordering of the list does not carry any semantics. For example,CLOSE_DATAGRAM_CONTEXT Capsule The CLOSE_DATAGRAM_CONTEXT capsule (type=0x01) allows anHTTP methodendpoint to inform its peer thatwishesit 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 touse four datagram flow identifiers forclose. Extension String: A string of comma-separated key-value pairs to enable extensibility, see thelifetimedefinition ofits request stream could look like this: Datagram-Flow-Id = 42, 44; ecn-ect0, 46; ecn-ect1, 48; ecn-ce Inthe same field in Section 4.1 for details. Note that thisexample, 42close is unilateral and bidirectional: theunnamed flow identifier, 44 representssender of thename "ecn-ect0", 46 represents "ecn-ect1", and 48 represents "ecn- ce". Note that, sinceframe unilaterally informs its peer of thelist ordering does not carry semantics, this exampleclosure. Endpoints canbe equivalently encoded as: Datagram-Flow-Id = 44; ecn-ect0, 42, 48; ecn-ce, 46; ecn-ect1 Even ifuse 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 asender attemptsREGISTER_DATAGRAM_CONTEXT capsule if they find its Extension String tocommunicate the meaning of a flow identifier before it uses it inbe unacceptable. After anHTTP/3 datagram,endpoint has either sent or received a CLOSE_DATAGRAM_CONTEXT frame, itis possibleMUST NOT send any DATAGRAM frames with thatits peer will receiveContext ID. However, due to reordering, anHTTP/3 datagramendpoint that receives a DATAGRAM frame with aflow identifier thatclosed Context ID MUST NOT treat itdoes not knowas an error, ithas not yet received the corresponding "Datagram-Flow-Id" header field. (For example, this could happen ifSHALL instead drop theQUIC STREAMDATAGRAM frame silently. Endpoints MUST NOT close a Context ID thatcontains the "Datagram-Flow-Id" header field is reordered and arrives afer the DATAGRAM frame.)was not previously registered. Endpoints MUST NOTtreatclose a Context ID thatscenario ashas already been closed. If anerror; theyendpoint receives a CLOSE_DATAGRAM_CONTEXT capsule that violates one or more of these requirements, the endpoint MUSTeither silently discardabruptly 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 datagramor buffer it until they receive the "Datagram- Flow-Id" header field. Distinctframe over an HTTPrequests MAY refer tostream. 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 sameflow identifiersemantics as datagrams sent intheir respective "Datagram-Flow-Id" header fields. NoteQUIC DATAGRAM frames. 5. The H3_DATAGRAM HTTP/3 SETTINGS Parameter Implementations of HTTP/3 thatinteger structured fieldssupport this mechanism canonly encode values upindicate that to10^15-1, thereforetheir peer by sending themaximum possibleH3_DATAGRAM SETTINGS parameter with a value ofan element1. The value of the"Datagram-Flow-Id" header field is lower then the theoretical maximumH3_DATAGRAM SETTINGS parameter MUST be either 0 or 1. A value ofa flow identifier which0 indicates that this mechanism is2^62-1 due to the QUIC variable length integer encoding. If the flow identifier allocation service of annot supported. An endpointruns out of values lower than 10^15-1,that receives theendpointH3_DATAGRAM SETTINGS parameter with a value that is neither 0 or 1 MUSTfailterminate theflow identifier allocation.connection with error H3_SETTINGS_ERROR. AnHTTP messageendpoint thatcarries a "Datagram-Flow-Id" header fieldsends the H3_DATAGRAM SETTINGS parameter with aflow identifiervalueabove 10^15-1 is malformed (see Section 8.1.2.6of[H2]). 7. HTTP Intermediaries HTTP/3 DATAGRAM flow identifiers are specific to a given 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 sent1 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 onits client-facing connection, it MUST inspect all HTTP requests from thata QUIC connectionand check for the presence of the "Datagram-Flow-Id" header field. If the HTTP method of the request isthat did notsupported byalso receive theintermediary, itmax_datagram_frame_size QUIC Transport Parameter MUSTremoveterminate the"Datagram- Flow-Id" header field before forwardingconnection with error H3_SETTINGS_ERROR. When clients use 0-RTT, they MAY store therequest. Ifvalue of theintermediary supportsserver's H3_DATAGRAM SETTINGS parameter. Doing so allows themethod, itclient to use HTTP/3 datagrams in 0-RTT packets. When servers decide to accept 0-RTT data, they MUSTeither remove the header fieldsend a H3_DATAGRAM SETTINGS parameter greater than oradhereequal to therequirements leveraged by that method on intermediaries. If an intermediary hasvalue 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 witha value of 1 on its server-facing connection, ittheir 0-RTT state, they MUSTinspect all HTTP responses fromvalidate thatconnection and check forthepresencenew value of the"Datagram-Flow-Id" header field. IfH3_DATAGRAM SETTINGS parameter sent by theHTTP method ofserver in therequesthandshake isnot supported by the intermediary, it MUST removegreater than or equal to the"Datagram- Flow-Id" header field before forwardingstored value; if not, theresponse. Ifclient MUST terminate theintermediary supportsconnection with error H3_SETTINGS_ERROR. In all cases, themethod, it MUST either removemaximum permitted value of theheader field or adhere toH3_DATAGRAM SETTINGS parameter is 1. 6. HTTP/1.x and HTTP/2 Support We can provide DATAGRAM support in HTTP/2 by defining therequirements leveragedCAPSULE frame in HTTP/2. We can provide DATAGRAM support in HTTP/1.x bythat method on intermediaries. Ifdefining its data stream format to a sequence of length-value capsules. TODO: Refactor this document into "HTTP Datagrams" with definitions for HTTP/1.x, HTTP/2, and HTTP/3. 7. Security Considerations Since this feature requires sending anintermediary processes distinct HTTP requestsHTTP/3 Settings parameter, it "sticks out". In other words, probing clients can learn whether a server supports this feature. Implementations thatrefersupport this feature SHOULD always send this Settings parameter to 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 |00 | +--------------+----------+---------------+---------+ 8.3. Capsule Types This document establishes 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 to a specification for the type. 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 Type. This registry initially contains the following entries: +---------------------------+-------+---------------+ | Capsule Type | Value | Specification | +---------------------------+-------+---------------+ | REGISTER_DATAGRAM_CONTEXT | 0x00 |+--------------+-------+---------------+---------+ 9.2. HTTP Header FieldThisdocument will request IANA to register the "Datagram-Flow-Id" header field in the "Permanent Message Header Field Names" registry maintained at <https://www.iana.org/assignments/message-headers>. +-------------------+----------+--------+---------------+ | Header Field NameDocument |Protocol+---------------------------+-------+---------------+ |StatusCLOSE_DATAGRAM_CONTEXT |Reference0x01 |+-------------------+----------+--------+---------------+This Document |Datagram-Flow-Id+---------------------------+-------+---------------+ |httpDATAGRAM |std0x02 | ThisdocumentDocument |+-------------------+----------+--------+---------------+ 9.3. Flow Identifier Parameters+---------------------------+-------+---------------+ 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