<?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.6.37 (Ruby 3.0.2) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-thatcher-p2p-quic-00" category="std" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.17.4 -->
  <front>
    <title>P2P QUIC</title>
    <seriesInfo name="Internet-Draft" value="draft-thatcher-p2p-quic-00"/>
    <author initials="P." surname="Thatcher" fullname="Peter Thatcher">
      <organization>Microsoft</organization>
      <address>
        <email>pthatcher@microsoft.com</email>
      </address>
    </author>
    <date/>
    <area>Applications and Real-Time</area>
    <workgroup>Audio/Video Transport Core Maintenance</workgroup>
    <keyword>Internet-Draft</keyword>
    <abstract>
      <?line 23?>

<t>This document describes how to combine ICE and QUIC to do p2p QUIC.</t>
    </abstract>
  </front>
  <middle>
    <?line 27?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>ICE <xref target="RFC8445"/> is a protocol for establishing peer-to-peer (p2p) connections.
It can be combined with client-server protocols such as DTLS <xref target="RFC9147"/> for p2p versions of those protocols.
This document describes how to use ICE with QUIC <xref target="RFC9000"/> for p2p QUIC connections.</t>
    </section>
    <section anchor="terminology-and-notation">
      <name>Terminology and Notation</name>
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
"SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" 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 anchor="alpn">
      <name>ALPN</name>
      <t>The QUIC ALPN MUST be "q2q".</t>
    </section>
    <section anchor="demultiplexing-ice-and-quic">
      <name>(De)multiplexing ICE and QUIC</name>
      <t>QUIC packets MUST be sent using the ICE selected candidate pair.</t>
      <t>ICE and QUIC packets are demultiplexed using the STUN magic cookie.  If a packet contains a STUN magic cookied, it MUST treated as an ICE packet.
If it does not contain a STUN magic cookie, it SHOULD be treated as a QUIC packet (but further demultiplexing between QUIC and other protocols is possible).</t>
    </section>
    <section anchor="signaling">
      <name>Signaling</name>
      <t>In addition to all signaling necessary for ICE (ICE parameters and candidates), the following information MUST be signaled or otherwise negotiated between the peers:
- Which side will take on the active (client) or passive (server) role.
- Certificate fingerprint(s)
- Whether or not to enable the grease bit
- Whether or not to the MuliplexingID is used</t>
    </section>
    <section anchor="certificate-verification">
      <name>Certificate verification</name>
      <t>Peers MAY use self-signed certificates.  Each peer MUST verify the certificate, meaning a QUIC implementation MUST support a server verifying a client certificate.</t>
    </section>
    <section anchor="grease-bit">
      <name>Grease bit</name>
      <t>Peers SHOULD enable and use the grease bit if only multiplexing ICE and QUIC.
When multiplexing other protocols that conflict with the grease bit, peers SHOULD NOT use the grease bit.</t>
    </section>
    <section anchor="multipath">
      <name>Multipath</name>
      <t>QUIC multipath SHOULD NOT be used unless it is known that one of the peers is a server.</t>
    </section>
    <section anchor="quic-datagrams">
      <name>QUIC datagrams</name>
      <t>QUIC datagrams SHOULD be supported.</t>
    </section>
    <section anchor="congestion-control">
      <name>Congestion control</name>
      <t>A real-time congestion control algorithm SHOULD be used, which may require extensions to QUIC (such as additional timestamps in feedback messages) and additional signaling.</t>
    </section>
    <section anchor="quic-pings">
      <name>QUIC Pings</name>
      <t>ACKed QUIC PING frames MAY be treated the same as a succesful ICE check, such that a peer may choose to send QUIC PING frames instead of ICE checks once an ICE candidate pair
has had at least one successful ICE check.</t>
    </section>
    <section anchor="network-migration">
      <name>Network Migration</name>
      <t>Network migration SHOULD be done using ICE, not QUIC.  But ICE migrates between candidate pairs, QUIC should change behavior (such as congestion control) as if
it had done a network migration, but it SHOULD NOT change the connection ID due to ICE migration.</t>
    </section>
    <section anchor="multiplexingid">
      <name>MultiplexingID</name>
      <t>Because it is often difficult to obtain an ICE connection, it is often advantageous to multiplex many uses over a single ICE connection.
For example, one may wish to send control data, real-time audio and video, and real-time data altogether over the same ICE connection.
If all of these uses are done using QUIC, there must be a way to distinguish multiple uses of QUIC within the same QUIC connection,
both for streams and for datagrams.</t>
      <t>The MultiplexingID is an optional, variable-length integer at the beginning of every QUIC datagram and stream.  If it is negotiated to be used,
it MUST be included on every datagram and stream.  If it is not negotiated to be used, it MUST NOT be included on any datagram or stream.</t>
      <t>The variable-length encoding is the same as used by QUIC, as defined in section 16.</t>
    </section>
    <section anchor="sdp">
      <name>SDP</name>
      <t>If SDP is used for signaling, the media type may be "audio", "video", or "application".
