CloudAcademia
EN

Networking · Module 01 · How the Internet Works

How the Internet Works

Lesson30 minFoundationsMarkdown

Showing raw Markdown: the renderer could not load.

## Why this matters
You watch a video, send a photo to a friend or open a web page, and it simply works. Behind that tap or click, your request crosses many machines you never see, sometimes in other countries, in a fraction of a second.

When a page loads slowly or someone says "the Internet is down", knowing the journey helps you see what that might mean. This lesson explains it step by step, using everyday comparisons.

## Learning objectives
- Explain what a network is and what the Internet is, using an everyday comparison.
- Distinguish clients and servers, and give examples of each from daily life.
- Describe how data travels in packets from router to router, and why it is split into packets.
- Identify the role of an Internet service provider (ISP) in connecting a home to the Internet.

## Key concepts

### Networks and the Internet
Think of the postal system. Letters don't fly straight from your hand to a friend's door. They go through a local post office, a sorting office, perhaps a plane or a truck, and another local office, and then a postman delivers them. Each stage knows only where to send the letter next.

A **network** works in a similar way: it is a group of devices (computers, phones, printers, TVs) that are connected so they can send data to each other. Your home is probably a small network. Your phone, laptop and TV all talk to one box in your living room, the **router**. A router is a device that receives data and passes it on towards its destination, like a sorting office for data. Your home router usually sends data to the outside world over a cable, a fibre line or a mobile connection.

The **Internet** is a network of networks. It is not one giant computer owned by one company. It is millions of separate networks (homes, schools, companies, universities, phone operators) that agree on common rules for passing data to each other, so a message can cross from any of them to any other. Nobody owns all of it, just as no one owns the world's postal system: each country has its own post, and they cooperate.

Every device on a network needs an address, like the address on an envelope. On the Internet this is an **IP address**, a number such as `203.0.113.7` (an address reserved for examples in documentation). People rarely type these numbers. They use a **domain name** such as `example.com`, which is easier to remember, and the Internet translates the name into the number for them.

