Skip to content
uencoder

STUN

STUN (Session Traversal Utilities for NAT, RFC 5389) lets a client discover its public IP and port as seen through a NAT, along with the NAT type.

Purpose

It provides public reflexive address discovery for endpoints behind NAT—the foundation of ICE and WebRTC NAT traversal.

Mechanism

The client sends a Binding Request to a STUN server, which replies with the source IP:port it observed (the reflexive public address). Additional attributes can test the NAT's type and behavior.

Use cases

  • WebRTC NAT traversal
  • VoIP SIP
  • P2P public address discovery

Related tools

References