What it is
NAT (Network Address Translation) is a mechanism where a device rewrites packet headers to map one address realm to another, typically private IPv4 to public IPv4. The common home router behavior is port address translation, where many internal flows share one public address.
Key points
- Creates mappings in a translation table as flows go out.
- Replies are matched to those mappings and translated back in.
- Breaks end to end addressing, which impacts some protocols and makes logging important.
Concrete example
At home, your laptop opens a TCP connection to a website. Your router rewrites your private source address to its public address and picks an unused external port. The website replies to that public IP and port, and the router translates it back to your laptop.