NAT is a technique that maps many private IP addresses to one (or a few) public IP address(es), conserving scarce IPv4 space and providing a rudimentary layer of address hiding.


Why NAT Matters


How NAT Works

  1. A host (e.g. 192.168.0.10:15401) sends a packet to an Internet server.
  2. The NAT router:
  3. The Internet server replies to the router’s public IP/port.
  4. The router looks up the original private mapping and forwards the reply back to 192.168.0.10:15401.

Translation Table Example

Private Address:Port Public Address:Port
192.168.0.10:15401 212.3.4.5:49215
192.168.0.11:15402 212.3.4.5:49216

Types of NAT

Type Description
Static NAT One‑to‑one mapping between a private and public IP—useful for hosting internal servers publicly.
Dynamic NAT Pools of public IPs are assigned dynamically to internal hosts—limited by pool size.
PAT (NAT Overload) Many‑to‑one mapping: all private hosts share a single public IP differentiated by port numbers.