The Magic Behind Typing "google.com" and Pressing Enter

Tim NgenoTim Ngeno
4 min read

Ever wondered about the digital symphony that plays every time you type "google.com" into your browser and hit Enter? That simple action kick-starts an awe-inspiring sequence of events, showcasing the wonder of technology. Dive in with us as we decode this marvel, making sure you're equipped with both knowledge and a bit of internet whimsy by the end.

1. Pressed Enter? Let the Adventure Begin!

Your journey commences the moment "google.com" is typed into the browser and the Enter key is pressed. Think of this as sending out an invitation to the web party. But your browser needs to know where to send this request.

2. The Cache Quest: Memory Lane

First, before reaching out to the internet, the browser takes a nostalgic trip down its memory lane— the local cache. It's checking to see if it recalls the IP address of "google.com".

If this diary is missing an entry, it consults the memory of the bigger fish— the operating system.

3. The Grand DNS Quest: Addressing the Address

Resolver and Recursive DNS Servers:

Imagine the DNS (Domain Name System) as a wise old librarian. She knows where every book (in this case, a website) resides.

  • First stop, your device's librarian: the DNS Resolver. If the OS doesn't have the IP cached, it reaches out to the DNS Resolver set up on your device or network (often assigned by your ISP).

  • If she's unaware, we consult a council of librarians: the Recursive DNS Servers. These servers have their cache but assuming the DNS lookup initially fails, they will perform a sequence of queries to find the IP.

  • They, in turn, check with the head librarian: the Root Servers. The recursive server asks a root server for the Top-Level Domain (TLD) DNS server for ".com". Root servers don’t have the IP but can direct to the right TLD server.

  • TLD Servers: The TLD server for ".com" provides the address for the authoritative name servers for "google.com"

  • The chain of queries ensues till the Authoritative Name Servers spill the beans on the exact IP location. Finally! This IP is passed back through the chain: from the authoritative server to the recursive server and then your computer.

4. TCP/IP: The Elaborate Digital Handshake

Having secured the address, your browser, like a polite guest, extends a handshake before entering. In the digital realm, this handshake has three distinct moves:

  • SYN (Synchronize): Your computer sends a SYN packet asking if the server is open for new connections.

  • SYN-ACK (Synchronize-Acknowledgment): The server responds affirmatively with a SYN-ACK packet.

  • ACK (Acknowledgment): Your computer replies with an ACK, and the connection is established.

  • Once both parties nod in agreement, communication lines are opened.

5. Security Frontlines: SSL/TLS & HTTPS

In today's cyber jungle, security is king. With predators lurking (read: hackers), "google.com" ensures your connection is encrypted and secure via the SSL/TLS handshake, the unsung heroes behind the tiny padlock symbol you see in your address bar.

They'll negotiate the version of SSL/TLS to use, choose cryptographic algorithms, exchange cryptographic keys, and then confirm that the handshake was successful.

6. Request Handling: Firewalls & Load Balancers

Your browser sends an HTTP GET request over the established connection. As you make your entrance request, vigilant bouncers are checking your credentials.

Firewalls act as meticulous gatekeepers, inspecting every piece of data.

Then, Load Balancers, much like talented maître d’s, ensure no server is burdened, directing traffic efficiently and distributing the request(s) to a poll of servers. This ensures no single server is overwhelmed.

7. Server Processing: Web & Application Servers

Once inside, Google's very own servers take the stage. While the Web Server plays the tunes you requested, it's often the Application Server working behind the curtains, ensuring every note hits perfectly.

The web server receives the request and forwards it to the appropriate application server if necessary. For instance, Google uses custom server software to handle requests.

Google’s server checks what information needs to be fetched or computed. This might involve database queries, API calls, or other computational tasks.

The server formulates a response, which is usually an HTML page, and sends it back to the browser.

8. Receiving and Rendering: Data’s Return Journey

After the performance, the data makes its way back to you in packets, via TCP/IP. Your browser, now in the audience, receives this, crafts it beautifully (interprets the HTML, CSS and Javascript), and voila! The Google homepage stands before you.

9. A Graceful Exit: Connection Curtains

Every grand performance deserves a grand curtain call. The connection, after delivering its masterpiece, gracefully bows out, making room for future performances.

This is performed using a TCP termination process. Unless the connection is kept alive for further requests, it's terminated to free up resources.

Conclusion: Ode to the Digital Ballet

The next time you're swiftly transported to "google.com", take a fleeting moment to marvel at the intricate ballet that whisked you there. Every keypress sets off a domino effect, a testament to the marvels of modern tech, the great digital opera!

0
Subscribe to my newsletter

Read articles from Tim Ngeno directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Tim Ngeno
Tim Ngeno

Software Engineering student at ALX