<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<!--rfc category="info" ipr="full3978"-->
<rfc submissionType="IETF" category="std" consensus="yes" number="8124" ipr="trust200902">
  <front>

    <title abbrev="WebSocket SDP Attribute"> 
The Session Description Protocol (SDP) WebSocket Connection URI Attribute</title>



   <author initials="R" surname="Ravindranath" fullname="Ram Mohan Ravindranath">
			<organization abbrev="Cisco">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>
			</address>
		    </author>
		    
    <author fullname="Gonzalo Salgueiro" initials="G"
            surname="Salgueiro">
      <organization abbrev="Cisco">Cisco Systems, Inc.</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>

    <date month="March" year="2017"/>

    <area>Real-time Applications and Infrastructre (RAI)</area>

    <workgroup>BFCPBIS Working Group</workgroup>




    <abstract>
      <t>The WebSocket protocol enables bidirectional real-time communication
      between clients and servers in web-based applications. This document specifies extensions to Session
      Description Protocol (SDP) for application protocols using WebSocket as a transport.</t>
    </abstract>
  </front>

  <middle>
  
    <section anchor="introduction" title="Introduction">
      <t>The WebSocket protocol <xref target="RFC6455"/> enables
      bidirectional message exchange between clients and servers on top of a
      persistent TCP connection (optionally secured with Transport Layer Security (TLS) <xref
      target="RFC5246"/>). The initial protocol handshake makes use of
      Hypertext Transfer Protocol (HTTP) <xref target="RFC7230"/> semantics, allowing the WebSocket
      protocol to reuse existing HTTP infrastructure.</t>

      <t>Modern web browsers include a WebSocket client stack
      compliant with the WebSocket API <xref target="WS-API"/> as
      specified by the W3C. It is expected that other client
      applications (e.g., those running on personal computers, mobile devices, etc.) will also make a WebSocket client stack
      available. Several specifications have been written that define how different
      applications can use a WebSocket subprotocol as a reliable transport mechanism. </t>
      
     <t>For example, <xref target="RFC7118"/> defines a WebSocket subprotocol as a reliable 
     transport mechanism between Session Initiation Protocol (SIP)<xref target="RFC3261"/>
      entities to enable use of SIP in web-oriented deployments. Additionally, 
      <xref target="RFC7977"/> defines a new WebSocket subprotocol 
      as a reliable transport mechanism between Message Session Relay Protocol (MSRP) clients 
      and relays.  <xref target="RFC7395"/> defines a WebSocket subprotocol for the 
      Extensible Messaging and Presence Protocol (XMPP).  Similarly,  
      <xref target="BFCP-WEBSOCKET"/> defines a WebSocket subprotocol as a 
      reliable transport mechanism between Binary Floor Control Protocol (BFCP) 
     <xref target="BFCP"/> entities to enable usage of BFCP in new 
     scenarios. </t>
        
      <t>When a WebSocket subprotocol is used as a transport mechanism between a server and client,
there needs to be a way to indicate the connection URI from the server to the
WebSocket client. For applications that use Session Description Protocol (SDP) <xref target="RFC4566"/>
to negotiate, the connection URI can be indicated by means of an SDP attribute.  
This specification defines new SDP attributes to indicate the connection URI for the
   WebSocket client.  Applications that use SDP for negotiation and
   WebSocket as a transport protocol can use this specification to
   advertise the WebSocket client connection URI.</t>
      
    </section>

    <section anchor="terminology" title="Terminology">
      <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 <xref target="RFC2119"/>.</t>

    </section>


<section anchor="sdp_con"  title="SDP Considerations">
    
      <section anchor="gen" title="General">
        <t>Applications that use the SDP Offer/Answer mechanism <xref target="RFC3264"/> for 
        negotiating media and also use WebSocket or secure WebSocket as a transport protocol MAY indicate 
        the connection URI for the WebSocket client via a new SDP "a=" media-level attribute 
       defined in <xref target="attribute1"/>. </t>
      </section>  
      <section anchor="attribute1"  title="&quot;websocket-uri&quot; SDP Attribute">
      <t>This section defines a new SDP media-level attribute, "websocket-uri", which can appear in any of the media sections.</t>
      
    <t>Example:</t>

      <t><figure>
        <artwork><![CDATA[
   a=websocket-uri:wss://example.com/chat
   ]]></artwork>
      </figure></t>
    
    <t>Where "wss://example.com/chat" is the ws-URI defined in Section 3 of <xref target="RFC6455"/>.</t>  
      
      <t>When the "websocket-uri" attribute is present in the media section of the
   SDP, the IP address in "c=" line SHALL be ignored and the full URI
   SHALL be used instead to open the WebSocket connection.
