MMUSIC                                                     K. Drage, Ed.
Internet-Draft                                               M. Makaraju
Intended status: Standards Track                     J. Stoetzer-Bradler
Expires: July 31, September 10, 2015                               Alcatel-Lucent
                                                                R. Ejzak
                                                               J. Marcon
                                                            Unaffiliated
                                                        January 27,
                                                           March 9, 2015

                   SDP-based "SCTP over DTLS" data channel negotiation
                draft-ietf-mmusic-data-channel-sdpneg-00 Data Channel Negotiation
                draft-ietf-mmusic-data-channel-sdpneg-01

Abstract

   The Real-Time Communication in WEB-browsers (RTCWeb) working group is
   charged to provide protocols to support direct interactive rich
   communications using audio, video, and data between two peers' web-
   browsers.  For the support of data communication, the RTCWeb working
   group has in particular defined the concept of bi-directional data
   channels over SCTP, where each data channel might be used to
   transport other protocols, called sub-protocols.  Data channel setup
   can be done using either the internal in-band band (also referred to
   as 'internal' for the rest of the document) WebRTC Data Channel
   Establishment Protocol or some external out-of-band simply referred
   to as 'external negotiation' in the rest of the document . This
   document specifies how the SDP offer/answer exchange can be used to
   achieve such an external negotiation.  Even though data channels are
   designed for RTCWeb use initially they may be used by other protocols
   like, but not limited to, the CLUE protocol.  This document is
   intended to be used wherever data channels are used.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at http://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on July 31, September 10, 2015.

Copyright Notice

   Copyright (c) 2015 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Conventions . . . . . . . . . . . . . . . . . . . . . . . . .   3
   3.  Terminology . . . . . . . . . . . . . . . . . . . . . . . . .   3
   4.  Data Channels . . . . . . . . . . . . . . . . . . . . . . . .   4
     4.1.  Stream identifier numbering Identifier Numbering . . . . . . . . . . . . . . .   5
     4.2.  Generic external negotiation External Negotiation  . . . . . . . . . . . . . .   6
       4.2.1.  Overview  . . . . . . . . . . . . . . . . . . . . . .   6
       4.2.2.  Opening a data channel Data Channel  . . . . . . . . . . . . . . .   6
       4.2.3.  Closing a data channel Data Channel  . . . . . . . . . . . . . . .   7
   5.  SDP-based external negotiation External Negotiation  . . . . . . . . . . . . . . .   7
     5.1.  SDP syntax Syntax  . . . . . . . . . . . . . . . . . . . . . . .   8
       5.1.1.  SDP attribute Attribute for data channel parameter negotiation Data Channel Parameter Negotiation    8
         5.1.1.1.  dcmap attribute Attribute . . . . . . . . . . . . . . . . .   9   8
         5.1.1.2.  dcmap-stream-id Parameter . . . . . . . . . . . .  10
         5.1.1.3.  label parameter Parameter . . . . . . . . . . . . . . . . .  10
         5.1.1.3.
         5.1.1.4.  subprotocol parameter Parameter . . . . . . . . . . . . . .  11
         5.1.1.4.  10
         5.1.1.5.  max-retr parameter Parameter  . . . . . . . . . . . . . . .  11
         5.1.1.5.  10
         5.1.1.6.  max-time parameter Parameter  . . . . . . . . . . . . . . .  11
         5.1.1.6.  10
         5.1.1.7.  ordered parameter Parameter . . . . . . . . . . . . . . . .  11
       5.1.2.  Sub-protocol specific attributes  Sub-Protocol Specific Attributes  . . . . . . . . . .  12  11
     5.2.  Procedures  . . . . . . . . . . . . . . . . . . . . . . .  13  12
       5.2.1.  Managing stream identifiers Stream Identifiers . . . . . . . . . . . . .  13  12
       5.2.2.  Negotiating Data Channel Parameters . . . . . . . . .  13
       5.2.3.  Opening a data channel Data Channel  . . . . . . . . . . . . . . .  13
       5.2.3.  14
       5.2.4.  Closing a data channel Data Channel  . . . . . . . . . . . . . . .  15
       5.2.4.  16
       5.2.5.  Various SDP offer/answer scenarios Offer/Answer Scenarios and considerations  16 Considerations  17
   6.  Examples  . . . . . . . . . . . . . . . . . . . . . . . . . .  17  18
   7.  Security Considerations . . . . . . . . . . . . . . . . . . .  19  20
   8.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  19  20
   9.  Acknowledgments . . . . . . . . . . . . . . . . . . . . . . .  20  21
   10. CHANGE LOG  . . . . . . . . . . . . . . . . . . . . . . . . .  20  21
     10.1.  Changes against 'draft-ietf-mmusic-data-channel-
            sdpneg-00' . . . . . . . . . . . . . . . . . . . . . . .  21
     10.2.  Changes against 'draft-ejzak-mmusic-data-channel-
            sdpneg-02' . . . . . . . . . . . . . . . . . . . . . . .  20

     10.2.  24
     10.3.  Changes against '-01'  . . . . . . . . . . . . . . . . .  21
     10.3.  25
     10.4.  Changes against '-00'  . . . . . . . . . . . . . . . . .  21  25
   11. References  . . . . . . . . . . . . . . . . . . . . . . . . .  21  25
     11.1.  Normative References . . . . . . . . . . . . . . . . . .  22  25
     11.2.  Informative References . . . . . . . . . . . . . . . . .  22  26
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  23  27

1.  Introduction

   The RTCWeb working group has defined the concept of bi-directional
   data channels running on top of SCTP/DTLS.  RTCWeb leaves it open for
   other applications to use data channels and its in-band or out-of-
   band protocol for creating them.  Each data channel consists of
   paired SCTP streams sharing the same SCTP Stream Identifier.  Data
   channels are created by endpoint applications through the WebRTC API,
   or other users of data channel like CLUE, and can be used to
   transport proprietary or well-defined protocols, which in the latter
   case can be signaled by the data channel "sub-protocol" parameter,
   conceptually similar to the WebSocket "sub-protocol".  However, apart
   from the "sub-protocol" value transmitted to the peer, RTCWeb leaves
   it open how endpoint applications can agree on how to instantiate a
   given sub-protocol on a data channel, and whether it is signaled in-
   band or out-of-band (or both).  In particular, the SDP offer
   generated by the application includes no channel-specific
   information.

   This document defines SDP-based out-of-band negotiation procedures to
   establish data channels for transport of well-defined sub-protocols.

2.  Conventions

   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 [RFC2119].

3.  Terminology

   This document uses the following terms:

      Data channel: A bidirectional WebRTC data channel consisting of paired SCTP
      outbound and inbound streams. as specified in
      [I-D.ietf-rtcweb-data-channel].

      Data channel stack: An entity which, upon application request,
      runs data channel protocol to keep track of states, sending and
      receive data.  If the application is browser based Javascript JavaScript
      application then this stack resides in the browser.  If the
      application is a native application then this stack resides in
      application and accessible to it via some sort of APIs.

      Data channel properties: fixed properties assigned to a data
      channel at the time of its creation.  Some of these properties
      determine the way the data channel stack transmits data on this
      channel (e.g., stream identifier, reliability, order of
      delivery...)
      delivery...).

      DCEP - Data Channel Establishment Protocol defined in
      [I-D.ietf-rtcweb-data-protocol].

      External negotiation: Data channel negotiation based on SDP offer/
      answer outlined in this specification.

      Internal negotiation: Data channel negotiation based on the Data
      Channel Establishment Protocol defined in
      [I-D.ietf-rtcweb-data-protocol].

      In-band: transmission through the peer-to-peer SCTP association.

      In-band negotiation: data channel negotiation based on the Data
      Channel Establishment Protocol defined in
      [I-D.ietf-rtcweb-data-protocol].

      Out-of-band: transmission through the application signaling path.

      Peer: From the perspective of one of the agents in a session, its
      peer is the other agent.  Specifically, from the perspective of
      the SDP offerer, the peer is the SDP answerer.  From the
      perspective of the SDP answerer, the peer is the SDP offerer.

      Stream identifier: the identifier of the outbound and inbound SCTP
      streams composing a data channel.

