RFC 5245 - Interactive Connectivity Establishment (ICE)
NAT traversal for multimedia sessions
What is ICE?
Interactive Connectivity Establishment (ICE) is a protocol for Network Address Translator (NAT) traversal for UDP-based multimedia sessions. ICE makes use of STUN and TURN protocols to establish connectivity between peers behind NATs and firewalls.
Key Components
Candidate Gathering
Discovers multiple network paths including host, server reflexive, and relay candidates.
Connectivity Checks
Tests all candidate pairs to find working communication paths.
Path Selection
Chooses the best available path based on priority and connectivity.
Keepalives
Maintains NAT bindings and detects path failures.
ICE Candidate Types
Host Candidates
Direct IP addresses of the local network interfaces.
Server Reflexive
Public IP addresses discovered via STUN servers.
Peer Reflexive
Addresses learned during connectivity checks.
Relay Candidates
Addresses allocated on TURN relay servers.
ICE Process Flow
- Gathering Phase: Collect all possible candidate addresses
- Prioritization: Assign priorities based on candidate type and network topology
- Exchange: Share candidates with remote peer via signaling
- Pairing: Form candidate pairs between local and remote candidates
- Connectivity Checks: Test each pair using STUN binding requests
- Nomination: Select the best working candidate pair
- Conclusion: Begin media flow on the selected path
NAT Traversal Scenarios
Direct Connection
Both peers on public internet or same local network.
One NAT
One peer behind NAT, other on public internet.
Both Behind NAT
Both peers behind different NATs requiring hole punching.
Symmetric NAT
Restrictive NATs requiring TURN relay servers.
Applications
- WebRTC: Browser-to-browser real-time communication
- VoIP: Voice over IP calls through NATs and firewalls
- Video Conferencing: Multi-party video communication
- P2P Gaming: Direct peer-to-peer game connections
- File Sharing: Direct file transfers between peers
- Remote Desktop: Direct connections for screen sharing