<?xml version="1.0" encoding="US-ASCII" ?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc strict="yes" ?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="no" ?>
<!-- sort the reference entries alphabetically -->
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>
<?rfc inline=yes ?>
<?rfc comments="yes"?>
<rfc category="info" docName="draft-kaustubh-mprtp-dtls-srtp-00" ipr="trust200902">  
<front>
    <title abbrev="Multipath RTP with SRTP">Multipath RTP (MPRTP) with Secure Real-Time Transport (SRTP)</title>

    <author fullname="Varun Singh" initials="V." surname="Singh">
      <organization abbrev="callstats.io">CALLSTATS I/O Oy</organization>
      <address>
        <postal>
          <street>Annankatu 31-33 C 42,</street>
          <city>Helsinki</city>
          <code>00100</code>
          <country>Finland</country>
        </postal>
        <email>kinamdar@cisco.com</email>
        <uri>http://www.callstats.io/</uri>
      </address>
    </author>
    <author fullname="Kaustubh Inamdar" initials="K." surname="Inamdar">
      <organization>Cisco Systems, Inc.</organization>
      <address>
        <postal>
          <street>Cessna Business Park ,</street>
          <street>Kadabeesanahalli Village, Varthur Hobli,</street>
		  <street>Sarjapur-Marathahalli Outer Ring Road</street>
          <city>Bangalore</city>
          <region>Karnataka</region>
          <code>560103</code>
          <country>India</country>
        </postal>
        <email>kinamdar@cisco.com</email>
         <!-- <uri>https://www.cisco.com</uri> -->
      </address>
    </author>
    <author fullname="Ram Mohan Ravindranath" initials="R." surname="Ravindranath">
      <organization>Cisco Systems, Inc.</organization>
      <address>
        <postal>
          <street>Cessna Business Park ,</street>
          <street>Kadabeesanahalli Village, Varthur Hobli,</street>
      <street>Sarjapur-Marathahalli Outer Ring Road</street>
          <city>Bangalore</city>
          <region>Karnataka</region>
          <code>560103</code>
          <country>India</country>
        </postal>
        <email>rmohanr@cisco.com</email>
         <!-- <uri>https://www.cisco.com</uri> -->
      </address>
    </author>


    <date year="2017" />

    <area>Applications and Real-Time Area (ART)</area>

    <workgroup>ICE</workgroup>

    <keyword>RTP</keyword>

    <keyword>RTCP</keyword>

    <keyword>multipath</keyword>

    <keyword>streaming</keyword>

	<keyword>SRTP</keyword>

   <abstract>
      <t>This document describes the considerations when using Multipath RTP 
        (MPRTP) with Secure Real-time Transport (SRTP) security context set up with the Datagram Transport Layer Security (DTLS) protocol.</t>
   </abstract>
 </front>
 <middle>
    <section title="Introduction">
      <t><xref target="I-D.ietf-avtcore-mprtp"/> is an extension to RTP that allows multi homed endpoints to use plurality of transmission paths to send/receive media.</t>
	  <t>MPRTP functions as a layer of abstraction between the RTP stack and the multiplicity of transport paths available for media transmission by splitting and recombining media streams. </t>
      <t>Datagram Transport Layer Security (DTLS) <xref target="RFC6347" /> is a channel security protocol that offers integrated key management, parameter negotiation, and secure data transfer.  Because DTLS data transfer protocol is generic, it is less highly optimized for use with RTP than is SRTP, which has been specifically tuned for that purpose, DTLS-SRTP <xref target="RFC5764" /> is an extension to DTLS that is optimized to work with Secure Real Time transport protocol <xref target="RFC3711" /> to provide integrated key management, SRTP algorithm negotiation and SRTP parameter negotiation.</t>
	  <t>MPRTP <xref target="I-D.ietf-avtcore-mprtp"/>conceptually introduces the
          possibility of transmitting RTP over a plurality of sub flows using
          an extension to RTP, however in real world deployments there is a
          need to secure transmission paths whether singular or multiple.  The
          motivation of this draft is to highlight the operating principles of
          MPRTP <xref target="I-D.ietf-avtcore-mprtp"/> with DTLS-SRTP <xref target="RFC5764"/>.</t>
	</section>

	<section title="Motivation">
	  <t>MPRTP <xref target="I-D.ietf-avtcore-mprtp"/> introdues the concept of transmitting RTP over multiple subflows. When DTLS-SRTP <xref target="RFC5764"/> is used with MPRTP  <xref target="I-D.ietf-avtcore-mprtp"/>there are different design considerations possible. The following sections of this draft highlight  some of these considerations.</t>
	</section>
	
	<section anchor="sec.crypto-context-considerations" title="SRTP Cryptographic Context considerations">
	  <t>Each SRTP stream requires the sender and receiver to maintain
   cryptographic state information which is called "SRTP Cryptographic 
   Contexts" as defined in Section 3.2 of <xref target="RFC3711"/>. A SRTP 
   cryptographic context is maintained for each SRTP session and provides 
   several parameters that are vital to the proper operation of the SRTP 
   framework (E.g. ROC, index, master keys, session keys etc.) In the case of 
   a single RTP stream that is secured via DTLS-SRTP, there is tight 
   synchronization between different cryptographic parameters on sending and 
   receiving application. </t>
	  <t>In the case of MPRTP, due to the presence of subflows, there can be two 
      possible approaches with regards to securing media traffic using 
      DTLS-SRTP:</t>
	  <t><list style="numbers">
	    <t>Re-use the same DTLS-SRTP association as traffic fails over from 
        interface to another</t>
	    <t>Use multiple DTLS-SRTP associations if traffic uses several subflows 
        concurrently.</t>
	  </list></t>
	  <t>The implications of using either approach are detailed in the 
      sub-seections below.</t>

	  <section anchor="sec.dtls-associate-reuse" title="DTLS association re-use">
		<t>One of major use cases of MPRTP is that of mobility, wherein a 
      currently active interface experiences a severe degradation of 
      transmission quality or disappears altogether as the device moves 
      between networks. In such cases the MPRTP stack may offload all traffic 
      to a secondary preference interface to continue media transmission. This 
      change in the media address would require an updated offer/answer 
      exchange to be sent when ICE <xref target="I-D.ietf-ice-rfc5245bis"/> is 
      used, in other cases in-band RTCP based advertisements may be used. For 
      such scenarios instead of setting up an entirely new 
      DTLS-SRTP association, the existing association can be reused by 
      retaining the same 'tls-id' as defined by <xref target="I-D.ietf-mmusic-dtls-sdp"/></t>
        <t>In cases where there is a need to gradually offload traffic from an 
          currently active interface to an another/additional interfaces, a 
          new DTLS-SRTP association must be setup or alternatively, there 
          might be a future specification/extension to DTLS-SRTP that defines 
          such behavior.</t>
	  </section>

	  <section anchor="sec.crypto-index" title="Cryptographic index">
	    <t>When using multiple subflows with MPRTP, each subflow sets up a different DTLS-SRTP association, the cryptographic context for each 
        DTLS-SRTP association is unique and referenced using a distinct  triplet identifier.</t>
		<t>&lt;SSRC, destination network address, destination transport port number&gt; </t>
		<t>While de-queuing packets from the application, the MPRTP stack may 
      choose to distribute these packets across several active subflows after 
      packet encryption and optional authentication, such that each active 
      subflow would most likely not service packets with monotonously 
      increasing global RTP sequence numbers (the per flow sequence numbers 
      however, would be monotonously increasing)</t>
		<t>The encryption process specified in section 3.3 of <xref target="RFC3711"/> when applied to the MPRTP scenario would cause a huge skew when 
    indices for successive packets in a given subflow are calculated as the 
    index value uses the global RTP sequence number as per the following 
    definition.</t>
		<t>i = 2^16 * ROC + SEQ</t>
		<t>When packets arrive out-of-order, this skew in packet indices can cause 
      the replay protection algorithm on the receiving application to misfire 
      and incorrectly drop packets as the replay window would accept packet 
      indices that slightly lag behind the current cryptographic index value. 
      Setting the window size to be large enough to accept packets whose 
      indices drastically lag behind the current cryptographic context index 
      value, renders the replay protection algorithm ineffective and incapable 
      of identifying replay attacks. This particular problem is exacerbated 
      when a certain subflow(s) are scantily used for packet transmission with 
      majority of the packets transmitted on other subflows with better path 
      characteristics.</t>
	  </section>

	  <section  anchor="sec.crypto-keys" title="Cryptographic keys">
	    <t><xref target="RFC3711"/> allows for sharing of keys across different RTP streams in a media session. From the perspective of MPRTP, there are two major problems that could arise with key sharing across different subflows.</t>
	    <section anchor="sec.keypad" title="Two-time keypad">
		  <t>MPRTP makes use of the same SSRC value across all subflows of a given 
        media type (e.g. audio), in general scenarios, unique keystreams are 
        generated per packet regardless of the subflow over which they are 
        transmitted as the index of the packet being encrypted in unique.  
        However in scenarios where certain critical packets are transmitted 
        over all or some of the subflows for the sake of redundancy and 
        reliability (e.g.  I-Frame, named telephony events), the very same 
        keystream value is generated and leads to "two-time key pad" rendering 
        the secure framework open to attacks.  The chances of a two-type key 
        pad issue is exacerbated if key re-use is allowed among different 
        MPRTP media types (e.g. audio and video) in a given media session as 
        the chance of an attacker detecting duplicate keystreams increases at 
        least by a factor of two.</t>
	    </section>

	    <section anchor="sec.auth-key-reuse" title="Authentication key re-use">
	      <t>The SSRC field in an SRTP packet is an authentication-protected 
          field and if the same authentication key is used, an attacker can 
          substitute one stream into another causing media playout issues at 
          the receiver application.</t>
	    </section>
	  </section>

	  <section title="Coordination between a plurality of cryptographic contexts and MPRTP">
	    <t>MPRTP involves the splitting of a single RTP stream into a number of 
        subflows that appear as distinct streams from the perspective of the 
        network. However the MPRTP stack at the receiver side is responsible 
        for re-combining these streams and presenting a single flow of RTP 
        packets to the application. Due to the presence of multiple subflows 
        (with distinct network addresses and ports), a separate DTLS-SRTP 
        association is required per subflow, with each association maintaining 
        a distinct set of cryptographic parameters as per section 3.2.1 of 
        <xref target="RFC3711"/>.</t>
		<t>With each encrypt/decrypt cycle occurring across subflows, the MPRTP 
      stack on the sender and receiver side has to ensure that various 
      parameters of the cryptographic context are updated across each subflow, 
      followed by correct sequencing of packets before it is presented to the 
      application. The computational costs of maintaining multiple subflows, 
      running several encrypt/decrypt cycles per subflow and sequencing 
      packets correctly is significantly higher in comparison to a single RTP 
      stream.</t>
      </section>
