Lesson 1
Networks, packets and the journey of one click
What you'll learn: what a network is, why everything online travels in small packets, and the route one web page takes from a server to your screen.
One click, a lot of work
Amara is on the sofa in her flat in Leeds with her laptop on her knees. She wants to bake a lemon drizzle cake, so she types the address of her favourite recipe site, Breadbox, into her browser and presses Enter. About half a second later the page is there: a photo of the cake, a list of ingredients, the method.
In that half second her laptop has talked to her Wi-Fi router, her broadband provider, a directory service that turns names into numbers, a server in a data centre, and quite possibly a cable lying on the floor of the Atlantic. This course follows that one request, step by step, until you could explain the whole trip to a friend.
A note on the name: we will call the site breadbox.example. Names ending in .example are reserved for teaching, so no real site uses it, which makes it perfect for a running example.
What a network is
A network is simply two or more devices that can send data to each other. Amara's laptop, her phone, her smart speaker and her router form a small network at home. Her broadband provider runs a much bigger one.
The internet is a network of networks. Nobody owns it as a whole. Tens of thousands of separate networks, run by companies, universities and governments, have agreed to pass data to each other using shared rules. Those shared rules are called protocols, and most of this course is about a handful of them.
Why data travels in packets
The Breadbox page is not small. With its photos, fonts and scripts it might add up to about 2 megabytes, which is 2 million bytes. That never travels as one lump. It is chopped into packets, small pieces that usually carry at most about 1,500 bytes of data each on a typical home or office network. Two million divided by 1,500 is roughly 1,300, so a single recipe page arrives as well over a thousand packets.
Here is the everyday picture. Imagine you had to post a whole book to a friend, but the post office only accepted postcards. You would copy the book onto numbered postcards, write your friend's address and your own on every one, and drop them in the box. Some might take different routes through different sorting offices. Some might arrive out of order, and one or two might get lost. Because they are numbered, your friend can put them back in order and ask you to resend any that never arrived.
That is almost exactly how the internet moves data. Chopping data into packets has three big advantages:
- Sharing the road. Millions of people's packets can be mixed together on the same cables, taking turns, instead of one person hogging a line for the whole conversation.
- Getting around problems. If one route breaks, later packets can go another way.
- Cheap repairs. If one packet is damaged, only that small piece needs sending again, not the whole page.
The old telephone network instead reserved a whole circuit for each call. The internet's approach, called packet switching, is why the same cables can carry video calls, emails and recipe pages for millions of people at once.
What a packet carries
Every packet is like a postcard: a small amount of message plus the information needed to deliver it. That delivery information sits at the front, in the header.
| Part of the packet | What it holds | Postcard equivalent |
|---|---|---|
| Source address | Where it came from | Your return address |
| Destination address | Where it is going | Your friend's address |
| Sequence information | Which piece of the whole this is | The number on the card |
| Hop limit | How many more stops it may make before being discarded | A "throw away if undelivered" date |
| Payload | The actual data, a slice of the recipe page | The writing on the card |
We will meet the addresses in the next lesson and the sequence numbers in lesson 5.
Jobs in layers
One more idea makes the rest of the course easier. The internet splits the work of delivery into layers, each doing one job and trusting the layers around it to do theirs.
- The link layer gets data across one hop, such as the radio link from Amara's laptop to her router.
- The internet layer gets packets from one address to another across many networks.
- The transport layer makes sure the right program gets the data, and, when needed, that nothing is missing.
- The application layer is the conversation that means something to people, such as "please send me the lemon drizzle page".
Because of layering, Amara's laptop could switch from Wi-Fi to a cable, or to her phone's mobile data, and the browser would neither know nor care.
The route map for this course
Here is the journey of Amara's one click, in the order we will follow it:
- Her laptop needs an address of its own and learns how to reach the wider world (lessons 2 and 3).
- It looks up which numeric address belongs to the name
breadbox.example(lesson 4). - It opens a reliable connection to that address (lesson 5).
- It asks for the page securely, so nobody along the way can read or alter it (lesson 6).
- The packets cross real cables, possibly under the sea, to a data centre (lesson 7).
- A nearby copy of the page may answer instead, which is why it was so fast (lesson 8).
- The packets make the final hop over Wi-Fi, and we look at what happens when any step fails (lesson 9).
Recap
- A network is devices that can send each other data; the internet is a network of networks with no single owner.
- Protocols are the shared rules that let all those separate networks cooperate.
- Data travels as packets of up to about 1,500 bytes, so one web page can be over a thousand of them.
- Each packet has a header with source and destination addresses and a payload with the data, like a numbered postcard.
- The work is split into layers (link, internet, transport, application), so each part can change without breaking the others.