I was thinking last night when I was trying to get to sleep -- it's definitely taking me longer to get to sleep than it has been before I delayed the Chlorpromazine ’till bedtime — about topics I could write on for this book on How the Internet Works. There's DNS, of course, which I can wax lyrical about, and is an important part of how the browser determines which server to talk to in the first place. I was trying to think of other protocols to use. What protocols do people typically use these days that aren't HTTP? Lots of people still use mail clients, so I could talk about IMAP and SMTP, explain a little about how they work, having already dived through the stack while talking about HTTP. Last night I was struggling to think of another protocol that's familiar to end users. Virtually everything is tunnelled through an HTTP interface these days! Heck, even IMAP and SMTP is a bit of a stretch when everyone uses Gmail in their web browser! I could stretch a bit and talk about instant messaging, focusing on XMPP (while noting that, in reality, you're probably using a different, proprietary, protocol).
I should also talk about TLS/SSL, with examples of how connections are either SSL tunnels or upgraded through negotiation. I could go on from SSL to talk about about SPDY, too, and the upcoming HTTP 2. Explaining certificate verification, and how the communication channel is secured would be a good plan. That can follow after the conversation about plain HTTP, and the deep dive down the stack into TCP, IP, and the data link layer.
At the IP layer, I can talk about ICMP for passing status messages from intermediate hosts to explain why packets have been dropped, or that they should be tweaked (path MTU discovery). I can show examples of ping sending ICMP echo messages and receiving the corresponding ICMP reply messages, measuring latency, that kind of thing. I should mention ICMP messages that indicate the remote host is unreachable, or that the destination network can't be routed to.
And I can talk all about routing protocols. It's probably a good idea to introduce the routing table with simple static routes to determine where packets should be sent as the next hop. I can then talk about the simple dynamic routing protocols that manage routing for small, self-contained networks. And I can talking about BGP for managing the routing of packets in the larger Internet. This topic can introduce things like routing around failure, multiple routes to a particular destination, network topologies, class-based internet routing, and CIDR. All fun topics.
At the data link layer, I can explain the intricate details of broadcast, unicast and multicast traffic. I should probably mention something about broadcast domains -- what hosts receive packets when they're addressed in particular ways at the IP level, or at the data link layer. It would probably do to mention promiscuous-ness at this stage, too, where a host can listen on the network for packets for which it knows it is not the intended destination. It behoves me to mention the address resolution protocol (ARP) for turning an IP address into a MAC address that the host can communicate directly with. I can talk about various 'physical' media, like Ethernet and Wifi.
For some reason, I got it into my head that I should talk about SNMP. I can't really think of a good reason for that, other than being able to point people at some pretty MRTG graphs showing traffic density and explaining how the data is retrieved. It did get me to thinking that explaining Internet Exchanges (e.g. LINX) would be a good plan. Explaining how peering works at a technical level, as well as from an administrative perspective. It would be good to investigate how peering actually works amongst a bunch of service providers -- balancing commercial decisions with technical ones.
Aha, it just occurred to me that there's another application level protocol I can talk about: ssh. Most developers use it, so explaining how it works at a protocol level, and how trust is established, would be useful.
I'd like to talk about how IP failover works, virtual IPs and global something load balancing (GSLB) and that kind of thing. I definitely need to do more research there, learn all about it myself. What else can I talk about? At the data link layer, there's things like the spanning tree protocol, for switches to gossip with each other about which hosts are connected to which ports. At the application layer, I should talk a little about the BSD socket library, since it's a (nearly) universal interface between applications and the underlying OS networking. I could really do with re-reading Advanced Programming in the Unix Environment and TCP/IP Illustrated, to refresh my memory. In fact, what I'm really looking to do is write TCP/IP Illustrated for the current generation.
Illustrated. It would be good to have a quirky, but consistent, style for the illustrations. Hand-drawing them on squared paper would probably work quite well. Taking some inspiration from the Pomodoro Technique Illustrated would be neat.
Ah, yes, I need to explain byte ordering. Host order vs network order, and how nobody these days would notice, since everyone is testing it with Intel hardware...
Another topic: Request for Comments. It's worth taking a bit of time to explain the history of standardisation of the Internet Protocol, how Postel's Law of "be liberal in what you accept, conservative in what you emit" is such a good idea, and how standards are formed in the IETF. I'll need to find out how the process works these days -- last time I had any (slight, lurking) involvement, it was with the reformulation of NNTP and the Usenet Message Format! I could talk about plain text vs binary protocols (and the IETF's preference for the former). Perhaps it's worth talking about other standardisation processes that favour binary formats (e.g. SIP vs H.323).
That's another good point, when I'm talking about IMAP and SMTP, I should make sure to separately talk about the message format, and how that's defined. I can introduce topics like MIME there, too.
Going back to the original topic, I suppose I should talk a little about what the web browser does with the HTTP response(s) when it gets them. I can talk about rendering, executing JavaScript, GPU acceleration, there's plenty of content there, I'm sure. That's definitely my weakest area though.
And I definitely need to re-read TCP/IP Illustrated, sooner rather than later!
Compare and contrast IPv4 and IPv6.