What happens when you type https://www.google.com in your browser and press Enter?

What happens when you type https://www.google.com in your browser and press Enter?

Have you ever wondered about the intricacies of how the internet operates? When you enter "https://www.google.com" in your web browser's address bar and hit Enter, several intricate steps are set in motion to bring you to the Google website. Here's a comprehensive overview:


DNS Resolution: The browser's first task is to resolve the IP address associated with the domain name "google.com." To achieve this, it sends a DNS (Domain Name System) query to a DNS server. The DNS server looks up the IP address for "google.com" and returns it to the browser.


TCP Connection: Next, the browser establishes a TCP (Transmission Control Protocol) connection with the IP address obtained from the DNS server on port 443 for secure connection. This involves a three-way handshake to create a connection with the Google server.


Firewalls: During the DNS resolution and TCP connection establishment, firewalls on both the client-side (your network) and server-side (Google's network) come into play. Firewalls inspect and filter incoming and outgoing network traffic based on predefined rules and security policies.


Sending an HTTP Request: Once the connection is set up, the browser sends an HTTP (Hypertext Transfer Protocol) request to the Google server, specifically requesting the homepage (e.g., "GET / HTTP/1.1"). This request includes various headers providing information about the browser and its capabilities.


Load Balancing: Google, with its high traffic, employs a multitude of servers. This necessitates the use of a load balancer that receives requests and directs them to specific servers based on the load balancing algorithm in use.


Response Handling: The server receiving the request sends a response to the load balancer, which then forwards it to your browser. This response primarily includes HTML, CSS, and JavaScript files that constitute Google's homepage.


Dynamic Content: If dynamic content, such as Google search results, is required, the web server may make a request to an application server, which, in turn, could query a database server to retrieve data. The web server then incorporates this data into the response it sends back to the browser.


Rendering: Finally, the browser renders the page and displays it for you to interact with.

Here's a more detailed discussion of the web infrastructure and the process flow:


DNS and DNS Request:

The DNS (Domain Name Server) serves as the internet's phone book, mapping human-readable domain names to IP addresses. When you input "https://www.google.com" in your browser, the browser first checks its cache for the DNS record for that domain. If not found, it sends a request to a DNS server to translate "www.google.com" into an IP address. The DNS lookup process involves various steps as detailed below:


1. Browser query travels into the Internet and is received by a DNS recursive resolver.

2. The resolver then queries a DNS root nameserver (.).

3. The root server then responds to the resolver with the address of a Top Level Domain (TLD) DNS server (such as .com or .net), which stores the information for its domains. When searching for googe.com, our request is pointed toward the .com TLD.

4. The resolver then makes a request to the .com TLD.

5. The TLD server then responds with the IP address of Google’s domain nameserver

6. The recursive resolver sends a query to the Google domain nameserver.

7. The IP address for google.com is then returned to the resolver from the nameserver.

8. The DNS resolver then responds to the web browser with the IP address of the domain requested initially.

The length of time that the DNS record is cached (the "TTL," or Time To Live) is determined by the authoritative nameserver and can be configured by the domain owner.


TCP/IP:

After obtaining the IP address, your computer needs a communication protocol to interact with Google's servers. This is where the TCP/IP protocol suite comes into play. It provides the rules for packaging, addressing, transmitting, routing, and receiving data over the internet, ensuring reliable and ordered communication.


TCP/IP comprises four layers:

a. Link layer / Physical layer: Manages data transmission between hosts on the network, tailored to the specific hardware in use.

b. Network Layer: Deals with packaging, addressing, and transmitting data across the internet, including protocols like IP and ICMP.

c. Transport Layer: Responsible for end-to-end communication, encapsulating protocols like TCP (reliable, ordered transmission) and UDP (connectionless, prioritizing speed).

d. Application Layer: Involves the protocols that software applications use most frequently, including HTTP, HTTPS, FTP, and SNMP.


Firewalls

During the establishment of a TCP connection with the IP address obtained from DNS, firewalls at both the client-side (your network) and server-side (Google's network) come into play. Firewalls inspect and filter incoming and outgoing network traffic, allowing or blocking connections based on predefined rules and security policies.

A firewall is a security system that monitors and controls network traffic based on a set of security rules. Firewalls usually sit between a trusted network and an untrusted network; oftentimes the untrusted network is the Internet.

Firewalls can be:

a. Host-based or computer firewall which protects just one computer. Typically deployed on personal devices and come packaged with the operating system.

b. Network firewalls which protect all devices and traffic passing a demarcation point. Network firewalls function at the network level, OSI layers 3 and 4, scanning traffic between external sources and the local area network (LAN) or traffic between different segments of the network.

If the content of the packets do not meet previously selected criteria based on rules that the network administrator or security team has created, the firewall rejects and blocks that traffic.


HTTPS/SSL:

Once the TCP connection with Google.com is established, your browser initiates an HTTPS/SSL request to create an encrypted connection on port 443 of the server. SSL/TLS (Transport Layer Security) encrypts data exchanged between your browser and the server, ensuring confidentiality and integrity.


This process includes:

a. The browser requesting a secure connection and providing encryption algorithm preferences.

b. The server responding with its preferred encryption algorithm, a digital certificate, and a random number.

c. The browser verifying the server's certificate with a trusted Certificate Authority (CA).

d. Generating a shared secret and deriving a session key for encryption and decryption.


With the SSL/TLS handshake completed, data exchanged is secure, and the browser can send an HTTP request over the encrypted connection.


Load balancer

Large corporations as Google that experience high traffic have many servers to be able to serve the requests. To efficiently handle this high traffic, Google employs a load balancer that distributes incoming requests to multiple servers using a defined algorithm.

A load balancer works as a “traffic cop” sitting in front of your server and routing client requests across all servers. It simply distributes the set of requested operations (database write requests, cache queries) effectively across multiple servers and ensures that no single server bears too many requests that lead to degrading the overall performance of the application. The load balancer selects an available web server based on a load-balancing algorithm (e.g., Round Robin, Least Connections, etc.).



Web Server, Application Server, and Databases:

The web server processes HTTP requests, serving web pages' HTML, CSS, and JavaScript files.

Upon receiving a request, an HTTP server checks if the requested URL matches an existing file.

If so, the web server returns the file content which would typically include the HTML, CSS, and JavaScript files that make up the web page.


If dynamic content is required, the web server communicates with an application server, which, in turn, may query a database server for data. The application server processes requests, generates dynamic content, and communicates with databases, if necessary.


If the request to www.google.com contains dynamic content, The web server forwards the HTTP request to an application server, which hosts the application logic and data. The application server processes the request, which may include database queries and other computations. The application server then generates dynamic content (e.g., HTML, JSON) to fulfill the client's request.


If the application server requires data from a database, it communicates with the database server. This may involve executing queries to retrieve, update, or manipulate data. The application server sends the response data back to the web server.


The web server receives the application server's response and may apply additional processing or static content assembly if necessary. The web server sends the response back to the load balancer. The load balancer, upon receiving the response from the web server, sends the response back to the client.


Browser Page Rendering:

The client's web browser receives HTTPS responses, decrypts them, and renders webpages by parsing HTML, applying CSS styles, and executing JavaScript. This process transforms resources into interactive webpages that users can interact with.


In conclusion, this intricate process ensures scalability, fault tolerance, and secure data transmission. Load balancers optimize server performance, while HTTPS safeguards data during transmission. This post serves as my submission for a technical writing task within the ALX Africa Software Engineering program.

To view or add a comment, sign in

Others also viewed

Explore content categories