IceCandiates Anatomy

Document created by akrishnamohan Support on Jul 26, 2018
Version 1Show Document
  • View in full screen mode

Its been a while since I had a post on the community. And, thought about writing a little-bit of my my known knowledge to share how to read the iceCandidates on a Call transaction. I hope this helps!

 

ICE stands for Interactive Connectivity Establishment , its a techniques used in NAT( network address translator ) for establishing communication. Typically ice candidate provides the information about the ip-address and port from where the data is going to be exchanged

 

ICE is the protocol chosen for NAT traversal in WebRTC.  A snippet of the IceCandidate as below:

 

 

"iceCandidates": [

 

 

Host candidate for RTP on UDP - in this ICE line our browser is giving its host candidates- the IP 10.10.15.25 of the interface or interfaces the browser is listening on the computer. The browser can receive/send SRTP and SRTCP on that IP in case there is IP visibility with some candidate of the remote peer.

 

For example, if the other computer is on the same LAN, hosts candidates will be used. The number after the protocol (udp) – 2122260223 - is the priority of the candidate.

{
"sdpMid": "audio",
"candidate": "candidate:1791031112 1 udp 2122260223 10.10.15.25 57339 typ host generation 0 ufrag say/ network-id 1 network-cost 10",
"sdpMLineIndex": 0

},
{
"sdpMid": "video",
"candidate": "candidate:1791031112 1 udp 2122260223 10.10.15.25 61520 typ host generation 0 ufrag say/ network-id 1 network-cost 10",
"sdpMLineIndex": 1
},

 

Reflexive candidate for RTP over UDP - here we have the server reflexive candidates. Note that they have lower priority than host candidates. These candidates are discovered by the STUN server

 

 

 

A Sample dissection on the candidate line:

 

3282008221 - is called Foundation, a unique identifier for each candidate of the same type!

 

1 - to Identify for RTP and in general 2 to Identify for RTCP

 

udp - denotes the transport type

 

1686052607 - priority of the given component

 

207.114.244.5 7423 - IP address and port

 

srflx - component type

 

raddr 10.10.15.25 rport 57339 - this is the related address for the relayed candidates and it contains the host address.

 

network-id - this term uniquely identifies a network interface. As per RFC, Each network interface SHOULD have a unique network ID, in the range of 0 to (2^16)-1

 

network-cost  - Network cost is an integer in the range 0-999, where larger values indicate a stronger preference for not using that network interface .

{
"sdpMid": "audio",
"candidate": "candidate:3282008221 1 udp 1686052607 207.114.244.5 7423 typ srflx raddr 10.10.15.25 rport 57339 generation 0 ufrag say/ network-id 1 network-cost 10",
"sdpMLineIndex": 0
},
{
"sdpMid": "video",
"candidate": "candidate:3282008221 1 udp 1686052607 207.114.244.5 61520 typ srflx raddr 10.10.15.25 rport 61520 generation 0 ufrag say/ network-id 1 network-cost 10",
"sdpMLineIndex": 1
},

 

Host candidate for RTP over TCP - These lines are the same as the two ICE lines before but for TCP traffic. Please note that the priority is the lower – i.e 1518280447 is larger - as TCP is not optimal for real-time media transportation.

{
"sdpMid": "audio",
"candidate": "candidate:608373688 1 tcp 1518280447 10.10.15.25 9 typ host tcptype active generation 0 ufrag say/ network-id 1 network-cost 10",
"sdpMLineIndex": 0
},
{
"sdpMid": "video",
"candidate": "candidate:608373688 1 tcp 1518280447 10.10.15.25 9 typ host tcptype active generation 0 ufrag say/ network-id 1 network-cost 10",
"sdpMLineIndex": 1
},

 

Relay candidate for RTP over UDP - next we have the relay candidates. Those candidates are obtained from a TURN server which must be provisioned when creating the peer connection. The first IP/port couple corresponds to the IP and port assigned by the TURN server (DirectMedia) for this media session. raddr and rport correspond to the public IP and the public port through which the WebRTC enpoint is reaching Internet. Note that the priorities are lower than the host and srflx type, 

{
"sdpMid": "audio",
"candidate": "candidate:3513707144 1 udp 41886207 52.88.206.94 50404 typ relay raddr 207.114.244.5 rport 7423 generation 0 ufrag say/ network-id 1 network-cost 10",
"sdpMLineIndex": 0
},
{
"sdpMid": "video",
"candidate": "candidate:3513707144 1 udp 41886207 52.88.206.94 52707 typ relay raddr 207.114.244.5 rport 61520 generation 0 ufrag say/ network-id 1 network-cost 10",
"sdpMLineIndex": 1
},
{
"sdpMid": "audio",
"candidate": "candidate:2346738545 1 udp 41885695 52.35.73.26 50792 typ relay raddr 207.114.244.5 rport 7423 generation 0 ufrag say/ network-id 1 network-cost 10",
"sdpMLineIndex": 0
},
{
"sdpMid": "video",
"candidate": "candidate:2346738545 1 udp 41885695 52.35.73.26 61601 typ relay raddr 207.114.244.5 rport 61520 generation 0 ufrag say/ network-id 1 network-cost 10",
"sdpMLineIndex": 1
}
],

Attachments

    Outcomes