DEV Community

Nick
Nick

Posted on

What Happens When you Type google.com in your Browser and Press Enter?

Introduction

Ever wondered what goes on “under the hood” when you type ‘google.com’, or any other phrase, into your browser’s address bar and press enter? Many people not familiar with web development are curious about the inner workings of a website. By reading this blog, readers from a non-technical background will gain a deeper understanding of the technologies that power their popular websites.

Website architecture (or web architecture) refers to the organization and structure of a website. Readers need to perceive the basic structure of a website to facilitate understanding. The web architecture consists of several components:

Client-Server Model: Is the fundamental structure of a website. A typical website assumes a client-server model. In this model, clients (web browsers) request resources from servers. Servers receive the client’s Hyper Text Transfer Protocol (HTTP) requests, process them and send specified resources back to the client, or perform an action.

Front-end: Is the user facing end of the website, for example a Chrome browser’s window.

Backend: Is a set of logic (code) that runs the website away from the front-end. The backend code processes requests coming from the front-end.

Database: Is a component that stores a website application’s data, such as user credentials.

Understanding the basic parts of a website creates a vivid visualization. A good understanding will help you follow along as this blog discusses the processes that run in the individual components.

Typing ‘google.com’ in your browser

When you type ‘google.com’ in your browser, you are essentially requesting a resource from one of several thousand Google servers. Clients can request several types of resources from Google servers. The resource ‘google.com’ is a static content, which is Google’s search engine main page.

The phrase ‘google.com’ is a domain name. A domain name is a human-readable and memorable address that a browser uses to identify and locate a server on the World Wide Web. Technically, a browser identifies a server by an Internet Protocol (IP) address and not a domain name. Therefore, when you type a domain name and press enter, the browser performs a Domain Name System (DNS) lookup. This process converts the wordy domain name into an IP address. Once the browser locates a server with the IP address specified in the address bar, the browser establishes a connection.

Manufacturers routinely configure client computers and servers with firewalls. Firewalls are software or hardware components that scrutinize website traffic to determine malicious content. Firewalls can allow or restrict outgoing requests and incoming server responses. Assuming both your web browser and the Google server contain non-restrictive firewall configurations for your type of request, they will establish a connection once the browser locates the server.

Computers need a communication method to facilitate the exchange of information. The Internet Assigned Numbers Authority (IANA) establishes and maintains a suite of computer communication protocols. The IANA protocols facilitate communication between computers of different architectures and operating systems. Your web browser communicates with a Google server using a communication protocol known as Transmission Control Protocol/Internet Protocol (TCP/IP). This communication standard governs the way data is transmitted between the two computers over the internet.

HTTP requests are human-readable, which poses a data security risk. Computer communications need to be discreet to prevent malicious actors from intercepting and deciphering communication in-between. For security purposes, browser and server manufacturers configure their software components with a security feature that allows the encryption of the data transmitted back and forth. This feature, known as the Secure Socket Layer (SSL), encrypts your HTTP request in transit and only decrypts it at the destination server.

Billions of people use the Google Search Engine daily, which can overload the servers. Companies that process such huge web traffic use software or hardware devices known as load balancers to distribute traffic between the different servers. This distribution solution aims to ease up workload on individual servers. Google engineers configure load balancers with distribution algorithms to route traffic from web browsers to various servers. Therefore, a load balancer will route your ‘google.com’ request to a server that can efficiently handle the request, based on factors such as server load and geographical location.

Once your request hits a server, the server will start processing it. A typical server contains within it a web server, an application server and a database. A web server processes static content. The server usually sends a static resource back to the client in an unchanged state. Static content includes HTML, CSS, JavaScript, and images files.

Servers also host dynamic content. A web server forwards dynamic content requests to an application server for further processing. An application server contains the server-side logic—a set of instructions to manage dynamic requests and route requests within the web framework).

Additionally, servers host databases that store an application’s data. A typical web application could store users’ login credentials in the database. Servers can host several categories of databases.

Conclusion

To recap, when you request ‘google.com’ from your web browser, the web browser will conduct a DNS lookup using the domain name to connect to a Google server where the requested resource lives. An SSL feature in your browser will encrypt the request data. A TCP/IP protocol will then transmit the request data through the internet to a Google server. A load balancer will route your request to a server. A web server will then process the request since you are requesting a static content. The server will return an encrypted response to your web browser. Your browser will then decrypt, render and display the response. Finally, your browser and server will close the connection.

Top comments (0)