What happens when you type google.com in your browser and press enter?
First, we can start to review some concepts:
- The Domain Name System (DNS) is the hierarchical and decentralized naming system used to identify computers, services, and other resources reachable through the Internet or other Internet Protocol (IP) networks. The resource records contained in the DNS associate domain names with other forms of information.
- DNS Request: request to ask to a server if the IP of DNS Request = IP of the server
Let’s start:
1. We search for the IP address in the DNS
First, we type “www.google.com” in our browser and this goes to the DNS to have the IP associated with the domain with a DNS request. For this example, we can see that this is the IP address for www.google.com
2. We make a request to the server of the IP address correspondent:
The browser make a “GET request” to the port:443 because we are using “https”, for this case the server must have a SSL encryption certificate with the domain to start to communicate securely. The answer that recive our curl should be the code 200 like we see in the Inspect/Network:
Also it is important to know that we have another request methods that we can ask:
- GET
- POST
- PUT
- PATCH
- DELETE
- OPTIONS
3. Establish TCP/IP
Let’s review a little the TCP:
We can see that the connection in three steps: SYN, SYN-ACK, ACK
Another protocol also that runs is the HTTPS with SSL Hanshake. Learn more in this link: https://www.ibm.com/docs/en/cics-tg-zos/9.3.0?topic=ssl-how-connection-is-established
4. The server respond! and the communication start
So we can detail this process like the picture & description below:
- The request goes to the load balancer
- The firewall will check the request and if all is in order, pass
- The load balancer check if there are a sessions save in the cache or with the algorithm correspondent goes to the server
- The request goes to the server
- The server respond with a respond header like the picture below (this is taken in the inspect/network section)
Finally we can check that the communication between the browser and server is done like this image:
5. Finally the browser take the response and renders the content ;)
The browser takes the HTTP Respond message, call the CSS styles corespondent, images other contents and finally we can see the webpage that we usually see when we navigate on the web ;)
I hope that you are delighted for this post and now increase your knowledge about how the internet works! See you around & happy coding :)!
Kate