How the internet works?




How the internet works? Good question. But before we try to answer that first let's try to figure out what the internet actually is.

The internet is a network of networks. Simple huh. So now you ask if I inter connect ten computers will it be called internet. The answer is yes and no. See when I say network of networks, I mean thousands and thousands of inter connected computer around the globe, not ten. Sure, you have an inter connected network of computers but its not the internet.

Now that we know it's a network of networks, how do all these computers communicate without ever breaking down? Let's try to understand how we human communicate. There are two things that are necessary in a communication, first another person and second the language. You both need to understand some common language, a standard of some kind which you both agree upon in order to converse or else it's going to fail.

Just like us humans, computers also have some standard upon which they agree to exchange information. A protocol of some kind. TCP/IP. These are two separate protocols but so similar that we usually say it in one breath.

Ok now we know that computers communicate through some kind of protocol. But how do they find each other between billions of other computers. Like we humans have home address which do not collide or at least are not supposed to collide, similarly computers also have some kind of addresses, Internet Protocol address (IP address) to be precise. An IP address is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. In layman's term, IP address is how computers address each other.

We have the two necessary ingredients for communication. We have a way to uniquely identify the computer we wanna talk to. And we have a protocol which both the computers agree upon. Now we just need to make this information travel to the right destination, which is done by routers. Routers as you already guessed routes the information to the next right computer which in turn passes the information forward repeating the process till the final destination is reached.

Data is sent in many smaller packets as it is too inefficient to send it as a single file. Small packets of information sometimes travel through different routes, some of which take longer than the others. If you ever did two simultaneous speed tests and got different results, now you probably know why.

TCP/IP are two sets of convention that computers use to get data from one point to another. TCP also handles delivery, if any data gets lost or fails to reach the destination TCP sends a message to resend the data.

Now let's connect all the dots with an example. You want to go to Google, you type www.google.com in the address bar of your browser and you get the google page in return. Here's what happened behind the scenes, first the browser automatically converts your www.google.com to https://www.google.com.

HTTP has several request methods. GET and POST are two of them. GET literally means that get me this. When a computer requests for a website, this is generally how the request would look like.


If the web server finds the requested page, it responds with

And this is how you get your google.com or facebook.com or any other site for that matter. All this is done in fraction of a second. Amazing isn't it.