The transport protocol MUST begin with "UDP/QUIC".
The transport protocol suffix combined with the media format may be any values which describe the protocol used on top of QUIC, either defined by other specifications or by applications.  The media format MAY be the value "generic".
The ICE parameters and candidates are signaled as defined by ICE ("a=ice-ufrag", "a=ice-pwd", "a=ice-options", "a=candidate").
The QUIC role and fingerprints are signaled using the same attributes as DTLS ("a=setup", and "a=fingerprint").
QUIC options are negotiated the same as ICE options but with an "a=quic-options" field.
The grease bit defaults to off unless a QUIC option of "grease" is included.
The MultiplexingID is signaled using an "a=mid" line, and the value MUST be a base-10 integer.  If any "a=mid" is specified in any QUIC m-section in a BUNDLE group, then all QUIC m-sections in the same BUNDLE group MUST have an "a=mid" specified.</t>
      <t>For example:</t>
      <artwork><![CDATA[
v=0
o=- 4962303333179871722 1 IN IP4 0.0.0.0
s=-
t=0 0
a=ice-ufrag:7sFv
a=ice-pwd:dOTZKZNVlO9RSGsEGM63JXT2
a=ice-options:trickle
a=quic-options:grease
a=fingerprint:sha-256
   7B:8B:F0:65:5F:78:E2:51:3B:AC:6F:F3:3F:46:1B:35:
   DC:B8:5F:64:1A:24:C2:43:F0:A1:58:D0:A1:2C:19:08
a=setup:active
a=group:BUNDLE 1 2 3
m=audio 9 UDP/QUIC/RTP/AVPF 99
a=mid:1
a=sendrecv
a=rtpmap:99 OPUS/4800/2
m=video 9 UDP/QUIC/RTP/AVPF 100
a=mid:2
a=sendrecv
a=rtpmap:100 VP8/90000
a=rtcp-fb:100 ccm fir
m=application 9 UDP/QUIC generic
a=mid:3
]]></artwork>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>This document is subject to the security considerations of ICE and QUIC.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>The ALPN "q2q" should be registered.</t>
    </section>
  </middle>
  <back>
    <references>
      <name>Normative References</name>
      <reference anchor="RFC8445">
        <front>
          <title>Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal</title>
          <author fullname="A. Keranen" initials="A." surname="Keranen"/>
          <author fullname="C. Holmberg" initials="C." surname="Holmberg"/>
          <author fullname="J. Rosenberg" initials="J." surname="Rosenberg"/>
          <date month="July" year="2018"/>
          <abstract>
            <t>This document describes a protocol for Network Address Translator (NAT) traversal for UDP-based communication. This protocol is called Interactive Connectivity Establishment (ICE). ICE makes use of the Session Traversal Utilities for NAT (STUN) protocol and its extension, Traversal Using Relay NAT (TURN).</t>
            <t>This document obsoletes RFC 5245.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="8445"/>
        <seriesInfo name="DOI" value="10.17487/RFC8445"/>
      </reference>
      <reference anchor="RFC9147">
        <front>
          <title>The Datagram Transport Layer Security (DTLS) Protocol Version 1.3</title>
          <author fullname="E. Rescorla" initials="E." surname="Rescorla"/>
          <author fullname="H. Tschofenig" initials="H." surname="Tschofenig"/>
          <author fullname="N. Modadugu" initials="N." surname="Modadugu"/>
          <date month="April" year="2022"/>
          <abstract>
            <t>This document specifies version 1.3 of the Datagram Transport Layer Security (DTLS) protocol. DTLS 1.3 allows client/server applications to communicate over the Internet in a way that is designed to prevent eavesdropping, tampering, and message forgery.</t>
            <t>The DTLS 1.3 protocol is based on the Transport Layer Security (TLS) 1.3 protocol and provides equivalent security guarantees with the exception of order protection / non-replayability. Datagram semantics of the underlying transport are preserved by the DTLS protocol.</t>
            <t>This document obsoletes RFC 6347.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="9147"/>
        <seriesInfo name="DOI" value="10.17487/RFC9147"/>
      </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="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>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA4VY23LjuBF9x1cgyotdJcqSfGeVqyJL9qx3bVmx5UmyqVQK
IiEJMW9DkPYoUzPfntMNkqK03qz9IF6Avp4+3aDneaIwRaR92ZkNZ/KvL3fj
jgjTIFExnoW5WhZesVZFsNa5lw0z70tpAq/fF4Eq9CrNN760RShC3Pny22Q0
v/kuhMlyXxZ5aYthv3/ZHwqVawUNoyyLDDaaNLFSJaF80iry5ibWHfGe5q+r
PC0zWleGJj36bEKdynmuEpuleSHHaa7lgzJJoROVBNjzqjfYFvryDs/yRBfe
hAwWwhaQ/m8VpQms2mgrMuPLfxZp0JUWonK9tLjaxHTxL2HLRWyshVXFJsOG
u5v5rRCqLNZp7gvpCYk/k1hfznpyXgWDH7oozTS0775I85VKzH/ZVV8+mCBP
bQrL6J2OlYl8mdVh/Utcv+4FaSyE53lSLWyRqwCuzNfGSiSkjHVSyFDbIDcL
beU6fZdFKrFjYRIt78Y3HFFKID0PU4ls8W3PiYxNGEZaiD9TtPI0LAMyTgja
+e3bn55uxxcnJ6ffv0voUzLLU4QrjeQyzaVGPBeRsWuTrGSmgYQi9ehXHkDJ
IYxIEs3ibE/cFTJQiVzo2rZQvptiLYPIwAPP6vwNG2v5VtoyWEtl5WR+/1wZ
cjk4OYchpJqcwHrLkEmXEjmxeru790fxKa2LDZvAwalU9Pv9lgp+s+MG4jTX
eWySNEpXG47tNC2Ui9l8rSXAJwl9VnYeXp7nna77ldNHvn66gcynmwldP/80
ur9vLuoVzz89vtzjvaiutjvHjw8PN9OJ24yncu/Rw+gf+CGTOo+z+d3jdHTf
AUARHGNFEwsUHUUAiaCSybMcMA0p0nWQQtpzPZ7JwUkVleFgcImoVHAYnJ98
/y7e1zpxytIkgst8W6zhvcoyrXISoqIISc9MoSIUFlRYh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