<figure class="diagram" style="--dg-w: 1050px"><svg xmlns="http://www.w3.org/2000/svg" class="dg" viewBox="0 0 1050 270" width="1050" height="270" role="img" aria-labelledby="inet-network-of-networks-title inet-network-of-networks-desc" font-family="Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif" xml:lang="en">
<title id="inet-network-of-networks-title">The Internet as a network of networks</title>
<desc id="inet-network-of-networks-desc">Four areas joined by lines from left to right. Your home: a home network with a laptop, a phone and the router at home. Your ISP: the cables, fibre and routers of your Internet service provider. Other ISPs: other networks, often far away or overseas. A data centre: the website&#x27;s servers, the computers that hold the website. The first line is labelled access, the others link. A caption says the Internet is all of these networks linked together.</desc>
<rect class="dg-bg" x="0.5" y="0.5" width="1049" height="269" rx="16" fill="#ffffff" stroke="#e3e3dd"/>
<g class="dg-l2"><rect class="dg-tint" x="30" y="24" width="180" height="170" rx="16" fill="#f1f7f3" stroke="#a1ccb1" stroke-width="1.2" stroke-dasharray="6 5"/>
<g class="dg-icon" transform="translate(46 37) scale(0.7500)" fill="none" stroke="#15803d" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"/><path d="M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/></g>
<text x="72" y="51" font-size="13" class="dg-ink" fill="#15803d" font-weight="700">Your home</text></g>
<rect class="dg-card" x="40" y="66" width="160" height="112" rx="12" fill="#ffffff" stroke="#cfcfc8"/>
<g class="dg-l2"><g class="dg-icon" transform="translate(56 82) scale(1.2500)" fill="none" stroke="#15803d" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16"/></g></g>
<g class="dg-l2"><text x="98" y="103" font-size="13.5" class="dg-ink" fill="#15803d" font-weight="700">Home network</text></g>
<text x="58" y="134" font-size="13" class="dg-muted" fill="#5c5c68" font-weight="500">Laptop, phone and</text>
<text x="58" y="154" font-size="13" class="dg-muted" fill="#5c5c68" font-weight="500">the router at home</text>
<g class="dg-l1"><rect class="dg-tint" x="300" y="24" width="180" height="170" rx="16" fill="#f0f6f9" stroke="#9ac3d9" stroke-width="1.2" stroke-dasharray="6 5"/>
<g class="dg-icon" transform="translate(316 37) scale(0.7500)" fill="none" stroke="#0369a1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4.9 16.1C1 12.2 1 5.8 4.9 1.9"/><path d="M7.8 4.7a6.14 6.14 0 0 0-.8 7.5"/><circle cx="12" cy="9" r="2"/><path d="M16.2 4.8c2 2 2.26 5.11.8 7.47"/><path d="M19.1 1.9a9.96 9.96 0 0 1 0 14.1"/><path d="M9.5 18h5"/><path d="m8 22 4-11 4 11"/></g>
<text x="342" y="51" font-size="13" class="dg-ink" fill="#0369a1" font-weight="700">Your ISP</text></g>
<rect class="dg-card" x="310" y="66" width="160" height="112" rx="12" fill="#ffffff" stroke="#cfcfc8"/>
<g class="dg-l1"><g class="dg-icon" transform="translate(326 82) scale(1.2500)" fill="none" stroke="#0369a1" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="8" x="2" y="14" rx="2"/><path d="M6.01 18H6"/><path d="M10.01 18H10"/><path d="M15 10v4"/><path d="M17.84 7.17a4 4 0 0 0-5.66 0"/><path d="M20.66 4.34a8 8 0 0 0-11.31 0"/></g></g>
<g class="dg-l1"><text x="368" y="103" font-size="13.5" class="dg-ink" fill="#0369a1" font-weight="700">ISP network</text></g>
<text x="328" y="134" font-size="13" class="dg-muted" fill="#5c5c68" font-weight="500">Cables, fibre and</text>
<text x="328" y="154" font-size="13" class="dg-muted" fill="#5c5c68" font-weight="500">routers of your ISP</text>
<g class="dg-l3"><rect class="dg-tint" x="570" y="24" width="180" height="170" rx="16" fill="#faf5f0" stroke="#e1ba9d" stroke-width="1.2" stroke-dasharray="6 5"/>
<g class="dg-icon" transform="translate(586 37) scale(0.7500)" fill="none" stroke="#b45309" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"/><path d="M2 12h20"/></g>
<text x="612" y="51" font-size="13" class="dg-ink" fill="#b45309" font-weight="700">Other ISPs</text></g>
<rect class="dg-card" x="580" y="66" width="160" height="112" rx="12" fill="#ffffff" stroke="#cfcfc8"/>
<g class="dg-l3"><g class="dg-icon" transform="translate(596 82) scale(1.2500)" fill="none" stroke="#b45309" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"/></g></g>
<g class="dg-l3"><text x="638" y="103" font-size="13.5" class="dg-ink" fill="#b45309" font-weight="700">Other networks</text></g>
<text x="598" y="134" font-size="13" class="dg-muted" fill="#5c5c68" font-weight="500">Other ISPs, often far</text>
<text x="598" y="154" font-size="13" class="dg-muted" fill="#5c5c68" font-weight="500">away, even overseas</text>
<g class="dg-l7"><rect class="dg-tint" x="840" y="24" width="180" height="170" rx="16" fill="#f6f2fd" stroke="#c5a9f0" stroke-width="1.2" stroke-dasharray="6 5"/>
<g class="dg-icon" transform="translate(856 37) scale(0.7500)" fill="none" stroke="#6d28d9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z"/><path d="M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2"/><path d="M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2"/><path d="M10 6h4"/><path d="M10 10h4"/><path d="M10 14h4"/><path d="M10 18h4"/></g>
<text x="882" y="51" font-size="13" class="dg-ink" fill="#6d28d9" font-weight="700">A data centre</text></g>
<rect class="dg-card" x="850" y="66" width="160" height="112" rx="12" fill="#ffffff" stroke="#cfcfc8"/>
<g class="dg-l7"><g class="dg-icon" transform="translate(866 82) scale(1.2500)" fill="none" stroke="#6d28d9" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="8" x="2" y="2" rx="2"/><rect width="20" height="8" x="2" y="14" rx="2"/><path d="M6 6h.01"/><path d="M6 18h.01"/></g></g>
<g class="dg-l7"><text x="908" y="103" font-size="13.5" class="dg-ink" fill="#6d28d9" font-weight="700">Web servers</text></g>
<text x="868" y="134" font-size="13" class="dg-muted" fill="#5c5c68" font-weight="500">Computers that hold</text>
<text x="868" y="154" font-size="13" class="dg-muted" fill="#5c5c68" font-weight="500">the website</text>
<g class="dg-l1"><path class="dg-stroke" d="M212  122H298" stroke="#0369a1" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></g>
<g class="dg-l1"><rect class="dg-bg-plain" x="226.68" y="92" width="56.64" height="24" rx="12" fill="#ffffff"/><text x="255" y="108.5" font-size="11.5" class="dg-ink" fill="#0369a1" font-weight="600" text-anchor="middle">access</text></g>
<g class="dg-l1"><path class="dg-stroke" d="M482  122H568" stroke="#0369a1" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></g>
<g class="dg-l1"><rect class="dg-bg-plain" x="503.12" y="92" width="43.76" height="24" rx="12" fill="#ffffff"/><text x="525" y="108.5" font-size="11.5" class="dg-ink" fill="#0369a1" font-weight="600" text-anchor="middle">link</text></g>
<g class="dg-l1"><path class="dg-stroke" d="M752  122H838" stroke="#0369a1" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></g>
<g class="dg-l1"><rect class="dg-bg-plain" x="773.12" y="92" width="43.76" height="24" rx="12" fill="#ffffff"/><text x="795" y="108.5" font-size="11.5" class="dg-ink" fill="#0369a1" font-weight="600" text-anchor="middle">link</text></g>
<text x="525" y="232" font-size="14" class="dg-text" fill="#17171c" font-weight="700" text-anchor="middle">The Internet is all of these networks, linked together</text>
</svg></figure>

*Figure 1. The Internet is not one thing: it is many networks linked together, and your data crosses several of them.*

