MMUSIC K. Drage
Internet-Draft Unaffiliated
Intended status: Standards Track M. Makaraju
Expires: October 6, 2018 Nokia
J. Stoetzer-Bradler
R. Ejzak
J. Marcon
Unaffiliated
R. Even, Ed.
Huawei
April 4, 2018

SDP-based Data Channel Negotiation
draft-ietf-mmusic-data-channel-sdpneg-17

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 (Stream Control Transmission Protocol), where each data channel might be used to transport other protocols, called subprotocols. Data channel setup can be done using either the in-band Data Channel Establishment Protocol (DCEP) or using some out-of-band non-DCEP protocol. This document specifies how the SDP (Session Description Protocol) offer/answer exchange can be used to achieve such an out-of-band non-DCEP 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 (which is defined by the IETF "ControLling mUltiple streams for tElepresence" working group). 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 https://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 October 6, 2018.

Copyright Notice

Copyright (c) 2018 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 (https://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

The RTCWeb working group has defined the concept of bi-directional data channels running on top of the Stream Control Transmission Protocol (SCTP) [I-D.ietf-rtcweb-data-channel]. RTCWeb allows applications to use data channels. RTCWeb defines an in-band Data Channel Establishment Protocol (DCEP) [I-D.ietf-rtcweb-data-protocol], however other in-band or out-of-band protocols may be used for establishing data channels. 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 (Application Programming Interface), or other users of a data channel like CLUE [I-D.ietf-clue-datachannel] They can be used to transport proprietary or well-defined protocols, which in the latter case can be signaled by the data channel "subprotocol" parameter, conceptually similar to the WebSocket "subprotocol". However, apart from the "subprotocol" value transmitted to the peer, RTCWeb leaves it open how endpoint applications can agree on how to instantiate a given subprotocol on a data channel, and whether it is signaled in-band using DCEP or out-of-band using a non-DCEP protocol (or both). In particular, the SDP offer generated by the RTCweb data channel stack includes no channel-specific information.

This document defines SDP offer/answer [RFC3264] negotiation procedures to establish data channels for transport of well-defined subprotocols, to enable out-of-band negotiation. These procedures are based on generic SDP offer/answer negotiation rules for SCTP based media transport as specified in [I-D.ietf-mmusic-sctp-sdp] for the SDP "m" line proto values UDP/DTLS/SCTP and TCP/DTLS/SCTP. In the future, data channels could be defined over other SCTP based protocols, such as SCTP over IP. However, corresponding potential other "m=" line proto values are not considered in this document.

This document makes use of MSRP (Message Session Relay Protocol) and BFCP (Binary Floor Control Protocol) in many of the examples. It does not provide a complete specification of how to negotiate the use of a data channel to transport MSRP. Procedures specific to each subprotocol would have to be documented elsewhere. For MSRP they are documented in [I-D.ietf-mmusic-msrp-usage-data-channel] . The use of MSRP in some examples is only to show how the generic procedures described herein might apply to a specific subprotocol.

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 WebRTC data channel as specified in [I-D.ietf-rtcweb-data-channel].
Data channel stack: An entity which, upon application request, runs the data channel protocol to keep track of states, sending and receiving data. If the application is a browser based JavaScript application then this stack resides in the browser. If the application is a native application then this stack resides in the application and is accessible 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...).
Data channel subprotocol: The application protocol which is transported over a single data channel. Data channel subprotocol messages are sent as data channel payload over an established data channel. If an SDP offer/answer exchange is used as specified in this document to negotiate the establishment of data channels, corresponding data channel properties, associated data channel subprotocols and data channel subprotocol properties, then the data channel subprotocols may be identified by the values of the "subprotocol" parameters of the SDP "a=dcmap" attribute as described in Section 5.1.4. Within this document the term "data channel subprotocol" is often abbreviated as just "subprotocol".
DCEP: Data Channel Establishment Protocol defined in [I-D.ietf-rtcweb-data-protocol].
In-band: Transmission through the peer-to-peer SCTP association.
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.
SCTP Stream Sequence Number (SSN): the SCTP stream sequence number as specified in [RFC4960].
Stream identifier: The identifier of the outbound and inbound SCTP streams composing a data channel.

