draft-ietf-masque-connect-udp-04.txt | draft-ietf-masque-connect-udp-05.txt | |||
---|---|---|---|---|
MASQUE D. Schinazi | MASQUE D. Schinazi | |||
Internet-Draft Google LLC | Internet-Draft Google LLC | |||
Intended status: Standards Track 12 July 2021 | Intended status: Standards Track 7 October 2021 | |||
Expires: 13 January 2022 | Expires: 10 April 2022 | |||
The CONNECT-UDP HTTP Method | UDP Proxying Support for HTTP | |||
draft-ietf-masque-connect-udp-04 | draft-ietf-masque-connect-udp-05 | |||
Abstract | Abstract | |||
This document describes the CONNECT-UDP HTTP method. CONNECT-UDP is | This document describes how to proxy UDP over HTTP. Similar to how | |||
similar to the HTTP CONNECT method, but it uses UDP instead of TCP. | the CONNECT method allows proxying TCP over HTTP, this document | |||
defines a new mechanism to proxy UDP. It is built using HTTP | ||||
Extended CONNECT. | ||||
Discussion Venues | Discussion Venues | |||
This note is to be removed before publishing as an RFC. | This note is to be removed before publishing as an RFC. | |||
Discussion of this document takes place on the MASQUE WG mailing list | Discussion of this document takes place on the MASQUE WG mailing list | |||
(masque@ietf.org), which is archived at | (masque@ietf.org), which is archived at | |||
https://mailarchive.ietf.org/arch/browse/masque/. | https://mailarchive.ietf.org/arch/browse/masque/. | |||
Source for this draft and an issue tracker can be found at | Source for this draft and an issue tracker can be found at | |||
skipping to change at page 1, line 42 ¶ | skipping to change at page 1, line 44 ¶ | |||
Internet-Drafts are working documents of the Internet Engineering | Internet-Drafts are working documents of the Internet Engineering | |||
Task Force (IETF). Note that other groups may also distribute | Task Force (IETF). Note that other groups may also distribute | |||
working documents as Internet-Drafts. The list of current Internet- | working documents as Internet-Drafts. The list of current Internet- | |||
Drafts is at https://datatracker.ietf.org/drafts/current/. | Drafts is at https://datatracker.ietf.org/drafts/current/. | |||
Internet-Drafts are draft documents valid for a maximum of six months | Internet-Drafts are draft documents valid for a maximum of six months | |||
and may be updated, replaced, or obsoleted by other documents at any | and may be updated, replaced, or obsoleted by other documents at any | |||
time. It is inappropriate to use Internet-Drafts as reference | time. It is inappropriate to use Internet-Drafts as reference | |||
material or to cite them other than as "work in progress." | material or to cite them other than as "work in progress." | |||
This Internet-Draft will expire on 13 January 2022. | This Internet-Draft will expire on 10 April 2022. | |||
Copyright Notice | Copyright Notice | |||
Copyright (c) 2021 IETF Trust and the persons identified as the | Copyright (c) 2021 IETF Trust and the persons identified as the | |||
document authors. All rights reserved. | document authors. All rights reserved. | |||
This document is subject to BCP 78 and the IETF Trust's Legal | This document is subject to BCP 78 and the IETF Trust's Legal | |||
Provisions Relating to IETF Documents (https://trustee.ietf.org/ | Provisions Relating to IETF Documents (https://trustee.ietf.org/ | |||
license-info) in effect on the date of publication of this document. | license-info) in effect on the date of publication of this document. | |||
Please review these documents carefully, as they describe your rights | Please review these documents carefully, as they describe your rights | |||
and restrictions with respect to this document. Code Components | and restrictions with respect to this document. Code Components | |||
extracted from this document must include Simplified BSD License text | extracted from this document must include Simplified BSD License text | |||
as described in Section 4.e of the Trust Legal Provisions and are | as described in Section 4.e of the Trust Legal Provisions and are | |||
provided without warranty as described in the Simplified BSD License. | provided without warranty as described in the Simplified BSD License. | |||
Table of Contents | Table of Contents | |||
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 | |||
1.1. Conventions and Definitions . . . . . . . . . . . . . . . 2 | 1.1. Conventions and Definitions . . . . . . . . . . . . . . . 3 | |||
2. Supported HTTP Versions . . . . . . . . . . . . . . . . . . . 3 | 2. Configuration of Clients . . . . . . . . . . . . . . . . . . 3 | |||
3. The CONNECT-UDP Method . . . . . . . . . . . . . . . . . . . 3 | 3. HTTP Exchanges . . . . . . . . . . . . . . . . . . . . . . . 3 | |||
4. Encoding of Proxied UDP Packets . . . . . . . . . . . . . . . 4 | 3.1. Proxy Handling . . . . . . . . . . . . . . . . . . . . . 4 | |||
5. Proxy Handling . . . . . . . . . . . . . . . . . . . . . . . 5 | 3.2. HTTP Request over HTTP/1.1 . . . . . . . . . . . . . . . 5 | |||
6. Performance Considerations . . . . . . . . . . . . . . . . . 5 | 3.3. HTTP Response over HTTP/1.1 . . . . . . . . . . . . . . . 5 | |||
6.1. Tunneling of ECN Marks . . . . . . . . . . . . . . . . . 6 | 3.4. HTTP Request over HTTP/2 and HTTP/3 . . . . . . . . . . . 6 | |||
7. Security Considerations . . . . . . . . . . . . . . . . . . . 6 | 3.5. HTTP Response over HTTP/2 and HTTP/3 . . . . . . . . . . 7 | |||
8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 | 3.6. Note About Draft Versions . . . . . . . . . . . . . . . . 7 | |||
8.1. HTTP Method . . . . . . . . . . . . . . . . . . . . . . . 6 | 4. Encoding of Proxied UDP Packets . . . . . . . . . . . . . . . 7 | |||
8.2. URI Scheme Registration . . . . . . . . . . . . . . . . . 7 | 5. Performance Considerations . . . . . . . . . . . . . . . . . 8 | |||
9. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 | 5.1. MTU Considerations . . . . . . . . . . . . . . . . . . . 9 | |||
9.1. Normative References . . . . . . . . . . . . . . . . . . 7 | 5.2. Tunneling of ECN Marks . . . . . . . . . . . . . . . . . 9 | |||
9.2. Informative References . . . . . . . . . . . . . . . . . 8 | 6. Security Considerations . . . . . . . . . . . . . . . . . . . 9 | |||
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 8 | 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 | |||
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8 | 7.1. HTTP Upgrade Token . . . . . . . . . . . . . . . . . . . 10 | |||
7.2. Datagram Format Type . . . . . . . . . . . . . . . . . . 10 | ||||
8. References . . . . . . . . . . . . . . . . . . . . . . . . . 10 | ||||
8.1. Normative References . . . . . . . . . . . . . . . . . . 10 | ||||
8.2. Informative References . . . . . . . . . . . . . . . . . 12 | ||||
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 13 | ||||
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 13 | ||||
1. Introduction | 1. Introduction | |||
This document describes the CONNECT-UDP HTTP method. CONNECT-UDP is | This document describes how to proxy UDP over HTTP. Similar to how | |||
similar to the HTTP CONNECT method (see section 4.3.6 of [RFC7231]), | the CONNECT method (see Section 9.3.6 of [SEMANTICS]) allows proxying | |||
but it uses UDP [UDP] instead of TCP [TCP]. | TCP [TCP] over HTTP, this document defines a new mechanism to proxy | |||
UDP [UDP]. | ||||
UDP Proxying supports all versions of HTTP and uses HTTP Datagrams | ||||
[HTTP-DGRAM]. When using HTTP/2 or HTTP/3, UDP proxying uses HTTP | ||||
Extended CONNECT as described in [EXT-CONNECT2] and [EXT-CONNECT3]. | ||||
When using HTTP/1.x, UDP proxying uses HTTP Upgrade as defined in | ||||
Section 7.8 of [SEMANTICS]. | ||||
1.1. Conventions and Definitions | 1.1. Conventions and Definitions | |||
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | |||
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and | "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and | |||
"OPTIONAL" in this document are to be interpreted as described in BCP | "OPTIONAL" in this document are to be interpreted as described in BCP | |||
14 [RFC2119] [RFC8174] when, and only when, they appear in all | 14 [RFC2119] [RFC8174] when, and only when, they appear in all | |||
capitals, as shown here. | capitals, as shown here. | |||
In this document, we use the term "proxy" to refer to the HTTP server | In this document, we use the term "proxy" to refer to the HTTP server | |||
that opens the UDP socket and responds to the CONNECT-UDP request. | that opens the UDP socket and responds to the UDP proxying request. | |||
If there are HTTP intermediaries (as defined in Section 2.3 of | If there are HTTP intermediaries (as defined in Section 3.7 of | |||
[RFC7230]) between the client and the proxy, those are referred to as | [SEMANTICS]) between the client and the proxy, those are referred to | |||
"intermediaries" in this document. | as "intermediaries" in this document. | |||
2. Supported HTTP Versions | Note that, when the HTTP version in use does not support multiplexing | |||
streams (such as HTTP/1.1), any reference to "stream" in this | ||||
document represents the entire connection. | ||||
The CONNECT-UDP method is defined for all versions of HTTP. UDP | 2. Configuration of Clients | |||
payloads are sent using HTTP Datagrams [HTTP-DGRAM]. Note that, when | ||||
the HTTP version in use does not support multiplexing streams (such | ||||
as HTTP/1.1), then any reference to "stream" in this document is | ||||
meant to represent the entire connection. | ||||
3. The CONNECT-UDP Method | Clients are configured to use UDP Proxying over HTTP via an URI | |||
Template [TEMPLATE]. The URI template MUST contain exactly two | ||||
variables: "target_host" and "target_port". Examples are shown | ||||
below: | ||||
The CONNECT-UDP method requests that the recipient establish a tunnel | https://masque.example.org/{target_host}/{target_port}/ | |||
over a single HTTP stream to the destination origin server identified | https://proxy.example.org:4443/masque?h={target_host}&p={target_port} | |||
by the request-target and, if successful, thereafter restrict its | https://proxy.example.org:4443/masque{?target_host,target_port} | |||
behavior to blind forwarding of packets, in both directions, until | ||||
the tunnel is closed. Tunnels are commonly used to create an end-to- | ||||
end virtual connection, which can then be secured using QUIC [QUIC] | ||||
or another protocol running over UDP. | ||||
The request-target of a CONNECT-UDP request is a URI [RFC3986] which | Figure 1: URI Template Examples | |||
uses the "masque" scheme and an immutable path of "/". For example: | ||||
CONNECT-UDP masque://target.example.com:443/ HTTP/1.1 | Since the original HTTP CONNECT method allowed conveying the target | |||
Host: target.example.com:443 | host and port but not the scheme, proxy authority, path, nor query, | |||
there exist proxy configuration interfaces that only allow the user | ||||
to configure the proxy host and the proxy port. Client | ||||
implementations of this specification that are constrained by such | ||||
limitations MUST use the default template which is defined as: | ||||
"https://$PROXY_HOST:$PROXY_PORT/{target_host}/{target_port}/" where | ||||
$PROXY_HOST and $PROXY_PORT are the configured host and port of the | ||||
proxy respectively. Proxy deployments SHOULD use the default | ||||
template to facilitate interoperability with such clients. | ||||
When using HTTP/2 [H2] or later, CONNECT-UDP requests use HTTP | 3. HTTP Exchanges | |||
pseudo-headers with the following requirements: | ||||
* The ":method" pseudo-header field is set to "CONNECT-UDP". | This document defines the "connect-udp" HTTP Upgrade Token. "connect- | |||
udp" uses the Capsule Protocol as defined in [HTTP-DGRAM]. | ||||
* The ":scheme" pseudo-header field is set to "masque". | A "connect-udp" request requests that the recipient establish a | |||
tunnel over a single HTTP stream to the destination target server | ||||
identified by the "target_host" and "target_port" variables of the | ||||
URI template (see Section 2). If the request is successful, the | ||||
proxy commits to converting received HTTP Datagrams into UDP packets | ||||
and vice versa until the tunnel is closed. Tunnels are commonly used | ||||
to create an end-to-end virtual connection, which can then be secured | ||||
using QUIC [QUIC] or another protocol running over UDP. | ||||
* The ":path" pseudo-header field is set to "/". | When sending its UDP proxying request, the client SHALL perform URI | |||
template expansion to determine the path and query of its request. | ||||
target_host supports using DNS names, IPv6 literals and IPv4 | ||||
literals. Note that this URI template expansion requires using pct- | ||||
encoding, so for example if the target_host is "2001:db8::42", it | ||||
will be encoded in the URI as "2001%3Adb8%3A%3A42". | ||||
* The ":authority" pseudo-header field contains the host and port to | A payload within a UDP proxying request message has no defined | |||
connect to (similar to the authority-form of the request-target of | semantics; a UDP proxying request with a non-empty payload is | |||
CONNECT requests; see [RFC7230], Section 5.3). | malformed. | |||
A CONNECT-UDP request that does not conform to these restrictions is | Responses to UDP proxying requests are not cacheable. | |||
malformed (see [H2], Section 8.1.2.6). | ||||
The recipient proxy establishes a tunnel by directly opening a UDP | 3.1. Proxy Handling | |||
socket to the request-target. Any 2xx (Successful) response | ||||
indicates that the proxy has opened a socket to the request-target | Upon receiving a UDP proxying request, the recipient proxy extracts | |||
the "target_host" and "target_port" variables from the URI it has | ||||
reconstructed from the request headers, and establishes a tunnel by | ||||
directly opening a UDP socket to the requested target. | ||||
Unlike TCP, UDP is connection-less. The proxy that opens the UDP | ||||
socket has no way of knowing whether the destination is reachable. | ||||
Therefore it needs to respond to the request without waiting for a | ||||
packet from the target. However, if the target_host is a DNS name, | ||||
the proxy MUST perform DNS resolution before replying to the HTTP | ||||
request. If DNS resolution fails, the proxy MUST fail the request | ||||
and SHOULD send details using the Proxy-Status header [PROXY-STATUS]. | ||||
Proxies can use connected UDP sockets if their operating system | ||||
supports them, as that allows the proxy to rely on the kernel to only | ||||
send it UDP packets that match the correct 5-tuple. If the proxy | ||||
uses a non-connected socket, it MUST validate the IP source address | ||||
and UDP source port on received packets to ensure they match the | ||||
client's request. Packets that do not match MUST be discarded by the | ||||
proxy. | ||||
The lifetime of the socket is tied to the request stream. The proxy | ||||
MUST keep the socket open while the request stream is open. If a | ||||
proxy is notified by its operating system that its socket is no | ||||
longer usable, it MUST close the request stream. Proxies MAY choose | ||||
to close sockets due to a period of inactivity, but they MUST close | ||||
the request stream before closing the socket. Proxies that close | ||||
sockets after a period of inactivity SHOULD NOT use a period lower | ||||
than two minutes, see Section 4.3 of [BEHAVE]. | ||||
A successful response (as defined in Section 3.3 and Section 3.5) | ||||
indicates that the proxy has opened a socket to the requested target | ||||
and is willing to proxy UDP payloads. Any response other than a | and is willing to proxy UDP payloads. Any response other than a | |||
successful response indicates that the tunnel has not yet been | successful response indicates that the request has failed, and the | |||
formed. | client MUST therefore abort the request. | |||
A proxy MUST NOT send any Transfer-Encoding or Content-Length header | 3.2. HTTP Request over HTTP/1.1 | |||
fields in a 2xx (Successful) response to CONNECT-UDP. A client MUST | ||||
treat a response to CONNECT-UDP containing any Content-Length or | ||||
Transfer-Encoding header fields as malformed. | ||||
A payload within a CONNECT-UDP request message has no defined | When using HTTP/1.1, a UDP proxying request will meet the following | |||
semantics; a CONNECT-UDP request with a non-empty payload is | requirements: | |||
malformed. | ||||
Responses to the CONNECT-UDP method are not cacheable. | * the method SHALL be "CONNECT". | |||
4. Encoding of Proxied UDP Packets | * the request-target SHALL use absolute-form (see Section 3.2.2 of | |||
[MESSAGING]). | ||||
UDP packets are encoded using HTTP Datagrams [HTTP-DGRAM]. The | * the request SHALL include a single Host header containing the | |||
payload of a UDP packet (referred to as "data octets" in [UDP]) is | origin of the proxy. | |||
sent unmodified in the "HTTP Datagram Payload" field of an HTTP | ||||
Datagram. In order to use HTTP Datagrams, the CONNECT-UDP client | ||||
will first decide whether or not to use HTTP Datagram Contexts and | ||||
then register its context ID (or lack thereof) using the | ||||
corresponding registration capsule, see [HTTP-DGRAM]. | ||||
Since HTTP Datagrams require prior negotiation (for example, in | * the request SHALL include a single "Connection" header with value | |||
HTTP/3 it is necessary to both send and receive the H3_DATAGRAM | "Upgrade". | |||
SETTINGS Parameter), clients MUST NOT send any HTTP Datagrams until | ||||
they have established support on a given connection. If negotiation | ||||
of HTTP Datagrams fails (for example if an HTTP/3 SETTINGS frame was | ||||
received without the H3_DATAGRAM SETTINGS Parameter), the client MUST | ||||
consider its CONNECT-UDP request as failed. | ||||
The proxy that is creating the UDP socket to the destination responds | * the request SHALL include a single "Upgrade" header with value | |||
to the CONNECT-UDP request with a 2xx (Successful) response, and | "connect-udp". | |||
indicates it supports HTTP Datagrams by sending the corresponding | ||||
registration capsule. | ||||
Clients MAY optimistically start sending proxied UDP packets before | For example, if the client is configured with URI template | |||
receiving the response to its CONNECT-UDP request, noting however | "https://proxy.example.org/{target_host}/{target_port}/" and wishes | |||
that those may not be processed by the proxy if it responds to the | to open a UDP proxying tunnel to target 192.0.2.42:443, it could send | |||
CONNECT-UDP request with a failure, or if the datagrams arrive before | the following request: | |||
the CONNECT-UDP request. | ||||
Extensions to CONNECT-UDP MAY leverage the "Context Extensions" field | CONNECT https://proxy.example.org/192.0.2.42/443/ HTTP/1.1 | |||
of registration capsules in order to negotiate different semantics or | Host: proxy.example.org | |||
encoding for UDP payloads. | Connection: upgrade | |||
Upgrade: connect-udp | ||||
5. Proxy Handling | Figure 2: Example HTTP Request over HTTP/1.1 | |||
Unlike TCP, UDP is connection-less. The proxy that opens the UDP | 3.3. HTTP Response over HTTP/1.1 | |||
socket has no way of knowing whether the destination is reachable. | ||||
Therefore it needs to respond to the CONNECT-UDP request without | ||||
waiting for a TCP SYN-ACK. | ||||
Proxies can use connected UDP sockets if their operating system | The proxy SHALL indicate a successful response by replying with the | |||
supports them, as that allows the proxy to rely on the kernel to only | following requirements: | |||
send it UDP packets that match the correct 5-tuple. If the proxy | ||||
uses a non-connected socket, it MUST validate the IP source address | ||||
and UDP source port on received packets to ensure they match the | ||||
client's CONNECT-UDP request. Packets that do not match MUST be | ||||
discarded by the proxy. | ||||
The lifetime of the socket is tied to the CONNECT-UDP stream. The | * the HTTP status code on the response SHALL be 101 (Switching | |||
proxy MUST keep the socket open while the CONNECT-UDP stream is open. | Protocols). | |||
Proxies MAY choose to close sockets due to a period of inactivity, | ||||
but they MUST close the CONNECT-UDP stream before closing the socket. | ||||
6. Performance Considerations | * the reponse SHALL include a single "Connection" header with value | |||
"Upgrade". | ||||
* the response SHALL include a single "Upgrade" header with value | ||||
"connect-udp". | ||||
* the response SHALL NOT include any Transfer-Encoding or Content- | ||||
Length header fields. | ||||
If any of these requirements are not met, the client MUST treat this | ||||
proxying attempt as failed and abort the connection. | ||||
For example, the proxy could respond with: | ||||
HTTP/1.1 101 Switching Protocols | ||||
Connection: upgrade | ||||
Upgrade: connect-udp | ||||
Figure 3: Example HTTP Response over HTTP/1.1 | ||||
3.4. HTTP Request over HTTP/2 and HTTP/3 | ||||
When using HTTP/2 [H2] or HTTP/3 [H3], UDP proxying requests use HTTP | ||||
pseudo-headers with the following requirements: | ||||
* The ":method" pseudo-header field SHALL be "CONNECT". | ||||
* The ":protocol" pseudo-header field SHALL be "connect-udp". | ||||
* The ":authority" pseudo-header field SHALL contain the authority | ||||
of the proxy. | ||||
* The ":path" and ":scheme" pseudo-header fields SHALL NOT be empty. | ||||
Their values SHALL contain the scheme and path from the URI | ||||
template after the URI template expansion process has been | ||||
completed. | ||||
A UDP proxying request that does not conform to these restrictions is | ||||
malformed (see Section 8.1.2.6 of [H2]). | ||||
For example, if the client is configured with URI template | ||||
"https://proxy.example.org/{target_host}/{target_port}/" and wishes | ||||
to open a UDP proxying tunnel to target 192.0.2.42:443, it could send | ||||
the following request: | ||||
HEADERS | ||||
:method = CONNECT | ||||
:protocol = connect-udp | ||||
:scheme = https | ||||
:path = /192.0.2.42/443/ | ||||
:authority = proxy.example.org | ||||
Figure 4: Example HTTP Request over HTTP/2 | ||||
3.5. HTTP Response over HTTP/2 and HTTP/3 | ||||
The proxy SHALL indicate a successful response by replying with any | ||||
2xx (Successful) HTTP status code, without any Transfer-Encoding or | ||||
Content-Length header fields. | ||||
If any of these requirements are not met, the client MUST treat this | ||||
proxying attempt as failed and abort the request. | ||||
For example, the proxy could respond with: | ||||
HEADERS | ||||
:status = 200 | ||||
Figure 5: Example HTTP Response over HTTP/2 | ||||
3.6. Note About Draft Versions | ||||
[[RFC editor: please remove this section before publication.]] | ||||
In order to allow implementations to support multiple draft versions | ||||
of this specification during its development, we introduce the | ||||
"connect-udp-version" header. When sent by the client, it contains a | ||||
list of draft numbers supported by the client (e.g., "connect-udp- | ||||
version: 0, 2"). When sent by the proxy, it contains a single draft | ||||
number selected by the proxy from the list provided by the client | ||||
(e.g., "connect-udp-version: 2"). Sending this header is RECOMMENDED | ||||
but not required. | ||||
4. Encoding of Proxied UDP Packets | ||||
UDP packets are encoded using HTTP Datagrams [HTTP-DGRAM] with the | ||||
UDP_PAYLOAD HTTP Datagram Format Type (see value in Section 7.2). | ||||
When using the UDP_PAYLOAD HTTP Datagram Format Type, the payload of | ||||
a UDP packet (referred to as "data octets" in [UDP]) is sent | ||||
unmodified in the "HTTP Datagram Payload" field of an HTTP Datagram. | ||||
In order to use HTTP Datagrams, the client will first decide whether | ||||
or not to use HTTP Datagram Contexts and then register its context ID | ||||
(or lack thereof) using the corresponding registration capsule, see | ||||
[HTTP-DGRAM]. | ||||
When sending a REGISTER_DATAGRAM_CONTEXT or | ||||
REGISTER_DATAGRAM_NO_CONTEXT capsule using the "Datagram Format Type" | ||||
set to UDP_PAYLOAD, the "Datagram Format Additional Data" field SHALL | ||||
be empty. Servers MUST NOT register contexts using the UDP_PAYLOAD | ||||
HTTP Datagram Format Type. Clients MUST NOT register more than one | ||||
context using the UDP_PAYLOAD HTTP Datagram Format Type. Endpoints | ||||
MUST NOT close contexts using the UDP_PAYLOAD HTTP Datagram Format | ||||
Type. If an endpoint detects a violation of any of these | ||||
requirements, it MUST abort the stream. | ||||
Clients MAY optimistically start sending proxied UDP packets before | ||||
receiving the response to its UDP proxying request, noting however | ||||
that those may not be processed by the proxy if it responds to the | ||||
request with a failure, or if the datagrams are received by the proxy | ||||
before the request. | ||||
Extensions to this mechanism MAY define new HTTP Datagram Format | ||||
Types in order to use different semantics or encodings for UDP | ||||
payloads. | ||||
5. Performance Considerations | ||||
Proxies SHOULD strive to avoid increasing burstiness of UDP traffic: | Proxies SHOULD strive to avoid increasing burstiness of UDP traffic: | |||
they SHOULD NOT queue packets in order to increase batching. | they SHOULD NOT queue packets in order to increase batching. | |||
When the protocol running over UDP that is being proxied uses | When the protocol running over UDP that is being proxied uses | |||
congestion control (e.g., [QUIC]), the proxied traffic will incur at | congestion control (e.g., [QUIC]), the proxied traffic will incur at | |||
least two nested congestion controllers. This can reduce performance | least two nested congestion controllers. This can reduce performance | |||
but the underlying HTTP connection MUST NOT disable congestion | but the underlying HTTP connection MUST NOT disable congestion | |||
control unless it has an out-of-band way of knowing with absolute | control unless it has an out-of-band way of knowing with absolute | |||
certainty that the inner traffic is congestion-controlled. | certainty that the inner traffic is congestion-controlled. | |||
If a client or proxy with a connection containing a CONNECT-UDP | If a client or proxy with a connection containing a UDP proxying | |||
stream disables congestion control, it MUST NOT signal ECN support on | request stream disables congestion control, it MUST NOT signal ECN | |||
that connection. That is, it MUST mark all IP headers with the Not- | support on that connection. That is, it MUST mark all IP headers | |||
ECT codepoint. It MAY continue to report ECN feedback via ACK_ECN | with the Not-ECT codepoint. It MAY continue to report ECN feedback | |||
frames, as the peer may not have disabled congestion control. | via ACK_ECN frames, as the peer may not have disabled congestion | |||
control. | ||||
When the protocol running over UDP that is being proxied uses loss | When the protocol running over UDP that is being proxied uses loss | |||
recovery (e.g., [QUIC]), and the underlying HTTP connection runs over | recovery (e.g., [QUIC]), and the underlying HTTP connection runs over | |||
TCP, the proxied traffic will incur at least two nested loss recovery | TCP, the proxied traffic will incur at least two nested loss recovery | |||
mechanisms. This can reduce performance as both can sometimes | mechanisms. This can reduce performance as both can sometimes | |||
independently retransmit the same data. To avoid this, HTTP/3 | independently retransmit the same data. To avoid this, HTTP/3 | |||
datagrams SHOULD be used. | datagrams SHOULD be used. | |||
6.1. Tunneling of ECN Marks | 5.1. MTU Considerations | |||
CONNECT-UDP does not create an IP-in-IP tunnel, so the guidance in | When using HTTP/3 with the QUIC Datagram extension [DGRAM], UDP | |||
payloads are transmitted in QUIC DATAGRAM frames. Since those cannot | ||||
be fragmented, they can only carry payloads up to a given length | ||||
determined by the QUIC connection configuration and the path MTU. If | ||||
a proxy is using QUIC DATAGRAM frames and it receives a UDP payload | ||||
from the target that will not fit inside a QUIC DATAGRAM frame, the | ||||
proxy SHOULD NOT send the UDP payload in a DATAGRAM capsule, as that | ||||
defeats the end-to-end unreliability characteristic that methods such | ||||
as Datagram Packetization Layer Path MTU Discovery (DPLPMTUD) depend | ||||
on [RFC8899]. In this scenario, the proxy SHOULD drop the UDP | ||||
payload and send an ICMP "Packet Too Big" message to the target | ||||
[RFC4443]. | ||||
5.2. Tunneling of ECN Marks | ||||
UDP proxying does not create an IP-in-IP tunnel, so the guidance in | ||||
[RFC6040] about transferring ECN marks between inner and outer IP | [RFC6040] about transferring ECN marks between inner and outer IP | |||
headers does not apply. There is no inner IP header in CONNECT-UDP | headers does not apply. There is no inner IP header in UDP proxying | |||
tunnels. | tunnels. | |||
Note that CONNECT-UDP clients do not have the ability in this | Note that UDP proxying clients do not have the ability in this | |||
specification to control the ECN codepoints on UDP packets the proxy | specification to control the ECN codepoints on UDP packets the proxy | |||
sends to the server, nor can proxies communicate the markings of each | sends to the server, nor can proxies communicate the markings of each | |||
UDP packet from server to proxy. | UDP packet from server to proxy. | |||
A CONNECT-UDP proxy MUST ignore ECN bits in the IP header of UDP | A UDP proxy MUST ignore ECN bits in the IP header of UDP packets | |||
packets received from the server, and MUST set the ECN bits to Not- | received from the server, and MUST set the ECN bits to Not-ECT on UDP | |||
ECT on UDP packets it sends to the server. These do not relate to | packets it sends to the server. These do not relate to the ECN | |||
the ECN markings of packets sent between client and proxy in any way. | markings of packets sent between client and proxy in any way. | |||
7. Security Considerations | 6. Security Considerations | |||
There are significant risks in allowing arbitrary clients to | There are significant risks in allowing arbitrary clients to | |||
establish a tunnel to arbitrary servers, as that could allow bad | establish a tunnel to arbitrary servers, as that could allow bad | |||
actors to send traffic and have it attributed to the proxy. Proxies | actors to send traffic and have it attributed to the proxy. Proxies | |||
that support CONNECT-UDP SHOULD restrict its use to authenticated | that support UDP proxying SHOULD restrict its use to authenticated | |||
users. | users. | |||
Because the CONNECT method creates a TCP connection to the target, | Because the CONNECT method creates a TCP connection to the target, | |||
the target has to indicate its willingness to accept TCP connections | the target has to indicate its willingness to accept TCP connections | |||
by responding with a TCP SYN-ACK before the proxy can send it | by responding with a TCP SYN-ACK before the proxy can send it | |||
application data. UDP doesn't have this property, so a CONNECT-UDP | application data. UDP doesn't have this property, so a UDP proxy | |||
proxy could send more data to an unwilling target than a CONNECT | could send more data to an unwilling target than a CONNECT proxy. | |||
proxy. However, in practice denial of service attacks target open | However, in practice denial of service attacks target open TCP ports | |||
TCP ports so the TCP SYN-ACK does not offer much protection in real | so the TCP SYN-ACK does not offer much protection in real scenarios. | |||
scenarios. Proxies MUST NOT introspect the contents of UDP payloads | Proxies MUST NOT introspect the contents of UDP payloads as that | |||
as that would lead to ossification of UDP-based protocols by proxies. | would lead to ossification of UDP-based protocols by proxies. | |||
8. IANA Considerations | 7. IANA Considerations | |||
8.1. HTTP Method | 7.1. HTTP Upgrade Token | |||
This document will request IANA to register "CONNECT-UDP" in the HTTP | This document will request IANA to register "connect-udp" in the HTTP | |||
Method Registry (IETF review) maintained at | Upgrade Token Registry maintained at | |||
<https://www.iana.org/assignments/http-methods>. | <https://www.iana.org/assignments/http-upgrade-tokens>. | |||
+-------------+------+------------+---------------+ | Value: connect-udp | |||
| Method Name | Safe | Idempotent | Reference | | ||||
+-------------+------+------------+---------------+ | ||||
| CONNECT-UDP | no | no | This document | | ||||
+-------------+------+------------+---------------+ | ||||
8.2. URI Scheme Registration | Description: Proxying of UDP Payloads. | |||
This document will request IANA to register the URI scheme "masque". | Expected Version Tokens: None. | |||
The syntax definition below uses Augmented Backus-Naur Form (ABNF) | Reference: This document. | |||
[RFC5234]. The definitions of "host" and "port" are adopted from | ||||
[RFC3986]. The syntax of a MASQUE URI is: | ||||
masque-URI = "masque:" "//" host ":" port "/" | 7.2. Datagram Format Type | |||
The "host" and "port" component MUST NOT be empty, and the "port" | This document will request IANA to register UDP_PAYLOAD in the "HTTP | |||
component MUST NOT be 0. | Datagram Format Types" registry established by [HTTP-DGRAM]. | |||
9. References | +=============+==========+===============+ | |||
| Type | Value | Specification | | ||||
+=============+==========+===============+ | ||||
| UDP_PAYLOAD | 0xff6f00 | This Document | | ||||
+-------------+----------+---------------+ | ||||
9.1. Normative References | Table 1: Registered Datagram Format Type | |||
8. References | ||||
8.1. Normative References | ||||
[DGRAM] Pauly, T., Kinnear, E., and D. Schinazi, "An Unreliable | ||||
Datagram Extension to QUIC", Work in Progress, Internet- | ||||
Draft, draft-ietf-quic-datagram-06, 5 October 2021, | ||||
<https://datatracker.ietf.org/doc/html/draft-ietf-quic- | ||||
datagram-06>. | ||||
[EXT-CONNECT2] | ||||
McManus, P., "Bootstrapping WebSockets with HTTP/2", | ||||
RFC 8441, DOI 10.17487/RFC8441, September 2018, | ||||
<https://www.rfc-editor.org/rfc/rfc8441>. | ||||
[EXT-CONNECT3] | ||||
Hamilton, R., "Bootstrapping WebSockets with HTTP/3", Work | ||||
in Progress, Internet-Draft, draft-ietf-httpbis-h3- | ||||
websockets-00, 9 September 2021, | ||||
<https://datatracker.ietf.org/doc/html/draft-ietf-httpbis- | ||||
h3-websockets-00>. | ||||
[H2] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext | [H2] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext | |||
Transfer Protocol Version 2 (HTTP/2)", RFC 7540, | Transfer Protocol Version 2 (HTTP/2)", RFC 7540, | |||
DOI 10.17487/RFC7540, May 2015, | DOI 10.17487/RFC7540, May 2015, | |||
<https://www.rfc-editor.org/rfc/rfc7540>. | <https://www.rfc-editor.org/rfc/rfc7540>. | |||
[H3] Bishop, M., "Hypertext Transfer Protocol Version 3 | ||||
(HTTP/3)", Work in Progress, Internet-Draft, draft-ietf- | ||||
quic-http-34, 2 February 2021, | ||||
<https://datatracker.ietf.org/doc/html/draft-ietf-quic- | ||||
http-34>. | ||||
[HTTP-DGRAM] | [HTTP-DGRAM] | |||
Schinazi, D. and L. Pardue, "Using Datagrams with HTTP", | Schinazi, D. and L. Pardue, "Using Datagrams with HTTP", | |||
Work in Progress, Internet-Draft, draft-ietf-masque-h3- | Work in Progress, Internet-Draft, draft-ietf-masque-h3- | |||
datagram-03, 12 July 2021, | datagram-04, 6 October 2021, | |||
<https://datatracker.ietf.org/doc/html/draft-ietf-masque- | <https://datatracker.ietf.org/doc/html/draft-ietf-masque- | |||
h3-datagram-03>. | h3-datagram-04>. | |||
[MESSAGING] | ||||
Fielding, R. T., Nottingham, M., and J. Reschke, | ||||
"HTTP/1.1", Work in Progress, Internet-Draft, draft-ietf- | ||||
httpbis-messaging-19, 12 September 2021, | ||||
<https://datatracker.ietf.org/doc/html/draft-ietf-httpbis- | ||||
messaging-19>. | ||||
[QUIC] Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based | [QUIC] Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based | |||
Multiplexed and Secure Transport", RFC 9000, | Multiplexed and Secure Transport", RFC 9000, | |||
DOI 10.17487/RFC9000, May 2021, | DOI 10.17487/RFC9000, May 2021, | |||
<https://www.rfc-editor.org/rfc/rfc9000>. | <https://www.rfc-editor.org/rfc/rfc9000>. | |||
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | |||
Requirement Levels", BCP 14, RFC 2119, | Requirement Levels", BCP 14, RFC 2119, | |||
DOI 10.17487/RFC2119, March 1997, | DOI 10.17487/RFC2119, March 1997, | |||
<https://www.rfc-editor.org/rfc/rfc2119>. | <https://www.rfc-editor.org/rfc/rfc2119>. | |||
[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform | ||||
Resource Identifier (URI): Generic Syntax", STD 66, | ||||
RFC 3986, DOI 10.17487/RFC3986, January 2005, | ||||
<https://www.rfc-editor.org/rfc/rfc3986>. | ||||
[RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax | ||||
Specifications: ABNF", STD 68, RFC 5234, | ||||
DOI 10.17487/RFC5234, January 2008, | ||||
<https://www.rfc-editor.org/rfc/rfc5234>. | ||||
[RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer | ||||
Protocol (HTTP/1.1): Message Syntax and Routing", | ||||
RFC 7230, DOI 10.17487/RFC7230, June 2014, | ||||
<https://www.rfc-editor.org/rfc/rfc7230>. | ||||
[RFC7231] "*** BROKEN REFERENCE ***". | ||||
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC | [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC | |||
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, | 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, | |||
May 2017, <https://www.rfc-editor.org/rfc/rfc8174>. | May 2017, <https://www.rfc-editor.org/rfc/rfc8174>. | |||
[SEMANTICS] | ||||
Fielding, R. T., Nottingham, M., and J. Reschke, "HTTP | ||||
Semantics", Work in Progress, Internet-Draft, draft-ietf- | ||||
httpbis-semantics-19, 12 September 2021, | ||||
<https://datatracker.ietf.org/doc/html/draft-ietf-httpbis- | ||||
semantics-19>. | ||||
[TCP] Postel, J., "Transmission Control Protocol", STD 7, | [TCP] Postel, J., "Transmission Control Protocol", STD 7, | |||
RFC 793, DOI 10.17487/RFC0793, September 1981, | RFC 793, DOI 10.17487/RFC0793, September 1981, | |||
<https://www.rfc-editor.org/rfc/rfc793>. | <https://www.rfc-editor.org/rfc/rfc793>. | |||
[TEMPLATE] Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., | ||||
and D. Orchard, "URI Template", RFC 6570, | ||||
DOI 10.17487/RFC6570, March 2012, | ||||
<https://www.rfc-editor.org/rfc/rfc6570>. | ||||
[UDP] Postel, J., "User Datagram Protocol", STD 6, RFC 768, | [UDP] Postel, J., "User Datagram Protocol", STD 6, RFC 768, | |||
DOI 10.17487/RFC0768, August 1980, | DOI 10.17487/RFC0768, August 1980, | |||
<https://www.rfc-editor.org/rfc/rfc768>. | <https://www.rfc-editor.org/rfc/rfc768>. | |||
9.2. Informative References | 8.2. Informative References | |||
[BEHAVE] Audet, F., Ed. and C. Jennings, "Network Address | ||||
Translation (NAT) Behavioral Requirements for Unicast | ||||
UDP", BCP 127, RFC 4787, DOI 10.17487/RFC4787, January | ||||
2007, <https://www.rfc-editor.org/rfc/rfc4787>. | ||||
[PROXY-STATUS] | ||||
Nottingham, M. and P. Sikora, "The Proxy-Status HTTP | ||||
Response Header Field", Work in Progress, Internet-Draft, | ||||
draft-ietf-httpbis-proxy-status-06, 16 August 2021, | ||||
<https://datatracker.ietf.org/doc/html/draft-ietf-httpbis- | ||||
proxy-status-06>. | ||||
[RFC4443] Conta, A., Deering, S., and M. Gupta, Ed., "Internet | ||||
Control Message Protocol (ICMPv6) for the Internet | ||||
Protocol Version 6 (IPv6) Specification", STD 89, | ||||
RFC 4443, DOI 10.17487/RFC4443, March 2006, | ||||
<https://www.rfc-editor.org/rfc/rfc4443>. | ||||
[RFC6040] Briscoe, B., "Tunnelling of Explicit Congestion | [RFC6040] Briscoe, B., "Tunnelling of Explicit Congestion | |||
Notification", RFC 6040, DOI 10.17487/RFC6040, November | Notification", RFC 6040, DOI 10.17487/RFC6040, November | |||
2010, <https://www.rfc-editor.org/rfc/rfc6040>. | 2010, <https://www.rfc-editor.org/rfc/rfc6040>. | |||
[RFC8899] Fairhurst, G., Jones, T., Tüxen, M., Rüngeler, I., and T. | ||||
Völker, "Packetization Layer Path MTU Discovery for | ||||
Datagram Transports", RFC 8899, DOI 10.17487/RFC8899, | ||||
September 2020, <https://www.rfc-editor.org/rfc/rfc8899>. | ||||
Acknowledgments | Acknowledgments | |||
This document is a product of the MASQUE Working Group, and the | This document is a product of the MASQUE Working Group, and the | |||
author thanks all MASQUE enthusiasts for their contibutions. This | author thanks all MASQUE enthusiasts for their contibutions. This | |||
proposal was inspired directly or indirectly by prior work from many | proposal was inspired directly or indirectly by prior work from many | |||
people. In particular, the author would like to thank Eric Rescorla | people. In particular, the author would like to thank Eric Rescorla | |||
for suggesting to use an HTTP method to proxy UDP. Thanks to Lucas | for suggesting to use an HTTP method to proxy UDP. Thanks to Lucas | |||
Pardue for their inputs on this document. | Pardue for their inputs on this document. | |||
Author's Address | Author's Address | |||
End of changes. 63 change blocks. | ||||
176 lines changed or deleted | 395 lines changed or added | |||
This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |