alex / what-happens-when

An attempt to answer the age old interview question "What happens when you type google.com into your browser and press enter?"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

what happens when you type google.com in a browser

ophiliatex opened this issue · comments

When you type "google.com" in your browser and press enter, several processes take place to facilitate your connection to the Google website. Here's an overview of the processes involved:
DNS Request:
Your browser sends a Domain Name System (DNS) request to a DNS server to resolve the human-readable domain name "google.com" into an IP address.
The DNS server responds with the IP address associated with "google.com."
TCP/IP (Transmission Control Protocol/Internet Protocol):
Using the obtained IP address, your browser initiates a TCP connection to the Google server. TCP is responsible for establishing a reliable connection between your computer and the server.
Firewall:
If you have a firewall on your computer or network, it may inspect and filter the incoming and outgoing traffic. The firewall ensures that the communication complies with the security policies.
HTTPS/SSL (Secure Sockets Layer):
If the website uses HTTPS (Hypertext Transfer Protocol Secure), your browser establishes a secure connection to the server using SSL/TLS (Transport Layer Security).
SSL/TLS encrypts the data exchanged between your browser and the server, ensuring that it remains confidential and secure.
Load-Balancer:
In the case of large-scale websites like Google, load balancers distribute incoming network traffic across multiple servers. This ensures optimal utilization of resources and prevents overload on a single server.
Web Server:
The web server (e.g., Apache, Nginx) receives the request from your browser and processes it. It retrieves the requested web page or resource and sends it back to your browser.
Application Server:
For dynamic content or web applications, an application server may be involved. This server executes application logic, interacts with databases, and generates dynamic content based on the user's request.
Database:
If the web page or application requires data from a database, the application server interacts with the database server to retrieve the necessary information.
The retrieved data is then processed and sent back to the web server, which, in turn, sends the final response to your browser.
In summary, the process involves translating the domain name to an IP address, establishing a secure connection, distributing traffic across servers, retrieving web content, executing application logic (if needed), and interacting with a database for dynamic content. Each component plays a crucial role in delivering the requested web page to your browser.