What happens when you type google.com in your browser and press Enter?
Joy M. Mbuvi - A deep-dive into how the client-server model works

What happens when you type google.com in your browser and press Enter?

To know what happens exactly, we first need to define some terms:

  • DNS - (Domain? Name System) is technology that translates human-readable names into IP addresses that the computer can understand.
  • Domain Name - The name that a user inputs to get an IP address. It is used to identify internet resources such as computers, networks and services because they are easy to remember. For example: wikipedia.org and google.com.
  • Server:? A computer software or hardware that provides functionality for other programs or devices.
  • SPOF(Single Point of Failure) -? is when a part of a system fails which causes the entire system to stop working.
  • Web server - A computer that hosts a website on the computer.

Now that we’re all set, we could dive into the big stuff. When a client or user types www.google.com and hits enter:

  • The Domain Name System(DNS) converts the text-based address into an IP address that the computer uses? to look up the page so that it can return a copy of the requested page. The DNS comes in handy because humans find it hard to remember the IP addresses but instead find it easier to remember the domain names assigned to the IP addresses.
  • Using the acquired IP address, the computer establishes a connection called TCP (Transmission Control Protocol) with a server through the IP.? This process is called a “handshake”.
  • If your computer has a firewall, the request passes through it to ensure that it is safe to advance or carry on with the request. Similarly,? if the server has a firewall, the request is checked for safety before the server sends a response.?
  • Using the connection, your browser uses SSL(Secure Socket Layer) or Transport Layer Security(TLS) to encrypt the data. This makes the data secure and is why there is an “s” in “https” as opposed to “http”.
  • Due to the numerous requests ig companies like google receive daily, they use load balancers to distribute the requests to various servers. This is important because it prevents a single point of failure (SPOF) from occurring.
  • Upon receiving the request, the server responds to the browser and sends back feedback which mostly consists of HTML, CSS, JavaScript and image files or content.
  • The web page rendered depends on the client’s needs. The client may request a static web page or a dynamic web page. In the case of a dynamic web page, the web server makes a request to the application server which in turn makes a request to the database server for data after which it is sent back to the browser.
  • Lastly, the browser will display the response in the form of the requested page by the client. Diagrammatically:

An image what actually happens when people lookup

What happens when you type "www.google.com?"

Let’s get into more details of how this whole process works:

The Domain Name System

It converts domain names? into IP addresses which are then used to load web pages. Every computer that is connected to the internet has its own IP address which other computers use to identify it by. When you search anything online, the browser stores the details in its cache so that when the same client looks up the same page, the browser checks in its cache to see if it has a record of the DNS entry for that domain. In the event that it finds a record in its cache, it responds faster because it does not have to request the DNS server for the IP address.

However, if there was no previous record of the IP address in its cache, the browser sends a request to the DNS server to translate the domain name into an IP address.

The DNS request is an entirely different process on its own but can be summarized as follows:

  1. The browser sends a request to the local DNS resolver provided by the ISP (Internet service provider)
  2. The resolver checks for a record of the domain. If a record exists, it sends the IP address back to the browser.
  3. If the resolver fails to find a record of the domain, it sends a request to the DNS server so that the domain name can be converted into an IP address.

TCP/IP Model

Transmission Control Protocol and Internet Protocol transfers data from the sender to the recipient. It is a concise version of the OSI model (Open Systems Interconnection) with only 4 layers to it as opposed to 7. It ensures that the data transmitted is accurate in that it is exactly the same as the client sent. It does this by dividing the data into packets and joins the packets at the end to form a whole. By doing so, data is transported faster while still maintaining accuracy.

The four layers of the TCP/IP model are:?

  • Physical layerThis is the layer that is responsible for requisition connections between the clients and the servers.
  • Internet LayerThis layer defines the protocols which are responsible for logical transmission of data over the entire network.
  • Transport LayerThis layer is responsible for how data is sent and delivered by ensuring that the client receives exactly what they requested. It is also responsible for retransmitting missing packets so that the data received is accurate. UDP and TCP/IP belong in the transport layer.
  • The Application LayerThis layer is responsible for error-free transmission of data as well as protecting data from data complexities that may occur in the transmission process. The Common protocols here are SSH, NTP, HTTP and HTTPS.

Firewall

A firewall is a security system that monitors incoming and outgoing network traffic so that it can either block or allow requests based on whether or not they follow the predefined rules. The firewall prevents the computer from malware or cyber threats. When a user types in “www.google.com”, the request goes through the firewall to ensure that it is safe to proceed to the servers. The firewalls were designed to secure private networks and the endpoint devices within them called network hosts. These so-called network hosts “talk” with other hosts on the network. They send and receive between internal and external networks as well as outbound and inbound between external networks.

HTTPS/SSL

Hypertext Transfer Protocol Secure (HTTPS) is a more secure version of HTTP and is the primary protocol used to send data between a browser and a website. It uses an encryption called Transport Layer Security (TLS) which was formerly called Secure Sockets Layer (SSL) to protect the data by using asymmetric public and private key pairs. When a connection is established between your browser and Google’s server, the server decides on the version of TLS/SSL to use and then makes a secure, encrypted channel to transport the data.

Load-Balancer

A load-balancer is a server that distributes the workload to different backend servers in order to ensure efficiency. Many users browse the Google website using its domain name or subdomain name. To ensure faster and more efficient responses to the clients, the load-balancer depending on the stipulated algorithm such as (The round-robin algorithm) distributes these requests across the multiple backend servers. A load-balancer prevents SPOFs from occurring.??

Web Server

A web server can refer to software, hardware or both software and hardware working together. On the hardware side, a web server is a computer that contains web server software and a website’s component files such as HTML, CSS and JavaScript. On the software side, a web server contains several parts that control how a client accesses hosted files. For instance, when a user types “www.google.com”, the browser forwards the request to the load balancer which will then be forwarded to Google’s web server. The server through the HTTPS accepts the request, finds the appropriate response (HTML, CSS and JavaScript files), pushes it back to the load balancer which will forward it to the browser and the pushed files are ultimately used to render the page that was initially requested by the client.

Application Server

The application server is responsible for rendering a dynamic web page. When users submit their queries, the load-balancer will forward it to the web server which will forward the request to the application server based on the type of query that was inputted. The web server renders static web pages but the application server renders the dynamic kind. When the application server finds the requested data, it pushes it back to the browser through the web server and load balancer to render the dynamic page.

Database

A database is an organized collection of well structured data or information stored in a computer system and managed by the database management system (DBMS). Depending on the complexity of the requested dynamic web page, the application server may have to make a request to the database to find the data that is needed by the client. If the data is found present in the database, it is returned to the browser and the data is rendered as the web page.

Displaying or Rendering the web page

Upon receipt of the requested files from the web server, the browser forms or displays a page that is made up of Hypertext Markup Language (HTML), Cascading Style Sheets (CSS) and JavaScript (JS). HTML provides functionality to the page, CSS styles the page and JS adds interactivity to the page. The rendered page also includes images which provide more context or even just to the style of the page.

Conclusion

I hope this article provides an insight into how things work under the hood when people search on Google or any other subdomain or domain name.?

Effie Fiona

Founder at Kua Nasi | Impact Entrepreneur | EMMIE Scholar | Creating Decent and Dignified Jobs for Women | Leader of Tomorrow by the 53rd SGS

1 年

So insightful. ??

回复

要查看或添加评论,请登录

Joy M. Mbuvi的更多文章

社区洞察

其他会员也浏览了