How the Internet and the Web Work

Beginner · 20 min

What actually happens between typing a URL and seeing a page — DNS, TCP/IP, routing, and the request/response cycle.

Vox · 20 min

How the Internet and the Web Work

The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.

Taught by VoxReport a problem with this video
Not started
Set this lesson's status

What you'll learn

  • The internet is a physical network of cables, routers, and data centers; the web is just one application — pages linked by HTTP — that runs on top of it.
  • Every device gets an IP address, and routers pass your data from network to network using those addresses, the same way postal workers pass a letter along by its street address without knowing the sender personally.
  • DNS translates the domain name you type into the IP address routers actually need, because humans remember words better than numbers.
  • Your data doesn't travel as one solid stream — it's broken into packets that can take different routes and get reassembled at the destination, which is what makes the network resilient to any single path failing.
  • The browser and the server talk in a strict back-and-forth: a request goes out, a response comes back, and nothing renders until that round trip completes.

Before the first line of code

Every frontend lesson after this one assumes you already understand what happens when a browser fetches a page. That assumption is usually wrong, and it’s worth fixing before you write anything. You can memorize React syntax for years and still be confused the first time a request hangs, a CORS error appears, or a page loads over HTTP instead of HTTPS, because those are all problems that live in the layer below the code. This lesson is about that layer: what actually happens, physically and logically, between you typing a URL and a page showing up on your screen.

The internet is not the web

Start with a distinction people blur constantly. The internet is a physical, global network — millions of computers, routers, and undersea cables, all wired together and able to exchange data. It existed before the web and would keep existing without it. Email, file transfer, and video calls all run on the internet too.

The web is one particular application built on top of that network: a collection of documents (pages) linked to each other, fetched and displayed using a specific protocol called HTTP. So when your browser “goes to a website,” it isn’t doing something the internet inherently understands — it’s running the web application, which happens to be the internet’s most famous tenant.

Addresses and routing

For any two machines to exchange data, each one needs an address. That’s what an IP address is — a numeric label, like 93.184.216.34, assigned to a device on the network. Every request you send and every response you get back is stamped with IP addresses on both ends, the same way a piece of mail needs a sender and a recipient address to go anywhere useful.

Getting a message from your laptop to a server across the planet isn’t a direct wire. It hops: your laptop to your home router, to your ISP, through a chain of larger routers, until it reaches a router close to the destination server, which hands it off locally. Each router only needs to know which direction gets the packet closer to its destination, not the whole path — the same way a postal worker routes your letter toward the right city without knowing exactly which house it ends up at. This is why a lost connection somewhere in the middle of the planet doesn’t take down the whole internet: there are usually other paths, and routers reroute around failures.

One more detail makes this resilient rather than fragile: your data isn’t sent as one unbroken stream. It’s chopped into pieces called packets, each one a self-contained unit with its own header describing where it came from and where it’s going. Packets from the same request can take different routes and arrive out of order — the receiving end reassembles them using sequence numbers in the header. If a single router or cable goes down mid-transfer, only the packets routed through it are affected; everything else keeps moving.

Names instead of numbers

Typing 93.184.216.34 into a browser every time you wanted a website would work, technically, but no one would remember it. That’s the entire reason the Domain Name System (DNS) exists: it’s a distributed lookup service that translates a human-readable name like example.com into the IP address a router actually needs. When you type a URL, one of the first things that happens — before anything else can proceed — is a DNS lookup, resolving that name to an address. The next lesson in this group covers DNS in more depth; for now, treat it as the internet’s phone book, consulted automatically and invisibly on every request.

The request/response cycle

Once your browser has an IP address to send to, it opens a connection to the server at that address and sends a request — a structured message that says, in effect, “give me this specific page.” The server receives it, figures out what to do (read a file, run some code, query a database), and sends back a response: a structured message containing the page’s content, or an error if something went wrong.

This exchange is built on HTTP (HyperText Transfer Protocol), the common language browsers and servers speak. HTTP rides on top of TCP, a lower-level protocol responsible for making sure packets actually arrive, in order, without corruption — the reliability layer underneath the conversation. You don’t interact with TCP directly as a web developer, but it’s the reason HTTP can assume a clean, ordered stream of bytes instead of having to handle packet loss itself.

The critical thing to internalize here is the strict back-and-forth shape of this cycle. The browser doesn’t just “load a page” — it sends a request, waits, and only renders anything once a response arrives. Every image, stylesheet, and script on a page you’ve ever loaded was its own separate request/response pair, which is one reason a page with a hundred small files can load slower than one with a few large ones: each request carries overhead, no matter how small the file behind it.

Why this matters once you start building

Nothing in this lesson is abstract trivia. Every network tab you’ll ever open in a browser’s developer tools is a list of these request/response pairs. Every “connection refused” or “DNS not found” error traces back to a specific step in this chain failing — the browser couldn’t resolve a name, couldn’t reach an address, or got no response back in time. Understanding the chain means you can look at a failure and know which link broke, instead of guessing. The next lesson zooms into the request and response themselves — what’s actually inside them, and what the status codes and headers mean — now that you know why they exist and where they sit in the bigger picture.

Check yourself

  1. 01Are "the internet" and "the web" the same thing?

    No. The internet is the physical network of connected devices and cables; the web is one application built on top of it, made of pages linked by HTTP.

  2. 02Why do we need DNS if computers already have IP addresses?

    Because IP addresses are what routers use to move data, but they're hard for humans to remember. DNS lets you type a name and quietly resolves it to the address underneath.

  3. 03Why is your data broken into packets instead of sent as one continuous stream?

    Smaller packets can travel independent routes across the network and get reassembled at the destination, so the loss or congestion of any single path doesn't take down the whole transfer.

  4. 04What has to happen before a browser can show you anything on a page?

    It has to send a request to a server and receive a response back — nothing is rendered until that round trip, however fast, actually completes.

Go deeper

Notes

Private to you

Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark