Subject: [rtcweb] JSEP/WebRTC API Datachannel question

From: Christian Groves <[email-masked]>
Date: Thu, 10 Apr 2014 13:58:20 +1000

Hello,

I've looked into the JSEP draft and WebRTC API (as well as the 
datachannel and DCEP drafts) to get a better understanding of how and 
when the SDP for the DTLS/SCTP Web-RTCDataChannel will be generated and 
what will trigger the DCEP protocol. Unfortunately I find myself more 
confused after the process .

I was trying to find some text regarding what happens in terms of SDP 
and DCEP when an endpoint uses multiple datachannels per peerConnection. 
e.g.

pc = new RTCPeerConnection(configuration);
channel = pc.createDataChannel("chat");
channel = pc.createDataChannel("clue");

Now based on the WebRTC API 
(http://dev.w3.org/2011/webrtc/editor/webrtc.html#peer-to-peer-data-api), I 
understand that a createOffer() is used to generate the required SDP for 
the data channel. This is also mentioned in Clause 5.2.1 "initial 
offers" draft-ietf-rtcweb-jsep-06 indicates: /"Lastly, if a data channel 
has been created, a m= section MUST be generated for data..."/

The WebRTC API cl.5.1.2 "createDataChannel" step 9 says /"Create 
channel's associated underlying data transport and configure it 
according to the relevant properties of channel."/ Now unfortunately it 
doesn't really say want this amounts to. Create could be "a new SCTP 
association" or it could be "using DCEP to do a DATA_CHANNEL_OPEN" or both.

If I look at the RTCPeerConnection Interface for addStream I see that it 
indicates that a negotiationneeded event (WebRTC API cl.4.3.2.3 step 5) 
is fired. This is a trigger for the createOffer(). The example 10.1 
WebRTC API shows this behavior. 10.3 also shows this behavior for 
createDataChannel but the Peer-to-Peer Data API doesn't indicate that 
the negotiationneeded event is triggered when establishing a data channel.

I looked at the RTCDataChannel closure procedure to see if this would 
shed any more light but simply says that the underlying data transport 
may be torn down. The JSEP draft isn't any help here either as it 
doesn't talk about RTCDataChannel closure at all.

So its not clear to me from the drafts/API whether:
1. each createDataChannel results in an offer with new m-line 
"webrtc-datachannel",
2. the first createDataChannel results in an SDP offer with m-line 
"webrtc-datachannel" and subsequent createDataChannels result in DCEP 
DATA_CHANNEL_OPENs on the existing webrtc-datachannel.
3. a mix of the above an endpoint can indicate multiple m-lines 
"webrtc-datachannel" and have multiple DCEP DATA_CHANNEL_OPENs per m-line.

Its clear from draft-ietf-rtcweb-data-channel-07 that "Multiple 
simultaneous data channels MUST be supported in the peer connection" but 
that doesn't clarify the above.

Is there any specification text that clarifies this?

Regards, Christian

---

From: Christian Groves <[email-masked]>
Date: Tue, 15 Apr 2014 15:13:58 +1000

I'll take a punt that people were thinking about 2 below when data 
channel was added. In order to clarify that I propose to add the 
following text to the JSEP draft to clarify this.

http://tools.ietf.org/html/draft-ietf-rtcweb-jsep-06#section-5.2.1
Replace:
"Lastly, if a data channel has been created, a m= section MUST be
    generated for data. The <media> field MUST be set to "application" 
and the <proto> field MUST be set to "DTLS/SCTP", as specified in 
[I-D.ietf-mmusic-sctp-sdp], Section 3; the "fmt" value MUST be set to 
the SCTP port number, as specified in Section 4.1."

With:
/  "Lastly, if createDataChannel has been called a m= section MUST be 
generated for data. In the case of multiple createDataChannel calls only 
one m= section is generated. The <media> field MUST be set to 
"application" and the <proto> field MUST be set to "DTLS/SCTP", as 
specified in [I-D.ietf-mmusic-sctp-sdp], Section 3; the "fmt" value MUST 
be set to the SCTP port number, as specified in Section 4.1."/

New text in 
http://tools.ietf.org/html/draft-ietf-rtcweb-jsep-06#section-5.2.2:
(above last paragraph)
/ "If createDataChannel has been called and a m= section has not 
previously been generated, a m= section MUST be generated for data. In 
the case of multiple createDataChannel calls only one m= section is 
generated. The <media> field MUST be set to "application" and the 
<proto> field MUST be set to "DTLS/SCTP", as specified in 
[I-D.ietf-mmusic-sctp-sdp], Section 3; the "fmt" value MUST be set to 
the SCTP port number, as specified in Section 4.1.//
//
//If all data channels have been closed, the m= section related to the 
data channels MUST be marked as recvonly by changing the value of the 
[RFC3264] directional attribute to "a=recvonly".//"/

It would also be good to add some text regarding the relationship 
between a createDataChannel and DCEP DATA_CHANNEL_OPEN I'm not sure if 
the JSEP draft is the place?

Also the W3C draft could be updated to indicate the interaction of a 
createDataChannel with the negotiationneeded event in section 5.2 
something along the lines of:
/7. For the first creation of a RTCDataChannel object fire a 
negotiationneeded event at connection./

Regards,
Christian

On 10/04/2014 1:58 PM, Christian Groves wrote:
> when the SDP for the DTLS/SCTP Web-RTCDataChannel will be generated 
> and what will trigger the DCEP protocol. Unfortunately I find myself 
> more confused after the process .
>
> and DCEP when an endpoint uses multiple datachannels per 
> peerConnection. e.g.
>
> (http://dev.w3.org/2011/webrtc/editor/webrtc.html#peer-to-peer-data-api), 
> I understand that a createOffer() is used to generate the required SDP 
> for the data channel. This is also mentioned in Clause 5.2.1 "initial 
> offers" draft-ietf-rtcweb-jsep-06 indicates: /"Lastly, if a data 
> channel has been created, a m= section MUST be generated for data..."/
>
> according to the relevant properties of channel."/ Now unfortunately 
> it doesn't really say want this amounts to. Create could be "a new 
> SCTP association" or it could be "using DCEP to do a 
> DATA_CHANNEL_OPEN" or both.
>
> If I look at the RTCPeerConnection Interface for addStream I see that 
> it indicates that a negotiationneeded event (WebRTC API cl.4.3.2.3 
> step 5) is fired. This is a trigger for the createOffer(). The example 
> 10.1 WebRTC API shows this behavior. 10.3 also shows this behavior for 
> simultaneous data channels MUST be supported in the peer connection" 
> but that doesn't clarify the above.
>
> _______________________________________________
> rtcweb mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/rtcweb
>