We use the internet every day and it has become such an integral part of our lives that we often take it for granted. As web developers and casual internet users, before we start developing websites and apps for people to access through the internet, we must understand the fundamentals of how the internet works.
The internet is ubiquitous and still, a lot of us think of it as a cloud, satellite, something hanging around in the sky, that is super complex and difficult to understand but that's not it at all.
The internet is a global network of networks that can communicate. It is the infrastructure that carries things like the web, email, file sharing, online gaming, etc.
It is simply this large stretch of wires that connects different computers. You might have one computer in Nigeria and another computer in Canada or China and they can all talk to each other and transfer data through these giant wires. Some of these computers attached to the internet have a very special job, and they have to be online 24/7 to perform this job. They serve us all of the data and files that we are requesting when we try to access websites. The computers that are doing this data delivery are called servers and the computers that users would use to access the internet are called clients. Which I explained here in this article.
You can imagine we have a web server as a giant library that's open 24/7, we go in there at any hour of the day and request "I want to see the latest post on Facebook". It will be able to serve us with all of the files and data we would need to be able to view whatever website it is that you requested. Now you can imagine if there's a library that's big enough to house all these websites, then it's going to be pretty difficult to quickly locate the thing that you want out of this giant library.
This problem is solved like this; let's say you type in google.com on your computer because you want to head over to the main Google home page. What happens behind the scene is that your browser will send a message to your ISP (Internet Service Provider) these are the people who you pay to be able to access the internet. In Nigeria, that's a company like Spectranet, Swift, or BaseSpot, in the US that's Xfinity, Verizon, or AT&T, depending on your country we have big companies that make a lot of money from internet usage. Now the message that you are sending the ISP is "I want to see google.com". The ISP will then relay that message to something called a DNS server or a Domain Name System server. The DNS server is essentially just a phone book. When you make a request on your browser, the DNS server will look up in its database to determine the location or IP address of that website that you're trying to access and every single computer that's connected to the internet has an IP address. Internet Protocol or IP address is like a postal address for your computer so that when people need to send and receive files on the internet, each computer can be located by their unique IP address, and once that DNS server finds the IP address, it sends that back to your browser.
So now, you know the exact address where you can find the Google home page. Next, your computer sends a direct request to that address through your ISP and this message will be delivered via what's called the Internet Backbone.
Screenshot from submarinecablemap.com
The internet backbone is the backbone of the internet. If you head over to submarinecablemap.com, you can view all of the underwater cables that power the internet, and the internet is made up of these huge sprawling masses of wires, connecting all of the world's internet users so that we can transfer files all over the world.
Now if I'm sitting in Lagos, Nigeria and I want to see a website that's hosted in Los Angeles, California in the United States, then my browser would have to make a request that goes through one of those cables under the Atlantic ocean to reach the United States and once that computer receives my request, they'll send back all of the relevant data through those giant cables. The IP address is just as if you are sending a letter halfway across the world and your only hope for your letter to reach your friend is that postal address on the front of the envelope. So once I've gotten the IP address of the website that I want to access, then my browser sends another message through the ISP via the internet backbone to the server that is located at that address (184.108.40.206) and the computer that is located at that address is, of course, Google server and on this server, there are all of the files I would need to be able to view the Google home page. So, the server then sends all of those files back to me through the internet backbone and I get to see the Google homepage on my browser and that happens in a matter of milliseconds.
Ultimately, that's what the Internet is and how it works, having this basic understanding of what happens underneath the hood will clarify some of the complicated stuff we usually think of about the internet