Mechanisms Behind Our Daily Internet Interactions.
Table of contents
Have you ever wondered what happens when you type: https://www.google.com in your browser and hit Enter?
In this article, we will look at the mechanisms that power our daily internet usage and interactions when surfing different webpages. We will try to cover concepts such as:
How web browsers handle or send DNS requests
The use of TCP/IP Protocol
The use of firewalls in securing web packets
How HTTPS/SSL differs from HTTP
Load-balancer and balancing mechanisms
What is a web server and its usage in web infrastructure
The use of application and database servers
Now, let us begin discussing our topics:
https://www.google.com is the URL (Universal Resource Locator) that points to the computer server hosting the internet resources you want to access. When you type that URL, a complex series of events occurs to retrieve and display the webpage. This process involves multiple layers of technology and communication protocols. The first step is to handle or send a DNS request.
DNS Request
A DNS (Domain Name System) request, also known as a DNS query, is the process by which a computer or other device asks a DNS server to resolve a domain name into an IP address. When you type a URL like "https://www.google.com" into your browser and press Enter, the browser needs to convert this human-readable address into an IP address that computers can use to communicate with each other. This process of translation and lookup is called DNS resolution.
TCP/IP Protocol (Transmission Control Protocol and Internet Protocol)
Once the web browser gets the IP address for Google's server, it will start to establish the connection with the server using the TCP/IP protocol. TCP establishes a reliable connection between your machine and Google's server, ensuring data integrity and order. IP, on the other hand, is responsible for routing the data packets to the correct destination.
Load Balancer
As soon as the connection is established, the browser (client) and Google’s website (server) can communicate with one another over the HTTPS protocol. A load balancer warmly welcomes the packets. Its job is to distribute incoming network traffic across several servers to ensure no single server becomes overwhelmed with too much traffic. This way, it ensures a seamless user experience and reduces the Single Point of Failure (SPOF). A load balancer can be configured with different mechanisms, one being round-robin, which distributes the incoming packets sequentially in the cluster of servers.
Firewall
These are security systems that monitor and control incoming and outgoing network traffic based on predetermined security rules.
The firewall checks the outgoing request from your browser to ensure it's permitted.
It also checks incoming responses from the Google server to ensure they are safe and allowed.
If all checks pass, the request and response are allowed through.
HTTPS/SSL
This is the protocol that establishes secure communication between the web browsers and Google servers. The protocol defines different types of requests (e.g., GET, POST, and PUT) and responses secured by a standard security protocol, Secure Sockets Layer (SSL), that encrypts and decrypts data traffic between the client and the server infrastructure at the load balancer.
The browser requests a secure connection by sending a message to the Google server.
The server responds with its SSL certificate, which contains its public key.
The browser verifies the certificate against a list of trusted Certificate Authorities (CAs).
Once verified, the browser and server establish an encrypted connection using symmetric encryption, where both parties share a secret key. This is crucial because it ensures that no third parties can interfere with or tamper with the information served by the server to the client, especially when making online payments and sending sensitive information.
Web Server and Application Server
Post load balancing, the web servers take the stage. They usually deliver static content, like HTML pages, images, videos, and files. A web server can decide what action is needed, often communicating with an application server to process the request further. An application server also handles HTTP requests but is not limited to HTTP protocol only since it can work with other protocols and interact with DBMS to serve business logic.
image source: https://i.sstatic.net/qCgzQ.gif
Finally, the desired webpage graces your screen, and the user can view the requested content.
The web server sends the final response back to the browser through the load balancer and firewall.
The browser receives the response, which typically includes HTML, CSS, and JavaScript.
The browser parses the HTML to build the DOM (Document Object Model).
CSS is applied to style the content, and JavaScript is executed to provide interactivity.
The rendered webpage is displayed to the user.
Conclusion
The entire process can take anywhere from about 150 milliseconds to several hundred milliseconds, depending on various factors such as network latency, server load and performance, complexity of the SSL/TLS handshake, and content of the webpage. However, web browsers and DNS servers employ caching mechanisms, which can significantly reduce the need to repeatedly resolve domain names and fetch resources.
Subscribe to my newsletter
Read articles from Mark Shija directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by