How an internet service interruption helped me answer: what happens when you type google.com in your browser and press Enter?

Kayongo Samuel Yongo
7 min readApr 15, 2023

Introduction

In my earlier years of using browsers, I took the browser for granted just like anyone else. My motto at the time was, “If it works, it works.” No need for complicating things. However, one memorable day, as I was trying to curb my boredom by looking up an African horror film called Shumileta(in 144p), a very ominous message greeted me on my screen. “DNS Server Not Responding”.

I was mad(and feeling superstitious). Was it that Shumileta had decided to pay the DNS server a visit ? Cause why weren’t they responding? (I was 11, forgive me for my ignorance). The ISP(Internet Service Provider) was given a call and I was notified by my older sibling that the network was down which was good news to me. At least the DNS server is safe wherever they are. As soon as the internet was back up, I decided to look up DNS and discovered a whole lot of information on what happens when I try to connect to the internet after pressing Enter.

In this blog post, we will explore each step of this process and explain what happens behind the scenes.

DNS request

DNS stands for Domain Name System, which is a protocol used to translate human-readable domain names (such as www.example.com) into IP addresses (such as 192.0.2.1) that computers can understand.

A DNS request is a request made by a client computer to a DNS server to obtain the IP(Internet Protocol) address associated with a domain name. When a user types a domain name into their web browser, the browser sends a DNS request to a DNS resolver, which is a server that is responsible for resolving domain names into IP addresses. The resolver then sends the request to a DNS root server, which provides a referral to a top-level domain (TLD) server. The TLD server then refers the resolver to the authoritative name server for the domain name.

The authoritative name server is responsible for providing the IP address associated with the domain name. Once the resolver receives the IP address, it sends it back to the client computer, which then uses the IP address to establish a connection with the web server associated with the domain name. In this case, it is www.google.com .This process of DNS resolution is typically very fast and happens in the background without the user being aware of it.

TCP/IP

TCP/IP (Transmission Control Protocol/Internet Protocol) is a set of networking protocols that defines how data is transmitted over the Internet. It is a fundamental part of the Internet and is used to establish connections between computers, exchange data packets, and manage data flow.

TCP is responsible for breaking data into packets, sending them over the network, and reassembling them at the receiving end. It ensures that data is transmitted reliably, with error-checking and retransmission capabilities to ensure that data is not lost or corrupted during transmission.

IP, on the other hand, is responsible for the delivery of packets across the network. It provides addressing and routing functions, allowing packets to be directed to their correct destination. IP is responsible for the basic transmission of data, while TCP ensures that the data is transmitted reliably.

After the browser obtains the IP address of the server hosting www.google.com, it initiates a connection using TCP/IP.

Firewall

Before the request reaches the web server, it must first pass through a 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 private internal network and the public Internet to prevent unauthorized access and potential attacks.

There are different types of firewalls, including network firewalls, host-based firewalls, and application firewalls. Network firewalls are typically placed at the edge of a network and are used to protect the entire network. Host-based firewalls, on the other hand, are installed on individual devices and protect them from unauthorized access. Application firewalls are used to protect specific applications or services.

HTTPS/SSL

Assuming the request is legitimate, it reaches the web server. In the case of Google, it is a load-balanced network of servers that distribute the incoming requests. The browser initiates an HTTPS (Hypertext Transfer Protocol Secure) connection to the server.

HTTPS (Hyper Text Transfer Protocol Secure) is a protocol for secure communication over the internet. It is essentially the same as HTTP, but with an added layer of security provided by SSL (Secure Sockets Layer) or its successor, TLS (Transport Layer Security).

When you connect to a website using HTTPS, your browser and the website’s server negotiate a secure connection. This negotiation involves a process called the “SSL handshake”, which establishes a shared secret key between your browser and the server. This key is then used to encrypt all data sent between your browser and the server, including login credentials, credit card information, and any other sensitive information.

SSL/TLS works by using a combination of symmetric and asymmetric encryption. Symmetric encryption is used to encrypt data that is transmitted between your browser and the server, while asymmetric encryption is used to establish the secure connection and negotiate the shared secret key.

During the SSL handshake, the server sends a digital certificate to your browser, which contains the server’s public key. Your browser uses this public key to encrypt a random symmetric key, which is then sent to the server. The server uses its private key to decrypt the symmetric key and then uses it to encrypt all further communication with your browser.

Load-balancer

A load balancer is a tool used in computer networking that helps distribute traffic or workload evenly across multiple servers or resources. It acts as an intermediary between clients and servers, receiving requests from clients and forwarding them to different servers in a balanced and efficient way.

Load balancing can help improve the performance, availability, and scalability of web applications or services by ensuring that no single server becomes overloaded with requests. The load balancer monitors the health of each server and distributes the workload based on predefined algorithms, such as round-robin, least connections, IP hash, or other methods.

When a client sends a request to the load balancer, the load balancer uses its routing algorithm to select an appropriate server to handle the request. The load balancer then forwards the request to the chosen server and returns the server’s response to the client. If one of the servers fails or becomes unavailable, the load balancer can automatically redirect traffic to other available servers, ensuring that the service remains accessible and responsive.

In the case of Google, there are multiple load-balancers located in different data centers around the world.

Web Servers

The load-balancer forwards the request to a web server.

A web server is a software program that is responsible for processing and responding to client requests on the World Wide Web (WWW). It is the foundational component of web hosting infrastructure and plays a vital role in delivering web content to end-users.

When a user requests a web page or resource, such as an image or video, their web browser sends a request to the web server for that resource. The web server then processes the request and sends the appropriate response back to the client, typically in the form of an HTML page that can be rendered in the user’s web browser.

Web servers can be configured to serve static or dynamic content. Static content includes files that are served directly from the server’s file system, such as HTML, CSS, and image files. Dynamic content, on the other hand, is generated by a web application running on the server, typically using server-side scripting languages such as PHP, Ruby, Python, or Node.js.

Web servers can also be used to host various types of web applications, such as content management systems, e-commerce platforms, or social networks.

Application Server

In the case of Google, the requested web page is generated by an application server.

An application server is a type of software framework that provides a platform for running web-based applications. It acts as a middle layer between a web server and a database server, and manages the business logic and data access for the application.

When a user makes a request to a web-based application, the request is first handled by the web server. The web server then passes the request to the application server, which processes the request and retrieves the required data from the database server. The application server then returns the requested data to the web server, which sends it back to the user’s browser.

Database

Finally, the application server retrieves the required data from a database. A database is a structured collection of data that is stored electronically on a computer system. It is designed to efficiently organize, manage, and retrieve large amounts of data.

When data is added to a database, it is stored in a table or tables. Data can be added, modified, or deleted from a database using a database management system (DBMS) such as MySQL, Oracle, or Microsoft SQL Server. A DBMS is software that provides an interface between the user and the database, allowing users to create, manage, and interact with the data stored in the database.

A diagram showing what is happening

Conclusion

In conclusion, when you type https://www.google.com into your browser and press Enter, a complex sequence of events occurs. Through my time in ALX, I have had the opportunity to go through some of these steps and appreciate the pioneers of such a system. However, the world keeps on changing. At the moment, I cannot see major flaws with how the internet works, but I wonder, what change will take place in the next 3 to 5 years? We’ll wait and see.

--

--

No responses yet