← Back to Labs

NAT Traversal and ICE Explorer

Change the NAT type on each side and watch how STUN, ICE checks, and TURN relay selection change the path that can actually work.

Peer A NATChoose how this gateway maps and filters UDP
Peer B NATChoose how this gateway maps and filters UDP
Peer ABarcelona10.0.0.23:50000NAT APort-restrictedSTUN sees 198.51.100.14:62001peer path 198.51.100.14:62001STUN + signallingdiscovers reflexive tuples and exchanges ICE candidateshost-only candidatesTURN relay198.51.100.90:43000 / 43088standby fallback pathNAT BPort-restrictedSTUN sees 203.0.113.77:54022peer path 203.0.113.77:54022Peer BAthens192.168.1.44:40000direct srflx pair is expected to win
Winning pair
srflx <-> srflx
host-only candidates
NAT A behaviour
usually keeps one mapping per local socket
accepts only the remote IP and port already contacted
NAT B behaviour
usually keeps one mapping per local socket
accepts only the remote IP and port already contacted
Step 1 / 6Each peer starts with only private candidates

The browser first knows only its own interface addresses. Those are useful on the same LAN, but not across the public internet.

Direct UDP works, but only after both peers send checks so each NAT learns the remote IP and port.

At least one NAT is port-restricted, so timing matters. The first inbound packet is not enough by itself. ICE succeeds because both sides actively probe the candidate pair until the filters open on both ends.

Arrow keys to navigate · R to reset

Tap dots to jump to any step

Read the full article →Take the quiz →