sciandu
Computer science

Computer science

How the internet works

Packets, addresses, and many routes: your message's journey around the world.

What you need first

You type a message, hit send, and a split second later someone on the other side of the world reads it. Between you lie cables, radio towers, and countless computers. How does your message even find its way? The answer is one of the cleverest ideas in the history of technology.

A network of networks

The internet is not a single place and it belongs to no one alone. It is millions of smaller networks joined together: your Wi-Fi at home, your school's network, the networks of big providers. All of them are linked by forwarding computers called routers. That is exactly what the name says: the prefix inter means between, so the internet is the network between all those networks.

Packets and addresses

Your message doesn't travel in one piece. It gets split into many small packets, much like a large piece of furniture gets packed into several boxes. A packet holds only a little, in most networks at most about 1500 , so bigger data is spread over many packets. Each packet carries a sender and a destination address, the IP address, for example 192.168.0.1. This notation with four number blocks is called IPv4. Because such addresses have become scarce, there are now also the longer IPv6 addresses. The routers read the destination address and pass each packet step by step in the right direction, like post offices forwarding a letter.

Packet router
YouServerAB

The message is split into small packets that travel on their own.

Message = 3 packets, route via A

Try it: send a message through the network and follow the routes the individual packets take.

Many routes to the destination

Here's the surprise: the packets of a single message can take completely different routes. If one path is congested, a router simply switches to another. That's why packets sometimes arrive in the wrong order. Sorting that out is not the job of the IP address but of a protocol called TCP. A protocol is a fixed set of rules that sender and receiver both follow: TCP numbers the packets, puts them back together in the right order at the destination, and asks for missing ones again. Fast services like video chats often use UDP instead, which does without these guarantees and has less delay in return.

Strong through detours

This design makes the internet remarkably resilient. If a router or a cable fails, the packets simply find another route, fully automatically. There is no central hub that could fail and bring everything down. That robustness was already a goal in the first networks of this kind: many possible routes instead of a single one.

Exercises

0 of 6 solved

Time to try it yourself. You can't break anything, every attempt counts.

What is the internet?

What happens to your message before it is sent?

How many number blocks does an IPv4 address like 192.168.0.1 consist of?

Put the journey of a message through the internet in the right order.

  1. 1Routers pass the packets step by step toward the destination.
  2. 2Each packet gets a sender and a destination address.
  3. 3The message is split into many small packets.
  4. 4TCP puts the packets back together in the right order at the destination.

A message is 4800 bytes and gets split into packets of 1200 bytes each. How many packets are created?

Match each part of the internet to its job.

Router
IP address
TCP
UDP