4.  Data Channels

   This section summarizes how data channels work in general.  Note that
   the references to 'browser' here is intentional as in this specific
   example the data channel user is a webrtc Webrtc enabled browser.

   A WebRTC application creates a data channel via the Data Channel data channel API,
   by providing a number of setup parameters (sub-protocol, label,
   reliability, order of delivery, priority).  The application also
   specifies if it wants to make use of the in-band negotiation using
   the DCEP [I-D.ietf-rtcweb-data-protocol], or if the application
   intends to perform an "external negotiation" using some other in-band
   or out-of-band mechanism.

   In any case, the SDP offer generated by the browser is per
   [I-D.ietf-mmusic-sctp-sdp].  In brief, it contains one m-line "m" line for
   the SCTP association on top of which data channels will run, and one
   attribute per protocol assigned to the SCTP ports:

   OPEN ISSUE: The syntax in [I-D.ietf-mmusic-sctp-sdp] may change as
   that document progresses.  In particular we expect "webrtc-
   datachannel" to become a more general term.

   m=application 54111 UDP/DTLS/SCTP webrtc-datachannel
   c=IN IP4 79.97.215.79
   a=max-message-size:100000
   a=sctp-port 5000
   a=setup:actpass
   a=connection:new
   a=fingerprint:SHA-1 \
       4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB

   Note: A WebRTC browser will only use m-line "m" line format "webrtc-
   datachannel", and will not use other formats in the m-line "m" line for
   other protocols such as t38.  [I-D.ietf-mmusic-sctp-sdp] supports
   only one SCTP association to be established on top of a DTLS session.

   Note: This SDP syntax does not contain any channel-specific
   information.

4.1.  Stream identifier numbering Identifier Numbering

   Independently from the requested type of negotiation, the application
   creating a data channel can either pass to the browser the stream
   identifier to assign to the data channel or else let the browser pick
   one identifier from the ones unused.

   To avoid glare situations, each endpoint can moreover own an
   exclusive set of stream identifiers, in which case an endpoint can
   only create a data channel with a stream identifier it owns.

   Which set of stream identifiers is owned by which endpoint is
   determined by convention or other means.

      For data channels negotiated in-band, one endpoint owns by
      convention the even stream identifiers, whereas the other owns the
      odd stream identifiers, as defined in
      [I-D.ietf-rtcweb-data-protocol].

      For data channels externally negotiated, no convention is defined
      by default.

4.2.  Generic external negotiation External Negotiation

4.2.1.  Overview

   In-band negotiation only provides for negotiation of data channel
   transport parameters and does not provide for negotiation of sub-
   protocol specific parameters.  External negotiation can be defined to
   allow negotiation of parameters beyond those handled by in-band
   negotiation, e.g., parameters specific to the sub-protocol
   instantiated on a particular data channel.  See Section 5.1.2 for an
   example of such a parameter.

   The following procedures are common to all methods of external
   negotiation, whether in-band (communicated using proprietary means on
   an already established data channel) or out-of-band (using SDP or
   some other protocol associated with the signaling channel).

4.2.2.  Opening a data channel Data Channel

   In the case of external negotiation, the endpoint application has the
   option to fully control the stream identifier assignments.  However
   these assignments have to coexist with the assignments controlled by
   the data channel stack for the in-band negotiated data channels (if
   any).  It is the responsibility of the application to ensure
   consistent assignment of stream identifiers.

   When the application requests the creation of a new data channel to
   be set up via external negotiation, the data channel stack creates
   the data channel locally without sending any DATA CHANNEL OPEN DATA_CHANNEL_OPEN
   message in-band, and sets the data channel state to Connecting if the
   SCTP association is not yet established, or sets the data channel
   state to Open if the SCTP association is already established.  The
   side which starts external negotiation creates data channel using
   underlying data channel stack API and the data channel is put into
   open state immediately (assuming ICE, SCTP procedures were already
   done).  However, the application can't send data on this data channel
   until external negotiation is complete with the peer.  This is
   because peer needs to be aware and accept the data channel via
   external negotiation.  The peer after accepting the data channel
   offer can start sending data immediately.  This implies that the
   offerer may get data channel message before external negotiation is
   complete and the application should be ready to handle it.

   If the peer rejects the data channel part of the offer then it
   doesn't have to do anything as the data channel was not created using
   the stack.  The offerer on the other hand needs to close the data
   channel that was opened by invoking relevant data channel stack API
   procedures.

   It is also worth noting that a data channel stack implementation may
   not provide any API to create and close data channels; instead the
   data channels are used on the fly as needed just by communicating via
   external means or by even having some local configuration/assumptions
   on both the peers.

   The application then externally negotiates the data channel
   properties and sub-protocol properties with the peer's application.

   [ASSUMPTION] The peer must then symmetrically create a data channel
   with these negotiated data channel properties.  This is the only way
   for the peer's data channel stack to know which properties to apply
   when transmitting data on this channel.  The data channel stack must
   allow data channel creation with any non-conflicting stream
   identifier so that both peers can create the data channel with the
   same stream identifier.

   In case the external negotiation is correlated with an SDP offer/
   answer exchange that establishes the SCTP association, the SCTP
   initialization completion triggers a callback from the data channel
   stack to an application on both the ends to change the data channel
   state from Connecting to Open.  The details of this interface is
   specific to the data channel user application.  Browser based
   applications (could include hybrid apps) will use [WebRtcAPI], while
   native applications use a compatible API, which is yet to be
   specified.  See Section 5.2.2 5.2.3 for details on when the data channel
   stack can assume the data channel is open, and on when the
   application can assume the data channel is open.

4.2.3.  Closing a data channel Data Channel

   When the application requests the closing of an externally negotiated
   data channel, the data channel stack always performs an in-band SSN
   reset for this channel.

   Depending upon the method used for external negotiation and the sub-
   protocol associated with the data channel, the closing might in
   addition be signaled to the peer via external negotiation.

5.  SDP-based external negotiation External Negotiation

   This section defines a method of external negotiation by which two
   clients can negotiate data channel-specific and sub-protocol-specific
   parameters, using the out-of-band SDP offer/answer exchange.  This
   SDP extension can only be used with SDP offer/answer model.

5.1.  SDP syntax Syntax

   Two new SDP attributes are defined to support external negotiation of
   data channels.  The first attribute provides for negotiation of
   channel-specific parameters.  The second attribute provides for
   negotiation of sub-protocol-specific parameters.

5.1.1.  SDP attribute Attribute for data channel parameter negotiation Data Channel Parameter Negotiation

   Associated with the SDP "m" line that defines the SCTP association
   for data channels (defined in Section 4), each SDP offer and answer
   includes an one "a=dcmap:" attribute line that defines the data channel
   parameters for each data channel to be negotiated.  Each such
   attribute line specifies the following parameters for a data channel: Stream
   Identifier,
   SCTP stream identifier, sub-protocol, label, reliability, order of
   delivery, and priority.  Conveying a reliable data channel

   The intention of exchanging these attributes is to create data
   channels on both the peers with the same set of attributes without
   actually using [I-D.ietf-rtcweb-data-protocol].  It is assumed that
   the data channel properties (reliable/partially reliable, ordered/
   unordered) are suitable per the sub-protocol transport requirements.

5.1.1.1.  dcmap Attribute

   "a=dcmap:" is achieved by including
   neither 'max-retr' nor 'max-time'.  Conveying a partially reliable media level attribute having following ABNF syntax.

   Formal Syntax:

   Name: dcmap

   Value: dcmap-value

   Usage Level: media

   Charset Dependent: no

   Syntax:

   dcmap-value     = dcmap-stream-id
                     [ SP dcmap-opt *(";" dcmap-opt) ]
   dcmap-opt       = ordering-opt / subprotocol-opt / label-opt
                     / maxretr-opt / maxtime-opt
                     ; Either only maxretr-opt or maxtime-opt
                     ; is present.
                     ; Both MUST not be present.

   dcmap-stream-id = 1*DIGIT
   ordering-opt    = "ordered=" ordering-value
   ordering-value  = "true" / "false"
   subprotocol-opt = "subprotocol=" quoted-string
   label-opt       = "label=" quoted-string
   maxretr-opt     = "max-retr=" maxretr-value
   maxretr-value   = <from-Reliability-Parameter of
                      I-D.ietf-rtcweb-data-protocol>
                     ; number of retransmissions
   maxtime-opt     = "max-time=" maxtime-value
   maxtime-value   = <from-Reliability-Parameter of
                     I-D.ietf-rtcweb-data-protocol>
                     ; milliseconds

   quoted-string   = DQUOTE *(quoted-char / escaped-char) DQUOTE
   quoted-char     = SP / quoted-visible
   quoted-visible  = %21 / %23-24 / %26-7E ; VCHAR without " or %
   escaped-char    = "%" HEXDIG HEXDIG
   DQUOTE          = <from-RFC5234>
   integer         = <from-RFC5234>

   Examples:

   a=dcmap:0
   a=dcmap:1 subprotocol="BFCP";max-time=60000
   a=dcmap:2 subprotocol="MSRP";ordered=true;label="MSRP"
   a=dcmap:3 label="Label 1";ordered=false;max-retr=5
   a=dcmap:4 label="foo%09bar";ordered=true;max-time=15000;max-retr=3
      Note: The last example (a=dcmap:4) shows a 'label' parameter value
      which contains one non-printable 'escaped-char' character (the
      tabulator character).

5.1.1.2.  dcmap-stream-id Parameter

   The 'dcmap-stream-id' parameter indicates the SCTP stream identifier
   within the SCTP association used to form the data channel.

