STUN/TURN
What is STUN/TURN?
STUN (Session Traversal Utilities for NAT) and TURN (Traversal Using Relays around NAT) are protocols that help two devices behind NAT establish a working connection, as WebRTC does for video calls. AdminKit's My IP tool shows the public address and port a STUN server would discover for your own connection, including behind CGNAT.
By AdminKit team, Netbase JSC · Updated
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; the message, attribute and error-code values a STUN exchange actually uses are catalogued in IANA’s STUN Parameters registry. 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 — MDN’s guide to WebRTC connectivity walks through that same STUN-then-TURN negotiation as part of ICE candidate gathering. In the browser API, the W3C WebRTC specification has an application list its servers as RTCIceServer entries with stun: or turn: URLs, adding a username and credential for a TURN server. CGNAT, common on mobile networks, is one of the main reasons a TURN relay ends up being required; AdminKit’s My IP tool shows the address and port a STUN server would discover for your own connection, including behind CGNAT.
STUN/TURN is part of AdminKit’s IP & network cluster; the full AdminKit glossary lists other related terms.
Frequently asked questions
What's the difference between STUN and TURN?
STUN simply tells a device its own public IP address and port as seen from outside, while TURN relays all traffic through a third-party server when a direct connection isn't possible -- TURN is slower and uses more bandwidth, so it's only used as a fallback.
Does every WebRTC call need a TURN server?
No -- most calls connect directly using STUN once both sides learn their public address and port, with WebRTC falling back to a TURN relay only when NAT or firewall restrictions block a direct path.
Why does CGNAT make TURN relays more likely?
Carrier-grade NAT shares one public IP across many customers and often maps ports unpredictably, which is one of the main reasons a direct STUN-discovered path fails and a call has to fall back to a TURN relay.
Can I see what a STUN server would discover about my own connection?
Yes -- AdminKit's My IP tool shows the public address and port visible from outside your network, including when you're behind CGNAT.