Do you know what happens when you type a web page in your browser and hit enter? Summary explanation of the internet for novice programmers

Jaime Andrés Aricapa Pérez
8 min readSep 1, 2021
Holberton’s Main Page

As the humankind evolved, their tolls required to survive evolved too. One of them is the communication, one of the most significative inventios for the progress, because with it we can transfer all kinds of information. In recent years, this communication has advanced to the next level and it is imperative to do so through the global network that we call the internet.

If you see this post, you are using internet to get knowledge through the communication between the reader and the writer, which is an excellent example of the importance of communication between humans. It’s easy to see how it works between us, but do you know how it works between computers? How can a computer on one side of the world connect with another computer on the other side of the world? How can they understand each other despite the linguistic differences of their users?

The above is generally answered with the use of languages ​​applied to computers, that is, it is the same communicative principle but used to translate human language into machine language. Of the many languages ​​that are used between computers, they all master a particular one, which allows them to talk to each other anywhere in the world. and that language is what allows the internet to exist.

Based on that previous idea, it is time to talk about how the internet works and how it makes communication between computers possible. In general terms, when you type the address of a web page (like holbertonschool.com for example) in your browser, you are making a request, which is interpreted by the DNS that looks for the site that has the information, then the load balancer acquires it; this in turn directs this request to a server where the web server and the application server work together with the database to return the requested information, in this case, the content of holbertonschool.com

Photo by Headway on Unsplash

Is it confusing to read these terms? Yes, for me it was, and I would like to show you what I have learned about it. Let’s review the process in parts:

TCP/IP

Just as humans and animals use different languages ​​and rules of communication, so do computers. In the computer world we use what is called TCP / IP (it stands for Transmission Control Protocol / Internet Protocol). Simply put, this protocol is a standard set of protocols that computers communicate over a network (private network or the Internet). This means that all computers are a node within the Internet or private networks.

This set of rules fulfill the following functions:

IP → Internet Protocol is the system in charge of obtaining the addresses where the data should be sent.

TCP → Transmission Control Protocol, on the other hand, is in charge of handling error checking and packet ordering. Then these protocols are in charge of determining the origin from which the data is sent and the destination that will receive this information.

HTTP/HTTPS

Before we delve into what happens when you type a URL in your web browser and hit Enter, let’s examine other related protocols. You can use TCP / IP to exchange data on your computer, but it requires a Hypertext Transfer Protocol (HTTP) that describes the rules for sending web pages over the network.

This protocol is based on a query system where the client is the web browser and the server is a computer that receives the requested website. However, HTTP is not secure for sending data over the network. This is due to the lack of confidentiality of the data sent. Therefore, all data sent from one computer to another is captured and easier to understand. For this, there is a secure version of HTTP called HTTPS (Hypertext Transfer Protocol Secure).

The HTTPS protocol works in the same way as HTTP, but its difference is that the data transfer is encrypted to increase security.

The client-server model

After knowing the basics about computer communication protocols, now we are going to talk about which computers communicate with each other. I don’t know if you knew it, but when you surf the internet, to connect to any web page you are going to interact with a huge number of computers along the way. And of all those computers, the most important to identify are the famous servers, since these are the ones that keep the web pages within themselves. The existence of servers in this chain of connections is necessary because it facilitates many connections at the same time to the web page, which is the basis of the concept of the web infrastructure.

The existence of servers in this chain of connections is necessary because it facilitates many connections at the same time to the web page, which is the basis of the concept of the web infrastructure. Although at first glance, the infrastructure seems a very abstract idea, it becomes easier to assimilate when knowing the idea of ​​the client-server model.

On the World Wide Web, the network is organized between clients, which request data, and servers, which stores the data and manages most of the processing of this data. For example, a browser is considered a client, and a server would be the computer program serving data to that client. Server is also a term describing the physical machine on which the server program is running. Each website, application, service can have multiple servers working behind the scenes to perform the processes needed by the client(s). In general, physical servers are regrouped in server farms, or data centers.

