🌐
Coding🔬 Ages 11-13Beginner 9 min read

How the Internet Works

How the internet works explained simply: IP addresses, packets, servers and clients, DNS, and what happens when you open a website. Clear diagrams in words and a quiz.

Key takeaways

  • The internet is a giant network of computers connected by cables and wireless links
  • Data is split into small packets that travel separately and are reassembled
  • Every device has an IP address so messages know where to go
  • DNS turns website names into IP addresses, like a phone book for the internet

A network of networks

The internet is a giant network that connects billions of computers around the world. The word itself means "between networks." Your home, your school, and a company on the other side of the planet each have their own small network, and the internet links them all together using cables, fibre-optic lines, and wireless signals.

When you watch a video or open a website, your device is talking to another computer that might be thousands of kilometres away — and the message often arrives in a fraction of a second.

Clients and servers

Most things you do online follow a simple pattern: a client asks, and a server answers.

  • A client is your device — a phone, laptop, or tablet — usually running a web browser.
  • A server is a powerful computer that stores websites, videos, or files and waits to send them when asked.

When you visit a website, your browser (the client) sends a request. The server receives it and sends back a response containing the page. This back-and-forth is the heart of how the Web works.

Every device has an address

For a message to reach the right place, each device needs an address — just like a house needs a postal address. On the internet this is called an IP address (Internet Protocol address). A common form looks like this:

142.250.72.14

Each number identifies part of the path to a specific device. When your computer sends data, it stamps it with the destination IP address so the network knows where to deliver it, and your own IP address so the reply knows where to come back.

DNS: the internet's phone book

People are bad at remembering numbers like 142.250.72.14, but good at remembering names like educaweb.org. The system that connects the two is called DNS — the Domain Name System.

When you type a website name, your computer first asks a DNS server, "What is the IP address for this name?" The DNS server looks it up and replies with the number. It works just like looking up a friend's name in a phone book to find their number.

You type:     educaweb.org
DNS replies:  → 142.250.72.14
Browser:      connects to that IP address

Data travels in packets

The internet does not send a whole video or web page in one big lump. Instead, it chops the data into many small pieces called packets. Each packet carries a bit of the data plus the address of where it is going and a number saying where it fits in the sequence.

These packets travel across the network, sometimes taking different routes, and arrive at the destination where they are put back in the correct order. If a packet gets lost on the way, only that small piece needs to be sent again — not the whole file. This makes the internet both fast and reliable.

What happens when you open a website

Let's put it all together. When you type educaweb.org and press Enter:

  1. Your browser asks DNS for the site's IP address.
  2. DNS replies with the address of the server.
  3. Your browser (the client) sends a request to that server.
  4. The server splits the page into packets and sends them back.
  5. The packets travel across the network, guided by IP addresses and routers.
  6. Your browser reassembles the packets and draws the page on your screen.

All of this usually happens in well under a second.

Where the code fits in

The page that arrives is written in code — mainly HTML for structure, and often CSS and JavaScript to make it look good and behave interactively. If you want to see what a server actually sends to your browser, try Build a Simple Web Page with HTML. And if you're curious how that data is processed before it's sent, the Lists and Arrays you store in programs are exactly the kind of data servers shuffle around all day.

Practice challenges

  • Draw the journey of a web request from your device to a server and back, labelling client, server, DNS, and packets.
  • Explain to a friend why packets are better than sending one giant file.
  • Find out the difference between the internet and the World Wide Web in your own words.

Quick quiz

Test yourself and earn XP

What is an IP address used for?

Why is data split into packets?

What does DNS do?

In a web request, which computer asks for the page?

FAQ

No. The internet is the underlying network of connected computers. The World Wide Web is one thing that runs on top of it — the system of websites you view in a browser. Email and video calls also use the internet but are not part of the Web.

It is real hardware: undersea cables, fibre lines, routers, and huge buildings full of computers called data centres. Wireless connections still connect to this physical network in the end.