5.1.1.3.  label Parameter

   The 'label' parameter indicates the name of the channel.  It
   represents a label that can be used to distinguish, in the context of
   the WebRTC API, an RTCDataChannel object from other RTCDataChannel
   objects.  This parameter maps to the 'Label' parameter defined in
   [I-D.ietf-rtcweb-data-protocol].  The 'label' parameter is optional.
   If it is not present, then its value defaults to the empty string.

   Note: The empty string may also be explicitly used as 'label' value,
   such that 'label=""' is equivalent to the 'label' parameter not being
   present at all.  [I-D.ietf-rtcweb-data-protocol] allows the
   DATA_CHANNEL_OPEN message's 'Label' value to be an empty string.

5.1.1.4.  subprotocol Parameter

   The 'subprotocol' parameter indicates which protocol the client
   expects to exchange via the channel.  'Subprotocol' is an optional
   parameter.  If the 'subprotocol' parameter is not present, then its
   value defaults to the empty string.

5.1.1.5.  max-retr Parameter

   This parameter indicates that the data channel is achieved by including only one of partially reliable.
   The 'max-retr' or 'max-
   time'.  By definition parameter indicates the max times a user message will
   be retransmitted.  The max-retr and max-time are mutually exclusive,
   so only one parameter is optional.  If the max-
   retr parameter is not present, then the maximal number of them can be present
   retransmissions is determined as per the generic SCTP retransmission
   rules as specified in a=dcmap.  If an SDP offer
   contains both [RFC4960].  This parameter maps to the 'Number
   of these parameters then such an SDP offer RTX' parameter defined in [I-D.ietf-rtcweb-data-protocol].

5.1.1.6.  max-time Parameter

   This parameter indicates that the data channel is partially reliable.
   A user message will no longer be
   rejected. transmitted or retransmitted after a
   specified life-time given in milliseconds in the 'max-time'
   parameter.  The max-time parameter is optional.  If an SDP answer contains both of these parameters the max-time
   parameter is not present, then the offerer may treat it generic SCTP retransmission timing
   rules apply as an error specified in [RFC4960].  This parameter maps to the
   'Lifetime in ms' parameter defined in
   [I-D.ietf-rtcweb-data-protocol].

5.1.1.7.  ordered Parameter

   The 'ordered' parameter with value "true" indicates that DATA chunks
   in the channel MUST be dispatched to the upper layer by the receiver
   while preserving the order.  The ordered parameter is optional and may assume
   takes two values: "true" for ordered and "false" for unordered
   delivery with "true" as the default value.  Any other value is
   ignored and default "ordered=true" is assumed.  In the absence of
   this parameter "ordered=true" is assumed.  This parameter maps to the
   ordered or unordered data channel types as defined in
   [I-D.ietf-rtcweb-data-protocol].

5.1.2.  Sub-Protocol Specific Attributes

   In the associated SDP, each data channel declaration MAY also be followed by
   other SDP offer/answer failed attributes specific to the sub-protocol in use.  Each of
   these attributes is represented by one new attribute line, and may take appropriate recovery actions.
   These recovery options are outside it
   includes the scope contents of a media-level SDP attribute already defined
   for use with this (sub)protocol in another IETF specification.
   Following  Sub-
   protocol-specific attributes might also be defined for exclusive use
   with data channel transport, but should use the same syntax described
   here for other sub-protocol-specific attributes.

   Each sub-protocol specific SDP attribute that would normally be used
   to negotiate the subprotocol using SDP is replaced with an example attribute
   of the attribute line form "a=dcsa:stream-id original-attribute", where dcsa stands
   for "data channel sub-protocol "BFCP"
   and attribute", stream-id is the SCTP
   stream id "2":

   a=dcmap:2 subprotocol="BFCP";label="channel 2"

   The SDP answer shall echo identifier assigned to this sub-protocol instance, and
   original-attribute represents the same subprotocol, max-retr, max-time,
   ordered parameters, if those were present in contents of the offer, and may
   include a label parameter.  They may appear sub-protocol
   related attribute to be included.

   Formal Syntax:

   Name: dcsa

   Value: dcsa-value

   Usage Level: media

   Charset Dependent: no

   Syntax:

   dcsa-value      = stream-id SP attribute
   attribute       = <from-RFC4566>

   Example:

   a=dcsa:2 accept-types:text/plain

   Thus in any order, the example above, the original attribute line "a=accept-
   types:text/plain" is represented by the attribute line "a=dcsa:2
   accept-types:text/plain", which could
   be different from specifies that this instance of MSRP
   being transported on the SDP offer, in sctp association using the SDP answer.

   The same information MUST be replicated without changes in any
   subsequent offer or answer, as long as data channel with
   stream id 2 accepts plain text files.

   As opposed to the data channel is still
   opened at the time of offer or answer generation.

      Note: This attribute is derived from "a=dcmap:" attribute "webrtc-
      DataChannel", which was parameters, these
   parameters are subject to offer/answer negotiation following the
   procedures defined in old version 03 of the following
      draft, but which was removed along with sub-protocol specific documents.

   The same syntax applies to any support for other SDP
      external attribute required for
   negotiation in subsequent versions:
      [I-D.ietf-mmusic-sctp-sdp]. of this instance of the sub-protocol.

   Note: This document does not provide a complete specification of how
   to negotiate the use of a data channel to transport BFCP. MSRP.  Procedures
   specific to each sub-protocol such as BFCP MSRP will be documented
   elsewhere.  The use of BFCP MSRP is only an example of how the generic
   procedures described herein might apply to a specific sub-protocol.

   The intention of exchanging these attributes is to create data
   channels on both the peers with the same set of attributes without
   actually using [I-D.ietf-rtcweb-data-protocol].  It is assumed that
   the data channel properties (reliable/partially reliable, ordered/
   unordered) are suitable per the sub-protocol transport requirements.
   Data channel types defined in [I-D.ietf-rtcweb-data-protocol] are
   mapped to SDP in the following manner:

   DATA_CHANNEL_RELIABLE
         a=dcmap:2 subprotocol="BFCP";label="channel 2"

   DATA_CHANNEL_RELIABLE_UNORDERED
         a=dcmap:2 subprotocol="BFCP";label="channel 2";\
                   ordered=0

   DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT
         a=dcmap:2 subprotocol="BFCP";label="channel 2";\
                   max-retr=3

   DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT_UNORDERED
         a=dcmap:2 subprotocol="BFCP";label="channel 2";\
                   max-retr=3;ordered=0;

   DATA_CHANNEL_PARTIAL_RELIABLE_TIMED
         a=dcmap:2 subprotocol="BFCP";label="channel 2";\
                   max-time=10000;

   DATA_CHANNEL_PARTIAL_RELIABLE_TIMED_UNORDERED
         a=dcmap:2 subprotocol="BFCP";label="channel 2";\
                   max-time=10000; ordered=0

5.1.1.1.  dcmap attribute

   The 'stream' parameter indicates the actual stream identifier within
   the association used to form the channel.

5.2.  Procedures

5.2.1.  Managing Stream is a mandatory
   parameter and is noted directly after the "a=dcmap:" attribute's
   colon.

   Formal Syntax:
   TBD: Should this be moved to Identifiers

   If an SDP grammar section?

   Name: dcmap

   Value: dcmap-value
   Usage Level: media

   Charset Dependent: no

   Syntax:

   dcmap-value     = dcmap-stream-id
                     [ SP dcmap-opt *(";" dcmap-opt) ]
   dcmap-opt       = ordering-opt / subprotocol-opt / label-opt
                     / maxretr-opt offer / maxtime-opt
                     ; Either only maxretr-opt or maxtime-opt
                     ; is present.
                     ; Both MUST not answer exchange (could be present.

   dcmap-stream-id = 1*DIGIT
   ordering-opt    = "ordered=" ordering-value
   ordering-value  = "0"/"1"
   subprotocol-opt = "subprotocol=" quoted-string
   label-opt       = "label=" quoted-string
   maxretr-opt     = "max-retr=" maxretr-value
   maxretr-value   = <from-Reliability-Parameter the initial or a
   subsequent one) results in a UDP/DTLS/SCTP or TCP/DTLS/SCTP based
   media description being accepted, and if this SDP offer / answer
   exchange results in the establishment of
                      I-D.ietf-rtcweb-data-protocol>
                     ; a new SCTP association, then
   the SDP offerer owns the even SCTP stream ids of this new SCTP
   association and the answerer owns the odd SCTP stream identifiers.

   If this "m" line is removed from the signaling session (its port
   number set to zero), and if usage of retransmissions
   maxtime-opt     = "max-time=" maxtime-value
   maxtime-value   = <from-Reliability-Parameter this or of
                     I-D.ietf-rtcweb-data-protocol>
                     ; milliseconds

   quoted-string   = DQUOTE *(quoted-char / escaped-char) DQUOTE
   quoted-char     = SP / quoted-visible
   quoted-visible  = %21 / %23-24 / %26-7E ; VCHAR without " a new UDP/DTLS/SCTP
   or %
   escaped         = "%" HEXDIG HEXDIG
   DQUOTE          = <from-RFC5234>
   integer         = <from-RFC5234>

   Examples:

   a=dcmap:0
   a=dcmap:1 subprotocol="BFCP";max-time=60000
   a=dcmap:2 subprotocol="MSRP";ordered;label="MSRP"
   a=dcmap:3 label="Label 1";unordered;max-retr=5
   a=dcmap:4 label="foo%09bar";ordered;max-time=15000;max-retr=3

