Lesson 2 of 7
IP Addresses & Routing
Every machine on the internet has an address. You'll learn how IP addresses, NAT and routing let your laptop reach a server on the other side of the world.
# IPv4: four bytes, dotted — 4.3 billion possible:
# 93.184.216.34
# IPv6: sixteen bytes — effectively unlimited:
# 2606:2800:220:1:248:1893:25c8:1946
# Your two addresses:
curl ifconfig.me # public IP (the world sees this)
ip addr | grep "inet " # local IP (192.168.x.x — private)
# (ipconfig on Windows, ifconfig on Mac)
# Private ranges never appear on the public internet:
# 10.x.x.x | 172.16-31.x.x | 192.168.x.x
# 127.0.0.1 = localhost — always 'this machine'IPv4 ran out of addresses, and NAT (Network Address Translation) is the patch that kept it alive: your router owns one public IP and rewrites traffic so every device in your home shares it — tracking which internal device each conversation belongs to. It's why your laptop can call out to any server, but servers can't call in to your laptop uninvited (and why game consoles complain about 'strict NAT').
Routing between networks is hierarchical. The internet is ~80,000 autonomous systems — ISPs, clouds, universities — announcing to each other which address blocks they can reach, via a protocol called BGP. Routers don't know every machine; they know which neighbor is closer to each address block. Your packet climbs from home ISP to backbone, crosses, and descends into the destination's network.
Tip: use the ← and → keys to move between lessons.