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
The path of a packet from the phone to the server: each router only passes it on one step further.

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?

  1. 3 MB is 3,000,000 bytes.
  2. Each packet carries about 1,500 bytes.
  3. Cross out two zeros on both sides: 30,000 : 15 = 2,000
  4. 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

Data travels in packets, each with the IP address of the sender and the recipient. Routers pass each packet on, and at the destination the packets are put back together.

Tasks

Three tasks complete the lesson. The order does not matter, the text above stays where it is.

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.

Drag the rows into the right order.

  1. 1Routers on the internet forward them
  2. 2The router at home forwards them
  3. 3The phone splits the photo into packets
  4. 4The server requests a missing packet
  5. 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?

Enter the result.

packets

Task 3 · Choice

A router along the way fails. What happens to the remaining packets?

One answer is right.

Go deeper

Three more tasks, optional. They do not count for completing the lesson.

Task 4 · Fill in · optional

How a packet finds its destination: fill in the right words.

Tap a word, it goes into the marked gap.

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?

Enter the result.

packets

Task 6 · Several right · optional

What is on every data packet?

Several answers are right. Pick all of them.

Back to the chapter