The internet is kinda amazing. There’s gotta be black magic behind the scenes …

How the Internet Works (A Simple Explanation)

Willson Mock
5 min readOct 16, 2014

I think it’s fair that most of us can’t imagine what it’d be like to live without the internet. Remember that time you dropped your iPhone in the toilet and had to live without an internet-connected phone for a couple of days? Tough, right? (Yea, I thought so) With the internet as ubiquitous as it is, how many of you have actually wondered what the internet is and how it works? It’s something I’ve wondered about and while I don’t prescribe to know all the intricate details of how this amazing system works, hopefully I can provide an analogy that gets us most of the way there.

What is the Internet?

When we talk about the Internet, what we’re actually referring to is an interconnected network of computers (hence, internet). Some of these computers are web servers, which are just specialized computers that contain and serve content from your favorite websites, and others are just the client devices we use everyday, like our laptops, tablets, and mobile phones. To make this discussion easier, take a look at the drawing below which I’ll be using for my internet analogy:

For now, let’s ignore our own internet connected devices and focus on those web servers. Let’s imagine each of these web servers as a tall building and that they’re connected to each other via highways and roads. This network of highways and roads (which is made up of fiberoptic cables around the world) can be thought of as the Internet, and what travels along these highways and roads is data. Just like how physical buildings in real life have a mailing address, each of our web servers (which represents our favorite web sites like ESPN.com or Facebook.com) have a unique address called an ip address.

Now you might ask, “What about us? How do we connect to the internet?” That’s where our Internet Service Providers (ISP’s) come into play. You can imagine them as special buildings that allow our client devices to connect to the highways and roads. Continuing with our analogy, just think of each of our internet connected devices as a house with a driveway that leads to the ISP’s. And once your house is hooked up to the internet, you’re good to go!

How does the Internet Work?

Now that we have a (very) high level sense of what the internet is, how exactly does it work? This is where your browser comes into play.

Your browser is what we call a “client application” and what this simply means is that its a program that allows you to make requests to different web sites and respond to the data that those web sites send back. To best explain how this works, I’ll list out some of the steps involved with making a request to ESPN.com:

  1. From our discussion above, remember how I said that each web server has its own unique ip address? Well, the web server for ESPN has its own ip address, which I found out is 199.181.33.61.
  2. When you type in “http://espn.go.com” into your browser, your browser somehow needs to know that this URL (i.e. uniform resource locator) actually means the ip address 199.181.33.61. So what the browser does is that it contacts the DNS (domain name service) and looks up the ip address for that url. You can think of the DNS as a phone book (do you kiddies even know what this is anymore??)
  3. Once the ip address is retrieved, your browser attempts to connect to the web server by opening up a socket connection. Without getting into the details, think of this as you physically calling the tall building (i.e. web server) and seeing if they’re still open. If someone responds, then you know they’re open and you’re connected.
  4. Now that your browser and the server have a open connection with each other, your request to a specific article on ESPN can be made. But before your request can be sent over the internet, it has to follow a set of rules that describe how the request must be formatted. These set of rules are known as TCP/IP and the HTTP protocol.
  5. Essentially, think of it like this: in order to travel along the highways and roads of the internet, every request made by your browser and every response sent by a web server must first be chopped up into small packets of data. You can think of your original request as a photo mosaic, and once its been chopped up, each tile represents a packet of data. Aside from containing the binary bits of data, each tile also knows the ip address its supposed to go to and how to reassemble itself once all the packets reach the destination ip address.
  6. Going back to our example of requesting a specific article on ESPN, the request for the article is chopped up into packets and sent along the highway and roads. Along the way, there are routers (and other similar devices) that basically act as traffic cops and direct the packets to the correct path leading to the ip address.
  7. Once all the packets of data arrive at the web server, the web server will look for the specific article, similar to how you’d look for a file in a cabinet drawer. Once the file has been located, the web server will chop up the response into data packets again, and send them back to your browser.
  8. Finally, when all the data packets arrive back at your browser, your browser will reassemble all packets into the HTML, CSS, JavaScript, and image files that represent the article. And once these files are processed, you’ll magically see the article displayed on screen.

In a nutshell, that’s what the Internet is and how it works! And while I’ve glossed over MANY details of how this intricate system works, I think that for the majority of us, having this basic understanding of what happens behind the scenes will demystify some of the magic and help us appreciate the internet that we’ve come to rely on for, basically, everything.

--

--

Willson Mock

I’m an avid learner, and I write about web technologies, personal fitness, and other fun stuff. http://willsonmock.com