What happens when you type holbertonschool.com and press ‘enter’ ?

Ahlemkaabi
7 min readSep 5, 2021
Typing holbertonschool.com

Hello everybody, today’s topic is about the web stack, we will try to make it easy for you to understand it or if you have an idea we hope this blog give you more knowledge.

Every time we ask the browser for a web page we just type the domain name and some magic happens and TADAA here is our page !

But is it really magic!

Let’s talk more deeply and see what’s really happening?

DNS Request

you first need to know that when you connect to the internet your laptop (or the devices that you are connected on ) will have an IP address (internet protocol address) so that you can be part of the internet network.
that IP address is given by the ISP -the internet sevice providor.

Now you’re in the network!

when you type holbertonschool.com here is the situation!

domain: holbertonschool.com
protocol: http or https
port: 80 for http or 443 for https
IP address: ?????? to be found using the DNS.

the browser look into the cache for a DNS record that will take him to the right IP address that host your desired web page since the host is a web server connected to the internet network.
As we mentioned before every connected devise should have a unique IP address in order to be reached.

Before we move on, let me briefly explain what is the DNS and how does it works?

It all starts with a Domain Name System Query sent by your browser!

The DNS is a phonebook of the internet. Human interact with the internet through domain names while the browsers search for information in the internet using the Internet Protocol address.
DNS translates the Domain Names (holbertonschool.com, google.com) to an IP address.

check for holbertonschool.com IP address

The translation involve 4 servers to find that unique IP address for the web page.

DNS and how does it works

The local DNS server is also called the resolver!
1- The computer send a DNS query to the local DNS server to translate the domain name.
2- The local DNS server send a DNS query the Root DNS server asking for the location of the Top Lever Domain server.
3- The Root DNS server will response with the location of the TLD DNS server
4- The local DNS server send a DNS query the TLD DNS server asking for the location of the Authoritative DNS server.
5- The TLD DNS server will response with the location of the Authoritative DNS server.
6- the local DNS server send a DNS query to the Authoritative DNS server to find the correspond IP address.
7- The Authoritative DNS server will check within its database and find that IP address and reply to the local DNS server
8- The resolver will know the IP address of holbertonschool.com and will send it back to the user’s computer browser.

What is the cache ?
Briefly the cache is used in order to not repeat the whole process of the DNS when looking for an IP address, every time you ask for an IP address it will saved in the cache!

The browser actually checks for the DNS record in 4 caches:
1- The browser cache
2- The OS cache
3- Router cache
4- The ISP cache (the Internet Service Provider)
If it doesn't find it in one of these caches then it will go through that previous process of looking for the IP address.

TCP/IP

Once the browser get the IP address, now it’s time to connect to that IP address.
So before systems can exchange HTTP or HTTPS messages, they must establish a TCP connection (Transmission Control Protocol).
The TCP uses a technique known as positive acknowledgment with retransmission.
The connection is established and a 3-way handshake is made. First, the source sends a SYN request packet to the server in order to start session establishment process. Then, the server sends a SYN-ACK packet to agree to the process. Lastly, the source sends an ACK packet to the target to confirm the process, after which the data can be sent. source here.

HTTPS/SSL

Now it is time to start sending messages. Our browser could send an HTTPS Get request to the server!

HTTPS : Hypertext Transfer Protocol Secure
SSL : Secure Sockets Layer: it’s the standard technology for keeping an internet connection secure and safeguarding any sensitive data that is being sent between two systems.

In HTTPS, the communication protocol is encrypted using formerly SSL. The protocol is therefor referred to as HTTP over SSL.

source

Firewall

The web is not safe, and security is what we worry about as developers, and firewall is our best friend. Now is the role of the firewall to decide whether our request continue her path or not.
How does a firewall works ?
First there is some rules that firewall follows. it allow or bloc specific data packets. A firewall works like a traffic guard to computer entry point, or port. Only trusted sources, or IP addresses, are allowed in.

Load-balancer

You need to know that generally the host of the domain name that you’re trying to reach, is not the first one to connect with, there is the load-balancer server first, which will transfer your request to the web server.

What is the role of the load balancer?
The load-balancer is like a “traffic cop” , it distributes the network or application traffic across a number of servers. (Yes! we could have multiple web services for high traffic web sites)

Web server

Now that our connection is established and secure, the HTPPS Get request passed through the load-balancer safely to the web server and then it will serve us the web page and reply with the right HTPPS response.

The web server main job is to accept requests for static content from a web site(HTML pages, files, images, videos, etc..).

But what if the HTTPS request was for some dynamic content, here comes the role of the load-balancer which will decide where the request will pass.
In this case an application server is the next destination.

Application server

application server is designed to run applications. It includes both hardware and software that provides an environment for program to run.
It generally handles the business logic of a web application.

Application servers consist of a web server connectors, computer programming languages, runtime libraries, database connectors, and the administration code needed to deploy, configure, manage, and connect these components on a web host.

The application server handles requests which create dynamic pages. So instead of serving an HTML page that is stored on the hard drive, they dynamically generate the HTML sent to the end user.

Database

We can’t talk about all the previous without mentioning the database .
A database is a structured collection of information, or data. It is usually controlled by a database management system (DBMS). Together, the data and the DBMS, along with the applications that are associated with them, are referred to as a database system, often shortened to just database.

Thank you for your reading, enjoy your journey of learning and best of luck!

REFERENCES

--

--