What happens when you type https://www.holbertonschool.com in your browser and press Enter?
Xavier E. Figueroa Muniz
Software Engineer at Lockheed Martin | Bachelor's in Computer Sciences | Holberton School
We do it all the time while on the internet. We write down the URL (Uniform Resource Locator) for the website we want to visit like its completely normal and depending on your internet speed it can give you what you want in practically no time. But how does it actually work? How are we able to get the website that we want every single time just by entering the URL needed? In that short amount of time it can be surprising all the things that occur.
Understanding the Client-Server Model
In order to better comprehend everything that we will discuss it would be best to start by understanding the client server model. The client-server model is a structure that partitions or divides the different workloads and tasks into clients and servers. A client can be seen as a service requester while a server is a provider of the service being requested which also stores the data and manages most of the processing of this data. In essence the way the internet would work when it comes to looking for a website would be the same since the user's computer or browser (for example) is the client and the computer program serving data as well as the physical machine on which the server program is running is the server. Each service may have multiple servers at disposal working behind the scenes to perform the tasks and processes requested by the client.
URL to IP Address
It would be best to start off by clarifying that the actual "name" or way to identify one website from another is through a designated IP Address. Which in very short terms is a string of numbers and periods that helps differentiate one site from another.
"An IP address is a unique address that identifies a device on the internet or a local network. IP stands for "Internet Protocol," which is the set of rules governing the format of data sent via the internet or local network. In essence, IP addresses are the identifier that allows information to be sent between devices on a network: they contain location information and make devices accessible for communication. The internet needs a way to differentiate between different computers, routers, and websites. IP addresses provide a way of doing so and form an essential part of how the internet works." - https://www.kaspersky.com/resource-center/definitions/what-is-an-ip-address
So lets start of from the very beginning. First off a person (or user) types down the URL of the website wanting to visit into its preferred web browser on his/her computer (which can be considered the client for this example). Computers and other devices tend to communicate with each other using IP addresses that help to identify from one and another. Due to the users (humans) being unable to memorize every single IP address there is then it is easier to work with words that make sense to us. Now before getting into the website we must convert a URL into an IP address and that is where the DNS comes in.
When we type https://www. holbertonschool.com and press enter the DNS (Domain Name System) will translate human-adapted, text-based domain names to machine-adapted, numerical-based IP. But before doing so we need to divide things up in steps.
TCP/IP
We have obtained the IP Address for https://www.holbertonschool.com we proceed to connect and request the website but in order to do so there are some protocols we have to follow. TCP/IP (Transmission Control Protocol/Internet Protocol) is a set of standardized rules that define how servers and clients interact and communicate over the network (internet). We already covered IP and how it obtains the address to which we send and receive data. On the other hand TCP is in charge of how the data will be delivered, received, ordered and broken into packets and checked for errors in the network.
领英推荐
Firewall
Protocols aside, part of the process of when servers and clients interact is going through the firewall. The Firewall is a network security software or system that is designated to prevent or prohibit unauthorized access to a part of a network. If we continue with our example, part of the process of connecting and interacting between the user and the server that has the content for https://www.holbertonschoo-l.com is going through the firewall for security purposes.
HTTPS/SSL
We have discussed the DNS, TCP/IP and Firewall yet the browser up until this point has only covered the domain-name, top-level domain and sub-domain. HTTPS or HyperText Transfer Protocol Secure is a secure version of HTTP in which the communications between client and server are encrypted. Basically the https:// stands for this. This transfer protocol defines different types of requests and responses served to clients and servers over a network such as confidential online transactions.
Another main component from this type of protocol when it comes to securing websites is the SSL certificate. SSL stands for Secure Sockets Layer, also known as TSL (Transport Layer Security). The certificate needs be issued from a trusted Certificate Authority. When a website has this certificate, we’re able to see depending on the browser a lock icon alongside the URL or the search bar may turn green.
Load-Balancer
Depending on the website there is a probability that it can have either one or multiple servers working at the same time. The reason for this would be for a way to control server traffic, attacks on a server or any other situation that may occur that can potentially harm a server. In order to avoid having a Single Point of Failure (SPOF), it is highly recommended to have a various servers that are being managed by a load-balancer. A load-balancer is a software that balances and distributes network requests or traffic between several servers, following a determined load-balancing algorithm. Examples of an algorithm would be one that which distributes traffic alternating between all the servers evenly and consequentially, or one that distributes traffic depending on the current server loads.
Server
Finally! We got past security and the load-balancer was able to distribute our request to an available server. But what now? Server can consist of a very general term when it comes to this process and how it works. Websites consist of static and dinamic content that help the user interact with the website and the information. As for the information itself it is stored inside a database. So we would need to cover these three components of a overall server.
With all this we can now have a general understanding of what happens behind the scenes when you type https://www.holbertonschool.com in your browser and press Enter. And more surprisingly is that depending on your internet connection speed this all can be done in second or less. Web Stack developent is very interesting and consists of various layers from which we are just getting started. This blog is purely for the understanding of these concepts and I take no credit whatsoever from the images used here. Nonetheless happy coding.