networks/ip-addresses-and-ports-the-street-address-and-the-apartment-number.md

IP addresses and ports: the street address and the apartment number

Networks · 10 min read ·

Every message on a network needs two things to arrive: an IP address to find the right computer, and a port to find the right program on it. Think street address and apartment number.

This guide explains how IPv4 addresses are built, why 192.168.x.x shows up in every home, what 127.0.0.1 (localhost) really means, and which programs usually live on ports 22, 80, 443, 5432 and 3000. Check any address yourself, then send packets to a server and see which app answers.

$ ls networks/

see all →
networks/dhcp-how-a-device-gets-an-address-the-moment-it-joins-the-wi-fi.md DHCP: how a device gets an address the moment it joins the Wi-Fi Every device on a network needs its own address, but nobody types one in when you join café Wi-Fi. A helper called DHCP hands them out with… 6 min read · 9 Nov networks/cdns-why-a-far-away-server-feels-slow-and-how-copies-near-you-fix-it.md CDNs: why a far-away server feels slow, and how copies near you fix it Why does a website load instantly for you and slowly for someone on the other side of the world? The server is the same; the distance is… 6 min read · 1 Nov networks/udp-why-a-video-call-skips-a-lost-piece-instead-of-waiting.md UDP: why a video call skips a lost piece instead of waiting Why does a video call skip a moment instead of freezing until the missing piece turns up? Because it uses UDP, a protocol that sends… 4 min read · 29 Oct networks/nat-how-a-dozen-devices-share-one-internet-address.md NAT: how a dozen devices share one internet address Your home has one public internet address but a dozen devices. NAT is how your router lets them all share it and still get each reply to… 5 min read · 26 Oct networks/traceroute-how-a-countdown-number-reveals-every-stop-between-you-and-a.md Traceroute: how a countdown number reveals every stop between you and a server Your data crosses a dozen machines on its way to a server, and you never see one of them. Yet a tool called traceroute lists every stop in… 5 min read · 23 Oct networks/diffie-hellman-how-two-strangers-agree-on-a-secret-while-everyone-list.md Diffie-Hellman: how two strangers agree on a secret while everyone listens How can a browser and a website that have never met agree on a secret key while everyone on the Wi-Fi is listening? The trick is… 5 min read · 20 Oct