Communication Networks · Visualized
Network Address Translation (NAT)
Addressing & Names
How devices get numbers, find each other on the LAN, and turn human-readable names into addresses.
7 interactive subtopics — each one animated, step-through and explained.
Network Address Translation (NAT)
Addressing & NamesIPv4 addresses ran out decades ago; NAT is the workaround that became infrastructure. Your router owns the single public address; every device behind it gets a private one (10/8, 172.16/12 or 192.168/16). Outgoing packets are rewritten — source IP and port replaced by the public IP and a fresh port — and the router remembers the mapping so replies find their way back.
How Network Address Translation (NAT) Works
- An inside host sends to the internet; its packet reaches the NAT gateway with a private source address.
- The router swaps the source to its public IP and picks an unused public port (e.g. 192.168.1.5:51322 → 93.184.216.1:40001).
- The mapping {inside IP:port ↔ public port} is stored in the NAT table with a timeout.
- The reply arrives at that public port; the table converts it back to the original inside host.
- Mapping entries expire after idleness — which is why long-lived connections send keepalives.
Network Address Translation (NAT) Worked Example
Try it: Two laptops open websites at the same time — watch the NAT table.
Laptop A:51322 → public :40001; Laptop B:51322 → public :40002. Both replies land on different public ports, and the table routes each to the right laptop. Their local ports collided; the NAT port pool prevents that from ever reaching the internet.
Network Address Translation (NAT): Key Facts to Remember
Recommended resourcesAffiliate links · may earn us a commission
Recommended for learners
See how packets really travel
Networks are built on the structures and algorithms you can watch step by step — queues, trees, and routing algorithms.