Visual RFC.
ALL RFCs / RFC 8489
Read the RFC ↗

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

  1. An app sends a probe

  2. A STUN server observes its address

  3. 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.

  1. Learn the server-observed addressA Binding transaction can reveal the source address and port observed by the STUN server.
  2. Match a response to its transactionA transaction ID correlates responses with the initiating request.
  3. Parse the STUN header and attributesA 20-byte header contains type, message length, magic cookie, and transaction ID, followed by padded attributes.
  4. Use credentials for message integritySTUN defines short-term and long-term credential mechanisms and integrity attributes.
  5. Separate discovery from connectivity and privacySTUN is a tool used by other traversal protocols, not a complete media-relay or identity system.
Start with chapter one →

This introduction explains RFC 8489 (2020). Read the original RFC ↗