The clients MUST ensure that they use the URI to open the WebSocket
connection and ignore the IP address in the "c=" line and the port in the "m=" line.</t>
    </section>
    
    
    <section anchor="muxConsid" title="&quot;websocket-uri&quot; Multiplexing Considerations">
<t>       
Multiplexing characteristics of SDP attributes are described in <xref target="SDP-MUX"/>.  Various SDP attribute multiplexing categories are introduced there.
</t>

<t><list style="symbols">
<t>
The multiplexing category of the "a=websocket-uri" attribute is CAUTION.
</t>
</list>
</t>    
<t>
There are no multiplexing rules specified for the "websocket-uri" SDP media-level attribute.  Additionally, the specification of multiplexing rules for the "websocket-uri" attribute is outside the scope of this document.
</t>
<t>While it is technically possible to bundle WebSocket, there are a variety of reasons that make it impractical; thus, it is considered unlikely to be used in practice. Therefore, the "websocket-uri" SDP media-level attribute defined in <xref target="attribute1"/> for using WebSocket as a transport protocol is not likely to be used with SDP bundle and is consequently categorized as CAUTION for multiplexing.
</t> 
<t>
If future extensions define how to bundle WebSocket, then multiplexing rules for the "a=websocket-uri" attribute need to be defined as well, for instance, in an extension of this SDP based WebSocket negotiation specification.
</t>
</section> 

</section>

