Millions of people type URLs into their browsers every day, yet little is known about what actually occurs behind the scenes.
This article’s goal is to clearly describe what happens in the background when you enter a url into your browser. So without further ado, let’s dive into this voyage step by step!
Browser looks up domain IP addresses
Just as anyone setting out on a journey must first know where they are going, the same is true for your browser, which must first determine the IP address of the server hosting the website. This is accomplished through the use of a DNS query, in which your computer (DNS client) requests the IP address of the domain name from a DNS server.
How we get there: The TCP/IP connection
It is now time to establish a connection with the IP address, which is done by adhering to the HTTPS protocol specified in the URL. This protocol, which is a secure variant of the Hypertext Transfer Protocol (HTTP), is a component of the Transmission Control Protocol/Internet Protocol (TCP/IP) protocol family.
TCP/IP uses a procedure known as the TCP 3-way handshake to establish the connection between two hosts (the client and the server). This when the client and the server both synchronize or SYN, and acknowledge or ACK, one another. The first SYN packet contains the initial sequence number that the client chooses. Additionally, the server selects its own beginning sequence number, raises the client’s SYN number, sends the SYN/ACK packet, and waits for the client to ACK before raising the client’s SYN number, then the TCP socket connection is established.
Connection Refused? — The Firewall
**Firewalls are designed to restrict incoming and outgoing traffic. **It is intended to thoroughly examine incoming communication in accordance with pre-established rules and filter traffic from untrusted or dubious sources in order to thwart assaults. The firewall evaluates each user request, and if it isn’t malicious or suspicious, it permits the connection to the load balancer-assigned web server. If the connection is blocked then there will not be an exchange of data over the network.
Websites, as I previously mentioned, are stored on servers. And your browser and the servers exchange data through the HTTPS protocol after the connection has been established. Everything has been running smoothly up until now, but what if the server suddenly receives a large number of requests?
Without a load balancer, a website that receives a lot of requests from users will experience downtime and have a single point of failure (SPOF). A load-balancer is a software program that distributes network requests between the different servers associated with it, based on a load-balancing algorithm like the most common, the round-robin, that distributes the incoming load alternating between all the servers evenly and consequentially. So in order to improve the performance of the website, numerous servers must be implemented. Then, using a load balancer, user requests are distributed among the servers.
At this point your request is at google’s web servers. A web server just manages HTTP/HTTPS requests and serves static content, including plain text files, pictures, and simple HTML pages. Web servers like Nginx or Apache are two examples.
Behind a web server and in front of a database management system runs an application server. Its fundamental objective is to produce dynamic content that supports the creation and delivery of applications by giving them the business logic they need.
Using these two sorts of servers, your response is then generated and sent to your browser, which then displays it.
The Database Management System (DBMS), is a program that enables interaction with databases — organized collections of structured data stored in computer systems — to define, manipulate, retrieve, and manage the data in response to requests. In this case, the database will provide the user with any information he requests from google.com and preserve any information, such as account creation information.
After you type in a URL into your browser and press Enter, the browser conducts a DNS query to determine the domain name’s IP address. Following the discovery of the IP, the browser establishes a TCP/IP connection, the firewall analyzes the request, and the load balancer distributes it to the web server and application server which then sends back your response.
And that’s all! Wasn’t the voyage hectic but exciting? The “tricks” concealed behind a website search on your browser are now known to you. Every step that was outlined is the same for every working website, thus if you try it with one and there is a component missing, you will likely get an error message rather than the website you were looking for.