<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.29 (Ruby 3.4.4) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-seemann-masque-connect-udp-ecn-00" category="std" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.29.0 -->
  <front>
    <title abbrev="CONNECT-UDP ECN">Using ECN when Proxying UDP in HTTP</title>
    <seriesInfo name="Internet-Draft" value="draft-seemann-masque-connect-udp-ecn-00"/>
    <author fullname="Marten Seemann">
      <organization>Smallstep</organization>
      <address>
        <email>martenseemann@gmail.com</email>
      </address>
    </author>
    <date year="2025" month="June" day="30"/>
    <area>Web and Internet Transport</area>
    <workgroup>Multiplexed Application Substrate over QUIC Encryption</workgroup>
    <keyword>UDP</keyword>
    <keyword>ECN</keyword>
    <keyword>Proxying</keyword>
    <abstract>
      <?line 37?>

<t>This document describes how to proxy the ECN bits when proxying UDP in HTTP.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        The latest revision of this draft can be found at <eref target="https://marten-seemann.github.io/draft-seemann-masque-connect-udp-ecn/draft-seemann-masque-connect-udp-ecn.html"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-seemann-masque-connect-udp-ecn/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        Multiplexed Application Substrate over QUIC Encryption Working Group mailing list (<eref target="mailto:masque@ietf.org"/>),
        which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/masque/"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/masque/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/marten-seemann/draft-seemann-masque-connect-udp-ecn"/>.</t>
    </note>
  </front>
  <middle>
    <?line 41?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>Explicit Congestion Notification marking <xref target="RFC3168"/> uses two bits in the IP
header to signal congestion from a network to endpoints.</t>
      <t><xref target="RFC9298"/> describes how UDP datagrams can be proxied in HTTP. This allows the
proxying of the payload of UDP datagrams, however, it is not possible to proxy
the ECN bits. This document defines an extension to <xref target="RFC9298"/> that allows the
proxying of the ECN bits without imposing any encoding overhead.</t>
      <t>When establishing a tunnel, the client registers four context identifiers, one
for each ECN marking. These context identifiers are then used to:</t>
      <ol spacing="normal" type="1"><li>
          <t>For UDP datagrams sent from the client to the proxy: To request the proxy to
set the ECN marking on the UDP datagram sent to the target.</t>
        </li>
        <li>
          <t>For UDP datagrams sent from the proxy to the client: To inform the client
about the ECN marking of the UDP datagram received from the target.</t>
        </li>
      </ol>
    </section>
    <section anchor="conventions-and-definitions">
      <name>Conventions and Definitions</name>
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
      <?line -18?>

</section>
    <section anchor="proxying-ecn">
      <name>Proxying ECN</name>
      <t>The proxy fulfills a dual role: First, it sends UDP datagrams received from the
client over HTTP to the target, and sends UDP datagrams received from the target
over HTTP to the client. Second, it also acts as a router that can experience
congestion in both directions.</t>
      <section anchor="sending-udp-datagrams-from-the-client-to-the-proxy">
        <name>Sending UDP datagrams from the client to the proxy</name>
        <t>When sending UDP datagrams over the tunnel, the client uses the context
identifier as negotiated during establishment of the tunnel (see
<xref target="negotiation"/>). Under normal circumstances, the proxy <bcp14>MUST</bcp14> set the ECN marking
on the UDP datagram sent to the target based on the context identifier. However,
if the proxy is experiencing congestion on the link to the target, it <bcp14>SHOULD</bcp14>
apply ECN markings according to <xref target="RFC3168"/> and <xref target="RFC8331"/>.</t>
      </section>
      <section anchor="sending-udp-datagrams-from-the-proxy-to-the-client">
        <name>Sending UDP datagrams from the proxy to the client</name>
        <t>When receiving UDP datagrams from the target, the proxy uses the context
