What Is The Internet?

Introduction 

 
The most important component of a developer's life is the internet. So what is the internet? Of course, you know it, but do you actually know how it works? In this article, we will go through a simple overview of how the internet works. Before looking at how one request/message is being processed over the internet, let's look at the basic elements that form the internet.
  • Device
    At the most atomic level of the internet, there's a device. This device could be your phone, laptop, desktop computer, or maybe your air conditioner if you have a 'smart' one. Any device that allows it to connect to the internet through wifi or an ethernet cable becomes the basic components of the internet.

  • LAN (Local Area Networks)
    When these devices are connected together through wifi or an ethernet cable, then these devices are actually connected to a router. The second level of the internet is a router that provides communication to all the devices (ranges from 1 to 255) forming a community. This is known as Intranets. Now, these routers have the special ability to connect to other routers which helps one community to connect to another community. This is termed as Extranets or the third level of the internet.

  • Servers
    Severs are just computers that listen for requests/messages from routers and respond back to them. In fact, these special computers often perform no other tasks besides responding to every request/message from all routers. For example, at Google, there is a team of servers that exists only to show the google homepage if someone types 'www.google.com' in their web browser.
Okay, so now the actual question: how one request/message is processed over the internet? Your device is connected locally by a router. Then, you pay an ISP/Internet Service Provider for the internet which makes your router talk to other routers out there. But how do these routers 'talk' to each other? Let's take a simple example, when you open your web browser and type 'www.google.com' into it. Then, what happens is:
  1. Your request for 'www.google.com' is sent to your router.
  2. Your router sends the request to a DNS (Domain Name Server) by saying "Hey, some device on my network named 'rithik's pc' is asking me to connect to google.com".
  3. Then, the DNS finds out the IP (Internet Protocol) address of 'google.com' from his lists of domain names (in this case, 8.8.8.8).
  4. The DNS sents your request to 8.8.8.8 which is the IP Address of Google's server.
  5. The Google computer says "Oh, this guy 'rithik's pc' just wants the Google homepage. Okay, let me put all the contents into a package and send it back".
  6. This package containing HTML, CSS, JS, and media files is sent back to your router (Sometimes the package is too big. Then it is broken into smaller packages and delivered one by one).
  7. Your router sends the package to your web browser.
  8. Your web browser opens the package and displays the results on your screen.
That's how a request is processed. It's that simple. The internet is just a bunch of connected devices that send data to each other. Now, you can officially say that you know how the internet works!