5.1.1.2.  label parameter

   The 'label' parameter indicates TCP/DTLS/SCTP based "m" line is renegotiated later on, then the name
   even and odd SCTP stream identifier ownership is redetermined as well
   as described above.

   This specification allows simultaneous use of the channel.  It
   represents external and internal
   negotiation.  However, a label single stream is managed using one method at
   a time.  Stream ids that are not currently used in SDP can be used
   for internal negotiation.  Stream id allocation per SDP based
   external negotiation may not align with DTLS role based allocation.
   This could cause glare conditions when one side trying to distinguish, in the context of
   the WebRTC API, an RTCDataChannel object from do external
   negotiation on a stream id while the other RTCDataChannel
   objects.  This parameter maps end trying to open a data
   channel on the 'Label' parameter defined in
   [I-D.ietf-rtcweb-data-protocol].  The 'label' parameter same stream id using internal negotiation.  To avoid
   these glare conditions this specification recommends that the data
   channel stack user always selects stream ids per above described SDP
   offer / answer rule even when internal negotiation is optional.
   If used.  To avoid
   glare conditions, it is not present, then its value defaults possible to the empty string.

   Note: The empty string may also be explicitly used as 'label' value, come up with a different stream
   id allocation scheme, but such that 'label=""' is equivalent to the 'label' parameter not being
   present at all.  [I-D.ietf-rtcweb-data-protocol] allows schemes are outside the
   DATA_CHANNEL_OPEN message's 'Label' value to scope of this
   specification.

5.2.2.  Negotiating Data Channel Parameters

   Conveying a reliable data channel is achieved by including neither
   'max-retr' nor 'max-time' in corresponding SDP offer's or answer's
   a=dcmap attribute line.  Conveying a partially reliable data channel
   is achieved by including only one of 'max-retr' or 'max-time'.  By
   definition max-retr and max-time are mutually exclusive, so only one
   of them can be present in a=dcmap.  If an empty string.

5.1.1.3.  subprotocol parameter

   The 'subprotocol' parameter indicates which protocol the client
   expects to exchange via the channel.  'Subprotocol' is SDP offer contains both of
   these parameters then such an optional
   parameter. SDP offer will be rejected.  If the 'subprotocol' parameter is not present, an SDP
   answer contains both of these parameters then its
   value defaults to the empty string.

5.1.1.4.  max-retr parameter

   This parameter indicates that offerer may treat
   it as an error and may assume the data channel is partially reliable.
   The 'max-retr' parameter indicates associated SDP offer/answer failed
   and may take appropriate recovery actions.  These recovery options
   are outside the max times a user message will
   be retransmitted. scope of this specification.

   The max-retr parameter is optional.  If SDP answer shall echo the max-
   retr parameter is not present, then same subprotocol, max-retr, max-time,
   ordered parameters, if those were present in the maximal number of
   retransmissions is determined as per offer, and may
   include a label parameter.  They may appear in any order, which could
   be different from the generic SCTP retransmission
   rules as specified SDP offer, in [RFC4960].  This parameter maps to the 'Number
   of RTX' parameter defined SDP answer.

   The same information MUST be replicated without changes in [I-D.ietf-rtcweb-data-protocol].

5.1.1.5.  max-time parameter

   This parameter indicates that any
   subsequent offer or answer, as long as the data channel is partially reliable.
   A user messages will no longer be transmitted still
   opened at the time of offer or retransmitted after
   a specified life-time given answer generation.

   Data channel types defined in milliseconds [I-D.ietf-rtcweb-data-protocol] are
   mapped to SDP in the 'max-time'
   parameter. following manner:

   DATA_CHANNEL_RELIABLE
         a=dcmap:2 subprotocol="BFCP";label="channel 2"

   DATA_CHANNEL_RELIABLE_UNORDERED
         a=dcmap:2 subprotocol="BFCP";label="channel 2";\
                   ordered=0

   DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT
         a=dcmap:2 subprotocol="BFCP";label="channel 2";\
                   max-retr=3

   DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT_UNORDERED
         a=dcmap:2 subprotocol="BFCP";label="channel 2";\
                   max-retr=3;ordered=0;

   DATA_CHANNEL_PARTIAL_RELIABLE_TIMED
         a=dcmap:2 subprotocol="BFCP";label="channel 2";\
                   max-time=10000;

   DATA_CHANNEL_PARTIAL_RELIABLE_TIMED_UNORDERED
         a=dcmap:2 subprotocol="BFCP";label="channel 2";\
                   max-time=10000; ordered=0

5.2.3.  Opening a Data Channel

   The max-time parameter is optional.  If the max-time
   parameter is not present, then procedure for opening a data channel using external negotiation
   starts with the generic SCTP retransmission timing
   rules apply as specified in [RFC4960].  This parameter maps agent preparing to send an SDP offer.  If a peer
   receives an SDP offer before getting to the
   'Lifetime in ms' parameter defined in
   [I-D.ietf-rtcweb-data-protocol].

5.1.1.6.  ordered parameter

   The ordered' parameter indicates send a new SDP offer with
   data channels that DATA chunks are to be externally negotiated, or loses an SDP
   offer glare resolution procedure in this case, it must wait until the channel MUST
   be dispatched
   ongoing SDP offer/answer completes before resuming the external
   negotiation procedure.

   The agent that intends to send an SDP offer to create data channels
   through SDP-based external negotiation performs the upper layer by following:

   o  Creates data channels using stream identifiers from the receiver while preserving owned set
      (see Section 5.2.1).

   o  As described in Section 4.2.2, if the
   order.  The ordered parameter SCTP association is optional and takes two values: "0"
   for ordered and "1" for ordered delivery with "1" as not yet
      established, then the default
   value.  Any other value is ignored and default ordered is assumed.
   If newly created data channels are in the ordered parameter is absent,
      Connecting state, else if the receiver SCTP association is required to
   deliver DATA chunks to the upper layer in proper order.  This
   parameter maps to already
      established, then the ordered or unorderd newly created data channel types as
   defined channels are in [I-D.ietf-rtcweb-data-protocol].

5.1.2.  Sub-protocol specific attributes

   In the SDP, each data channel declaration MAY also be followed by
   other Open
      state.

   o  Generates a new SDP attributes specific to offer.  In the sub-protocol in use.  Each case of
   these attributes is represented by one new attribute line, and it
   includes the contents of a media-level browser based
      applications the browser generates the offer via the createOffer()
      API call [I-D.ietf-rtcweb-jsep].

   o  Determines the list of stream identifiers assigned to data
      channels opened through external negotiation.

   o  Completes the SDP attribute already defined
   for use offer with this (sub)protocol in another IETF specification.  Sub-
   protocol-specific the dcmap and dcsa attributes might also be defined needed,
      if any, for exclusive use
   with each externally-negotiated data channel transport, but should use the same syntax channel, as described
   here for other sub-protocol-specific attributes.

   Each sub-protocol specific SDP attribute that would normally be used
   to negotiate
      in Section 5.1 and in Section 5.2.2.

   o  Sends the subprotocol using SDP is replaced with offer.

   The peer receiving such an attribute
   of the form "a=dcsa: stream-id original-attribute", where dcsa stands
   for "data channel sub-protocol attribute", stream-id is SDP offer performs the sctp
   stream identifier assigned to this sub-protocol instance, following:

   o  Parses and
   original-attribute represents applies the contents of SDP offer.  Note that the sub-protocol typical parser
      normally ignores unknown SDP attributes, which includes data
      channel related attribute attributes.

   o  Analyzes the channel parameters and sub-protocol attributes to be included.

   Formal Syntax:

   Name: dcsa

   Value: dcsa-value

   Usage Level: media

   Charset Dependent: no

   Syntax:

   dcsa-value      = stream-id SP attribute
   attribute       = <from-RFC4566>

   Examples:

   a=dcsa:2 accept-types:text/plain

   Thus in
      determine whether to accept each offered data channel.

   o  For accepted data channels, it creates peer instances for the example above, data
      channels with the original attribute line "a=accept-
   types:text/plain" is represented by agent using the attribute line "a=dcsa:2
   accept-types:text/plain", which specifies that this instance of MSRP
   being transported on channel parameters described in
      the sctp association using SDP offer.  Note that the agent is asked to create data channel
      channels with SCTP stream id 2 accepts plain text files.  The above example creates a
   reliable, ordered data channel. identifiers contained in the SDP offer
      if the SDP offer is accepted.

   o  As opposed to described in Section 4.2.2, if the SCTP association is not yet
      established, then the newly created data channel setup parameters, these parameters channels are
   subject to offer/answer negotiation following in the procedures defined
      Connecting state, else if the SCTP association is already
      established, then the newly created data channels are in the sub-protocol specific documents.

   The same syntax applies to any other Open
      state.

   o  Generates an SDP attribute required for
   negotiation of this instance of answer.

   o  Completes the sub-protocol.

   Note: This document does not provide a complete specification of how
   to negotiate SDP answer with the use of a data channel to transport MSRP.  Procedures
   specific to dcmap and optional dcsa
      attributes needed for each sub-protocol such externally-negotiated data channel, as MSRP will be documented
   elsewhere.
      described in Section 5.1 and in Section 5.2.2.

   o  Sends the SDP answer.

   The use of MSRP is only agent receiving such an example of how SDP answer performs the generic
   procedures described herein might apply to a specific sub-protocol.

