RFC 8489 / START HERE
STUN, before the details
STUN: Session Traversal Utilities for NAT
STUN helps an application discover how its network address appears to another system. NAT means Network Address Translation, which often changes addresses at a router.
The idea in one picture
An app sends a probe
A STUN server observes its address
The app learns a possible contact address
A simplified picture of the idea; the chapters explain the actual mechanisms.
Why it exists
An application behind a home router may not know the public-facing address and port that another participant sees.
A familiar example
A calling app contacts a STUN server while discovering possible ways another caller might reach it.
Helpful background
You can start here without reading another RFC. If these ideas are unfamiliar, these short introductions may help.
What you’ll learn next
Begin with chapter one, or choose a topic.
- Learn the server-observed addressA Binding transaction can reveal the source address and port observed by the STUN server.→
- Match a response to its transactionA transaction ID correlates responses with the initiating request.→
- Parse the STUN header and attributesA 20-byte header contains type, message length, magic cookie, and transaction ID, followed by padded attributes.→
- Use credentials for message integritySTUN defines short-term and long-term credential mechanisms and integrity attributes.→
- Separate discovery from connectivity and privacySTUN is a tool used by other traversal protocols, not a complete media-relay or identity system.→
This introduction explains RFC 8489 (2020). Read the original RFC ↗