idnits 2.17.1 draft-mmusic-data-channel-sdpneg-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 7 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: 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. -- The document date (January 26, 2015) is 3377 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'ASSUMPTION' is mentioned on line 299, but not defined == Unused Reference: 'RFC3264' is defined on line 1006, but no explicit reference was found in the text == Unused Reference: 'RFC5234' is defined on line 1010, but no explicit reference was found in the text == Unused Reference: 'RFC4975' is defined on line 1046, but no explicit reference was found in the text == Unused Reference: 'RFC4976' is defined on line 1049, but no explicit reference was found in the text == Unused Reference: 'RFC5547' is defined on line 1053, but no explicit reference was found in the text == Unused Reference: 'RFC6135' is defined on line 1058, but no explicit reference was found in the text == Unused Reference: 'RFC6714' is defined on line 1065, but no explicit reference was found in the text ** Obsolete normative reference: RFC 4566 (Obsoleted by RFC 8866) == Outdated reference: A later version (-26) exists of draft-ietf-rtcweb-jsep-08 == Outdated reference: A later version (-26) exists of draft-ietf-mmusic-sctp-sdp-12 -- Possible downref: Non-RFC (?) normative reference: ref. 'WebRtcAPI' -- Obsolete informational reference (is this intentional?): RFC 4960 (Obsoleted by RFC 9260) Summary: 1 error (**), 0 flaws (~~), 13 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 MMUSIC K. Drage, Ed. 3 Internet-Draft M. Makaraju 4 Intended status: Standards Track J. Stoetzer-Bradler 5 Expires: July 30, 2015 Alcatel-Lucent 6 R. Ejzak 7 J. Marcon 8 Unaffiliated 9 January 26, 2015 11 SDP-based "SCTP over DTLS" data channel negotiation 12 draft-mmusic-data-channel-sdpneg-00 14 Abstract 16 The Real-Time Communication in WEB-browsers (RTCWeb) working group is 17 charged to provide protocols to support direct interactive rich 18 communications using audio, video, and data between two peers' web- 19 browsers. For the support of data communication, the RTCWeb working 20 group has in particular defined the concept of bi-directional data 21 channels over SCTP, where each data channel might be used to 22 transport other protocols, called sub-protocols. Data channel setup 23 can be done using either the internal in-band band (also referred to 24 as 'internal' for the rest of the document) WebRTC Data Channel 25 Establishment Protocol or some external out-of-band simply referred 26 to as 'external negotiation' in the rest of the document . This 27 document specifies how the SDP offer/answer exchange can be used to 28 achieve such an external negotiation. Even though data channels are 29 designed for RTCWeb use initially they may be used by other protocols 30 like, but not limited to, the CLUE protocol. This document is 31 intended to be used wherever data channels are used. 33 Status of This Memo 35 This Internet-Draft is submitted in full conformance with the 36 provisions of BCP 78 and BCP 79. 38 Internet-Drafts are working documents of the Internet Engineering 39 Task Force (IETF). Note that other groups may also distribute 40 working documents as Internet-Drafts. The list of current Internet- 41 Drafts is at http://datatracker.ietf.org/drafts/current/. 43 Internet-Drafts are draft documents valid for a maximum of six months 44 and may be updated, replaced, or obsoleted by other documents at any 45 time. It is inappropriate to use Internet-Drafts as reference 46 material or to cite them other than as "work in progress." 48 This Internet-Draft will expire on July 30, 2015. 50 Copyright Notice 52 Copyright (c) 2015 IETF Trust and the persons identified as the 53 document authors. All rights reserved. 55 This document is subject to BCP 78 and the IETF Trust's Legal 56 Provisions Relating to IETF Documents 57 (http://trustee.ietf.org/license-info) in effect on the date of 58 publication of this document. Please review these documents 59 carefully, as they describe your rights and restrictions with respect 60 to this document. Code Components extracted from this document must 61 include Simplified BSD License text as described in Section 4.e of 62 the Trust Legal Provisions and are provided without warranty as 63 described in the Simplified BSD License. 65 Table of Contents 67 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 68 2. Conventions . . . . . . . . . . . . . . . . . . . . . . . . . 3 69 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 70 4. Data Channels . . . . . . . . . . . . . . . . . . . . . . . . 4 71 4.1. Stream identifier numbering . . . . . . . . . . . . . . . 5 72 4.2. Generic external negotiation . . . . . . . . . . . . . . 6 73 4.2.1. Overview . . . . . . . . . . . . . . . . . . . . . . 6 74 4.2.2. Opening a data channel . . . . . . . . . . . . . . . 6 75 4.2.3. Closing a data channel . . . . . . . . . . . . . . . 7 76 5. SDP-based external negotiation . . . . . . . . . . . . . . . 7 77 5.1. SDP syntax . . . . . . . . . . . . . . . . . . . . . . . 8 78 5.1.1. SDP attribute for data channel parameter negotiation 8 79 5.1.1.1. dcmap attribute . . . . . . . . . . . . . . . . . 9 80 5.1.1.2. label parameter . . . . . . . . . . . . . . . . . 10 81 5.1.1.3. subprotocol parameter . . . . . . . . . . . . . . 11 82 5.1.1.4. max-retr parameter . . . . . . . . . . . . . . . 11 83 5.1.1.5. max-time parameter . . . . . . . . . . . . . . . 11 84 5.1.1.6. ordered parameter . . . . . . . . . . . . . . . . 11 85 5.1.2. Sub-protocol specific attributes . . . . . . . . . . 12 86 5.2. Procedures . . . . . . . . . . . . . . . . . . . . . . . 13 87 5.2.1. Managing stream identifiers . . . . . . . . . . . . . 13 88 5.2.2. Opening a data channel . . . . . . . . . . . . . . . 13 89 5.2.3. Closing a data channel . . . . . . . . . . . . . . . 15 90 5.2.4. Various SDP offer/answer scenarios and considerations 16 91 6. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 17 92 7. Security Considerations . . . . . . . . . . . . . . . . . . . 19 93 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19 94 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 20 95 10. CHANGE LOG . . . . . . . . . . . . . . . . . . . . . . . . . 20 96 10.1. Changes against 'draft-ejzak-mmusic-data-channel- 97 sdpneg-02' . . . . . . . . . . . . . . . . . . . . . . . 20 99 10.2. Changes against '-01' . . . . . . . . . . . . . . . . . 21 100 10.3. Changes against '-00' . . . . . . . . . . . . . . . . . 21 101 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 21 102 11.1. Normative References . . . . . . . . . . . . . . . . . . 22 103 11.2. Informative References . . . . . . . . . . . . . . . . . 22 104 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 23 106 1. Introduction 108 The RTCWeb working group has defined the concept of bi-directional 109 data channels running on top of SCTP/DTLS. RTCWeb leaves it open for 110 other applications to use data channels and its in-band or out-of- 111 band protocol for creating them. Each data channel consists of 112 paired SCTP streams sharing the same SCTP Stream Identifier. Data 113 channels are created by endpoint applications through the WebRTC API, 114 or other users of data channel like CLUE, and can be used to 115 transport proprietary or well-defined protocols, which in the latter 116 case can be signaled by the data channel "sub-protocol" parameter, 117 conceptually similar to the WebSocket "sub-protocol". However, apart 118 from the "sub-protocol" value transmitted to the peer, RTCWeb leaves 119 it open how endpoint applications can agree on how to instantiate a 120 given sub-protocol on a data channel, and whether it is signaled in- 121 band or out-of-band (or both). In particular, the SDP offer 122 generated by the application includes no channel-specific 123 information. 125 This document defines SDP-based out-of-band negotiation procedures to 126 establish data channels for transport of well-defined sub-protocols. 128 2. Conventions 130 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 131 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 132 document are to be interpreted as described in [RFC2119]. 134 3. Terminology 136 This document uses the following terms: 138 Data channel: A bidirectional channel consisting of paired SCTP 139 outbound and inbound streams. 141 Data channel stack: An entity which, upon application request, 142 runs data channel protocol to keep track of states, sending and 143 receive data. If the application is browser based Javascript 144 application then this stack resides in the browser. If the 145 application is a native application then this stack resides in 146 application and accessible to it via some sort of APIs. 148 Data channel properties: fixed properties assigned to a data 149 channel at the time of its creation. Some of these properties 150 determine the way the data channel stack transmits data on this 151 channel (e.g., stream identifier, reliability, order of 152 delivery...) 154 DCEP - Data Channel Establishment Protocol defined in 155 [I-D.ietf-rtcweb-data-protocol]. 157 External negotiation: Data channel negotiation based on SDP offer/ 158 answer outlined in this specification. 160 Internal negotiation: Data channel negotiation based on Data 161 Channel Establishment Protocol defined in 162 [I-D.ietf-rtcweb-data-protocol]. 164 In-band: transmission through the peer-to-peer SCTP association. 166 In-band negotiation: data channel negotiation based Data Channel 167 Establishment Protocol defined in [I-D.ietf-rtcweb-data-protocol]. 169 Out-of-band: transmission through the application signaling path. 171 Peer: From the perspective of one of the agents in a session, its 172 peer is the other agent. Specifically, from the perspective of 173 the SDP offerer, the peer is the SDP answerer. From the 174 perspective of the SDP answerer, the peer is the SDP offerer. 176 Stream identifier: the identifier of the outbound and inbound SCTP 177 streams composing a data channel. 179 4. Data Channels 181 This section summarizes how data channels work in general. Note that 182 the references to 'browser' here is intentional as in this specific 183 example the data channel user is a webrtc enabled browser. 185 A WebRTC application creates a data channel via the Data Channel API, 186 by providing a number of setup parameters (sub-protocol, label, 187 reliability, order of delivery, priority). The application also 188 specifies if it wants to make use of the in-band negotiation using 189 the DCEP [I-D.ietf-rtcweb-data-protocol], or if the application 190 intends to perform an "external negotiation" using some other in-band 191 or out-of-band mechanism. 193 In any case, the SDP offer generated by the browser is per 194 [I-D.ietf-mmusic-sctp-sdp]. In brief, it contains one m-line for the 195 SCTP association on top of which data channels will run, and one 196 attribute per protocol assigned to the SCTP ports: 198 OPEN ISSUE: The syntax in [I-D.ietf-mmusic-sctp-sdp] may change as 199 that document progresses. In particular we expect "webrtc- 200 datachannel" to become a more general term. 202 m=application 54111 UDP/DTLS/SCTP webrtc-datachannel 203 c=IN IP4 79.97.215.79 204 a=max-message-size:100000 205 a=sctp-port 5000 206 a=setup:actpass 207 a=connection:new 208 a=fingerprint:SHA-1 \ 209 4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB 211 Note: A WebRTC browser will only use m-line format "webrtc- 212 datachannel", and will not use other formats in the m-line for other 213 protocols such as t38. [I-D.ietf-mmusic-sctp-sdp] supports only one 214 SCTP association to be established on top of a DTLS session. 216 Note: This SDP syntax does not contain any channel-specific 217 information. 219 4.1. Stream identifier numbering 221 Independently from the requested type of negotiation, the application 222 creating a data channel can either pass to the browser the stream 223 identifier to assign to the data channel or else let the browser pick 224 one identifier from the ones unused. 226 To avoid glare situations, each endpoint can moreover own an 227 exclusive set of stream identifiers, in which case an endpoint can 228 only create a data channel with a stream identifier it owns. 230 Which set of stream identifiers is owned by which endpoint is 231 determined by convention or other means. 233 For data channels negotiated in-band, one endpoint owns by 234 convention the even stream identifiers, whereas the other owns the 235 odd stream identifiers, as defined in 236 [I-D.ietf-rtcweb-data-protocol]. 238 For data channels externally negotiated, no convention is defined 239 by default. 241 4.2. Generic external negotiation 243 4.2.1. Overview 245 In-band negotiation only provides for negotiation of data channel 246 transport parameters and does not provide for negotiation of sub- 247 protocol specific parameters. External negotiation can be defined to 248 allow negotiation of parameters beyond those handled by in-band 249 negotiation, e.g., parameters specific to the sub-protocol 250 instantiated on a particular data channel. See Section 5.1.2 for an 251 example of such a parameter. 253 The following procedures are common to all methods of external 254 negotiation, whether in-band (communicated using proprietary means on 255 an already established data channel) or out-of-band (using SDP or 256 some other protocol associated with the signaling channel). 258 4.2.2. Opening a data channel 260 In the case of external negotiation, the endpoint application has the 261 option to fully control the stream identifier assignments. However 262 these assignments have to coexist with the assignments controlled by 263 the data channel stack for the in-band negotiated data channels (if 264 any). It is the responsibility of the application to ensure 265 consistent assignment of stream identifiers. 267 When the application requests the creation of a new data channel to 268 be set up via external negotiation, the data channel stack creates 269 the data channel locally without sending any DATA CHANNEL OPEN 270 message in-band, and sets the data channel state to Connecting if the 271 SCTP association is not yet established, or sets the data channel 272 state to Open if the SCTP association is already established. The 273 side which starts external negotiation creates data channel using 274 underlying data channel stack API and the data channel is put into 275 open state immediately (assuming ICE, SCTP procedures were already 276 done). However, the application can't send data on this data channel 277 until external negotiation is complete with the peer. This is 278 because peer needs to be aware and accept the data channel via 279 external negotiation. The peer after accepting the data channel 280 offer can start sending data immediately. This implies that offerer 281 may get data channel message before external negotiation is complete 282 and the application should be ready to handle it. 284 If the peer rejects the data channel part of the offer then it 285 doesn't have to do anything as the data channel was not created using 286 the stack. The offerer on the other hand needs to close the data 287 channel that was opened by invoking relevant data channel stack API 288 procedures. 290 It is also worth noting that a data channel stack implementation may 291 not provide any API to create and close data channels; instead the 292 data channels are used on the fly as needed just by communicating via 293 external means or by even having some local configuration/assumptions 294 on both the peers. 296 The application then externally negotiates the data channel 297 properties and sub-protocol properties with the peer's application. 299 [ASSUMPTION] The peer must then symmetrically create a data channel 300 with these negotiated data channel properties. This is the only way 301 for the peer's data channel stack to know which properties to apply 302 when transmitting data on this channel. The data channel stack must 303 allow data channel creation with any non-conflicting stream 304 identifier so that both peers can create the data channel with the 305 same stream identifier. 307 In case the external negotiation is correlated with an SDP offer/ 308 answer exchange that establishes the SCTP association, the SCTP 309 initialization completion triggers a callback from the data channel 310 stack to an application on both the ends to change the data channel 311 state from Connecting to Open. The details of this interface is 312 specific to the data channel user application. Browser based 313 applications (could include hybrid apps) will use [WebRtcAPI], while 314 native applications use a compatible API, which is yet to be 315 specified. See Section 5.2.2 for details on when the data channel 316 stack can assume the data channel is open, and on when the 317 application can assume the data channel is open. 319 4.2.3. Closing a data channel 321 When the application requests the closing of an externally negotiated 322 data channel, the data channel stack always performs an in-band SSN 323 reset for this channel. 325 Depending upon the method used for external negotiation and the sub- 326 protocol associated with the data channel, the closing might in 327 addition be signaled to the peer via external negotiation. 329 5. SDP-based external negotiation 331 This section defines a method of external negotiation by which two 332 clients can negotiate data channel-specific and sub-protocol-specific 333 parameters, using the out-of-band SDP offer/answer exchange. This 334 SDP extension can only be used with SDP offer/answer model. 336 5.1. SDP syntax 338 Two new SDP attributes are defined to support external negotiation of 339 data channels. The first attribute provides for negotiation of 340 channel-specific parameters. The second attribute provides for 341 negotiation of sub-protocol-specific parameters. 343 5.1.1. SDP attribute for data channel parameter negotiation 345 Associated with the SDP "m" line that defines the SCTP association 346 for data channels (defined in Section 4), each SDP offer and answer 347 includes an attribute line that defines the data channel parameters 348 for each data channel to be negotiated. Each attribute line 349 specifies the following parameters for a data channel: Stream 350 Identifier, sub-protocol, label, reliability, order of delivery, and 351 priority. Conveying a reliable data channel is achieved by including 352 neither 'max-retr' nor 'max-time'. Conveying a partially reliable 353 data channel is achieved by including only one of 'max-retr' or 'max- 354 time'. By definition max-retr and max-time are mutually exclusive, 355 so only one of them can be present in a=dcmap. If an SDP offer 356 contains both of these parameters then such an SDP offer will be 357 rejected. If an SDP answer contains both of these parameters then 358 the offerer may treat it as an error and may assume the associated 359 SDP offer/answer failed and may take appropriate recovery actions. 360 These recovery options are outside the scope of this specification. 361 Following is an example of the attribute line for sub-protocol "BFCP" 362 and stream id "2": 364 a=dcmap:2 subprotocol="BFCP";label="channel 2" 366 The SDP answer shall echo the same subprotocol, max-retr, max-time, 367 ordered parameters, if those were present in the offer, and may 368 include a label parameter. They may appear in any order, which could 369 be different from the SDP offer, in the SDP answer. 371 The same information MUST be replicated without changes in any 372 subsequent offer or answer, as long as the data channel is still 373 opened at the time of offer or answer generation. 375 Note: This attribute is derived from attribute "webrtc- 376 DataChannel", which was defined in old version 03 of the following 377 draft, but which was removed along with any support for SDP 378 external negotiation in subsequent versions: 379 [I-D.ietf-mmusic-sctp-sdp]. 381 Note: This document does not provide a complete specification of 382 how to negotiate the use of a data channel to transport BFCP. 383 Procedures specific to each sub-protocol such as BFCP will be 384 documented elsewhere. The use of BFCP is only an example of how 385 the generic procedures described herein might apply to a specific 386 sub-protocol. 388 The intention of exchanging these attributes is to create data 389 channels on both the peers with the same set of attributes without 390 actually using [I-D.ietf-rtcweb-data-protocol]. It is assumed that 391 the data channel properties (reliable/partially reliable, ordered/ 392 unordered) are suitable per the sub-protocol transport requirements. 393 Data channel types defined in [I-D.ietf-rtcweb-data-protocol] are 394 mapped to SDP in the following manner: 396 DATA_CHANNEL_RELIABLE 397 a=dcmap:2 subprotocol="BFCP";label="channel 2" 399 DATA_CHANNEL_RELIABLE_UNORDERED 400 a=dcmap:2 subprotocol="BFCP";label="channel 2";\ 401 ordered=0 403 DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT 404 a=dcmap:2 subprotocol="BFCP";label="channel 2";\ 405 max-retr=3 407 DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT_UNORDERED 408 a=dcmap:2 subprotocol="BFCP";label="channel 2";\ 409 max-retr=3;ordered=0; 411 DATA_CHANNEL_PARTIAL_RELIABLE_TIMED 412 a=dcmap:2 subprotocol="BFCP";label="channel 2";\ 413 max-time=10000; 415 DATA_CHANNEL_PARTIAL_RELIABLE_TIMED_UNORDERED 416 a=dcmap:2 subprotocol="BFCP";label="channel 2";\ 417 max-time=10000; ordered=0 419 5.1.1.1. dcmap attribute 421 The 'stream' parameter indicates the actual stream identifier within 422 the association used to form the channel. Stream is a mandatory 423 parameter and is noted directly after the "a=dcmap:" attribute's 424 colon. 426 Formal Syntax: 427 TBD: Should this be moved to SDP grammar section? 429 Name: dcmap 431 Value: dcmap-value 432 Usage Level: media 434 Charset Dependent: no 436 Syntax: 438 dcmap-value = dcmap-stream-id 439 [ SP dcmap-opt *(";" dcmap-opt) ] 440 dcmap-opt = ordering-opt / subprotocol-opt / label-opt 441 / maxretr-opt / maxtime-opt 442 ; Either only maxretr-opt or maxtime-opt 443 ; is present. 444 ; Both MUST not be present. 446 dcmap-stream-id = 1*DIGIT 447 ordering-opt = "ordered=" ordering-value 448 ordering-value = "0"/"1" 449 subprotocol-opt = "subprotocol=" quoted-string 450 label-opt = "label=" quoted-string 451 maxretr-opt = "max-retr=" maxretr-value 452 maxretr-value = 454 ; number of retransmissions 455 maxtime-opt = "max-time=" maxtime-value 456 maxtime-value = 458 ; milliseconds 460 quoted-string = DQUOTE *(quoted-char / escaped-char) DQUOTE 461 quoted-char = SP / quoted-visible 462 quoted-visible = %21 / %23-24 / %26-7E ; VCHAR without " or % 463 escaped = "%" HEXDIG HEXDIG 464 DQUOTE = 465 integer = 467 Examples: 469 a=dcmap:0 470 a=dcmap:1 subprotocol="BFCP";max-time=60000 471 a=dcmap:2 subprotocol="MSRP";ordered;label="MSRP" 472 a=dcmap:3 label="Label 1";unordered;max-retr=5 473 a=dcmap:4 label="foo%09bar";ordered;max-time=15000;max-retr=3 475 5.1.1.2. label parameter 477 The 'label' parameter indicates the name of the channel. It 478 represents a label that can be used to distinguish, in the context of 479 the WebRTC API, an RTCDataChannel object from other RTCDataChannel 480 objects. This parameter maps to the 'Label' parameter defined in 481 [I-D.ietf-rtcweb-data-protocol]. The 'label' parameter is optional. 482 If it is not present, then its value defaults to the empty string. 484 Note: The empty string may also be explicitly used as 'label' value, 485 such that 'label=""' is equivalent to the 'label' parameter not being 486 present at all. [I-D.ietf-rtcweb-data-protocol] allows the 487 DATA_CHANNEL_OPEN message's 'Label' value to be an empty string. 489 5.1.1.3. subprotocol parameter 491 The 'subprotocol' parameter indicates which protocol the client 492 expects to exchange via the channel. 'Subprotocol' is an optional 493 parameter. If the 'subprotocol' parameter is not present, then its 494 value defaults to the empty string. 496 5.1.1.4. max-retr parameter 498 This parameter indicates that the data channel is partially reliable. 499 The 'max-retr' parameter indicates the max times a user message will 500 be retransmitted. The max-retr parameter is optional. If the max- 501 retr parameter is not present, then the maximal number of 502 retransmissions is determined as per the generic SCTP retransmission 503 rules as specified in [RFC4960]. This parameter maps to the 'Number 504 of RTX' parameter defined in [I-D.ietf-rtcweb-data-protocol]. 506 5.1.1.5. max-time parameter 508 This parameter indicates that the data channel is partially reliable. 509 A user messages will no longer be transmitted or retransmitted after 510 a specified life-time given in milliseconds in the 'max-time' 511 parameter. The max-time parameter is optional. If the max-time 512 parameter is not present, then the generic SCTP retransmission timing 513 rules apply as specified in [RFC4960]. This parameter maps to the 514 'Lifetime in ms' parameter defined in 515 [I-D.ietf-rtcweb-data-protocol]. 517 5.1.1.6. ordered parameter 519 The ordered' parameter indicates that DATA chunks in the channel MUST 520 be dispatched to the upper layer by the receiver while preserving the 521 order. The ordered parameter is optional and takes two values: "0" 522 for ordered and "1" for ordered delivery with "1" as the default 523 value. Any other value is ignored and default ordered is assumed. 524 If the ordered parameter is absent, the receiver is required to 525 deliver DATA chunks to the upper layer in proper order. This 526 parameter maps to the ordered or unorderd data channel types as 527 defined in [I-D.ietf-rtcweb-data-protocol]. 529 5.1.2. Sub-protocol specific attributes 531 In the SDP, each data channel declaration MAY also be followed by 532 other SDP attributes specific to the sub-protocol in use. Each of 533 these attributes is represented by one new attribute line, and it 534 includes the contents of a media-level SDP attribute already defined 535 for use with this (sub)protocol in another IETF specification. Sub- 536 protocol-specific attributes might also be defined for exclusive use 537 with data channel transport, but should use the same syntax described 538 here for other sub-protocol-specific attributes. 540 Each sub-protocol specific SDP attribute that would normally be used 541 to negotiate the subprotocol using SDP is replaced with an attribute 542 of the form "a=dcsa: stream-id original-attribute", where dcsa stands 543 for "data channel sub-protocol attribute", stream-id is the sctp 544 stream identifier assigned to this sub-protocol instance, and 545 original-attribute represents the contents of the sub-protocol 546 related attribute to be included. 548 Formal Syntax: 550 Name: dcsa 552 Value: dcsa-value 554 Usage Level: media 556 Charset Dependent: no 558 Syntax: 560 dcsa-value = stream-id SP attribute 561 attribute = 563 Examples: 565 a=dcsa:2 accept-types:text/plain 567 Thus in the example above, the original attribute line "a=accept- 568 types:text/plain" is represented by the attribute line "a=dcsa:2 569 accept-types:text/plain", which specifies that this instance of MSRP 570 being transported on the sctp association using the data channel with 571 stream id 2 accepts plain text files. The above example creates a 572 reliable, ordered data channel. 574 As opposed to the data channel setup parameters, these parameters are 575 subject to offer/answer negotiation following the procedures defined 576 in the sub-protocol specific documents. 578 The same syntax applies to any other SDP attribute required for 579 negotiation of this instance of the sub-protocol. 581 Note: This document does not provide a complete specification of how 582 to negotiate the use of a data channel to transport MSRP. Procedures 583 specific to each sub-protocol such as MSRP will be documented 584 elsewhere. The use of MSRP is only an example of how the generic 585 procedures described herein might apply to a specific sub-protocol. 587 5.2. Procedures 589 5.2.1. Managing stream identifiers 591 For the SDP-based external negotiation described in this document, 592 the initial offerer based "SCTP over DTLS" owns by convention the 593 even stream identifiers whereas the initial answerer owns the odd 594 stream identifiers. This ownership is invariant for the whole 595 lifetime of the signaling session, e.g. it does not change if the 596 initial answerer sends a new offer to the initial offerer. 598 This specification allows simultaneous use of external and internal 599 negotiation. However, a single stream is managed using one method at 600 a time. Stream ids that are not currently used in SDP can be used 601 for internal negotiation. Stream id allocation per SDP based 602 external negotiation may not align with DTLS role based allocation. 603 This could cause glare conditions when one side trying to do external 604 negotiation on a stream id while the other end trying to open data 605 channel on the same stream id using internal negotiation. To avoid 606 these glare conditions this specification recommends that the data 607 channel stack user always selects stream ids per SDP offer/answer 608 rule even when internal negotiation is used. To avoid glare 609 conditions, it is possible to come up with a different stream id 610 allocation scheme, but such schemes are outside the scope of this 611 specification. 613 5.2.2. Opening a data channel 615 The procedure for opening a data channel using external negotiation 616 starts with the agent preparing to send an SDP offer. If a peer 617 receives an SDP offer before getting to send a new SDP offer with 618 data channels that are to be externally negotiated, or loses an SDP 619 offer glare resolution procedure in this case, it must wait until the 620 ongoing SDP offer/answer completes before resuming the external 621 negotiation procedure. 623 The agent that intends to send an SDP offer to create data channels 624 through SDP-based external negotiation performs the following: 626 o Creates data channels using stream identifiers from the owned set 627 (see Section 5.2.1). 629 o As described in Section 4.2.2, if the SCTP association is not yet 630 established, then the newly created data channels are in the 631 Connecting state, else if the SCTP association is already 632 established, then the newly created data channels are in the Open 633 state. 635 o Generates a new SDP offer. In the case of the browser based 636 applications the browser generates the offer via the createOffer() 637 API call [I-D.ietf-rtcweb-jsep]. 639 o Determines the list of stream identifiers assigned to data 640 channels opened through external negotiation. 642 o Completes the SDP offer with the dcmap and dcsa attributes needed, 643 if any, for each externally-negotiated data channel, as described 644 in Section 5.1. 646 o Sends the SDP offer. 648 The peer receiving such an SDP offer performs the following: 650 o Applies the SDP offer. Note that the browser ignores data channel 651 specific attributes in the SDP. 653 o Analyzes the channel parameters and sub-protocol attributes to 654 determine whether to accept each offered data channel. 656 o For accepted data channels, creates peer instances for the data 657 channels with the browser using the channel parameters described 658 in the SDP offer. Note that the browser is asked to create data 659 channels with stream identifiers not "owned" by the agent. 661 o As described in Section 4.2.2, if the SCTP association is not yet 662 established, then the newly created data channels are in the 663 Connecting state, else if the SCTP association is already 664 established, then the newly created data channels are in the Open 665 state. 667 o Generates an SDP answer. 669 o Completes the SDP answer with the dcmap and optional dcsa 670 attributes needed for each externally-negotiated data channel, as 671 described in Section 5.1. 673 o Sends the SDP answer. 675 The agent receiving such an SDP answer performs the following: 677 o Closes any created data channels (whether in Connecting or Open 678 state) for which the expected dcmap and dcsa attributes are not 679 present in the SDP answer. 681 o Applies the SDP answer. 683 Any data channels in Connecting state are transitioned to the Open 684 state when the SCTP association is established. 686 Each agent application MUST wait to send data until it has 687 confirmation that the data channel at the peer is in the Open state. 688 For webrtc, this is when both data channel stacks have channel 689 parameters instantiated. This occurs: 691 o At both peers when a data channel is created without an 692 established SCTP association, as soon as the data channel stacks 693 report that the data channel transitions to the Open state from 694 the Connecting state. 696 o At the agent receiving an SDP offer for which there is an 697 established SCTP association, as soon as it creates an externally 698 negotiated data channel in the Open state based on information 699 signaled in the SDP offer. 701 o At the agent sending an SDP offer to create a new externally 702 negotiated data channel for which there is an established SCTP 703 association, when it receives the SDP answer confirming acceptance 704 of the data channel or when it begins to receive data on the data 705 channel from the peer, whichever occurs first. 707 5.2.3. Closing a data channel 709 When the application requests the closing of a data channel that was 710 externally negotiated, the data channel stack always performs an in- 711 band SSN reset for this channel. 713 It is specific to the sub-protocol whether this closing must in 714 addition be signaled to the peer via a new SDP offer/answer exchange. 716 A data channel can be closed by sending a new SDP offer which 717 excludes the dcmap and dcsa attributes lines for the data channel. 718 The port value for the m line should not be changed (e.g., to zero) 719 when closing a data channel (unless all data channels are being 720 closed and the SCTP association is no longer needed), since this 721 would close the SCTP association and impact all of the data channels. 722 If answerer accepts the SDP offer then it MUST also exclude the 723 corresponding attribute lines in the answer. In addition to that, 724 SDP answerer may exclude other data channels which were closed but 725 not yet communicated to the peer. So, offerer MUST inspect the 726 answer to see if it has to close other data channels which are now 727 not included in the answer 729 If a new SDP offer/answer is used to close data channels then the 730 data channel(s) should only be closed by the answerer/offerer after 731 successful SDP answer is sent/received. 733 This delayed close is to handle cases where a successful SDP 734 answer is not received, in which case the state of session should 735 be kept per the last successful SDP offer/answer. 737 If a client receives a data channel close indication (due to inband 738 SSN reset or some other reason) without associated SDP offer then an 739 SDP offer which excludes this closed data channel SHOULD be 740 generated. 742 The application must also close any data channel that was externally 743 negotiated, for which the stream identifiers are not listed in an 744 incoming SDP offer. 746 A closed data channel using local close (SCTP reset), without an 747 additional SDP offer/answer to close it, may be reused for a new data 748 channel. This can only be done via new SDP offer/answer, describing 749 the new sub-protocol and its attributes, only after the corresponding 750 data channel close acknowledgement is received from the peer (i.e. 751 SCTP reset of both incoming and outgoing streams is completed). This 752 restriction is to avoid the race conditions between arrival of "SDP 753 offer which reuses stream" with "SCTP reset which closes outgoing 754 stream" at the peer 756 5.2.4. Various SDP offer/answer scenarios and considerations 758 SDP offer has no a=dcmap attributes 760 * Initial SDP offer: No data channel negotiated yet. 762 * Subsequent SDP offer: All the externally negotiated data 763 channels must be closed now. The DTLS/SCTP association remains 764 open for external or internal negotiation of data channels. 766 SDP answer has no a=dcmap attributes 768 * Initial SDP answer: Either the peer does not support dcmap 769 attributes or it rejected all the data channels. In either 770 case offerer closes all the externally negotiated data channels 771 that were open at the time of initial offer. The DTLS/SCTP 772 association will still be setup. 774 * Sub-sequent SDP answer: All the externally negotiated data 775 channels must be closed now. The DTLS/SCTP association remains 776 open for future external or internal negotiation of data 777 channels. 779 SDP offer has no a=dcsa attributes for a data channel. 781 * This is allowed and indicates there are no sub-protocol 782 parameters to convey. 784 SDP answer has no a=dcsa attributes for a data channel. 786 * This is allowed and indicates there are no sub-protocol 787 parameters to convey in the SDP answer. The number of dcsa 788 attributes in the SDP answer does not have to match the number 789 of dcsa attributes in the SDP offer. 791 6. Examples 793 SDP offer: 794 m=application 10001 UDP/DTLS/SCTP webrtc-datachannel 795 c=IN IP4 10.10.10.1 796 a=max-message-size:100000 797 a=sctp-port 5000 798 a=setup:actpass 799 a=connection:new 800 a=fingerprint:SHA-1 \ 801 4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB 802 a=dcmap:0 subprotocol="BFCP";label="BFCP" 804 SDP answer: 805 m=application 10002 UDP/DTLS/SCTP webrtc-datachannel 806 c=IN IP4 10.10.10.2 807 a=max-message-size:100000 808 a=sctp-port 5002 809 a=setup:passive 810 a=connection:new 811 a=fingerprint:SHA-1 \ 812 5B:AD:67:B1:3E:82:AC:3B:90:02:B1:DF:12:5D:CA:6B:3F:E5:54:FA 814 Figure 1: Example 1 816 In the above example the SDP answerer rejected the data channel with 817 stream id 0 either for explicit reasons or because it does not 818 understand the a=dcmap attribute. As a result the offerer will close 819 the data channel created with the external negotiation option. The 820 SCTP association will still be setup over DTLS. At this point 821 offerer or answerer may use internal negotiation to open data 822 channels. 824 SDP offer: 825 m=application 10001 UDP/DTLS/SCTP webrtc-datachannel 826 c=IN IP4 10.10.10.1 827 a=max-message-size:100000 828 a=sctp-port 5000 829 a=setup:actpass 830 a=connection:new 831 a=fingerprint:SHA-1 \ 832 4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB 833 a=dcmap:0 subprotocol="BFCP";label="BFCP" 834 a=dcmap:2 subprotocol="MSRP";label="MSRP" 835 a=dcsa:2 accept-types:message/cpim text/plain text/ 836 a=dcsa:2 path:msrp://alice.example.com:10001/2s93i93idj;dc 838 SDP answer: 839 m=application 10002 UDP/DTLS/SCTP webrtc-datachannel 840 c=IN IP4 10.10.10.2 841 a=max-message-size:100000 842 a=sctp-port 5002 843 a=setup:passive 844 a=connection:new 845 a=fingerprint:SHA-1 \ 846 5B:AD:67:B1:3E:82:AC:3B:90:02:B1:DF:12:5D:CA:6B:3F:E5:54:FA 847 a=dcmap:2 subprotocol="MSRP";label="MSRP" 848 a=dcsa:2 accept-types:message/cpim text/plain 849 a=dcsa:2 path:msrp://bob.example.com:10002/si438dsaodes;dc 851 Figure 2: Example 2 853 In the above example SDP offer contains data channels for BFCP and 854 MSRP sub-protocols. SDP answer rejected BFCP and accepted MSRP. So, 855 the offerer should close the data channel for BFCP and both offerer 856 and answerer may start using MSRP data channel (after SCTP/DTLS 857 association is setup). The data channel with stream id 0 is free and 858 can be used for future internal or external negotiation. 860 Continuing on the earlier example in Figure 1. 862 Subsequent SDP offer: 863 m=application 10001 UDP/DTLS/SCTP webrtc-datachannel 864 c=IN IP4 10.10.10.1 865 a=max-message-size:100000 866 a=sctp-port 5000 867 a=setup:actpass 868 a=connection:existing 869 a=fingerprint:SHA-1 \ 870 4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB 871 a=dcmap:4 subprotocol="MSRP";label="MSRP" 872 a=dcsa:4 accept-types:message/cpim text/plain 873 a=dcsa:4 path:msrp://alice.example.com:10001/2s93i93idj;dc 875 Subsequent SDP answer: 876 m=application 10002 UDP/DTLS/SCTP webrtc-datachannel 877 c=IN IP4 10.10.10.2 878 a=max-message-size:100000 879 a=sctp-port 5002 880 a=setup:passive 881 a=connection:existing 882 a=fingerprint:SHA-1 \ 883 5B:AD:67:B1:3E:82:AC:3B:90:02:B1:DF:12:5D:CA:6B:3F:E5:54:FA 884 a=dcmap:4 subprotocol="MSRP";label="MSRP" 885 a=dcsa:4 accept-types:message/cpim text/plain 886 a=dcsa:4 path:msrp://bob.example.com:10002/si438dsaodes;dc 888 Figure 3: Example 3 890 The above example is a continuation of the example in Figure 1. The 891 SDP offer now removes the MSRP data channel with stream id 2, but 892 opens a new MSRP data channel with stream id 4. The answerer 893 accepted the entire offer. As a result the offerer closes the 894 earlier negotiated MSRP related data channel and both offerer and 895 answerer may start using new the MSRP related data channel. 897 7. Security Considerations 899 No security considerations are envisaged beyond those already 900 documented in [RFC4566] 902 8. IANA Considerations 904 To be completed. As [I-D.ietf-rtcweb-data-protocol] this document 905 should refer to IANA's WebSocket Subprotocol Name Registry defined in 906 [RFC6455]. 908 9. Acknowledgments 910 The authors wish to acknowledge the borrowing of ideas from other 911 internet drafts by Salvatore Loreto, Gonzalo Camarillo, Peter Dunkley 912 and Gavin Llewellyn, and to thank Paul Kyzivat, Jonathan Lennox, 913 Christian Groves and Uwe Rauschenbach for their invaluable comments. 915 10. CHANGE LOG 917 10.1. Changes against 'draft-ejzak-mmusic-data-channel-sdpneg-02' 919 o Removal of note "[ACTION ITEM]" from section "subprotocol 920 parameter". As [I-D.ietf-rtcweb-data-protocol] this document 921 should refer to IANA's WebSocket Subprotocol Name Registry defined 922 in [RFC6455]. 924 o In whole document, replacement of "unreliable" with "partially 925 reliable", which is used in [I-D.ietf-rtcweb-data-channel] and in 926 [I-D.ietf-rtcweb-data-protocol] in most places. 928 o Clarification of the semantic if the "max-retr" parameter is not 929 present in an a=dcmap attribute line. In section "max-retr 930 parameter" the sentence "The max-retr parameter is optional with 931 default value unbounded" was replaced with "The max-retr parameter 932 is optional. If the max-retr parameter is not present, then the 933 maximal number of retransmissions is determined as per the generic 934 SCTP retransmission rules as specified in [RFC4960]". 936 o Clarification of the semantic if the "max-time" parameter is not 937 present in an a=dcmap attribute line. In section "max-time 938 parameter" the sentence "The max-time parameter is optional with 939 default value unbounded" was replaced with "The max-time parameter 940 is optional. If the max-time parameter is not present, then the 941 generic SCTP retransmission timing rules apply as specified in 942 [RFC4960]". 944 o In section "label parameter" the sentence "Label is a mandatory 945 parameter." was removed and following new sentences (including the 946 note) were added: "The 'label' parameter is optional. If it is 947 not present, then its value defaults to the empty string. Note: 948 The empty string may also be explicitly used as 'label' value, 949 such that 'label=""' is equivalent to the 'label' parameter not 950 being present at all. [I-D.ietf-rtcweb-data-protocol] allows the 951 DATA_CHANNEL_OPEN message's 'Label' value to be an empty string." 953 o In section "subprotocol parameter" the sentence "Subprotocol is a 954 mandatory parameter." was replaced with "'Subprotocol' is an 955 optional parameter. If the 'subprotocol' parameter is not 956 present, then its value defaults to the empty string." 958 o In the "Examples" section, in the first two SDP offer examples in 959 the a=dcmap attribute lines 'label="BGCP"' was replaced with 960 'label="BFCP"'. 962 o In all examples, the m-line proto value "DTLS/SCTP" was replaced 963 with "UDP/DTLS/SCTP" and the "a=fmtp" attribute lines were 964 replaced with "a=max-message-size" attribute lines, as per draft- 965 ietf-mmusic-sctp-sdp-12. 967 10.2. Changes against '-01' 969 o Formal syntax for dcmap and dcsa attribute lines. 971 o Making subprotocol as an optional parameter in dcmap. 973 o Specifying disallowed parameter combinations for max-time and max- 974 retr. 976 o Clarifications on data channel close procedures. 978 10.3. Changes against '-00' 980 o Revisions to identify difference between internal and external 981 negotiation and their usage. 983 o Introduction of more generic terminology, e.g. "application" 984 instead of "browser". 986 o Clarification of how "max-retr and max-time affect the usage of 987 unreliable and reliable data channels. 989 o Updates of examples to take into account the SDP syntax changes 990 introduced with draft-ietf-mmusic-sctp-sdp-07. 992 o Removal of the SCTP port number from the a=dcmap and a=dcsa 993 attributes as this is now contained in the a=sctp-port attribute, 994 and as draft-ietf-mmusic-sctp-sdp-07 supports only one SCTP 995 association on top of the DTLS connection. 997 11. References 998 11.1. Normative References 1000 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1001 Requirement Levels", BCP 14, RFC 2119, March 1997. 1003 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 1004 Description Protocol", RFC 4566, July 2006. 1006 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 1007 with Session Description Protocol (SDP)", RFC 3264, June 1008 2002. 1010 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 1011 Specifications: ABNF", STD 68, RFC 5234, January 2008. 1013 [I-D.ietf-rtcweb-jsep] 1014 Uberti, J., Jennings, C., and E. Rescorla, "Javascript 1015 Session Establishment Protocol", draft-ietf-rtcweb-jsep-08 1016 (work in progress), October 2014. 1018 [I-D.ietf-rtcweb-data-channel] 1019 Jesup, R., Loreto, S., and M. Tuexen, "WebRTC Data 1020 Channels", draft-ietf-rtcweb-data-channel-13 (work in 1021 progress), January 2015. 1023 [I-D.ietf-mmusic-sctp-sdp] 1024 Holmberg, C., Loreto, S., and G. Camarillo, "Stream 1025 Control Transmission Protocol (SCTP)-Based Media Transport 1026 in the Session Description Protocol (SDP)", draft-ietf- 1027 mmusic-sctp-sdp-12 (work in progress), January 2015. 1029 [WebRtcAPI] 1030 Bergkvist, A., Burnett, D., Jennings, C., and A. 1031 Narayanan, "WebRTC 1.0: Real-time Communication Between 1032 Browsers", World Wide Web Consortium WD-webrtc-20130910, 1033 September 2013, 1034 . 1036 11.2. Informative References 1038 [I-D.ietf-rtcweb-data-protocol] 1039 Jesup, R., Loreto, S., and M. Tuexen, "WebRTC Data Channel 1040 Establishment Protocol", draft-ietf-rtcweb-data- 1041 protocol-09 (work in progress), January 2015. 1043 [RFC4960] Stewart, R., "Stream Control Transmission Protocol", RFC 1044 4960, September 2007. 1046 [RFC4975] Campbell, B., Mahy, R., and C. Jennings, "The Message 1047 Session Relay Protocol (MSRP)", RFC 4975, September 2007. 1049 [RFC4976] Jennings, C., Mahy, R., and A. Roach, "Relay Extensions 1050 for the Message Sessions Relay Protocol (MSRP)", RFC 4976, 1051 September 2007. 1053 [RFC5547] Garcia-Martin, M., Isomaki, M., Camarillo, G., Loreto, S., 1054 and P. Kyzivat, "A Session Description Protocol (SDP) 1055 Offer/Answer Mechanism to Enable File Transfer", RFC 5547, 1056 May 2009. 1058 [RFC6135] Holmberg, C. and S. Blau, "An Alternative Connection Model 1059 for the Message Session Relay Protocol (MSRP)", RFC 6135, 1060 February 2011. 1062 [RFC6455] Fette, I. and A. Melnikov, "The WebSocket Protocol", RFC 1063 6455, December 2011. 1065 [RFC6714] Holmberg, C., Blau, S., and E. Burger, "Connection 1066 Establishment for Media Anchoring (CEMA) for the Message 1067 Session Relay Protocol (MSRP)", RFC 6714, August 2012. 1069 Authors' Addresses 1071 Keith Drage (editor) 1072 Alcatel-Lucent 1073 Quadrant, Stonehill Green, Westlea 1074 Swindon 1075 UK 1077 Email: keith.drage@alcatel-lucent.com 1079 Raju Makaraju 1080 Alcatel-Lucent 1081 2000 Lucent Lane 1082 Naperville, Illinois 1083 US 1085 Email: Raju.Makaraju@alcatel-lucent.com 1086 Juergen Stoetzer-Bradler 1087 Alcatel-Lucent 1088 Lorenzstrasse 10 1089 D-70435 Stuttgart 1090 Germany 1092 Email: Juergen.Stoetzer-Bradler@alcatel-lucent.com 1094 Richard Ejzak 1095 Unaffiliated 1097 Email: richard.ejzak@gmail.com 1099 Jerome Marcon 1100 Unaffiliated