<?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-rfc2629 version 1.6.5 (Ruby 3.0.3) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-schinazi-masque-connect-udp-ecn-02" category="std" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.12.3 -->
  <front>
    <title abbrev="CONNECT-UDP ECN Extension">An ECN Extension to CONNECT-UDP</title>
    <seriesInfo name="Internet-Draft" value="draft-schinazi-masque-connect-udp-ecn-02"/>
    <author initials="D." surname="Schinazi" fullname="David Schinazi">
      <organization>Google LLC</organization>
      <address>
        <postal>
          <street>1600 Amphitheatre Parkway</street>
          <city>Mountain View, California 94043</city>
          <country>United States of America</country>
        </postal>
        <email>dschinazi.ietf@gmail.com</email>
      </address>
    </author>
    <date year="2022" month="March" day="28"/>
    <workgroup>MASQUE</workgroup>
    <keyword>Internet-Draft</keyword>
    <abstract>
      <t>CONNECT-UDP allows proxying UDP packets over HTTP. This document describes an
extension to CONNECT-UDP that allows conveying ECN information on proxied UDP
packets.</t>
    </abstract>
    <note removeInRFC="true">
      <name>Discussion Venues</name>
      <t>Source for this draft and an issue tracker can be found at
  <eref target="https://github.com/DavidSchinazi/draft-connect-udp-ecn"/>.</t>
    </note>
  </front>
  <middle>
    <section anchor="intro">
      <name>Introduction</name>
      <t>CONNECT-UDP <xref target="CONNECT-UDP"/> allows proxying UDP
packets over HTTP. This document describes an extension to CONNECT-UDP that
allows conveying ECN <xref target="ECN"/> information on proxied UDP packets.</t>
      <section anchor="defs">
        <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>
      </section>
    </section>
    <section anchor="context-identifiers">
      <name>Context Identifiers</name>
      <t>The "Context Identifiers" section of <xref target="CONNECT-UDP"/> defines the concept of
context IDs and how they can be used to extend CONNECT-UDP. When a client wishes
to use ECN with CONNECT-UDP, it generates an unique client-allocated context ID.
In this document, we'll refer to that context ID as the "chosen context ID".
Note that, by definition of client-allocated context IDs, the chosen context ID
will always be a non-zero even number. We also add the restriction that the
chosen context ID <bcp14>MUST</bcp14> be strictly less than 10<sup>15</sup>. If the client has
run out of available context ID values that match this requirement for this
CONNECT-UDP request, it <bcp14>MUST NOT</bcp14> use the ECN extension with this CONNECT-UDP
request.</t>
    </section>
    <section anchor="header">
      <name>ECN Header Definition</name>
      <t>The "ECN" header field is an Item Structured Field, see <xref section="3.3" sectionFormat="of" target="STRUCT-FIELD"/>; its value <bcp14>MUST</bcp14> be a Integer; any other value type <bcp14>MUST</bcp14>
be handled as if the field were not present by recipients (for example, if this
field is included multiple times, its type will become a List and the field will
therefore be ignored). This document does not define any parameters for the
"ECN" header field value, but future documents might define parameters.
Receivers <bcp14>MUST</bcp14> ignore unknown parameters.</t>
      <t>When present, the "ECN" header indicates that the sender supports this
extension, and communicates the chosen context ID as the "ECN" field value.</t>
      <t>For example, if the client chosen context ID is 42, it would send the following:</t>
      <figure anchor="example-header-client">
        <name>Example Client ECN Field</name>
        <artwork><![CDATA[
ECN: 42; foo=bar
]]></artwork>
      </figure>
      <t>Clients <bcp14>MUST NOT</bcp14> indicate support for this extension unless they know that the
protocol running over UDP that is being proxied supports ECN, and will react
appropriately to Congestion Experienced (CE) markings.</t>
      <t>Proxies <bcp14>MUST NOT</bcp14> indicate support for this extension unless they know they
have the ability to read and write the IP ECN bits on its target-bound UDP
sockets.</t>
      <t>This extension is said to have been negotiated when both client and proxy
indicated support for it in their CONNECT-UDP request and response. When
indicating support for this extension, the proxy send the client's chosen
context ID as the "ECN" field value.</t>
      <t>For example, the proxy could reply with:</t>
      <figure anchor="example-header-proxy">
        <name>Example Proxy ECN Field</name>
        <artwork><![CDATA[
ECN: 42
]]></artwork>
      </figure>
    </section>
    <section anchor="encoding-of-ecn-bits">
      <name>Encoding of ECN bits</name>
      <t>When an HTTP Datagram <xref target="HTTP-DGRAM"/> associated
with a CONNECT-UDP stream uses the chosen context ID as its context ID, its
"Payload" field contains the following format (using the notation from the
"Notational Conventions" section of <xref target="QUIC"/>):</t>
      <figure anchor="payload-format">
        <name>CONNECT-UDP Payload with ECN</name>
        <artwork><![CDATA[
CONNECT-UDP Payload with ECN {
  Must be Zero (6),
  ECN Bits (2),
  UDP Payload (..),
}
]]></artwork>
      </figure>
      <dl>
        <dt>Must be Zero:</dt>
        <dd>
          <t>6 bits that <bcp14>MUST</bcp14> be sent as zero. Receivers <bcp14>MUST</bcp14> validate that these bits are
