idnits 2.17.1 draft-ietf-masque-connect-udp-09.txt: -(683): 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 copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (11 April 2022) is 746 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' == Outdated reference: A later version (-11) exists of draft-ietf-masque-h3-datagram-09 ** Obsolete normative reference: RFC 793 (ref. 'TCP') (Obsoleted by RFC 9293) Summary: 2 errors (**), 0 flaws (~~), 3 warnings (==), 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 11 April 2022 5 Expires: 13 October 2022 7 UDP Proxying Support for HTTP 8 draft-ietf-masque-connect-udp-09 10 Abstract 12 This document describes how to proxy UDP over HTTP. Similar to how 13 the CONNECT method allows proxying TCP over HTTP, this document 14 defines a new mechanism to proxy UDP. When using HTTP/2 or HTTP/3, 15 it uses Extended CONNECT; when using HTTP/1.1, it uses Upgrade. 17 About This Document 19 This note is to be removed before publishing as an RFC. 21 The latest revision of this draft can be found at https://ietf-wg- 22 masque.github.io/draft-ietf-masque-connect-udp/draft-ietf-masque- 23 connect-udp.html. Status information for this document may be found 24 at https://datatracker.ietf.org/doc/draft-ietf-masque-connect-udp/. 26 Discussion of this document takes place on the MASQUE Working Group 27 mailing list (mailto:masque@ietf.org), which is archived at 28 https://mailarchive.ietf.org/arch/browse/masque/. 30 Source for this draft and an issue tracker can be found at 31 https://github.com/ietf-wg-masque/draft-ietf-masque-connect-udp. 33 Status of This Memo 35 This Internet-Draft is submitted in full conformance with the 36 provisions of BCP 78 and BCP 79. 38 Internet-Drafts are working documents of the Internet Engineering 39 Task Force (IETF). Note that other groups may also distribute 40 working documents as Internet-Drafts. The list of current Internet- 41 Drafts is at https://datatracker.ietf.org/drafts/current/. 43 Internet-Drafts are draft documents valid for a maximum of six months 44 and may be updated, replaced, or obsoleted by other documents at any 45 time. It is inappropriate to use Internet-Drafts as reference 46 material or to cite them other than as "work in progress." 48 This Internet-Draft will expire on 13 October 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. Configuration of Clients . . . . . . . . . . . . . . . . . . 3 69 3. HTTP Exchanges . . . . . . . . . . . . . . . . . . . . . . . 4 70 3.1. Proxy Handling . . . . . . . . . . . . . . . . . . . . . 5 71 3.2. HTTP Request over HTTP/1.1 . . . . . . . . . . . . . . . 6 72 3.3. HTTP Response over HTTP/1.1 . . . . . . . . . . . . . . . 7 73 3.4. HTTP Request over HTTP/2 and HTTP/3 . . . . . . . . . . . 7 74 3.5. HTTP Response over HTTP/2 and HTTP/3 . . . . . . . . . . 8 75 3.6. Note About Draft Versions . . . . . . . . . . . . . . . . 8 76 4. Context Identifiers . . . . . . . . . . . . . . . . . . . . . 9 77 5. HTTP Datagram Payload Format . . . . . . . . . . . . . . . . 9 78 6. Performance Considerations . . . . . . . . . . . . . . . . . 10 79 6.1. MTU Considerations . . . . . . . . . . . . . . . . . . . 11 80 6.2. Tunneling of ECN Marks . . . . . . . . . . . . . . . . . 11 81 7. Security Considerations . . . . . . . . . . . . . . . . . . . 12 82 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12 83 8.1. HTTP Upgrade Token . . . . . . . . . . . . . . . . . . . 12 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 . . . . . . . . . . . . . . . . . . . . . . . . . 15 89 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 15 91 1. Introduction 93 This document describes how to proxy UDP over HTTP. Similar to how 94 the CONNECT method (see Section 9.3.6 of [HTTP]) allows proxying TCP 95 [TCP] over HTTP, this document defines a new mechanism to proxy UDP 96 [UDP]. 98 UDP Proxying supports all versions of HTTP and uses HTTP Datagrams 99 [HTTP-DGRAM]. When using HTTP/2 [HTTP/2] or HTTP/3 [HTTP/3], UDP 100 proxying uses HTTP Extended CONNECT as described in [EXT-CONNECT2] 101 and [EXT-CONNECT3]. When using HTTP/1.x [HTTP/1.1], UDP proxying 102 uses HTTP Upgrade as defined in Section 7.8 of [HTTP]. 104 1.1. Conventions and Definitions 106 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 107 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 108 "OPTIONAL" in this document are to be interpreted as described in 109 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all 110 capitals, as shown here. 112 In this document, we use the term "proxy" to refer to the HTTP server 113 that acts upon the client's UDP proxying request to open a UDP socket 114 to a target server, and generates the response to this request. If 115 there are HTTP intermediaries (as defined in Section 3.7 of [HTTP]) 116 between the client and the proxy, those are referred to as 117 "intermediaries" in this document. 119 Note that, when the HTTP version in use does not support multiplexing 120 streams (such as HTTP/1.1), any reference to "stream" in this 121 document represents the entire connection. 123 2. Configuration of Clients 125 Clients are configured to use UDP Proxying over HTTP via a URI 126 Template [TEMPLATE] with the variables "target_host" and 127 "target_port". Examples are shown below: 129 https://masque.example.org/.well-known/masque/udp/{target_host}/{target_port}/ 130 https://proxy.example.org:4443/masque?h={target_host}&p={target_port} 131 https://proxy.example.org:4443/masque{?target_host,target_port} 133 Figure 1: URI Template Examples 135 The following requirements apply to the URI Template: 137 * The URI Template MUST be a level 3 template or lower. 139 * The URI Template MUST be in absolute form, and MUST include non- 140 empty scheme, authority and path components. 142 * The path component of the URI Template MUST start with a slash 143 "/". 145 * All template variables MUST be within the path component of the 146 URI. 148 * The URI template MUST contain the two variables "target_host" and 149 "target_port" and MAY contain other variables. 151 * The URI Template MUST NOT contain any non-ASCII unicode characters 152 and MUST only contain ASCII characters in the range 0x21-0x7E 153 inclusive (note that percent-encoding is allowed). 155 * The URI Template MUST NOT use Reserved Expansion ("+" operator), 156 Fragment Expansion ("#" operator), Label Expansion with Dot- 157 Prefix, Path Segment Expansion with Slash-Prefix, nor Path-Style 158 Parameter Expansion with Semicolon-Prefix. 160 If any of the requirements above are not met by a URI Template, the 161 client MUST reject its configuration and fail the request without 162 sending it to the proxy. 164 Since the original HTTP CONNECT method allowed conveying the target 165 host and port but not the scheme, proxy authority, path, nor query, 166 there exist proxy configuration interfaces that only allow the user 167 to configure the proxy host and the proxy port. Client 168 implementations of this specification that are constrained by such 169 limitations MAY attempt to access UDP Proxying capabilities using the 170 default template, which is defined as: 171 "https://$PROXY_HOST:$PROXY_PORT/.well-known/masque/ 172 udp/{target_host}/{target_port}/" where $PROXY_HOST and $PROXY_PORT 173 are the configured host and port of the proxy respectively. Proxy 174 deployments SHOULD offer service at this location if they need to 175 interoperate with such clients. 177 Clients MAY interpret HTTP 400, 404, or 405 response codes as 178 indications that the URI template is not correct. Servers MUST NOT 179 return these response codes if the request is well-formed and the URI 180 matches a supported template. 182 3. HTTP Exchanges 184 This document defines the "connect-udp" HTTP Upgrade Token. "connect- 185 udp" uses the Capsule Protocol as defined in Section 3.2 of 186 [HTTP-DGRAM]. The format of HTTP Datagrams is defined in Section 5. 188 Clients issue requests containing a "connect-udp" upgrade token to 189 initiate a UDP tunnel associated with a single HTTP stream. Tunnels 190 are commonly used to create an end-to-end virtual connection, which 191 can then be secured using QUIC [QUIC] or another protocol running 192 over UDP. The target of the tunnel is indicated by the client to the 193 proxy via the "target_host" and "target_port" variables of the URI 194 Template (see Section 2). If the request is successful, the proxy 195 commits to converting received HTTP Datagrams into UDP packets and 196 vice versa until the tunnel is closed. 198 When sending its UDP proxying request, the client SHALL perform URI 199 Template expansion to determine the path and query of its request. 200 target_host supports using DNS names, IPv6 literals and IPv4 201 literals. Note that this URI Template expansion requires using pct- 202 encoding, so for example if the target_host is "2001:db8::42", it 203 will be encoded in the URI as "2001%3Adb8%3A%3A42". 205 By virtue of the definition of the Capsule Protocol (see 206 [HTTP-DGRAM]), UDP proxying requests do not carry any message 207 content. Similarly, successful UDP proxying responses also do not 208 carry any message content. 210 Responses to UDP proxying requests are not cacheable. 212 3.1. Proxy Handling 214 Upon receiving a UDP proxying request, the recipient proxy extracts 215 the "target_host" and "target_port" variables from the URI it has 216 reconstructed from the request headers, and establishes a tunnel by 217 directly opening a UDP socket to the requested target. 219 Unlike TCP, UDP is connection-less. The proxy that opens the UDP 220 socket has no way of knowing whether the destination is reachable. 221 Therefore it needs to respond to the request without waiting for a 222 packet from the target. However, if the target_host is a DNS name, 223 the proxy MUST perform DNS resolution before replying to the HTTP 224 request. If errors occur during this process (for example, a DNS 225 resolution failure), the proxy MUST fail the request and SHOULD send 226 details using the Proxy-Status header field [PROXY-STATUS]. 228 Proxies can use connected UDP sockets if their operating system 229 supports them, as that allows the proxy to rely on the kernel to only 230 send it UDP packets that match the correct 5-tuple. If the proxy 231 uses a non-connected socket, it MUST validate the IP source address 232 and UDP source port on received packets to ensure they match the 233 client's request. Packets that do not match MUST be discarded by the 234 proxy. 236 The lifetime of the socket is tied to the request stream. The proxy 237 MUST keep the socket open while the request stream is open. If a 238 proxy is notified by its operating system that its socket is no 239 longer usable (for example, this can happen when an ICMP "Destination 240 Unreachable" message is received, see Section 3.1 of [ICMP6]), it 241 MUST close the request stream. Proxies MAY choose to close sockets 242 due to a period of inactivity, but they MUST close the request stream 243 when closing the socket. Proxies that close sockets after a period 244 of inactivity SHOULD NOT use a period lower than two minutes, see 245 Section 4.3 of [BEHAVE]. 247 A successful response (as defined in Section 3.3 and Section 3.5) 248 indicates that the proxy has opened a socket to the requested target 249 and is willing to proxy UDP payloads. Any response other than a 250 successful response indicates that the request has failed, and the 251 client MUST therefore abort the request. 253 Proxies MUST NOT introduce fragmentation at the IP layer when 254 forwarding HTTP Datagrams onto a UDP socket. In IPv4, the Don't 255 Fragment (DF) bit MUST be set if possible, to prevent fragmentation 256 on the path. Future extensions MAY remove these requirements. 258 3.2. HTTP Request over HTTP/1.1 260 When using HTTP/1.1 [HTTP/1.1], a UDP proxying request will meet the 261 following requirements: 263 * the method SHALL be "GET". 265 * the request-target SHALL use absolute-form (see Section 3.2.2 of 266 [HTTP/1.1]). 268 * the request SHALL include a single Host header field containing 269 the origin of the proxy. 271 * the request SHALL include a single "Connection" header field with 272 value "Upgrade" (note that this requirement is case-insensitive as 273 per Section 7.6.1 of [HTTP]). 275 * the request SHALL include a single "Upgrade" header field with 276 value "connect-udp". 278 For example, if the client is configured with URI Template 279 "https://proxy.example.org/.well-known/masque/ 280 udp/{target_host}/{target_port}/" and wishes to open a UDP proxying 281 tunnel to target 192.0.2.42:443, it could send the following request: 283 GET https://proxy.example.org/.well-known/masque/udp/192.0.2.42/443/ HTTP/1.1 284 Host: proxy.example.org 285 Connection: Upgrade 286 Upgrade: connect-udp 288 Figure 2: Example HTTP Request over HTTP/1.1 290 3.3. HTTP Response over HTTP/1.1 292 The proxy SHALL indicate a successful response by replying with the 293 following requirements: 295 * the HTTP status code on the response SHALL be 101 (Switching 296 Protocols). 298 * the reponse SHALL include a single "Connection" header field with 299 value "Upgrade" (note that this requirement is case-insensitive as 300 per Section 7.6.1 of [HTTP]). 302 * the response SHALL include a single "Upgrade" header field with 303 value "connect-udp". 305 * the response SHALL NOT include any Transfer-Encoding or Content- 306 Length header fields. 308 If any of these requirements are not met, the client MUST treat this 309 proxying attempt as failed and abort the connection. 311 For example, the proxy could respond with: 313 HTTP/1.1 101 Switching Protocols 314 Connection: Upgrade 315 Upgrade: connect-udp 317 Figure 3: Example HTTP Response over HTTP/1.1 319 3.4. HTTP Request over HTTP/2 and HTTP/3 321 When using HTTP/2 [HTTP/2] or HTTP/3 [HTTP/3], UDP proxying requests 322 use Extended CONNECT. This requires that servers send an HTTP 323 Setting as specified in [EXT-CONNECT2] and [EXT-CONNECT3], and that 324 requests use HTTP pseudo-header fields with the following 325 requirements: 327 * The ":method" pseudo-header field SHALL be "CONNECT". 329 * The ":protocol" pseudo-header field SHALL be "connect-udp". 331 * The ":authority" pseudo-header field SHALL contain the authority 332 of the proxy. 334 * The ":path" and ":scheme" pseudo-header fields SHALL NOT be empty. 335 Their values SHALL contain the scheme and path from the URI 336 Template after the URI template expansion process has been 337 completed. 339 A UDP proxying request that does not conform to these restrictions is 340 malformed (see Section 8.1.1 of [HTTP/2]). 342 For example, if the client is configured with URI Template 343 "https://proxy.example.org/{target_host}/{target_port}/" and wishes 344 to open a UDP proxying tunnel to target 192.0.2.42:443, it could send 345 the following request: 347 HEADERS 348 :method = CONNECT 349 :protocol = connect-udp 350 :scheme = https 351 :path = /.well-known/masque/udp/192.0.2.42/443/ 352 :authority = proxy.example.org 354 Figure 4: Example HTTP Request over HTTP/2 356 3.5. HTTP Response over HTTP/2 and HTTP/3 358 The proxy SHALL indicate a successful response by replying with any 359 2xx (Successful) HTTP status code, without any Transfer-Encoding or 360 Content-Length header fields. 362 If any of these requirements are not met, the client MUST treat this 363 proxying attempt as failed and abort the request. 365 For example, the proxy could respond with: 367 HEADERS 368 :status = 200 370 Figure 5: Example HTTP Response over HTTP/2 372 3.6. Note About Draft Versions 374 [[RFC editor: please remove this section before publication.]] 376 In order to allow implementations to support multiple draft versions 377 of this specification during its development, we introduce the 378 "connect-udp-version" header field. When sent by the client, it 379 contains a list of draft numbers supported by the client (e.g., 380 "connect-udp-version: 0, 2"). When sent by the proxy, it contains a 381 single draft number selected by the proxy from the list provided by 382 the client (e.g., "connect-udp-version: 2"). Sending this header 383 field is RECOMMENDED but not required. The "connect-udp-version" 384 header field is a List Structured Field, see Section 3.1 of 385 [STRUCT-FIELD]. Each list member MUST be an Integer. 387 4. Context Identifiers 389 This protocol allows future extensions to exchange HTTP Datagrams 390 which carry different semantics from UDP payloads. Some of these 391 extensions can augment UDP payloads with additional data, while 392 others can exchange data that is completely separate from UDP 393 payloads. In order to accomplish this, all HTTP Datagrams associated 394 with UDP Proxying request streams start with a context ID, see 395 Section 5. 397 Context IDs are 62-bit integers (0 to 2^62-1). Context IDs are 398 encoded as variable-length integers, see Section 16 of [QUIC]. The 399 context ID value of 0 is reserved for UDP payloads, while non-zero 400 values are dynamically allocated: non-zero even-numbered context IDs 401 are client-allocated, and odd-numbered context IDs are proxy- 402 allocated. The context ID namespace is tied to a given HTTP request: 403 it is possible for a context ID with the same numeric value to be 404 simultaneously allocated in distinct requests, potentially with 405 different semantics. Context IDs MUST NOT be re-allocated within a 406 given HTTP namespace but MAY be allocated in any order. The context 407 ID allocation restrictions to the use of even-numbered and odd- 408 numbered context IDs exist in order to avoid the need for 409 synchronisation between endpoints. However, once a context ID has 410 been allocated, those restrictions do not apply to the use of the 411 context ID: it can be used by any client or proxy, independent of 412 which endpoint initially allocated it. 414 Registration is the action by which an endpoint informs its peer of 415 the semantics and format of a given context ID. This document does 416 not define how registration occurs. Future extensions MAY use HTTP 417 header fields or capsules to register contexts. Depending on the 418 method being used, it is possible for datagrams to be received with 419 Context IDs which have not yet been registered, for instance due to 420 reordering of the packet containing the datagram and the packet 421 containing the registration message during transmission. 423 5. HTTP Datagram Payload Format 425 When HTTP Datagrams (see [HTTP-DGRAM]) are associated with UDP 426 proxying request streams, the HTTP Datagram Payload field has the 427 format defined in Figure 6. Note that when HTTP Datagrams are 428 encoded using QUIC DATAGRAM frames, the Context ID field defined 429 below directly follows the Quarter Stream ID field which is at the 430 start of the QUIC DATAGRAM frame payload: 432 UDP Proxying HTTP Datagram Payload { 433 Context ID (i), 434 Payload (..), 435 } 437 Figure 6: UDP Proxying HTTP Datagram Format 439 Context ID: A variable-length integer (see Section 16 of [QUIC]) 440 that contains the value of the Context ID. If an HTTP/3 datagram 441 which carries an unknown Context ID is received, the receiver 442 SHALL either drop that datagram silently or buffer it temporarily 443 (on the order of a round trip) while awaiting the registration of 444 the corresponding Context ID. 445 Payload: The payload of the datagram, whose semantics depend on 446 value of the previous field. Note that this field can be empty. 448 UDP packets are encoded using HTTP Datagrams with the Context ID set 449 to zero. When the Context ID is set to zero, the Payload field 450 contains the unmodified payload of a UDP packet (referred to as "data 451 octets" in [UDP]). 453 Clients MAY optimistically start sending UDP packets in HTTP 454 Datagrams before receiving the response to its UDP proxying request. 455 However, implementors should note that such proxied packets may not 456 be processed by the proxy if it responds to the request with a 457 failure, or if the proxied packets are received by the proxy before 458 the request. 460 By virtue of the definition of the UDP header [UDP], it is not 461 possible to encode UDP payloads longer than 65527 bytes. Therefore, 462 endpoints MUST NOT send HTTP Datagrams with a Payload field longer 463 than 65527 using Context ID zero. An endpoint that receives a 464 DATAGRAM capsule using Context ID zero whose Payload field is longer 465 than 65527 MUST abort the stream. If a proxy knows it can only send 466 out UDP packets of a certain length due to its underlying link MTU, 467 it SHOULD discard incoming DATAGRAM capsules using Context ID zero 468 whose Payload field is longer than that limit without buffering the 469 capsule contents. 471 6. Performance Considerations 473 Proxies SHOULD strive to avoid increasing burstiness of UDP traffic: 474 they SHOULD NOT queue packets in order to increase batching. 476 When the protocol running over UDP that is being proxied uses 477 congestion control (e.g., [QUIC]), the proxied traffic will incur at 478 least two nested congestion controllers. This can reduce performance 479 but the underlying HTTP connection MUST NOT disable congestion 480 control unless it has an out-of-band way of knowing with absolute 481 certainty that the inner traffic is congestion-controlled. 483 If a client or proxy with a connection containing a UDP proxying 484 request stream disables congestion control, it MUST NOT signal ECN 485 support on that connection. That is, it MUST mark all IP headers 486 with the Not-ECT codepoint. It MAY continue to report ECN feedback 487 via ACK_ECN frames, as the peer may not have disabled congestion 488 control. 490 When the protocol running over UDP that is being proxied uses loss 491 recovery (e.g., [QUIC]), and the underlying HTTP connection runs over 492 TCP, the proxied traffic will incur at least two nested loss recovery 493 mechanisms. This can reduce performance as both can sometimes 494 independently retransmit the same data. To avoid this, UDP proxying 495 SHOULD be performed over HTTP/3 to allow leveraging the QUIC DATAGRAM 496 frame. 498 6.1. MTU Considerations 500 When using HTTP/3 with the QUIC Datagram extension [DGRAM], UDP 501 payloads are transmitted in QUIC DATAGRAM frames. Since those cannot 502 be fragmented, they can only carry payloads up to a given length 503 determined by the QUIC connection configuration and the path MTU. If 504 a proxy is using QUIC DATAGRAM frames and it receives a UDP payload 505 from the target that will not fit inside a QUIC DATAGRAM frame, the 506 proxy SHOULD NOT send the UDP payload in a DATAGRAM capsule, as that 507 defeats the end-to-end unreliability characteristic that methods such 508 as Datagram Packetization Layer Path MTU Discovery (DPLPMTUD) depend 509 on [DPLPMTUD]. In this scenario, the proxy SHOULD drop the UDP 510 payload and send an ICMP "Packet Too Big" message to the target, see 511 Section 3.2 of [ICMP6]. 513 6.2. Tunneling of ECN Marks 515 UDP proxying does not create an IP-in-IP tunnel, so the guidance in 516 [ECN-TUNNEL] about transferring ECN marks between inner and outer IP 517 headers does not apply. There is no inner IP header in UDP proxying 518 tunnels. 520 Note that UDP proxying clients do not have the ability in this 521 specification to control the ECN codepoints on UDP packets the proxy 522 sends to the target, nor can proxies communicate the markings of each 523 UDP packet from target to proxy. 525 A UDP proxy MUST ignore ECN bits in the IP header of UDP packets 526 received from the target, and MUST set the ECN bits to Not-ECT on UDP 527 packets it sends to the target. These do not relate to the ECN 528 markings of packets sent between client and proxy in any way. 530 7. Security Considerations 532 There are significant risks in allowing arbitrary clients to 533 establish a tunnel to arbitrary targets, as that could allow bad 534 actors to send traffic and have it attributed to the proxy. Proxies 535 that support UDP proxying ought to restrict its use to authenticated 536 users. 538 Because the CONNECT method creates a TCP connection to the target, 539 the target has to indicate its willingness to accept TCP connections 540 by responding with a TCP SYN-ACK before the proxy can send it 541 application data. UDP doesn't have this property, so a UDP proxy 542 could send more data to an unwilling target than a CONNECT proxy. 543 However, in practice denial of service attacks target open TCP ports 544 so the TCP SYN-ACK does not offer much protection in real scenarios. 545 While a proxy could potentially limit the number of UDP packets it is 546 willing to forward until it has observed a response from the target, 547 that is unlikely to provide any protection against denial of service 548 attacks because such attacks target open UDP ports where the protocol 549 running over UDP would respond, and that would be interpreted as 550 willingness to accept UDP by the proxy. 552 UDP sockets for UDP proxying have a different lifetime than TCP 553 sockets for CONNECT, therefore implementors would be well served to 554 follow the advice in Section 3.1 if they base their UDP proxying 555 implementation on a preexisting implementation of CONNECT. 557 The security considerations described in [HTTP-DGRAM] also apply 558 here. 560 8. IANA Considerations 562 8.1. HTTP Upgrade Token 564 This document will request IANA to register "connect-udp" in the 565 "HTTP Upgrade Tokens" registry maintained at 566 . 568 Value: connect-udp 569 Description: Proxying of UDP Payloads 570 Expected Version Tokens: None 571 Reference: This document 573 8.2. Well-Known URI 575 This document will request IANA to register "masque/udp" in the 576 "Well-Known URIs" registry maintained at 577 . 579 URI Suffix: masque/udp 580 Change Controller: IETF 581 Reference: This document 582 Status: permanent (if this document is approved) 583 Related Information: Includes all resources identified with the path 584 prefix "/.well-known/masque/udp/" 586 9. References 588 9.1. Normative References 590 [DGRAM] Pauly, T., Kinnear, E., and D. Schinazi, "An Unreliable 591 Datagram Extension to QUIC", RFC 9221, 592 DOI 10.17487/RFC9221, March 2022, 593 . 595 [EXT-CONNECT2] 596 McManus, P., "Bootstrapping WebSockets with HTTP/2", 597 RFC 8441, DOI 10.17487/RFC8441, September 2018, 598 . 600 [EXT-CONNECT3] 601 Hamilton, R., "Bootstrapping WebSockets with HTTP/3", Work 602 in Progress, Internet-Draft, draft-ietf-httpbis-h3- 603 websockets-04, 8 February 2022, 604 . 607 [HTTP] Fielding, R. T., Nottingham, M., and J. Reschke, "HTTP 608 Semantics", Work in Progress, Internet-Draft, draft-ietf- 609 httpbis-semantics-19, 12 September 2021, 610 . 613 [HTTP-DGRAM] 614 Schinazi, D. and L. Pardue, "HTTP Datagrams and the 615 Capsule Protocol", Work in Progress, Internet-Draft, 616 draft-ietf-masque-h3-datagram-09, 11 April 2022, 617 . 620 [HTTP/1.1] Fielding, R. T., Nottingham, M., and J. Reschke, 621 "HTTP/1.1", Work in Progress, Internet-Draft, draft-ietf- 622 httpbis-messaging-19, 12 September 2021, 623 . 626 [HTTP/2] Thomson, M. and C. Benfield, "HTTP/2", Work in Progress, 627 Internet-Draft, draft-ietf-httpbis-http2bis-07, 24 January 628 2022, . 631 [HTTP/3] Bishop, M., "Hypertext Transfer Protocol Version 3 632 (HTTP/3)", Work in Progress, Internet-Draft, draft-ietf- 633 quic-http-34, 2 February 2021, 634 . 637 [PROXY-STATUS] 638 Nottingham, M. and P. Sikora, "The Proxy-Status HTTP 639 Response Header Field", Work in Progress, Internet-Draft, 640 draft-ietf-httpbis-proxy-status-08, 13 October 2021, 641 . 644 [QUIC] Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based 645 Multiplexed and Secure Transport", RFC 9000, 646 DOI 10.17487/RFC9000, May 2021, 647 . 649 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 650 Requirement Levels", BCP 14, RFC 2119, 651 DOI 10.17487/RFC2119, March 1997, 652 . 654 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 655 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 656 May 2017, . 658 [STRUCT-FIELD] 659 Nottingham, M. and P-H. Kamp, "Structured Field Values for 660 HTTP", RFC 8941, DOI 10.17487/RFC8941, February 2021, 661 . 663 [TCP] Postel, J., "Transmission Control Protocol", STD 7, 664 RFC 793, DOI 10.17487/RFC0793, September 1981, 665 . 667 [TEMPLATE] Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., 668 and D. Orchard, "URI Template", RFC 6570, 669 DOI 10.17487/RFC6570, March 2012, 670 . 672 [UDP] Postel, J., "User Datagram Protocol", STD 6, RFC 768, 673 DOI 10.17487/RFC0768, August 1980, 674 . 676 9.2. Informative References 678 [BEHAVE] Audet, F., Ed. and C. Jennings, "Network Address 679 Translation (NAT) Behavioral Requirements for Unicast 680 UDP", BCP 127, RFC 4787, DOI 10.17487/RFC4787, January 681 2007, . 683 [DPLPMTUD] Fairhurst, G., Jones, T., Tüxen, M., Rüngeler, I., and T. 684 Völker, "Packetization Layer Path MTU Discovery for 685 Datagram Transports", RFC 8899, DOI 10.17487/RFC8899, 686 September 2020, . 688 [ECN-TUNNEL] 689 Briscoe, B., "Tunnelling of Explicit Congestion 690 Notification", RFC 6040, DOI 10.17487/RFC6040, November 691 2010, . 693 [ICMP6] Conta, A., Deering, S., and M. Gupta, Ed., "Internet 694 Control Message Protocol (ICMPv6) for the Internet 695 Protocol Version 6 (IPv6) Specification", STD 89, 696 RFC 4443, DOI 10.17487/RFC4443, March 2006, 697 . 699 Acknowledgments 701 This document is a product of the MASQUE Working Group, and the 702 author thanks all MASQUE enthusiasts for their contibutions. This 703 proposal was inspired directly or indirectly by prior work from many 704 people. In particular, the author would like to thank Eric Rescorla 705 for suggesting to use an HTTP method to proxy UDP. Thanks to Lucas 706 Pardue for their inputs on this document. The extensibility design 707 in this document came out of the HTTP Datagrams Design Team, whose 708 members were Alan Frindell, Alex Chernyakhovsky, Ben Schwartz, Eric 709 Rescorla, Lucas Pardue, Marcus Ihlar, Martin Thomson, Mike Bishop, 710 Tommy Pauly, Victor Vasiliev, and the author of this document. 712 Author's Address 713 David Schinazi 714 Google LLC 715 1600 Amphitheatre Parkway 716 Mountain View, CA 94043 717 United States of America 718 Email: dschinazi.ietf@gmail.com