Chapter 1: The journey of a page
Why everything travels in packets
See why the internet chops every message into small numbered pieces, and what happens when one goes missing.
Old telephone networks worked by reserving a line. When you placed a call, switches along the way connected a circuit just for you. It stayed yours until you hung up, even while nobody was talking. That suits a phone call. Computers talk differently, in short bursts with long gaps, so a reserved line would sit idle most of the time.
The internet does the opposite. It chops every message into small pieces called packets and sends each one on its own. A packet is usually no bigger than about 1,500 bytes, roughly a long paragraph of text. One photo on a web page might take hundreds of packets. A movie takes millions.
What's on a packet
Every packet has two parts. The payload is a slice of your data. The header is a label on the front, like the outside of an envelope. It says where the packet came from and where it's going. It also carries a number that tells the receiver where this slice fits in the whole.
One more field is worth knowing about. The header holds a counter that drops by one at every router. If it reaches zero, the packet is thrown away. That way a packet caught in a loop dies quietly instead of circling forever.
Why chop things up
Sharing is the first reason. Thousands of conversations can take turns on the same cable, one packet at a time, and nobody hogs it. When you pause to read, the link carries someone else's packets instead of sitting empty.
The second reason is resilience. If a link fails, routers send the next packets another way. Nothing needs to be redialed. A network built like this keeps working while parts of it are broken, and on a network this size, some part always is.
Out of order is normal
Because packets travel independently, they can arrive out of order, and some never arrive at all. In practice the packets of one download usually follow the same path, but nothing guarantees it. And when a router gets more packets than it can forward, it simply drops some. The receiver uses the numbers to put everything back in order and to spot what's missing.
Try it below. Tap Send message and watch the arrival order. Then turn on Drop packet 3 and send again.
Notice two things. The pieces arrive jumbled, yet the message comes out right. And with a packet dropped, the receiver can't finish until the sender notices the gap and sends that piece again. That wait is the stall you sometimes feel on a bad connection. Lesson five covers how the sender notices.
Rabbit holes
Questions worth chasing. In Learnfold, tap one and your tutor answers it as a new lesson in your course.
- Why is a typical packet about 1,500 bytes and not much bigger?
- Who first proposed chopping messages into packets, and why did phone engineers doubt it?
- What happens inside a router when too many packets arrive at once?