What happens when…

luiscarvajal
9 min readJan 13, 2021

--

This is a classic interview question “What happen when you type something like https://www.holbertonschool.cominto your browser’s address box and press enter?”. how developers is important for us know what’s the process behind a search in internet and how the search work when we use it.

In this blog we’re try to explain this question making a review about some important concepts that happen when you make a search on the internet browser

First, we need to cover the following concepts :

  • DNS request
  • How TCP/IP works?
  • What is a Firewall?
  • What is HTTPS/SSL?
  • What is a web server?
  • What is Load-balancer
  • Application server
  • Databases

WHAT IS TCP?

The Transmission Control Protocol (TCP) is a communications standard that enables application programs and computing devices to exchange messages over a network. It is designed to send packets across the internet and ensure the successful delivery of data and messages over networks.

TCP is one of the basic standards that define the rules of the internet and is included within the standards defined by the Internet Engineering Task Force (IETF). It is one of the most commonly used protocols within digital network communications and ensures end-to-end data delivery.

As a result, TCP is used to transmit data from high-level protocols that need all data to arrive. These include peer-to-peer sharing protocols like File Transfer Protocol (FTP), Secure Shell (SSH), and Telnet. It is also used to send and receive email through Internet Message Access Protocol (IMAP), Post Office Protocol (POP), and Simple Mail Transfer Protocol (SMTP), and for web access through the Hypertext Transfer Protocol (HTTP).

WHAT IS IP?

The Internet Protocol (IP) is the method for sending data from one device to another across the internet. Every device has an IP address that uniquely identifies it and enables it to communicate with and exchange data with other devices connected to the internet.

IP is responsible for defining how applications and devices exchange packets of data with each other. It is the principal communications protocol responsible for the formats and rules for exchanging data and messages between computers on a single network or several internet-connected networks. It does this through the Internet Protocol Suite (TCP/IP), a group of communications protocols that are split into four abstraction layers.

WHAT IS A DNS (Domain Name System)?

The Domain Name System (DNS) is a naming system for computers, services, or other resources connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities. Most prominently, it translates more readily memorized domain names to the numerical IP addresses needed for locating and identifying computer services and devices with the underlying network protocols. By providing a worldwide, distribute directory service, the Domain Name System has been an essential component of the functionality of the Internet since

WHAT IS A FIREWALL?

A firewall is a network security device that monitors incoming and outgoing network traffic and decides whether to allow or block specific traffic based on a defined set of security rules.

Firewalls have been a first line of defense in network security for over 25 years. They establish a barrier between secured and controlled internal networks that can be trusted and untrusted outside networks, such as the Internet.

WHAT IS A SSL CERTIFICATE?

SSL stands for Secure Sockets Layer and, in short, it’s the standard technology for keeping an internet connection secure and safeguarding any sensitive data that is being sent between two systems, preventing criminals from reading and modifying any information transferred, including potential personal details. The two systems can be a server and a client (for example, a shopping website and browser) or server to server (for example, an application with personal identifiable information or with payroll information).

WHAT IS HTTPS?

Hypertext transfer protocol secure (HTTPS) is the secure version of HTTP, which is the primary protocol used to send data between a web browser and a website. HTTPS is encrypted in order to increase security of data transfer. This is particularly important when users transmit sensitive data, such as by logging into a bank account, email service, or health insurance provider.

WHAT IS A WEB SERVER?

A web server is 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.

A web server can manage client HTTP requests for Web Resources related to one or more of its configured / served websites.

A web server usually receives incoming network HTTP requests and sends outcoming HTTP responses (one for each processed request), along with web contents, through transparent and / or encrypted TCP/IP connections (See also: HTTPS) which are started by client user agents before sending their HTTP request(s). Maybe in future web servers will be able to handle also other types of transport protocols for HTTP requests.

WHAT IS LOAD BALANCING?

Load balancing refers to efficiently distributing incoming network traffic across a group of backend servers, also known as a server farm or server pool.

Modern high‑traffic websites must serve hundreds of thousands, if not millions, of concurrent requests from users or clients and return the correct text, images, video, or application data, all in a fast and reliable manner. To cost‑effectively scale to meet these high volumes, modern computing best practice generally requires adding more servers.

A load balancer acts as the “traffic cop” sitting in front of your servers and routing client requests across all servers capable of fulfilling those requests in a manner that maximizes speed and capacity utilization and ensures that no one server is overworked, which could degrade performance. If a single server goes down, the load balancer redirects traffic to the remaining online servers. When a new server is added to the server group, the load balancer automatically starts to send requests to it.

