STUN (Session Traversal Utilities for NAT)
STUN lets a device behind NAT discover its public IP address and port by asking an external server, so it can advertise a reachable address in SIP and SDP.
Published 8 November 2026 · 1 min read · By SpaGreen Creative
Short answer
STUN (Session Traversal Utilities for NAT) is a protocol, defined in RFC 8489, by which a client learns the public IP address and port that a NAT has assigned to it.
A device behind NAT does not know what address the outside world sees. STUN, defined in RFC 8489, solves this with a simple exchange. The client sends a request to a STUN server on the public internet. The server replies with the source address and port it saw on that request, which is the mapping the NAT created. The client can now place that public address in its SIP headers and SDP instead of its private one.
STUN is lightweight and works for the most common NAT types, where the same mapping is reused for all destinations. It does not help with symmetric NAT, where the router creates a different mapping for each destination, because the address learned from the STUN server will not be the one used toward the SIP server. In that case a TURN relay or server-side NAT handling is needed.
STUN is rarely used alone today. It is one of the building blocks of ICE, which gathers STUN-derived addresses alongside local and relayed ones and tests them to find a working path.
In SIPdia the STUN server field is in the Advanced section of the account page, with a separate ICE switch. Providers often publish a STUN server address; a common public one is run by Google.
Sources and further reading
- RFC 8489: Session Traversal Utilities for NAT (STUN)www.rfc-editor.org
This article is published by SpaGreen Creative, the maker of SIPdia. Product names mentioned belong to their owners. Where it describes other software, treat the steps as general guidance and check the official documentation linked above.
