NAT (Network Address Translation) Reference
Reference 为 NAT types, 端口 translation, 和 traversal techniques (STUN, TURN, ICE).
NAT Types
Full cone NAT maps an internal (IP, port) to a fixed external (IP, port) accepting connections from any external host. Restricted cone NAT requires the external host to have received a packet from the internal host first. Port-restricted cone adds port matching. Symmetric NAT assigns a different external port per destination, making traversal very difficult. NAT64 translates IPv6 to IPv4 for transition. CGN (Carrier-Grade NAT) uses a large public pool for many subscribers.
- full cone
- Most permissive
- symmetric
- Most restrictive
- NAT64
- IPv6 to IPv4
any external host difficult traversal transition mechanism Traversal Techniques
STUN (Session Traversal Utilities for NAT) discovers the external mapping via a public server. TURN (Traversal Using Relays around NAT) relays traffic when direct connection fails. ICE (Interactive Connectivity Establishment) orchestrates STUN, TURN, and direct attempts to find the best path. UPnP-IGD allows applications to request port mappings from the NAT. NAT traversal is essential for P2P applications like WebRTC. Symmetric NAT typically requires TURN relay.
- STUN
- Discover mapping
- TURN
- Relay fallback
- ICE
- Orchestrates all
public server when direct fails best path