<section anchor="sdpoaprocedure" title="SDP Offer/Answer Procedures">
      <section title="General">
        <t>An endpoint (i.e., both the offerer and the answerer) that wishes to negotiate WebSocket
          as transport protocol MUST indicate that it wishes to use WebSocket or secure WebSocket  
          in the "proto" field of the "m=" line. Furthermore, the server side, which could be either 
          the offerer or answerer, MUST add an "a=websocket-uri" attribute in the media section whose 
          value can be either "ws-URI" or "wss-URI", as defined in Section 3 of <xref target="RFC6455"/>,  
          depending on whether it wishes to use WebSocket or secure WebSocket. This new attribute MUST 
          follow the syntax defined in <xref target="sdp_con"/>. The procedures in 
          this section apply to an "m=" line associated with any media stream that uses WebSocket 
          or secure WebSocket as transport.</t>
          <t>Both offerer or answerer can initiate a WebSocket connection.  It is
   expected that, based on the topology (for example, if the client is
   behind NAT and server is on global IP address), the offerer and
   answerer applications decide on who will initiate the WebSocket
   connection and appropriately set the "setup" attribute in SDP
   following the procedures of <xref target="RFC4145"/>.</t>

       </section>
       
       <section title="Generating the Initial Offer">

        <t>In order to negotiate WebSocket as a transport, an SDP offerer MUST indicate that it wishes to use it in the "proto" field of the "m=" line. For example, to negotiate BFCP-over-WebSocket, the "proto"
        value in the "m=" line is TCP/WSS/BFCP if WebSocket is over TLS; else, it is 
        TCP/WS/BFCP, as specified in <xref target="BFCP-WEBSOCKET"/>.</t>

        <t>The offerer SHOULD assign the SDP "setup" attribute with a value of "active" (the 
          offerer will be the initiator of the outgoing TCP connection) or "passive" if the 
          offerer wishes to be a receiver of an incoming connection. The offerer MUST NOT 
          assign an SDP "setup" attribute with a "holdconn" value. The offerer MUST follow the
          procedures described in <xref target="RFC4145"/>  while using the "setup" attribute. 
          If the "setup" attribute has a value of "passive", it MUST have a URI in the 
          "a=websocket-uri" attribute. </t>

          <t>The following is an example of an "m=" line for a BFCP connection:
             <figure>
          <artwork><![CDATA[
Offer (browser):
m=application 9 TCP/WSS/BFCP *
a=setup:active
a=connection:new
a=floorctrl:c-only
m=audio 55000 RTP/AVP 0
m=video 55002 RTP/AVP 31
]]></artwork>
        </figure></t>

        <t>In the above example, the client is intending to set up the TLS/TCP connection; hence, the port is set to a value of 9, which is the discard port. </t>
       
  </section>

  <section anchor="sec-gen-answer" title="Generating the Answer">
    <t>If the answerer accepts the offered WebSocket transport
   connection, in the associated SDP answer, the answerer MUST assign an
   SDP "setup" attribute with a value of either "active" or "passive",
   according to the procedures in <xref target="RFC4145"/>.  The answerer MUST NOT
   assign an SDP "setup" attribute with a value of "holdconn".</t>

   <t>If the answerer assigns an SDP "setup" attribute with a value of
   "active", the answerer MUST initiate the WebSocket connection handshake by
    acting as client on the negotiated media stream, towards the URI specified in the "a=websocket-uri" 
    SDP attribute using the procedures described in Section 4 of <xref target="RFC6455"/>.</t>

    <t>If the answerer assigns an SDP "setup" attribute with a value of "passive", then it MUST 
      have a value of "ws-URI" or "wss-URI", as defined in Section 3 of <xref target="RFC6455"/> in an
      "a=websocket-uri" SDP attribute, depending on whether the application uses WebSocket or secure WebSocket. 
      This attribute MUST follow the syntax defined in <xref target="sdp_con"/>.</t>

    <t>The following example shows a case where the server responds with a BFCP media stream over
     a WebSocket connection running TLS. It shows an answer "m=" line for the BFCP connection.
      In this example, since WebSocket is running over TLS, the server answers back with an
      "a=websocket-uri" attribute in the media section of SDP having a "wss-URI" connection URI:
      <figure>
          <artwork><![CDATA[
Answer (server):
m=application 50000 TCP/WSS/BFCP *
a=setup:passive
a=connection:new
a=websocket-uri:wss://bfcp-ws.example.com?token=3170449312
a=floorctrl:s-only
a=confid:4321
a=userid:1234
a=floorid:1 m-stream:10
a=floorid:2 m-stream:11
m=audio 50002 RTP/AVP 0
a=label:10
m=video 50004 RTP/AVP 31
a=label:11
      ]]></artwork>
        </figure></t> 
        </section>

        <section title="Offerer Processing of the Answer">
          <t>When the offerer receives an SDP answer, if the offerer ends up intiating the TCP connection, then it MUST follow the procedures in <xref target="sec-active-proc"/>.

 </t>
         </section>

        <section title="Modifying the Session">
          <t>Once an offer/answer exchange has been completed, either endpoint MAY
   send a new offer in order to modify the session. The endpoints can
   reuse the existing WebSocket connection by adding an "a=connection:existing" attribute in the 
   media section of the SDP following the rules mentioned in <xref target="RFC4145"/>, if the "websocket-uri" SDP 
   value and the transport parameters indicated by each endpoint are unchanged.
   Otherwise, following the rules for the initial offer/answer exchange,
   the endpoints can negotiate and create a new WebSocket connection on top of TLS/TCP or TCP.</t>
        </section>

         <section anchor="sec-offerless" title="Offerless INVITE Scenarios">
          <t>
            In some scenarios, an endpoint (e.g., a browser) originating the call (a User Agent Client or UAC) can send
