Track: How Computers Work · Lesson 8 of 10 · Ages: 8+ · Time: 40 minutes
When you watch a video or send a message, it can seem to appear out of thin air. But your message is really a trip. It travels through cables and radio waves, past lots of helpful machines, and arrives in a blink. Let us follow it on its journey!
Beep says I have a secret. Whenever I talk to a faraway robot friend, my message gets chopped into tiny pieces. Then it gets put back together at the other end. Beep boop!
What you need
- Small bits of paper (sticky notes work well) and a pencil.
- A friend or grown-up to play the packet game.
- About 40 minutes.
A network of networks
A network is a group of computers that are connected so they can share information. The internet is a gigantic network made of millions of smaller networks, joined together all around the world. The connections are cables, including long ones under the sea, and radio waves, like Wi-Fi and mobile phone signals. Many cables carry messages as tiny flashes of light.
The internet is not the same as the web. The web, the pages you visit in a browser, is just one thing that uses the internet. Email, video calls and online games use it too.
The post office idea
Suppose you want to send a long story to a friend far away, but the post office only takes postcards. Here is what you would do:
- Split the story into small pieces, one for each postcard.
- Write your friend’s address on every postcard.
- Number the postcards: 1, 2, 3 and so on.
- Put them all in the post box.
The postcards do not all travel together. The post office sorts them at different sorting offices, and some go one way and some go another. They may arrive in a muddled order. But your friend looks at the numbers and puts the postcards back in order. Then the whole story can be read.
The internet works in just the same way.
Packets
When your tablet sends something, the information is cut into small pieces called packets. Every packet carries three important things:
- A small piece of the message.
- The address it is going to, and the address it came from.
- A number, so the pieces can be put back in order.
An internet address is called an IP address. It is a number label that identifies a device on the internet, a bit like a house number for a computer. When you type a website name, a helper system called the DNS works like a phone book. It looks up the name and finds the right number address.
Routers
A router is a machine that reads the address on each packet and passes it on to the next stop that gets it closer to where it is going. It is like a signpost at a crossroads, or a sorting office at the post office. Your home or school has a router, and so does the internet itself, in many, many places.

A packet may pass through a lot of routers on its journey. If one road is busy or broken, the routers can send packets along another route. So the packets of one message might not all take the same path.
When all the packets get to the other computer, it uses the numbers to rebuild the message in the right order. If a packet has gone missing, the receiver asks for just that one again.
Pixel says Why not send the whole message in one big lump? Small packets can share the cables fairly with everybody else. And if one goes missing, only a tiny piece needs to be sent again. Clever, meow!
The packet game
You and a friend can play a game to see this in action.
- Pick a short, happy sentence, like “Pixel the cat loves fish and naps”. Do not use any private information.
- Write one or two words on each small bit of paper, and write a number on each one.
- Mix up the bits of paper and put them into a pile. This is the “internet”.
- Hand the pile to your friend. Can they put the packets in order using the numbers and read the sentence?
For extra fun, ask a few people to be routers. Each router takes a packet and passes it along to the next person until it reaches your friend.
Packets in Python
This program chops a message into packets of 8 letters, numbers them, and then pretends they arrive in the wrong order. It puts them back in order using the numbers.
message = "HELLO FRIEND, HOW ARE YOU TODAY?"
packets = []
number = 1
for start in range(0, len(message), 8):
packets.append((number, message[start:start + 8]))
number = number + 1
arrived = packets[::-1]
print("Arrived:")
for number, piece in arrived:
print(number, piece)
arrived.sort()
text = ""
for number, piece in arrived:
text = text + piece
print("Rebuilt:", text)
Arrived: 4 U TODAY? 3 W ARE YO 2 IEND, HO 1 HELLO FR Rebuilt: HELLO FRIEND, HOW ARE YOU TODAY?
Each packet is a pair of a number and a piece of the message, written like (1, "HELLO FR"). The slice message[start:start + 8] cuts out 8 letters. The code packets[::-1] makes a backwards copy, which is our muddled arrival order. Then arrived.sort() puts the packets back in order by their number, and the loop glues the pieces together.
Notice that the pieces can include spaces, so “U TODAY?” starts with a letter and a space. The space is part of the message too!
Did you know? Signals in cables travel at a good fraction of the speed of light, so a packet can cross an ocean in a fraction of a second.
Challenges
Try it A message has 25 letters. Each packet can carry 5 letters. How many packets does it need?
Show the answer
25 ÷ 5 = 5 packets.
Try it Packet number 3 of 5 never arrives. What should the receiving computer do?
Show the answer
It asks the sender to send packet 3 again. Because each packet has a number, the computer knows exactly which one is missing, and it does not need the other four sent again.
Try it Change 8 to 5 in the Python program, in both places where it appears. How many packets do you get now?
Show the answer
The message has 32 letters. With 5 letters per packet that makes 7 packets: six full packets of 5 and one with the last 2 letters. The packet numbers now go from 1 to 7.
Grown-ups This is a simplified picture. Real packets carry more labels than we describe here, and the rules that govern them are called protocols. The post office comparison is a good bridge to bigger ideas like why websites sometimes load slowly. You can mention that a home router is a real example, but there is no need for children to touch it or change its settings.
What you learned
- The internet is a huge network of networks joined by cables and radio waves.
- Messages are split into small packets, each with an address and a number.
- Routers read the addresses and pass packets along towards where they are going.
- The packets can take different routes, and the receiving computer uses their numbers to put them back in order.
- The web is just one of the things that uses the internet.
