How the @#$% does the internet work? That’s a question people seldom ask but I thought I’d take some time to explain it for those who were curious about what’s going on behind the wizard’s curtain. I’ll start off by explaining some basic concepts in Part I and then get into the more modern model of the web in Part II.

An Advanced Light Switch

At its very core, the internet is all about sharing data between two computers over a wire. As an example, let’s say that the data you’re sending is this Medium article.

If you wanted to send an article from computer A to computer B, you’d need to somehow send the words you’re reading over a wire connecting the two. The only problem is that a wire can only do one thing — have electricity flowing through it (i.e. be on) or not (i.e be off). So how the @#$% do we send an article made up of individual characters over a wire using only an on / off switch.

Let’s break it down. Say computer A and B agree that electricity flowing through the wire for one second represents a 1 and the switch being off for one second represents a 0 (granted this happens much much faster but bare with me). Now I can send 1s and 0s over the wire by turning it on and off in one second intervals. Great, we can send 1s and 0s but how can we send an article or even letters? Well computer A and B can agree that every 8 1s and 0s represent some letter — for example, 01000001 represents the letter A. So using our simple shared rules, Computer A can break down each character in the article into sets of 8 1s and 0s and can correctly flick the wire on and off for some set time interval. Then Computer B can read those on and off impulses as 1s and 0s and convert them back into characters using the same rules Computer A used to break them down.

The technical term for this breaking down and building up of data is called encoding and decoding, respectively. Using this simple idea we can take something as dumb as a light switch and use it to send all kinds of data like webpages, videos, and even Medium articles. All this is possible because computers share the rules by which they break things down so that any other computer can build them back up. So when you see .mp4, .pdf, etc. at the end of your files it’s just a way for your computer to know which rules to use to build up the 1s and 0s it was sent.

So to read this article, your phone or computer had to connect to one of Medium’s many computers around the world and have it send some encoded 1’s and 0’s over a series of very, very long wires spanning the globe, which your computer then decoded into words and paragraphs using the shared rules of the web. Oh and by the way, this all happens in fractions of a second.

Wires, Wires, and Wires

So is the world really covered with long wires that connect us to different computers holding articles, videos, photos, emails, status updates, web applications, etc.?

YES, it literally is. Here’s a map showing the wires that connect our continents:

So if the internet is all about wires how can we use wireless phones and laptops?

Well, WiFi sends 1s and 0s through the air but that signal can only span the distance of maybe a 100 feet (The tech behind that is pretty cool too and could justify its own HTF article). So once they hit a nearby wireless router, the connection has to be transferred to the very same web of wires spanning the globe (Cell towers work in a similar way but have a stronger signal that can span several miles).

So to sum this concept up, if we are in Europe trying to connect to a Medium computer in America to get this article, our computer sends the request asking for the article to our WiFi router, which connects to our internet service provider via the wire coming into our home or office or local coffee shop. That signal bounces around several switches across the continent until it reaches one of the many cross-Atlantic wires that carries the signal to the United States, where it bounces around a few more times until it reaches a Medium computer holding this article on its hard drive. I happen to be sitting in Turkey when writing this article and it took my laptop only 10 jumps around the globe to connect to a computer belonging to www.medium.com.

The “***” are access points whose IP addresses are blocked for security reasons. If you want to try this out for yourself, type traceroute www.medium.com (or any other site) in terminal.

The IP addresses you’re seeing in the image above work the same as postal addresses as they indicate where the signals need to travel to. 104.16.120.127, the IP address of the Medium computer I connected to, translates to somewhere in Phoenix, Arizona (source: iplocationtools.com) and it only took a few fractions of a second for my request to travel from my laptop in Muğla, Turkey to a Medium server in Phoenix, Arizona!

Conclusion

The Internet is a pretty crazy concept and arguably that greatest invention of mankind but at the end of the day it is just a bunch of light switches and very long wires. What makes all this possible is that fact that computers across the globe share rules by which they breakdown and buildup data. As you sit back and read this article, consider all people around the world and decades of progress involved in getting just a few thousand 1s and 0s to your screen.

I hope you’ve enjoyed the first article of this two part series. In the second article I’ll get into some more depth about the modern model of the web and explain concepts like servers, web pages, security, and how companies collect all that data on you.

I want to keep this series open so drop a comment on which “How the @#$%?” topic I should cover next. If you’re ok with me occasionally bugging you with some more articles and reading lists then please subscribe here…and I really do mean occasionally :)