There are many other layers between the client and the server in a client-server model, let’s break is down.

The Web server

Once the requests have been evenly distributed to the servers, they will be processed by one or more web servers. A web server is a software program that serves static content, like simple HTML pages, images or plain text files. Examples of web servers are Nginx or Apache. The web server is responsible for finding where the static content corresponding to the address asked for is living, and for serving it as an HTTP, or HTTPS response.

The Application server

Having a web server is the basis of any web page. But most sites don’t just want a static page where no interaction is happening, and most websites are dynamic. That means that it’s possible to interact with the site, save information into it, log in with a user name and a password, etc.

This is made possible by the use of one or more application servers. These are software programs responsible for operating applications, communicate with databases and manage user information, among other things. they work behind web servers and will be able to serve a dynamic application using the static content from the web server.

The Database

The last step in our web infrastructure is the Data Base Management System (DBMS). A database is a collection of data, and the DBMS is the program that is going to interact with the database and retrieve, add, modify data in it.

There are several types of database models. The two main ones are relational databases, and non-relational databases. A relational database can be seen as a collection of tables representing objects, where each column is an attribute and each row is an instance of that object. We can perform SQL (Structured Query Language) queries on those databases. MySQL and PostgreSQL are two popular relational databases. A non-relational database can have many forms, as the data inserted in it doesn’t have to follow a particular schema. They are also called NoSQL databases.

Photo by Umberto on Unsplash

DNS

At this point, you now know that there are many machines between your computer and the web page (the web infrastructure) and that there are communication protocols between them. What you will see now is that they talk to each other through those protocols, that is, that computers talk to each other.

By typing a web page as holbertonschool.com in your browser, you are asking for information, which is on Holberton’s servers, which is a physical machine somewhere in the world. But as we saw, each machine has an address to identify itself on the internet (IP address).

But, in your browser, you don’t type 132.54.1.2 but you type holbertonschool.com, so how is it that I manage to communicate with that computer?

Therefore, the primary function of DNS is to convert a hostname (such as www.twitter.com) into a computer-compatible IP address (such as 132.138.1.3). In this way, when you request a web page, a translation is made between what you type in your web browser (www.twitter.com) and the machine-friendly address (IP) necessary to locate the resource you want.

Load Balancer/Firewall

There are two tools that servers use so that errors will not occur when receiving requests for information like the one we just made.

The first is a load balancer. Its function is to receive all incoming requests and forward them to the server where the website you are looking for is located. To do this, they use standard algorithms to configure push tools. In this way, items can be classified based on various factors such as server capacity, request type, server status. In addition, the main objective is to always provide the fastest response and improve the quality and efficiency of the response to the user.

In addition to the load balancers that are used in high-density networks to make a large number of requests, other tools are used to control traffic to and from the infrastructure where the content is stored. This tool is called Firewall. And, as its name suggests, it is a wall that allows or denies the need to access different ports. In this way, the security software analyzes any need to determine if it originated from an insecure IP address or if permission was requested to access the wrong port.

visual diagram of how a computer connects to the server of any web page

Conclusion

Finally, after going through these filters, the request reaches the server. This server contains the web server which is in charge of connecting the user with the static content (the web page) and refers the user to the application server, to give the user interactive alternatives for the use and storage of data if necessary. these two small virtual servers inside the big and physical server begins to search the computer directories and its databases to find the necessary content and, when it finds it, returns a response with the content of this file. This response is finally interpreted by your web browser displaying the information from the web page and finally displaying it on your screen.

Although all of the above has been a long and extensive topic, I hope I have been able to synthesize all the steps involved in a simple to read way. It was an intense experience to live learning this, servers have not been my greatest taste in the field of programming, but it has been interesting to understand how things work under the hood. Thanks for your time in reading this post, see you on another topic soon.

--

--