5.2.  Procedures

5.2.1.  Managing stream identifiers

   For following:

   o  Closes any created data channels (whether in Connecting or Open
      state) for which the SDP-based external negotiation described expected dcmap and dcsa attributes are not
      present in this document, the initial offerer based "SCTP over DTLS" owns by convention SDP answer.

   o  Applies the
   even stream identifiers whereas SDP answer.

   Any data channels in Connecting state are transitioned to the initial answerer owns Open
   state when the odd
   stream identifiers.  This ownership SCTP association is invariant for the whole
   lifetime of the signaling session, e.g. established.

   Each agent application MUST wait to send data until it does not change if has
   confirmation that the
   initial answerer sends a new offer to data channel at the initial offerer. peer is in the Open state.
   For WebRTC, this is when both data channel stacks have channel
   parameters instantiated.  This specification allows simultaneous use of external and internal
   negotiation.  However, occurs:

   o  At both peers when a single stream data channel is managed using one method at
   a time.  Stream ids created without an
      established SCTP association, as soon as the data channel stacks
      report that are not currently used in the data channel transitions to the Open state from
      the Connecting state.

   o  At the agent receiving an SDP can be used offer for internal negotiation.  Stream id allocation per SDP based
   external negotiation may not align with DTLS role which there is an
      established SCTP association, as soon as it creates an externally
      negotiated data channel in the Open state based allocation.
   This could cause glare conditions when one side trying to do external
   negotiation on a stream id while information
      signaled in the other end trying SDP offer.

   o  At the agent sending an SDP offer to open create a new externally
      negotiated data channel on for which there is an established SCTP
      association, when it receives the same stream id using internal negotiation.  To avoid
   these glare conditions this specification recommends that SDP answer confirming acceptance
      of the data channel stack user always selects stream ids per SDP offer/answer
   rule even or when internal negotiation is used.  To avoid glare
   conditions, it is possible begins to come up with receive data on the data
      channel from the peer, whichever occurs first.

5.2.4.  Closing a different stream id
   allocation scheme, but such schemes are outside Data Channel

   When the scope application requests the closing of this
   specification.

5.2.2.  Opening a data channel

   The procedure for opening a that was
   externally negotiated, the data channel using external negotiation
   starts with stack always performs an in-
   band SSN reset for this channel.

   It is specific to the agent preparing sub-protocol whether this closing must in
   addition be signaled to send an SDP offer.  If a the peer
   receives an via a new SDP offer before getting offer/answer exchange.

   The intention to send close a data channel can be signaled by sending a
   new SDP offer with which excludes the "a=dcmap:" and "a=dcsa:" attribute
   lines for the data channel.  The port value for the "m" line SHOULD
   not be changed (e.g., to zero) when closing a data channel (unless
   all data channels that are to be externally negotiated, or loses an SDP
   offer glare resolution procedure in being closed and the SCTP association is no
   longer needed), since this case, it must wait until would close the
   ongoing SDP offer/answer completes before resuming SCTP association and
   impact all of the data channels.  If the answerer accepts the external
   negotiation procedure.

   The agent that intends to send an SDP
   offer to create then it MUST close those data channels
   through SDP-based external negotiation performs whose "a=dcmap:" and
   "a=dcsa:" attribute lines were excluded from the following:

   o  Creates received SDP offer,
   unless those data channels using stream identifiers from were already closed, and it MUST also
   exclude the owned set
      (see Section 5.2.1).

   o  As described corresponding attribute lines in Section 4.2.2, if the SCTP association is answer.  In addition
   to that, the SDP answerer MAY exclude other data channels which were
   closed but not yet
      established, then communicated to the newly created peer.  So, the offerer MUST
   inspect the answer to see if it has to close other data channels
   which are now not included in the
      Connecting state, else if the SCTP association answer.

   If a new SDP offer/answer is already
      established, used to close data channels then the newly created
   data channels are in channel(s) SHOULD only be closed by the Open
      state.

   o  Generates answerer/offerer after a new
   successful SDP offer.  In the answer is sent/received.

      This delayed closure is RECOMMENDED in order to handle cases where
      a successful SDP answer is not received, in which case of the browser based
      applications the browser generates the offer via state
      of the createOffer()
      API call [I-D.ietf-rtcweb-jsep].

   o  Determines session SHOULD be kept per the list of stream identifiers assigned to last successful SDP offer/
      answer.

   If a client receives a data
      channels opened through external negotiation.

   o  Completes the channel close indication (due to inband
   SSN reset or some other reason) without associated SDP offer with the dcmap and dcsa attributes needed,
      if any, for each externally-negotiated then an
   SDP offer which excludes this closed data channel, as described
      in Section 5.1.

   o  Sends channel SHOULD be
   generated.

   The application must also close any data channel that was externally
   negotiated, for which the stream identifiers are not listed in an
   incoming SDP offer.

   The peer receiving such

   A closed data channel using local close (SCTP reset), without an
   additional SDP offer performs the following:

   o  Applies the offer/answer to close it, may be reused for a new data
   channel.  This can only be done via new SDP offer.  Note that offer/answer, describing
   the new sub-protocol and its attributes, only after the browser ignores corresponding
   data channel
      specific attributes in the SDP.

   o  Analyzes close acknowledgement is received from the channel parameters peer (i.e.
   SCTP reset of both incoming and sub-protocol attributes to
      determine whether outgoing streams is completed).  This
   restriction is to accept each offered data channel.

   o  For accepted data channels, creates peer instances for avoid the data
      channels race conditions between arrival of "SDP
   offer which reuses stream" with "SCTP reset which closes outgoing
   stream" at the browser using the peer

5.2.5.  Various SDP Offer/Answer Scenarios and Considerations

      SDP offer has no a=dcmap attributes

      *  Initial SDP offer: No data channel parameters described
      in the negotiated yet.

      *  Subsequent SDP offer.  Note that offer: All the browser is asked to create externally negotiated data
         channels with stream identifiers not "owned" by the agent.

   o  As described in Section 4.2.2, if the SCTP must be closed now.  The DTLS/SCTP association is remains
         open for external or internal negotiation of data channels.

      SDP answer has no a=dcmap attributes

      *  Initial SDP answer: Either the peer does not yet
      established, then support dcmap
         attributes or it rejected all the newly created data channels are in channels.  In either
         case offerer closes all the
      Connecting state, else if externally negotiated data channels
         that were open at the SCTP time of initial offer.  The DTLS/SCTP
         association is already
      established, then will still be setup.

      *  Sub-sequent SDP answer: All the newly created externally negotiated data
         channels must be closed now.  The DTLS/SCTP association remains
         open for future external or internal negotiation of data
         channels.

      SDP offer has no a=dcsa attributes for a data channel.

      *  This is allowed and indicates there are in the Open
      state.

   o  Generates an SDP answer.

   o  Completes the no sub-protocol
         parameters to convey.

      SDP answer with the dcmap and optional dcsa has no a=dcsa attributes needed for each externally-negotiated a data channel, as
      described channel.

      *  This is allowed and indicates there are no sub-protocol
         parameters to convey in Section 5.1.

   o  Sends the SDP answer.  The agent receiving such an number of dcsa
         attributes in the SDP answer performs the following:

   o  Closes any created data channels (whether in Connecting or Open
      state) for which does not have to match the expected dcmap and number
         of dcsa attributes are not
      present in the SDP answer.

   o  Applies offer.

