Learn · Track 1 of 4

The Internet

When you press Play, your device talks to computers that can be thousands of kilometers away, and the game appears in about a second. Follow a packet from your Wi-Fi to the other side of the world and back.

12 lessons 8 Try-it toys and steppers 1 quiz
You Router Internet Cloud­flare LeonGames packets on their way

Every page, picture and game travels like this: chopped into tiny packets that zip across the world.

LESSON 1

What is the internet?

The internet is a network of networks. Your home Wi-Fi is a small network. Your school has one. Phone companies, internet providers and big data centers each have their own. The internet is what you get when all of those networks agree to connect to each other.

To understand each other, they follow shared rules called protocols. A protocol is an agreement about how to talk, the same way everyone agrees that a red light means stop. Any computer that follows the protocols can join, whatever brand or country it's from.

The internet is also very physical. Data travels through copper wires, through the air as radio waves, and through fiber-optic cables that carry pulses of light. Giant cables lie on the ocean floor and connect the continents. Almost all data that crosses an ocean goes through those undersea cables, not through satellites.

Your home Phone Laptop Console Router Your internetprovider (ISP) School network Phone network (5G) Ocean floor undersea fiber cable Internetexchange Data center(servers)
Packets going out (blue, yellow) and answers coming back (pink, green). Internet exchanges are buildings where different networks plug into each other.
Internet vs. webThe internet is the roads. The web (websites like leongames.org) is one kind of traffic that drives on those roads. Video calls, email, messages and online multiplayer games use the same roads.
LESSON 2

Wi-Fi is not the internet

People often say "the Wi-Fi is down" when they mean the internet. They're two different things.

Wi-Fi is a way to connect devices to your home router without cables, using radio waves. Think of it as an invisible cable that reaches a few rooms. It only goes from your device to the router, and that's all.

The router is plugged into a real cable (fiber, TV cable or phone line) that goes out to your internet provider. That cable is your home's real door to the internet. Wi-Fi is your driveway; the internet is the whole highway system. Full Wi-Fi bars only tell you the driveway is fine.

Try it

Unplug the internet

Pull out the internet cable and watch what happens. The Wi-Fi keeps working, but packets get stuck at the router. Then switch off the Wi-Fi to see the difference.

PhoneWi-Fi ●●● TabletWi-Fi ●●● LaptopWi-Fi ●●● Wi-Firouter cable Fiber box(modem) Internetprovider Internet radio waves (Wi-Fi) real cables to the outside world

Wi-Fi: connected · Internet: connected

Good things to know about Wi-Fi

  • Walls slow it down. Radio waves get weaker through walls, floors, fish tanks and even people. Closer to the router usually means faster.
  • 2.4 GHz and 5 GHz. Many routers make two Wi-Fi networks. 2.4 GHz reaches farther; 5 GHz is faster but shorter range.
  • Bluetooth is a different radio, for very short distances: headphones, game controllers, smartwatches. It isn't the internet either.
  • When "nothing works", the classic fix is to restart the router: unplug it, wait 30 seconds, plug it back in. Ask an adult first.
LESSON 3

How devices get online

Phones, tablets, Chromebooks, laptops, desktop PCs and game consoles all speak the same internet protocols. What changes is how they reach the internet. There are four common ways:

radio to your router

Wi-Fi

Wireless, at home, at school or in a café. Almost every device has it.

a real wire

Ethernet cable

A cable from the device to the router. The most stable and fastest connection, which is why gamers love it.

radio to a cell tower

Mobile data (4G/5G)

Phones talk to towers of a phone company using a SIM card. Works almost anywhere, but data usually costs money.

sharing a phone's data

Hotspot

A phone turns its mobile data into a small Wi-Fi network so a laptop or tablet can get online.

Try it

Pick a device and a way to connect

Choose a device, then a connection, and watch the path its packets take to reach the internet.

LESSON 4

IP addresses

Every device on the internet needs an address so data knows where to go. That address is an IP address (IP stands for Internet Protocol). It works like the address on an envelope.

The classic kind, called IPv4, is four numbers separated by dots, and each number goes from 0 to 255:

203.0.113.42

That gives about 4.3 billion different addresses. It sounds like a lot, but there are more phones, laptops, consoles and smart TVs than that. So a newer kind, IPv6, uses much longer addresses like 2001:db8::8a2e:370:7334. IPv6 has about 340 trillion trillion trillion addresses, enough to give one to every grain of sand on Earth many times over.

Public and private addresses

Your home router has one public IP that the rest of the internet sees. Inside your home, the router gives each device a private IP, usually starting with 192.168.. When your tablet asks for a web page, the router sends the request out using its public address, remembers who asked, and hands the answer to the right device. It's like an apartment building: one street address outside, many apartment numbers inside.

INSIDE YOUR HOME · private addresses Tablet192.168.1.23 Laptop192.168.1.24 Console192.168.1.25 Router public IP 203.0.113.42 The internet only sees the public IP
Example addresses. Real ones look exactly like these.
Try it

