DHCP: Automating local IPs
Dynamic Host Configuration Protocol (DHCP) automatically assigns IP addresses, gateway pathways, subnet masks, and DNS resolvers to local devices. When a phone joins a Wi-Fi network, it broadcasts a DHCP Discover packet, receives an offer from the router, and leases an IP address.
NAT: Sharing one public IP
Network Address Translation (NAT) allows routers to map local private IP ranges (e.g. 192.168.x.x) to a single public IP. When a device requests a webpage, the router translates the private source IP in the packet header to the router's public IP, tracking the connection state in a port-mapping table.
