<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" submissionType="IETF" category="std" consensus="true" docName="draft-ietf-avtcore-rfc7983bis-09" number="9443" updates="5764, 7983" ipr="trust200902" obsoletes="" xml:lang="en" symRefs="true" sortRefs="true" tocInclude="true" version="3">

  <!-- xml2rfc v2v3 conversion 3.17.0 -->
  <!-- Generated by id2xml 1.5.0 on 2023-04-04T22:59:18Z -->
	<front>
    <title>Multiplexing Scheme Updates for QUIC</title>
    <seriesInfo name="RFC" value="9443"/>
    <author initials="B." surname="Aboba" fullname="Bernard Aboba">
      <organization>Microsoft Corporation</organization>
      <address>
        <postal>
          <street>One Microsoft Way</street>
          <city>Redmond</city>
          <region>WA</region>
          <code>98052</code>
          <country>United States of America</country>
        </postal>
        <email>bernard.aboba@gmail.com</email>
      </address>
    </author>
    <author initials="G." surname="Salgueiro" fullname="Gonzalo Salgueiro">
      <organization>Cisco Systems</organization>
      <address>
        <postal>
          <street>7200-12 Kit Creek Road</street>
          <city>Research Triangle Park</city>
          <region>NC</region>
          <code>27709</code>
          <country>United States of America</country>
        </postal>
        <email>gsalguei@cisco.com</email>
      </address>
    </author>
    <author initials="C." surname="Perkins" fullname="Colin Perkins">
      <organization abbrev="University of Glasgow">School of Computing Science</organization>
      <address>
        <postal>
          <street>University of Glasgow</street>
          <city>Glasgow</city>
          <code>G12 8QQ</code>
          <country>United Kingdom</country>
        </postal>
        <email>csp@csperkins.org</email>
      </address>
    </author>
    <date year="2023" month="July"/>
    <area>art</area>
    <workgroup>avtcore</workgroup>

<keyword>RTP</keyword>
<keyword>ZRTP</keyword>
<keyword>STUN</keyword>
<keyword>TURN</keyword>
<keyword>DTLS</keyword>

    <abstract>
      <t>
   RFC 7983 defines a scheme for a Real-time Transport Protocol (RTP)
   receiver to demultiplex Datagram Transport Layer Security (DTLS),
   Session Traversal Utilities for NAT (STUN), Secure Real-time
   Transport Protocol (SRTP) / Secure Real-time Transport Control
   Protocol (SRTCP), ZRTP, and Traversal Using Relays around NAT (TURN)
   channel packets arriving on a single port.  This document updates RFC
   7983 and RFC 5764 to also allow QUIC packets to be multiplexed on a
   single receiving socket.</t>
    </abstract>
  </front>
  <middle>
    <section anchor="sect-1" numbered="true" toc="default">
      <name>Introduction</name>
      <t>
   "Multiplexing Scheme Updates for Secure Real-time Transport Protocol (SRTP) Extension for Datagram Transport Layer Security (DTLS)"
   <xref target="RFC7983" format="default"/> defines a scheme for a Real-time Transport Protocol (RTP)
   <xref target="RFC3550" format="default"/> receiver to demultiplex DTLS <xref target="RFC9147" format="default"/>, Session Traversal
   Utilities for NAT (STUN) <xref target="RFC8489" format="default"/>, Secure Real-time Transport
   Protocol (SRTP) / Secure Real-time Transport Control Protocol (SRTCP)
   <xref target="RFC3711" format="default"/>, ZRTP <xref target="RFC6189" format="default"/>, and Traversal Using Relays around NAT
   (TURN) channel packets arriving on a single port. This document
   updates <xref target="RFC7983" format="default"/> and "Datagram Transport Layer Security (DTLS) Extension to Establish Keys for the Secure Real-time Transport Protocol (SRTP)" <xref target="RFC5764" format="default"/> to also allow QUIC <xref target="RFC9000" format="default"/> to be
   multiplexed on the same port.</t>

      <t>
   The multiplexing scheme described in this document supports multiple
   use cases. In the WebRTC scenarios described in <xref target="P2P-QUIC" format="default"/> and <xref target="P2P-QUIC-TRIAL" format="default"/>, SRTP transports audio and video while peer-to-peer QUIC is used for data exchange.
