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/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 networks/tcp-how-a-network-that-drops-data-still-delivers-every-byte-in-order.md TCP: how a network that drops data still delivers every byte in order The internet underneath your apps drops data and makes no promise to deliver it. TCP adds the promise anyway: it numbers every piece, the… 5 min read · 17 Oct networks/cidr-and-subnets-what-the-24-in-192-168-1-0-24-means.md CIDR and subnets: what the /24 in 192.168.1.0/24 means What does the `/24` in `192.168.1.0/24` mean? It counts how many of an IPv4 address's 32 bits name the network, and how many are left to… 5 min read · 14 Oct networks/dns-lookups-why-a-website-is-slower-the-first-time-you-visit.md DNS lookups: why a website is slower the first time you visit Typing a name like www.example.com sets off a short chain of questions: a resolver asks a root server, then a .com server, then the… 5 min read · 11 Oct