Lesson 2 of 4 · Open
How data travels
Why a video arrives even though there is no fixed line.
A video is playing on your phone. The data comes from a server hundreds of kilometers away. There is no line of its own from the server to your phone, and along the way millions of people use the same routes. How does the data still find its way to you, and arrive complete?
Data does not travel in one piece. It is split into small parts called data packets. Each packet carries a piece of the data, plus details about where it comes from and where it is going. Just like with a letter, the address decides the route, not the contents.
For this, every device on the network has a number, its IP address. IP stands for Internet Protocol, the rules by which the packets travel. The common form is four numbers from 0 to 255 with dots in between. A laptop in a home network might have 192.168.178.20, for example. Each of the four numbers fits into one byte.
Four such numbers are not enough for all the devices in the world. That is why there is a newer, longer form, IPv6. Here we stay with the older form, IPv4, which is still widely used. Every packet carries two IP addresses: that of the sender, who sends it off, and that of the recipient, who it is meant for.
From router to router
On the way, each packet passes many routers. Each one looks at the recipient's IP address and hands the packet on to a neighbor that is closer to the destination. This is called forwarding. No router knows the whole route, each one only knows the next step.
New terms
- data packet
- a small piece of the data with details about where it comes from and where it is going
- IP address
- the number of a device on the network, such as 192.168.178.20
- sender
- the device that sends a packet off
- recipient
- the device a packet is meant for
- forward
- to hand a packet on to the next router, one that is closer to the destination
If a route is busy or broken, a router sends the packets through a different neighbor. So packets of the same file often take different routes and arrive out of order. That is why each packet also carries a sequence number. At the destination, the packets are put back together by these numbers. If one is missing, the recipient requests it again.
Quick check
All the packets have reached the server, but out of order. What happens now?
How many packets does a photo make?
A packet usually holds at most about 1,500 bytes. A small part of that is the addresses, the number, and other bookkeeping details, and some packets are smaller. For an estimate, you still calculate as if each packet carried 1,500 bytes of the file. That is a simplification, and the result is approximately right.
Example
A photo of 3 MB
You upload a phone photo of 3 MB to a server. About how many packets does it make?
- 3 MB is 3,000,000 bytes.
- Each packet carries about 1,500 bytes.
- Cross out two zeros on both sides: 30,000 : 15 = 2,000
- About 2,000 packets travel to the server one by one.
Typical mistake
Picturing a fixed line through which the whole file flows in one piece, like water through a hose. That cannot be right: if a router fails along the way, the video does not break off, the packets take another route. And the same routes carry the packets of millions of other people at the same time.
Remember
Tasks
Task 1 · Order
A phone sends a photo to a server, and one packet gets lost on the way. Put the steps in the order in which they happen.
- 1Routers on the internet forward them
- 2The router at home forwards them
- 3The phone splits the photo into packets
- 4The server requests a missing packet
- 5The server puts the photo together
Task 2 · Input
A photo of 6 MB travels in packets of 1,500 bytes each. How many packets is that?
Task 3 · Choice
A router along the way fails. What happens to the remaining packets?
Go deeper
Task 4 · Fill in · optional
How a packet finds its destination: fill in the right words.
A router reads the IP address of the on each packet and forwards it to a neighbor closer to the . If a packet is missing at the end, it is again.
Task 5 · Input · optional
A video of 150 MB is sent in packets of 1,500 bytes each. About how many packets is that?
Task 6 · Several right · optional