zero and <bcp14>MUST</bcp14> silently drop the HTTP Datagram if they have any other value.
Extensions to this mechanism <bcp14>MAY</bcp14> relax this requirement.</t>
        </dd>
        <dt>ECN Bits:</dt>
        <dd>
          <t>The ECN bits, sent in the same order as they appear in the IP header.</t>
        </dd>
        <dt>UDP Payload:</dt>
        <dd>
          <t>The UDP Payload, as defined in the "HTTP Datagram Payload Format" section of
<xref target="CONNECT-UDP"/>.</t>
        </dd>
      </dl>
      <t>When the proxy receives a datagram with the chosen context ID, it sets the IP
packet's ECN bits accordingly on the UDP packet it sends to the target.
Similarly, in the other direction the ECN Bits field represents which ECN bits
were seen on the UDP packets received from the target.</t>
    </section>
    <section anchor="note">
      <name>A Note about Future Extensions</name>
      <t>This CONNECT-UDP extension uses an HTTP field to register its chosen context ID.
Future extensions to CONNECT-UDP can use the same strategy to register their
chosen context ID(s) via another HTTP field. This strategy is best for
CONNECT-UDP extensions that only need to register context IDs during the HTTP
request and response.</t>
      <t>Some extensions may need to register context IDs after the request and response
have been exchanged, for example an extension that wishes to compress QUIC
connection IDs <xref target="QUIC"/> is not aware of all connection IDs at request time. In
such cases, extensions can use new Capsule Types (see <xref target="HTTP-DGRAM"/>) to perform
context ID registration.</t>
    </section>
    <section anchor="security">
      <name>Security Considerations</name>
      <t>This document does not have additional security considerations beyond those
defined in <xref target="CONNECT-UDP"/>.</t>
    </section>
    <section anchor="iana">
      <name>IANA Considerations</name>
      <t>This document will request IANA to register the following entry in the "HTTP
Field Name" registry:</t>
      <dl>
        <dt>Field Name:</dt>
        <dd>
          <t>ECN</t>
        </dd>
        <dt>Template:</dt>
        <dd>
          <t>None</t>
        </dd>
        <dt>Status:</dt>
        <dd>
          <t>provisional (permanent if this document is approved)</t>
        </dd>
        <dt>Reference:</dt>
        <dd>
          <t>This document</t>
        </dd>
        <dt>Comments:</dt>
        <dd>
          <t>None</t>
        </dd>
      </dl>
    </section>
  </middle>
  <back>
    <references>
      <name>Normative References</name>
      <reference anchor="CONNECT-UDP">
        <front>
          <title>UDP Proxying Support for HTTP</title>
          <author fullname="David Schinazi">
            <organization>Google LLC</organization>
          </author>
          <date day="21" month="March" year="2022"/>
          <abstract>
            <t>   This document describes how to proxy UDP over HTTP.  Similar to how
   the CONNECT method allows proxying TCP over HTTP, this document
   defines a new mechanism to proxy UDP.  It is built using HTTP
   Extended CONNECT.

            </t>
          </abstract>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-masque-connect-udp-08"/>
      </reference>
      <reference anchor="ECN">
        <front>
          <title>The Addition of Explicit Congestion Notification (ECN) to IP</title>
          <author fullname="K. Ramakrishnan" initials="K." surname="Ramakrishnan">
            <organization/>
          </author>
          <author fullname="S. Floyd" initials="S." surname="Floyd">
            <organization/>
          </author>
          <author fullname="D. Black" initials="D." surname="Black">
            <organization/>
          </author>
          <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="RFC2119">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author fullname="S. Bradner" initials="S." surname="Bradner">
            <organization/>
          </author>
          <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">
            <organization/>
          </author>
          <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="STRUCT-FIELD">
        <front>
          <title>Structured Field Values for HTTP</title>
          <author fullname="M. Nottingham" initials="M." surname="Nottingham">
            <organization/>
          </author>
          <author fullname="P-H. Kamp" initials="P-H." surname="Kamp">
            <organization/>
          </author>
          <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="HTTP-DGRAM">
        <front>
          <title>HTTP Datagrams and the Capsule Protocol</title>
          <author fullname="David Schinazi">
            <organization>Google LLC</organization>
          </author>
          <author fullname="Lucas Pardue">
            <organization>Cloudflare</organization>
          </author>
          <date day="28" month="March" year="2022"/>
          <abstract>
            <t>   This document describes HTTP Datagrams, a convention for conveying
   multiplexed, potentially unreliable datagrams inside an HTTP
   connection.

   In HTTP/3, HTTP Datagrams can be conveyed natively using the QUIC
   DATAGRAM extension.  When the QUIC DATAGRAM frame is unavailable or
   undesirable, they can be sent using the Capsule Protocol, a more
   general convention for conveying data in HTTP connections.

   Both are intended for use by HTTP extensions, not applications.

            </t>
          </abstract>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-masque-h3-datagram-08"/>
      </reference>
      <reference anchor="QUIC">
        <front>
          <title>QUIC: A UDP-Based Multiplexed and Secure Transport</title>
          <author fullname="J. Iyengar" initials="J." role="editor" surname="Iyengar">
            <organization/>
          </author>
          <author fullname="M. Thomson" initials="M." role="editor" surname="Thomson">
            <organization/>
          </author>
          <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>
    <section numbered="false" anchor="acks">
      <name>Acknowledgments</name>
      <t>This proposal was inspired directly or indirectly by prior work from many
people. The author would like to thank contributors the MASQUE working group.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