6.  Examples

   SDP offer:
     m=application 10001 UDP/DTLS/SCTP webrtc-datachannel
     c=IN IP4 10.10.10.1
     a=max-message-size:100000
     a=sctp-port 5000
     a=setup:actpass
     a=connection:new
     a=fingerprint:SHA-1 \
         4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB
     a=dcmap:0 subprotocol="BFCP";label="BFCP"

   SDP answer:
     m=application 10002 UDP/DTLS/SCTP webrtc-datachannel
     c=IN IP4 10.10.10.2
     a=max-message-size:100000
     a=sctp-port 5002
     a=setup:passive
     a=connection:new
     a=fingerprint:SHA-1 \
         5B:AD:67:B1:3E:82:AC:3B:90:02:B1:DF:12:5D:CA:6B:3F:E5:54:FA

                            Figure 1: Example 1

   In the above example the SDP answer.

   Any answerer rejected the data channels in Connecting state are transitioned to channel with
   stream id 0 either for explicit reasons or because it does not
   understand the Open
   state when a=dcmap attribute.  As a result the offerer will close
   the data channel created with the external negotiation option.  The
   SCTP association is established.

   Each agent application MUST wait will still be setup over DTLS.  At this point the
   offerer or the answerer may use internal negotiation to send open data until it has
   confirmation that
   channels.

   SDP offer:
     m=application 10001 UDP/DTLS/SCTP webrtc-datachannel
     c=IN IP4 10.10.10.1
     a=max-message-size:100000
     a=sctp-port 5000
     a=setup:actpass
     a=connection:new
     a=fingerprint:SHA-1 \
         4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB
     a=dcmap:0 subprotocol="BFCP";label="BFCP"
     a=dcmap:2 subprotocol="MSRP";label="MSRP"
     a=dcsa:2 accept-types:message/cpim text/plain text/
     a=dcsa:2 path:msrp://alice.example.com:10001/2s93i93idj;dc

   SDP answer:
     m=application 10002 UDP/DTLS/SCTP webrtc-datachannel
     c=IN IP4 10.10.10.2
     a=max-message-size:100000
     a=sctp-port 5002
     a=setup:passive
     a=connection:new
     a=fingerprint:SHA-1 \
         5B:AD:67:B1:3E:82:AC:3B:90:02:B1:DF:12:5D:CA:6B:3F:E5:54:FA
     a=dcmap:2 subprotocol="MSRP";label="MSRP"
     a=dcsa:2 accept-types:message/cpim text/plain
     a=dcsa:2 path:msrp://bob.example.com:10002/si438dsaodes;dc

                            Figure 2: Example 2

   In the above example SDP offer contains data channel at channels for BFCP and
   MSRP sub-protocols.  SDP answer rejected BFCP and accepted MSRP.  So,
   the peer is in offerer should close the Open state.
   For webrtc, this is when both data channel stacks have channel
   parameters instantiated.  This occurs:

   o  At for BFCP and both peers when a offerer
   and answerer may start using MSRP data channel (after SCTP/DTLS
   association is created without an
      established SCTP association, as soon as the data channel stacks
      report that the setup).  The data channel transitions to the Open state from
      the Connecting state.

   o  At the agent receiving an SDP offer for which there with stream id 0 is an
      established SCTP association, as soon as it creates an externally
      negotiated data channel in the Open state based free and
   can be used for future internal or external negotiation.

   Continuing on information
      signaled in the earlier example in Figure 1.

   Subsequent SDP offer.

   o  At the agent sending an offer:
     m=application 10001 UDP/DTLS/SCTP webrtc-datachannel
     c=IN IP4 10.10.10.1
     a=max-message-size:100000
     a=sctp-port 5000
     a=setup:actpass
     a=connection:existing
     a=fingerprint:SHA-1 \
         4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB
     a=dcmap:4 subprotocol="MSRP";label="MSRP"
     a=dcsa:4 accept-types:message/cpim text/plain
     a=dcsa:4 path:msrp://alice.example.com:10001/2s93i93idj;dc

   Subsequent SDP offer to create a new externally
      negotiated data channel for which there answer:
     m=application 10002 UDP/DTLS/SCTP webrtc-datachannel
     c=IN IP4 10.10.10.2
     a=max-message-size:100000
     a=sctp-port 5002
     a=setup:passive
     a=connection:existing
     a=fingerprint:SHA-1 \
         5B:AD:67:B1:3E:82:AC:3B:90:02:B1:DF:12:5D:CA:6B:3F:E5:54:FA
     a=dcmap:4 subprotocol="MSRP";label="MSRP"
     a=dcsa:4 accept-types:message/cpim text/plain
     a=dcsa:4 path:msrp://bob.example.com:10002/si438dsaodes;dc

                            Figure 3: Example 3

   The above example is an established SCTP
      association, when it receives a continuation of the example in Figure 1.  The
   SDP answer confirming acceptance
      of offer now removes the MSRP data channel or when it begins to receive data on the with stream id 2, but
   opens a new MSRP data channel from with stream id 4.  The answerer
   accepted the peer, whichever occurs first.

5.2.3.  Closing entire offer.  As a result the offerer closes the
   earlier negotiated MSRP related data channel

   When and both offerer and
   answerer may start using new the application requests MSRP related data channel.

7.  Security Considerations

   No security considerations are envisaged beyond those already
   documented in [RFC4566]

8.  IANA Considerations

   To be completed.  As [I-D.ietf-rtcweb-data-protocol] this document
   should refer to IANA's WebSocket Subprotocol Name Registry defined in
   [RFC6455].

9.  Acknowledgments

   The authors wish to acknowledge the closing borrowing of a ideas from other
   internet drafts by Salvatore Loreto, Gonzalo Camarillo, Peter Dunkley
   and Gavin Llewellyn, and to thank Christian Groves, Christer
   Holmberg, Paul Kyzivat, Jonathan Lennox, and Uwe Rauschenbach for
   their invaluable comments.

10.  CHANGE LOG

