<?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" docName="draft-ietf-avtcore-rfc7983bis-09" category="std" updates="7983, 5764" 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="Internet-Draft" value="draft-ietf-avtcore-rfc7983bis-09"/>
    <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="April"/>
    <area>art</area>
    <workgroup>avtcore</workgroup>
    <!-- [rfced] Please insert any keywords (beyond those that appear in the title) for use on https://www.rfc-editor.org/search. -->

<keyword>example</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. Peer-to-peer QUIC in WebRTC scenarios, described in
   <xref target="P2P-QUIC" format="default"/> <xref target="P2P-QUIC-TRIAL" format="default"/>, transports audio and video over SRTP,
   alongside QUIC, used for data exchange.  For this use case, SRTP
   <xref target="RFC3711" format="default"/> is keyed using DTLS-SRTP <xref target="RFC5764" format="default"/> and 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="I-D.ietf-quic-v2" 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 MUST NOT send the grease_quic_bit
   transport parameter.</t>
      <section anchor="sect-1.1" numbered="true" toc="default">
        <name>Terminology</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" format="default"/> <xref target="RFC8174" format="default"/> 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 Section 3.5 of <xref target="RFC8656" format="default"/>).  <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 does 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 Section 7 of <xref target="RFC7983" format="default"/> (which in
   turn updates <xref target="RFC5764" format="default"/>) as follows:</t>
      <t>
   OLD TEXT</t>
      <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 MUST be dropped and an alert
   MAY be logged.  This process is summarized in Figure 3.</t>
      <figure anchor="fig-1">
        <name>The DTLS-SRTP receiver's packet demultiplexing algorithm.</name>
        <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
                 +----------------+
]]></artwork>
      </figure>
      <t>END OLD TEXT</t>
      <t>NEW TEXT </t>
      <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 is 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 MUST
   be dropped and an alert MAY be logged. This process is summarized
   in Figure 3.</t>
      <figure anchor="fig-2">
        <name>The receiver's packet demultiplexing algorithm.</name>
        <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
                +----------------+
]]></artwork>
      </figure>
      <t>Note: Endpoints that wish to demultiplex QUIC MUST NOT send the
   grease_quic_bit transport parameter, described in [RFC9287].</t>
      <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 mis-implemented, the logic could
   potentially mis-classify 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 nor 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 will replace references to RFC
   7983 with references to this document.</t>
    </section>
  </middle>
  <back>
    <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>
        <xi:include href="https://datatracker.ietf.org/doc/bibxml3/draft-ietf-avtcore-rtp-over-quic.xml"/>
        <xi:include href="https://datatracker.ietf.org/doc/bibxml3/draft-ietf-quic-v2.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6189.xml"/>
        <reference anchor="P2P-QUIC" target="https://github.com/w3c/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 month="May" year="2021"/>
          </front>
          <seriesInfo name="W3C" value="ORTC Community Group Draft (work in progress)"/>
        </reference>
        <reference anchor="P2P-QUIC-TRIAL" target="https://developers.google.com/web/updates/2019/01/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 Martin Thomson, Roni Even, 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>