4. Applicability Statement

The mechanism in this document only applies to the Session Description Protocol (SDP) [RFC4566], when used together with the SDP offer/answer mechanism [RFC3264]. Declarative usage of SDP is out of scope of this document, and is thus undefined.

5. SDP Data Channel Attributes

This sections defines new SDP media-level attributes, that can be used together with the SDP Offer/Answer mechanism to negotiate data channel-specific and subprotocol-specific parameters, without the usage of DCEP [I-D.ietf-rtcweb-data-protocol].

Note: Appendix A provides information how data channels work in general and especially summarizes some key aspects, which should be considered for the negotiation of data channels if DCEP is not used.

Two new SDP attributes are defined to support SDP offer/answer negotiation of data channels. The first attribute provides for negotiation of channel-specific parameters. The second attribute provides for negotiation of subprotocol-specific parameters.

5.1. SDP DCMAP Attribute

This section defines a new media level attribute "a=dcmap:" that defines the data channel parameters for each data channel to be negotiated.

The intention in exchanging this attribute is to create, on two peers, without use of DCEP [I-D.ietf-rtcweb-data-protocol], matched data channels as pairs of oppositely directed SCTP streams having the same set of attributes. It is assumed that the data channel properties (reliable/partially reliable, ordered/unordered) are suitable per the subprotocol transport requirements.

5.1.1. DCMAP Attribute 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 / priority-opt
                  ; Either only maxretr-opt or maxtime-opt 
                  ; is present.

dcmap-stream-id = 1*5DIGIT
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   = "0" / integer
                  ; number of retransmissions,
                  ; less than 2^32,
                  ; derived from 'Reliability Parameter' of
                  ; [I-D.ietf-rtcweb-data-protocol]
maxtime-opt     = "max-time=" maxtime-value
maxtime-value   = "0" / integer
                  ; milliseconds,
                  ; less than 2^32,
                  ; derived from 'Reliability Parameter' of
                  ; [I-D.ietf-rtcweb-data-protocol]
priority-opt    = "priority=" priority-value
priority-value  = "0" / integer
                  ; unsigned integer value indicating the priority of 
                  ; the data channel,
                  ; less than 2^16,
                  ; derived from 'Priority' of
                  ; [I-D.ietf-rtcweb-data-protocol]

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

Examples:

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

"a=dcmap:" is a media level attribute having the following ABNF (Augmented Backus-Naur Form, [RFC5234]) syntax.

Note: The last example (a=dcmap:4) shows a 'label' parameter value which contains one non-printable 'escaped-char' character (the tabulator character).

Within an 'a=dcmap:' attribute line's 'dcmap-opt' value either only one 'maxretr-opt' parameter or one 'maxtime-opt' parameter MAY be present. Both MUST NOT be present.

5.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.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 [WebRtcAPI], 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 a '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.4. Subprotocol Parameter

The 'subprotocol' parameter indicates which protocol the client expects to exchange via the channel. This parameter maps to the 'Protocol' parameter defined in [I-D.ietf-rtcweb-data-protocol]. Section 9.1 specifies how new subprotocol parameter values are registered. 'Subprotocol' is an optional parameter. If the 'subprotocol' parameter is not present, then its value defaults to an empty string.

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

5.1.5. Max-retr Parameter

This parameter indicates that the data channel is partially reliable. The 'max-retr' parameter indicates the maximal number of times a user message will be retransmitted. 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]. This parameter maps to the 'Number of RTX' parameter defined in [I-D.ietf-rtcweb-data-protocol].

5.1.6. Max-time Parameter

This parameter indicates that the data channel is partially reliable. A user message will no longer be transmitted or retransmitted after a specified life-time given in milliseconds in the 'max-time' parameter. 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]. This parameter maps to the 'Lifetime in ms' parameter defined in [I-D.ietf-rtcweb-data-protocol].