identifier negotiated during establishment of the tunnel to indicate the ECN
marking the UDP datagram was received with. Similarly, if the HTTP connection to
the client is experiencing congestion, the proxy <bcp14>SHOULD</bcp14> apply ECN markings.</t>
      </section>
    </section>
    <section anchor="negotiation">
      <name>Negotiating Extension and Registration of Context Identifiers</name>
      <t>To support ECN mode, both clients and proxies need to include the "Proxy-ECN"
header field. This indicates support for ECN mode and registers the context
IDs.</t>
      <artwork><![CDATA[
proxy-ecn = ?1; not-ect = 2; ect1 = 100; ect0 = 1234; ce = 42
]]></artwork>
      <t>"Proxy-ECN" is an Item Structured Header <xref target="RFC8941"/>. Its value <bcp14>MUST</bcp14> be a
boolean.</t>
      <t>If the client wants to enable proxying of ECN markings, it sets the value to
"?1". The client <bcp14>MUST</bcp14> add the following four parameters: "not-ect", "ect1",
"ect0", and "ce", each of which is of type sf-integer. The values are used to
register the context IDs for the different ECN markings. The numbers <bcp14>MUST</bcp14> be even
according to the rules for context identifiers in Section 4 of <xref target="RFC9298"/>.</t>
      <t>It is <bcp14>RECOMMENDED</bcp14> to use context identifier values that can be encoded using the
same QUIC Variable-Length Integer encoding (see Section 16 of <xref target="RFC9000"/>).</t>
      <t>If the proxy wants to enable proxying of ECN markings, it sets the value to
"?1". It <bcp14>MUST NOT</bcp14> add any of the four parameters defined above.</t>
      <t>If the proxy wants to disable proxying of ECN markings, it either omits the
"Proxy-ECN" header field or sets the value to "?0". This also refuses the
registration of the context IDs.</t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>TODO Security</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>This document has no IANA actions.</t>
    </section>
  </middle>
  <back>
    <references anchor="sec-normative-references">
      <name>Normative References</name>
      <reference anchor="RFC3168">
        <front>
          <title>The Addition of Explicit Congestion Notification (ECN) to IP</title>
          <author fullname="K. Ramakrishnan" initials="K." surname="Ramakrishnan"/>
          <author fullname="S. Floyd" initials="S." surname="Floyd"/>
          <author fullname="D. Black" initials="D." surname="Black"/>
          <date month="September" year="2001"/>
          <abstract>
            <t>This memo specifies the incorporation of ECN (Explicit Congestion Notification) to TCP and IP, including ECN's use of two bits in the IP header. [STANDARDS-TRACK]</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="3168"/>
        <seriesInfo name="DOI" value="10.17487/RFC3168"/>
      </reference>
      <reference anchor="RFC9298">
        <front>
          <title>Proxying UDP in HTTP</title>
          <author fullname="D. Schinazi" initials="D." surname="Schinazi"/>
          <date month="August" year="2022"/>
          <abstract>
            <t>This document describes how to proxy UDP in HTTP, similar to how the HTTP CONNECT method allows proxying TCP in HTTP. More specifically, this document defines a protocol that allows an HTTP client to create a tunnel for UDP communications through an HTTP server that acts as a proxy.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="9298"/>
        <seriesInfo name="DOI" value="10.17487/RFC9298"/>
      </reference>
      <reference anchor="RFC2119">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author fullname="S. Bradner" initials="S." surname="Bradner"/>
          <date month="March" year="1997"/>
          <abstract>
            <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <seriesInfo name="DOI" value="10.17487/RFC2119"/>
      </reference>
      <reference anchor="RFC8174">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author fullname="B. Leiba" initials="B." surname="Leiba"/>
          <date month="May" year="2017"/>
          <abstract>
            <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="8174"/>
        <seriesInfo name="DOI" value="10.17487/RFC8174"/>
      </reference>
      <reference anchor="RFC8331">
        <front>
          <title>RTP Payload for Society of Motion Picture and Television Engineers (SMPTE) ST 291-1 Ancillary Data</title>
          <author fullname="T. Edwards" initials="T." surname="Edwards"/>
          <date month="February" year="2018"/>
          <abstract>
            <t>This memo describes a Real-time Transport Protocol (RTP) payload format for the Society of Motion Picture and Television Engineers (SMPTE) ancillary space (ANC) data, as defined by SMPTE ST 291-1. SMPTE ANC data is generally used along with professional video formats to carry a range of ancillary data types, including time code, Closed Captioning, and the Active Format Description (AFD).</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="8331"/>
        <seriesInfo name="DOI" value="10.17487/RFC8331"/>
      </reference>
      <reference anchor="RFC8941">
        <front>
          <title>Structured Field Values for HTTP</title>
          <author fullname="M. Nottingham" initials="M." surname="Nottingham"/>
          <author fullname="P-H. Kamp" surname="P-H. Kamp"/>
          <date month="February" year="2021"/>
          <abstract>
            <t>This document describes a set of data types and associated algorithms that are intended to make it easier and safer to define and handle HTTP header and trailer fields, known as "Structured Fields", "Structured Headers", or "Structured Trailers". It is intended for use by specifications of new HTTP fields that wish to use a common syntax that is more restrictive than traditional HTTP field values.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="8941"/>
        <seriesInfo name="DOI" value="10.17487/RFC8941"/>
      </reference>
      <reference anchor="RFC9000">
        <front>
          <title>QUIC: A UDP-Based Multiplexed and Secure Transport</title>
          <author fullname="J. Iyengar" initials="J." role="editor" surname="Iyengar"/>
          <author fullname="M. Thomson" initials="M." role="editor" surname="Thomson"/>
          <date month="May" year="2021"/>
          <abstract>
            <t>This document defines the core of the QUIC transport protocol. QUIC provides applications with flow-controlled streams for structured communication, low-latency connection establishment, and network path migration. QUIC includes security measures that ensure confidentiality, integrity, and availability in a range of deployment circumstances. Accompanying documents describe the integration of TLS for key negotiation, loss detection, and an exemplary congestion control algorithm.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="9000"/>
        <seriesInfo name="DOI" value="10.17487/RFC9000"/>
      </reference>
    </references>
    <?line 144?>