10.1.  Changes against 'draft-ietf-mmusic-data-channel-sdpneg-00'

   o  In Section 3 "WebRTC data channel that channel" was
   externally negotiated, the data defined as "A bidirectional
      channel stack always performs an in-
   band SSN reset for consisting of paired SCTP outbound and inbound streams."
      Replacement of this channel.

   It is specific definition with "Data channel: A WebRTC data
      channel as specified in [I-D.ietf-rtcweb-data-channel]", and
      consistent usage of "data channel" in the remainder of the
      document including the document's headline."

   o  In Section 4 removal of following note: 'OPEN ISSUE: The syntax in
      [I-D.ietf-mmusic-sctp-sdp] may change as that document progresses.
      In particular we expect "webrtc-datachannel" to become a more
      general term.'

   o  Consistent usage of '"m" line' in whole document as per [RFC4566].

   o  In Section 5.1.1 removal of the sub-protocol whether this closing must example dcmap attribute line
      'a=dcmap:2 subprotocol="BFCP";label="channel 2' as there are
      already four examples right after the ABNF rules in
   addition be signaled
      Section 5.1.1.1.  Corresponding removal of following related note:
      "Note: This document does not provide a complete specification of
      how to negotiate the peer via use of a new SDP offer/answer exchange.

   A WebRTC data channel can to transport
      BFCP.  Procedures specific to each sub-protocol such as BFCP will
      be closed by sending a new SDP offer which
   excludes the dcmap and dcsa attributes lines for the data channel. documented elsewhere.  The port value for use of BFCP is only an example of
      how the m line should not be changed (e.g., generic procedures described herein might apply to zero)
   when closing a data channel (unless all data channels are being
   closed and the SCTP association is no longer needed), since this
   would close the SCTP association and impact all
      specific sub-protocol."

   o  In Section 5.1.1 removal of the data channels.
   If answerer accepts the SDP offer then it MUST also exclude the
   corresponding following note: "Note: This attribute lines
      is derived from attribute "webrtc-DataChannel", which was defined
      in old version 03 of the answer.  In addition to that,
   SDP answerer may exclude other data channels which were closed following draft, but
   not yet communicated to the peer.  So, offerer MUST inspect the
   answer to see if it has to close other data channels which are now
   not included was removed
      along with any support for SDP external negotiation in the answer

   If a subsequent
      versions: [I-D.ietf-mmusic-sctp-sdp]."

   o  Insertion of following new SDP offer/answer is used sentence to close data channels then the
   data channel(s) should only be closed by the answerer/offerer after
   successful SDP answer beginning of
      Section 5.1.1.1: "dcmap is sent/received.

      This delayed close a media level attribute having
      following ABNF syntax:"

   o  Insertion of new Section 5.1.1.2 containing the dcmap-stream-id
      specifying sentence, which previously was placed right before the
      formal ABNF rules.  Removal of the sentence 'Stream is to handle cases where a successful SDP
      answer mandatory
      parameter and is not received, in which case noted directly after the state "a=dcmap:" attribute's
      colon' as this information is part of session should
      be kept per the last successful SDP offer/answer.

   If a client receives a data channel close indication (due ABNF specification.

   o  In Section 5.1.1.1 modification of the 'ordering-value' values
      from "0" or "1" to inband
   SSN reset "true" or some other reason) without associated SDP offer then an
   SDP offer "false".  Corresponding text
      modifications in Section 5.1.1.7.

   o  In Section 5.1.1.1 the ABNF definition of "quoted-string" referred
      to rule name "escaped-char", which excludes this closed data channel SHOULD be
   generated.

   The application must also close any data channel that was externally
   negotiated, for which the stream identifiers are not listed in an
   incoming SDP offer.

   A closed data channel using local close (SCTP reset), without an
   additional SDP offer/answer defined.  Instead a
      rule with name "escaped" was defined.  Renamed that rule's name to close it, may be reused for
      "escaped-char".

   o  Insertion of a new data
   channel.  This can only be done via new SDP offer/answer, describing
   the new sub-protocol and its attributes, only dedicated note right after the corresponding
   data channel close acknowledgement is received from "a=dcmap:4"
      attribute example in Section 5.1.1.1 regarding the peer (i.e.
   SCTP reset non-printable
      "escaped-char" character within the "label" value.

   o  In Section 5.1.2's second paragraph replacement of both incoming and outgoing streams is completed). "sctp stream
      identifier" with "SCTP stream identifier".

   o  In first paragraph of Section 5.2.1 replacement of first two
      sentences 'For the SDP-based external negotiation described in
      this document, the initial offerer based "SCTP over DTLS" owns by
      convention the even stream identifiers whereas the initial
      answerer owns the odd stream identifiers.  This
   restriction ownership is to avoid the race conditions between arrival
      invariant for the whole lifetime of "SDP the signaling session, e.g. it
      does not change if the initial answerer sends a new offer which reuses stream" with "SCTP reset which closes outgoing
   stream" at to the peer

5.2.4.  Various SDP offer/answer scenarios and considerations
      initial offerer.' with 'If an SDP offer has no a=dcmap attributes

      *  Initial SDP offer: No data channel negotiated yet.

      *  Subsequent SDP offer: All the externally negotiated data
         channels must / answer exchange (could
      be closed now.  The DTLS/SCTP association remains
         open for external the initial or internal negotiation of data channels. a subsequent one) results in a UDP/DTLS/SCTP or
      TCP/DTLS/SCTP based media description being accepted, and if this
      SDP offer / answer has no a=dcmap attributes

      *  Initial SDP answer: Either exchange results in the peer does not support dcmap
         attributes or it rejected all establishment of a new
      SCTP association, then the data channels.  In either
         case SDP offerer closes all the externally negotiated data channels
         that were open at owns the time even SCTP stream
      ids of initial offer.  The DTLS/SCTP this new SCTP association will still be setup.

      *  Sub-sequent SDP answer: All and the externally negotiated data
         channels must be closed now.  The DTLS/SCTP association remains
         open for future external answerer owns the odd
      SCTP stream identifiers.  If this "m" line is removed from the
      signaling session (its port number set to zero), and if usage of
      this or internal negotiation of data
         channels.

      SDP offer has no a=dcsa attributes for a data channel.

      *  This new UDP/DTLS/SCTP or TCP/DTLS/SCTP based "m" line is allowed
      renegotiated later on, then the even and indicates there are no sub-protocol
         parameters to convey.

      SDP answer has no a=dcsa attributes for a data channel.

      *  This odd SCTP stream
      identifier ownership is allowed and indicates there are no sub-protocol
         parameters to convey in redetermined as well as described above.'

   o  In Section 5.2.3 the SDP answer.  The number first action of dcsa
         attributes in an SDP answerer, when
      receiving an SDP offer, was described as "Applies the SDP answer does not have to match offer.
      Note that the number
         of dcsa browser ignores data channel specific attributes in
      the SDP."  Replacement of these two sentences with "Parses and
      applies the SDP offer.

6.  Examples

   SDP offer:
     m=application 10001 UDP/DTLS/SCTP webrtc-datachannel
     c=IN IP4 10.10.10.1
     a=max-message-size:100000
     a=sctp-port 5000
     a=setup:actpass
     a=connection:new
     a=fingerprint:SHA-1 \
         4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB
     a=dcmap:0 subprotocol="BFCP";label="BFCP"  Note that the typical parser normally
      ignores unknown SDP answer:
     m=application 10002 UDP/DTLS/SCTP webrtc-datachannel
     c=IN IP4 10.10.10.2
     a=max-message-size:100000
     a=sctp-port 5002
     a=setup:passive
     a=connection:new
     a=fingerprint:SHA-1 \
         5B:AD:67:B1:3E:82:AC:3B:90:02:B1:DF:12:5D:CA:6B:3F:E5:54:FA

                            Figure 1: Example 1 attributes, which includes data channel
      related attributes."

   o  In Section 5.2.3 the above example second sentence of the third SDP answerer rejected
      action was "Note that the browser is asked to create data channel channels
      with stream id 0 either for explicit reasons or because it does identifiers not
   understand the a=dcmap attribute.  As a result the offerer will close "owned" by the data channel created agent.".  Replacement
      of this sentence with "Note that the external negotiation option.  The
   SCTP association will still be setup over DTLS.  At this point
   offerer or answerer may use internal negotiation agent is asked to open create data
   channels.

   SDP offer:
     m=application 10001 UDP/DTLS/SCTP webrtc-datachannel
     c=IN IP4 10.10.10.1
     a=max-message-size:100000
     a=sctp-port 5000
     a=setup:actpass
     a=connection:new
     a=fingerprint:SHA-1 \
         4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB
     a=dcmap:0 subprotocol="BFCP";label="BFCP"
     a=dcmap:2 subprotocol="MSRP";label="MSRP"
     a=dcsa:2 accept-types:message/cpim text/plain text/
     a=dcsa:2 path:msrp://alice.example.com:10001/2s93i93idj;dc
      channels with SCTP stream identifiers contained in the SDP answer:
     m=application 10002 UDP/DTLS/SCTP webrtc-datachannel
     c=IN IP4 10.10.10.2
     a=max-message-size:100000
     a=sctp-port 5002
     a=setup:passive
     a=connection:new
     a=fingerprint:SHA-1 \
         5B:AD:67:B1:3E:82:AC:3B:90:02:B1:DF:12:5D:CA:6B:3F:E5:54:FA
     a=dcmap:2 subprotocol="MSRP";label="MSRP"
     a=dcsa:2 accept-types:message/cpim text/plain
     a=dcsa:2 path:msrp://bob.example.com:10002/si438dsaodes;dc

                            Figure 2: Example 2

   In offer
      if the above example SDP offer contains is accepted."

   o  In Section 5.2.4 the third paragraph began with "A data channels for BFCP and
   MSRP sub-protocols. channel
      can be closed by sending a new SDP answer rejected BFCP and accepted MSRP.  So, offer which excludes the offerer should close dcmap
      and dcsa attribute lines for the data channel channel.  The port value for BFCP and both offerer
   and answerer may start using MSRP
      the m line should not be changed (e.g., to zero) when closing a
      data channel (after SCTP/DTLS
   association is setup).  The (unless all data channel with stream id 0 is free channels are being closed and
   can be used for future internal or external negotiation.

   Continuing on the earlier example in Figure 1.

   Subsequent SDP offer:
     m=application 10001 UDP/DTLS/SCTP webrtc-datachannel
     c=IN IP4 10.10.10.1
     a=max-message-size:100000
     a=sctp-port 5000
     a=setup:actpass
     a=connection:existing
     a=fingerprint:SHA-1 \
         4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB
     a=dcmap:4 subprotocol="MSRP";label="MSRP"
     a=dcsa:4 accept-types:message/cpim text/plain
     a=dcsa:4 path:msrp://alice.example.com:10001/2s93i93idj;dc

   Subsequent SDP answer:
     m=application 10002 UDP/DTLS/SCTP webrtc-datachannel
     c=IN IP4 10.10.10.2
     a=max-message-size:100000
     a=sctp-port 5002
     a=setup:passive
     a=connection:existing
     a=fingerprint:SHA-1 \
         5B:AD:67:B1:3E:82:AC:3B:90:02:B1:DF:12:5D:CA:6B:3F:E5:54:FA
     a=dcmap:4 subprotocol="MSRP";label="MSRP"
     a=dcsa:4 accept-types:message/cpim text/plain
     a=dcsa:4 path:msrp://bob.example.com:10002/si438dsaodes;dc

                            Figure 3: Example 3

   The above example
      SCTP association is a continuation no longer needed), since this would close the
      SCTP association and impact all of the example in Figure 1.  The data channels.  If the
      answerer accepts the SDP offer now removes then it MUST also exclude the MSRP
      corresponding attribute lines in the answer. ..." Replacement of
      this part with "The intention to close a data channel with stream id 2, but
   opens can be
      signaled by sending a new MSRP SDP offer which excludes the "a=dcmap:"
      and "a=dcsa:" attribute lines for the data channel.  The port
      value for the "m" line SHOULD not be changed (e.g., to zero) when
      closing a data channel with stream id 4.  The answerer
   accepted (unless all data channels are being closed
      and the entire offer.  As a result SCTP association is no longer needed), since this would
      close the offerer closes SCTP association and impact all of the
   earlier negotiated MSRP related data channel and both offerer and channels.
      If the answerer may start using new accepts the MSRP related SDP offer then it MUST close those
      data channel.

7.  Security Considerations

   No security considerations are envisaged beyond channels whose "a=dcmap:" and "a=dcsa:" attribute lines were
      excluded from the received SDP offer, unless those data channels
      were already
   documented closed, and it MUST also exclude the corresponding
      attribute lines in [RFC4566]

8.  IANA Considerations

   To the answer."

   o  In Section 5.2.4 the hanging text after the third paragraph was
      "This delayed close is to handle cases where a successful SDP
      answer is not received, in which case the state of session should
      be completed.  As [I-D.ietf-rtcweb-data-protocol] kept per the last successful SDP offer/answer."  Replacement of
      this document
   should refer to IANA's WebSocket Subprotocol Name Registry defined sentence with "This delayed closure is RECOMMENDED in
   [RFC6455].

9.  Acknowledgments

   The authors wish order
      to acknowledge handle cases where a successful SDP answer is not received, in
      which case the borrowing state of ideas from other
   internet drafts by Salvatore Loreto, Gonzalo Camarillo, Peter Dunkley
   and Gavin Llewellyn, the session SHOULD be kept per the last
      successful SDP offer/answer."

   o  Although dedicated to "a=dcmap" and "a=dcsa" SDP syntax aspects
      Section 5.1.1 contained already procedural descriptions related to thank Paul Kyzivat, Jonathan Lennox,
   Christian Groves
      data channel reliability negotiation.  Creation of new
      Section 5.2.2 and Uwe Rauschenbach for their invaluable comments.

10.  CHANGE LOG

10.1. moval of reliability negotiation related text to
      this new section.

10.2.  Changes against 'draft-ejzak-mmusic-data-channel-sdpneg-02'

   o  Removal of note "[ACTION ITEM]" from section "subprotocol
      parameter".  As [I-D.ietf-rtcweb-data-protocol] this document
      should refer to IANA's WebSocket Subprotocol Name Registry defined
      in [RFC6455].

   o  In whole document, replacement of "unreliable" with "partially
      reliable", which is used in [I-D.ietf-rtcweb-data-channel] and in
      [I-D.ietf-rtcweb-data-protocol] in most places.

   o  Clarification of the semantic if the "max-retr" parameter is not
      present in an a=dcmap attribute line.  In section "max-retr
      parameter" the sentence "The max-retr parameter is optional with
      default value unbounded" was replaced with "The max-retr parameter
      is optional.  If the max-retr parameter is not present, then the
      maximal number of retransmissions is determined as per the generic
      SCTP retransmission rules as specified in [RFC4960]".

   o  Clarification of the semantic if the "max-time" parameter is not
      present in an a=dcmap attribute line.  In section "max-time
      parameter" the sentence "The max-time parameter is optional with
      default value unbounded" was replaced with "The max-time parameter
      is optional.  If the max-time parameter is not present, then the
      generic SCTP retransmission timing rules apply as specified in
      [RFC4960]".

   o  In section "label parameter" the sentence "Label is a mandatory
      parameter." was removed and following new sentences (including the
      note) were added: "The 'label' parameter is optional.  If it is
      not present, then its value defaults to the empty string.  Note:
      The empty string may also be explicitly used as 'label' value,
      such that 'label=""' is equivalent to the 'label' parameter not
      being present at all.  [I-D.ietf-rtcweb-data-protocol] allows the
      DATA_CHANNEL_OPEN message's 'Label' value to be an empty string."

   o  In section "subprotocol parameter" the sentence "Subprotocol is a
      mandatory parameter." was replaced with "'Subprotocol' is an
      optional parameter.  If the 'subprotocol' parameter is not
      present, then its value defaults to the empty string."

   o  In the "Examples" section, in the first two SDP offer examples in
      the a=dcmap attribute lines 'label="BGCP"' was replaced with
      'label="BFCP"'.

   o  In all examples, the m-line "m" line proto value "DTLS/SCTP" was replaced
      with "UDP/DTLS/SCTP" and the "a=fmtp" attribute lines were
      replaced with "a=max-message-size" attribute lines, as per draft-
      ietf-mmusic-sctp-sdp-12.