an offerless INVITE to the server. The server will generate an offer
in response to the INVITE. In such cases, the server MUST send an offer with
the "setup" attribute with a value of "passive" so as to accept incoming connection and
MUST include an "a=websocket-uri" attribute in the media section whose value MUST be either "ws-URI" or "wss-URI",
depending on whether the server wishes to use WebSocket or secure WebSocket.
The SDP offer sent by the server will look like the example in <xref target="sec-gen-answer"/>.
          </t>
         </section> 

     </section> 

    <section anchor="sec-active-proc" title="Procedures at WebSocket Client">
      <t>The WebSocket client MUST always initiate the 
          outgoing TCP connection; hence, the SDP "setup" attribute MUST always be "active" for 
          the WebSocket client in its SDP offer/answer.  In the example below, the WebSocket client is the offerer; hence, it 
          assigns a "setup" attribute with a value of "active". </t>

          <t>The WebSocket server is a server on the Internet; hence,
          it MUST always assign an SDP "setup" attribute with a value
          of "passive". This also avoids the need to use Interactive
          Connectivity Establishment (ICE) between WebSocket client
          and WebSocket server, as the connection model here would be
          a typical client-to-server web connection.</t>

         <t>Once the offer/answer is complete, the client MUST
         initiate the WebSocket connection handshake by sending a GET
         message on the negotiated media stream, towards the URI
         specified in an "a=websocket-uri" attribute, as per the procedures
         described in <xref target="RFC6455"/>.  When no port is
         passed in the "a=websocket-uri" attribute, the default port
         (80 or 443) is used depending on whether the value was
         "ws-URI" or "wss-URI".</t>
        </section> 

    <section anchor="security_considerations"
             title="Security Considerations">
      <t>An attacker may attempt to add, modify, or remove
      an "a=websocket-uri" attribute from a session description.  This
      could result in an application behaving undesirably.
      Consequently, it is RECOMMENDED that integrity protection be
      applied to the SDP session descriptions.  For session
      descriptions carried in SIP <xref target="RFC3261"/>, S/MIME is
      available to provide such end-to-end integrity protection.</t>

      <t>As described in Section 10 of <xref target="RFC6455"/>, application signalling traffic being transported 
        over WebSocket MUST support secure WebSocket and SHOULD employ it when communicating with 
        their peers.</t>

      <t>The WebSocket clients have to initiate the TCP connection to the WebSocket
        server identified by the Fully Qualified Domain Name (FQDN) in an "a=websocket-uri" attribute. Further, as with any other web connection, the clients will verify the server's
certificate. The WebSocket
      client MUST follow the procedures in <xref target="RFC7525"/> (including host name verification 
      as per Section 6.1 in <xref target="RFC7525"/>) while setting up a TLS connection with a
      WebSocket server. </t>
    </section>

    <section anchor="iana_considerations" title="IANA Considerations">
      <section title="Registration of the &quot;websocket-uri&quot; SDP Media Attribute">


     <t>This document defines a new SDP media-level attribute "websocket-uri" in <xref target="attribute1"/>; IANA has registered the following SDP att-field under the "Session Description Protocol (SDP) Parameters" registry as follows:
     </t>

     <texttable title="">
       <ttcol align='left' width='30%'/>
       <ttcol align='left'/>

       <c>Attribute name:</c>
       <c>websocket-uri</c>
       
       <c>Long-form attribute name:</c>
       <c>WebSocket Connection URI</c>
       
       <c>Type of attribute:</c>
       <c>media</c>

       <c>Mux category:</c>
       <c>CAUTION</c>

       <c>Charset Dependent:</c>
       <c>No</c>

       <c>Purpose:</c>
       <c>The "websocket-uri" attribute is intended to be used as a connection URI for opening the WebSocket connection.</c>

       <c>Appropriate values:</c>
       <c>A ws-URI  or wss-URI, as defined in Section 3 of <xref target="RFC6455"/></c>

       <c>Contact name:</c>
       <c>Gonzalo Salgueiro</c>

       <c>Contact email:</c>
       <c>gsalguei@cisco.com</c>

       <c>Reference:</c>
       <c>RFC 8124</c>
     </texttable>
                
      </section>
      
</section>


  </middle>


  <back>

    <references title="Normative References">
    <?rfc include="reference.RFC.2119"?>
    <?rfc include="reference.RFC.6455"?>
    <?rfc include="reference.RFC.4145"?>

    </references>

    <references title="Informative References">
    <?rfc include="reference.RFC.7230"?>
    <?rfc include="reference.RFC.3261"?>
    <?rfc include="reference.RFC.3264"?>
    <?rfc include="reference.RFC.4566"?>
    <?rfc include="reference.RFC.5246"?>
    <?rfc include="reference.RFC.7118"?>
    <?rfc include="reference.RFC.7395"?>
    <?rfc include="reference.RFC.7525"?>
    <?rfc include="reference.RFC.7977"?>
<!--    <?rfc include="reference.I-D.ietf-bfcpbis-bfcp-websocket"?>; In MISSREF as of 3/14/17 -->



<reference anchor='BFCP-WEBSOCKET'>
<front>
<title>The WebSocket Protocol as a Transport for the Binary Floor Control Protocol (BFCP)</title>

<author initials='V' surname='Pascual' fullname='Victor Pascual'>
    <organization />
</author>

