What happens when you type holbertonschool.com in your browser en press Enter

Erika Osorio Guerrero

--

Have you ever wonder how the information you are looking for, when you type it in the browser gets back to you? Where does it come from? Well i am going to take you to a journey today so, you actually get to see how much you request and responses travels through the internet, so let’s do it

First of all let’s assume we are going to type this address for the first time, and for better purposes of the explanation, we are going to do this example with a brand new computer. before starting let's have clear some key words to understand this journey

Key words

URL → Uniform Resource Locator, and the parts of the URL in the image

Cached → It is hardware or software component that stores data so that future requests for that data can be served faster

DNS (Domain Name System)

Root server → sits at the top of the DNS (Domain Name System). This server knows the IP addresses of the TLD (Top level Domain) servers. The representation of the root is the “.”

TLD server (Top-level Domain)The coordination of most top-level domain belong to the internet corporation for Assigned Names and Numbers ICANN. [.COM TLD] was one of the first created at 1985 and today is the largest TLD on the Internet. There are different types of TLD, some include .NET .ORG .EDU which are type Generic TLD.

Authoritative Name server (Name server)

It is the responsible to give answers only to queries about domain names, It means when the authoritative name server receives a request about a specific name, it will respond with the IP address of that specific name

Hierarchy of the DNS

Now lets start with:

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

The first thing that happens when you type https://www.holbertonschool.com and hit enter, your browser will look at its cache to see if, as a previous search was made to this URL. Because we said before this is a brand new machine and was the first time searching for this URL, is obvious that in the browser’s cache there is not any information related to it,

So the the next step for the browser is to look at the OS of the computer more exactly will look at the /etc/host files, and look at any IP address associated with the one the browser is looking for. Because there is nothing in that file the next step that the browser will do is to ask the DNS (Domain Name Server)

When the browser ask the DNS system for the IP address of the URL we enter, the DNS server will take the responsibility to figure out what is the IP address for that domain, using specifically the “RESOLVER server”. First It will look at its cache, and when there is not any positive result, then a hole new journey will happen in the DNS system, The resolver has the very important task of finding the IP address, but one thing the resolver must know is where to locate the “ROOT SERVER”. The Resolver server is usually your ISP (internet service provider), So Let’s start with this trip through the DNS system.

AS we explain before, the resolver, didn't find any information in is’t cache, so the next step is to ask to a very important server, the “ROOT server” about the IP address of the URL we are looking for, this server doesn’t know the IP address of our URL but instead it knows the address of all servers call “TLD server” (Top-Level Domain) and will help us to go to the right path, In this case the TLD will be the “.COM TLD”.

The RESOLVER then will go to the “.COM TLD” server and will ask for the IP address of the URL; the answer to the resolver is not the IP address, but instead will be the IP address for the “Authoritative Name Servers”. Usually there is more than one name server attached to any domain, and they will be the servers that will know the IP address of “holbertonschool.com.” When the resolver gets to one of the Name servers, and ask for the IP address of the domain name, finally It will get the response back, the IP address of holbertonschool.com which is a number like 125.43.43.2. All this information will be saved in the resolver Cache so next time you search for the same domain name, the resolver will response as quick as it can, and avoid to have this fun but long journey again, and the browser will do the same thing as well. All this travel seems like long time, but takes about milliseconds to be completed.

Finally when the Resolver retrieves the IP address to the browser, it will make a request connection to that specific IP address and the response will get back to you in a blink.

DNS request

Domain Name System is a naming system for Computers.

Computers and other devices communicate using IP (Internet Protocol)addresses (eg.10.10.10.1) to identify each other on the internet, but for humans its very difficult to remember this numbers, so we use Words (Host-names) that relate to that specific IP address like a phone Notebook; where we save a contact by its name and phone number. The Domain name system brings the IP address and the domain name together, so we are able to get the information we were looking for. When we type in the browser holbertonschool.com, and if neither the cache of the browser or the OS have any information related to it, that is when the browser makes a request to the DNS, and the hole journey we explained earlier occurs with the resolver.

DNS is like A phone Book number but with IP address

TCP/IP