WHAT IS AN APPLICATION SERVER?

An application server is a server that hosts applications.[1]

Application server frameworks are software frameworks for building application servers. An application server framework provides both facilities to create web applications and a server environment to run them.

An application server framework contains a comprehensive service layer model. It includes a set of components accessible to the software developer through a standard API defined for the platform itself. For Web applications, these components usually run in the same environment as their web server(s), and their main job is to support the construction of dynamic pages. However, many application servers do more than generate web pages: they implement services such as clustering, fail-over, and load-balancing, so developers can focus on implementing the business logic.

WHAT IS A DATABASE?

Formally, a “database” refers to a set of related data and the way it is organized. Access to this data is usually provided by a “database management system” (DBMS) consisting of an integrated set of computer software that allows users to interact with one or more databases and provides access to all of the data contained in the database (although restrictions may exist that limit access to particular data)

CACHE MEMORY

The cache is like a phone book, containing names (domains) associated with numbers (IP addresses). With Internet browsers, cache is a temporary storage area where website data is stored. By caching this data, the web browser can improve performance by loading data from your disk, instead of the Internet, if it’s ever needed again.

IP Request

When we visit a website, the first thing to keep in mind is that the address may be stored in your browser’s cache, otherwise the operating system will start the process of going through the Domain Name System ( DNS) to find the address. First, the operating system asks the Internet service provider for the address, If it is a website with a lot of traffic, the service provider may have this value stored in its cache, otherwise, the service provider knows the root server address, where the search for the IP address will begin. The root server contains the addresses of the top-level domain (TLD) servers. Some common TLDs are .COM, .ORG, and .NET. Since our domain name is derived from the .COM TLD, the resolver is sent to that server, which will contain information about all the .COM domain names. The solver will also cache the TLD .COM server address so you don’t have to request it from the root server again. If the .COM TLD does not have the address directly, it will send the resolver to the authoritative name server. When a domain name is purchased, the domain registrar reserves the name and information to the TLD registry which authoritative name server is associated with that address. This server is owned by the company through which the domain name was purchased. Once on the authoritative nameserver, the resolver can finally obtain the IP address and return it to the operating system. The operating system will save this address, so the resolver will not have to go through this process again and return the address to the browser.

Connection

Now that your browser knows where to find www.holbertonschool.com, you can request the information. The way your browser and server interact is governed by the TCP / IP Protocol. IP defines how to address and route these packets through the network. TCP defines how to create communication channels through a network and how information will be broken up into smaller packets and reassembled at the destination. Before your computer sends a request to the website, a connection will be established through the TCP three-way handshake, known as SYN-SYN-ACK. Your computer will send a TCP synchronization packet to the server, upon receiving the packet, the server will send a confirmation and synchronization packet to the computer, once it receives this packet, our machine will send a confirmation packet, which will establish the connection.

BALANCER AND SECURITY

Finally, an HTTP request will be sent to the landing page of www.holbertonschool.com. This request first reaches a server called a load balancer, which distributes traffic across multiple servers to balance the requests. The load balancer and both the servers are usually equipped with what is known as a firewall, which monitors incoming and outgoing traffic and decides whether or not to allow traffic to pass through based on a custom set of security rules in addition to how frequently it is used. which requests are made or the type of content requested.

SSL (Secure Socket Layer) will establish an encrypted link between your web browser and the load balancer using an SSL certificate located on the server (change http to https), this ensures that all the information that is transmitted between these two endpoints remains private with a balancing algorithm of A common load is round-robin, in which the load balancer loops through a list of servers and forwards the request to the next server in the list.

FINALLY STEPS, REQUESTS

The purpose of the online server is to method requests over HTTP and serve files that correspond to the requested website, ofttimes the request solely includes a static machine-readable text terminology (HTML) file. In this case, the web server will access the file from the filing system and deliver it on to the client, most of the time, websites are supported dynamic content or content that changes. As a result, the content can ought to be reborn to a static file to be delivered to the client. An further server, the appliance server, will retrieve data from a database, such as user data, and convert this information to a static file. This is then came back to the online server to satisfy the request. Once the file is shipped back to the browser, it’ll interpret the hypertext mark-up language file and show the corresponding website.

The following diagram is an interpretation of the connection made and the journey through the servers

https://www.cloudflare.com/learning/ssl/what-is-https

--

--