Internet and Behind the Scenes

I am a developer who likes to share his learnings in the form of blogs and social media posts. I already have the knowledge of machine learning concepts and to make complete end-to-end applications, I am learning Web Development
Hello everyone, have you ever wondered how you reached this page so easily?
Well, after reading this article, you'll get the answer and realize that all these behind-the-scenes mechanisms are inspired by real life.
First, lets understand why does internet matters in today’s world.
Why does internet matters?
Global Communication: Enables instant messaging, emails and video calls.
Information Sharing: Allows access to vast amount of knowledge, research and news
Entertainment: Streaming services, gaming and social media
Education and innovation: Enables online courses, remote work and technological advancements.
In above examples, you will find that in one way or another, the data is being shared from one point to another point. The whole agenda of internet is based on this ‘data sharing’ only. So to understand the internet, we must understand how data is being shared. So now, lets move on to technical terms and understand the internet.
The Packet’s Path: Navigating the Digital Highway
The data which travels from one point to another is broken down into small chunks, these chunks are called packets. Now I will take you to the entire journey of these packets.
Planning The Trip:
When we search for a website (like www.google.com) in a browser, the browser needs the IP address of that website. To get it, the browser sends the website name to the DNS server, which helps to find the IP address of the following website.
Analogy: If we have to go to someone’s house, we require their exact address rather that the house name.
Now we got the IP address of www.google.com which is 142.250.183.100

Preparing The Journey:
Now that we have the address to send the data to, our browser constructs HTTP/HTTPS requests to facilitate this transfer. These requests include:
Method (GET, POST, DELETE, etc.)
Headers (User Agent, Host, etc.)
Request Body (the actual data)
Analogy: This process is similar to packing our luggage before visiting a house.

Starting The Journey:
When our HTTP request is ready, it is sent over the internet using specific protocols that dictate how how data transfer should occur. The two primary protocols are:
TCP (Transmission Control Protocol): Ensures reliable, ordered and error-checked delivery of data. Used for web pages, emails and file transfer.
UDP (User Datagram Protocol): A faster but less reliable protocol used for real-time applications like video streaming, online gaming and video calls.
Analogy: TCP is like taking a planned route with checkpoints ensuring you arrive safely while UDP is like taking the fastest route without worrying about checkpoints.

The Role of Routers and Switches:
Data packets don’t travel from sender to receiver directly. Instead they pass through multiple routers and switches to reach the final destination efficiently.
Routers: These act like highway interchanges, directing packets along the best possible path to reach the destination.
Switches: These operate withing the local network (e.g. home or office) directing packets to the correct device in the network.
Analogy: They act as traffic cops or local guides, ensuring the data reaches its intended destination efficiently.

Reaching the Destination:
Now our data has reached its final destination. The data is reassembled into its original sequence using defined protocols. The receiver processes the data according to the request and sends a response back if needed.
The entire process in fraction of a second, allowing us to load the web pages almost instantly.
Additional Concepts That Keep Our Internet Running
Caching
Web browsers and servers use caching to store copies of frequently accessed content, reducing load times.
For example, when you visit www.google.com frequently, your browser stores the IP address in memory instead of searching for it every time.
Firewalls and Security Measures
Firewalls and encryption protocols such as HTTPS ensure data privacy and protection from cyber threats
Analogy: A firewall is like a security checkpoint that filters harmful entities before the enter a restricted area.
Conclusion:
From typing URL in browser to receiving a web-page, many such processes occur behind the scenes, ensuring seamless connectivity. These mechanisms ranging from DNS resolution, HTTP requests, TCP/UDP transmission and router navigation are the backbone of the internet.
All these process are complex yet well-structured system inspired by our day-to-day life.
Understand how the internet works through this article? Then engage with it by liking and sharing. Follow me on X and LinkedIn for more insightful tech content.