5.1.7. Ordered Parameter

The 'ordered' parameter with value "true" indicates that the receiver MUST dispatch DATA chunks in the data channel to the upper layer while preserving the order. The ordered parameter is optional and 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.8. Priority Parameter

The 'priority' parameter indicates the data channel's priority relative to the priorities of other data channels, which may additionally exist over the same SCTP association. The 'priority' parameter maps to the 'Priority' parameter defined in [I-D.ietf-rtcweb-data-protocol]. The 'priority' parameter is optional. In the absence of this parameter "priority=256" is assumed.

5.1.9. DCMAP Multiplexing Category

Multiplexing characteristics of SDP attributes are described in [I-D.ietf-mmusic-sdp-mux-attributes].

The multiplexing category of the "a=dcmap:" attribute is SPECIAL.

As the usage of multiple SCTP associations on top of a single DTLS association is outside the scope of [I-D.ietf-mmusic-sctp-sdp], no "a=dcmap:" attribute multiplexing rules are specified for the UDP/DTLS/SCTP and TCP/DTLS/SCTP proto values. If future extensions of [I-D.ietf-mmusic-sctp-sdp] define how to negotiate multiplexing of multiple SCTP associations on top of a single DTLS association, or how to add multiple SCTP associations to one BUNDLE group, then multiplexing rules for the "a=dcmap:" attribute need to be defined as well, for instance in an extension of this SDP offer/answer based data channel negotiation specification.

5.2. SDP DCSA Attribute

In the SDP media description, each data channel declaration MAY also be followed by other media level SDP attributes, which are either specifically defined for or applied to the subprotocol in use. Each of these attributes is represented by one new attribute line, and it includes the contents of a media-level SDP attribute already defined for use with this (sub)protocol in another IETF (Internet Engineering Task Force) document. Subprotocol specific attributes MAY also be defined for exclusive use with data channel transport, but MUST use the same syntax described here for other subprotocol related attributes.

Each SDP attribute, related to the subprotocol, that would normally be used to negotiate the subprotocol using SDP offer/answer is replaced with an attribute of the form "a=dcsa:stream-id original-attribute", where dcsa stands for "data channel subprotocol attribute", stream-id is the SCTP stream identifier assigned to this subprotocol instance, and original-attribute represents the contents of the subprotocol related attribute to be included.

The same syntax applies to any other SDP attribute required for negotiation of this instance of the subprotocol.

5.2.1. DCSA Syntax

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=dcmap:2 subprotocol="MSRP";ordered=true;label="MSRP"

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

Note that the above reference to [RFC4566] defines where the attribute definition can be found; it does not provide any limitation on support of attributes defined in other documents in accordance with this attribute definition. Note however that not all SDP attributes are suitable as a "a=dcsa:" parameter. [IANA-SDP-Parameters] contains the lists of IANA (Internet Assigned Numbers Authority) registered session and media level or media level only SDP attributes.

Thus in 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 specifies that this instance of the MSRP subprotocol being transported on the SCTP association using the data channel with stream id 2 accepts plain text files.

As opposed to the data channel "a=dcmap:" attribute parameters, these parameters are subject to offer/answer negotiation following the procedures defined in the subprotocol specific documents.

It is assumed that in general the usages of subprotocol related media level attributes are independent from the subprotocol's transport protocol. Such transport protocol independent subprotocol related attributes are used in the same way as defined in the original subprotocol specification, also if the subprotocol is transported over a data channel and if the attribute is correspondingly embedded in a "a=dcsa" attribute.

There may be cases, where the usage of a subprotocol related media level attribute depends on the subprotocol's transport protocol. In such cases the subprotocol related usage of the attribute is expected to be described for the data channel transport. A data channel specific usage of a subprotocol attribute is expected to be specified in the same document that registers the subprotocol's identifier for data channel usage as described in Section 9.1.

5.2.2. DCSA Multiplexing Category

The multiplexing category of the "a=dcsa:" attribute is SPECIAL.

