RE: Issue 209: Trying to remove RTCIceTransport.createAssociatedTransport(component)

[BA] Today in the ORTC API there are several places where RTP and RTCP transports are associated with each other, implicitly or explicitly.

In constructing RtpSender/RtpReceiver objects (or when calling .setTransport()), the RTP (and optionally, RTCP) DtlsTransport(s) are passed as arguments.

The other place is in the RTCIceTransportController.addTransport() method, where only the RTP IceTransport is passed as an argument, with the implicit assumption that the RTCP IceTransport can be determined from that (e.g. through .createAssociatedTransport()).

Unless we add the RTCP IceTransport as an explicit argument to addTransport(), I believe we will have a problem.

This is illustrated by looking at one of the sample code examples (enclosed in full below).

There, the issue comes down to the following lines:

// RTP and RTCP Ice Gatherer objects created prior to these lines...

// Create the ICE RTP and RTCP transports
var iceRtpTransport = new RTCIceTransport(iceRtpGatherer);
// Would iceRtcpTransport = new RTCIceTransport(iceRtcpGatherer); work just as well?
var iceRtcpTransport = iceRtpTransport.createAssociatedTransport();
// Create the ICE Transport Controller object and add the RTP Ice Transport to it
var controller = new RTCIceTransportController();
controller.addTransport(iceRtpTransport);

[BA] In the above example, without iceRtpTransport.createAssociatedTransport() we can still construct iceRtcpTransport from the iceRtcpGatherer.

However, the problem comes in calling controller.addTransport(iceRtpTransport) because the IceTransportController would no longer be able to determine that iceRtcpTransport is the RTCP IceTransport associated with iceRtpTransport. This information is available to the RtpSender/RtpReceiver objects once they are constructed, but those objects are not arguments to IceTransportController.

Example

// Example to demonstrate forking when RTP and RTCP are not multiplexed,
// so that both RTP and RTCP IceGatherer and IceTransport objects are needed.
// Create ICE gather options
var gatherOptions = new RTCIceGatherOptions();
gatherOptions.gatherPolicy = RTCIceGatherPolicy.relay;
gatherOptions.iceservers = ... ;
// Create ICE gatherer objects
var iceRtpGatherer = new RTCIceGatherer(gatherOptions);
var iceRtcpGatherer = iceRtpGatherer.createAssociatedGatherer();
// Prepare to signal local candidates
iceRtpGatherer.onlocalcandidate = function (event) {mySendLocalCandidate(RTCIceComponent.RTP, event.candidate)};
iceRtcpGatherer.onlocalcandidate = function (event) {mySendLocalCandidate(RTCIceComponent.RTCP, event.candidate)};

mySendInitiate({
"icertp": iceRtpGatherer.getLocalParameters(),
"icertcp": iceRtcpGatherer.getLocalParameters()
},
function(response) {
// We may get N responses
//
// Create the ICE RTP and RTCP transports
var iceRtpTransport = new RTCIceTransport(iceRtpGatherer);
// Would iceRtcpTransport = new RTCIceTransport(iceRtcpGatherer); work just as well?
var iceRtcpTransport = iceRtpTransport.createAssociatedTransport();
// Create the ICE Transport Controller object and add the RTP Ice Transport to it
var controller = new RTCIceTransportController();
controller.addTransport(iceRtpTransport);
// Start the RTP and RTCP ICE transports so that outgoing ICE connectivity checks can begin
iceRtpTransport.start(iceRtpGatherer, response.icertp, RTCIceRole.controlling);
iceRtcpTransport.start(iceRtcpGatherer, response.icertcp, RTCIceRole.controlling);
// Prepare to add ICE candidates signalled by the remote peer
mySignaller.onRemoteCandidate = function(remote) {
if (remote.component == RTCIceComponent.RTP){
iceRtpTransport.addRemoteCandidate(remote.candidate);
} else {
iceRtcpTransport.addRemoteCandidate(remote.candidate);
};
}

// ... setup DTLS, RTP, SCTP, etc.
});

function mySendLocalCandidate(component, candidate){
mySignaller.mySendLocalCandidate({
"candidate": candidate,
"component": component
});
}


From: Bernard Aboba [mailto:Bernard.Aboba@microsoft.com]
Sent: Tuesday, May 26, 2015 1:17 PM
To: public-ortc@w3.org
Subject: Issue 209: Trying to remove RTCIceTransport.createAssociatedTransport(component)

Opened by Robin Raymond:
https://github.com/openpeer/ortc/issues/209

Trying to remove RTCIceTransport.createAssociatedTransport(component) in favour ofRTCIceGatherer.createAssociatedGatherer(component). Bit of an issue, not sure how we can associate RTP to RTCP for transports (especially in forking) for the sake of freezing RTCP against RTP... Needs more research before we remove this method.

Received on Tuesday, 26 May 2015 20:26:15 UTC