What Happens When You Type google.com And Press Enter?
Tags: google, http, softwareengineering, programming
Published: 2023-05-19 12:01:13

**What Happens When You Type google.com And Press Enter?**

It does more than just take you to Google's homepage. Behind the scenes, a complex set of processes are running that are responsible for delivering content from web servers to our screens.



We'll explore the following: 

- DNS requests 

- TCP/IP

- Firewalls 

- HTTPS/SSL

- Load-balancing 

- Web servers

- Application servers

- Databases


So when you type https://www.google.com into your browser window and pressed enter. A lot of technical stuff happens behind the scenes. 

Let's take a look at each step:


DNS request:
The first thing that happens is that a Domain Name System (DNS) request is sent out to find out the IP address associated with https://www.google.com. This implies that a DNS request is sent out to resolve the domain name of the server hosting the website. The DNS looks up information about the site, such as its IP address and location, and sends it back as an answer. This process happens almost instantaneously and preps your computer for communication with the server.

The IP address is a unique numerical identifier that helps the computer determine which web server to send your request to.

Once the IP address is found, a TCP/IP connection is established between your computer and the web server – this cryptographic protocol provides secure communication between two or more computers and helps keep everything secure across the internet. 


TCP/IP:
Using TCP/IP protocols, your computer sends out requests for the pages of the site shown in your browser. Depending on what type of firewall or load balancer is in place at the server-side, these requests can be accepted or rejected before they ever reach their destination.

The TCP/IP protocols have been around for decades, allowing computers to connect with each other over a network. While there are many different types of protocols, most browsers rely on two: IP and TCP.


Firewalls:
Your Firewall Checks the Connection and Passes It Through

Once all of your devices are connected together, your firewall comes into play. It checks the connection to make sure that there’s nothing malicious lurking in the background, and then it passes it through to the web server.

Your firewall is a bit like an online bouncer—it stands guard over your computer and examines incoming and outgoing traffic. If something looks suspicious, your firewall will block it from getting through.

Once the connection is approved by the firewall, your TCP/IP protocol takes over. This protocol breaks down data into small packets that are easier for the web server to process. To make sure that all of these pieces get put back together properly, TCP/IP also includes error checking to make sure that every last byte of data arrives as expected.


HTTPS/SSL:
If you type in a URL beginning with HTTPS (like https://www.google.com), you’ll also be using SSL (Secure Sockets Layer). This extra layer of security encrypts data before it leaves your device, so any bad actors on the same network won’t be able to read what you’re sending or receiving.

HTTPS Encrypts Your Connection for Added Security

Do you ever wonder why your browser's URL bar turns green when you search for something on Google? That's because of HTTPS!

When it comes to ensuring your connection is secure, HTTPS (Hypertext Transfer Protocol Secure) adds an extra layer of protection. It's the same protocol that sends data between web browsers and websites, but with the added benefit that it encrypts your communication and makes sure only the intended receiver can read it. This protects against "man-in-the-middle" attacks, where someone else intercepts your data before it reaches its intended recipient.

To ensure a secure connection, HTTPS uses something called the SSL (Secure Sockets Layer) protocol. This is basically a handshake process between both sides of the connection—the browser and server—whereby they agree who will be talking to whom and what kind of encryption should be used for each communication session. Once this connection is established, all data sent back and forth is scrambled by a key that only both sides know about. After that, every time someone visits Google in their browser, they get redirected to the secure version thanks to a feature called HTTP Strict Transport Security (HSTS).


Load-balancing:
The load-balancer then sends your request to the appropriate web server and then an application server (if there is one). Here's where things get interesting – depending on what kind of website it is, any programming code associated with it runs and reaches out to the database for more info if needed, pulls data together, performs calculations and sends back a response in HTML form back along the established path you took before…right back down to you!

Load Balancers Distribute Your Request to Google's Web Servers
When you type in https://www.google.com and press 'Enter', your request is sent to a load balancer. Load balancers are responsible for distributing requests effectively, efficiently and securely over the Internet and can be located anywhere in the world.

A load-balancer can:
Divide traffic by geographical location
Automatically reroute traffic when necessary
Select the server with the best performance to minimize user wait time
Monitor servers for any unexpected downtimes and mitigate them by redirecting traffic to unaffected servers.


Application server:
Application Servers Process Your Search Query

The application servers take care of the processing power needed to make it happen. They query a database for the results and return them to you in an organized format.

The aim is for your request to be processed as quickly as possible, so Google uses load balancers to distribute requests evenly across its application servers and ensure performance isn't impacted by fluctuating traffic levels. 


Database/Web server:
Results Are Retrieved From Google's Massive Databases:

When you press the 'enter' key, the web servers connected to the Google network retrieve results from Google's massive databases. The databases contain the answers to all of your searches, and they are constantly updated to ensure that you get accurate results.

These databases are managed by Google’s application and database servers, which are designed to process millions of requests every second. The application server collates all of the relevant information from different sources (web pages, images, videos etc.), while the database server stores the data in an organized manner in order to provide quick access. The results are then sent back to you via Google's secure HTTPS protocol and displayed on your screen.

Conclusion
From the DNS request to the Google search engine, there is a lot working behind the scenes when you type https://www.google.com in the browser. With the help of the Firewall, HTTPS/SSL, load-balancer, web server, application server, and database, your request is processed and the results displayed to you in a matter of seconds.