Why do the numbers stop at 255?

Computers store everything as bits: tiny switches that are either 0 (off) or 1 (on). Each part of an IPv4 address uses 8 bits, which is called a byte. Tap the switches and see which numbers you can make. With all 8 on, you get the biggest one.

Number: 0 · binary 00000000
On Leon GamesAn IP address can reveal roughly which city or region you're in, though not your exact home. That's one reason Leon Games never saves IP addresses. The Hall of Fame lesson shows the trick it uses instead.
LESSON 5

Packets

Data never travels as one big piece. A photo, a message or a game file is chopped into small pieces called packets, each one at most about 1,500 bytes. A game of 3 megabytes becomes roughly 2,000 packets.

Each packet is like an envelope. On the outside it says who sent it, who it's for, and which piece it is. Inside, it carries its small slice of the data.

HEADER (the outside of the envelope) From203.0.113.42 To198.51.100.20 Piece3 / 7 PAYLOAD (the slice of data inside) 01001100 01000101 01001111 01001110 00100000 01000111 01000001 01001101 …up to about 1,500 bytes One file → many packets 1 2 3 4 5 6 7 Every packet gets a number, so the receiver can put them back in the right order.
game.png3 MB the file game.png3 MB, rebuilt put back in order six packets, six different paths 1 2 3 4 5 6
The file is chopped into numbered packets. They travel separately, even on different routes, and the receiver rebuilds the file using the numbers.

Why chop things up?

  • Sharing the road. If one huge file used a cable all by itself, everyone else would have to wait. Small packets from millions of people can mix on the same cable.
  • Different routes. Packets can take different paths, so a traffic jam or broken cable doesn't stop everything.
  • Easy fixes. If one packet gets lost, only that one is sent again, not the whole file.

Careful delivery and fast delivery

TCP is the careful method. It checks that every packet arrived and asks again for any that went missing. Web pages need every single byte, so they use careful delivery. (Newer websites use a faster careful method called QUIC, but the idea is the same.)

UDP is the fast method. It sends packets and doesn't wait for a reply. Online multiplayer games and video calls often use it, because a packet that arrives late is useless anyway: the game has already moved on.

LESSON 6

Routers and the journey

Packets jump from router to router. A router is a computer whose only job is to read the "To" address on each packet and pass it one step closer, like a mail sorting office. No router knows the whole path. Each one just knows which neighbor is closer to the destination. Each jump is called a hop, and a trip across the internet usually takes 10 to 20 hops.

Packets from the same message may take different paths and arrive mixed up. The receiver uses the packet numbers to rebuild the message in the right order.

Try it

Send a message across the network

Type a short message and press Send. Watch the order the packets arrive in. Then switch off router R4 and send again. The network finds another way around. The internet was designed so that no single broken part could stop it.

Packets waiting to be sent.

LESSON 7

Domain names and DNS

Computers find each other with IP addresses, but people are bad at remembering numbers. So we use names like leongames.org. A domain name is a friendly name that points to an IP address.

https://www.leongames.org/hall-of-fame secure web(see HTTPS) subdomain the name we chose top-leveldomain (TLD) path: which page
Domains are rented, not bought forever. Someone pays a domain shop (a registrar) every year to keep leongames.org.

DNS (Domain Name System) is the internet's contact list. When you type leongames.org, your device has to look up its IP address before anything else can happen. Click through the steps:

Your browser"leongames.org?" DNS resolverthe look-up helper Root serverknows every TLD .org serverknows every .org Cloudflarename server 198.51.100.20 198.51.100.20 1 2 3 4 5 6 7
LESSON 8

Browsers, servers and HTTP

A browser (Chrome, Safari, Edge, Firefox) is a program that asks for web pages and shows them. A server is a computer that waits for requests and answers them. Servers are ordinary computers, usually without a screen, kept in huge buildings called data centers.

They talk using HTTP (HyperText Transfer Protocol). It always works in pairs: the browser sends a request, and the server sends back a response.

Request (browser → server)
GET /games/games.json
Host: leongames.org
Accept: application/json
Response (server → browser)
200 OK
Content-Type: application/json

[ { "id": "true-knight", … } ]

A real request from Leon Games: games.json is the catalog file that lists every game on the site.

The first word of a request is the method. GET means "please give me this". POST means "here is something for you", like when you submit a score to the Hall of Fame. Every response starts with a status code:

CodeMeansWhen you'd see it
200OKEverything worked. Almost every request.
301MovedThe page lives at a new address; the browser follows automatically.
404Not foundThe page doesn't exist. Leon Games has its own 404 page.
429Too many requestsSomeone is sending too much, too fast. The Hall of Fame uses this to stop spam.
500Server errorSomething broke on the server's side.
See it yourselfOne page is never one request. The browser asks separately for the HTML, the styles, the scripts, every image, every font and the game files. On a computer, open leongames.org, press F12, click the Network tab and reload the page. Every line is one request and response.
LESSON 9

Speed: bandwidth and ping

