What happens when you type google.com in your browser and press Enter
This question is a classic and still widely used interview question for many types of software engineering position.

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

Introduction:

This article covers the following networking aspects:

- DNS request

- TCP/IP

- Firewall

- HTTPS/SSL

- Load-balancer

- Web server

- Application server

- Database


Once you've written a string and press enter the browser determines weather this string is a URL or not; if its a search term then it does a search, and if its a URL, it visits that page. In our case google.com is a URL and therefor it starts the process of visiting this page. Establishing a connection with a website happens by sending a get request to it.

Since it was not specified, we need to know which protocol to use, http unencrypted port 80 or https encrypted port 443? the browser searches on its local list of websites that only communicates with https. It finds google.com in the HSTS list so it uses https port 443 and it knows that it will only establish a secure connection with it.

What happens when you type
What happens when you type


DNS request:

A DNS request also known as a DNS query, is a process in which a device asks the Domain Name System (DNS) server for the IP address associated with a specific domain name. This is essential for the device to be able to connect to google.com.

The browser translates the URL https://www.google.com into an IP address by first sending a DNS request to a DNS server. The server then looks up the domain name in its database to find the corresponding IP address. Once the IP,address has been identified, the browser can initiate a connection to the server that hosts the website. This process is known as DNS resolution.

DNS Request

TCP/IP:

TCP/IP, or Transmission Control Protocol/Internet Protocol, is a set of rules (protocols) that governs how devices on the internet communicate with each other. It is essentially the foundation of the internet. TCP/IP ensures that data is correctly sent and received between different devices over the internet.

The TCP/IP model consists of four layers:

  1. The Network Interface Layer: This is the lowest layer of the TCP/IP model, and it is responsible for placing TCP/IP packets on the network medium and receiving TCP/IP packets off the network medium.
  2. The Internet Layer: This layer is responsible for addressing, packaging, and routing functions.
  3. The Transport Layer: This layer is responsible for maintaining end-to-end communication between the source and destination application.
  4. The Application Layer: This is the highest layer in the TCP/IP model. This layer includes all processes that use the Transport Layer protocols to deliver data.

Typical TCP/IP protocols comprise;

  • A web server and a web browser communicate via the Hypertext Transfer Protocol (HTTP).
  • HTTP Secure manages secure communication between a web server and a web browser (an http with an ’s’ — https, like in our ).
  • File Transfer Protocol controls computer-to-computer file transfer.
  • At this point, your computer essentially just says, “Hey, I need the content of?https://www.google.com," using the “https” language, and the server on the IP answers with the web pages based on the agreed-upon language.

TCP/IP


Firewall:

A firewall is a network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules. It acts as a barrier between a trusted internal network and untrusted external networks, such as the internet, to prevent unauthorized access and protect against cyber threats. Firewalls can be implemented in hardware or software form to help secure computer networks and data.

The conversation and any relevant packets exchanged with?https://www.google.com?are tracked until the connection is stopped with a firewall configured on your machine. As a result, the danger of malware assaults is significantly decreased, which is particularly beneficial for enabling safe communication over the internet.

Firewall


HTTPS/SSH:

HTTPS stands for Hypertext Transfer Protocol Secure, which is a secure version of the standard HTTP protocol used for transferring data between a web browser and website. SSL stands for Secure Sockets Layer, which is a technology that encrypts the connection between a web browser and a website to ensure that data transmitted between them is secure and protected from unauthorized access. In simpler terms, HTTPS and SSL work together to create a secure and encrypted connection between a user's browser and a google.com page, helping to protect sensitive information such as passwords, credit card details, and personal data. The SSL handshake process is performed at the beginning of connection between the computer and?https://www.google.com.

HTTPS/SSL


Load Balancers:

Google searches are something we all do every single day. If there is only one server for?https://www.google.com, your browser may experience delays in displaying the site’s content, assuming it even reaches the site at all. This is because there are often millions of people all trying to access the same page at the same time. Companies like Google provide multiple high-capacity servers, each with a unique IP address, to handle the traffic to?https://www.google.com. Even when there are several servers available, traffic from various parts of the world still needs to be balanced across them. This is where a load balancer comes in.

Load-balancers, in this context, are programs or pieces of hardware that route requests for servers from clients to many servers in the same network. Load balancing is the practice of using multiple scheduling algorithms in concert inside a single piece of software. Load balancers, on the hardware side, are sometimes referred to as specialized routers or switches and are placed between the servers and the clients.

Load Balancer


Web Server:

A web server is a computer program or software that serves requested web pages to users over the internet. It processes incoming network requests over HTTP and delivers the requested web pages to the user's browser. Web servers are essential for hosting websites and enabling users to access and interact with web content. Its primary responsibility is to show website content by storing, processing, and delivering web pages to visitors. It primarily serves static material.


Application Server:

An application server is a software framework that provides an environment for running and managing applications. It typically handles tasks such as application scalability, security, transaction management, and resource pooling. Application servers are used to deploy and run web applications, enterprise applications, and other software services. They help in managing the communication between the user interface and the backend services, ensuring smooth operation of the application.

In contrast to a web server, which was designed to primarily serve static material, an application server is capable of serving dynamic content, performing business logic for enterprise applications, and incorporating a number of different protocols for client response.

For example, when you type in “https://www.google.com (https://www.google.com/)" in your browser, the server will respond and send the requested page to your computer.


Database:

In a network, a database serves as a centralized repository for storing and managing data that can be accessed by multiple users or applications. The database helps in organizing and structuring data in a way that facilitates efficient retrieval and sharing of information across the network. It allows multiple users to access and manipulate data simultaneously, ensuring data consistency and integrity. Additionally, databases in a network environment help in providing secure access control, data backup, and recovery mechanisms to ensure data reliability and availability.


Conclusion:

What happens when you type

When you type "google.com" into your browser, here's what happens:

  1. The browser checks the cache for a DNS record to find the corresponding IP address of "google.com".
  2. If the requested URL is not in the cache, ISP’s DNS server initiates a DNS query to find the IP address of the server that hosts "google.com".
  3. The browser initiates a TCP connection with the server.
  4. The browser sends an HTTP request to the server (The SSL handshake process is performed before the connection, meanwhile the firewall tracks incoming and outgoing network traffic).
  5. The server handles the request and sends back a response.
  6. The browser receives the HTTP response and renders the HTML content (i.e., the webpage).


Monzer Omer

UofK student- MERN full stack Software engineer - Math teacher on-site and online

12 个月

That’s great

Lina Ahmed Alnoosh

Electrical and Electronics Engineering final year student at University of Khartoum | Telecom Specialization | ML Enthusiast

12 个月

Keep the flow of such informative content coming our way huda! ??????

要查看或添加评论,请登录

Huda Omer的更多文章

  • ??? ??????

    ??? ??????

    Introduction Purpose: My project is an online marketplace dedicated to selling handmade accessories, with the aim of…

    23 条评论

社区洞察

其他会员也浏览了