</section>

   <section title="Re-keying considerations">
    <t> To avoid the two-time key pad problem, it is necessary for an 
    SRTP/SRTCP stream to re-key (master key) every time the 48 bit index space 
    is exhausted, this ensures that duplicate key-streams arent generated.   
    MPRTP may setup subflows that are scantily used in packet transmission, in 
    which case a given subflow would quickly exhaust its index space, roll 
    over and possibly produce duplicate keystreams leading to a potential 
    breakdown of the SRTP framework. If the master key is shared across 
    several subflows this would certainly lead to frequent re-keying across 
    several subflows adding to the cryptographic load.</t>
   </section>

   <section title="Encrypting MPRTP header extensions">
	 <t>MPRTP uses header extensions in RTP and RTCP packets for the following use-cases:</t>
	  <t><list style="numbers">
	   <t>To communicate the subflow ID and subflow specific sequence numbers</t>
	   <t>To report per subflow RTCP reports</t>
	   <t>For interface advertisement (RTCP)</t>
	   </list></t>
     <t>The transforms and constructs of <xref target="RFC3711"/> encrypt only 
     the payload of the SRTP packets, without considering the header extensions
     . Given that the MPRTP header extension could be visible to an attacker, 
     fields like the subflow specific ID or subflow specific sequence numbers 
     can easily be manipulated, causing issues on the receiving application. 
     For example, an adversary can change the subflow specific sequence number 
     to indicate a drastic change causing the receiving application to drop 
     the packet. The subflow specific ID could be also be changed to reflect a 
     stream ID that is non existent causing the receiving application to 
     completely drop all packets corresponding to the rogue subflow ID.</t>
     
     <t>SRTP authentication tag would ensure that RTP header extensions are 
      unaltered, however in the case where encryption proceeds without 
      authentication, it may be desirable to encrypt the MPRTP header 
      extensions.</t>
     </section>	 
	 
	 <section title="DTLS associations">
	 <t>As discussed in earlier sections of this draft, multiple DTLS-SRTP 
    associations must be established per subflow in an MPRTP setup, 
    maintaining multiple subflows with DTLS-SRTP does bring up some additional 
    considerations that are discussed below: </t>

   <section title="DTLS Session Resumption">
   <t>For related media streams within a RTP session, it is advised to use 
    DTLS session resumption to reduce the cost of cryptographic operations. 
    Using DTLS session resumption leads to the re-use of the master key across 
    all the subflows, which could lead to the problems highlighted in 
    <xref target="sec.dtls-associate-reuse"/>. It is advisable to use 
    parallel, distinct DTLS-SRTP associations to protect the subflows such 
    that the keys are unique across all subflows.</t>
   </section>

      <section title="Keeping subflows Alive">
   <t>Certain MPRTP subflows that are secure via DTLS SRTP, might be used 
    sparingly for packet transmission, with the majority of traffic being sent 
    over other high priority subflows (as determined via ICE 
    <xref target="I-D.ietf-ice-rfc5245bis"/> or a local algorithm at the 
    sender side), in order to ensure that sparingly used subflows at the 
    DTLS layer, the DTLS heartbeat extension as defined in 
    <xref target="RFC6520"/> may be used. This ensures that the costly 
    operation of a DTLS re-negotiation is avoided and also ensures that TURN 
    or STUN bindings are refreshed if media traverses through NATs or relays.
  </t>
   </section>
    
    <section title="Late Binding of Cryptographic Contexts">
   <t>As DTLS SRTP associations are agnostic to the SSRC of media streams, 
    DTLS-SRTP uses a "late binding" mechanism as far as cryptographic contexts 
    are concerned.  A MPRTP endpoint can have multiple DTLS-SRTP associations, 
    in which case on receiving the SRTP packet, an assertion needs to be made 
    on what association that SSRC corresponds to, so, initially the cost of 
    the algorithm to determine this will be equal to the number of subflows 
    and the algorithm might require additional passes as subflows are added.
  </t>
    </section>

</section>
	
	<section title="Security Considerations">
		<t>TBD</t>
	</section>

  <section anchor="sec.iana-considerations" title="IANA Considerations">
    <t> This document does not add any new extensions. No updates needed to 
      IANA registry. </t>
  </section>

	<section title="Acknowledgements">
	</section>

  </middle>
  <back>
  <references title="Normative References">
    <?rfc include="reference.RFC.6347"?>
    <?rfc include="reference.RFC.5764"?>
    <?rfc include="reference.RFC.3711"?>
    <?rfc include="reference.I-D.ietf-avtcore-mprtp"?>
    </references>
    <references title="Informative References">
      <?rfc include="reference.I-D.ietf-ice-rfc5245bis"?>
      <?rfc include="reference.I-D.ietf-mmusic-dtls-sdp"?>
      <?rfc include="reference.RFC.6520"?>
    </references>
	<!--
	<references title="Informative References">
		
    </references>-->
	</back>
</rfc>