Two different things decide how fast the internet feels. Think of a water pipe:

  • Bandwidth is how wide the pipe is: how much data can flow each second. It's measured in megabits per second (Mbps). More bandwidth means a big download finishes sooner.
  • Latency is how long the pipe is: how long one trip takes. It's measured in milliseconds (ms), thousandths of a second. Gamers call it ping. Low ping means your button press reaches the server quickly.

Nothing travels faster than light, and inside a fiber cable light moves at about 200,000 km per second. That sounds instant, but the Earth is big. And loading a web page needs several round trips before the first picture shows up (DNS, connecting, the secure handshake, asking for the page), so distance adds up.

Try it

The speed-of-light calculator

Move the slider to choose how far away the server is. These are the best possible times. Real cables don't run in straight lines and every router adds a little delay, so real numbers are higher.


One way
0 ms
Round trip (ping)
0 ms
Page starts (≈4 trips)
0 ms

For comparison, a blink of an eye takes about 100 to 150 ms.

On Leon GamesThis is exactly why the site uses Cloudflare: it keeps copies of Leon Games in hundreds of cities, so the server is almost always "Same city" or "Next country" for you, never "Other side of Earth". See the Cloudflare lesson below.
LESSON 10

HTTPS and the padlock

Your packets pass through many routers owned by other people. With plain HTTP, anyone along the way (for example, someone on the same café Wi-Fi) could read them or even change them. The S in HTTPS means secure, and it does two jobs:

  1. Encryption. Everything is scrambled so that only your browser and the real server can unscramble it. Anyone in the middle just sees noise.
  2. Proof of identity. The server shows a certificate, a digital ID card signed by a trusted organization. Your browser checks it, so you know you're talking to the real leongames.org and not a fake.

The padlock trick

How can two computers agree on a secret if strangers can see everything they send? Imagine the server hands out open padlocks to anyone who asks, but keeps the only key. Your browser picks a secret code, puts it in a box, and snaps the server's padlock shut. Anyone can see the box go by, but only the server can open it. Now both sides know the secret code and use it to scramble everything else. Real HTTPS does this with math instead of padlocks, in a fraction of a second, every time you open a site.

Your browser Serverhas the only key 1 · "Here's an open padlock" (public key) 2 · Secret code, locked in a box with that padlock strangers see the box, not the secret
Try it

Scramble a message

This is a very old cipher: every letter moves forward in the alphabet by the same amount (the key). Change the key and the text. A computer could break this toy in a millionth of a second. Real HTTPS keys are so strong that all the computers on Earth working together would need longer than the age of the universe to guess one.


On Leon GamesCloudflare creates the certificate for leongames.org automatically and renews it before it expires. That's why the padlock is always there.
LESSON 11

Cloudflare and the edge

Leon Games doesn't live on one computer in somebody's house. It runs on Cloudflare, a company with data centers in more than 300 cities around the world. When the site is published, its files are copied to all of them. When you visit, you're served by the one closest to you.

This is called the edge: computers at the edge of the network, near the people using them, instead of one far-away central server.

Leon Games files uploaded once copyNew York copySão Paulo copyLondon copyLagos copyTokyo copySydney ● players connect to the nearest copy
Six example cities. The real network has hundreds. A trick called anycast lets all of them share the same IP address, and the internet's routers automatically deliver you to the nearest one.

Leon Games uses several Cloudflare pieces. You've already met each of these in this track:

answers "where is it?"

DNS

Cloudflare's name servers answer the last step of the DNS lookup for leongames.org.

copies near you

CDN (static assets)

A Content Delivery Network. The HTML, CSS, images and game files are stored in every location, ready to send.

the padlock

Certificate

Created and renewed automatically, so the site is always HTTPS.

tiny programs at the edge

Worker

A small program that runs in every location. Leon Games has one that answers the Hall of Fame requests (addresses that start with /api/).

organized storage

D1 database

A database is like a giant, super-fast spreadsheet. D1 stores the Hall of Fame scores.

human or robot?

Turnstile

Checks that a real person is submitting a score, usually without any puzzle to solve.

the shield

Attack protection

Blocks floods of fake traffic (called DDoS attacks) before they ever reach the site.

Cool factAll of this runs on Cloudflare's free plan. Putting a website in front of the whole world used to need expensive servers and a team of experts. Today a small project like Leon Games can do it.
LESSON 12

The trip of one click

Here is everything you've learned, in order. This is what happens between typing leongames.org and jumping as True Knight.

Your devicebrowser Router Internetprovider + hops DNS CLOUDFLARE · NEAREST CITY Certificatethe padlock Site filesHTML, CSS, games Worker/api/… D1scores × 30 files game files 60×/s the game runs here POST /api/run/finish
QUIZ

Check what you learned

7 questions about this track. Pick an answer to see if you got it right. Your answers are saved only on this device.

Next track

Your Devices

What's inside your phone or computer: CPU, RAM, storage, GPU and the operating system.

Go to track 2 →