webrtcturn

Can Alice behind a symmetric NAT establish a webrtc connection with Bob who is forced to use Turn relay?


Assuming Alice is behind a symmetric NAT and Bob is behind a normal NAT (e.g. Full cone).

Alice's iceServer list only has a stun, Bob's iceServer list only has a turn which is forced to be configured as relay. Both of them can reach the turn.

Can Alice and Bob establish a WebRTC connection? If can, what candidate pair choosed?

In other words, does having one TURN server (both ends can reach it) guarantee the ability to establish a WebRTC connection regardless of the network architecture?


Solution

  • .. does having a TURN server guarantee the ability to establish a WebRTC connection regardless of the network architecture?

    Yes it does as long as both parties can reach that same TURN server. But both Alice and Bob will need to talk to the same TURN server to get relay candidates that will match during the ICE negotiation. When they do, the TURN server will create a relay-session where it will simply accept RTP and RTCP packets from one client and send it to the other over the connections that are already established.

    It won't work if Alice uses a STUN server, i.e., not the same TURN server as Bob.