idnits 2.17.1 draft-ietf-masque-connect-udp-04.txt: 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: ---------------------------------------------------------------------------- No issues found here. 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 (12 July 2021) is 1013 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) ** Obsolete normative reference: RFC 7540 (ref. 'H2') (Obsoleted by RFC 9113) == Outdated reference: A later version (-11) exists of draft-ietf-masque-h3-datagram-03 ** Obsolete normative reference: RFC 7230 (Obsoleted by RFC 9110, RFC 9112) ** Obsolete normative reference: RFC 7231 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 793 (ref. 'TCP') (Obsoleted by RFC 9293) Summary: 4 errors (**), 0 flaws (~~), 2 warnings (==), 1 comment (--). 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 12 July 2021 5 Expires: 13 January 2022 7 The CONNECT-UDP HTTP Method 8 draft-ietf-masque-connect-udp-04 10 Abstract 12 This document describes the CONNECT-UDP HTTP method. CONNECT-UDP is 13 similar to the HTTP CONNECT method, but it uses UDP instead of TCP. 15 Discussion Venues 17 This note is to be removed before publishing as an RFC. 19 Discussion of this document takes place on the MASQUE WG mailing list 20 (masque@ietf.org), which is archived at 21 https://mailarchive.ietf.org/arch/browse/masque/. 23 Source for this draft and an issue tracker can be found at 24 https://github.com/ietf-wg-masque/draft-ietf-masque-connect-udp. 26 Status of This Memo 28 This Internet-Draft is submitted in full conformance with the 29 provisions of BCP 78 and BCP 79. 31 Internet-Drafts are working documents of the Internet Engineering 32 Task Force (IETF). Note that other groups may also distribute 33 working documents as Internet-Drafts. The list of current Internet- 34 Drafts is at https://datatracker.ietf.org/drafts/current/. 36 Internet-Drafts are draft documents valid for a maximum of six months 37 and may be updated, replaced, or obsoleted by other documents at any 38 time. It is inappropriate to use Internet-Drafts as reference 39 material or to cite them other than as "work in progress." 41 This Internet-Draft will expire on 13 January 2022. 43 Copyright Notice 45 Copyright (c) 2021 IETF Trust and the persons identified as the 46 document authors. All rights reserved. 48 This document is subject to BCP 78 and the IETF Trust's Legal 49 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 50 license-info) in effect on the date of publication of this document. 51 Please review these documents carefully, as they describe your rights 52 and restrictions with respect to this document. Code Components 53 extracted from this document must include Simplified BSD License text 54 as described in Section 4.e of the Trust Legal Provisions and are 55 provided without warranty as described in the Simplified BSD License. 57 Table of Contents 59 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 60 1.1. Conventions and Definitions . . . . . . . . . . . . . . . 2 61 2. Supported HTTP Versions . . . . . . . . . . . . . . . . . . . 3 62 3. The CONNECT-UDP Method . . . . . . . . . . . . . . . . . . . 3 63 4. Encoding of Proxied UDP Packets . . . . . . . . . . . . . . . 4 64 5. Proxy Handling . . . . . . . . . . . . . . . . . . . . . . . 5 65 6. Performance Considerations . . . . . . . . . . . . . . . . . 5 66 6.1. Tunneling of ECN Marks . . . . . . . . . . . . . . . . . 6 67 7. Security Considerations . . . . . . . . . . . . . . . . . . . 6 68 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 69 8.1. HTTP Method . . . . . . . . . . . . . . . . . . . . . . . 6 70 8.2. URI Scheme Registration . . . . . . . . . . . . . . . . . 7 71 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 72 9.1. Normative References . . . . . . . . . . . . . . . . . . 7 73 9.2. Informative References . . . . . . . . . . . . . . . . . 8 74 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 8 75 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8 77 1. Introduction 79 This document describes the CONNECT-UDP HTTP method. CONNECT-UDP is 80 similar to the HTTP CONNECT method (see section 4.3.6 of [RFC7231]), 81 but it uses UDP [UDP] instead of TCP [TCP]. 83 1.1. Conventions and Definitions 85 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 86 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 87 "OPTIONAL" in this document are to be interpreted as described in BCP 88 14 [RFC2119] [RFC8174] when, and only when, they appear in all 89 capitals, as shown here. 91 In this document, we use the term "proxy" to refer to the HTTP server 92 that opens the UDP socket and responds to the CONNECT-UDP request. 93 If there are HTTP intermediaries (as defined in Section 2.3 of 94 [RFC7230]) between the client and the proxy, those are referred to as 95 "intermediaries" in this document. 97 2. Supported HTTP Versions 99 The CONNECT-UDP method is defined for all versions of HTTP. UDP 100 payloads are sent using HTTP Datagrams [HTTP-DGRAM]. Note that, when 101 the HTTP version in use does not support multiplexing streams (such 102 as HTTP/1.1), then any reference to "stream" in this document is 103 meant to represent the entire connection. 105 3. The CONNECT-UDP Method 107 The CONNECT-UDP method requests that the recipient establish a tunnel 108 over a single HTTP stream to the destination origin server identified 109 by the request-target and, if successful, thereafter restrict its 110 behavior to blind forwarding of packets, in both directions, until 111 the tunnel is closed. Tunnels are commonly used to create an end-to- 112 end virtual connection, which can then be secured using QUIC [QUIC] 113 or another protocol running over UDP. 115 The request-target of a CONNECT-UDP request is a URI [RFC3986] which 116 uses the "masque" scheme and an immutable path of "/". For example: 118 CONNECT-UDP masque://target.example.com:443/ HTTP/1.1 119 Host: target.example.com:443 121 When using HTTP/2 [H2] or later, CONNECT-UDP requests use HTTP 122 pseudo-headers with the following requirements: 124 * The ":method" pseudo-header field is set to "CONNECT-UDP". 126 * The ":scheme" pseudo-header field is set to "masque". 128 * The ":path" pseudo-header field is set to "/". 130 * The ":authority" pseudo-header field contains the host and port to 131 connect to (similar to the authority-form of the request-target of 132 CONNECT requests; see [RFC7230], Section 5.3). 134 A CONNECT-UDP request that does not conform to these restrictions is 135 malformed (see [H2], Section 8.1.2.6). 137 The recipient proxy establishes a tunnel by directly opening a UDP 138 socket to the request-target. Any 2xx (Successful) response 139 indicates that the proxy has opened a socket to the request-target 140 and is willing to proxy UDP payloads. Any response other than a 141 successful response indicates that the tunnel has not yet been 142 formed. 144 A proxy MUST NOT send any Transfer-Encoding or Content-Length header 145 fields in a 2xx (Successful) response to CONNECT-UDP. A client MUST 146 treat a response to CONNECT-UDP containing any Content-Length or 147 Transfer-Encoding header fields as malformed. 149 A payload within a CONNECT-UDP request message has no defined 150 semantics; a CONNECT-UDP request with a non-empty payload is 151 malformed. 153 Responses to the CONNECT-UDP method are not cacheable. 155 4. Encoding of Proxied UDP Packets 157 UDP packets are encoded using HTTP Datagrams [HTTP-DGRAM]. The 158 payload of a UDP packet (referred to as "data octets" in [UDP]) is 159 sent unmodified in the "HTTP Datagram Payload" field of an HTTP 160 Datagram. In order to use HTTP Datagrams, the CONNECT-UDP client 161 will first decide whether or not to use HTTP Datagram Contexts and 162 then register its context ID (or lack thereof) using the 163 corresponding registration capsule, see [HTTP-DGRAM]. 165 Since HTTP Datagrams require prior negotiation (for example, in 166 HTTP/3 it is necessary to both send and receive the H3_DATAGRAM 167 SETTINGS Parameter), clients MUST NOT send any HTTP Datagrams until 168 they have established support on a given connection. If negotiation 169 of HTTP Datagrams fails (for example if an HTTP/3 SETTINGS frame was 170 received without the H3_DATAGRAM SETTINGS Parameter), the client MUST 171 consider its CONNECT-UDP request as failed. 173 The proxy that is creating the UDP socket to the destination responds 174 to the CONNECT-UDP request with a 2xx (Successful) response, and 175 indicates it supports HTTP Datagrams by sending the corresponding 176 registration capsule. 178 Clients MAY optimistically start sending proxied UDP packets before 179 receiving the response to its CONNECT-UDP request, noting however 180 that those may not be processed by the proxy if it responds to the 181 CONNECT-UDP request with a failure, or if the datagrams arrive before 182 the CONNECT-UDP request. 184 Extensions to CONNECT-UDP MAY leverage the "Context Extensions" field 185 of registration capsules in order to negotiate different semantics or 186 encoding for UDP payloads. 188 5. Proxy Handling 190 Unlike TCP, UDP is connection-less. The proxy that opens the UDP 191 socket has no way of knowing whether the destination is reachable. 192 Therefore it needs to respond to the CONNECT-UDP request without 193 waiting for a TCP SYN-ACK. 195 Proxies can use connected UDP sockets if their operating system 196 supports them, as that allows the proxy to rely on the kernel to only 197 send it UDP packets that match the correct 5-tuple. If the proxy 198 uses a non-connected socket, it MUST validate the IP source address 199 and UDP source port on received packets to ensure they match the 200 client's CONNECT-UDP request. Packets that do not match MUST be 201 discarded by the proxy. 203 The lifetime of the socket is tied to the CONNECT-UDP stream. The 204 proxy MUST keep the socket open while the CONNECT-UDP stream is open. 205 Proxies MAY choose to close sockets due to a period of inactivity, 206 but they MUST close the CONNECT-UDP stream before closing the socket. 208 6. Performance Considerations 210 Proxies SHOULD strive to avoid increasing burstiness of UDP traffic: 211 they SHOULD NOT queue packets in order to increase batching. 213 When the protocol running over UDP that is being proxied uses 214 congestion control (e.g., [QUIC]), the proxied traffic will incur at 215 least two nested congestion controllers. This can reduce performance 216 but the underlying HTTP connection MUST NOT disable congestion 217 control unless it has an out-of-band way of knowing with absolute 218 certainty that the inner traffic is congestion-controlled. 220 If a client or proxy with a connection containing a CONNECT-UDP 221 stream disables congestion control, it MUST NOT signal ECN support on 222 that connection. That is, it MUST mark all IP headers with the Not- 223 ECT codepoint. It MAY continue to report ECN feedback via ACK_ECN 224 frames, as the peer may not have disabled congestion control. 226 When the protocol running over UDP that is being proxied uses loss 227 recovery (e.g., [QUIC]), and the underlying HTTP connection runs over 228 TCP, the proxied traffic will incur at least two nested loss recovery 229 mechanisms. This can reduce performance as both can sometimes 230 independently retransmit the same data. To avoid this, HTTP/3 231 datagrams SHOULD be used. 233 6.1. Tunneling of ECN Marks 235 CONNECT-UDP does not create an IP-in-IP tunnel, so the guidance in 236 [RFC6040] about transferring ECN marks between inner and outer IP 237 headers does not apply. There is no inner IP header in CONNECT-UDP 238 tunnels. 240 Note that CONNECT-UDP clients do not have the ability in this 241 specification to control the ECN codepoints on UDP packets the proxy 242 sends to the server, nor can proxies communicate the markings of each 243 UDP packet from server to proxy. 245 A CONNECT-UDP proxy MUST ignore ECN bits in the IP header of UDP 246 packets received from the server, and MUST set the ECN bits to Not- 247 ECT on UDP packets it sends to the server. These do not relate to 248 the ECN markings of packets sent between client and proxy in any way. 250 7. Security Considerations 252 There are significant risks in allowing arbitrary clients to 253 establish a tunnel to arbitrary servers, as that could allow bad 254 actors to send traffic and have it attributed to the proxy. Proxies 255 that support CONNECT-UDP SHOULD restrict its use to authenticated 256 users. 258 Because the CONNECT method creates a TCP connection to the target, 259 the target has to indicate its willingness to accept TCP connections 260 by responding with a TCP SYN-ACK before the proxy can send it 261 application data. UDP doesn't have this property, so a CONNECT-UDP 262 proxy could send more data to an unwilling target than a CONNECT 263 proxy. However, in practice denial of service attacks target open 264 TCP ports so the TCP SYN-ACK does not offer much protection in real 265 scenarios. Proxies MUST NOT introspect the contents of UDP payloads 266 as that would lead to ossification of UDP-based protocols by proxies. 268 8. IANA Considerations 270 8.1. HTTP Method 272 This document will request IANA to register "CONNECT-UDP" in the HTTP 273 Method Registry (IETF review) maintained at 274 . 276 +-------------+------+------------+---------------+ 277 | Method Name | Safe | Idempotent | Reference | 278 +-------------+------+------------+---------------+ 279 | CONNECT-UDP | no | no | This document | 280 +-------------+------+------------+---------------+ 282 8.2. URI Scheme Registration 284 This document will request IANA to register the URI scheme "masque". 286 The syntax definition below uses Augmented Backus-Naur Form (ABNF) 287 [RFC5234]. The definitions of "host" and "port" are adopted from 288 [RFC3986]. The syntax of a MASQUE URI is: 290 masque-URI = "masque:" "//" host ":" port "/" 292 The "host" and "port" component MUST NOT be empty, and the "port" 293 component MUST NOT be 0. 295 9. References 297 9.1. Normative References 299 [H2] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext 300 Transfer Protocol Version 2 (HTTP/2)", RFC 7540, 301 DOI 10.17487/RFC7540, May 2015, 302 . 304 [HTTP-DGRAM] 305 Schinazi, D. and L. Pardue, "Using Datagrams with HTTP", 306 Work in Progress, Internet-Draft, draft-ietf-masque-h3- 307 datagram-03, 12 July 2021, 308 . 311 [QUIC] Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based 312 Multiplexed and Secure Transport", RFC 9000, 313 DOI 10.17487/RFC9000, May 2021, 314 . 316 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 317 Requirement Levels", BCP 14, RFC 2119, 318 DOI 10.17487/RFC2119, March 1997, 319 . 321 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 322 Resource Identifier (URI): Generic Syntax", STD 66, 323 RFC 3986, DOI 10.17487/RFC3986, January 2005, 324 . 326 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 327 Specifications: ABNF", STD 68, RFC 5234, 328 DOI 10.17487/RFC5234, January 2008, 329 . 331 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 332 Protocol (HTTP/1.1): Message Syntax and Routing", 333 RFC 7230, DOI 10.17487/RFC7230, June 2014, 334 . 336 [RFC7231] "*** BROKEN REFERENCE ***". 338 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 339 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 340 May 2017, . 342 [TCP] Postel, J., "Transmission Control Protocol", STD 7, 343 RFC 793, DOI 10.17487/RFC0793, September 1981, 344 . 346 [UDP] Postel, J., "User Datagram Protocol", STD 6, RFC 768, 347 DOI 10.17487/RFC0768, August 1980, 348 . 350 9.2. Informative References 352 [RFC6040] Briscoe, B., "Tunnelling of Explicit Congestion 353 Notification", RFC 6040, DOI 10.17487/RFC6040, November 354 2010, . 356 Acknowledgments 358 This document is a product of the MASQUE Working Group, and the 359 author thanks all MASQUE enthusiasts for their contibutions. This 360 proposal was inspired directly or indirectly by prior work from many 361 people. In particular, the author would like to thank Eric Rescorla 362 for suggesting to use an HTTP method to proxy UDP. Thanks to Lucas 363 Pardue for their inputs on this document. 365 Author's Address 367 David Schinazi 368 Google LLC 369 1600 Amphitheatre Parkway 370 Mountain View, California 94043, 371 United States of America 373 Email: dschinazi.ietf@gmail.com