Get the latest tech news

How NAT Traversal Works (2020)


Learn how Tailscale can get through Network Address Translators (NAT) and securely connect your devices directly to each other.

As a rule, you can’t take an existing network library and make it traverse NATs, because you have to send and receive extra packets that aren’t part of the “main” protocol you’re trying to speak. Their stateful firewall component still wants to see packets flowing in the right order, but we can reliably figure out the correct ip:port to give to our peer and do our simultaneous transmission trick to get through. Spend half an hour brute-forcing your way through, then you can keep pinging to keep the open path alive indefinitely — or at least until one of the NATs reboots and dumps all its state, then you’re back to brute forcing.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Nat Traversal Works

Nat Traversal Works