Skip to the workspace
Pebellslearn by building
How the Internet Works  ›  Lesson

How the Internet Works

How does the internet work? 12 minThe internet is a network of networks that moves data as small addressed packets, relayed by routers and reassembled in order by TCP at the destination.

frontend / How the Internet Works

Explore each scene at your own pace.

01 · The rule

The rule

How the Internet Works

Throughout this course you will build and ship the website of a small neighbourhood bakery, Crumb Bakery, at crumbbakery.com. Before writing a single tag, it helps to know what actually happens when someone in another city opens that site on their phone. The page does not fly across the world in one piece. It is chopped up, addressed and passed hand to hand.

The rule

Data travels as small addressed packets, hopping between networks, reassembled at the end.

A network of networks. Your home Wi-Fi is a small network. Your internet provider runs a bigger one. Universities, companies and cloud providers run their own. The internet is simply all of these networks agreeing to connect and to follow the same rules, called protocols. Nobody owns the whole thing.

Addresses. Every device that talks on the internet has an IP address, such as 203.0.113.10 (IPv4) or a longer IPv6 address like 2001:db8::10. It works like a postal address: it tells the network where to deliver.

Packets. Data is never sent as one big blob. It is split into packets of at most about 1,500 bytes on most networks, each labelled with the sender's and receiver's IP addresses. A photo of the bakery's sourdough might become hundreds of packets.

Routers. Along the way, routers read each packet's destination and pass it one hop closer. Packets from the same file can even take different routes.

Reassembly. At the far end, TCP (Transmission Control Protocol) puts the packets back in order, notices any that went missing and asks for those again. That is why a page arrives complete even though the network lost a few pieces on the way.

The two roles to remember:

  • A client asks for something: your browser.
  • A server answers: the computer holding the bakery's site.
Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.