24.7 Common Ports and Protocols: 22, 80, 443, 53, 25, 3306

Right, let’s talk about the digital equivalent of apartment numbers: ports. Your computer is a single building with a single IP address, but it’s running dozens of services. How does a packet of data know to go to your web browser and not your email client? Ports. They’re just numbers, 0 through 65535, and a few of them are so important they’ve become legendary. We’re going to cover the A-listers.

24.6 ARP: Mapping IP Addresses to MAC Addresses

Right, so you’ve got an IP address. Great. That’s a logical, software-based concept, a neat label we’ve all agreed to use. Your network card, however, speaks a much more primitive language: the hardware address, the MAC. It’s like knowing the postal address of a building (the IP) but needing to know the specific apartment number (the MAC) to get the pizza delivered. The Address Resolution Protocol, or ARP, is the process of standing in the hallway and yelling “Who’s in apartment 192.168.1.5?!” so you can write their actual apartment number on your clipboard.

24.5 DHCP: Dynamic Address Assignment and Lease Files

Right, so you’ve got a network. It has computers. Those computers need IP addresses. You could hand them out manually like a party host assigning seats, but that’s a thankless chore destined for typos and conflicts. The solution? DHCP, the Dynamic Host Configuration Protocol, or as I like to call it, the “please, just give me an address and leave me alone” protocol. It’s the silent, mostly reliable concierge of your network, handing out not just IPs, but also gateways, DNS servers, and other crucial bits of info. Let’s pull back the curtain.

24.4 DNS: Resolution, Recursive Resolvers, and /etc/resolv.conf

Right, let’s talk about DNS. You use it every second you’re online, and it’s probably the single biggest “wait, how does that actually work?” protocol on the internet. It’s the phonebook of the internet, but that analogy is so tired it needs a nap. Think of it more like a massively distributed, hierarchical, cached key-value store that translates human-friendly names like example.com into machine-friendly IP addresses like 93.184.216.34. And it works so well that you only notice it when it breaks, which, unfortunately, is more often than any of us would like.

24.3 IPv6: Address Format, Link-Local, and Global Unicast

Alright, let’s talk about IPv6. You’ve probably heard the horror stories: addresses that look like a cat walked across your keyboard, configuration that feels like black magic. I’m here to tell you it’s not that bad. In fact, once you get past the initial shock of all those colons, it’s mostly just more of the same networking concepts, but with some genuinely good ideas baked in. The designers looked at the duct-tape-and-bailing-wire mess that IPv4 NAT created and said, “Let’s just give everyone more addresses than they could ever need.” And they did. The entire IPv4 address space is a rounding error in IPv6.

24.2 IPv4 Addressing: Subnets, CIDR Notation, and Private Ranges

Alright, let’s talk about IPv4 addresses. You’ve seen them: those four numbers separated by dots, like 192.168.1.1. They’re the postal addresses of the internet, and at their core, they’re just 32-bit numbers. We humans are terrible at reading binary, so we split that 32-bit number into four 8-bit chunks (called “octets”) and convert each to decimal. That’s it. That’s the magic. It’s just a number. The problem is, we have about 4.3 billion possible addresses, and that sounded like science fiction in the 1970s but turned out to be hilariously insufficient. This scarcity forced us to get really clever about how we use them, which is where subnets and CIDR come in. They’re not just academic concepts; they’re the fundamental tools for keeping the internet from collapsing under its own weight.

24.1 The TCP/IP Model: Layers and Their Responsibilities

Right, let’s get this out of the way: the OSI model with its pristine seven layers is a beautiful academic concept. We don’t use it. We use its grittier, more practical, real-world cousin: the TCP/IP model. It’s the one that actually gets its hands dirty on the internet you use every day. Think of it as a four-layer burrito of responsibility, where each layer has a very specific job and trusts the other layers to do theirs, even if they occasionally mess up.

— joke —

...