DEV Community

Cover image for A-Z of how the web works: #1 Introduction
Amid Oani
Amid Oani

Posted on

A-Z of how the web works: #1 Introduction

"I'm online."

Two simple words.

You probably don't think twice before saying them. In fact, there's a good chance you are online right now.

But what does "online" actually mean?

It means you can send a message to someone thousands of kilometres away and have them receive it almost instantly.

It means you can watch a movie stored on a computer somewhere in another part of the world.

It means you can make a payment without physically handing money to another person.

It means you can open your browser, type a website address and, within seconds, have information from a computer somewhere else displayed on your screen.

Being online has become so normal that we've stopped noticing how remarkable it is.

The internet has become woven into our everyday lives. We use it to communicate, learn, work, entertain ourselves, shop, make transactions and connect with people.

But have you ever wondered what actually happens when you do any of these things?

What happens when your computer communicates with another computer?

How does your message get from your phone to your friend's phone?

How does a website get from a computer somewhere in the world to the screen in front of you?

To answer these questions, we first need to understand how we got here.

Table of Contents

1. Communication changed

Communication hasn't always been this easy.

Not too long ago, if you wanted to send a message to someone who lived far away, you might have had to write a letter, take it to a post office and wait for it to be delivered. Depending on where the person lived, that could take days, weeks, or even longer. You could also rely on someone travelling to that location to deliver the message for you.

Distance mattered. Physical movement mattered. And most importantly, time mattered.

Today, things are remarkably different. You can send a message to someone on the other side of the world and receive a reply almost immediately. You can make a video call with someone thousands of kilometres away and have a conversation as though you were in the same room. Pictures, documents, audio and video can all be shared in seconds.

We have become so accustomed to this speed that it hardly surprises us anymore. But think about what is actually happening: information is leaving one device and reaching another device somewhere else, often almost instantly. How is that possible? What makes this kind of communication feasible?

To respond to these questions, we need to start with something that sits at the heart of our modern digital world: computers.

2. Computers

Humans have always needed to communicate and share information. We use words, sounds, images, gestures and countless other ways to express and exchange ideas.

Computers gave us a completely different way of handling that information.

A computer can store information, process it, and send it somewhere else. Your phone can store thousands of photographs, process a video you record, and send a message to someone on the other side of the world. A computer can do all of this incredibly quickly.

But a computer sitting by itself can only do so much when it comes to communication.

The real magic begins when we connect computers together.

Once computers can communicate with other computers, they can exchange information with one another. And when millions of computers and other devices are connected together, things become much more interesting.

This brings us to one of the most important ideas we'll need to understand throughout this series: networks.

3. Computers talking to computers

A computer can do a lot on its own. It can store your files, run applications, process information and perform countless tasks.

And when you connect two computers together, now they can exchange information.

One computer can send a file to the other. One can request information from the other. They can share resources and work together in ways that neither could do alone.

This idea is much bigger than simply connecting two computers. We can connect dozens of computers. Hundreds. Thousands. Even millions.

And when computers are connected in a way that allows them to communicate and share information, we have what is called a network.

You probably interact with networks every day without giving them much thought. Your phone connects to your home Wi-Fi. Your laptop connects to a network at school or work. Your devices can communicate with other devices because they are connected to a network.

But what happens when one network needs to communicate with another network?

That's where things start getting really interesting.

4. Networks talking to networks

We now have computers connected to one another, forming networks.

However, these networks don't have to exist in isolation.

Imagine a network in your home. Your phone, laptop and other devices might all be connected to the same Wi-Fi network. Now imagine that network being connected to another network in your neighbourhood. That network can connect to another one in your city, which can connect to another somewhere else. The idea can continue on a much, much larger scale.

Networks can connect to other networks, allowing computers on one network to communicate with computers on another. Eventually, we end up with an enormous collection of interconnected networks spanning countries and continents.

This is the basic idea behind the Internet.

The Internet isn't one giant computer sitting somewhere in the world. It's a vast system of interconnected networks that allows devices around the world to communicate and exchange information. And this is the infrastructure on which the Web operates.

But before we dive into the Web itself, there's an important distinction we need to make: the Internet and the Web are not the same thing.

5. The internet isn't the Web

At this point, you might be thinking that we've been talking about the Web all along.

No. That's not it.

The Internet and the Web are not the same thing.

The Internet is the enormous network of interconnected networks that allows computers and other devices around the world to communicate with one another.

The Web, on the other hand, is a service that runs on top of the Internet. It is the system that allows us to access and interact with websites and web pages through web browsers.

A simple way to think about it is to imagine the Internet as a massive system of roads connecting places around the world.

The Web is one of the many things that can use those roads.

Think of the Internet as the infrastructure that makes communication possible, while the Web is one of the things we use that infrastructure for.

And the Web isn't the only thing that uses the Internet. Email, online gaming, video calls, messaging applications, file transfers and many other services can also communicate across the Internet.

So when you open your browser and visit a website, you're using the Web, which itself relies on the Internet underneath it.

Now that we have that distinction out of the way, we can finally start focusing on the Web itself.

But what exactly happens when you type a website address into your browser and press Enter?

6. So... how does the Web actually work?

Now that we know what the Internet is and how it relates to the Web, let's return to something we do almost every day.

You open your browser.

You type a website address, such as:

https://www.example.com

Then you press Enter.

A moment later, a webpage appears on your screen.

Simple, right?

Well... not really.

Between the moment you press Enter and the moment that webpage appears, a remarkable chain of events takes place.

Your browser has to figure out where the website is, communicate with another computer, send a request, wait for a response, receive information, and then turn that information into the webpage you're looking at.

And that's only scratching the surface.

How does your browser find the right computer?

How does your request travel across the Internet?

How does the server know what you're asking for?

How does the information find its way back to you?

And once it gets there, how does your browser turn that information into the page you see?

These are the questions we'll be answering throughout this series.

Let's take the journey from the very beginning.

7. The roadmap

So, how are we going to answer all these questions?

We're going to build our understanding from the ground up.

We'll start with the basics: computers and networks. We'll look at how computers communicate with one another, how devices connect to a network, and how your Internet Service Provider (ISP) connects you to the wider Internet.

From there, we'll zoom out and see how different networks connect to one another to form the enormous network we call the Internet.

Once we understand the foundation, we'll explore how information moves across these networks. We'll learn about IP addresses, packets, routers, routing, and the protocols that allow computers to communicate reliably.

Then we'll turn our attention to the Web itself.

We'll explore web browsers, websites, URLs, DNS, web servers, HTTP, HTTPS, and TLS, and understand how these different pieces work together to make the Web possible.

We'll also look at what happens on the other side of the connection. What does a server actually do when it receives a request? Where do application logic and databases fit into the picture? And how does a server decide what information to send back?

Finally, we'll put everything together.

We'll return to the simple action we started with:

Type a URL → press Enter → a webpage appears.

This time, however, we'll follow the entire journey—from your device, through your network and ISP, across the Internet, to the server and back again—before seeing how your browser turns the response into the webpage you eventually see and interact with.

We'll start with the basics, build each piece one at a time, and eventually put the entire puzzle together.

8. Final note

This series is intended to be a comprehensive dive into understanding the workings of the Web.

Please ask any question, give insights, call me to any mistake. I am open to criticism or discussion that'll aid better understanding and will assist in making this series as easily understood as possible.

It'll be a long ride. I know I'll enjoy it. Hopefully you will too.

Onto the next!

Top comments (0)