What happens when you type in an URL in your browser and press Enter.
What happens when you type in an URL in your browser and press Enter

What happens when you type in an URL in your browser and press Enter.

Let's imagine … You request some web page in your browser, for example holbertonschool.com and press Enter.

No alt text provided for this image

How does a DNS request work? Why do we use the TCP/IP connection ? What do we need for the Firewall ? Why is the traffic served over HTTPS ? What is the role of the web-server ? What is the application server and why do we need it ? Database, what for ?Let’s discuss all these questions step by step.

First, what is the role of the domain name holbertonschool.com ?A domain name is an identification string that defines an autonomy and authority within the Internet. Domain name identifies a network domain, represents an Internet Protocol (IP) resource. They are formed by the rules and procedures of the Domain Name System (DNS). Any name registered in the DNS is a domain name.

How DNS works ?

Computers and other devices communicate using IP addresses to identify each other on the internet. DNS (Domain Name System) is the technology that translates human-adapted, text-based domain names to machine-adapted, numerical-based IP.

Humans can’t remember IP addresses so they use words like holbertonschool.com. Then the Domain Name Systems brings you and get you to your destination.

After entering www.holbertonschool.com and hitting "Enter", the computer immediately needs to resolve the Fully Qualified Domain Name (FQDN) to an IP Address. 

Fully Qualified Domain Name (FQDN) - is the complete domain name for a specific computer, or host, on the internet. The FQDN consists of two parts: the host name and the domain name. For example, www.holbertonschool.com is the FQDN on the web for Holberton School. In this case, www is the name of the host in the holbertonschool.com domain.

The DNS Resolver  is usually your internet service provider. Its job is to know where in the world locate the root server.

  1. DNS Resolver will prepare a DNS Query. This is a request from a DNS Client to a DNS Server to ask for the IP Address related with a Fully Qualified Domain Name (FQDN).
  2. DNS Resolver will send DNS Query to the IP Address of DNS Server, configured in TCP/IP (Transmission Control Protocol/Internet Protocol) configuration settings.
  3. After receiving the DNS Query from DNS Client, DNS Server will perform the name resolution steps
  4. Finally will send a DNS Reply back to the DNS Client. If the name resolution process was successful the DNS Reply will contain the answer for the DNS Query.

Why is the traffic served over HTTPS ?

We request a HTTP connection to www.holbertonschool.com. You will see a padlock icon in the browser address bar.

No alt text provided for this image

It means that you use a secure connection. Information which you give to this internet-site, for example, passwords and your bank card numbers are protected. This internet-site has a valid SSL certificate.

  • After hitting Enter the website www.holbertonschool.com will send its SSL certificate to your browser. This certificate contains the public key. A public key is needed to begin the secure session.
  • After your browser and the website will initiate an exchange of information usually called the 'SSL handshake'. During this exchange will be generated some common technical agreements about establishing a secure connection between your and the website.

Why do we use TCP/IP and how it works ?

TCP and UDP are the 2 mainly used data transfer protocols for IP. Requests and responses will be sent using TCP/IP connections between client and server. 

TCP/IP by devices to communicate over the Internet and most local networks. TCP provides applications a way to deliver and receive an ordered and error-checked stream of information packets over the network.

When you request a web page www.holbertonschool.com in your browser, your computer sends TCP packets to the web server’s address. Your computer asks this way to send the web page back to you. The web server responds by sending a stream of TCP packets. Your web browser stitches them together to form the web page. When you click a link, sign in, post a comment, or do anything else, your web browser sends TCP packets to the server and the server sends TCP packets back.

 TCP is all about reliability—packets sent with TCP are tracked. It means that no data is lost or corrupted in transit. This is why file downloads don’t become corrupted even if there are network hiccups. 

TCP achieves this in two ways: 

  1. It orders packets by numbering them.
  2. It error-checks by having the recipient send a response back to the sender saying that it has received the message. If the sender doesn’t get a correct response, it can resend the packets to ensure the recipient receives them correctly.

Why do we need a Firewall ?

A firewall is a division between a private network and the internet. The task is to manage traffic passing between the two networks. Firewalls allow, limit, and block network traffic based on configured rules in the hardware or software. It analyzing data packets that request entry to the network. It is useful for allowing remote access to a private network through secure authentication certificates and logins.

A hardware firewall protects your network from the external environment with a single physical device. This device monitors packets of data as they are transmitted and then blocks or transfers the data according to predefined rules.

Web-server, application server, data base, load balancer... Why do we need them and what are they used for ?

A web server is a server software, or a system of one or more computers dedicated to running this software. That can satisfy client HTTP requests on the public World Wide Web or also on private LANs and WANs. It delivers web pages. It can manage client HTTP requests for web resources. So, web server will deliver the page holbertonschool.com. 

 A web server usually receives incoming network HTTP requests and sends outgoing HTTP responsesOne for each processed request with web contents. Requests and responses will be sent using TCP/IP connections. TCP/IP connections are started by client user agents before sending their HTTP request(s). User agent is any software, acting on behalf of a user. Web browsers are the user agents.

The purpose of a web server is to store and deliver web contents and / or web resources. Examples of web contents may be HTML files, XHTML files, image files, style sheets, scripts, other types of generic files that may be downloaded by clients, etc.

A web server can be used to serve either static or dynamic content:

  • Static content refers to the content being shown as is.
  • Dynamic content can be updated and changed. 

A static web server will consist of a computer and HTTP software. It is considered static because the server will send hosted files as is to a browser.

Dynamic web server will consist of a web server and other software such as an application server and database. It is considered dynamic because :

  • the application server can to update any hosted files before they are sent to a browser.
  • the web server can generate content when it is requested from the database.

Load balancing is the process of distributing a set of tasks over a set of computing units. The aim is making their overall processing more efficient. A load balancer is a device that distributes network or application traffic across a number of servers. Load balancers are used to increase capacity and reliability of applications. 

In my case load balancer is configured with a Round Robin algorithm. Requests are served by the server sequentially one after another. After sending the request to the last server, it starts from the first server again. This algorithm is used when servers are of equal specification and there are not many persistent connections.

To view or add a comment, sign in

More articles by Natalia Ponsard

Explore content categories