What happens when you type google.com in your browser and press Enter

What happens when you type google.com in your browser and press Enter

In this article, I will explain in-depth what happens When you type google.com into your browser and hit enter.

TABLE OF CONTENTS

  • DNS Request

  • TCP/IP

  • Firewall

  • HTTPS/SSL

  • Load-balancer

  • Web server and Application Server

  • Database

  • Illutrating diagram of web infrastructure

When you type google.com into your browser and hit enter, a complex chain of events takes place behind the scenes to deliver the webpage to your screen. This post will explore the different components involved and the steps they take to make this possible.

DNS Request

The first step is the DNS request. let start by explaining what DNS is all about. DNS stands for Domain Name System, and it is a protocol used to translate human-readable domain names, like "www.google.com," into machine-readable IP addresses, like "172.217.0.46". A DNS request is a query made by a client to a DNS server asking for the IP address associated with a specific domain name, which is like a phone book for the internet. Every website has an IP address, which is a unique set of numbers that identifies it on the internet. When you type in a domain name like google.com, your browser sends a DNS request to a DNS server to find out the IP address associated with that domain name.

TCP/IP

Once your browser has the IP address for the website, it sends a request to the website's server using the TCP/IP protocol. TCP (Transmission Control Protocol) is a protocol for establishing and maintaining a network connection, while IP (Internet Protocol) is responsible for routing data packets between devices on the internet. TCP/IP is a suite of communication protocols used for connecting devices to the internet and other computer networks. It is the primary communication protocol used on the internet and is responsible for routing data packets between networks and ensuring reliable delivery of data across the network.

TCP is responsible for breaking data into packets, sending them across the network, and reassembling them at the destination. It establishes a reliable connection between two devices by setting up a virtual "conversation" that involves a series of handshakes between the devices. It also ensures that packets are delivered in the correct order and that lost packets are retransmitted.

IP, on the other hand, is responsible for routing packets between networks. It assigns a unique IP address to each device on the network, which is used to identify the device and route packets to it. IP also handles fragmentation, which is the process of breaking packets into smaller pieces if they are too large to be transmitted over the network.

Together, TCP and IP form the basis of the Internet and other computer networks, allowing devices to communicate with each other reliably and efficiently.

Firewall

The website's server may have a firewall in place to protect it from unauthorized access. A firewall is a network security system that monitors and controls incoming and outgoing network traffic based on a set of rules. It acts as a barrier between a trusted internal network and an untrusted external network, such as the internet.

The primary function of a firewall is to filter network traffic and block unauthorized access to a network. It does this by examining each packet of data that enters or leaves the network and comparing it against a set of predetermined rules. If the packet does not meets the criteria specified by the rules, the firewall blocks it from entering or leaving the network but if it is allowed to pass through the firewall successfully, it proceeds to the next step.

HTTPS/SSL

Next, your browser and the website's server establish an HTTPS connection. HTTPS (Hypertext Transfer Protocol Secure) is the secure version of HTTP, which is the protocol used to transfer data between a web browser and a web server. HTTPS uses encryption to protect the integrity and confidentiality of data as it travels between the browser and the server.

SSL (Secure Sockets Layer) is the predecessor to the newer TLS (Transport Layer Security) protocol that is used to establish a secure connection between a web browser and a web server. SSL and TLS are both cryptographic protocols that use digital certificates to verify the identity of the server and encrypt the data being transferred.

When a user connects to a website using HTTPS, the web server presents its digital certificate to the browser, which verifies the authenticity of the certificate and establishes a secure connection with the server. This secure connection is indicated by a padlock icon in the browser's address bar and the "https" prefix in the URL.

HTTPS/SSL is important for protecting sensitive data transmitted over the internet, such as passwords, credit card numbers, and other personal information. It prevents attackers from intercepting and reading the data as it travels between the browser and the server, which helps to protect against various types of cyber attacks, including man-in-the-middle attacks, eavesdropping, and data tampering.

Load-balancer

A load balancer is a network device or software application that distributes network traffic across multiple servers or other network resources to optimize resource utilization, maximize throughput, minimize response time, and ensure high availability and fault tolerance. If the website receives a high volume of traffic, it may use a load-balancer to distribute the requests across multiple servers. The load-balancer receives the request from your browser and forwards it to one of the web servers.

Load balancers are often used in web applications, where they help to distribute incoming traffic across multiple servers to ensure that no single server becomes overwhelmed with requests. They can also be used to distribute traffic across multiple data centers or cloud regions for improved performance, resilience, and disaster recovery.

Web Server

The web server receives the request from the load-balancer and processes it. It retrieves the requested webpage and sends it back to your browser using the HTTPS connection that was established earlier.

A web server typically consists of two main components: a HTTP server and a file server. The HTTP server is responsible for handling incoming HTTP requests and returning the requested content, while the file server stores the files that make up the web pages and serves them to the HTTP server as needed.

Application Server

If the requested webpage requires dynamic content or interaction with a database, the web server may forward the request to an application server. The application server processes the request, retrieves the necessary data from the database, and sends it back to the web server, which in turn sends it back to your browser. Additionally, it may provide security, transaction management, connection pooling, and messaging services to improve performance, scalability, and reliability.

Database

If the requested webpage requires data from a database, the application server retrieves the necessary data from the database. The data is then sent back to the web server, which sends it back to your browser as part of the webpage.

In conclusion, when you type google.com into your browser and hit enter, a complex chain of events takes place to deliver the webpage to your screen. This involves a DNS request, TCP/IP, firewall, HTTPS/SSL, load-balancer, web server, application server, and database. Understanding how these components work together can help you troubleshoot any issues that may arise when accessing websites.

Below is web infrastructure design that shows how traffic is been distributed with the help of load balancer in place.