Skip to content
AdminKit

STUN/TURN

STUN (Session Traversal Utilities for NAT) and TURN (Traversal Using Relays around NAT) are protocols that help two devices behind NAT, such as a video call app on two different home networks, establish a working connection. A STUN server simply tells a device what its own public IP address and port look like from the outside, which is often enough for both sides to exchange that information and connect directly. When the NAT or firewall on either side is too restrictive for a direct path, a TURN server instead relays the traffic between the two devices, acting as a middleman at the cost of extra latency and bandwidth. Real-time communication standards like WebRTC use both together, trying a STUN-assisted direct connection first and falling back to a TURN relay only when needed. CGNAT, common on mobile networks, is one of the main reasons a TURN relay ends up being required.

By AdminKit team, Netbase JSC · Updated