DEV Community

Cover image for A Comprehensive Guide to How the Internet Really Works
Yash Sangwan
Yash Sangwan

Posted on

A Comprehensive Guide to How the Internet Really Works

Hey there, fellow internet explorer! 🌐

Ever hit enter on your favorite website and wondered, "How the heck does this content get from some server in Silicon Valley to my screen in seconds? " Trust me, I asked myself the same question, and what I discovered was mind-blowing! Today, I'm going to take you on a journey through the internet's backbone – and I promise to keep it as fun.

Table of content
Understanding IP Addresses: The digital identifiers that make the internet work
Domain Name Systems (DNS): How human-readable web addresses translate to IP addresses
Internet Routing: The complex network that guides data across the globe
Cookies and Web Tracking: How websites remember you and personalize your experience
Firewalls and Internet Security: Protecting your digital presence
Web Protocols: The rules that govern data transmission on the internet
Caching Mechanisms: The technology behind faster web browsing

Part 1: "Wait, My Computer Has an Address?"

You know how every house has a unique address for mail delivery? Well, your device has one too – it's called an IP address!

How IP address looks like

Now, here's where it starts to get interesting. There are two types of IP addresses:

  1. Dynamic IP: It's like staying in a hotel. Each time you check in (connect to the internet), you may be assigned a different room number (IP address). This is more typical for home users.

  2. Static IP: It's like owning a house. Your address remains the same even when you leave and come back many times. These are mostly used by businesses.

The original system (IPv4) can only handle about 4.3 billion addresses. Sounds like a lot, Well, with your phone, laptop, smart TV, and even your fridge wanting to connect, we needed more.

Illustration of rising of smart home

That's why we now have IPv6 – This new system can provide 340 undecillion addresses. That's a 3 followed by 38 zeros! To put it in perspective, that's more than enough.

Part 2: "Domain Names: Because Who Wants to Memorize Numbers?"

Alright, Which's easier to remember: "142.250.189.206" or "Google.com"? you probably picked the second option.

Let's get real with a practical example:

Suppose you want to watch the episode of your favorite show, which is running on Netflix. Here’s the behind the scene..

  1. You type "netflix.com" in your browser.

  2. Your computer ask the DNS (Domain Name System), "Hey, what's the actual address of Netflix?"

  3. The DNS looks at you as if saying, " let me check my phonebook. OK, here it is: his IP address".

  4. Your browser then heads to that address to fetch your content.

But wait, there's more! Domain names have different parts, kind of like a mailing address:

  • "www" is like the name of the building

  • "netflix" is the street name

  • ".com" is the city

And just like cities, there are different domain endings:

  • .com (originally for commercial sites, now used for almost everything)

  • .org (typically for non-profit organizations)

  • .edu (for educational institutions)

  • .gov (for government sites)

There are even country-specific domains like .uk for the United Kingdom or .in for India. It's like having different area codes for phone numbers!

Netflix home page with url

Part 3: "Routing"

When you send an email, post a tweet, or stream a video, your data is broken down into tiny packets, all trying to reach their destinations.

Illustration of data packets trying to reach their destinatons

Routers are placed at each and every internet intersection. They take data packets and find them the shortest possible route.

Imagine using Google Maps to find your way. The app calculates the best route for you, avoiding traffic jams and closed roads. That is how the internet routes!

Your data packets might take different routes to reach the same destination. The internet does this to ensure the fastest possible delivery of your data.

And just like a real city, sometimes there's traffic. Too many packets all trying to go the same route will slow everything down. This is why it is often that your internet seems slow because it's congested somewhere along the route.

Illustration of congestion in data packets

Part 4: "The Cookie"

Cookies are small pieces of data stored on your computer by websites you visit.

Here's how it works:

  1. You visit a website for the first time. The site store a cookie to remember you by.

Illustration of how cookie popup on websites

  1. Your browser takes the cookie and stores it.

  2. Next time you visit, your browser shows the cookie to the website.

Cookies are why you don't have to log in every single time you visit a site, or why your shopping cart remembers what you added last week.

But here's the catch – some cookies are like who knows a bit too much about your business. They can track your browsing habits across different sites. That's why you might see ads for things right after you search..

Don't worry, Your browser lets you manage cookies. You can choose to accept all cookies, block them, or clear them out occasionally.

Part 5: "Firewalls and Security"

In internet terms, a firewall is a security system that monitors and controls incoming and outgoing network traffic.

Here's how it works:

  1. You try to access a website.

  2. The firewall checks if this website is on the "Nice List" or the "Spam List."

  3. If it's nice, you get through. If it's spam, the firewall blocks the connection.

illustration of how firewall works

Part 6: "Protocols"

Think of protocols as the internet's postal service. They're a set of rules that define how data should be packaged, addressed, transmitted, routed, and received.

Some common protocols:

  1. HTTP/HTTPS: The delivery service for websites. HTTP is like regular mail, while HTTPS is like sending your mail in a locked box. Only the recipient has the key.

  2. TCP/IP: The internet's fundamental protocol duo. TCP breaks data into packets and makes sure they all arrive correctly, while IP makes sure they get to the right address.

  3. FTP: File Transfer Protocol. Specializing in transferring large amounts of data.

  4. SMTP: Simple Mail Transfer Protocol. This is the email delivery guy, making sure your messages reach the right inbox.

Part 7: "Caching"

Ever wonder how some websites load faster? In the digital world, caching is like the internet's version of a photographic memory.

Here's how it works:

Imagine you're a waiter at a busy restaurant. Instead of running back to the kitchen every time someone orders the daily special, you keep a few ready on a tray. That's caching in a nutshell!

When you visit a website, your browser stores certain elements – like images, CSS files, or JavaScript – on your device. Next time you visit, instead of downloading everything again, it just pulls these elements from its local memory.

illustration of how cache works

Caching happens at multiple levels:

  1. Browser caching: Your personal internet butler, remembering your favorite sites.

  2. Server caching: The website's own memory bank, keeping popular content ready to serve.

  3. CDN caching: Content Delivery Networks, like a chain of convenience stores, keeping copies of websites closer to users around the world.

Caching is why you can browse Instagram at lightning speed (dangerous for productivity, I know). It's also why sometimes you need to "clear your cache" when a website isn't showing the latest updates.


Conclusion

As we wrap up our journey through the internet's core, The internet might seem like magic, but now you know the technology and brilliant minds behind it.

Top comments (0)