For this use case, SRTP
   <xref target="RFC3711" format="default"/> is keyed using DTLS-SRTP <xref target="RFC5764" format="default"/>; therefore, SRTP/SRTCP
   <xref target="RFC3550" format="default"/>, STUN, TURN, DTLS, and QUIC need to be multiplexed on the
   same port.  Were SRTP to be keyed using QUIC-SRTP (not yet
   specified), SRTP/SRTCP, STUN, TURN, and QUIC would need to be
   multiplexed on the same port. Where QUIC is used for peer-to-peer
   transport of data as well as RTP/RTCP <xref target="I-D.ietf-avtcore-rtp-over-quic" format="default"/>,
   STUN, TURN, and QUIC need to be multiplexed on the same port.</t>
      <t>
   While the scheme described in this document is compatible with QUIC
   version 2 <xref target="RFC9369" format="default"/>, it is not compatible with QUIC bit
   greasing <xref target="RFC9287" format="default"/>.  As a result, endpoints that wish to use
   multiplexing on their socket <bcp14>MUST NOT</bcp14> send the grease_quic_bit
   transport parameter.</t>
      <section anchor="sect-1.1" numbered="true" toc="default">
        <name>Terminology</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&nbsp;14 <xref target="RFC2119"/> <xref
    target="RFC8174"/> when, and only when, they appear in all capitals, as
    shown here.
        </t>
      </section>
    </section>
    <section anchor="sect-2" numbered="true" toc="default">
      <name>Multiplexing of TURN Channels</name>
      <t>
   TURN channels are an optimization where data packets are exchanged
   with a 4-byte prefix instead of the standard 36-byte STUN overhead
   (see <xref target="RFC8656" sectionFormat="of" section="3.5"/>).  <xref target="RFC7983" format="default"/> allocates the values from
   64 to 79 in order to allow TURN channels to be demultiplexed when the
   TURN client does the channel binding request in combination with the
   demultiplexing scheme described in <xref target="RFC7983" format="default"/>.</t>
      <t>
   In the absence of QUIC bit greasing, the first octet of a QUIC packet
   (e.g. a short header packet in QUIC v1 or v2) may fall in the range
   64 to 127, thereby overlapping with the allocated range for TURN
   channels of 64 to 79.  However, in practice this overlap does not
   represent a problem.  TURN channel packets will only be received from
   a TURN server to which TURN allocation and channel-binding requests
   have been sent.  Therefore, a TURN client receiving packets from the
   source IP address and port of a TURN server only needs to
   disambiguate STUN (i.e., regular TURN) packets from TURN channel
   packets; (S)RTP, (S)RTCP, ZRTP, DTLS, or QUIC packets will not be sent
   from a source IP address and port that had previously responded to
   TURN allocation or channel-binding requests.</t>
      <t>
   As a result, if the source IP address and port of a packet do not
   match that of a responding TURN server, a packet with a first octet
   of 64 to 127 can be unambiguously demultiplexed as QUIC.</t>
    </section>
    <section anchor="sect-3" numbered="true" toc="default">
      <name>Updates to RFC 7983</name>
      <t>
   This document updates the text in <xref target="RFC7983" sectionFormat="of" section="7"/> (which in
   turn updates <xref target="RFC5764" format="default"/>) as follows:</t>
      <t>
   OLD TEXT</t>
      <blockquote>
	<t>
   The process for demultiplexing a packet is as follows.  The receiver
   looks at the first byte of the packet.  If the value of this byte is
   in between 0 and 3 (inclusive), then the packet is STUN.  If the
   value is between 16 and 19 (inclusive), then the packet is ZRTP.  If
   the value is between 20 and 63 (inclusive), then the packet is DTLS.
   If the value is between 64 and 79 (inclusive), then the packet is
   TURN Channel.  If the value is in between 128 and 191 (inclusive),
   then the packet is RTP (or RTCP, if both RTCP and RTP are being
   multiplexed over the same destination port).  If the value does not
   match any known range, then the packet <bcp14>MUST</bcp14> be dropped 
   and an alert <bcp14>MAY</bcp14> be logged.  This process is summarized 
   in Figure 3.</t>
        <artwork name="" type="" align="left" alt=""><![CDATA[
                 +----------------+
                 |        [0..3] -+--> forward to STUN
                 |                |
                 |      [16..19] -+--> forward to ZRTP
                 |                |
     packet -->  |      [20..63] -+--> forward to DTLS
                 |                |
                 |      [64..79] -+--> forward to TURN Channel
                 |                |
                 |    [128..191] -+--> forward to RTP/RTCP
                 +----------------+

Figure 3: The DTLS-SRTP receiver's packet demultiplexing algorithm.

]]></artwork>
      </blockquote>
      <t>END OLD TEXT</t>
      <t>NEW TEXT </t>
