<?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 iprnotified="no" ?>
<?rfc strict="yes" ?>
<?rfc compact="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc colonspace="yes" ?>
<?rfc rfcedstyle="no" ?>
<?rfc tocdepth="4"?>

<rfc category="std" docName="draft-pthatcher-avtext-esid-00" ipr="trust200902">
  <front>
    <title abbrev="ESID">Encoded Stream ID Header Extension</title>

    <author fullname="Peter Thatcher" initials="P." surname="Thatcher">
      <organization>Google</organization>

      <address>
        <postal>
          <street>747 6th Ave S</street>

          <city>Kirkland</city>

          <region>WA</region>

          <code>98033</code>

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

        <email>pthatcher@webrtc.org</email>
      </address>
    </author>

    <date day="9" month="March" year="2015" />

    <area>RAI</area>

    <abstract>
      <t>This document defines a new RTP Header Extension and SDES
      item for an Encoded Stream ID or "ESID" which can be used for
      either identifying Encoded Streams or for extending RTP Payload
      Types. </t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction" anchor="introduction">
      <t>SDP Offerers and Answerers <xref target="RFC3264"></xref> can
      assign fmt values to SDP Media Descriptions (m= lines) within
      SDP Offers and Answers, using the procedures in <xref
      target="RFC4566"></xref>.  Each fmt uniquely identifies a media
      format, which is typically an RTP payload type.</t>
 
      <t>fmt values are also used to identity an Encoded Stream, where
      each combination of (Media Format, Encoded Stream) is
      represented as a unique fmt value.  For large numbers of Media
      Formats and Encoded Streams, the number of fmts then can exceed
      what can typically fit in an RTP payload type.</t>

      <t>This specification defines a new RTP Header Extension and SDES
      item for an Encoded Stream ID or "ESID" which can be used for
      either identifying Encoded Streams or extending RTP Payload
      Types. It also defines how these map to fmt values.</t>
    </section>

    <section title="Terminology" anchor="terminology">
      <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="RTP/RTCP extensions for ESID value transport" anchor="transport">
      <t>This section defines a new RTP SDES item <xref
      target="RFC3264"></xref>, 'ESID', which is used to carry IDs for
      Encoded Streams values within RTCP SDES packets.  This section
      also defines a new RTP header extension <xref
      target="RFC5285"></xref>, which can be used to carry the ESID
      value in RTP packets.</t>

      <t>The SDES item and RTP header extension makes is possible for
      a receiver to associate received RTCP- and RTP packets with a
      specific Encoded Stream.</t>

      <t>The RTP MID SDES item SHOULD be sent in the first few RTCP
      packets sent on joining the session, and SHOULD be sent
      regularly thereafter.  The exact number of RTCP packets in which
      this SDES item is sent is intentionally not specified here, as
      it will depend on the expected packet loss rate, the RTCP
      reporting interval, and the allowable overhead.</t>

      <t>The RTP ESID header extension SHOULD be included in some RTP
      packets at the start of the session and whenever the SSRC
      changes.  It might also be useful to include the header
      extension in RTP packets that comprise random access points in
      the media (e.g., with video I-frames).  The exact number of RTP
      packets in which this header extension is sent is intentionally
      not specified here, as it will depend on expected packet loss
      rate and loss patterns, the overhead the application can
      tolerate, and the importance of immediate receipt of the ESID
      value.</t>

      <t>For robustness purpose, endpoints need to be prepared for
      situations where the ESID value is delayed, and SHOULD NOT
      terminate sessions in such cases, as the ESID value is likely to
      arrive soon.</t>

    <section title="RTP ESID Header Extension" anchor="transport.hdrext">

      <t>The payload, containing the ESID value, of the RTP ESID
      header extension element can be encoded using either the
      one-byte or two- byte header <xref target="RFC5285"></xref>.</t>
    </section>

    <section title="RTP ESID SDES Item" anchor="transport.sdes">

     <t><figure>
       <artwork><![CDATA[

     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |     ESID=TBD  |     length    | ESID value                  ...
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork>
     </figure></t>

     <t>[RFC EDITOR NOTE: Please replace TBD with the assigned SDES
   identifier value.]</t>      
    </section>
  </section>

  <section title="Representation as a fmt value" anchor="fmt">
    <t>NOTE: The usage of other signalling protocols for
    carrying the ESID value is not prevented, but the usage of such
    protocols is outside the scope of this document.</t>

    <t>fmt values typically do not exceed 127, the limit of the value that
    can be reprsented by an RTP payload type.  The ESID allows for
    values for fmt larger than 127, calculated from the ESID and the 
    RTP payload type in the following way.</t>

    <t>The value of the ESID is treated as a big-endian integer, which is
    then shifted left 7 bits and added to the value of the RTP payload type.
    This integer value is then used as the fmt value in the SDP.</t>
  </section>

  <section title="Examples" anchor="examples">
    <t>For an ESID value of 1 and 2 and a Payload Type of 97, the fmt
    values of (1 &lt;&lt; 7) + 97 = 225 and (2 &lt;&lt; 7) + 97 = 353 would be
    used:
</t>
     <t><figure>
       <artwork><![CDATA[
       v=0
       o=alice 2890844526 2890844526 IN IP4 atlanta.example.com
       s=
       c=IN IP4 atlanta.example.com
       t=0 0
       m=video 10002 RTP/AVP 225 353
       a=rtpmap:225 VP8/90000
       a=rtpmap:353 VP8/90000
]]></artwork></figure>
     </t>
  </section>
  <section title="Security Considerations" anchor="sec.security-considerations">
    <t>TODO</t>
  </section>
  <section title="IANA Considerations" anchor="sec.iana-considerations">
    <t>
   [RFC EDITOR NOTE: Please replace RFCXXXX with the RFC number of this
   document.]
    </t>

    <t>
   [RFC EDITOR NOTE: Please replace TBD with the assigned SDES
   identifier value.]
    </t>

    <t>
   This document adds the MID SDES item to the IANA "RTP SDES item
   types" registry as follows:
    </t>

     <t><figure>
       <artwork><![CDATA[
       Value:      TBD
       Abbrev.:    ESID
       Name:       Encoded Stream Identification
       Reference:  RFCXXXX
]]></artwork></figure>
     </t>

  </section>
  <section title="Acknowledgements" anchor="sec.acknowledgements">
  </section>
</middle>

<back>
  <references title="Normative References">
    <reference anchor="RFC2119">
        <front>
          <title abbrev="RFC Key Words">Key words for use in RFCs to Indicate
          Requirement Levels</title>

          <author fullname="Scott Bradner" initials="S." surname="Bradner">
            <organization>Harvard University</organization>

            <address>
              <postal>
                <street>1350 Mass. Ave.</street>

                <street>Cambridge</street>

                <street>MA 02138</street>
              </postal>

              <phone>- +1 617 495 3864</phone>

              <email>sob@harvard.edu</email>
            </address>
          </author>

          <date month="March" year="1997" />

          <area>General</area>

          <keyword>keyword</keyword>
        </front>

        <seriesInfo name="BCP" value="14" />

        <seriesInfo name="RFC" value="2119" />

        <format octets="4723"
                target="http://www.rfc-editor.org/rfc/rfc2119.txt" type="TXT" />

        <format octets="17491"
                target="http://xml.resource.org/public/rfc/html/rfc2119.html"
                type="HTML" />

        <format octets="5777"
                target="http://xml.resource.org/public/rfc/xml/rfc2119.xml"
                type="XML" />
    </reference>
    <reference anchor="RFC3264">
        <front>
          <title>An Offer/Answer Model with Session Description Protocol
          (SDP)</title>

          <author fullname="J. Rosenberg" initials="J." surname="Rosenberg">
            <organization></organization>
          </author>

          <author fullname="H. Schulzrinne" initials="H."
                  surname="Schulzrinne">
            <organization></organization>
          </author>

          <date month="June" year="2002" />
        </front>

        <seriesInfo name="RFC" value="3264" />

        <format octets="60854"
                target="http://www.rfc-editor.org/rfc/rfc3264.txt" type="TXT" />
    </reference>
    <reference anchor="RFC4566">
        <front>
          <title>SDP: Session Description Protocol</title>

          <author fullname="M. Handley" initials="M." surname="Handley">
            <organization></organization>
          </author>

          <author fullname="V. Jacobson" initials="V." surname="Jacobson">
            <organization></organization>
          </author>

          <author fullname="C. Perkins" initials="C." surname="Perkins">
            <organization></organization>
          </author>

          <date month="July" year="2006" />
        </front>

        <seriesInfo name="RFC" value="4566" />

        <format octets="108820"
                target="http://www.rfc-editor.org/rfc/rfc4566.txt" type="TXT" />
    </reference>
    <reference anchor="RFC5285">
        <front>
          <title>A General Mechanism for RTP Header Extensions</title>

          <author fullname="D. Singer" initials="D." surname="Singer">
            <organization></organization>
          </author>

          <author fullname="H. Desineni" initials="H." surname="Desineni">
            <organization></organization>
          </author>

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

          <abstract>
            <t>This document provides a general mechanism to use the header
            extension feature of RTP (the Real-Time Transport Protocol). It
            provides the option to use a small number of small extensions in
            each RTP packet, where the universe of possible extensions is
            large and registration is de-centralized. The actual extensions in
            use in a session are signaled in the setup information for that
            session. [STANDARDS-TRACK]</t>
          </abstract>
        </front>

        <seriesInfo name="RFC" value="5285" />

        <format octets="36844"
                target="http://www.rfc-editor.org/rfc/rfc5285.txt" type="TXT" />
    </reference>
  </references>
  <section title="Change log" anchor="sec.change-log">
  </section>
</back>
</rfc>
