DEV Community

Cover image for Behind the Browser: A Beginner’s Journey into the Internet’s Secrets
Tala Amm
Tala Amm

Posted on • Edited on

Behind the Browser: A Beginner’s Journey into the Internet’s Secrets

A Realization Every Developer Has👩‍💻

I've built full stack websites, but when I started learning Rust and tried to build a web server, I hit a wall.
I realized I didn’t fully understand what happens when I type a URL into a browser. How does my computer talk to a website? Where is the server? What is a server? What even is the internet?
In this post, we're going to break it all down, step by step, in a simple, beginner-friendly way.

Table of Contents:


What Is the Internet?🌐

The internet isn't a magical cloud. It's a physical system: cables buried in the ground, undersea wires, satellites, cell towers. It's the largest network of connected computers on the planet. Just imagine it as huge wires connected all around the world.

internet cables

So how do we connect to the internet? Obviously our PC isn’t directly connected to that big web...🤔


Connection Path💻

  1. Your device connects to your home router (via Wi-Fi or Ethernet).
  2. The router connects to your ISP (Internet Service Provider which is the company that provides the internet for you as Bezeq) via a cable (fiber, DSL, coaxial).
  3. Your ISP connects you to the global internet, because the ISP is connected to bigger networks, which are connected to data centers and Internet Exchange Points (IXPs). These are giant hubs where ISPs and large networks physically connect using fiber optic cables. This massive, interconnected web of high-speed cables and infrastructure is called the Internet Backbone — the "spine" of the web.

So when you say, "I'm connected to the internet," you're not really! You are connected to a network that leads you to the internet.

connecting to internet path


Where Does a Website Live? 🏠

A server is a powerful computer that stays online 24/7, and is connected to the Internet, with a software that allows it to store your website’s files: (HTML, CSS, JS, images, etc.).
It's called a server because it serves up the right content when requested.

How Do People Host Their Websites?

There are many companies and services that will rent websites’ owners space on a server to host their website online.
They pay an ongoing hosting fee, which is a bit like paying rent, leaving them to take care of the technical aspects of running a server, so that you don't have to.
💭 Imagine: Think of a server like a bakery:
You're renting space (hosting).
You display your goodies (files).
Customers (browsers) come in and ask for something.


IP Addresses

Every computer or server has a special IP address (Internet Protocol Address), like:

IPV4 IPV6

This is how devices find each other in order to communicate. But remembering numbers is hard; so we use names!


Domain Names

Domain names are easier to remember , so, Instead of typing an IP address to find a website, we type a domain name like google.com.
But, devices only know each other by IP addresses… How do they find each other when we search for a Domain name?


What Happens When You Type google.com?🔍

The Client-Server Model

  • Client: Your browser (or any tool that is able to make requests)
  • Server: The website's host
  • Protocol: They talk using HTTP

Let’s walk through it:

  1. You type google.com in your browser.
  2. Your browser needs the IP address for that domain.

DNS: The Internet's Phonebook

The Domain Name System (DNS) translates domain names to IP addresses. It simply maps human-friendly names to IP addresses.

Here’s how the lookup works✨:

  • Your computer checks if it already knows google.com? (is it cached?) ✅ Use it.
  • If not, it asks your router, then your ISP DNS server.
  • If your ISP doesn't know, it escalates the query to global DNS servers to find the IP address

dns

💡 EXERCISE:

  • Open your terminal and run the below command to get back the real IP that DNS returns.
nslookup google.com 
Enter fullscreen mode Exit fullscreen mode
  • Run this command to send a small data packet to the website's server; to check if it's online and accessible.
ping google.com 
Enter fullscreen mode Exit fullscreen mode

Talking to the Server💬

The Browser Now Has the IP. What's Next?

It can now connect to the server and make requests. But first:

TCP: Building the Connection Pipe

Before sending a request, it needs a reliable connection, so the browser and server create a TCP connection: (Transmission Control Protocol).
TCP is like opening a phone call before you speak:

  1. You say: “Can you hear me?”
  2. The other side says: “Yes, can you hear me?”
  3. You say: “Okay, let’s talk.”

This is called the TCP Three-Way Handshake:

tcp handshake

So, What is the TCP 3-Way Handshake?

TCP wants to be safe and reliable, so both sides must agree before talking.

  • Browser → Server: SYN
    • “Hey server, I want to start a TCP conversation.”
  • Server → Browser: SYN-ACK
    • “Got it! I’m ready. Are you ready too?”
  • Browser → Server: ACK
    • “Yes! Let’s go.”

✅ Now the TCP connection is fully open. This is a very low-level process done automatically by the computer’s networking system.

💡 SYN = "Synchronize", ACK = "Acknowledge"

🔌 This creates a stable "pipe" between browser and server to communicate.


HTTP: The Language of the Web

Now the browser sends an HTTP request which is just text sent through the TCP connection:

GET /index.html HTTP/1.1
Host: google.com
User-Agent: Chrome
Accept: text/html
Enter fullscreen mode Exit fullscreen mode

breakdown of request

If you’re sending data (like with POST), you'd also include a body, like this:

POST /login HTTP/1.1
Host: example.com
Content-Type: application/json
Content-Length: 27

{"username":"tala","pass":"123"}
Enter fullscreen mode Exit fullscreen mode

Then the server responds:

HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 1234

<html>
  <head>...</head>
  <body>Google!</body>
</html>
Enter fullscreen mode Exit fullscreen mode

Your browser then:

  • Receives & Parses the HTML
  • Requests more resources (CSS, JS, images)
  • Renders the full page

💡TIP: u can always look at a request, if you go in your browser, open the developer tools, in the network tab you can inspect your made requests.

network tab


Protocol Versions

A protocol is just a set of rules that two computers follow when they want to talk to each other.

protocols


Deeper Into Protocols⚙️

TCP vs UDP:

tcp vs udp

HTTP vs HTTPS:

http vs https


Localhost VS. The Internet 💻

What is localhost?

localhost is your own computer. It uses IP 127.0.0.1, a special loopback address.

Running Your Own Server Locally

In Go, for example:

http.ListenAndServe(":8080", nil)
Enter fullscreen mode Exit fullscreen mode

Visit localhost:8080 in your browser:

  • Your browser becomes the client.
  • Your Go program becomes the server.
  • They talk using HTTP over 127.0.0.1.

Everything happens inside your computer. You don’t need internet, Wi-Fi, or a router.

localhost


How the Browser Renders a Page:

  1. Parses HTML into DOM
  2. Parses CSS into CSSOM
  3. Builds Render Tree
  4. Lays out elements
  5. Paints pixels
  6. If JavaScript exists, it runs last.

Common Errors & Who returns them? The server or the browser?⚠️

Server errors come in HTTP response codes.

Browser errors are from DNS, certificates, or frontend rules.

errors


Final Thoughts🌟

Next time you open a browser and type in a URL, remember:

  • You’re connecting through your router, ISP, DNS, and TCP layers.
  • Your browser is talking to a server using a shared protocol.
  • That response is parsed, rendered, and built before your eyes.

And when you're running your own server? You're in full control of that journey.

You just understood the entire lifecycle of a web request. That’s the kind of deep knowledge that powers real developers.

Keep exploring! 🚀

Top comments (0)