<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc strict="yes" ?>
<?rfc rfcedstyle="yes" ?>
<?rfc subcompact="no" ?>
<?rfc sortrefs="no" ?>
<?rfc colonspace='yes' ?>

<rfc number="4961" category="bcp" seriesNo="131">
  <front>
    <title abbrev="Symmetric RTP and RTCP">Symmetric RTP / RTP
    Control Protocol (RTCP)</title>

    <author fullname="Dan Wing" initials="D." surname="Wing">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street>170 West Tasman Drive</street>

          <city>San Jose</city>

          <region>CA</region>

          <code>95134</code>

          <country>USA</country>
        </postal>

        <email>dwing@cisco.com</email>
      </address>
    </author>

    <date month="July" year="2007" />

    <area>Transport</area>

    <workgroup>BEHAVE</workgroup>

<!-- [rfced] Please insert any additional keywords for
use on www.rfc-editor.org/search.html -->

    <keyword>NAT</keyword>
    <keyword>symmetric</keyword>
    <keyword>RTP</keyword>
    <keyword>RTCP</keyword>

    <abstract>
      <t>This document recommends using one UDP port pair for both
      communication directions of bidirectional RTP and RTP Control Protocol (RTCP) sessions,
      commonly called "symmetric RTP" and "symmetric RTCP".</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t><xref target="RFC0793">TCP</xref>, which is inherently bidirectional,
      transmits and receives data using the same local port. That is, when a
      TCP connection is established from host A with source TCP port "a" to a
      remote host, the remote host sends packets back to host A's source TCP
      port "a".</t>

      <t>However, UDP is not inherently bidirectional and UDP does not require
      using the same port for sending and receiving bidirectional traffic.
      Rather, some UDP applications use a single UDP port to transmit and
      receive (e.g., <xref target="RFC1035">DNS</xref>), some applications use
      different UDP ports to transmit and receive with explicit signaling
      (e.g., <xref target="RFC1350"> Trivial File Transfer Protocol (TFTP)</xref>), and other applications don't
      specify the choice of transmit and receive ports (<xref
      target="RFC3550">RTP</xref>).</t>

      <t>Because RTP and RTCP are not inherently bidirectional protocols, and
      UDP is not a bidirectional protocol, the usefulness of using the same
      UDP port for transmitting and receiving has been generally ignored for
      RTP and RTCP. Many firewalls, Network Address Translators (NATs) <xref target="RFC3022"></xref>, and
      RTP implementations expect symmetric RTP, and do not work in the
      presence of asymmetric RTP. However, this term has never been defined.
      This document defines "symmetric RTP" and "symmetric RTCP".</t>

      <t>The UDP port number to receive media, and the UDP port to transmit
      media are both selected by the device that receives that media and
      transmits that media. For unicast flows, the receive port is
      communicated to the remote peer (e.g., <xref target="RFC4566">Session Description Protocol (SDP)</xref>
      carried in <xref target="RFC3261">SIP</xref>, <xref
      target="RFC2974">Session Announcement Protocol (SAP)</xref>, or <xref
      target="RFC3525">Megaco/H.248</xref>).</t>

      <t>There is no correspondence between the local RTP (or RTCP) port and
      the remote RTP (or RTCP) port. That is, device "A" might choose its
      local transmit and receive port to be 1234. Its peer, device "B", is not
      constrained to also use port 1234 for its port. In fact, such a
      constraint is impossible to meet because device "B" might already be
      using that port for another application.</t>

      <t>The benefits of using one UDP port pair is described below in <xref
      target="recommended_usage"></xref>.</t>
    </section>

    <section title="Conventions Used in this Document">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
      "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
      document are to be interpreted as described in <xref
      target="RFC2119"></xref>.</t>
    </section>

    <section title="Definition of Symmetric RTP and Symmetric RTCP">
      <t>A device supports symmetric RTP if it selects, communicates, and uses
      IP addresses and port numbers such that, when receiving a bidirectional
      RTP media stream on UDP port "A" and IP address "a", it also transmits
      RTP media for that stream from the same source UDP port "A" and IP
      address "a". That is, it uses the same UDP port to transmit and receive
      one RTP stream.</t>

      <t>A device that doesn't support symmetric RTP would transmit RTP from
      a different port, or from a different IP address, than the port and IP
      address used to receive RTP for that bidirectional media steam.</t>

      <t>A device supports symmetric RTCP if it selects, communicates, and
      uses IP addresses and port numbers such that, when receiving RTCP
      packets for a media stream on UDP port "B" and IP address "b", it also
      transmits RTCP packets for that stream from the same source UDP port "B"
      and IP address "b". That is, it uses the same UDP port to transmit and
      receive one RTCP stream.</t>

      <t>A device that doesn't support symmetric RTCP would transmit RTCP
      from a different port, or from a different IP address, than the port and
      IP address used to receive RTCP.</t>
    </section>

    <section anchor="recommended_usage" title="Recommended Usage">
      <t>There are two specific instances where symmetric RTP and symmetric
      RTCP are REQUIRED:</t>

      <t>The first instance is NATs that lack integrated Application Layer
      Gateway (ALG) functionality. Such NATs require that endpoints use
      symmetric UDP ports to establish bidirectional traffic. This requirement
      exists for all types of NATs described in Section 4 of <xref
      target="RFC4787"></xref>. ALGs are defined in Section 4.4 of <xref
      target="RFC3022"></xref>.</t>

      <t>The second instance is Session Border Controllers (SBCs) and other
      forms of RTP and RTCP relays (e.g., <xref
      target="TURN"></xref>). Media relays are necessary to
      establish bidirectional UDP communication across a NAT that is
      'Address-Dependent' or 'Address and Port-Dependent' <xref
      target="RFC4787"></xref>. However, even with a media relay, symmetric
      UDP ports are still required to traverse such a NAT.</t>

      <t>There are other instances where symmetric RTP and symmetric RTCP are
      helpful, but not required. For example, if a firewall can expect
      symmetric RTP and symmetric RTCP, then the firewall's dynamic per-call
      port filter list can be more restrictive compared to asymmetric RTP and
      asymmetric RTCP. Symmetric RTP and symmetric RTCP can also ease
      debugging and troubleshooting.</t>

      <t>Other UDP-based protocols can also benefit from common local transmit
      and receive ports.</t>

      <t>There are no known cases where symmetric RTP or symmetric RTCP are
      harmful.</t>

      <t>For these reasons, it is RECOMMENDED that symmetric RTP and symmetric
      RTCP always be used for bidirectional RTP media streams.</t>
    </section>

    <section title="Security Considerations">
      <t>If an attacker learns the source and destination UDP ports of a
      symmetric RTP or symmetric RTCP flow, the attacker can send RTP or RTCP
      packets to that host. This differs from asymmetric RTP and asymmetric
      RTCP, where an attacker has to learn the UDP source and destination
      ports used for the reverse traffic, before it can send packets to that
      host. Thus, if a host uses symmetric RTP or symmetric RTCP, an attacker
      need only see one RTP or RTCP packet in order to attack either RTP
      endpoint. Note that this attack is similar to that of other UDP-based
      protocols that use one UDP port pair (e.g., <xref
      target="RFC1035">DNS</xref>).</t>
    </section>

    <section title="Acknowledgments">
      <t>The author thanks Francois Audet, Sunil Bhargo, Lars Eggert, Francois
      Le Faucheur, Cullen Jennings, Benny Rodrig, Robert Sparks, and Joe Stone
      for their assistance with this document.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119" ?>
    </references>

    <references title="Informative References">
      <?rfc include="reference.RFC.3550" ?>

      <?rfc include="reference.RFC.4787" ?>

      <?rfc include="reference.RFC.0793" ?>

      <?rfc include="reference.RFC.3022" ?>

      <?rfc include="reference.RFC.4566" ?>

      <?rfc include="reference.RFC.1035" ?>

      <?rfc include="reference.RFC.1350" ?>

<!--      <?rfc include="reference.I-D.ietf-behave-turn" ?> -->

<reference anchor='TURN'>
<front>
<title>Obtaining Relay Addresses from Simple Traversal Underneath NAT
(STUN)</title>

<author initials='J' surname='Rosenberg' fullname='Jonathan
Rosenberg'>
    <organization />
</author>

<date month='July' day='6' year='2007' />

<abstract><t>
This specification defines an extension of the Session Traversal
Utilities for NAT (STUN) Protocol for asking the STUN server to relay
packets towards a client.  This extension, called Traversal Using
Relays around NAT (TURN), is useful for elements behind NATs whose
mapping behavior is address and port dependent.  The extension
purposefully restricts the ways in which the relayed address can be
used.  In particular, it prevents users from running general purpose
servers from ports obtained from the STUN server.
</t></abstract>
</front>

<seriesInfo name='Work in' value='Progress' />
</reference>

      <?rfc include="reference.RFC.3261" ?>

      <?rfc include="reference.RFC.2974" ?>

      <?rfc include="reference.RFC.3525" ?>
    </references>
  </back>
</rfc>
