[libnice] Context for NAT traversal

James jtp at biomantica.com
Thu Nov 3 20:02:20 UTC 2016

I've been reading up on NAT traversal, in general, and libnice specifically and there are various details which are still unclear.   NAT traversal will always happen in the context of some application which needs to use it.  These applications will differ from one another but there are some minimum things they all need to do to initiate the NAT traversal session.  Right?  My guess is the following:

1. Establish which user wants to talk to which other user at a specific time.   This could be by username for a file sharing application or telephone number for IP telephony, for example.   Users will have to be polling some application server to find out when someone wants to talk to them.  STUN doesn't do this.  Does it?

2. Once the desire to communicate between two specific users is established, then they can perform ICE but they still need the application server to pass the needed session information (SDP or just a candidates list) from each user to the other.  This takes the place of the cut and paste operation in the example code provided with libnice. 

Once steps 1 and 2, above, are completed the two user machines can go through the candidates list until they get a connection.  Then they have direct communication and don't need the application server or the STUN server in the loop.  That's assuming STUN works.  If not, they may need a TURN server to remain as an intermediary.

So is my understanding correct?  If not, what's different?


More information about the nice mailing list