How Internet Works- Explained
For now, let’s ignore our own internet connected devices and focus on those web servers. Let’s imagine each of these web servers as a tall building and that they’re connected to each other via highways and roads. This network of highways and roads (which is made up of fiber optic cables around the world) can be thought of as the Internet, and what travels along these highways and roads is data. Just like how physical buildings in real life have a mailing address, each of our web servers (which represents our favorite web sites like ESPN.com or Facebook.com) have a unique address called an ip address.
lets divide our explanation into components:
1. Web Browser
2. DNS
3. IP Address
2.ISP( Internet Service Provider)
Now lets get into the real stuff
Your browser is what we call a “client application” and what this simply means is that its a program that allows you to make requests to different web sites and respond to the data that those web sites send back.
So when you type a URL( for example www.google.com) , your browser contacts DNS. A DNS translates domain names to
IP addresses so browsers can load Internet resources. You can imagine a DNS as a phonebook which has phone numbers( ip address) of sites.
Once the ip address is retrieved, your browser attempts to connect to the web server by opening up a socket connection. Without getting into the details, think of this as you calling the web server and seeing if they’re still open. If it responds, then you know they’re open and you’re connected.
In order to travel along the highways and roads of the internet, every request made by your browser and every response sent by a web server must first be chopped up into small packets of data. You can think of your original request as a photo mosaic, and once its been chopped up, each tile represents a packet of data. Aside from containing the binary bits of data, each tile also knows the ip address its supposed to go to and how to reassemble itself once all the packets reach the destination ip address.
Along the way, there are routers (and other similar devices) that basically act as traffic cops and direct the packets to the correct path leading to the ip address.
Once all the packets of data arrive at the web server, the web server will look for the specific article, similar to how you’d look for a file in a cabinet drawer. Once the file has been located, the web server will chop up the response into data packets again, and send them back to your browser.
Finally, when all the data packets arrive back at your browser, your browser will reassemble all packets into the HTML, CSS, JavaScript, and image files that represent the article. And once these files are processed, you’ll magically see the article displayed on screen.