Transmission Control Protocol/ Internet Protocol is a suite of communication protocols used to interconnect network devices on the internet. The entire Internet Protocol suite — a set of rules and procedures — is commonly referred to as TCP/IP.

“TCP/IP specifies how data is exchanged over the internet by providing end-to-end communications that identify how it should be broken into packets, addressed, transmitted, routed and received at the destination. TCP/IP requires little central management, and it is designed to make networks reliable, with the ability to recover automatically from the failure of any device on the network.”TCP/IP (Transmission Control Protocol/Internet Protocol)

The two main protocols in the Internet Protocol are TCP and IP

TCP defines how applications can create channels of communication across a network (Ports). It also manages how a message is assembled into smaller packets before they are then transmitted over the internet and reassembled in the right order at the destination address.

IP defines how to address and route each packet to make sure it reaches the right destination. So the IP layer will attach the origin and destination IP addresses to each packet so de package know where it comes from and where is going

The following image, is the representation of layers of TCP/IP model

Firewall

Is a Network security system that monitors outgoing and incomming network traffic base on predetermined security rules. It is a barrier to keep destructive forces away from your property. A firewall Could be a Software or Hardware and there are two types:

  • Network-based protect a network, the firewall is located within the LAN and WAN.
  • Host-based firewalls are deployed directly on the host itself to control network traffic or other computing resources. This can be a daemon or service as a part of the operating system or an agent application for protection.
Example of network-based

HTTPS/SSL

HTTPS (Hypertext Transfer Protocol Secure) Is used by browser and web servers to transfer encrypted data, this is a way of exchanging private data in a safe way, you can see if the web page you are visiting is safe, by looking in the browser search, where there must be a lock icon. HTTP protocol instead is a version that is not secure to exchange data and browser now days will warn you with a message.

But then how are some web sites secure, and some others not?

This is where SSL plays a important role around the internet.

SSL stands for secure Sockets layer, and basically is a certificate for the web page that identifies the web page as safe to transfer any private data.

“Initially, a secure session is established via a “handshake”, an automated process of negotiation between the server and your browser. Your data is being encrypted in a way that only the intended recipient can understand it. This is all very important because the information that is being sent through the web is being passed on different servers and all your data would be very easy to steal (passwords, credit card numbers, etc.) if it is not encrypted with a SSL certificate.” — Why do you need a SSL Certificate by Damien Jordan April 4th, 2018

Load-balancer

Its a server that distributes the traffic to the available servers. Load balancing is a key component of highly-available infrastructures commonly used to improve the performance and reliability of web sites, applications, databases and other services by distributing the workload across multiple servers.

Load balancer can be configure depending of the needs using different load balancing algorithms, including “round robin”, that sends one request to each server in order one by one.

Web server

Is a software that servers web pages to clients, upon their request, is does it over the protocol HTTP or HTTPS. Web servers usually servers Static content; but web pages also can have dynamic content. An example of web server is Nginx and it will explain the concept as follows:

“The content of most web pages is encoded in Hypertext Markup Language (HTML). The content can be static (for example, text and images) or dynamic (for example, a computed price or the list of items a customer has marked for purchase). To deliver dynamic content, most web servers support server‑side scripting languages to encode business logic into the communication.”

Application server

Serves business logic to application programs, it collaborates with the web server to return a dynamic, customized response to a client request but also interact with your database. This servers are responsable for handling enterprise features, transactions and queuing, multi-channel communication.

Database

Database are used to store and manage databases that are stored on the server and to provide data access for authorized users. This type of server keeps the data in a central location that can be regularly backed up. It also allows users and applications to centrally access the data across the network

servers will have your one or more database hosted such as Oracle, SQL Server, MySQL,

In a master-slave model, database master servers are central and primary locations of data while database slave servers are synchronized backups of the master acting as proxies.

Example of web server, app server and database server

Resources

[What is a web server by NGNIX https://www.nginx.com/resources/glossary/web-server/]

[Why do you need a SSL Certificate by Damien Jordan April 4, 2018 https://www.websitepulse.com/blog/why-do-you-need-a-ssl-certificate]

[TCP/IP (Transmission Control Protocol/Internet Protocol) by Margaret Rouser https://searchnetworking.techtarget.com/definition/TCP-IP]

--

--