As the usage of multiple SCTP associations on top of a single DTLS association is outside the scope of [I-D.ietf-mmusic-sctp-sdp], no "a=dcsa:" attribute multiplexing rules are specified for the UDP/DTLS/SCTP and TCP/DTLS/SCTP proto values. If future extensions of [I-D.ietf-mmusic-sctp-sdp] define how to negotiate multiplexing of multiple SCTP associations on top of a single DTLS association, or how to add multiple SCTP associations to one BUNDLE group, then multiplexing rules for the "a=dcsa:" attribute need to be defined as well, for instance in an extension of this SDP based data channel negotiation specification.

6. SDP Offer/Answer Procedures

6.1. Managing Stream Identifiers

If a SDP offer/answer exchange (could be 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 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 this or of a new UDP/DTLS/SCTP or TCP/DTLS/SCTP based "m" line is renegotiated later on, then the even and odd SCTP stream identifier ownership is re-determined as described above.

This document allows simultaneous use of SDP offer/answer and DCEP negotiation. However, an SCTP stream MUST NOT be referenced in a "a=dcmap:" or "a=dcsa:" attribute of an SDP offer/answer exchange if the associated SCTP stream has already been negotiated via DCEP. Stream ids that are not currently used in SDP offer/answer can be used for DCEP negotiation. Stream id allocation per SDP offer/answer negotiation may not align with DTLS role based allocation. This could cause glare conditions when one side tries to do SDP offer/answer negotiation on a stream id while the other end tries to open a data channel on the same stream id using DCEP negotiation. To avoid these glare conditions this document recommends that the data channel stack user always selects stream ids per the above described SDP offer/answer rule even when DCEP negotiation is used. To avoid glare conditions, it is possible to come up with a different stream id allocation scheme, but such schemes are outside the scope of this document.

6.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 at most one of them MAY be present in the "a=dcmap:" attribute line. If a SDP offer contains both of these parameters then the receiver of such an SDP offer MUST reject the SDP offer. If a SDP answer contains both of these parameters then the offerer MUST treat the associated SDP offer/answer failed and take appropriate recovery actions. These recovery options are outside the scope of this document.

The SDP answer SHALL echo the same subprotocol, max-retr, max-time, ordered parameters, if those were present in the offer, and MAY include a label parameter. They MAY appear in any order, which could be different from the SDP offer, in the SDP answer.

When sending a subsequent offer or an answer, and for as long as the data channel is still open, the sender MUST replicate the same information.

Data channel types defined in [I-D.ietf-rtcweb-data-protocol] are mapped to SDP media description in the following manner, where "ordered=true" is the default and may be omitted:

DATA_CHANNEL_RELIABLE
      ordered=true

DATA_CHANNEL_RELIABLE_UNORDERED
      ordered=false

DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT
      ordered=true;max-retr=<number of retransmissions>

DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT_UNORDERED 
      ordered=false;max-retr=<number of retransmissions>

DATA_CHANNEL_PARTIAL_RELIABLE_TIMED  
      ordered=true;max-time=<lifetime in milliseconds>
          
DATA_CHANNEL_PARTIAL_RELIABLE_TIMED_UNORDERED  
      ordered=false;max-time=<lifetime in milliseconds>

6.3. Generating Initial Offer

The agent that intends to send an SDP offer to create data channels through SDP offer/answer negotiation performs the following:

6.4. Generating SDP Answer

The peer receiving such an SDP offer performs the following:

6.5. Offerer Processing of the SDP Answer

An offerer receiving a SDP answer performs the following:

Each agent application MUST wait to send data until it has confirmation that the data channel at the peer is instantiated. For WebRTC, this is when both data channel stacks have channel parameters instantiated. This occurs:

Note: DCEP is not used, that is neither the SDP offerer nor the SDP answerer send an in-band DCEP DATA_CHANNEL_OPEN message.

6.6. Subsequent Offers

When an application wants to add a data channel it will send a new oofer with a new a=dcmap with a new dcmap-stream-id and optionally a=dcsa attributes. The offer should include in the offer all parameters of the existing channesl. If the offer wants to remove a data channel it will remove the attributes with the dcmap-stream-id it wants to remove, see the examples in the examples section Section 7

6.6.1. Closing a Data Channel

When the application requests the closing of a data channel that was negotiated via SDP offer/answer, the data channel stack always performs an SCTP SSN reset for this channel.

It is specific to the subprotocol whether this closing MUST in addition be signaled to the peer via a new SDP offer/answer exchange.

The intention to close a data channel can be signaled by sending a new SDP offer which excludes the "a=dcmap:" and "a=dcsa:" attribute lines for the data channel. The offerer SHOULD NOT change the port value for the "m" line (e.g. 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 of the data channels. If the answerer accepts the SDP offer then the answerer MUST close those data channels whose "a=dcmap:" and "a=dcsa:" attribute lines were excluded from the received SDP offer, unless those data channels were already closed, and the answerer MUST also exclude the corresponding attribute lines in the answer. In addition to that, the SDP answerer MAY exclude other data channels which were closed but not yet communicated to the peer. So, the offerer MUST inspect the answer to see if it has to close other data channels that are now not included in the answer.

If a new SDP offer/answer is used to close data channels then the data channel(s) SHOULD only be closed by the answerer/offerer after a successful SDP 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 the state of the session SHOULD be kept per the last successful SDP offer/answer.

If a client receives a data channel close indication (due to inband SCTP SSN reset or some other reason) without associated SDP offer then the client SHOULD generate an SDP offer which excludes this closed data channel.

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

A closed data channel using local close (SCTP SSN reset), without an additional SDP offer/answer to close it, may be reused for a new data channel. This can only be done via new SDP offer/answer, describing the new subprotocol and its attributes, only after the corresponding data channel close acknowledgement is received from the peer (i.e. SCTP SSN reset of both incoming and outgoing streams is completed). This restriction is to avoid the race conditions between arrival of "SDP offer which reuses stream" with "SCTP SSN reset which closes outgoing stream" at the peer.

6.7. Various SDP Offer/Answer Scenarios and Considerations

7. Examples

SDP offer:

  m=application 10001 UDP/DTLS/SCTP webrtc-datachannel
  c=IN IP6 IP6 2001:db8::3
  a=max-message-size:100000
  a=sctp-port:5000
  a=setup:actpass
  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=tls-id:abc3de65cddef001be82
  a=dcmap:0 subprotocol="BFCP";label="BFCP"
    
SDP answer:

  m=application 10002 UDP/DTLS/SCTP webrtc-datachannel
  c=IN IP6 IP6 2001:db8::1
  a=max-message-size:100000
  a=sctp-port:5002
  a=setup:passive
  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=tls-id:dcb3ae65cddef0532d42

Figure 1: Example 1

In the above example the SDP answerer rejected the data channel with stream id 0 either for explicit reasons or because it does not understand the "a=dcmap:" attribute. As a result the offerer will close the data channel created with the SDP offer/answer negotiation option. The SCTP association will still be setup over DTLS. At this point the offerer or the answerer may use DCEP negotiation to open data channels.

SDP offer:

  m=application 10001 UDP/DTLS/SCTP webrtc-datachannel
  c=IN IP4 192.0.2.1
  a=max-message-size:100000
  a=sctp-port:5000
  a=setup:actpass
  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=tls-id:abc3de65cddef001be82
  a=dcmap:0 subprotocol="BFCP";label="BFCP"
  a=dcmap:2 subprotocol="MSRP";label="MSRP"  
  a=dcsa:2 accept-types:message/cpim text/plain
  a=dcsa:2 path:msrp://alice.example.com:10001/2s93i93idj;dc

SDP answer:

  m=application 10002 UDP/DTLS/SCTP webrtc-datachannel
  c=IN IP4 192.0.2.2
  a=max-message-size:100000
  a=sctp-port:5002
  a=setup:passive
  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=tls-id:dcb3ae65cddef0532d42
  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 the SDP offer contains data channels for BFCP (Binary Floor Control Protocol) and MSRP subprotocols. The SDP answer rejected BFCP and accepted MSRP. So, the offerer closes the data channel for BFCP and both offerer and answerer may start using the MSRP data channel (after the SCTP association is set up). The data channel with stream id 0 is free and can be used for future DCEP or SDP offer/answer negotiation.

Continuing the example in Figure 2.

Subsequent SDP offer:

  m=application 10001 UDP/DTLS/SCTP webrtc-datachannel
  c=IN IP4 192.0.2.1
  a=max-message-size:100000
  a=sctp-port:5000
  a=setup:actpass
  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=tls-id:abc3de65cddef001be82
  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 192.0.2.2
  a=max-message-size:100000
  a=sctp-port:5002
  a=setup:passive
  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=tls-id:dcb3ae65cddef0532d42
  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 a continuation of the example in Figure 2. The SDP offerer now removes the MSRP data channel with stream id 2, but opens a new MSRP data channel with stream id 4. The answerer accepts the entire offer. As a result the offerer closes the earlier negotiated MSRP related data channel and both offerer and answerer may start using new the MSRP related data channel.

8. Security Considerations

This document specifies new SDP attributes used in the negotiation of the DATA channel parameters.

These parameter are negotiated as part of opening a SCTP channel over DTLS as specified in [I-D.ietf-mmusic-sctp-sdp]. This document do not add any security considerations to the ones specified in the above document

Error cases like the use of unknown parameter values or violation the odd/even rule must be handled by closing the corresponding Data Channel.

9. IANA Considerations

9.1. Subprotocol Identifiers

Registration of new subprotocol identifiers is performed using the existing IANA "WebSocket Subprotocol Name Registry" table.

The following text should be added following the title of the table.

"This table also includes subprotocol identifiers specified for usage within a WebRTC data channel."

The following reference should be added to under the heading reference: "RFC XXXX".

This document assigns no new values to this table.

A subprotocol may simultaneously be defined for data channel transport and for Websocket transport. In such a case the "Subprotocol Definition" and "Reference" cells in the subprotocol's row of the IANA "WebSocket Subprotocol Name Registry" table should contain two entries. One entry in each of these cells should refer to the Websocket related subprotocol specification, and the other entry should refer to the data channel related subprotocol specification.

NOTE to RFC Editor: Please replace "XXXX" with the number of this RFC.

9.2. New SDP Attributes

9.2.1. dcmap

NOTE to RFC Editor: Please replace "XXXX" with the number of this RFC.

This document defines a new SDP media-level attribute "a=dcmap:" as follows:

Contact name: IESG Chairs
Contact email: iesg@ietf.org
Attribute name: dcmap
Attribute syntax: As per Section 5.1.1
Attribute semantics: As per Section 5.1.1
Usage level: media
Charset dependent: No
Purpose: Define data channel specific parameters
Appropriate values: As per Section 5.1.1
O/A procedures: As per Section 6
Mux category: SPECIAL. See Section 5.1.9
Reference: RFCXXXX

9.2.2. dcsa

NOTE to RFC Editor: Please replace "XXXX" with the number of this RFC.

This document defines a new SDP media-level attribute "a=dcsa:" as follows:

Contact name: IESG Chairs
Contact email: iesg@ietf.org
Attribute name: dcsa
Attribute syntax: As per Section 5.2.1
Attribute semantics: As per Section 5.2.1
Usage level: media
Charset dependent: No
Purpose: Define data channel subprotocol specific attributes
Appropriate values: As per Section 5.2.1
O/A procedures: As per Section 6
Mux category: SPECIAL. See Section 5.2.2
Reference: RFCXXXX

9.3. New Usage Level

This document introduces a new "Data Channel Subprotocol Attribute" (dcsa) usage level of the SDP media description to the IANA SDP att-field registry. SDP attributes that are defined for use at the dcsa usage level only SHALL use the dcsa usage level when registering the attribute. If existing media attributes are used in a datachannel subprotocol specific way (Section 5.2.1), then a new dcsa usage level MUST be defined for the existing media attribute. Where the SDP attribute is applicable to a particular subprotocol/s this SHALL also be registered by indicating the applicable subprotocol identifiers (see Section 9.1) along with the dcsa usage level. E.g.

... ...
Usage level: dcsa(MSRP)
... ...

10. Acknowledgments

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

11. CHANGE LOG

11.1. Changes against 'draft-ietf-mmusic-data-channel-sdpneg-15'

11.2. Changes against 'draft-ietf-mmusic-data-channel-sdpneg-14'

11.3. Changes against 'draft-ietf-mmusic-data-channel-sdpneg-12'

11.4. Changes against 'draft-ietf-mmusic-data-channel-sdpneg-11'

11.5. Changes against 'draft-ietf-mmusic-data-channel-sdpneg-10'

11.6. Changes against 'draft-ietf-mmusic-data-channel-sdpneg-09'

11.7. Changes against 'draft-ietf-mmusic-data-channel-sdpneg-08'

11.8. Changes against 'draft-ietf-mmusic-data-channel-sdpneg-07'

11.9. Changes against 'draft-ietf-mmusic-data-channel-sdpneg-06'

11.10. Changes against 'draft-ietf-mmusic-data-channel-sdpneg-05'

11.11. Changes against 'draft-ietf-mmusic-data-channel-sdpneg-04'

11.12. Changes against 'draft-ietf-mmusic-data-channel-sdpneg-03'

11.13. Changes against 'draft-ietf-mmusic-data-channel-sdpneg-02'

11.14. Changes against 'draft-ietf-mmusic-data-channel-sdpneg-01'

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

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

11.17. Changes against '-01'

11.18. Changes against '-00'

12. References

12.1. Normative References

[I-D.ietf-mmusic-sctp-sdp] Holmberg, C., Shpount, R., Loreto, S. and G. Camarillo, "Session Description Protocol (SDP) Offer/Answer Procedures For Stream Control Transmission Protocol (SCTP) over Datagram Transport Layer Security (DTLS) Transport.", Internet-Draft draft-ietf-mmusic-sctp-sdp-26, April 2017.
[I-D.ietf-mmusic-sdp-mux-attributes] Nandakumar, S., "A Framework for SDP Attributes when Multiplexing", Internet-Draft draft-ietf-mmusic-sdp-mux-attributes-17, February 2018.
[I-D.ietf-rtcweb-data-channel] Jesup, R., Loreto, S. and M. Tuexen, "WebRTC Data Channels", Internet-Draft draft-ietf-rtcweb-data-channel-13, January 2015.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997.
[RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model with Session Description Protocol (SDP)", RFC 3264, DOI 10.17487/RFC3264, June 2002.
[RFC4566] Handley, M., Jacobson, V. and C. Perkins, "SDP: Session Description Protocol", RFC 4566, DOI 10.17487/RFC4566, July 2006.
[RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, DOI 10.17487/RFC5234, January 2008.

12.2. Informative References

[I-D.ietf-clue-datachannel] Holmberg, C., "CLUE Protocol data channel", Internet-Draft draft-ietf-clue-datachannel-14, August 2016.
[I-D.ietf-mmusic-dtls-sdp] Holmberg, C. and R. Shpount, "Session Description Protocol (SDP) Offer/Answer Considerations for Datagram Transport Layer Security (DTLS) and Transport Layer Security (TLS)", Internet-Draft draft-ietf-mmusic-dtls-sdp-32, October 2017.
[I-D.ietf-mmusic-msrp-usage-data-channel] Drage, K., Makaraju, M., Stoetzer-Bradler, J., Ejzak, R., Marcon, J. and J. Recio, "MSRP over Data Channels", Internet-Draft draft-ietf-mmusic-msrp-usage-data-channel-08, March 2018.
[I-D.ietf-rtcweb-data-protocol] Jesup, R., Loreto, S. and M. Tuexen, "WebRTC Data Channel Establishment Protocol", Internet-Draft draft-ietf-rtcweb-data-protocol-09, January 2015.
[IANA-SDP-Parameters] "Session Description Protocol (SDP) Parameters", Internet Assigned Numbers Authority Protocol Assignments Session Description Protocol (SDP) Parameters
[RFC4960] Stewart, R., "Stream Control Transmission Protocol", RFC 4960, DOI 10.17487/RFC4960, September 2007.
[RFC6455] Fette, I. and A. Melnikov, "The WebSocket Protocol", RFC 6455, DOI 10.17487/RFC6455, December 2011.
[WebRtcAPI] Bergkvist, A., Burnett, D., Jennings, C. and A. Narayanan, "WebRTC 1.0: Real-time Communication Between Browsers", World Wide Web Consortium WD-webrtc-20150210, February 2015.

Appendix A. Generic Data Channel Negotiation Aspects When Not Using DCEP

This appendix summarizes how data channels work in general and discusses some key aspects, which should be considered for the out-of-band negotiation of data channels if DCEP is not used.

A WebRTC application creates a data channel by providing a number of setup parameters (subprotocol, label, maximal number of retransmissions, maximal retransmission time, order of delivery, priority). The application also specifies if it wants to make use of the negotiation using the DCEP [I-D.ietf-rtcweb-data-protocol], or if the application intends to negotiate data channels using the SDP offer/answer protocol.

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

m=application 54111 UDP/DTLS/SCTP webrtc-datachannel
c=IN IP4 192.0.2.1
a=max-message-size:100000
a=sctp-port:5000
a=tls-id:abc3de65cddef001be82
a=setup:actpass
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 application will only use "m" line format "webrtc-datachannel", and will not use other formats in the "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 association.

Note: The above SDP media description does not contain any channel-specific information.

A.1. Stream Identifier Numbering

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

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.

Note:For data channels negotiated with the DCEP, 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].
Note:For data channels negotiated via different protocol from DCEP, no convention is defined by default.

A.2. Generic Data Channel Negotiation Not Using DCEP

A.2.1. Overview

DCEP negotiation only provides for negotiation of data channel transport parameters and does not provide for negotiation of subprotocol specific parameters. DCEP-less data channel negotiation can be defined to allow negotiation of parameters beyond those handled by DCEP, e.g., parameters specific to the subprotocol instantiated on a particular data channel.

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

A.2.2. Opening a Data Channel

In the case of DCEP-less 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 DCEP 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 DCEP-less negotiation, the data channel stack creates the data channel locally without sending any DATA_CHANNEL_OPEN message in-band. However, even if the ICE (Interactive Connectivity Establishment), DTLS and SCTP procedures were already successfully completed, the application can't send data on this data channel until the negotiation is complete with the peer. This is because the peer needs to be aware of and accept the usage of this data channel. The peer, after accepting the data channel offer, can start sending data immediately. This implies that the offerer may receive data channel subprotocol messages before the 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 may be used on the fly as needed just by communicating via non-DCEP means or by even having some local configuration/assumptions on both the peers.

The application then negotiates the data channel properties and subprotocol properties with the peer's application using a mechanism different from DCEP.

The peer then symmetrically creates 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.

A.2.3. Closing a Data Channel

When the application requests the closing of a data channel negotiated without DCEP, the data channel stack always performs an SCTP SSN reset for this channel.

Depending upon the method used for DCEP-less negotiation and the subprotocol associated with the data channel, the closing might in addition be signaled to the peer via SDP offer/answer negotiation.

Authors' Addresses

Keith Drage Unaffiliated EMail: drageke@ntlworld.com
Maridi R. Makaraju (Raju) Nokia 2000 Lucent Lane Naperville, Illinois US EMail: Raju.Makaraju@nokia.com
Juergen Stoetzer-Bradler Unaffiliated EMail: Juergen.S-B.ietf@email.de
Richard Ejzak Unaffiliated EMail: richard.ejzak@gmail.com
Jerome Marcon Unaffiliated EMail: jeromee.marcon@free.fr
Roni Even (editor) Huawei EMail: roni.even@huawei.com