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.
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.
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.
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.
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:
Wi-Fi
Wireless, at home, at school or in a café. Almost every device has it.
Ethernet cable
A cable from the device to the router. The most stable and fastest connection, which is why gamers love it.
Mobile data (4G/5G)
Phones talk to towers of a phone company using a SIM card. Works almost anywhere, but data usually costs money.
Hotspot
A phone turns its mobile data into a small Wi-Fi network so a laptop or tablet can get online.
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.
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.
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.
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.
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.
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.
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.
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.
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:
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.
GET /games/games.json Host: leongames.org Accept: application/json
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:
| Code | Means | When you'd see it |
|---|---|---|
| 200 | OK | Everything worked. Almost every request. |
| 301 | Moved | The page lives at a new address; the browser follows automatically. |
| 404 | Not found | The page doesn't exist. Leon Games has its own 404 page. |
| 429 | Too many requests | Someone is sending too much, too fast. The Hall of Fame uses this to stop spam. |
| 500 | Server error | Something broke on the server's side. |
F12, click the Network tab and reload the page. Every line is one request and response.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.
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.
For comparison, a blink of an eye takes about 100 to 150 ms.
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:
- Encryption. Everything is scrambled so that only your browser and the real server can unscramble it. Anyone in the middle just sees noise.
- 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.
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.
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 uses several Cloudflare pieces. You've already met each of these in this track:
DNS
Cloudflare's name servers answer the last step of the DNS lookup for leongames.org.
CDN (static assets)
A Content Delivery Network. The HTML, CSS, images and game files are stored in every location, ready to send.
Certificate
Created and renewed automatically, so the site is always HTTPS.
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/).
D1 database
A database is like a giant, super-fast spreadsheet. D1 stores the Hall of Fame scores.
Turnstile
Checks that a real person is submitting a score, usually without any puzzle to solve.
Attack protection
Blocks floods of fake traffic (called DDoS attacks) before they ever reach the site.
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.
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.