What happens when you enter www.google.com ?

Before we dive deep into what all steps are there which executes when you perform this action, let’s look some of the pre-requisites terms you need to know
- Webpage : It’s basically a raw text file which is understandable to different browsers like : Chrome, Safari etc, also termed as HTML ( Hyper Text Markup Language ) that is stored in something called as servers.
- Servers : The storing service that hold all these raw text files ( Webpages ) and deliver to client side based on request.
- IP Addresses : Like a courier physical address , server and client are also located some where which in technical term we called it an IP Address.
- Protocols : The ways by which data is transmitted from server to client side are called as Protocols. There are majorly two types : TCP & UDP
Transmission Control Protocol ( TCP ) : In TCP , what happens is that data is transmitted in the form of small packets from server side & it serves static sites. i.e imagine you are downloading a file & suddenly your internet connection drops off or there is any server fault & the file stops downloading, but as soon as things turn right it get started from there it self not from 0% , which means server knows how many packets are delivered & what user still need to be receive. Although this protocol is slight slow as compare to UDP
User Datagram Protocol ( UDP ) : In UDP, it generally serves live videos & streams which makes it lot faster than TCP & UDP dose not care if all the data is delivered for ex : when you watch a live stream , either your internet connection or the host’s drops, you would just stop seeing the content; and when the connection comes back up you will only see the current stream of the broadcast and what was missed is forever lost.
Now, let’s break down the process of what happens when you type www.google.com in your web browser and press Enter into simpler steps:
Step 1: Browser Cache Check : The browser first check its own cache if the IP address requested is known or not
Step 2: Operating System Cache Check: If the browser doesn’t know the IP address, it asks your operating system (OS). The OS checks its own cache.
Step 3 :Host File Check: If the OS doesn’t have the IP address, it checks the host file on your computer. This file can map domain names to IP addresses.
Step 4 : DNS Request :
- If the host file doesn’t have the IP address, the OS makes a DNS request.
- The DNS request first goes to the resolver server provided by your Internet Service Provider (ISP).
Step 5 : Resolver Server Cache Check : The resolver server checks its cache for the IP address.
Step 6 : Root Server Query:
- If the resolver server doesn’t have the IP address, it asks a root DNS server.
- The root server points to the correct Top Level Domain (TLD) server, e.g., .COM for www.google.com.
Step 7 : TLD Server Query:
- The TLD server checks its cache.
- If not found, it directs the request to an authoritative name server.
Step 8 : Authoritative Name Server Query: The authoritative name server provides the IP address for www.google.com.
Step 9 : Browser Receives IP Address: The OS receives the IP address and gives it to the browser.
Step 10 : HTTP GET Request: The browser makes an HTTP GET request to the IP address.
Step 11 : OS Packs the Request: The OS packs the request using the TCP protocol and sends it to the server.
Step 12 : Firewall Check: The request passes through firewalls on both the OS and the server to ensure security.
Step 13 : Load Balancer: The server’s load balancer directs the request to one of the available servers.
Step 14 : SSL Handshake: The server responds with an IP address and an SSL certificate to establish a secure connection (HTTPS).
Step 15: Server Response: The chosen server sends back the HTML, CSS, and JavaScript files.
Step 16: Browser Renders Page: The OS receives these files and passes them to the browser, which interprets them to display the website.
Each of these steps happens incredibly quickly, often in just milliseconds, to deliver the webpage to your browser.
That’s it! . Feel free to follow me and share your thoughts on what else I can improve.
See you in the next part! 😊