NAT
Network Address Translation
ELI5 — The Vibe Check
NAT is how your home router lets all your devices share one public IP address. Your phone, laptop, and TV each get a private IP (192.168.x.x), but to the outside world, they all look like ONE IP address. The router keeps track of who asked for what and routes responses back correctly.
Real Talk
NAT is a method that remaps IP addresses by modifying packet headers as they pass through a router. The most common form, NAPT (Port Address Translation), maps many private IP:port combinations to a single public IP with different port numbers. Widely used to extend IPv4 address space.
Show Me The Code
# Private IP ranges (RFC 1918)
10.0.0.0/8 # Large private networks
172.16.0.0/12 # Medium private networks
192.168.0.0/16 # Home/small office networks
# Example NAT translation:
# Internal: 192.168.1.100:54321 → google.com:443
# External: 203.0.113.1:54321 → google.com:443
# (router translates 192.168.1.100 to 203.0.113.1)
When You'll Hear This
"All devices behind the NAT router share one public IP." / "NAT makes it hard to host services without port forwarding."
Related Terms
Firewall
A firewall is the bouncer at your network's door. It checks every incoming and outgoing connection against a list of rules and blocks anything suspicious.
IP Address
An IP address is your device's home address on the internet.
IPv4 (Internet Protocol version 4)
IPv4 is the original address format for the internet — four numbers separated by dots, like 192.168.1.1. The problem?
Router
The router is the traffic cop of your backend.
Subnet
A subnet is a smaller chunk of a larger network, like dividing a city into neighborhoods. All devices in a subnet can talk to each other directly.