I newly wrote a simple chat application, but I didn't really understand the background of ICE Candidates.
When the peer create a connection they get ICE Candidates and they exchange them and set them finally to the peerconnection.
So my question is, where do the ICE Candidates come from and how are they used and are they all really used ?
I have noticed that my colleague got less candidates when he executes the application on his machine, what could be the reason for different amount of Candidates ?
ICE stands for Interactive Connectivity Establishment , its a techniques used in NAT( network address translator ) for
establishing communication for VOIP, peer-peer, instant-messaging, and other kind of interactive media.Typically ice candidate provides the information about the ipaddress and port from where the data is going to be exchanged.
It's format is something like follows
a=candidate:1 1 UDP 2130706431 192.168.1.102 1816 typ host
here
UDPspecifies the protocol to be used, thetyp hostspecifies which type of ice candidates it is, host means the candidates is generated within the firewall. If you usewiresharkto monitor the traffic then you can see the ports that are used for data transfer are same as the one present in ice-candidates.Another type is
relay, which denotes this candidates can be used when communication is to be done outside the firewall.It may contain more information depending on browser you are using. Many time i have seen 8-12 ice-candidates are generated by browser.