10.2.

10.3.  Changes against '-01'

   o  Formal syntax for dcmap and dcsa attribute lines.

   o  Making subprotocol as an optional parameter in dcmap.

   o  Specifying disallowed parameter combinations for max-time and max-
      retr.

   o  Clarifications on WebRTC data channel close procedures.

10.3.

10.4.  Changes against '-00'

   o  Revisions to identify difference between internal and external
      negotiation and their usage.

   o  Introduction of more generic terminology, e.g. "application"
      instead of "browser".

   o  Clarification of how "max-retr and max-time affect the usage of
      unreliable and reliable WebRTC data channels.

   o  Updates of examples to take into account the SDP syntax changes
      introduced with draft-ietf-mmusic-sctp-sdp-07.

   o  Removal of the SCTP port number from the a=dcmap and a=dcsa
      attributes as this is now contained in the a=sctp-port attribute,
      and as draft-ietf-mmusic-sctp-sdp-07 supports only one SCTP
      association on top of the DTLS connection.

11.  References

11.1.  Normative References

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119, March 1997.

   [RFC4566]  Handley, M., Jacobson, V., and C. Perkins, "SDP: Session
              Description Protocol", RFC 4566, July 2006.

   [RFC3264]  Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model
              with Session Description Protocol (SDP)", RFC 3264, June
              2002.

   [RFC5234]  Crocker, D. and P. Overell, "Augmented BNF for Syntax
              Specifications: ABNF", STD 68, RFC 5234, January 2008.

   [I-D.ietf-rtcweb-jsep]
              Uberti, J., Jennings, C., and E. Rescorla, "Javascript
              Session Establishment Protocol", draft-ietf-rtcweb-jsep-08
              (work in progress), October 2014.

   [I-D.ietf-rtcweb-data-channel]
              Jesup, R., Loreto, S., and M. Tuexen, "WebRTC Data
              Channels", draft-ietf-rtcweb-data-channel-13 (work in
              progress), January 2015.

   [I-D.ietf-mmusic-sctp-sdp]
              Holmberg, C., Loreto, S., and G. Camarillo, "Stream
              Control Transmission Protocol (SCTP)-Based Media Transport
              in the Session Description Protocol (SDP)", draft-ietf-
              mmusic-sctp-sdp-12
              mmusic-sctp-sdp-14 (work in progress), January March 2015.

   [WebRtcAPI]
              Bergkvist, A., Burnett, D., Jennings, C., and A.
              Narayanan, "WebRTC 1.0: Real-time Communication Between
              Browsers", World Wide Web Consortium WD-webrtc-20130910,
              September 2013,
              <http://www.w3.org/TR/2013/WD-webrtc-20130910/>.

11.2.  Informative References

   [I-D.ietf-rtcweb-data-protocol]
              Jesup, R., Loreto, S., and M. Tuexen, "WebRTC Data Channel
              Establishment Protocol", draft-ietf-rtcweb-data-
              protocol-09 (work in progress), January 2015.

   [RFC4960]  Stewart, R., "Stream Control Transmission Protocol", RFC
              4960, September 2007.

   [RFC4975]  Campbell, B., Mahy, R., and C. Jennings, "The Message
              Session Relay Protocol (MSRP)", RFC 4975, September 2007.

   [RFC4976]  Jennings, C., Mahy, R., and A. Roach, "Relay Extensions
              for the Message Sessions Relay Protocol (MSRP)", RFC 4976,
              September 2007.

   [RFC5547]  Garcia-Martin, M., Isomaki, M., Camarillo, G., Loreto, S.,
              and P. Kyzivat, "A Session Description Protocol (SDP)
              Offer/Answer Mechanism to Enable File Transfer", RFC 5547,
              May 2009.

   [RFC6135]  Holmberg, C. and S. Blau, "An Alternative Connection Model
              for the Message Session Relay Protocol (MSRP)", RFC 6135,
              February 2011.

   [RFC6455]  Fette, I. and A. Melnikov, "The WebSocket Protocol", RFC
              6455, December 2011.

   [RFC6714]  Holmberg, C., Blau, S., and E. Burger, "Connection
              Establishment for Media Anchoring (CEMA) for the Message
              Session Relay Protocol (MSRP)", RFC 6714, August 2012.

Authors' Addresses

   Keith Drage (editor)
   Alcatel-Lucent
   Quadrant, Stonehill Green, Westlea
   Swindon
   UK

   Email: keith.drage@alcatel-lucent.com

   Raju

   Maridi R. Makaraju (Raju)
   Alcatel-Lucent
   2000 Lucent Lane
   Naperville, Illinois
   US

   Email: Raju.Makaraju@alcatel-lucent.com

   Juergen Stoetzer-Bradler
   Alcatel-Lucent
   Lorenzstrasse 10
   D-70435 Stuttgart
   Germany

   Email: Juergen.Stoetzer-Bradler@alcatel-lucent.com

   Richard Ejzak
   Unaffiliated

   Email: richard.ejzak@gmail.com

   Jerome Marcon
   Unaffiliated