<section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>TODO acknowledge.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA61X3XLbuBW+x1Ogyk3bsWTJ9mwTZXe9ruzUmrFlN5ab2en0
AiRBCWMK4AKgFTXjd+mz9Mn6HYCkqEibdae9IgkC53zn/0O/32de+UKOee/R
Kb3gV5MZXy+l5vfWfN7QyuPlPVeaX8/n9z0mksTKZ+ye3M1mV5N5n/7iTI+l
wsuFsZsxdz5jLDOpFivIzazIfd9JuRJa91fC/VLJfmq0lqnvV1nZl6nuD4fM
VclKOaeM9psS56ZX8w9MV6tE2jHLIHzMcMpJ7So35t5WkgHHKRNWCuD5JBMu
dMan2kurpedzK7QrjfU9tjb2aWFNVWLfbVV4VRbys8z4RVkWCrihkz9UifMW
arh5lpb/9XE64Vc6tZuSfvfYk9xATDZmvE8eoQfMpkfjKPYsdQWUnP+vujiP
Luh9AnAKwV9IIK2vhCqwHr34k5I+Hxi7oD/Cpkv8WXpfuvHxMW2kJfUsB822
Y1o4TqxZO3kcRRzT0YXyyyoJYq2XuonV8WsiR+cLWOL8jvKunEGUP1DmVRJf
tWmw9Kuix5io/NJYCgpwcJ5XRRGz7jZA4A9RSvgJDwit/hlCMOYPK1EUzssy
/JPRsRF4rfqnBS0OUrNiTBu7wsFnhJcpnXe+WL/f5yLEM/WMzZfKceR+tZLa
80y61KpEOr40a+4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