Symmetric NAT

connectivity

The connection requires a TURN server due to a Symmetric NAT.

Description

Symmetric NAT is the most restrictive type of Network Address Translation (NAT) and is a major problem for WebRTC because it prevents the standard methods used to establish a direct peer-to-peer (P2P) connection: It breaks the "hole punching" technique that WebRTC relies on.

Unlike other NATs, it creates a different external port mapping for every unique destination the internal device wants to talk to.

So the address and port received when contacting the STUN server will not be the one used when contacting the peer. So that the peer will not be able to respond.

Symmetric NAT can be detected when using two servers giving a public address (STUN + TURN in UDP) or several TURN servers configured for UDP.

What do we do here?

With the candidates received, we check if we have two candidates with the same relatedPort and different ports then we mark this connection as behind a symmetric NAT.