Steps Your Browser Takes After Typing https://www.google.com and Pressing Enter
When you type https://www.google.com
into your browser and press Enter, a complex series of events unfold almost instantaneously, connecting your computer to Google’s servers and displaying the website. Here’s a detailed breakdown of each step involved; using a person that want to buy a book from bookshop as an example:
1. DNS Request
Imagine you want to buy a specific book, but you don’t know which shop has it. You need to find the address of a bookshop that sells it. This process is similar to a DNS request.
Browser Cache (Personal Address Book): First, you check your personal address book to see if you already know the address of the bookshop.
Operating System Cache (Home Notice Board): If you don’t find it there, you check a notice board in your home where you keep important addresses.
Router Cache (Neighborhood Bulletin Board): If the address isn’t on your notice board, you go to your neighborhood bulletin board.
ISP DNS Server (Local Library): If the neighborhood bulletin board doesn’t have the information, you visit your local library (ISP’s DNS server) to look up the bookshop’s address in a directory.
Recursive DNS Servers (City Directory Assistance): If the local library doesn’t have the information, they call the city directory assistance service (recursive DNS servers) to help find the address.
Root DNS Servers (Central Post Office): If directory assistance can’t find it, they ask the central post office (root DNS servers), which directs them to the right regional post office (top-level domain DNS servers), and finally to the specific post office that knows about the bookshop (authoritative DNS servers for google.com).
Once the address (IP address) of the bookshop (Google server) is found, it is given to you.
2. TCP/IP
With the bookshop’s address in hand, you need to establish a way to get there, just like establishing a TCP/IP connection.
Three-Way Handshake:
SYN (You Decide to Go): You decide to visit the bookshop and inform your friend that you’re planning to go.
SYN-ACK (Friend Agrees): Your friend acknowledges your plan and agrees to accompany you.
ACK (You Confirm): You confirm the plan and both of you start the journey.
3. Firewall
On your way to the bookshop, you may encounter security checkpoints (firewalls).
Your Firewall (Home Security): Before leaving your house, you check to make sure it’s safe to go (outgoing requests are legitimate).
Bookshop's Firewall (Store Security): When you reach the bookshop, the store security checks to ensure you’re allowed to enter (filtering incoming requests).
4. HTTPS/SSL
Upon entering the bookshop, you want to ensure your conversation with the shopkeeper is private and secure, similar to establishing an HTTPS/SSL connection.
Handshake Process:
ClientHello (Greeting): You greet the shopkeeper and indicate you want to talk securely.
ServerHello (Response): The shopkeeper greets you back and agrees to a secure conversation.
Certificate (Shop ID): The shopkeeper shows their ID (SSL certificate) to prove they are trustworthy.
Key Exchange (Secret Code): You and the shopkeeper agree on a secret code (session key) for communication.
Session Established (Private Conversation): You start a secure, private conversation using the secret code.
5. Load-Balancer
Inside the bookshop, if there are many customers, you may be directed to different counters (servers) to balance the load.
- Load Balancer (Store Manager): The store manager (load balancer) directs you to the least busy counter (server) to ensure quick service.
6. Web Server
At the counter, you request the book you want.
- Handling the Request (Store Clerk): The clerk (web server) receives your request, checks their inventory, and determines what you need.
7. Application Server
If the book is not immediately available or requires customization, the clerk asks a specialized worker (application server) for help.
- Dynamic Processing (Special Orders Desk): The specialized worker processes special orders, checks the database for availability, or fetches a custom version of the book.
8. Database
To fulfill your request, the specialized worker may need to check the store’s inventory database.
Database Query (Inventory Check): The worker looks up the book in the store’s inventory system.
Response (Availability): The inventory system provides the availability status of the book, which the worker uses to complete your request.
Returning the Response
Once the book is found or customized, the specialized worker gives it to the clerk, who then hands it to you.
Rendering the Page
Finally, you receive the book and start reading it.
Parsing HTML (Reading the Book): You open the book and start reading.
Loading Resources (Getting More Info): If the book references other materials (images, stylesheets, scripts), you gather those as well.
Executing JavaScript (Interacting with the Book): If the book includes interactive content (JavaScript), you engage with it to enhance your reading experience.
Conclusion
Going to a bookshop to buy a book involves multiple steps: finding the shop, traveling there, passing security checks, ensuring a private conversation, being directed by the store manager, interacting with clerks and specialized workers, and checking the inventory. This detailed analogy mirrors the technical process that occurs when you type https://www.google.com
in your browser and press Enter, involving DNS resolution, TCP/IP connection, firewalls, HTTPS/SSL encryption, load balancing, web and application servers, and database queries, all working together to deliver the webpage you requested.