How Does NAT Work?


Regarding your article What’s the difference between a hub, a switch, and a router? your description of routers raised a question. When using NAT, how does the router know which local IP address should receive an incoming packet? Using your example network, suppose computer “A” sends out a packet to someone on the internet. But what if at the SAME time, computer “B” sends out a packet to the SAME someone?

Now, each local IP address (from computers “A” and “B”) both get translated to the same internet IP address (72.134.xx on your diagram) and then sent out to the same someone on the internet. That person then sends back responses for both computer “A” and computer “B” on the same internet IP address. The router receives these response packets, but how does the router know which packet goes to which computer? Both came in from the same place with the same destination internet IP address.

It turns out that NAT, or Network Address Translation, is actually a very simple concept; one that we rely on every day to share a single internet connection across multiple computers as well as to keep those computers safe from internet threats.

Simple in concept, maybe, but difficult – complex even – to explain.

But, I’ll give it a shot.

Read moreHow Does NAT Work?