webrtcsipstunturnice-protocol

Stun/Turn usage in WebRTC


I am developing a small webrtc application in C. I am making a webrtc call using sip signalling. I have below queries regarding usage of stun/turn/ice.

When I start call I send INVITE with offer (SDP). In SDP we need to put ICE candidates.

I have two possible cases. To explain it I will take an example. Say two endpoints are A and B. I have a sip proxy server say P. Also I have a turn server (supports both stun and turn), say it is T.

Case 1
All entities A, B, P and T are in same private network. Is STUN resolution required here? If yes then what all stun requests/responses I need to deal with?

Case 2
Here A is in private network. Other entities B, P and T are in public network. In this case I hope we need to do STUN/TURN resolution. Lets say I started with STUN, and got host and reflexive candidates. I see in some examples, Permission , Channel Bind requests are also used. If I am using just STUN (no TURN), after I get host and reflective candidates then do I need to do anything extra?

Besides this, is there any good open source available for stun/turn client in C that uses gnutls (no openssl)?


Solution

  • Case 1 - No. Not required, per se. It's just that there's no easy way to detect when an INVITE comes from the same network as you are on.

    Case 2 - If you are just using STUN, local host and reflexive candidates are fine. TURN is used for scenarios when relays are required (symmetric NAT scenarios).