How can a whole household share one internet address?
In 1994 a stopgap trick was proposed to survive a few years. Your home router still uses it every second.
โถ Start the storyYour home router swaps your devices' private addresses for one public address, and remembers who asked for what. This is network address translation, or NAT. An IPv4 address can address only about 4.3 billion devices, and by 1992 it was clear that would not be enough. NAT let one internet-routable address of a serve an entire private network.
Here is the trick. When a packet leaves your phone, the router replaces the private source address with its own public one and notes the connection in a table. For TCP and UDP it also changes the port numbers, so that when a reply comes back, the combination of address and port tells the router exactly which private device asked. It forwards the reply there.
Step 1: Phone sends a request
From a private address
Step 2: Router swaps the address
Its own public address goes on the packet, and the connection is noted
Step 3: Website replies
To the router's public address
Step 4: Router looks up the entry
And forwards the reply to the right device
NAT was never meant to last. A 1994 document called NAT a short-term solution to the problems of running out of addresses and routing at scale. By 2004 it was widespread. The stopgap had quietly become part of how the internet works.
There is a catch. Communication through the router works only when the conversation starts inside the private network. A browser inside can reach outside websites, but outsiders cannot simply visit a website hosted inside. Hosts behind NAT lose and cannot take part in some internet protocols, which is why video calls and other apps need extra tricks to work.
Quiz me
0/3
Recap
The router swaps private addresses for its public one, tracks each connection by address and port, and sends replies back to the right device.
๐ก A trick to remember it ยท The router is a doorman with a notebook: he stamps his own address on every letter going out and checks the notebook when a reply arrives.
Surprising fact ยท A 1994 document called NAT a short-term solution, yet it became widespread by 2004.
Sources (1)
No source, no claim. Every fact in this lesson (16 claims) cites at least one of these.