How Networks Work Module 1: What a network is Lesson 1.2 12 min

Packets, links and speed

Data does not flow down a cable like water. It travels in small packets. See why, and learn the two numbers that decide how fast a network feels: latency and bandwidth.

Your internet plan says “500 Mb/s”. So why does a video call to a friend on the other side of the world still feel laggy, while a download from a nearby server flies?

Because “fast” means two different things on a network, and your plan only tells you about one of them. To see both, you first need to know how data really travels.

Data travels in packets

When your laptop sends a photo, it does not push the whole file down the cable in one go. It cuts the file into small pieces called packets, each with the addresses of the sender and the receiver written on it, and sends them one after another.

Watch a 6,000-byte photo go from one laptop to another over a single cable. (The command nc simply sends a file to another computer. You do not need to remember it.)

Five packets carried the photo: four full ones of 1,460 bytes and a last one with the 160 bytes left over. Why not one big packet?

  • Sharing. A cable, a Wi-Fi channel or a link across the sea is shared by many people. Small packets from everyone can take turns, so nobody’s huge download blocks everybody else for minutes.
  • Mistakes are cheap. If one packet is damaged or lost, only that small piece has to be sent again, not the whole file.
  • Every link has a size limit. On an ordinary Ethernet cable, a packet can carry at most about 1,500 bytes. You will meet that limit again near the end of the course.

Two kinds of fast

The cable in that lab was fast and short, so the whole thing was over in less than half a millisecond. Real links are not all like that. Every link has two numbers:

  • Latency is how long one bit takes to travel from one end to the other. It depends mostly on distance: light in a fibre covers about 200 km every millisecond, so crossing an ocean takes tens of milliseconds, whatever you pay.
  • Bandwidth is how many bits per second the link can push onto the wire. It decides how long it takes to send a big packet, or a big file. This is the “500 Mb/s” in your plan.

A useful picture: latency is the length of a motorway, bandwidth is the number of lanes. More lanes let more cars through per minute, but they do not make the trip shorter.

Here is the same pair of laptops joined by a much worse link: 40 milliseconds each way (like a long-distance connection) and only 2 Mb/s. First a ping, which sends one small message and times the reply.

The ping’s answer, time=80.8 ms, is the round-trip time (RTT): out and back. The extra 0.8 ms on top of the 80 is the time it took to push the ping’s 102 bytes onto a 2 Mb/s link, once in each direction.

Now the photo, over the same slow link.

The photo took about 146 milliseconds instead of less than half a millisecond. Most of that is not the bandwidth. Count the round trips: setting up the conversation took a full one (80 ms) before any data moved, then the data needed half of one (40 ms) to arrive, and pushing the five packets onto the slow wire added the rest. Every round trip costs 80 milliseconds, however many lanes the motorway has.

Press Try it and change the latency and the bandwidth of that cable. Make the bandwidth ten times bigger and run the photo again: it gets faster, but not ten times faster. Then make the latency smaller instead.

In the real world

A video call needs very little bandwidth, a few megabits per second, but it needs low latency: if your voice takes 300 ms to arrive, people start talking over each other. That is why a call to another continent can feel bad on a “fast” connection, and why online games care about ping much more than about download speed. Bandwidth is something you can buy more of. Latency is mostly set by distance, and the speed of light does not go up.

Recap

  • Data is cut into packets, each carrying addresses, and sent one after another.
  • Packets let many people share a link and make a lost piece cheap to resend.
  • Latency is the travel time across a link; bandwidth is how many bits per second it carries.
  • The round-trip time (RTT) is there and back; ping measures it.
  • Many network delays are round trips, which more bandwidth does not shorten.

Quick check

  1. Your friend's internet plan doubles its bandwidth. What happens to their ping time to a server far away?
  2. Why is a file sent as many packets instead of one?
  3. What does a round-trip time measure?

Your progress is saved in this browser. Sign in to keep it on every device. Free, no password.

Join the discussion