idnits 2.17.1 draft-ietf-masque-h3-datagram-05.txt: -(960): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == There are 2 instances of lines with non-ascii characters in the document. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (25 October 2021) is 886 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-10) exists of draft-ietf-quic-datagram-06 == Outdated reference: A later version (-12) exists of draft-ietf-httpbis-priority-07 Summary: 0 errors (**), 0 flaws (~~), 4 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 MASQUE D. Schinazi 3 Internet-Draft Google LLC 4 Intended status: Standards Track L. Pardue 5 Expires: 28 April 2022 Cloudflare 6 25 October 2021 8 Using Datagrams with HTTP 9 draft-ietf-masque-h3-datagram-05 11 Abstract 13 The QUIC DATAGRAM extension provides application protocols running 14 over QUIC with a mechanism to send unreliable data while leveraging 15 the security and congestion-control properties of QUIC. However, 16 QUIC DATAGRAM frames do not provide a means to demultiplex 17 application contexts. This document describes how to use QUIC 18 DATAGRAM frames when the application protocol running over QUIC is 19 HTTP/3. It associates datagrams with client-initiated bidirectional 20 streams and defines an optional additional demultiplexing layer. 21 Additionally, this document defines how to convey datagrams over 22 prior versions of HTTP. 24 Discussion Venues 26 This note is to be removed before publishing as an RFC. 28 Discussion of this document takes place on the MASQUE WG mailing list 29 (masque@ietf.org), which is archived at 30 https://mailarchive.ietf.org/arch/browse/masque/. 32 Source for this draft and an issue tracker can be found at 33 https://github.com/ietf-wg-masque/draft-ietf-masque-h3-datagram. 35 Status of This Memo 37 This Internet-Draft is submitted in full conformance with the 38 provisions of BCP 78 and BCP 79. 40 Internet-Drafts are working documents of the Internet Engineering 41 Task Force (IETF). Note that other groups may also distribute 42 working documents as Internet-Drafts. The list of current Internet- 43 Drafts is at https://datatracker.ietf.org/drafts/current/. 45 Internet-Drafts are draft documents valid for a maximum of six months 46 and may be updated, replaced, or obsoleted by other documents at any 47 time. It is inappropriate to use Internet-Drafts as reference 48 material or to cite them other than as "work in progress." 49 This Internet-Draft will expire on 28 April 2022. 51 Copyright Notice 53 Copyright (c) 2021 IETF Trust and the persons identified as the 54 document authors. All rights reserved. 56 This document is subject to BCP 78 and the IETF Trust's Legal 57 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 58 license-info) in effect on the date of publication of this document. 59 Please review these documents carefully, as they describe your rights 60 and restrictions with respect to this document. Code Components 61 extracted from this document must include Simplified BSD License text 62 as described in Section 4.e of the Trust Legal Provisions and are 63 provided without warranty as described in the Simplified BSD License. 65 Table of Contents 67 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 68 1.1. Conventions and Definitions . . . . . . . . . . . . . . . 4 69 2. Multiplexing . . . . . . . . . . . . . . . . . . . . . . . . 4 70 2.1. Datagram Contexts . . . . . . . . . . . . . . . . . . . . 4 71 2.2. Datagram Formats . . . . . . . . . . . . . . . . . . . . 5 72 2.3. Context ID Allocation . . . . . . . . . . . . . . . . . . 5 73 3. HTTP/3 DATAGRAM Format . . . . . . . . . . . . . . . . . . . 6 74 4. Capsules . . . . . . . . . . . . . . . . . . . . . . . . . . 7 75 4.1. Capsule Protocol . . . . . . . . . . . . . . . . . . . . 8 76 4.2. Requirements . . . . . . . . . . . . . . . . . . . . . . 9 77 4.3. Intermediary Processing . . . . . . . . . . . . . . . . . 9 78 4.4. Capsule Types . . . . . . . . . . . . . . . . . . . . . . 10 79 4.4.1. The Datagram Registration Capsules . . . . . . . . . 10 80 4.4.2. The Datagram Close Capsule . . . . . . . . . . . . . 11 81 4.4.3. The Datagram Capsules . . . . . . . . . . . . . . . . 13 82 5. The H3_DATAGRAM HTTP/3 SETTINGS Parameter . . . . . . . . . . 14 83 5.1. Note About Draft Versions . . . . . . . . . . . . . . . . 15 84 6. The Sec-Use-Datagram-Contexts HTTP Header . . . . . . . . . . 15 85 7. Prioritization . . . . . . . . . . . . . . . . . . . . . . . 16 86 8. Security Considerations . . . . . . . . . . . . . . . . . . . 17 87 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17 88 9.1. HTTP/3 SETTINGS Parameter . . . . . . . . . . . . . . . . 17 89 9.2. HTTP Header Field Name . . . . . . . . . . . . . . . . . 17 90 9.3. Capsule Types . . . . . . . . . . . . . . . . . . . . . . 18 91 9.4. Datagram Format Types . . . . . . . . . . . . . . . . . . 18 92 9.5. Context Close Codes . . . . . . . . . . . . . . . . . . . 19 93 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 20 94 10.1. Normative References . . . . . . . . . . . . . . . . . . 20 95 10.2. Informative References . . . . . . . . . . . . . . . . . 21 96 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 21 97 A.1. CONNECT-UDP . . . . . . . . . . . . . . . . . . . . . . . 21 98 A.2. CONNECT-UDP with Delayed Timestamp Extension . . . . . . 22 99 A.2.1. With Delay . . . . . . . . . . . . . . . . . . . . . 22 100 A.3. Successful Optimistic . . . . . . . . . . . . . . . . . . 23 101 A.4. Optimistic but Unsupported . . . . . . . . . . . . . . . 24 102 A.5. CONNECT-IP with IP compression . . . . . . . . . . . . . 25 103 A.6. WebTransport . . . . . . . . . . . . . . . . . . . . . . 26 104 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 27 105 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 27 107 1. Introduction 109 The QUIC DATAGRAM extension [DGRAM] provides application protocols 110 running over QUIC [QUIC] with a mechanism to send unreliable data 111 while leveraging the security and congestion-control properties of 112 QUIC. However, QUIC DATAGRAM frames do not provide a means to 113 demultiplex application contexts. This document describes how to use 114 QUIC DATAGRAM frames when the application protocol running over QUIC 115 is HTTP/3 [H3]. It associates datagrams with client-initiated 116 bidirectional streams and defines an optional additional 117 demultiplexing layer. Additionally, this document defines how to 118 convey datagrams over prior versions of HTTP. 120 This document is structured as follows: 122 * Section 2 presents core concepts for multiplexing across HTTP 123 versions. 125 - Section 2.1 defines datagram contexts, an optional end-to-end 126 multiplexing concept scoped to each HTTP request. Whether 127 contexts are in use is defined in Section 6. 129 - Section 2.2 defines datagram formats, which are scoped to 130 contexts. Formats communicate the format and encoding of 131 datagrams sent using the associated context. 133 - Contexts are identified using a variable-length integer. 134 Requirements for allocating identifier values are detailed in 135 Section 2.3. 137 * Section 3 defines how QUIC DATAGRAM frames are used with HTTP/3. 138 Section 5 defines an HTTP/3 setting that endpoints can use to 139 advertise support of the frame. 141 * Section 4 introduces the Capsule Protocol and the "data stream" 142 concept. Data streams are initiated using special-purpose HTTP 143 requests, after which Capsules, an end-to-end message, can be 144 sent. 146 - The following Capsule types are defined, together with guidance 147 for defining new types: 149 o Datagram registration capsules Section 4.4.1 151 o Datagram close capsule Section 4.4.2 153 o Datagram capsules Section 4.4.3 155 1.1. Conventions and Definitions 157 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 158 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 159 "OPTIONAL" in this document are to be interpreted as described in BCP 160 14 [RFC2119] [RFC8174] when, and only when, they appear in all 161 capitals, as shown here. 163 2. Multiplexing 165 When running over HTTP/3, multiple exchanges of datagrams need the 166 ability to coexist on a given QUIC connection. To allow this, HTTP 167 datagrams contain two layers of multiplexing. First, the QUIC 168 DATAGRAM frame payload starts with an encoded stream identifier that 169 associates the datagram with a given QUIC stream. Second, datagrams 170 optionally carry a context identifier (see Section 2.1) that allows 171 multiplexing multiple datagram contexts related to a given HTTP 172 request. Conceptually, the first layer of multiplexing is per-hop, 173 while the second is end-to-end. 175 When running over HTTP/2, the first level of demultiplexing is 176 provided by the HTTP/2 framing layer. When running over HTTP/1, 177 requests are strictly serialized in the connection, therefore the 178 first layer of demultiplexing is not needed. 180 2.1. Datagram Contexts 182 Within the scope of a given HTTP request, contexts provide an 183 additional demultiplexing layer. Contexts determine the encoding of 184 datagrams, and can be used to implicitly convey metadata. For 185 example, contexts can be used for compression to elide some parts of 186 the datagram: the context identifier then maps to a compression 187 context that the receiver can use to reconstruct the elided data. 189 While stream IDs are a per-hop concept, context IDs are an end-to-end 190 concept. In other words, if a datagram travels through one or more 191 intermediaries on its way from client to server, the stream ID will 192 most likely change from hop to hop, but the context ID will remain 193 the same. Context IDs are opaque to intermediaries. 195 Contexts are OPTIONAL to implement for both endpoints. 196 Intermediaries do not require any context-specific software to enable 197 contexts. When contexts are supported by the implementation, their 198 use is optional and can be selected on each stream. Endpoints inform 199 their peer of whether they wish to use contexts via the Sec-Use- 200 Datagram-Contexts HTTP header, see Section 6. 202 When contexts are used, they are identified within the scope of a 203 given request by a numeric value, referred to as the context ID. A 204 context ID is a 62-bit integer (0 to 2^62-1). 206 2.2. Datagram Formats 208 When an endpoint registers a datagram context (or the lack of 209 contexts), it communicates the format (i.e., the semantics and 210 encoding) of datagrams sent using this context. This is 211 acccomplished by sending a Datagram Format Type as part of the 212 datagram registration capsule, see Section 4.4.1. This type 213 identifier is registered with IANA (see Section 9.4) and allows 214 applications that use HTTP Datagrams to indicate what the content of 215 datagrams are. Registration capsules carry a Datagram Format 216 Additional Data field which allows sending some additional 217 information that would impact the format of datagrams. 219 For example, a protocol which proxies IP packets can define a 220 Datagram Format Type which represents an IP packet. The 221 corresponding Datagram Format Additional Data field would be empty. 222 An extension to such a protocol that wishes to compress IP addresses 223 could define a distinct Datagram Format Type and exchange two IP 224 addresses via the Datagram Format Additional Data field. Then any 225 datagrams with that type would contain the IP packet with addresses 226 elided. 228 2.3. Context ID Allocation 230 Implementations of HTTP Datagrams that support datagram contexts MUST 231 provide a context ID allocation service. That service will allow 232 applications co-located with HTTP to request a unique context ID that 233 they can subsequently use for their own purposes. The HTTP 234 implementation will then parse the context ID of incoming HTTP 235 Datagrams and use it to deliver the frame to the appropriate 236 application context. 238 Even-numbered context IDs are client-initiated, while odd-numbered 239 context IDs are server-initiated. This means that an HTTP client 240 implementation of the context ID allocation service MUST only provide 241 even-numbered IDs, while a server implementation MUST only provide 242 odd-numbered IDs. Note that, once allocated, any context ID can be 243 used by both client and server - only allocation carries separate 244 namespaces to avoid requiring synchronization. Additionally, note 245 that the context ID namespace is tied to a given HTTP request: it is 246 possible for the same numeral context ID to be used simultaneously in 247 distinct requests. 249 3. HTTP/3 DATAGRAM Format 251 When used with HTTP/3, the Datagram Data field of QUIC DATAGRAM 252 frames uses the following format (using the notation from the 253 "Notational Conventions" section of [QUIC]): 255 HTTP/3 Datagram { 256 Quarter Stream ID (i), 257 [Context ID (i)], 258 HTTP Datagram Payload (..), 259 } 261 Figure 1: HTTP/3 DATAGRAM Format 263 Quarter Stream ID: A variable-length integer that contains the value 264 of the client-initiated bidirectional stream that this datagram is 265 associated with, divided by four (the division by four stems from 266 the fact that HTTP requests are sent on client-initiated 267 bidirectional streams, and those have stream IDs that are 268 divisible by four). The largest legal QUIC stream ID value is 269 2^62-1, so the largest legal value of Quarter Stream ID is 2^62-1 270 / 4. Receipt of a frame that includes a larger value MUST be 271 treated as a connection error of type FRAME_ENCODING_ERROR. 273 Context ID: A variable-length integer indicating the context ID of 274 the datagram (see Section 2.1). Whether or not this field is 275 present depends on whether datagram contexts are in use on this 276 stream, see Section 6. If this QUIC DATAGRAM frame is reordered 277 and arrives before the receiver knows whether datagram contexts 278 are in use on this stream, then the receiver cannot parse this 279 datagram and the receiver MUST either drop that datagram silently 280 or buffer it temporarily. 282 HTTP Datagram Payload: The payload of the datagram, whose semantics 283 are defined by individual applications. Note that this field can 284 be empty. 286 Intermediaries parse the Quarter Stream ID field in order to 287 associate the QUIC DATAGRAM frame with a stream. If an intermediary 288 receives a QUIC DATAGRAM frame whose payload is too short to allow 289 parsing the Quarter Stream ID field, the intermediary MUST treat it 290 as an HTTP/3 connection error of type H3_GENERAL_PROTOCOL_ERROR. The 291 Context ID field is optional and whether it is present or not is 292 decided end-to-end by the endpoints, see Section 6. Therefore 293 intermediaries cannot know whether the Context ID field is present or 294 absent and they MUST ignore any HTTP/3 Datagram fields after the 295 Quarter Stream ID. 297 Endpoints parse both the Quarter Stream ID field and the Context ID 298 field in order to associate the QUIC DATAGRAM frame with a stream and 299 context within that stream. If an endpoint receives a QUIC DATAGRAM 300 frame whose payload is too short to allow parsing the Quarter Stream 301 ID field, the endpoint MUST treat it as an HTTP/3 connection error of 302 type H3_GENERAL_PROTOCOL_ERROR. If an endpoint receives a QUIC 303 DATAGRAM frame whose payload is long enough to allow parsing the 304 Quarter Stream ID field but too short to allow parsing the Context ID 305 field, the endpoint MUST abruptly terminate the corresponding stream 306 with a stream error of type H3_GENERAL_PROTOCOL_ERROR. 308 Endpoints MUST NOT send HTTP/3 datagrams unless the corresponding 309 stream's send side is open. On a given endpoint, once the receive 310 side of a stream is closed, incoming datagrams for this stream are no 311 longer expected so the endpoint can release related state. Endpoints 312 MAY keep state for a short time to account for reordering. Once the 313 state is released, the endpoint MUST silently drop received 314 associated datagrams. 316 If an HTTP/3 datagram is received and its Quarter Stream ID maps to a 317 stream that has not yet been created, the receiver SHALL either drop 318 that datagram silently or buffer it temporarily while awaiting the 319 creation of the corresponding stream. 321 4. Capsules 323 This specification introduces the Capsule Protocol. The Capsule 324 Protocol is a sequence of type-length-value tuples that allows 325 endpoints to reliably communicate request-related information end-to- 326 end, even in the presence of HTTP intermediaries. 328 4.1. Capsule Protocol 330 This specification defines the "data stream" of an HTTP request as 331 the bidirectional stream of bytes that follow the headers in both 332 directions. In HTTP/1.x, the data stream consists of all bytes on 333 the connection that follow the blank line that concludes either the 334 request header section, or the 2xx (Successful) response header 335 section. In HTTP/2 and HTTP/3, the data stream of a given HTTP 336 request consists of all bytes sent in DATA frames with the 337 corresponding stream ID. The concept of a data stream is 338 particularly relevant for methods such as CONNECT where there is no 339 HTTP message content after the headers. 341 Definitions of new HTTP Methods or of new HTTP Upgrade Tokens can 342 state that their data stream uses the Capsule Protocol. If they do 343 so, that means that the contents of their data stream uses the 344 following format (using the notation from the "Notational 345 Conventions" section of [QUIC]): 347 Capsule Protocol { 348 Capsule (..) ..., 349 } 351 Figure 2: Capsule Protocol Stream Format 353 Capsule { 354 Capsule Type (i), 355 Capsule Length (i), 356 Capsule Value (..), 357 } 359 Figure 3: Capsule Format 361 Capsule Type: A variable-length integer indicating the Type of the 362 capsule. Endpoints that receive a capsule with an unknown Capsule 363 Type MUST silently skip over that capsule. 365 Capsule Length: The length of the Capsule Value field following this 366 field, encoded as a variable-length integer. Note that this field 367 can have a value of zero. 369 Capsule Value: The payload of this capsule. Its semantics are 370 determined by the value of the Capsule Type field. 372 4.2. Requirements 374 If the definition of an HTTP Method or HTTP Upgrade Token states that 375 it uses the capsule protocol, its implementations MUST follow the 376 following requirements: 378 * A server MUST NOT send any Transfer-Encoding or Content-Length 379 header fields in a 2xx (Successful) response. If a client 380 receives a Content-Length or Transfer-Encoding header fields in a 381 successful response, it MUST treat that response as malformed. 383 * A request message does not have content. 385 * A successful response message does not have content. 387 * Responses are not cacheable. 389 4.3. Intermediary Processing 391 Intermediaries MUST operate in one of the two following modes: 393 Pass-through mode: In this mode, the intermediary forwards the data 394 stream between two associated streams without any modification of 395 the data stream. 397 Participant mode: In this mode, the intermediary terminates the data 398 stream and parses all Capsule Type and Capsule Length fields it 399 receives. 401 Each Capsule Type determines whether it is opaque or transparent to 402 intermediaries in participant mode: opaque capsules are forwarded 403 unmodified while transparent ones can be parsed, added, or removed by 404 intermediaries. Intermediaries MAY modify the contents of the 405 Capsule Data field of transparent capsule types. 407 Unless otherwise specified, all Capsule Types are defined as opaque 408 to intermediaries. Intermediaries MUST forward all received opaque 409 CAPSULE frames in their unmodified entirety. Intermediaries MUST NOT 410 send any opaque CAPSULE frames other than the ones it is forwarding. 411 All Capsule Types defined in this document are opaque, with the 412 exception of the datagram capsules, see Section 4.4.3. Definitions 413 of new Capsule Types MAY specify that the newly introduced type is 414 transparent. Intermediaries MUST treat unknown Capsule Types as 415 opaque. 417 Intermediaries respect the order of opaque CAPSULE frames: if an 418 intermediary receives two opaque CAPSULE frames in a given order, it 419 MUST forward them in the same order. 421 Endpoints which receive a Capsule with an unknown Capsule Type MUST 422 silently drop that Capsule. 424 4.4. Capsule Types 426 4.4.1. The Datagram Registration Capsules 428 This document defines the REGISTER_DATAGRAM and 429 REGISTER_DATAGRAM_CONTEXT capsules types, known collectively as the 430 datagram registration capsules (see Section 9.3 for the value of the 431 capsule types). The REGISTER_DATAGRAM capsule is used by endpoints 432 to inform their peer of the encoding and semantics of all datagrams 433 associated with a stream. The REGISTER_DATAGRAM_CONTEXT capsule is 434 used by endpoints to inform their peer of the encoding and semantics 435 of all datagrams associated with a given context ID on this stream. 437 Datagram Registration Capsule { 438 Type (i) = REGISTER_DATAGRAM or REGISTER_DATAGRAM_CONTEXT, 439 Length (i), 440 [Context ID (i)], 441 Datagram Format Type (i), 442 Datagram Format Additional Data (..), 443 } 445 Figure 4: REGISTER_DATAGRAM_CONTEXT Capsule Format 447 Context ID: A variable-length integer indicating the context ID to 448 register (see Section 2.1). This field is present in 449 REGISTER_DATAGRAM_CONTEXT capsules but not in REGISTER_DATAGRAM 450 capsules. If a REGISTER_DATAGRAM capsule is used on a stream 451 where datagram contexts are in use, it is associated with context 452 ID 0. REGISTER_DATAGRAM_CONTEXT capsules MUST NOT carry context 453 ID 0 as that context ID is conveyed using the REGISTER_DATAGRAM 454 capsule. 456 Datagram Format Type: A variable-length integer that defines the 457 semantics and encoding of the HTTP Datagram Payload field of 458 datagrams with this context ID, see Section 2.2. 460 Datagram Format Additional Data: This field carries additional 461 information that impact the format of datagrams with this context 462 ID, see Section 2.2. 464 Note that these registrations are unilateral and bidirectional: the 465 sender of the capsule unilaterally defines the semantics it will 466 apply to the datagrams it sends and receives using this context ID. 467 Once a context ID is registered, it can be used in both directions. 469 Endpoints MUST NOT send HTTP Datagrams until they have either sent or 470 received a datagram registration capsule with the same Context ID. 471 However, reordering can cause HTTP Datagrams to be received with an 472 unknown Context ID. Receipt of such HTTP datagrams MUST NOT be 473 treated as an error. Endpoints SHALL drop the HTTP Datagram 474 silently, or buffer it temporarily while awaiting the corresponding 475 datagram registration capsule. Intermediaries SHALL drop the HTTP 476 Datagram silently, MAY buffer it, or forward it on immediately. 478 Endpoints MUST NOT register the same Context ID twice on the same 479 stream. This also applies to Context IDs that have been closed using 480 a CLOSE_DATAGRAM_CONTEXT capsule. Clients MUST NOT register server- 481 initiated Context IDs and servers MUST NOT register client-initiated 482 Context IDs. If an endpoint receives a REGISTER_DATAGRAM_CONTEXT 483 capsule that violates one or more of these requirements, the endpoint 484 MUST abruptly terminate the corresponding stream with a stream error 485 of type H3_GENERAL_PROTOCOL_ERROR. 487 If datagrams contexts are not in use, the client is responsible for 488 choosing the datagram format and informing the server via a 489 REGISTER_DATAGRAM capsule. Servers MUST NOT send the 490 REGISTER_DATAGRAM capsule. If a client receives a REGISTER_DATAGRAM 491 capsule, the client MUST abruptly terminate the corresponding stream 492 with a stream error of type H3_GENERAL_PROTOCOL_ERROR. 494 4.4.2. The Datagram Close Capsule 496 The CLOSE_DATAGRAM_CONTEXT capsule (see Section 9.3 for the value of 497 the capsule type) allows an endpoint to inform its peer that it will 498 no longer send or parse received datagrams associated with a given 499 context ID. 501 CLOSE_DATAGRAM_CONTEXT Capsule { 502 Type (i) = CLOSE_DATAGRAM_CONTEXT, 503 Length (i), 504 Context ID (i), 505 Close Code (i), 506 Close Details (..), 507 } 509 Figure 5: CLOSE_DATAGRAM_CONTEXT Capsule Format 511 Context ID: The context ID to close. 513 Close Code: The close code allows an endpoint to provide additional 514 information as to why a datagram context was closed. 515 Section 4.4.2.1 defines a set of codes, the circumstances under 516 which an implementation sends them, and how receivers react. 518 Close Details: This is meant for debugging purposes. It consists of 519 a human-readable string encoded in UTF-8. 521 Note that this close is unilateral and bidirectional: the sender of 522 the frame unilaterally informs its peer of the closure. Endpoints 523 can use CLOSE_DATAGRAM_CONTEXT capsules to close a context that was 524 initially registered by either themselves, or by their peer. 525 Endpoints MAY use the CLOSE_DATAGRAM_CONTEXT capsule to immediately 526 reject a context that was just registered using a 527 REGISTER_DATAGRAM_CONTEXT capsule if they find its Datagram Format 528 Type field to be unacceptable. 530 After an endpoint has either sent or received a 531 CLOSE_DATAGRAM_CONTEXT frame, it MUST NOT send any HTTP Datagrams 532 with that Context ID. However, due to reordering, an endpoint that 533 receives an HTTP Datagram with a closed Context ID MUST NOT treat it 534 as an error, it SHALL instead drop the HTTP Datagram silently. 536 Endpoints MUST NOT close a Context ID that was not previously 537 registered. Endpoints MUST NOT close a Context ID that has already 538 been closed. If an endpoint receives a CLOSE_DATAGRAM_CONTEXT 539 capsule that violates one or more of these requirements, the endpoint 540 MUST abruptly terminate the corresponding stream with a stream error 541 of type H3_GENERAL_PROTOCOL_ERROR. 543 4.4.2.1. Close Codes 545 Close codes are intended to allow implementations to react 546 differently when they receive them - for example, some close codes 547 require the receiver to not open another context under certain 548 conditions. 550 This specification defines the close codes below. Their numeric 551 values are in Section 9.5. Extensions to this mechanism MAY define 552 new close codes and they SHOULD state how receivers react to them. 554 NO_ERROR: This indicates that a context was closed without any 555 action specified for the receiver. 557 UNKNOWN_FORMAT: This indicates that the sender does not know how to 558 interpret the datagram format type associated with this context. 559 The endpoint that had originally registered this context MUST NOT 560 try to register another context with the same datagram format type 561 on this stream. 563 DENIED: This indicates that the sender has rejected the context 564 registration based on its local policy. The endpoint that had 565 originally registered this context MUST NOT try to register 566 another context with the same datagram format type and datagram 567 format data on this stream. 569 RESOURCE_LIMIT: This indicates that the context was closed to save 570 resources. The recipient SHOULD limit its future registration of 571 resource-intensive contexts. 573 Receipt of an unknown close code MUST be treated as if the NO_ERROR 574 code was present. Close codes are registered with IANA, see 575 Section 9.5. 577 4.4.3. The Datagram Capsules 579 This document defines the DATAGRAM and DATAGRAM_WITH_CONTEXT capsules 580 types, known collectively as the datagram capsules (see Section 9.3 581 for the value of the capsule types). These capsules allow an 582 endpoint to send a datagram frame over an HTTP stream. This is 583 particularly useful when using a version of HTTP that does not 584 support QUIC DATAGRAM frames. 586 Datagram Capsule { 587 Type (i) = DATAGRAM or DATAGRAM_WITH_CONTEXT, 588 Length (i), 589 [Context ID (i)], 590 HTTP Datagram Payload (..), 591 } 593 Figure 6: DATAGRAM Capsule Format 595 Context ID: A variable-length integer indicating the context ID of 596 the datagram (see Section 2.1). This field is present in 597 DATAGRAM_WITH_CONTEXT capsules but not in DATAGRAM capsules. If a 598 DATAGRAM capsule is used on a stream where datagram contexts are 599 in use, it is associated with context ID 0. DATAGRAM_WITH_CONTEXT 600 capsules MUST NOT carry context ID 0 as that context ID is 601 conveyed using the DATAGRAM capsule. 603 HTTP Datagram Payload: The payload of the datagram, whose semantics 604 are defined by individual applications. Note that this field can 605 be empty. 607 Datagrams sent using the datagram capsule have the exact same 608 semantics as datagrams sent in QUIC DATAGRAM frames. In particular, 609 the restrictions on when it is allowed to send an HTTP Datagram and 610 how to process them from Section 3 also apply to HTTP Datagrams sent 611 and received using the datagram capsules. 613 The datagram capsules are transparent to intermediaries, meaning that 614 intermediaries MAY parse them and send datagram capsules that they 615 did not receive. This allows an intermediary to reencode HTTP 616 Datagrams as it forwards them: in other words, an intermediary MAY 617 send a datagram capsule to forward an HTTP Datagram which was 618 received in a QUIC DATAGRAM frame, and vice versa. 620 Note that while datagram capsules are sent on a stream, 621 intermediaries can reencode HTTP Datagrams into QUIC DATAGRAM frames 622 over the next hop, and those could be dropped. Because of this, 623 applications have to always consider HTTP Datagrams to be unreliable, 624 even if they were initially sent in a capsule. 626 If an intermediary receives an HTTP Datagram in a QUIC DATAGRAM frame 627 and is forwarding it on a connection that supports QUIC DATAGRAM 628 frames, the intermediary SHOULD NOT convert that HTTP Datagram to a 629 DATAGRAM capsule. If the HTTP Datagram is too large to fit in a 630 DATAGRAM frame (for example because the path MTU of that QUIC 631 connection is too low or if the maximum UDP payload size advertised 632 on that connection is too low), the intermediary SHOULD drop the HTTP 633 Datagram instead of converting it to a DATAGRAM capsule. This 634 preserves the end-to-end unreliability characteristic that methods 635 such as Datagram Packetization Layer Path MTU Discovery (DPLPMTUD) 636 depend on [RFC8899]. An intermediary that converts QUIC DATAGRAM 637 frames to datagram capsules allows HTTP Datagrams to be arbitrarily 638 large without suffering any loss; this can misrepresent the true path 639 properties, defeating methods such a DPLPMTUD. 641 5. The H3_DATAGRAM HTTP/3 SETTINGS Parameter 643 Implementations of HTTP/3 that support HTTP Datagrams can indicate 644 that to their peer by sending the H3_DATAGRAM SETTINGS parameter with 645 a value of 1. The value of the H3_DATAGRAM SETTINGS parameter MUST 646 be either 0 or 1. A value of 0 indicates that HTTP Datagrams are not 647 supported. An endpoint that receives the H3_DATAGRAM SETTINGS 648 parameter with a value that is neither 0 or 1 MUST terminate the 649 connection with error H3_SETTINGS_ERROR. 651 Endpoints MUST NOT send QUIC DATAGRAM frames until they have both 652 sent and received the H3_DATAGRAM SETTINGS parameter with a value of 653 1. 655 When clients use 0-RTT, they MAY store the value of the server's 656 H3_DATAGRAM SETTINGS parameter. Doing so allows the client to send 657 QUIC DATAGRAM frames in 0-RTT packets. When servers decide to accept 658 0-RTT data, they MUST send a H3_DATAGRAM SETTINGS parameter greater 659 than or equal to the value they sent to the client in the connection 660 where they sent them the NewSessionTicket message. If a client 661 stores the value of the H3_DATAGRAM SETTINGS parameter with their 662 0-RTT state, they MUST validate that the new value of the H3_DATAGRAM 663 SETTINGS parameter sent by the server in the handshake is greater 664 than or equal to the stored value; if not, the client MUST terminate 665 the connection with error H3_SETTINGS_ERROR. In all cases, the 666 maximum permitted value of the H3_DATAGRAM SETTINGS parameter is 1. 668 5.1. Note About Draft Versions 670 [[RFC editor: please remove this section before publication.]] 672 Some revisions of this draft specification use a different value (the 673 Identifier field of a Setting in the HTTP/3 SETTINGS frame) for the 674 H3_DATAGRAM Settings Parameter. This allows new draft revisions to 675 make incompatible changes. Multiple draft versions MAY be supported 676 by either endpoint in a connection. Such endpoints MUST send 677 multiple values for H3_DATAGRAM. Once an endpoint has sent and 678 received SETTINGS, it MUST compute the intersection of the values it 679 has sent and received, and then it MUST select and use the most 680 recent draft version from the intersection set. This ensures that 681 both endpoints negotiate the same draft version. 683 6. The Sec-Use-Datagram-Contexts HTTP Header 685 Endpoints indicate their support for datagram contexts by sending the 686 Sec-Use-Datagram-Contexts header with a value of ?1. If the header 687 is missing or has a value different from ?1, that indicates that its 688 sender does not wish to use datagram contexts. Endpoints that wish 689 to use datagram contexts SHALL send the Sec-Use-Datagram-Contexts 690 header with a value of ?1 on requests and responses that use the 691 capsule protocol. 693 "Sec-Use-Datagram-Contexts" is an Item Structured Header [RFC8941]. 694 Its value MUST be a Boolean, its ABNF is: 696 Sec-Use-Datagram-Contexts = sf-boolean 698 The REGISTER_DATAGRAM_CONTEXT, DATAGRAM_WITH_CONTEXT, and 699 CLOSE_DATAGRAM_CONTEXT capsules as refered to as context-related 700 capsules. Endpoints which do not wish to use contexts MUST NOT send 701 context-related capsules, and MUST silently ignore any received 702 context-related capsules. 704 Both endpoints unilaterally decide whether they wish to use datagram 705 contexts on a given stream. Contexts are used on a given stream if 706 and only if both endpoints indicate they wish to use them on this 707 stream. Once an endpoint has received the HTTP request or response, 708 it knows whether datagram contexts are in use on this stream or not. 710 Conceptually, when datagram contexts are not in use on a stream, all 711 datagrams use context ID 0, which is client-initiated. This means 712 that the client chooses the datagram format for all datagrams when 713 datagram contexts are not in use. 715 If datagram contexts are not in use on a stream, endpoints MUST NOT 716 send context-related capsules to the peer on that stream. Clients 717 MAY optimistically send context-related capsules before learning 718 whether the server wishes to support datagram contexts or not. 720 This allows a client to optimistically use extensions that rely on 721 datagram contexts without knowing a priori whether the server 722 supports them, and without incurring a latency cost to negotiate 723 extension support. In this scenario, the client would send its 724 request with the Sec-Use-Datagram-Contexts header set to ?1, and 725 register two datagram contexts: the main context would use context ID 726 0 and the extension context would use context ID 2. The client then 727 sends a REGISTER_DATAGRAM capsule to register the main context, and a 728 REGISTER_DATAGRAM_CONTEXT to register the extension context. The 729 client can then immediately send DATAGRAM capsules to send main 730 datagrams and DATAGRAM_WITH_CONTEXT capsules to send extension 731 datagrams. 733 * If the server wishes to use datagram contexts, it will set Sec- 734 Use-Datagram-Contexts to ?1 on its response and correctly parse 735 all the received capsules. 737 * If the server does not wish to use datagram contexts (for example 738 if the server implementation does not support them), it will not 739 set Sec-Use-Datagram-Contexts to ?1 on its response. It will then 740 parse the REGISTER_DATAGRAM and DATAGRAM capsules without datagram 741 contexts being in use on this stream, and parse the main datagrams 742 correctly while silently dropping the extension datagrams. Once 743 the client receives the server's response, it will know datagram 744 contexts are not in use, and then will be able to send HTTP 745 Datagrams via the QUIC DATAGRAM frame. 747 Extensions MAY define a different mechanism to communicate whether 748 contexts are in use, and they MAY do so in a way which is opaque to 749 intermediaries. 751 7. Prioritization 753 Data streams (see Section 4.1) can be prioritized using any means 754 suited to stream or request prioritization. For example, see 755 Section 11 of [PRIORITY]. 757 Prioritization of HTTP/3 datagrams is not defined in this document. 758 Future extensions MAY define how to prioritize datagrams, and MAY 759 define signaling to allow endpoints to communicate their 760 prioritization preferences. 762 8. Security Considerations 764 Since this feature requires sending an HTTP/3 Settings parameter, it 765 "sticks out". In other words, probing clients can learn whether a 766 server supports this feature. Implementations that support this 767 feature SHOULD always send this Settings parameter to avoid leaking 768 the fact that there are applications using HTTP/3 datagrams enabled 769 on this endpoint. 771 9. IANA Considerations 773 9.1. HTTP/3 SETTINGS Parameter 775 This document will request IANA to register the following entry in 776 the "HTTP/3 Settings" registry: 778 +==============+==========+===============+=========+ 779 | Setting Name | Value | Specification | Default | 780 +==============+==========+===============+=========+ 781 | H3_DATAGRAM | 0xffd277 | This Document | 0 | 782 +--------------+----------+---------------+---------+ 784 Table 1: New HTTP/3 Settings 786 9.2. HTTP Header Field Name 788 This document will request IANA to register the following entry in 789 the "HTTP Field Name" registry: 791 Field Name: Sec-Use-Datagram-Contexts 793 Template: None 795 Status: provisional (permanent if this document is approved) 797 Reference: This document 799 Comments: None 801 9.3. Capsule Types 803 This document establishes a registry for HTTP capsule type codes. 804 The "HTTP Capsule Types" registry governs a 62-bit space. 805 Registrations in this registry MUST include the following fields: 807 Type: A name or label for the capsule type. 809 Value: The value of the Capsule Type field (see Section 4.1) is a 810 62-bit integer. 812 Reference: An optional reference to a specification for the type. 813 This field MAY be empty. 815 Registrations follow the "First Come First Served" policy (see 816 Section 4.4 of [IANA-POLICY]) where two registrations MUST NOT have 817 the same Type. 819 This registry initially contains the following entries: 821 +===========================+==========+===============+ 822 | Capsule Type | Value | Specification | 823 +===========================+==========+===============+ 824 | REGISTER_DATAGRAM_CONTEXT | 0xff37a1 | This Document | 825 +---------------------------+----------+---------------+ 826 | REGISTER_DATAGRAM | 0xff37a2 | This Document | 827 +---------------------------+----------+---------------+ 828 | CLOSE_DATAGRAM_CONTEXT | 0xff37a3 | This Document | 829 +---------------------------+----------+---------------+ 830 | DATAGRAM_WITH_CONTEXT | 0xff37a4 | This Document | 831 +---------------------------+----------+---------------+ 832 | DATAGRAM | 0xff37a5 | This Document | 833 +---------------------------+----------+---------------+ 835 Table 2: Initial Capsule Types Registry Entries 837 Capsule types with a value of the form 41 * N + 23 for integer values 838 of N are reserved to exercise the requirement that unknown capsule 839 types be ignored. These capsules have no semantics and can carry 840 arbitrary values. These values MUST NOT be assigned by IANA and MUST 841 NOT appear in the listing of assigned values. 843 9.4. Datagram Format Types 845 This document establishes a registry for HTTP datagram format type 846 codes. The "HTTP Datagram Format Types" registry governs a 62-bit 847 space. Registrations in this registry MUST include the following 848 fields: 850 Type: A name or label for the datagram format type. 852 Value: The value of the Datagram Format Type field (see Section 2.2) 853 is a 62-bit integer. 855 Reference: An optional reference to a specification for the 856 parameter. This field MAY be empty. 858 Registrations follow the "First Come First Served" policy (see 859 Section 4.4 of [IANA-POLICY]) where two registrations MUST NOT have 860 the same Type nor Value. 862 This registry is initially empty. 864 Datagram format types with a value of the form 41 * N + 17 for 865 integer values of N are reserved to exercise the requirement that 866 unknown datagram format types be ignored. These format types have no 867 semantics and can carry arbitrary values. These values MUST NOT be 868 assigned by IANA and MUST NOT appear in the listing of assigned 869 values. 871 9.5. Context Close Codes 873 This document establishes a registry for HTTP context close codes. 874 The "HTTP Context Close Codes" registry governs a 62-bit space. 875 Registrations in this registry MUST include the following fields: 877 Type: A name or label for the close code. 879 Value: The value of the Close Code field (see Section 4.4.2) is a 880 62-bit integer. 882 Reference: An optional reference to a specification for the 883 parameter. This field MAY be empty. 885 Registrations follow the "First Come First Served" policy (see 886 Section 4.4 of [IANA-POLICY]) where two registrations MUST NOT have 887 the same Type nor Value. 889 This registry initially contains the following entries: 891 +====================+==========+===============+ 892 | Context Close Code | Value | Specification | 893 +====================+==========+===============+ 894 | NO_ERROR | 0xff78a0 | This Document | 895 +--------------------+----------+---------------+ 896 | UNKNOWN_FORMAT | 0xff78a1 | This Document | 897 +--------------------+----------+---------------+ 898 | DENIED | 0xff78a2 | This Document | 899 +--------------------+----------+---------------+ 900 | RESOURCE_LIMIT | 0xff78a3 | This Document | 901 +--------------------+----------+---------------+ 903 Table 3: Initial Context Close Code Registry 904 Entries 906 Context close codes with a value of the form 41 * N + 19 for integer 907 values of N are reserved to exercise the requirement that unknown 908 context close codes be treated as NO_ERROR. These values MUST NOT be 909 assigned by IANA and MUST NOT appear in the listing of assigned 910 values. 912 10. References 914 10.1. Normative References 916 [DGRAM] Pauly, T., Kinnear, E., and D. Schinazi, "An Unreliable 917 Datagram Extension to QUIC", Work in Progress, Internet- 918 Draft, draft-ietf-quic-datagram-06, 5 October 2021, 919 . 922 [H3] Bishop, M., "Hypertext Transfer Protocol Version 3 923 (HTTP/3)", Work in Progress, Internet-Draft, draft-ietf- 924 quic-http-34, 2 February 2021, 925 . 928 [IANA-POLICY] 929 Cotton, M., Leiba, B., and T. Narten, "Guidelines for 930 Writing an IANA Considerations Section in RFCs", BCP 26, 931 RFC 8126, DOI 10.17487/RFC8126, June 2017, 932 . 934 [QUIC] Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based 935 Multiplexed and Secure Transport", RFC 9000, 936 DOI 10.17487/RFC9000, May 2021, 937 . 939 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 940 Requirement Levels", BCP 14, RFC 2119, 941 DOI 10.17487/RFC2119, March 1997, 942 . 944 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 945 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 946 May 2017, . 948 [RFC8941] Nottingham, M. and P-H. Kamp, "Structured Field Values for 949 HTTP", RFC 8941, DOI 10.17487/RFC8941, February 2021, 950 . 952 10.2. Informative References 954 [PRIORITY] Oku, K. and L. Pardue, "Extensible Prioritization Scheme 955 for HTTP", Work in Progress, Internet-Draft, draft-ietf- 956 httpbis-priority-07, 25 October 2021, 957 . 960 [RFC8899] Fairhurst, G., Jones, T., Tüxen, M., Rüngeler, I., and T. 961 Völker, "Packetization Layer Path MTU Discovery for 962 Datagram Transports", RFC 8899, DOI 10.17487/RFC8899, 963 September 2020, . 965 Appendix A. Examples 967 A.1. CONNECT-UDP 969 In this example, the client does not support any CONNECT-UDP nor HTTP 970 Datagram extensions, and therefore has no use for datagram contexts 971 on this stream. 973 Client Server 975 STREAM(44): HEADERS --------> 976 :method = CONNECT 977 :protocol = connect-udp 978 :scheme = https 979 :path = /target.example.org/443/ 980 :authority = proxy.example.org:443 982 STREAM(44): DATA --------> 983 Capsule Type = REGISTER_DATAGRAM 984 Datagram Format Type = UDP_PAYLOAD 985 Datagram Format Additional Data = "" 987 DATAGRAM --------> 988 Quarter Stream ID = 11 989 Payload = Encapsulated UDP Payload 991 <-------- STREAM(44): HEADERS 992 :status = 200 994 /* Wait for target server to respond to UDP packet. */ 996 <-------- DATAGRAM 997 Quarter Stream ID = 11 998 Payload = Encapsulated UDP Payload 1000 A.2. CONNECT-UDP with Delayed Timestamp Extension 1002 In these examples, the client supports a CONNECT-UDP Timestamp 1003 Extension, which uses a different Datagram Format Type that carries a 1004 timestamp followed by the encapsulated UDP payload. 1006 A.2.1. With Delay 1008 In this instance, the client prefers to wait a round trip to learn 1009 whether the server supports datagram contexts. 1011 Client Server 1013 STREAM(44): HEADERS --------> 1014 :method = CONNECT 1015 :protocol = connect-udp 1016 :scheme = https 1017 :path = /target.example.org/443/ 1018 :authority = proxy.example.org:443 1019 Sec-Use-Datagram-Contexts = ?1 1021 <-------- STREAM(44): HEADERS 1022 :status = 200 1023 Sec-Use-Datagram-Contexts = ?1 1025 STREAM(44): DATA --------> 1026 Capsule Type = REGISTER_DATAGRAM_CONTEXT 1027 Context ID = 0 1028 Datagram Format Type = UDP_PAYLOAD 1029 Datagram Format Additional Data = "" 1031 DATAGRAM --------> 1032 Quarter Stream ID = 11 1033 Context ID = 0 1034 Payload = Encapsulated UDP Payload 1036 <-------- DATAGRAM 1037 Quarter Stream ID = 11 1038 Context ID = 0 1039 Payload = Encapsulated UDP Payload 1041 STREAM(44): DATA --------> 1042 Capsule Type = REGISTER_DATAGRAM_CONTEXT 1043 Context ID = 2 1044 Datagram Format Type = UDP_PAYLOAD_WITH_TIMESTAMP 1045 Datagram Format Additional Data = "" 1047 DATAGRAM --------> 1048 Quarter Stream ID = 11 1049 Context ID = 2 1050 Payload = Encapsulated UDP Payload With Timestamp 1052 A.3. Successful Optimistic 1054 In this instance, the client does not wish to spend a round trip 1055 waiting to learn whether the server supports datagram contexts. It 1056 registers its context optimistically in such a way that the server 1057 will react well whether it supports contexts or not. In this case, 1058 the server does support datagram contexts. 1060 Client Server 1062 STREAM(44): HEADERS --------> 1063 :method = CONNECT 1064 :protocol = connect-udp 1065 :scheme = https 1066 :path = /target.example.org/443/ 1067 :authority = proxy.example.org:443 1068 Sec-Use-Datagram-Contexts = ?1 1070 STREAM(44): DATA --------> 1071 Capsule Type = REGISTER_DATAGRAM 1072 Datagram Format Type = UDP_PAYLOAD 1073 Datagram Format Additional Data = "" 1075 STREAM(44): DATA --------> 1076 Capsule Type = DATAGRAM 1077 Payload = Encapsulated UDP Payload 1079 <-------- STREAM(44): HEADERS 1080 :status = 200 1081 Sec-Use-Datagram-Contexts = ?1 1083 /* Datagram contexts are in use on this stream */ 1085 <-------- DATAGRAM 1086 Quarter Stream ID = 11 1087 Context ID = 0 1088 Payload = Encapsulated UDP Payload 1090 STREAM(44): DATA --------> 1091 Capsule Type = REGISTER_DATAGRAM_CONTEXT 1092 Context ID = 2 1093 Datagram Format Type = UDP_PAYLOAD_WITH_TIMESTAMP 1094 Datagram Format Additional Data = "" 1096 DATAGRAM --------> 1097 Quarter Stream ID = 11 1098 Context ID = 2 1099 Payload = Encapsulated UDP Payload With Timestamp 1101 A.4. Optimistic but Unsupported 1103 In this instance, the client does not wish to spend a round trip 1104 waiting to learn whether the server supports datagram contexts. It 1105 registers its context optimistically in such a way that the server 1106 will react well whether it supports contexts or not. In this case, 1107 the server does not support datagram contexts. 1109 Client Server 1111 STREAM(44): HEADERS --------> 1112 :method = CONNECT 1113 :protocol = connect-udp 1114 :scheme = https 1115 :path = /target.example.org/443/ 1116 :authority = proxy.example.org:443 1117 Sec-Use-Datagram-Contexts = ?1 1119 STREAM(44): DATA --------> 1120 Capsule Type = REGISTER_DATAGRAM 1121 Datagram Format Type = UDP_PAYLOAD 1122 Datagram Format Additional Data = "" 1124 STREAM(44): DATA --------> 1125 Capsule Type = DATAGRAM 1126 Payload = Encapsulated UDP Payload 1128 <-------- STREAM(44): HEADERS 1129 :status = 200 1131 /* Datagram contexts are not in use on this stream */ 1133 <-------- DATAGRAM 1134 Quarter Stream ID = 11 1135 Payload = Encapsulated UDP Payload 1137 DATAGRAM --------> 1138 Quarter Stream ID = 11 1139 Payload = Encapsulated UDP Payload 1141 A.5. CONNECT-IP with IP compression 1143 Client Server 1145 STREAM(44): HEADERS --------> 1146 :method = CONNECT 1147 :protocol = connect-ip 1148 :scheme = https 1149 :path = / 1150 :authority = proxy.example.org:443 1151 Sec-Use-Datagram-Contexts = ?1 1153 <-------- STREAM(44): HEADERS 1154 :status = 200 1155 Sec-Use-Datagram-Contexts = ?1 1157 /* Exchange CONNECT-IP configuration information. */ 1159 STREAM(44): DATA --------> 1160 Capsule Type = REGISTER_DATAGRAM_CONTEXT 1161 Context ID = 0 1162 Datagram Format Type = IP_PACKET 1163 Datagram Format Additional Data = "" 1165 DATAGRAM --------> 1166 Quarter Stream ID = 11 1167 Context ID = 0 1168 Payload = Encapsulated IP Packet 1170 /* Endpoint happily exchange encapsulated IP packets */ 1171 /* using Quarter Stream ID 11 and Context ID 0. */ 1173 DATAGRAM --------> 1174 Quarter Stream ID = 11 1175 Context ID = 0 1176 Payload = Encapsulated IP Packet 1178 /* After performing some analysis on traffic patterns, */ 1179 /* the client decides it wants to compress a 2-tuple. */ 1181 STREAM(44): DATA --------> 1182 Capsule Type = REGISTER_DATAGRAM_CONTEXT 1183 Context ID = 2 1184 Datagram Format Type = COMPRESSED_IP_PACKET 1185 Datagram Format Additional Data = "192.0.2.6,192.0.2.7" 1187 DATAGRAM --------> 1188 Quarter Stream ID = 11 1189 Context ID = 2 1190 Payload = Compressed IP Packet 1192 A.6. WebTransport 1193 Client Server 1195 STREAM(44): HEADERS --------> 1196 :method = CONNECT 1197 :scheme = https 1198 :method = webtransport 1199 :path = /hello 1200 :authority = webtransport.example.org:443 1201 Origin = https://www.example.org:443 1203 STREAM(44): DATA --------> 1204 Capsule Type = REGISTER_DATAGRAM 1205 Datagram Format Type = WEBTRANSPORT_DATAGRAM 1206 Datagram Format Additional Data = "" 1208 <-------- STREAM(44): HEADERS 1209 :status = 200 1211 /* Both endpoints can now send WebTransport datagrams. */ 1213 Acknowledgments 1215 The DATAGRAM context identifier was previously part of the DATAGRAM 1216 frame definition itself, the authors would like to acknowledge the 1217 authors of that document and the members of the IETF MASQUE working 1218 group for their suggestions. Additionally, the authors would like to 1219 thank Martin Thomson for suggesting the use of an HTTP/3 SETTINGS 1220 parameter. Furthermore, the authors would like to thank Ben Schwartz 1221 for writing the first proposal that used two layers of indirection. 1223 Authors' Addresses 1225 David Schinazi 1226 Google LLC 1227 1600 Amphitheatre Parkway 1228 Mountain View, California 94043, 1229 United States of America 1231 Email: dschinazi.ietf@gmail.com 1233 Lucas Pardue 1234 Cloudflare 1236 Email: lucaspardue.24.7@gmail.com