As we all know, there are plenty of blogs, articles, and youtube videos out there that explain how the internet works. I do not intend to add anything new to the subject aside from sharing my own journey on understanding the internet. I will begin with where I was pre-bootcamp, where I am now (Phase 2 of the Flatiron bootcamp), and where I will be by the end of writing this blog. Here we go!
NOTE: I enjoyed writing about the internet more than I intended, so I decided to break this saga up into parts in order to maintain brevity of the posts themselves.
I am in my early 30s so I remember a time when a computer and a smart phone weren’t staples in the average household. However, that never meant I had a firm grasp on how the internet actually worked — how I could play Neopets or chat with my friends on AOL messenger. I was even more oblivious when the concept of the “cloud” was introduced — where is it? what is it? How do I access it? Thankfully this all changed when I was introduced to Ruby on Rails in Mod2 at Flatiron.
What is ‘The Internet’?
Essentially, the internet’s most basic function is to send information from one place to the next. It’s the digital version of USPS. And despite marketing telling me my data is sent via ‘the cloud,’ the internet network is mostly comprised of our computers, various types of cables, radio waves and satellite links. One of our teachers sent us this video that explores this ‘physical’ presence of the internet network I just mentioned — an aspect that is important to understanding exactly how our information moves.
Circuit Switching vs Packet Switching
To send data via the internet, we know now that it runs via cables or radio waves — but how exactly? Surprisingly, most of the internet is sent through the same network as the public telephone! However, the key difference is how that data is sent. Let’s first take a look at the analog telephone: when you wanted to call your best friend in high school, you would pick up your phone, dial their number. Your phone then opens up a direct line of communication to their telephone. This line is also known as a circuit. If you think of the telephone network as a huge map of different paths that link up your home to others around you, the phone call you just made searches through all these links to find an available connection from point A to point B.
Your phone call doesn’t go through until this circuit is established and subsequently, your connection stays open until you end the call. This is called circuit switching. We have all seen movies of people (mostly women) frantically connecting calls on the switchboard — this is exactly what is happening! And as you can imagine, it’s highly inefficient and labor intensive. While you are gabbing away on the phone, the channel cannot receive or make any additional calls. Imagine that being the case on the internet?!
Thankfully, that is not the case. When sending a text or an email, the internet is using a method called packet switching. Here your data is broken up into various different pieces, put into neat little packages and sent separately, all coming back together once they reach their final destination. How do the individual packets know which computer to go to? They are tagged with an IP address. IP stands for Internet Protocol and the address is a series of numbers that gets attached to all your online activity. Through packet switching, you don’t need a permanent connection between two places so the routes can be open more often, allowing you to send and receive multiple messages at a time.
Computers: Client-Server Model
Okay, let’s dive a bit deeper. There are billions of computers out there, many of them are our personal devices we use in our homes. However, there are other computers whose function mimics that of a filing cabinet — they simply store information. This is called a server. Servers can not only be hardware, but also a computer program(or software). On the other end is the client; this is the computer(or program) that is making a request to the server for whatever service or content they provide.
Let’s look at the example of connecting to Google or Amazon. The user (you, me or anyone looking to access the internet) would open up their browser, or client. We would then type in the URL (Uniform Resource Locator) www.google.com or www.amazon.com. WAIT, STOP:
“Didn’t you say that our data is sent via packets to a unique IP address? Why do we type in a url?”
Yes, they are! In fact, instead of typing in google.com, you could simply put in google’s IP address and get to the same page! A URL can be thought of as a nickname — something more memorable and easy to interact with compared to dealing with long strings of numbers and dots.
There is actually something called a DNS (Domain Name System) which is the system that translates these more readable urls into their corresponding IP addresses. After you type in the url and hit enter, the client (browser) will check the cache for a DNS record to find the respective IP address of said URL (in our example its either Google or Amazon.)
So much more! We have covered tons already and have barely hit the surface. In my next blog post, I will continue down the path of this mysterious internet client request — we will look at the request in more detail and how servers respond. Stay tuned!
- Vox. (2020 Jan 8). How does the Internet Work? [Video]. Youtube. https://www.youtube.com/watch?v=TNQsmPf24go.
- WebConcepts. (2020 Oct 5). Web Server Concepts and Examples[Video]. Youtube. https://www.youtube.com/watch?v=9J1nJOivdyw.
- Wijesinghe, M. (2017 Apr 25). What happens when you type a URL in the browser and press enter? Medium.com https://email@example.com/what-happens-when-you-type-an-url-in-the-browser-and-press-enter-bb0aa2449c1a.
- Woodford, C. (Updated 2020 Apr 21). The Internet. ExplainThatStuff.com https://www.explainthatstuff.com/internet.html.