<?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.18 (Ruby 3.3.3) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-seemann-quic-address-discovery-03" category="std" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.22.0 -->
  <front>
    <title abbrev="QUIC Address Discovery">QUIC Address Discovery</title>
    <seriesInfo name="Internet-Draft" value="draft-seemann-quic-address-discovery-03"/>
    <author fullname="Marten Seemann">
      <organization/>
      <address>
        <email>martenseemann@gmail.com</email>
      </address>
    </author>
    <date year="2024" month="August" day="20"/>
    <area>Transport</area>
    <workgroup>QUIC</workgroup>
    <keyword>QUIC</keyword>
    <keyword>STUN</keyword>
    <keyword>Address Discovery</keyword>
    <abstract>
      <?line 39?>

<t>Unless they have out-of-band knowledge, QUIC endpoints have no information about
their network situation. They neither know their external IP address and port,
nor do they know if they are directly connected to the internet or if they are
behind a NAT. This QUIC extension allows nodes to determine their public IP
address and port for any QUIC path.</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-quic-address-discovery/draft-seemann-quic-address-discovery.html"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-seemann-quic-address-discovery/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        QUIC Working Group mailing list (<eref target="mailto:quic@ietf.org"/>),
        which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/quic/"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/quic/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/marten-seemann/draft-seemann-quic-address-discovery"/>.</t>
    </note>
  </front>
  <middle>
    <?line 48?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>STUN (<xref target="RFC8489"/>) allows nodes to discover their reflexive transport address
by asking a remote server to report the observed source address. While the QUIC
(<xref target="RFC9000"/>) packet header was designed to allow demultiplexing from STUN
packets, moving address discovery into the QUIC layer has a number of
advantages:</t>
      <ol spacing="normal" type="1"><li>
          <t>STUN traffic is unencrypted, and can be observed and modified by on-path
observers. By moving address discovery into QUIC's encrypted envelope it
becomes invisible to observers.</t>
        </li>
        <li>
          <t>When located behind a load balancer, QUIC packets may be routed based on the
QUIC connection ID. Depending on the architecture, not using STUN might
simplify the routing logic.</t>
        </li>
        <li>
          <t>If QUIC traffic doesn't need to be demultiplexed from STUN traffic,
implementations can enable QUIC bit greasing (<xref target="RFC9287"/>).</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="negotiate-extension">
      <name>Negotiating Extension Use</name>
      <t>Endpoints advertise their support of the extension by sending the
address_discovery (0x9f81a175) transport parameter (<xref section="7.4" sectionFormat="of" target="RFC9000"/>)
with a variable-length integer value. The value determines the behavior with
respect to address discovery:</t>
      <ul spacing="normal">
        <li>
          <t>0: The node is willing to provide address observations to its peer, but is not
interested in receiving address observations itself.</t>
        </li>
        <li>
          <t>1: The node is interested in receiving address observations, but it is not
willing to provide address observations.</t>
        </li>
        <li>
          <t>2: The node is interested in receiving address observations, and it is willing
to provide address observations.</t>
        </li>
      </ul>
      <t>Implementations that understand this transport parameter <bcp14>MUST</bcp14> treat the receipt
of any other value than these as a connection error of type
TRANSPORT_PARAMETER_ERROR.</t>
      <t>When using 0-RTT, both endpoints <bcp14>MUST</bcp14> remember the value of this transport
parameter. This allows sending the frame defined by this extension in 0-RTT
packets. If 0-RTT data is accepted by the server, the server <bcp14>MUST NOT</bcp14> disable
this extension or change the value on the resumed connection.</t>
    </section>
    <section anchor="frames">
      <name>Frames</name>
      <t>This extension defines the OBSERVED_ADDRESS frame.</t>
      <section anchor="observedaddress">
        <name>OBSERVED_ADDRESS</name>
        <artwork><![CDATA[
OBSERVED_ADDRESS Frame {
    Type (i) = 0x9f81a4..0x9f81a5,
    [ IPv4 (32) ],
    [ IPv6 (128) ],
    Port (16),
}
]]></artwork>
        <t>The OBSERVED_ADDRESS frame contains the following fields:</t>
        <dl>
          <dt>IPv4:</dt>
          <dd>
            <t>The IPv4 address. Only present if the least significant bit of the frame type
is 0.</t>
          </dd>
          <dt>IPv6:</dt>
          <dd>
            <t>The IPv6 address. Only present if the least significant bit of the frame type
is 1.</t>
          </dd>
          <dt>Port:</dt>
          <dd>
            <t>The port number, in network byte order.</t>
          </dd>
        </dl>
        <t>This frame <bcp14>MUST</bcp14> only appear in the handshake and in the application data packet
number space. It is a "probing frame" as defined in <xref section="9.1" sectionFormat="of" target="RFC9000"/>.
OBSERVED_ADDRESS frames are ack-eliciting, and <bcp14>SHOULD</bcp14> be retransmitted if lost.
Retransmissions <bcp14>MUST</bcp14> happen on the same path as the original frame was sent on.</t>
        <t>An endpoint <bcp14>MUST NOT</bcp14> send an OBSERVED_ADDRESS frame to a node that did not