<author initials='A' surname='Roman' fullname='Anton Roman'>
    <organization />
</author>

<author initials='S' surname='Cazeaux' fullname='Stephane Cazeaux'>
    <organization />
</author>

<author initials='G' surname='Salgueiro' fullname='Gonzalo Salgueiro'>
    <organization />
</author>

<author initials='R' surname='R' fullname='Ram R'>
    <organization />
</author>

<date month='February' day='8' year='2017' />

<abstract><t>The WebSocket protocol enables two-way realtime communication between clients and servers.  This document specifies the use of Binary Floor Control Protocol(BFCP) as a new WebSocket sub-protocol enabling a reliable transport mechanism between BFCP entities in new scenarios.</t></abstract>

</front>

<seriesInfo name='Work in Progress,' value='draft-ietf-bfcpbis-bfcp-websocket-15' />

</reference>



<!--    <?rfc include="reference.I-D.ietf-bfcpbis-rfc4582bis"?>; MISSREF as of 3/14/17 -->


<reference anchor='BFCP'>
<front>
<title>The Binary Floor Control Protocol (BFCP)</title>

<author initials='G' surname='Camarillo' fullname='Gonzalo Camarillo'>
    <organization />
</author>

<author initials='K' surname='Drage' fullname='Keith Drage'>
    <organization />
</author>

<author initials='T' surname='Kristensen' fullname='Tom Kristensen'>
    <organization />
</author>

<author initials='J' surname='Ott' fullname='Joerg Ott'>
    <organization />
</author>

<author initials='C' surname='Eckel' fullname='Charles Eckel'>
    <organization />
</author>

<date month='November' day='13' year='2015' />

<abstract><t>Floor control is a means to manage joint or exclusive access to shared resources in a (multiparty) conferencing environment. Thereby, floor control complements other functions -- such as conference and media session setup, conference policy manipulation, and media control -- that are realized by other protocols.  This document specifies the Binary Floor Control Protocol (BFCP). BFCP is used between floor participants and floor control servers, and between floor chairs (i.e., moderators) and floor control servers.  This document obsoletes RFC 4582.  Changes from RFC 4582 are summarized in Section 16.</t></abstract>

</front>

<seriesInfo name='Work in Progress,' value='draft-ietf-bfcpbis-rfc4582bis-16' />

</reference>



 <!--        <?rfc include="reference.I-D.ietf-mmusic-sdp-mux-attributes"?>; MISSREF as of 3/14/17 -->



<reference anchor='SDP-MUX'>
<front>
<title>A Framework for SDP Attributes when Multiplexing</title>

<author initials='S' surname='Nandakumar' fullname='Suhas Nandakumar'>
    <organization />
</author>

<date month='December' day='19' year='2016' />

<abstract><t>The purpose of this specification is to provide a framework for analyzing the multiplexing characteristics of Session Description Protocol (SDP) attributes when SDP is used to negotiate the usage of single 5-tuple for sending and receiving media associated with multiple media descriptions.  This specification also categorizes the existing SDP attributes based on the framework described herein.</t></abstract>

</front>

<seriesInfo name='Work in Progress,' value='draft-ietf-mmusic-sdp-mux-attributes-16' />

</reference>

    <reference anchor="WS-API" target="https://www.w3.org/TR/2012/CR-websockets-20120920/">
        <front>
          <title>The WebSocket API</title>


          <author fullname="Ian Hickson" initials="I." role="editor"
                  surname="Hickson">
            <organization>Google, Inc.</organization>
          </author>

          <date month="September" year="2012"/>
        </front>
       <seriesInfo name="W3C Candidate" value="Recommendation"/>
      </reference>
    </references>


      <section anchor="acknowledgements" title="Acknowledgements" numbered="no">
        <t>Thanks to Christer Holmberg for raising the need for a 
        BFCP-independent SDP attribute for WebSocket Connection URI.  
        </t>
        <t>The authors wish to acknowledge Paul Kyzivat, Suhas Nandakumar, Christer Holmberg, Charles Eckel, Dan Wing, Alissa Cooper, and Joel Halpern for their invaluable suggestions and review comments.</t> 
        <t>Thanks to Mirja Kuehlewind, Alexey Melnikov, Ben Campbell, and Kathleen Moriarty for their comments and feedback during IESG reviews. </t>
      </section>

  </back>
</rfc>
