Working of Internet
I’m not a prodigy. I didn’t start at 13. I learned the hard way — error by error, late night by late night. I still Google basic stuff, still mess up, still doubt myself. But I show up daily, build real things, and document the process without filters. No polished aesthetics. No fake “10x dev” talk. Just one guy trying to master his craft — publicly, consistently, and without shortcuts. If you relate to the grind more than the glory, welcome to my corner of the internet.
Have you ever thought about how fast a website opens by clicking a link? What happens at the backend? Nowadays, we visit many websites, but we do not know how these websites open with a single click. In this article, I will explain how the Internet functions
Internet
The Internet is a global network of billions of devices connected worldwide, enabling communication with confidence and ease. Using the web, we can send any data or information anywhere. The Internet is commonly used in our daily lives, enhancing the way we connect with others.
Internet - a Global Village
We can say the internet is a global village. Because information spreads quickly and reliably in the village, the same is true with the internet, on the internet, information spreads very fast. Social media is a great example of it.
Working of Internet
Have you ever imagined how the Internet operates? In this section, we will explore the key components of the Internet, the protocols used for exchanging data between the browser and the server, and how data is transferred over the Internet. When you type a URL, your browser retrieves the IP address from the DNS and sends a request to the server. The server locates the website and delivers the webpage files (HTML, CSS, JS) to the browser, which displays them as a page.
Diagram

Key components of Internet
Client and Server: The client is the Browser and the Server is the computer on which the website lives. These computers remain online 24/7. Whenever we type any URL on the browser, Our browser makes a request to the server for the website.
Protocols: Protocol is defined as a set of rules. Whenever we say protocol, it means we are referring to pre-defined rules. In terms of the Internet. Protocols are a set of rules that control how data is transferred over the internet. Because, if there are no rules, then it is a great chance that data will not transfer accurately. Now we will know about some of the protocols of the internet.
HTTP: HTTP is the abbreviation of Hypertext Transfer Protocol. In simpler words, it is the set of rules that controls how hypertext will be transferred over the internet. Hypertext are text documents that contain links to other documents. Using these hyperlinks we can visit other documents.HTTP is stateless. It does not track our sessions. Example: When we open a webpage, it is displayed using HTTP.
HTTP is stateless but did you notice that many websites do not ask for our login information every time even if we close the browser like Facebook and Youtube and some websites offer the option “Remember me”? . The answer is that these websites use cookies.
Cookies: HTTP uses cookies to store information that is required for the interaction of users with websites. This is a small text file that stores our login information, location, and other information.
Stateless and Stateful: Stateless means that it does not maintain a state. Stateless means it maintains a state.
Example: When we watch a movie on Netflix and then close the app while watching the movie. If next time, when we open the app, the movie starts from where we closed the app. It means it has maintained the state.
FTP: It is a File Transfer Protocol that is used to transfer files between the Client and Server. It is stateful. It requires login and a Track session.
Example: When we download or upload files using Google Drive.
TCP: TCP is Transmission control protocol. It ensures that data is transferred reliably. If a file is transferred using TCP then it will ensure that all data packets are sent and received in the correct order. However, it is slow because it takes time to ensure delivery of all packets and resend a packet if it is lost or damaged.
Working of TCP

3-way acknowledgment: To transfer data reliably. TCP uses 3-way acknowledgment, In this the browser sends a Sync like a browser says “Hi”. Then the server sends Sync- Ack like the browser says “Hi, Can you hear me ?”. The browser sends an Ack like the browser says “Yes, I can hear you”.
Example: When we send a recorded voice message, it is sent using TCP.
UDP: UDP is User Datagram Protocol. It ensures that data is transferred very fast. To send data fast, it converts the large file into small datagrams. It does not ensure that all datagrams are sent.
Diagram to show Working of UDP

Difference between TCP and UDP:

Packets : When data is transferred across internet , then it is divided into small packets.
Journey of Data - From Servers to Browser.
In this section, we will know what process happens in the backend when we click a link and a webpage is displayed. We will follow a step-by-step process of how data travels from Server to Browser.
When we type “www. google.com” in the search bar in the browser. The www.google.com does not make sense for the browser to request the Server.
So the browser has to know the IP address of that website. At this step, first Browser makes a DNS query to find the IP address.
D.N.S(Domain Name System): DNS is a phone book of the Internet. It translates the Domain name(like www. google.com) into its corresponding IP address (192.168.150.00).DNS does not store Domain names. It only stores IP addresses.
Before this step, the browser checks its cache to see if the IP address is already stored. If the IP address is not found, the browser then sends a query to the DNS. This process is known as DNS resolution, during which the DNS provides the IP address.
Then Browser makes an HTTP request at this specific IP address of the server.
The server finds the requested website at this IP, if found then the browser sends web content files to the requested IP ( like HTML, CSS, JS) to the browser with status code 200(OK).
If not found then Browser sends status code 404( not found).
If there is an error in the Server. Then Browser sends status code 500(Internal Server Error).
Real Life Analogy to demonstrate this Journey
In this example, I will clearly explain the flow of data from browsers to servers using a real-life analogy. I will compare the process to how we order pizza and have it delivered.
My friend (the User) asks (types a URL) me (the browser) to order pizza (for a website). I (the browser) don’t have the phone number (the IP address) of the pizza shop (website).
First, I (the browser) will remember if I already know the phone number (IP address) ).
If I cannot find it, I will search for the phone number (find the IP address) in my contacts list (perform DNS resolution—query the DNS server). After locating the phone number (IP address), I will contact the pizza shop’s reception (the web server) to place the order (make an HTTP request).
The Pizza shop(Server ) will check its kitchen(Database). If the desired pizza is available in the kitchen(the server will check for the website).
If yes, then they will confirm the address (In the case of server and browser, the browser sends headers that contain the IP address )and deliver the Pizza(The server will send web content files with status code 200).
If the Pizza is unavailable, they will reply that the Pizza is unavailable(The server will send status code 404).
If their service is closed they will say “Sorry, we do not deliver pizza at this time”(The server will send status code 503, Service unavailable)
If there is any problem in their kitchen(Any problem in the server, they will say “Sorry, there is any issue in the kitchen(Server will send status code 500, internal server error).
Now think as in the case of Pizza, the Pizza shop offers us any other options if our desired pizza is not available. What does the server do will it also recommend other options if it does not find our website? For example, if I search for the pepperoni pizza website, will the server recommend any other pizza website if it does not find my desired website, and which status code will the browser return?
Diagram to show step by step process step by step process

Summary :
"In this article, I’ve explained what the internet does, how it functions, and how a webpage is displayed when we click a link. I’ve used real-life analogies to make these concepts clearer. If you notice any mistakes, feel free to comment so I can correct them. I value your feedback!"