idnits 2.17.00 (12 Aug 2021) /tmp/idnits46280/draft-ietf-masque-connect-udp-12.txt: -(696): 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 : ---------------------------------------------------------------------------- ** There are 2 instances of too long lines in the document, the longest one being 6 characters in excess of 72. -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? Miscellaneous warnings: ---------------------------------------------------------------------------- -- The document date (3 May 2022) is 11 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Possible downref: Normative reference to a draft: ref. 'HTTP' Summary: 1 error (**), 0 flaws (~~), 1 warning (==), 3 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 3 May 2022 5 Expires: 4 November 2022 7 Proxying UDP in HTTP 8 draft-ietf-masque-connect-udp-12 10 Abstract 12 This document describes how to proxy UDP in HTTP, similar to how the 13 HTTP CONNECT method allows proxying TCP in HTTP. More specifically, 14 this document defines a protocol that allows HTTP clients to create a 15 tunnel for UDP communications through an HTTP server that acts as a 16 proxy. 18 About This Document 20 This note is to be removed before publishing as an RFC. 22 The latest revision of this draft can be found at https://ietf-wg- 23 masque.github.io/draft-ietf-masque-connect-udp/draft-ietf-masque- 24 connect-udp.html. Status information for this document may be found 25 at https://datatracker.ietf.org/doc/draft-ietf-masque-connect-udp/. 27 Discussion of this document takes place on the MASQUE Working Group 28 mailing list (mailto:masque@ietf.org), which is archived at 29 https://mailarchive.ietf.org/arch/browse/masque/. 31 Source for this draft and an issue tracker can be found at 32 https://github.com/ietf-wg-masque/draft-ietf-masque-connect-udp. 34 Status of This Memo 36 This Internet-Draft is submitted in full conformance with the 37 provisions of BCP 78 and BCP 79. 39 Internet-Drafts are working documents of the Internet Engineering 40 Task Force (IETF). Note that other groups may also distribute 41 working documents as Internet-Drafts. The list of current Internet- 42 Drafts is at https://datatracker.ietf.org/drafts/current/. 44 Internet-Drafts are draft documents valid for a maximum of six months 45 and may be updated, replaced, or obsoleted by other documents at any 46 time. It is inappropriate to use Internet-Drafts as reference 47 material or to cite them other than as "work in progress." 48 This Internet-Draft will expire on 4 November 2022. 50 Copyright Notice 52 Copyright (c) 2022 IETF Trust and the persons identified as the 53 document authors. All rights reserved. 55 This document is subject to BCP 78 and the IETF Trust's Legal 56 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 57 license-info) in effect on the date of publication of this document. 58 Please review these documents carefully, as they describe your rights 59 and restrictions with respect to this document. Code Components 60 extracted from this document must include Revised BSD License text as 61 described in Section 4.e of the Trust Legal Provisions and are 62 provided without warranty as described in the Revised BSD License. 64 Table of Contents 66 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 67 1.1. Conventions and Definitions . . . . . . . . . . . . . . . 3 68 2. Client Configuration . . . . . . . . . . . . . . . . . . . . 3 69 3. Tunnelling UDP over HTTP . . . . . . . . . . . . . . . . . . 4 70 3.1. UDP Proxy Handling . . . . . . . . . . . . . . . . . . . 5 71 3.2. HTTP/1.1 Request . . . . . . . . . . . . . . . . . . . . 6 72 3.3. HTTP/1.1 Response . . . . . . . . . . . . . . . . . . . . 7 73 3.4. HTTP/2 and HTTP/3 Requests . . . . . . . . . . . . . . . 8 74 3.5. HTTP/2 and HTTP/3 Responses . . . . . . . . . . . . . . . 8 75 3.6. Note About Draft Versions . . . . . . . . . . . . . . . . 9 76 4. Context Identifiers . . . . . . . . . . . . . . . . . . . . . 9 77 5. HTTP Datagram Payload Format . . . . . . . . . . . . . . . . 10 78 6. Performance Considerations . . . . . . . . . . . . . . . . . 11 79 6.1. MTU Considerations . . . . . . . . . . . . . . . . . . . 11 80 6.2. Tunneling of ECN Marks . . . . . . . . . . . . . . . . . 12 81 7. Security Considerations . . . . . . . . . . . . . . . . . . . 12 82 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13 83 8.1. HTTP Upgrade Token . . . . . . . . . . . . . . . . . . . 13 84 8.2. Well-Known URI . . . . . . . . . . . . . . . . . . . . . 13 85 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 13 86 9.1. Normative References . . . . . . . . . . . . . . . . . . 13 87 9.2. Informative References . . . . . . . . . . . . . . . . . 15 88 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 16 89 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 16 91 1. Introduction 93 While HTTP provides the CONNECT method (see Section 9.3.6 of [HTTP]) 94 for creating a TCP [TCP] tunnel to a proxy, it lacks a method for 95 doing so for UDP [UDP] traffic. 97 This document describes a protocol for tunnelling UDP to a server 98 acting as a UDP-specific proxy over HTTP. UDP tunnels are commonly 99 used to create an end-to-end virtual connection, which can then be 100 secured using QUIC [QUIC] or another protocol running over UDP. 101 Unlike CONNECT, the UDP proxy itself is identified with an absolute 102 URL containing the traffic's destination. Clients generate those 103 URLs using a URI Template [TEMPLATE], as described in Section 2. 105 This protocol supports all versions of HTTP by using HTTP Datagrams 106 [HTTP-DGRAM]. When using HTTP/2 [HTTP/2] or HTTP/3 [HTTP/3], it uses 107 HTTP Extended CONNECT as described in [EXT-CONNECT2] and 108 [EXT-CONNECT3]. When using HTTP/1.x [HTTP/1.1], it uses HTTP Upgrade 109 as defined in Section 7.8 of [HTTP]. 111 1.1. Conventions and Definitions 113 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 114 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 115 "OPTIONAL" in this document are to be interpreted as described in 116 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all 117 capitals, as shown here. 119 In this document, we use the term "UDP proxy" to refer to the HTTP 120 server that acts upon the client's UDP tunnelling request to open a 121 UDP socket to a target server, and generates the response to this 122 request. If there are HTTP intermediaries (as defined in Section 3.7 123 of [HTTP]) between the client and the UDP proxy, those are referred 124 to as "intermediaries" in this document. 126 Note that, when the HTTP version in use does not support multiplexing 127 streams (such as HTTP/1.1), any reference to "stream" in this 128 document represents the entire connection. 130 2. Client Configuration 132 HTTP clients are configured to use a UDP proxy with a URI Template 133 [TEMPLATE] that has the variables "target_host" and "target_port". 134 Examples are shown below: 136 https://masque.example.org/.well-known/masque/udp/{target_host}/{target_port}/ 137 https://proxy.example.org:4443/masque?h={target_host}&p={target_port} 138 https://proxy.example.org:4443/masque{?target_host,target_port} 140 Figure 1: URI Template Examples 142 The following requirements apply to the URI Template: 144 * The URI Template MUST be a level 3 template or lower. 146 * The URI Template MUST be in absolute form, and MUST include non- 147 empty scheme, authority and path components. 149 * The path component of the URI Template MUST start with a slash 150 "/". 152 * All template variables MUST be within the path or query components 153 of the URI. 155 * The URI template MUST contain the two variables "target_host" and 156 "target_port" and MAY contain other variables. 158 * The URI Template MUST NOT contain any non-ASCII unicode characters 159 and MUST only contain ASCII characters in the range 0x21-0x7E 160 inclusive (note that percent-encoding is allowed). 162 * The URI Template MUST NOT use Reserved Expansion ("+" operator), 163 Fragment Expansion ("#" operator), Label Expansion with Dot- 164 Prefix, Path Segment Expansion with Slash-Prefix, nor Path-Style 165 Parameter Expansion with Semicolon-Prefix. 167 If the client detects that any of the requirements above are not met 168 by a URI Template, the client MUST reject its configuration and fail 169 the request without sending it to the UDP proxy. While clients 170 SHOULD validate the requirements above, some clients MAY use a 171 general-purpose URI Template implementation that lacks this specific 172 validation. 174 Since the original HTTP CONNECT method allowed conveying the target 175 host and port but not the scheme, proxy authority, path, nor query, 176 there exist proxy configuration interfaces that only allow the user 177 to configure the proxy host and the proxy port. Client 178 implementations of this specification that are constrained by such 179 limitations MAY attempt to access UDP proxying capabilities using the 180 default template, which is defined as: 181 "https://$PROXY_HOST:$PROXY_PORT/.well-known/masque/ 182 udp/{target_host}/{target_port}/" where $PROXY_HOST and $PROXY_PORT 183 are the configured host and port of the UDP proxy respectively. UDP 184 proxy deployments SHOULD offer service at this location if they need 185 to interoperate with such clients. 187 3. Tunnelling UDP over HTTP 189 To allow negotiation of a tunnel for UDP over HTTP, this document 190 defines the "connect-udp" HTTP Upgrade Token. The resulting UDP 191 tunnels use the Capsule Protocol (see Section 3.2 of [HTTP-DGRAM]) 192 with HTTP Datagram in the format defined in Section 5. 194 To initiate a UDP tunnel associated with a single HTTP stream, 195 clients issue a request containing the "connect-udp" upgrade token. 196 The target of the tunnel is indicated by the client to the UDP proxy 197 via the "target_host" and "target_port" variables of the URI 198 Template, see Section 2. If the request is successful, the UDP proxy 199 commits to converting received HTTP Datagrams into UDP packets and 200 vice versa until the tunnel is closed. 202 When sending its UDP proxying request, the client SHALL perform URI 203 Template expansion to determine the path and query of its request. 204 target_host supports using DNS names, IPv6 literals and IPv4 205 literals. Note that this URI Template expansion requires using pct- 206 encoding, so for example if the target_host is "2001:db8::42", it 207 will be encoded in the URI as "2001%3Adb8%3A%3A42". 209 By virtue of the definition of the Capsule Protocol (see 210 [HTTP-DGRAM]), UDP proxying requests do not carry any message 211 content. Similarly, successful UDP proxying responses also do not 212 carry any message content. 214 3.1. UDP Proxy Handling 216 Upon receiving a UDP proxying request: 218 * if the recipient is configured to use another HTTP proxy, it will 219 act as an intermediary: it forwards the request to another HTTP 220 server. Note that such intermediaries may need to reencode the 221 request if they forward it using a version of HTTP that is 222 different from the one used to receive it, as the request encoding 223 differs by version (see below). 225 * otherwise, the recipient will act as a UDP proxy: it extracts the 226 "target_host" and "target_port" variables from the URI it has 227 reconstructed from the request headers, and establishes a tunnel 228 by directly opening a UDP socket to the requested target. 230 Unlike TCP, UDP is connection-less. The UDP proxy that opens the UDP 231 socket has no way of knowing whether the destination is reachable. 232 Therefore it needs to respond to the request without waiting for a 233 packet from the target. However, if the target_host is a DNS name, 234 the UDP proxy MUST perform DNS resolution before replying to the HTTP 235 request. If errors occur during this process, the UDP proxy MUST 236 fail the request and SHOULD send details using an appropriate "Proxy- 237 Status" header field [PROXY-STATUS] (for example, if DNS resolution 238 returns an error, the proxy can use the dns_error Proxy Error Type 239 from Section 2.3.2 of [PROXY-STATUS]). 241 UDP proxies can use connected UDP sockets if their operating system 242 supports them, as that allows the UDP proxy to rely on the kernel to 243 only send it UDP packets that match the correct 5-tuple. If the UDP 244 proxy uses a non-connected socket, it MUST validate the IP source 245 address and UDP source port on received packets to ensure they match 246 the client's request. Packets that do not match MUST be discarded by 247 the UDP proxy. 249 The lifetime of the socket is tied to the request stream. The UDP 250 proxy MUST keep the socket open while the request stream is open. If 251 a UDP proxy is notified by its operating system that its socket is no 252 longer usable (for example, this can happen when an ICMP "Destination 253 Unreachable" message is received, see Section 3.1 of [ICMP6]), it 254 MUST close the request stream. UDP proxies MAY choose to close 255 sockets due to a period of inactivity, but they MUST close the 256 request stream when closing the socket. UDP proxies that close 257 sockets after a period of inactivity SHOULD NOT use a period lower 258 than two minutes, see Section 4.3 of [BEHAVE]. 260 A successful response (as defined in Section 3.3 and Section 3.5) 261 indicates that the UDP proxy has opened a socket to the requested 262 target and is willing to proxy UDP payloads. Any response other than 263 a successful response indicates that the request has failed, and the 264 client MUST therefore abort the request. 266 UDP proxies MUST NOT introduce fragmentation at the IP layer when 267 forwarding HTTP Datagrams onto a UDP socket. In IPv4, the Don't 268 Fragment (DF) bit MUST be set if possible, to prevent fragmentation 269 on the path. Future extensions MAY remove these requirements. 271 3.2. HTTP/1.1 Request 273 When using HTTP/1.1 [HTTP/1.1], a UDP proxying request will meet the 274 following requirements: 276 * the method SHALL be "GET". 278 * the request SHALL include a single "Host" header field containing 279 the origin of the UDP proxy. 281 * the request SHALL include a "Connection" header field with value 282 "Upgrade" (note that this requirement is case-insensitive as per 283 Section 7.6.1 of [HTTP]). 285 * the request SHALL include an "Upgrade" header field with value 286 "connect-udp". 288 For example, if the client is configured with URI Template 289 "https://proxy.example.org/.well-known/masque/ 290 udp/{target_host}/{target_port}/" and wishes to open a UDP proxying 291 tunnel to target 192.0.2.42:443, it could send the following request: 293 GET https://proxy.example.org/.well-known/masque/udp/192.0.2.42/443/ HTTP/1.1 294 Host: proxy.example.org 295 Connection: Upgrade 296 Upgrade: connect-udp 298 Figure 2: Example HTTP/1.1 Request 300 In HTTP/1.1, this protocol uses the GET method to mimic the design of 301 the WebSocket Protocol [WEBSOCKET]. 303 3.3. HTTP/1.1 Response 305 The UDP proxy SHALL indicate a successful response by replying with 306 the following requirements: 308 * the HTTP status code on the response SHALL be 101 (Switching 309 Protocols). 311 * the reponse SHALL include a single "Connection" header field with 312 value "Upgrade" (note that this requirement is case-insensitive as 313 per Section 7.6.1 of [HTTP]). 315 * the response SHALL include a single "Upgrade" header field with 316 value "connect-udp". 318 * the response SHALL NOT include any "Transfer-Encoding" or 319 "Content-Length" header fields. 321 If any of these requirements are not met, the client MUST treat this 322 proxying attempt as failed and abort the connection. 324 For example, the UDP proxy could respond with: 326 HTTP/1.1 101 Switching Protocols 327 Connection: Upgrade 328 Upgrade: connect-udp 330 Figure 3: Example HTTP/1.1 Response 332 3.4. HTTP/2 and HTTP/3 Requests 334 When using HTTP/2 [HTTP/2] or HTTP/3 [HTTP/3], UDP proxying requests 335 use Extended CONNECT. This requires that servers send an HTTP 336 Setting as specified in [EXT-CONNECT2] and [EXT-CONNECT3], and that 337 requests use HTTP pseudo-header fields with the following 338 requirements: 340 * The ":method" pseudo-header field SHALL be "CONNECT". 342 * The ":protocol" pseudo-header field SHALL be "connect-udp". 344 * The ":authority" pseudo-header field SHALL contain the authority 345 of the UDP proxy. 347 * The ":path" and ":scheme" pseudo-header fields SHALL NOT be empty. 348 Their values SHALL contain the scheme and path from the URI 349 Template after the URI template expansion process has been 350 completed. 352 A UDP proxying request that does not conform to these restrictions is 353 malformed (see Section 8.1.1 of [HTTP/2]). 355 For example, if the client is configured with URI Template 356 "https://proxy.example.org/{target_host}/{target_port}/" and wishes 357 to open a UDP proxying tunnel to target 192.0.2.42:443, it could send 358 the following request: 360 HEADERS 361 :method = CONNECT 362 :protocol = connect-udp 363 :scheme = https 364 :path = /.well-known/masque/udp/192.0.2.42/443/ 365 :authority = proxy.example.org 367 Figure 4: Example HTTP/2 Request 369 3.5. HTTP/2 and HTTP/3 Responses 371 The UDP proxy SHALL indicate a successful response by replying with 372 any 2xx (Successful) HTTP status code, without any "Transfer- 373 Encoding" or "Content-Length" header fields. 375 If any of these requirements are not met, the client MUST treat this 376 proxying attempt as failed and abort the request. 378 For example, the UDP proxy could respond with: 380 HEADERS 381 :status = 200 383 Figure 5: Example HTTP/2 Response 385 3.6. Note About Draft Versions 387 [[RFC editor: please remove this section before publication.]] 389 In order to allow implementations to support multiple draft versions 390 of this specification during its development, we introduce the 391 "connect-udp-version" header field. When sent by the client, it 392 contains a list of draft numbers supported by the client (e.g., 393 "connect-udp-version: 0, 2"). When sent by the UDP proxy, it 394 contains a single draft number selected by the UDP proxy from the 395 list provided by the client (e.g., "connect-udp-version: 2"). 396 Sending this header field is RECOMMENDED but not required. The 397 "connect-udp-version" header field is a List Structured Field, see 398 Section 3.1 of [STRUCT-FIELD]. Each list member MUST be an Integer. 400 4. Context Identifiers 402 This protocol allows future extensions to exchange HTTP Datagrams 403 which carry different semantics from UDP payloads. Some of these 404 extensions can augment UDP payloads with additional data, while 405 others can exchange data that is completely separate from UDP 406 payloads. In order to accomplish this, all HTTP Datagrams associated 407 with UDP Proxying request streams start with a context ID, see 408 Section 5. 410 Context IDs are 62-bit integers (0 to 2^62-1). Context IDs are 411 encoded as variable-length integers, see Section 16 of [QUIC]. The 412 context ID value of 0 is reserved for UDP payloads, while non-zero 413 values are dynamically allocated: non-zero even-numbered context IDs 414 are client-allocated, and odd-numbered context IDs are proxy- 415 allocated. The context ID namespace is tied to a given HTTP request: 416 it is possible for a context ID with the same numeric value to be 417 simultaneously allocated in distinct requests, potentially with 418 different semantics. Context IDs MUST NOT be re-allocated within a 419 given HTTP namespace but MAY be allocated in any order. The context 420 ID allocation restrictions to the use of even-numbered and odd- 421 numbered context IDs exist in order to avoid the need for 422 synchronisation between endpoints. However, once a context ID has 423 been allocated, those restrictions do not apply to the use of the 424 context ID: it can be used by any client or UDP proxy, independent of 425 which endpoint initially allocated it. 427 Registration is the action by which an endpoint informs its peer of 428 the semantics and format of a given context ID. This document does 429 not define how registration occurs. Future extensions MAY use HTTP 430 header fields or capsules to register contexts. Depending on the 431 method being used, it is possible for datagrams to be received with 432 Context IDs which have not yet been registered, for instance due to 433 reordering of the packet containing the datagram and the packet 434 containing the registration message during transmission. 436 5. HTTP Datagram Payload Format 438 When HTTP Datagrams (see [HTTP-DGRAM]) are associated with UDP 439 proxying request streams, the HTTP Datagram Payload field has the 440 format defined in Figure 6. Note that when HTTP Datagrams are 441 encoded using QUIC DATAGRAM frames, the Context ID field defined 442 below directly follows the Quarter Stream ID field which is at the 443 start of the QUIC DATAGRAM frame payload: 445 UDP Proxying HTTP Datagram Payload { 446 Context ID (i), 447 Payload (..), 448 } 450 Figure 6: UDP Proxying HTTP Datagram Format 452 Context ID: A variable-length integer (see Section 16 of [QUIC]) 453 that contains the value of the Context ID. If an HTTP/3 datagram 454 which carries an unknown Context ID is received, the receiver 455 SHALL either drop that datagram silently or buffer it temporarily 456 (on the order of a round trip) while awaiting the registration of 457 the corresponding Context ID. 458 Payload: The payload of the datagram, whose semantics depend on 459 value of the previous field. Note that this field can be empty. 461 UDP packets are encoded using HTTP Datagrams with the Context ID set 462 to zero. When the Context ID is set to zero, the Payload field 463 contains the unmodified payload of a UDP packet (referred to as "data 464 octets" in [UDP]). 466 Clients MAY optimistically start sending UDP packets in HTTP 467 Datagrams before receiving the response to its UDP proxying request. 468 However, implementors should note that such proxied packets may not 469 be processed by the UDP proxy if it responds to the request with a 470 failure, or if the proxied packets are received by the UDP proxy 471 before the request. 473 By virtue of the definition of the UDP header [UDP], it is not 474 possible to encode UDP payloads longer than 65527 bytes. Therefore, 475 endpoints MUST NOT send HTTP Datagrams with a Payload field longer 476 than 65527 using Context ID zero. An endpoint that receives a 477 DATAGRAM capsule using Context ID zero whose Payload field is longer 478 than 65527 MUST abort the stream. If a UDP proxy knows it can only 479 send out UDP packets of a certain length due to its underlying link 480 MTU, it SHOULD discard incoming DATAGRAM capsules using Context ID 481 zero whose Payload field is longer than that limit without buffering 482 the capsule contents. 484 6. Performance Considerations 486 UDP proxies SHOULD strive to avoid increasing burstiness of UDP 487 traffic: they SHOULD NOT queue packets in order to increase batching. 489 When the protocol running over UDP that is being proxied uses 490 congestion control (e.g., [QUIC]), the proxied traffic will incur at 491 least two nested congestion controllers. This can reduce performance 492 but the underlying HTTP connection MUST NOT disable congestion 493 control unless it has an out-of-band way of knowing with absolute 494 certainty that the inner traffic is congestion-controlled. 496 If a client or UDP proxy with a connection containing a UDP proxying 497 request stream disables congestion control, it MUST NOT signal ECN 498 support on that connection. That is, it MUST mark all IP headers 499 with the Not-ECT codepoint. It MAY continue to report ECN feedback 500 via ACK_ECN frames, as the peer may not have disabled congestion 501 control. 503 When the protocol running over UDP that is being proxied uses loss 504 recovery (e.g., [QUIC]), and the underlying HTTP connection runs over 505 TCP, the proxied traffic will incur at least two nested loss recovery 506 mechanisms. This can reduce performance as both can sometimes 507 independently retransmit the same data. To avoid this, UDP proxying 508 SHOULD be performed over HTTP/3 to allow leveraging the QUIC DATAGRAM 509 frame. 511 6.1. MTU Considerations 513 When using HTTP/3 with the QUIC Datagram extension [DGRAM], UDP 514 payloads are transmitted in QUIC DATAGRAM frames. Since those cannot 515 be fragmented, they can only carry payloads up to a given length 516 determined by the QUIC connection configuration and the path MTU. If 517 a UDP proxy is using QUIC DATAGRAM frames and it receives a UDP 518 payload from the target that will not fit inside a QUIC DATAGRAM 519 frame, the UDP proxy SHOULD NOT send the UDP payload in a DATAGRAM 520 capsule, as that defeats the end-to-end unreliability characteristic 521 that methods such as Datagram Packetization Layer Path MTU Discovery 522 (DPLPMTUD) depend on [DPLPMTUD]. In this scenario, the UDP proxy 523 SHOULD drop the UDP payload and send an ICMP "Packet Too Big" message 524 to the target, see Section 3.2 of [ICMP6]. 526 6.2. Tunneling of ECN Marks 528 UDP proxying does not create an IP-in-IP tunnel, so the guidance in 529 [ECN-TUNNEL] about transferring ECN marks between inner and outer IP 530 headers does not apply. There is no inner IP header in UDP proxying 531 tunnels. 533 Note that UDP proxying clients do not have the ability in this 534 specification to control the ECN codepoints on UDP packets the UDP 535 proxy sends to the target, nor can UDP proxies communicate the 536 markings of each UDP packet from target to UDP proxy. 538 A UDP proxy MUST ignore ECN bits in the IP header of UDP packets 539 received from the target, and MUST set the ECN bits to Not-ECT on UDP 540 packets it sends to the target. These do not relate to the ECN 541 markings of packets sent between client and UDP proxy in any way. 543 7. Security Considerations 545 There are significant risks in allowing arbitrary clients to 546 establish a tunnel to arbitrary targets, as that could allow bad 547 actors to send traffic and have it attributed to the UDP proxy. HTTP 548 servers that support UDP proxying ought to restrict its use to 549 authenticated users. 551 Because the CONNECT method creates a TCP connection to the target, 552 the target has to indicate its willingness to accept TCP connections 553 by responding with a TCP SYN-ACK before the CONNECT proxy can send it 554 application data. UDP doesn't have this property, so a UDP proxy 555 could send more data to an unwilling target than a CONNECT proxy. 556 However, in practice denial of service attacks target open TCP ports 557 so the TCP SYN-ACK does not offer much protection in real scenarios. 558 While a UDP proxy could potentially limit the number of UDP packets 559 it is willing to forward until it has observed a response from the 560 target, that is unlikely to provide any protection against denial of 561 service attacks because such attacks target open UDP ports where the 562 protocol running over UDP would respond, and that would be 563 interpreted as willingness to accept UDP by the UDP proxy. 565 UDP sockets for UDP proxying have a different lifetime than TCP 566 sockets for CONNECT, therefore implementors would be well served to 567 follow the advice in Section 3.1 if they base their UDP proxying 568 implementation on a preexisting implementation of CONNECT. 570 The security considerations described in [HTTP-DGRAM] also apply 571 here. 573 8. IANA Considerations 575 8.1. HTTP Upgrade Token 577 This document will request IANA to register "connect-udp" in the 578 "HTTP Upgrade Tokens" registry maintained at 579 . 581 Value: connect-udp 582 Description: Proxying of UDP Payloads 583 Expected Version Tokens: None 584 Reference: This document 586 8.2. Well-Known URI 588 This document will request IANA to register "masque/udp" in the 589 "Well-Known URIs" registry maintained at 590 . 592 URI Suffix: masque/udp 593 Change Controller: IETF 594 Reference: This document 595 Status: permanent (if this document is approved) 596 Related Information: Includes all resources identified with the path 597 prefix "/.well-known/masque/udp/" 599 9. References 601 9.1. Normative References 603 [DGRAM] Pauly, T., Kinnear, E., and D. Schinazi, "An Unreliable 604 Datagram Extension to QUIC", RFC 9221, 605 DOI 10.17487/RFC9221, March 2022, 606 . 608 [EXT-CONNECT2] 609 McManus, P., "Bootstrapping WebSockets with HTTP/2", 610 RFC 8441, DOI 10.17487/RFC8441, September 2018, 611 . 613 [EXT-CONNECT3] 614 Hamilton, R., "Bootstrapping WebSockets with HTTP/3", Work 615 in Progress, Internet-Draft, draft-ietf-httpbis-h3- 616 websockets-04, 8 February 2022, 617 . 620 [HTTP] Fielding, R. T., Nottingham, M., and J. Reschke, "HTTP 621 Semantics", Work in Progress, Internet-Draft, draft-ietf- 622 httpbis-semantics-19, 12 September 2021, 623 . 626 [HTTP-DGRAM] 627 Schinazi, D. and L. Pardue, "HTTP Datagrams and the 628 Capsule Protocol", Work in Progress, Internet-Draft, 629 draft-ietf-masque-h3-datagram-09, 11 April 2022, 630 . 633 [HTTP/1.1] Fielding, R. T., Nottingham, M., and J. Reschke, 634 "HTTP/1.1", Work in Progress, Internet-Draft, draft-ietf- 635 httpbis-messaging-19, 12 September 2021, 636 . 639 [HTTP/2] Thomson, M. and C. Benfield, "HTTP/2", Work in Progress, 640 Internet-Draft, draft-ietf-httpbis-http2bis-07, 24 January 641 2022, . 644 [HTTP/3] Bishop, M., "Hypertext Transfer Protocol Version 3 645 (HTTP/3)", Work in Progress, Internet-Draft, draft-ietf- 646 quic-http-34, 2 February 2021, 647 . 650 [PROXY-STATUS] 651 Nottingham, M. and P. Sikora, "The Proxy-Status HTTP 652 Response Header Field", Work in Progress, Internet-Draft, 653 draft-ietf-httpbis-proxy-status-08, 13 October 2021, 654 . 657 [QUIC] Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based 658 Multiplexed and Secure Transport", RFC 9000, 659 DOI 10.17487/RFC9000, May 2021, 660 . 662 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 663 Requirement Levels", BCP 14, RFC 2119, 664 DOI 10.17487/RFC2119, March 1997, 665 . 667 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 668 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 669 May 2017, . 671 [STRUCT-FIELD] 672 Nottingham, M. and P-H. Kamp, "Structured Field Values for 673 HTTP", RFC 8941, DOI 10.17487/RFC8941, February 2021, 674 . 676 [TCP] Postel, J., "Transmission Control Protocol", STD 7, 677 RFC 793, DOI 10.17487/RFC0793, September 1981, 678 . 680 [TEMPLATE] Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., 681 and D. Orchard, "URI Template", RFC 6570, 682 DOI 10.17487/RFC6570, March 2012, 683 . 685 [UDP] Postel, J., "User Datagram Protocol", STD 6, RFC 768, 686 DOI 10.17487/RFC0768, August 1980, 687 . 689 9.2. Informative References 691 [BEHAVE] Audet, F., Ed. and C. Jennings, "Network Address 692 Translation (NAT) Behavioral Requirements for Unicast 693 UDP", BCP 127, RFC 4787, DOI 10.17487/RFC4787, January 694 2007, . 696 [DPLPMTUD] Fairhurst, G., Jones, T., Tüxen, M., Rüngeler, I., and T. 697 Völker, "Packetization Layer Path MTU Discovery for 698 Datagram Transports", RFC 8899, DOI 10.17487/RFC8899, 699 September 2020, . 701 [ECN-TUNNEL] 702 Briscoe, B., "Tunnelling of Explicit Congestion 703 Notification", RFC 6040, DOI 10.17487/RFC6040, November 704 2010, . 706 [ICMP6] Conta, A., Deering, S., and M. Gupta, Ed., "Internet 707 Control Message Protocol (ICMPv6) for the Internet 708 Protocol Version 6 (IPv6) Specification", STD 89, 709 RFC 4443, DOI 10.17487/RFC4443, March 2006, 710 . 712 [WEBSOCKET] 713 Fette, I. and A. Melnikov, "The WebSocket Protocol", 714 RFC 6455, DOI 10.17487/RFC6455, December 2011, 715 . 717 Acknowledgments 719 This document is a product of the MASQUE Working Group, and the 720 author thanks all MASQUE enthusiasts for their contibutions. This 721 proposal was inspired directly or indirectly by prior work from many 722 people. In particular, the author would like to thank Eric Rescorla 723 for suggesting to use an HTTP method to proxy UDP. The author is 724 indebted to Mark Nottingham and Lucas Pardue for the many 725 improvements they contributed to this document. The extensibility 726 design in this document came out of the HTTP Datagrams Design Team, 727 whose members were Alan Frindell, Alex Chernyakhovsky, Ben Schwartz, 728 Eric Rescorla, Lucas Pardue, Marcus Ihlar, Martin Thomson, Mike 729 Bishop, Tommy Pauly, Victor Vasiliev, and the author of this 730 document. 732 Author's Address 734 David Schinazi 735 Google LLC 736 1600 Amphitheatre Parkway 737 Mountain View, CA 94043 738 United States of America 739 Email: dschinazi.ietf@gmail.com