request the receipt of address observations as described in
<xref target="negotiate-extension"/>. A node that did not request the receipt of address
observations <bcp14>MUST</bcp14> close the connection with a PROTOCOL_VIOLATION error if it
receives an OBSERVED_ADDRESS frame.</t>
      </section>
    </section>
    <section anchor="address-discovery">
      <name>Address Discovery</name>
      <t>An endpoint that negotiated (see <xref target="negotiate-extension"/>) this extension and
offered to provide address observations to the peer <bcp14>MUST</bcp14> send an
OBSERVED_ADDRESS frame on every new path. This also applies to the path used for
the QUIC handshake.</t>
      <t>The OBSERVED_ADDRESS frame <bcp14>SHOULD</bcp14> be sent as early as possible. However, during
the handshake an endpoint <bcp14>SHOULD</bcp14> prioritize frames that lead to handshake
progress (CRYPTO and ACK frames in particular) over sending of the
OBSERVED_ADDRESS frame.</t>
      <t>For paths used after completion of the handshake, endpoints <bcp14>SHOULD</bcp14> bundle the
OBSERVED_ADDRESS frame with probing packets. This is possible, since the frame
is defined to be a probing frame (<xref section="8.2" sectionFormat="of" target="RFC9000"/>).</t>
      <t>Additionally, the sender <bcp14>SHOULD</bcp14> send an OBSERVED_ADDRESS frame when it detects a
change in the remote address on an existing path. This could be indicative of a
NAT rebindings.</t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <section anchor="on-the-requester-side">
        <name>On the Requester Side</name>
        <t>In general, nodes cannot be trusted to report the correct address in
OBSERVED_ADDRESS frames. If possible, endpoints might decide to only request
address observations when connecting to trusted peers, or if that is not
possible, define some validation logic (e.g. by asking multiple untrusted peers
and observing if the responses are consistent). This logic is out of scope for
this document.</t>
      </section>
      <section anchor="on-the-responder-side">
        <name>On the Responder Side</name>
        <t>Depending on the routing setup, a node might not be able to observe the peer's
reflexive transport address, and attempts to do so might reveal details about
the internal network. In these cases, the node <bcp14>SHOULD NOT</bcp14> offer to provide
address observations.</t>
      </section>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>TODO: fill out registration request for the transport parameter and frame types</t>
    </section>
  </middle>
  <back>
    <references anchor="sec-normative-references">
      <name>Normative References</name>
      <reference anchor="RFC8489">
        <front>
          <title>Session Traversal Utilities for NAT (STUN)</title>
          <author fullname="M. Petit-Huguenin" initials="M." surname="Petit-Huguenin"/>
          <author fullname="G. Salgueiro" initials="G." surname="Salgueiro"/>
          <author fullname="J. Rosenberg" initials="J." surname="Rosenberg"/>
          <author fullname="D. Wing" initials="D." surname="Wing"/>
          <author fullname="R. Mahy" initials="R." surname="Mahy"/>
          <author fullname="P. Matthews" initials="P." surname="Matthews"/>
          <date month="February" year="2020"/>
          <abstract>
            <t>Session Traversal Utilities for NAT (STUN) is a protocol that serves as a tool for other protocols in dealing with NAT traversal. It can be used by an endpoint to determine the IP address and port allocated to it by a NAT. It can also be used to check connectivity between two endpoints and as a keep-alive protocol to maintain NAT bindings. STUN works with many existing NATs and does not require any special behavior from them.</t>
            <t>STUN is not a NAT traversal solution by itself. Rather, it is a tool to be used in the context of a NAT traversal solution.</t>
            <t>This document obsoletes RFC 5389.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="8489"/>
        <seriesInfo name="DOI" value="10.17487/RFC8489"/>
      </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>
      <reference anchor="RFC9287">
        <front>
          <title>Greasing the QUIC Bit</title>
          <author fullname="M. Thomson" initials="M." surname="Thomson"/>
          <date month="August" year="2022"/>
          <abstract>
            <t>This document describes a method for negotiating the ability to send an arbitrary value for the second-most significant bit in QUIC packets.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="9287"/>
        <seriesInfo name="DOI" value="10.17487/RFC9287"/>
      </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>
    </references>
    <?line 196?>

<section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>TODO acknowledge.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA61Y7XLbNhb9j6fAKj9qdyTactzE0fRLsZ3Ws4nllZV2Op2O
ByIhCRMKYAhQjtaTPss+yz7ZnntBUpLtpNnZ/WOTEHG/7zkX6PV6IpiQ64Hs
/OPtxakcZlmpvZdnxqdupct1R6jptNSrz3yQqqDnrlwPpA+ZEJlLrVpCYlaq
Weh5rZfK2t77yqQ9FXf3smZ37/Cp8NV0abw3zoZ1gX0X55NXUj6RKvcOao3N
dKHxx4ZOV3Z0ZoIrjcrp5WL4Ev9ciafx5FVH2Go51eVAZDBpIFJnvba+8gMZ
ykoLOPFUqFIrSJ2UyvrClaEjb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