FOUNDATIONS / LESSON 02
How the Internet Works.
The basics of how data travels around the world

Loading the lesson…
Loading activities…
FOUNDATIONS / LESSON 02
The basics of how data travels around the world

Loading the lesson…
Loading activities…
Every time you open a website, a whole lot happens behind the scenes in about the time it takes to blink. Sounds intimidating, I know. It's honestly easier than it looks, and we're gonna break it down using something you already get... sending mail.
Say you want to mail a letter to a friend. You need a few things to make that work.
The internet runs on the exact same idea.
www.google.comLet's meet the main characters in this lil story.
Your browser is the app you use to visit websites. Chrome, Safari, Firefox and Edge are all browsers. Think of your browser as the person writing and reading letters.
It has two main jobs.
A server is a computer that's always on, always connected to the internet and always ready to answer requests. When you visit a website, you're really asking a server to send you that site's files.
Picture a server as a helpful librarian. You ask for a book (a webpage), they go find it, and they hand it over.
So what does that back-and-forth between your browser and a server look like? It's pretty simple, actually.
You type www.netflix.com into your browser and hit Enter.
Your browser fires a message across the internet that basically says "Hey Netflix server, can you send me your homepage?"
Netflix's server gets your request and gathers up every file it needs to show you that homepage.
The server ships back everything your browser needs, meaning the text, the images, the videos and the instructions for how to lay it all out.
Your browser takes that pile of files and turns it into the webpage you're looking at.
All of that usually takes less than a second. Wild.
Here's the part most people never think about. When you send a request, it doesn't travel in one big chunk. It gets chopped into tiny pieces called packets. Each packet makes its own way across the internet, and they all get put back together when they arrive.
Why bother? Because it's faster and more reliable. If one packet gets lost, only that one small piece has to be resent instead of the whole thing.
Web addresses like www.google.com are easy for humans to remember. Computers, though? They'd rather deal in numbers. Every device on the internet has a unique number called an IP address.
When you type www.google.com, your computer first looks up Google's IP address (something like 142.250.80.46) and then sends your request to that number.
It's kinda like knowing your buddy's place as "the blue house on Oak Street" while the post office only cares about the actual street address.
Sometimes a website just won't load. Here's what the common errors are trying to tell you.
Let's follow what happens when you order a pizza online, because who doesn't love a pizza example.
Every click and every page load is just requests and responses flying back and forth... that's really all it is.
Now you know how the internet moves stuff around, so let's look at what happens on each end of the trip. Next lesson we'll get into frontend versus backend, the two sides of every web app...