What happens when you type www.google.com in your browser and press Enter
Hello everyone, Let's take a quick look at what happens behind the scene when you type www.google.com on your web-browser, all we just see is the google search page in an instant or split seconds. Have you ever imagined how the process or how you get the page. Lets break the process into factions for your understanding.
STEPS:
- DNS
- TCP/IP
- Firewall
- HTTPS/SSL
- Load-balancer
- Web server
- Application server
- Database
1. DNS:
When you enter www.google.com on the browser it goes through a process, Your computer or the internet do not understand human language which is “www.google.com” so DNS which means Domain Name Server was established to translate the human readable address to the computer understandable language which is IP address. Now the DNS take the human readable address to the Recursive Domain Name Resolver (RDNS) which is controlled by the ISP it primary goal is to serve the IP address. The DNR goes through the browser cache to see if it has that IP address pointing to www.google.com, if it has it serves it back to the browser and if it does not it goes to the Root Name Sever which hold the address of TLD “Top Level Domain” like .com, .net, .org
it ask give me the IP address of www.google.com but TLD looks at the address and see it is top level domain and point the Domain Name Resolver to the Authoritative Name Server it knows everything about the domain name and IP address so it returns back to the Recursive DNS server
2. TCP/IP:
This is Transmission Control Protocol/Internet Protocol a level 4 Transport Layer protocol used to connect two interactive system or machines together in a private network either internet or extranet. It allows for a secure share of data between the two interactive system. Now when the browser gets the IP address of the web server to connect to. An authorization need to happen between the two systems an handshake is made between the two system so subsequent connections can happen smoothly and transfer of data are reliable and fast. With the IP address of the web server obtained through DNS resolution, the browser establishes a TCP connection to the server. This connection is established using the IP address and the port number associated with the specific service (e.g., port 80 for HTTP or port 443 for HTTPS).
3. Firewall:
Firewalls are indeed used for security between the client and the web server. They can be hardware or software-based and are configured to allow or block traffic based on predefined rules. While firewalls can indeed filter traffic based on geographic location, they primarily filter based on criteria such as IP addresses, ports, and protocols. They also provide features like intrusion detection and prevention. Let say for instance you want only people from Nigeria to visit your website you set a firewall to block every traffic that comes from other countries and allow those from Nigeria only , it is also used to track the connection
4. HTTPS/SSL (Hypertext Transfer Protocol Secure/Secure Sockets Layer):
HTTPS encrypts the data exchanged between your browser and the web server, ensuring privacy and security. SSL/TLS certificates are used to establish this secure connection. Http routes on port 80, and https on port 443, SSL is a depreciated level of security and TLS is the new level of security
When you connect to a website using HTTPS, your browser and the server negotiate a secure connection, encrypting data like login credentials and credit card information. We are telling the server we want a secure connection the load balancer takes the request and encrypts it sends the request to the server the server decrypts it and send the necessary response back to the load balance which also encrypts the response and send its to the browser. mind you after the connection of TCP/IP the browser and server agreed on a session key to use in encrypting and decrypting
5. Load Balancer:
Load balancers distribute incoming network traffic across multiple servers to improve responsiveness and availability of websites and applications. They monitor the health of servers and can route traffic away from servers that are overloaded or experiencing issues. Now when your request has been made the load balancer intercepts the traffic and reroute it to a specific web server using an algorithm specified either round robin or least connection to reduce the load on the web server.
6. Web Server:
The web server is responsible for serving web pages to clients (browsers). It receives requests over the internet, processes them, and returns the requested resources (HTML, images, etc.) to the client. When the load balancer send the request the webserver who receives the request go through the request and server the static web page if its a static page without business logic, if it entails business logic the web server connects the request to the application who is responsible for dealing with dynamic web page and business logic.
7. Application Server:
Some cases, especially for dynamic websites or web applications, an application server may be involved. This server runs the application code (e.g., PHP, Python, Java) and generates dynamic content based on user requests.
8. Database:
The website or application requires data storage and retrieval, a database server is involved. This server manages the storage, organization, and retrieval of data requested by the application server.