> [!CHECK]
> Which description of the Internet is the most accurate?
>
> - [ ] One huge computer that stores all the web pages
> - [x] Many separate networks linked together by common rules
> - [ ] A single company's cable running around the world
> - [ ] The same thing as the web browser on your computer
>
> The Internet is a network of networks. The web browser is only one program that uses it.

### Clients and servers
When you open a web page, two sides take part. One asks, the other answers. Think of a restaurant: you (the customer) ask for a dish, and the kitchen prepares it and brings it to you.

The side that asks is the **client**. Your laptop's web browser, a streaming app on your phone or a messaging app are clients. The side that answers is the **server**: a computer that is always on, waiting for requests, and that holds things people want, such as web pages, videos or messages. It sends back what you asked for.

A server is a normal computer with a job, usually without a screen, running day and night in a building full of similar machines. Your browser asks `example.com` for its page (you are the client, and the website's computer is the server). Your streaming app asks the streaming service's servers for a film.

<figure class="diagram" style="--dg-w: 900px"><svg xmlns="http://www.w3.org/2000/svg" class="dg" viewBox="0 0 900 300" width="900" height="300" role="img" aria-labelledby="inet-client-server-title inet-client-server-desc" font-family="Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif" xml:lang="en">
<title id="inet-client-server-title">Clients ask and servers answer</title>
<desc id="inet-client-server-desc">Two rows. In each row a client on the left sends an arrow to a server on the right labelled asks, show me this, and the server sends an arrow back labelled answers, sends it back. First row: your browser, the client, and a website&#x27;s server, which holds the web page. Second row: a streaming app on a phone, the client, and the streaming servers, which hold the videos.</desc>
<rect class="dg-bg" x="0.5" y="0.5" width="899" height="299" rx="16" fill="#ffffff" stroke="#e3e3dd"/>
<rect class="dg-card" x="24" y="24" width="250" height="100" rx="12" fill="#ffffff" stroke="#cfcfc8"/>
<g class="dg-l2"><g class="dg-icon" transform="translate(40 40) scale(1.2500)" fill="none" stroke="#15803d" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16"/></g></g>
<g class="dg-l2"><text x="82" y="61" font-size="15" class="dg-ink" fill="#15803d" font-weight="700">Your browser</text></g>
<text x="42" y="92" font-size="13" class="dg-muted" fill="#5c5c68" font-weight="500">the client</text>
<rect class="dg-card" x="626" y="24" width="250" height="100" rx="12" fill="#ffffff" stroke="#cfcfc8"/>
<g class="dg-l1"><g class="dg-icon" transform="translate(642 40) scale(1.2500)" fill="none" stroke="#0369a1" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"/><path d="M2 12h20"/></g></g>
<g class="dg-l1"><text x="684" y="61" font-size="15" class="dg-ink" fill="#0369a1" font-weight="700">A website&#x27;s server</text></g>
<text x="644" y="92" font-size="13" class="dg-muted" fill="#5c5c68" font-weight="500">holds the web page</text>
<g class="dg-l2"><path class="dg-stroke" d="M278 58H614" stroke="#15803d" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></g>
<g class="dg-l2"><path class="dg-stroke" d="M611 52l8 6-8 6" stroke="#15803d" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></g>
<text x="450" y="48" font-size="12.5" class="dg-muted" fill="#5c5c68" font-weight="600" text-anchor="middle">asks: &quot;show me this&quot;</text>
<g class="dg-l1"><path class="dg-stroke" d="M622 96H286" stroke="#0369a1" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></g>
<g class="dg-l1"><path class="dg-stroke" d="M289 90l-8 6 8 6" stroke="#0369a1" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></g>
<text x="450" y="118" font-size="12.5" class="dg-muted" fill="#5c5c68" font-weight="600" text-anchor="middle">answers: sends it back</text>
<rect class="dg-card" x="24" y="152" width="250" height="100" rx="12" fill="#ffffff" stroke="#cfcfc8"/>
<g class="dg-l2"><g class="dg-icon" transform="translate(40 168) scale(1.2500)" fill="none" stroke="#15803d" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="20" x="5" y="2" rx="2"/><path d="M12 18h.01"/></g></g>
<g class="dg-l2"><text x="82" y="189" font-size="15" class="dg-ink" fill="#15803d" font-weight="700">A streaming app</text></g>
<text x="42" y="220" font-size="13" class="dg-muted" fill="#5c5c68" font-weight="500">the client</text>
<rect class="dg-card" x="626" y="152" width="250" height="100" rx="12" fill="#ffffff" stroke="#cfcfc8"/>
<g class="dg-l1"><g class="dg-icon" transform="translate(642 168) scale(1.2500)" fill="none" stroke="#0369a1" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="14" x="2" y="5" rx="3"/><path d="m10 9 5 3-5 3z"/></g></g>
<g class="dg-l1"><text x="684" y="189" font-size="15" class="dg-ink" fill="#0369a1" font-weight="700">The streaming servers</text></g>
<text x="644" y="220" font-size="13" class="dg-muted" fill="#5c5c68" font-weight="500">hold the videos</text>
<g class="dg-l2"><path class="dg-stroke" d="M278 186H614" stroke="#15803d" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></g>
<g class="dg-l2"><path class="dg-stroke" d="M611 180l8 6-8 6" stroke="#15803d" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></g>
<text x="450" y="176" font-size="12.5" class="dg-muted" fill="#5c5c68" font-weight="600" text-anchor="middle">asks: &quot;show me this&quot;</text>
<g class="dg-l1"><path class="dg-stroke" d="M622 224H286" stroke="#0369a1" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></g>
<g class="dg-l1"><path class="dg-stroke" d="M289 218l-8 6 8 6" stroke="#0369a1" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></g>
<text x="450" y="246" font-size="12.5" class="dg-muted" fill="#5c5c68" font-weight="600" text-anchor="middle">answers: sends it back</text>
</svg></figure>

*Figure 2. The client always starts the conversation by asking; the server answers.*

> [!CHECK]
> You open a music app on your phone and press play. Which part is the server?
>
> - [ ] Your phone
> - [ ] The app's play button
> - [x] The computers of the music service that hold the songs
> - [ ] Your home router
>
> Your phone and its app are the client that asks. The server is the service's computer that answers by sending the song.

### Packets, routers and routes
Imagine you want to send a whole book to a friend, but the post only accepts postcards. You would copy the book onto many postcards, write a page number and the friend's address on every one, and post them. They might travel in different trucks and arrive in a different order. Your friend puts them in order using the numbers and reads the book.

The Internet does exactly this. A photo, a web page or a video is never sent in one piece. It is cut into small pieces called **packets**. Each packet carries a piece of the data, a number that says its place in the sequence, and the IP address of where it is going and where it came from.

Why not send everything in one go? There are two good reasons:

- **Sharing the road.** Many people use the same cables at once. Small packets from many people can take turns, so nobody has to wait for someone else's huge file to finish.
- **Resilience.** If one packet gets lost or a link breaks, only that small packet is sent again, not the whole photo. The packets can also go round the problem.

Packets travel from router to router. Each router is like a sorting office: it looks at the destination address on the packet and sends it to the next router that is closer to the destination. The passage from one router to the next is called a **hop**. A trip across the Internet often takes between a few and about twenty hops. No router knows the whole journey, only the best next step. Because routers can choose different next steps depending on how busy things are, the packets of one photo may take different routes. At the end, the receiving computer uses the numbers to put the packets back in order. If a packet is missing, the receiver asks for it again.

<figure class="diagram" style="--dg-w: 1040px"><svg xmlns="http://www.w3.org/2000/svg" class="dg" viewBox="0 0 1040 400" width="1040" height="400" role="img" aria-labelledby="inet-packets-title inet-packets-desc" font-family="Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif" xml:lang="en">
<title id="inet-packets-title">A message split into numbered packets that take different routes</title>
<desc id="inet-packets-desc">A sender with a photo to send on the left and a receiver on the right. Between them are four routers: one on the left, two in the middle (an upper and a lower route) and one on the right. The photo is split into four numbered packets. Packets 1 and 3 travel along the upper route and packets 2 and 4 along the lower route. At the receiver the packets arrive in the order 3, 1, 4, 2 and are put back in order as 1, 2, 3, 4.</desc>
<rect class="dg-bg" x="0.5" y="0.5" width="1039" height="399" rx="16" fill="#ffffff" stroke="#e3e3dd"/>
<rect class="dg-card" x="20" y="100" width="200" height="100" rx="12" fill="#ffffff" stroke="#cfcfc8"/>
<g class="dg-l2"><g class="dg-icon" transform="translate(36 116) scale(1.2500)" fill="none" stroke="#15803d" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16"/></g></g>
<g class="dg-l2"><text x="78" y="137" font-size="15" class="dg-ink" fill="#15803d" font-weight="700">Sender</text></g>
<text x="38" y="168" font-size="13" class="dg-muted" fill="#5c5c68" font-weight="500">A photo to send</text>
<rect class="dg-card" x="820" y="100" width="200" height="120" rx="12" fill="#ffffff" stroke="#cfcfc8"/>
<g class="dg-l2"><g class="dg-icon" transform="translate(836 116) scale(1.2500)" fill="none" stroke="#15803d" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16"/></g></g>
<g class="dg-l2"><text x="878" y="137" font-size="15" class="dg-ink" fill="#15803d" font-weight="700">Receiver</text></g>
<text x="838" y="168" font-size="13" class="dg-muted" fill="#5c5c68" font-weight="500">Packets arrive mixed up,</text>
<text x="838" y="188" font-size="13" class="dg-muted" fill="#5c5c68" font-weight="500">then are put back in order</text>
<rect class="dg-card" x="280" y="118" width="120" height="64" rx="12" fill="#ffffff" stroke="#cfcfc8"/>
<g class="dg-l1"><g class="dg-icon" transform="translate(296 134) scale(1.2500)" fill="none" stroke="#0369a1" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="8" x="2" y="14" rx="2"/><path d="M6.01 18H6"/><path d="M10.01 18H10"/><path d="M15 10v4"/><path d="M17.84 7.17a4 4 0 0 0-5.66 0"/><path d="M20.66 4.34a8 8 0 0 0-11.31 0"/></g></g>
<g class="dg-l1"><text x="338" y="155" font-size="13.5" class="dg-ink" fill="#0369a1" font-weight="700">Router</text></g>
<rect class="dg-card" x="460" y="24" width="120" height="64" rx="12" fill="#ffffff" stroke="#cfcfc8"/>
<g class="dg-l1"><g class="dg-icon" transform="translate(476 40) scale(1.2500)" fill="none" stroke="#0369a1" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="8" x="2" y="14" rx="2"/><path d="M6.01 18H6"/><path d="M10.01 18H10"/><path d="M15 10v4"/><path d="M17.84 7.17a4 4 0 0 0-5.66 0"/><path d="M20.66 4.34a8 8 0 0 0-11.31 0"/></g></g>
<g class="dg-l1"><text x="518" y="61" font-size="13.5" class="dg-ink" fill="#0369a1" font-weight="700">Router</text></g>
<rect class="dg-card" x="460" y="212" width="120" height="64" rx="12" fill="#ffffff" stroke="#cfcfc8"/>
<g class="dg-l1"><g class="dg-icon" transform="translate(476 228) scale(1.2500)" fill="none" stroke="#0369a1" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="8" x="2" y="14" rx="2"/><path d="M6.01 18H6"/><path d="M10.01 18H10"/><path d="M15 10v4"/><path d="M17.84 7.17a4 4 0 0 0-5.66 0"/><path d="M20.66 4.34a8 8 0 0 0-11.31 0"/></g></g>
<g class="dg-l1"><text x="518" y="249" font-size="13.5" class="dg-ink" fill="#0369a1" font-weight="700">Router</text></g>
<rect class="dg-card" x="640" y="118" width="120" height="64" rx="12" fill="#ffffff" stroke="#cfcfc8"/>
<g class="dg-l1"><g class="dg-icon" transform="translate(656 134) scale(1.2500)" fill="none" stroke="#0369a1" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="8" x="2" y="14" rx="2"/><path d="M6.01 18H6"/><path d="M10.01 18H10"/><path d="M15 10v4"/><path d="M17.84 7.17a4 4 0 0 0-5.66 0"/><path d="M20.66 4.34a8 8 0 0 0-11.31 0"/></g></g>
<g class="dg-l1"><text x="698" y="155" font-size="13.5" class="dg-ink" fill="#0369a1" font-weight="700">Router</text></g>
<g class="dg-l2"><path class="dg-stroke" d="M222 150H278" stroke="#15803d" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></g>
<g class="dg-l1"><path class="dg-stroke" d="M402 150L458 56" stroke="#0369a1" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></g>
<g class="dg-l1"><path class="dg-stroke" d="M402 150L458 244" stroke="#0369a1" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></g>
<g class="dg-l1"><path class="dg-stroke" d="M582 56L638 150" stroke="#0369a1" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></g>
<g class="dg-l1"><path class="dg-stroke" d="M582 244L638 150" stroke="#0369a1" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></g>
<g class="dg-l1"><path class="dg-stroke" d="M762 150H802" stroke="#0369a1" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></g>
<g class="dg-l1"><path class="dg-stroke" d="M809 144l8 6-8 6" stroke="#0369a1" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></g>
<g class="dg-l4"><rect class="dg-solid" x="46" y="216" width="30" height="26" rx="13" fill="#c2410c"/><text x="61" y="233.5" font-size="12" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">1</text></g>
<g class="dg-l4"><rect class="dg-solid" x="84" y="216" width="30" height="26" rx="13" fill="#c2410c"/><text x="99" y="233.5" font-size="12" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">2</text></g>
<g class="dg-l4"><rect class="dg-solid" x="122" y="216" width="30" height="26" rx="13" fill="#c2410c"/><text x="137" y="233.5" font-size="12" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">3</text></g>
<g class="dg-l4"><rect class="dg-solid" x="160" y="216" width="30" height="26" rx="13" fill="#c2410c"/><text x="175" y="233.5" font-size="12" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">4</text></g>
<text x="20" y="266" font-size="12.5" class="dg-muted" fill="#5c5c68" font-weight="600">Each packet has a number and the receiver&#x27;s address</text>
<g class="dg-l4"><rect class="dg-solid" x="416" y="90" width="28" height="26" rx="13" fill="#c2410c"/><text x="430" y="107.5" font-size="12" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">1</text></g>
<g class="dg-l4"><rect class="dg-solid" x="596" y="90" width="28" height="26" rx="13" fill="#c2410c"/><text x="610" y="107.5" font-size="12" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">3</text></g>
<g class="dg-l4"><rect class="dg-solid" x="416" y="184" width="28" height="26" rx="13" fill="#c2410c"/><text x="430" y="201.5" font-size="12" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">2</text></g>
<g class="dg-l4"><rect class="dg-solid" x="596" y="184" width="28" height="26" rx="13" fill="#c2410c"/><text x="610" y="201.5" font-size="12" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">4</text></g>
<rect class="dg-panel" x="560" y="308" width="460" height="86" rx="12" fill="#f0f0ec"/>
<text x="576" y="338" font-size="11" class="dg-muted" fill="#5c5c68" font-weight="700" letter-spacing="1.2">ARRIVES</text>
<g class="dg-l4"><rect class="dg-solid" x="776" y="325" width="30" height="26" rx="13" fill="#c2410c"/><text x="791" y="342.5" font-size="12" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">3</text></g>
<g class="dg-l4"><rect class="dg-solid" x="816" y="325" width="30" height="26" rx="13" fill="#c2410c"/><text x="831" y="342.5" font-size="12" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">1</text></g>
<g class="dg-l4"><rect class="dg-solid" x="856" y="325" width="30" height="26" rx="13" fill="#c2410c"/><text x="871" y="342.5" font-size="12" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">4</text></g>
<g class="dg-l4"><rect class="dg-solid" x="896" y="325" width="30" height="26" rx="13" fill="#c2410c"/><text x="911" y="342.5" font-size="12" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">2</text></g>
<text x="576" y="374" font-size="11" class="dg-muted" fill="#5c5c68" font-weight="700" letter-spacing="1.2">AFTER SORTING</text>
<g class="dg-ok"><rect class="dg-solid" x="776" y="361" width="30" height="26" rx="13" fill="#15803d"/><text x="791" y="378.5" font-size="12" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">1</text></g>
<g class="dg-ok"><rect class="dg-solid" x="816" y="361" width="30" height="26" rx="13" fill="#15803d"/><text x="831" y="378.5" font-size="12" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">2</text></g>
<g class="dg-ok"><rect class="dg-solid" x="856" y="361" width="30" height="26" rx="13" fill="#15803d"/><text x="871" y="378.5" font-size="12" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">3</text></g>
<g class="dg-ok"><rect class="dg-solid" x="896" y="361" width="30" height="26" rx="13" fill="#15803d"/><text x="911" y="378.5" font-size="12" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">4</text></g>
</svg></figure>

*Figure 3. Packets take different routes and may arrive out of order; their numbers let the receiver rebuild the photo.*

> [!CHECK]
> Why is a photo sent as many small packets instead of as one big piece?
>
> - [ ] Because routers can only read pictures that are small
> - [ ] Because every packet is faster than the one before it
> - [x] So many users can share the same links, and only a lost piece needs to be sent again
> - [ ] Because it makes the photo smaller in quality
>
> Small packets let many people take turns on the same cables, and a lost packet is resent on its own. The photo's quality is not changed.

### ISPs, cables and data centres
Your home router is not connected to the whole world directly. You pay a company, your **Internet service provider** (ISP), to connect you. An ISP is a company that owns or rents a network and sells access to the Internet. Examples are your telephone, cable, fibre or mobile company.

The ISP connects your home to its own network through a cable in the wall, a fibre line or a radio link (mobile data). From there your packets reach the ISP's routers. If the website you want is inside the ISP's network, the way is short. If not, the ISP hands your packets to another network, because ISPs are linked to each other and to big content companies. This is why the Internet is a network of networks: no ISP covers everything, and each depends on the others.

Between cities and countries, the links are mostly **undersea cables**: thick cables on the sea floor that carry data as pulses of light. Most traffic between continents travels this way, not by satellite, because cables are faster and carry far more. There are hundreds of them around the world.

The servers themselves live in **data centres**: large buildings full of computers, with strong power supplies, cooling and fast network links. A video service, a bank or a shop may keep its servers in several data centres, in different places, so that if one fails the others keep working, and so users can be served from a nearby one.

> [!CHECK]
> What does your ISP do?
>
> - [ ] It owns every website you visit
> - [x] It connects your home network to the rest of the Internet
> - [ ] It stores a copy of everything on the Internet
> - [ ] It decides which websites exist
>
> The ISP is the company that gives your home access to the Internet by linking it to its own network and to other networks.

## How it works
Here is what happens, at a high level, when you type `example.com` in your browser and press Enter.

1. **You ask.** Your browser (the client) needs the page held by the server for `example.com`.
2. **Find the address.** Computers talk with numbers, not names. Your device asks a service that works like a giant phone book, the **DNS** (Domain Name System), for the IP address that belongs to `example.com`. The answer comes back in a moment.
3. **The request travels.** Your browser sends a small request, split into packets, to your home router. The router passes it to your ISP, and packets hop from router to router, across one or more networks, until they reach the server.
4. **The server answers.** The server prepares the page and sends it back, cut into packets. They follow the same kind of journey in the opposite direction, maybe by different routes.
5. **The page appears.** Your computer puts the packets back in order. The browser reads the result and shows you the page. A real page often needs many requests, for example one for the text, others for each picture, so steps 3 to 5 repeat many times, usually in less than a second.

<figure class="diagram" style="--dg-w: 1060px"><svg xmlns="http://www.w3.org/2000/svg" class="dg" viewBox="0 0 1060 166" width="1060" height="166" role="img" aria-labelledby="inet-page-journey-title inet-page-journey-desc" font-family="Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif" xml:lang="en">
<title id="inet-page-journey-title">What happens when you open a web page</title>
<desc id="inet-page-journey-desc">Five numbered steps in a row. 1, You ask: you type example.com. 2, Find the address: a phone book gives its number. 3, Request travels: packets hop from router to router. 4, Server answers: it sends the page back in packets. 5, Page appears: your browser puts the pieces together.</desc>
<rect class="dg-bg" x="0.5" y="0.5" width="1059" height="165" rx="16" fill="#ffffff" stroke="#e3e3dd"/>
<rect class="dg-card" x="24" y="24" width="175.2" height="118" rx="12" fill="#ffffff" stroke="#cfcfc8"/>
<g class="dg-l1"><circle class="dg-solid" cx="46" cy="48" r="12" fill="#0369a1"/><text x="46" y="52.5" font-size="12.5" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">1</text></g>
<g class="dg-l1"><g class="dg-icon" transform="translate(159.2 36) scale(1.0833)" fill="none" stroke="#0369a1" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16"/></g></g>
<text x="38" y="86" font-size="14" class="dg-text" fill="#17171c" font-weight="700">You ask</text>
<text x="38" y="106" font-size="12" class="dg-muted" fill="#5c5c68" font-weight="500">You type</text>
<text x="38" y="123" font-size="12" class="dg-muted" fill="#5c5c68" font-weight="500">example.com</text>
<path class="dg-line" d="M205.2 83H227.2" stroke="#cfcfc8" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
<path class="dg-line" d="M219.2 77l8 6-8 6" stroke="#cfcfc8" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
<rect class="dg-card" x="233.2" y="24" width="175.2" height="118" rx="12" fill="#ffffff" stroke="#cfcfc8"/>
<g class="dg-l1"><circle class="dg-solid" cx="255.2" cy="48" r="12" fill="#0369a1"/><text x="255.2" y="52.5" font-size="12.5" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">2</text></g>
<g class="dg-l1"><g class="dg-icon" transform="translate(368.4 36) scale(1.0833)" fill="none" stroke="#0369a1" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h16"/><path d="M4 12h10"/><path d="M4 18h6"/><circle cx="18" cy="16" r="3"/><path d="m22 20-1.8-1.8"/></g></g>
<text x="247.2" y="86" font-size="14" class="dg-text" fill="#17171c" font-weight="700">Find the address</text>
<text x="247.2" y="106" font-size="12" class="dg-muted" fill="#5c5c68" font-weight="500">A &quot;phone book&quot;</text>
<text x="247.2" y="123" font-size="12" class="dg-muted" fill="#5c5c68" font-weight="500">gives its number</text>
<path class="dg-line" d="M414.4 83H436.4" stroke="#cfcfc8" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
<path class="dg-line" d="M428.4 77l8 6-8 6" stroke="#cfcfc8" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
<rect class="dg-card" x="442.4" y="24" width="175.2" height="118" rx="12" fill="#ffffff" stroke="#cfcfc8"/>
<g class="dg-l1"><circle class="dg-solid" cx="464.4" cy="48" r="12" fill="#0369a1"/><text x="464.4" y="52.5" font-size="12.5" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">3</text></g>
<g class="dg-l1"><g class="dg-icon" transform="translate(577.6 36) scale(1.0833)" fill="none" stroke="#0369a1" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="8" x="2" y="14" rx="2"/><path d="M6.01 18H6"/><path d="M10.01 18H10"/><path d="M15 10v4"/><path d="M17.84 7.17a4 4 0 0 0-5.66 0"/><path d="M20.66 4.34a8 8 0 0 0-11.31 0"/></g></g>
<text x="456.4" y="86" font-size="14" class="dg-text" fill="#17171c" font-weight="700">Request travels</text>
<text x="456.4" y="106" font-size="12" class="dg-muted" fill="#5c5c68" font-weight="500">Packets hop from</text>
<text x="456.4" y="123" font-size="12" class="dg-muted" fill="#5c5c68" font-weight="500">router to router</text>
<path class="dg-line" d="M623.6 83H645.6" stroke="#cfcfc8" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
<path class="dg-line" d="M637.6 77l8 6-8 6" stroke="#cfcfc8" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
<rect class="dg-card" x="651.6" y="24" width="175.2" height="118" rx="12" fill="#ffffff" stroke="#cfcfc8"/>
<g class="dg-l1"><circle class="dg-solid" cx="673.6" cy="48" r="12" fill="#0369a1"/><text x="673.6" y="52.5" font-size="12.5" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">4</text></g>
<g class="dg-l1"><g class="dg-icon" transform="translate(786.8 36) scale(1.0833)" fill="none" stroke="#0369a1" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="8" x="2" y="2" rx="2"/><rect width="20" height="8" x="2" y="14" rx="2"/><path d="M6 6h.01"/><path d="M6 18h.01"/></g></g>
<text x="665.6" y="86" font-size="14" class="dg-text" fill="#17171c" font-weight="700">Server answers</text>
<text x="665.6" y="106" font-size="12" class="dg-muted" fill="#5c5c68" font-weight="500">It sends the page</text>
<text x="665.6" y="123" font-size="12" class="dg-muted" fill="#5c5c68" font-weight="500">back in packets</text>
<path class="dg-line" d="M832.8 83H854.8" stroke="#cfcfc8" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
<path class="dg-line" d="M846.8 77l8 6-8 6" stroke="#cfcfc8" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
<rect class="dg-card" x="860.8" y="24" width="175.2" height="118" rx="12" fill="#ffffff" stroke="#cfcfc8"/>
<g class="dg-l1"><circle class="dg-solid" cx="882.8" cy="48" r="12" fill="#0369a1"/><text x="882.8" y="52.5" font-size="12.5" class="dg-on" fill="#ffffff" font-weight="700" text-anchor="middle">5</text></g>
<g class="dg-l1"><g class="dg-icon" transform="translate(996 36) scale(1.0833)" fill="none" stroke="#0369a1" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"/><path d="M2 12h20"/></g></g>
<text x="874.8" y="86" font-size="14" class="dg-text" fill="#17171c" font-weight="700">Page appears</text>
<text x="874.8" y="106" font-size="12" class="dg-muted" fill="#5c5c68" font-weight="500">Your browser puts</text>
<text x="874.8" y="123" font-size="12" class="dg-muted" fill="#5c5c68" font-weight="500">the pieces together</text>
</svg></figure>

*Figure 4. Five steps from typing an address to seeing a page.*

> [!CHECK]
> Before your browser can send a request to `example.com`, what does it need?
>
> - [ ] A copy of the web page
> - [ ] A new ISP
> - [x] The IP address that belongs to the name
> - [ ] The server's permission to open the browser
>
> Names are for people; the network delivers by IP address. DNS translates the name to the address first.

## Worked example
Sofia lives in an apartment and watches a film on her phone over home Wi-Fi.

1. Her phone (client) connects by Wi-Fi to the router in her apartment: this is her home network.
2. She presses play. The phone asks the streaming service for the film, in packets, through the router.
3. The router sends them over the fibre line to her ISP. The ISP's routers pass them on, perhaps to another network, until they reach a data centre of the streaming service.
4. The streaming server sends the film back as thousands of numbered packets, over the same kind of path.
5. Some packets arrive slightly late. Her phone puts them in order and keeps a few seconds of film in advance, so the picture doesn't pause.

If her ISP's connection fails, her home network still works (she can still print at home), but nothing outside answers: she has lost her link to the Internet, not her network.

## Common pitfalls
- **"The Internet and the web are the same."** The Internet is the network that carries data. The web (web pages in a browser) is just one service that uses it; email, video calls and games use it too.
- **"The Internet is in the cloud, not in real places."** It runs on real cables, routers and buildings, many of them under the sea. "The cloud" just means someone else's computers in a data centre.
- **"Wi-Fi is the Internet."** Wi-Fi only connects your device to your router, inside your home. If the ISP link is down, Wi-Fi can look fine while no page loads.
- **"My data travels in one piece along one fixed path."** It is cut into packets, and routers may send them on different routes.

## Security considerations
Because your data crosses many networks you don't own, a few simple habits matter:

- Packets can in principle be read along the way unless they are protected. Look for the padlock and `https://` in the browser's address bar: it means the connection to that site is encrypted, so others on the path can't read it.
- On public Wi-Fi (cafés, airports), avoid entering passwords or bank details on sites that do not use `https://`, and prefer your mobile data for sensitive tasks.
- Change your home router's default password: it is the front door of your home network.

> [!NOTE]
> Encryption, passwords and safe browsing have their own modules. Here you only need to know that the path between you and a server is shared with many other machines.

## Summary
- A network is a group of connected devices; the Internet is a network of networks that agree on common rules.
- A client (your browser or app) asks; a server (a computer in a data centre) answers.
- Data is cut into numbered packets, passed from router to router, and put back in order at the destination.
- Your ISP connects your home to the rest of the Internet; undersea cables and data centres make up the physical parts you never see.
- Opening a web page means: ask, find the address, send the request, get the answer, show the page.

## Glossary
| Term | Definition |
|---|---|
| network | A group of connected devices that can send data to each other. |
| router | A device that receives data and passes it on towards its destination, like a sorting office for packets. |
| Internet | The worldwide network of networks that agree on common rules for passing data. |
| IP address | The number that identifies a device on a network, like the address on an envelope. |
| domain name | A readable name such as `example.com` that is translated into an IP address. |
| client | The device or program that asks for something, such as your browser or an app. |
| server | A computer that waits for requests and sends back what is asked, such as a web page or a video. |
| packet | A small piece of data, with a number and the addresses of sender and receiver. |
| hop | The step from one router to the next on a packet's journey. |
| Internet service provider | The company (ISP) that connects your home to the Internet. |
| undersea cable | A cable on the sea floor that carries data as light between countries and continents. |
| data centre | A large building full of computers (servers), with power, cooling and fast network links. |
| DNS | The Domain Name System, the "phone book" that turns a domain name into an IP address. |

## Check your understanding
1. In your own words, why is the Internet called a "network of networks"? Name two networks that take part when you open a web page.
2. Think of three apps on your phone. For each one, say what the client is and what the server does.
3. Your friend says "my Wi-Fi is on but nothing loads". Using what you learned, name two places along the path where the problem could be.

## References
- [How does the Internet work? — MDN Web Docs](https://developer.mozilla.org/en-US/docs/Learn_web_development/Howto/Web_mechanics/How_does_the_Internet_work)
- RFC 1918, Address Allocation for Private Internets, and RFC 5737, IPv4 Address Blocks Reserved for Documentation (`203.0.113.0/24` is a documentation range).