Several techniques help applications work through NAT:
STUN (Session Traversal Utilities for NAT):
- Client queries STUN server to learn its public IP and port
- Works for UDP when NAT is not too restrictive
TURN (Traversal Using Relays around NAT):
- Relay server forwards all traffic
- Always works, but adds latency
ICE (Interactive Connectivity Establishment):
- Tries direct, STUN, then TURN
- Used by WebRTC and modern VoIP
UPnP/NAT-PMP:
- Application asks router to create port mapping
Hole Punching:
- Both peers send packets simultaneously to create NAT entries