<blockquote>
      <t>
   The process for demultiplexing a packet is as follows.  The receiver
   looks at the first byte of the packet.  If the value of this byte is
   between 0 and 3 (inclusive), then the packet is STUN.  If the value
   is between 16 and 19 (inclusive), then the packet is ZRTP.  If the
   value is between 20 and 63 (inclusive), then the packet is DTLS. If
   the value is between 128 and 191 (inclusive), then the packet is RTP
   (or RTCP, if both RTCP and RTP are being multiplexed over the same
   destination port).  If the value is between 80 and 127 (inclusive)
   or between 192 and 255 (inclusive), then the packet is QUIC. If the
   value is between 64 and 79 (inclusive) and the packet has a source
   IP address and port of a responding TURN server, then the packet
   is TURN channel; if the source IP address and port are not that of
   a responding TURN server, then the packet is QUIC.</t>
      <t>
   If the value does not match any known range, then the packet <bcp14>MUST</bcp14>
   be dropped and an alert <bcp14>MAY</bcp14> be logged. This process is summarized
   in Figure 3.</t>
        <artwork name="" type="" align="left" alt=""><![CDATA[
                +----------------+
                |        [0..3] -+--> forward to STUN
                |                |
                |       [4..15] -+--> DROP
                |                |
                |      [16..19] -+--> forward to ZRTP
                |                |
    packet -->  |      [20..63] -+--> forward to DTLS
                |                |
                |      [64..79] -+--> forward to TURN Channel
                |                | (if from TURN server), else QUIC
                |     [80..127] -+--> forward to QUIC
                |                |
                |    [128..191] -+--> forward to RTP/RTCP
                |                |
                |    [192..255] -+--> forward to QUIC
                +----------------+

     Figure 3: The receiver's packet demultiplexing algorithm.
]]></artwork>
      <t>Note: Endpoints that wish to demultiplex QUIC <bcp14>MUST NOT</bcp14> send the
   grease_quic_bit transport parameter, as described in <xref target="RFC9287"/>.</t>
</blockquote>
      <t>END NEW TEXT</t>
    </section>
    <section anchor="sect-4" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>
   The solution discussed in this document could potentially introduce
   some additional security issues beyond those described in <xref target="RFC7983" format="default"/>.
   These additional concerns are described below.</t>
      <t>
   In order to support multiplexing of QUIC, this document adds logic to
   the scheme defined in <xref target="RFC7983" format="default"/>. If misimplemented, the logic could
   potentially misclassify packets, exposing protocol handlers to
   unexpected input.</t>
      <t>
   When QUIC is used solely for data exchange, the TLS-within-QUIC
   exchange <xref target="RFC9001" format="default"/> derives keys used solely to protect QUIC data
   packets.  If properly implemented, this should not affect the
   transport of SRTP or the derivation of SRTP keys via DTLS-SRTP.
   However, if a future specification were to define use of the TLS-
   within-QUIC exchange to derive SRTP keys, both transport and SRTP key
   derivation could be adversely impacted by a vulnerability in the QUIC
   implementation.</t>
    </section>
    <section anchor="sect-5" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <t>
   In the "TLS ContentType" registry, IANA replaced references to <xref target="RFC7983"/> with references to this document.</t>
    </section>
  </middle>
  <back>

<displayreference target="I-D.ietf-avtcore-rtp-over-quic" to="RTP-OVER-QUIC"/>

    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3550.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3711.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5764.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7983.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8489.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8656.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9000.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9001.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9147.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9287.xml"/>
      </references>
      <references>
        <name>Informative References</name>

<!-- [I-D.ietf-avtcore-rtp-over-quic] IESG state I-D Exists -->
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-avtcore-rtp-over-quic.xml"/>


<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9369.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6189.xml"/>


        <reference anchor="P2P-QUIC" target="https://www.w3.org/p2p-webtransport/">
          <front>
            <title>QUIC API For Peer-to-Peer Connections</title>
            <author initials="P." surname="Thatcher" fullname="P. Thatcher">
	</author>
            <author initials="B." surname="Aboba" fullname="B. Aboba">
	</author>
            <author initials="R." surname="Raymond" fullname="R. Raymond">
	</author>
            <date day="20" month="May" year="2023" />
          </front>
<refcontent>W3C Community Group Draft Report</refcontent>
<refcontent>commit 50d79c0</refcontent>
        </reference>

        <reference anchor="P2P-QUIC-TRIAL" target="https://developer.chrome.com/blog/rtcquictransport-api/">
          <front>
            <title>RTCQuicTransport Coming to an Origin Trial Near You (Chrome 73)</title>
            <author initials="S." surname="Hampson" fullname="S. Hampson">
	</author>
            <date month="January" year="2019"/>
          </front>
        </reference>
      </references>
    </references>
    <section numbered="false" anchor="acknowledgments" toc="default">
      <name>Acknowledgments</name>
      <t>
   We would like to thank <contact fullname="Martin Thomson"/>, <contact fullname="Roni Even"/>, <contact fullname="Jonathan Lennox"/>, and
   other participants in the IETF QUIC and AVTCORE Working Groups for
   their discussion of the QUIC multiplexing issue, and their input
   relating to potential solutions.</t>
    </section>
  </back>
</rfc>
