What Happens When You Type https://www.google.com In Your Browser And Press Enter

Chigozirim igweamaka
9 min readApr 29, 2022

--

Just as it was a mystery to us, while we were kids how people got into TVs and how they managed to fit into radios, it is a mystery to a lot of people how a browser takes them to a specific location on the internet upon typing in, pasting in, or even speaking in a domain name, or URL, into the browser. Does the browser go to the website owning the domain name or does the website come to the browser?

To unravel this mystery, I’ll take you through a series of steps your web browser takes upon receiving a URL, for example, https://google.com, to take you to a specific location on the internet.

Terminologies

Before we proceed though, here are some definitions of terms that will be relevant for the duration of this article:

  • Server: A server is a computer software, with underlying hardware, that’s dedicated to providing a service to other computers. In the context of this article, the usage of the term “server(s)” will refer to the computer system(s) hosting a website.
  • Client: A client is computer software, with underlying hardware, that access services hosted on a server. in the context of this article, the usage of the term “client” will refer to the web browser.
  • Webserver: A webserver is a type of server that uses HTTP, or it’s variant, and other protocols to respond to web client requests made over the internet. It is its responsibility to display website content through storing, processing, and delivering web pages to the web browser.
  • Protocol: A protocol is an established set of rules or procedures that dictate how data is transmitted between different devices on a network.

Step 0: The browser parses the URL

When you type in a URL, https://www.google.com , for example, the browser breaks it down into parts:

  • Protocol — https — the data transfer method to be used between the client and server.
  • Subdomain — www — additional information added to the beginning of a domain name.
  • Domain name — google — the domain name that maps to the IP address of the webserver.
  • TLD — .com — the top level domain that classify a feature of the website.

All of which you learn about in the course of this article.

Step 1: The browser uses Domain Name System (DNS) To convert the domain name to an IP address

Computers on a network identify each other with IP addresses just as we humans identify each other with names. An IP address ranges from 12–16 digits, and we humans would find it difficult memorising and remembering one, let alone the dozens we come across every day. Thus, IP addresses are encoded as domain names.

You can type in an IP address directly to the browser and the browser would begin communication with the website’s server. However, if you decide to be a human and use a domain name instead, the browser tries to get the IP address behind the given domain name by using a system called DNS — Domain Name System

Before proceeding to DNS, the browser and OS first check their cache to see if they know the IP address of the specified domain name. If they do, the browser connects to the website server using the IP address and begins communication with it right away. However, if they don’t, the OS queries DNS resolver with the domain name.

DNS resolver is a server, usually your Internet Service Provider (ISP), designed to receive domain names from web browsers and other applications. It is responsible for tracking down the IP address for a given domain name.

The DNS resolver goes through a series of predefined steps, known as the DNS hierarchy, to translate the domain name into an IP address. The first it takes is sending the domain name to a server called the root server. The root server serves as a reference — it refers requests sent by the resolver to another server called the Top Level Domain server, TLD for short.

TLD servers are one step below the root servers in the DNS hierarchy. TLD servers take the domain name provided, google.com for example, and provide the IP of its Authoritative Name Server , `.com` in this case.

The Authoritative Name Server is a DNS server that contains information for a specific domain name. It is the final point in the search for the IP address of a domain name. This server takes the domain name and subdomain, and if both are valid it returns the correct IP address to the DNS Resolver.

Upon getting the IP address for the given domain name, the DNS Resolver tells the OS the IP address. The OS saves the address in its cache (so it wouldn’t have to involve the resolver the next time you type in the domain name) and tells it to the browser. Now, with the IP address in hand the browser knows the exact computer, web server, to communicate with over the internet.

Step 2: The Browser Sends A Request To The Website’s Server To Communicate

TCP/IP (Transmission Control Protocol/Internet Protocol)

The browser begins communication with the website’s server by sending a request to it. But no communication is successful without both ends sharing a common language, or message format, so a method for connection known as TCP/IP is used.

TCP/IP is a set of rules, conceptualized in layers, that dictate the way computer systems on the internet communicate. The layers are as follows:

  1. The Application layer, which is the first layer, is where programs like your browser directly interact with. This layer has protocols like HTTP (if you’re visiting websites), or SMTP (if you’re checking your email). The Application layer gets data from the browser and tells it to the second layer through something called a port.
  2. The Transport Layer, which is the second layer, is where TCP is found, along with a second schema called UDP. Each protocol in the Application layer uses a different port to communicate with this layer so that TCP knows where the data is coming from. Once TCP gets the data, it chunks it up into small chunks called segments, also known as packets, where they could individually take the quickest route to get to their destination. To reunite the segments properly upon arrival at their destination, TCP adds a header unto each segment which contains the instructions on what order to reassemble the segments into as well as error checking information so that the computer knows whether the segments arrived without any mishaps. After this is done, the segments are pushed on to the third layer.
  3. The Internet Layer, which is the third layer, receives the segments and attaches the origin and destination IP addresses on each segment so that irrespective of the route the segments may take, they know where they are going and where they came from. The segments are then sent to the final layer:
  4. The Network Access Layer. It is responsible for the transmission of data between two devices on the same network. It defines how the data should be sent physically through the network.

HTTPS

With a common method of communication in place, the browser sends a HTTPS request, over TCP/IP, to the web server and waits for a response.

Yes, I remember too. HTTPS appeared in the first part of our URL from step 0: https:// . Lets see what that means and the purpose it serves:

HTTPS, Hypertext Transfer Protocol Secure, is a variation of HTTP protocol, a standard application-level protocol on top of TCP/IP that supports exchange of files such as text, image, audio, video, e.t.c, between a web client and a web server on the internet.

HTTPS, order than it’s variant, HTTP, ensures data security over a network by encrypting all requests sent by the web client to the web server as well as all responses sent by the web server to the web client. HTTPS is encrypted using a protocol called Transport Layer Security (TLS), formerly known as Secure Sockets Layer (SSL).

With HTTPS, highly confidential online transactions like online banking and online shopping order forms are safe from attackers. To assure web users of this security, most web browsers display a padlock icon in the address bar to visually indicate that a HTTPS connection is in effect.

Step 3: The Web Server Responds With A Web Page

What exactly is a web page? A web page is a document, usually written in HTML, that’s displayable by a browser.

Once the web client sends a request, the web server checks if the resource (which is usually a file, or files) required to satisfy the request is present. If it is, it sends a HTTPS response with the resource. Otherwise, it checks it’s static database for the resource. And if found, it sends a HTTPS response.

A database is a collection of organized information set up for easy access, management, update and retrieval by a computer.

Resources to some requests may not exist in the webserver or it’s static database and the request may need to be processed in order to generate the resource. To do this, the web server sends a request to an Application server which in turn would contact the Application database in order to get some details as it processes the request. Once done with the processing it sends a response to the web server which in turn process it and sends a HTTPS response to the web client.

An Application server is a server specifically designed to run applications. It includes both hardware and software that provide an environment for programs to run.

However, in cases where no resource was found, or generated for a request, a 404 -page not found- error code is sent as response to the client.

Before a request hits the actual web server, it goes through some technologies to ensure security and constant service rendering.

Load balancer

It’s always satisfying when a website responds fast to users demands

Think of a laptop running multiple, heavy programs synchronously. It would grow real hot, begin to run slowly, and eventually crash. This ,too, happens to webservers when they begin to receive more requests than they can actually handle.

To keep this from happening, companies that receive high traffic on their websites, Facebook for instance, deploy multiple individual servers [that render the same services] to reduce the amount of load on an individual server. They use something called a load balancer to distribute the requests evenly across the servers-which in turn increase the availability, reliability and efficiency of their application.

A load balancer is an intermediary responsible for efficiently sharing incoming network traffic evenly across a cluster of servers.

Firewall — Web Servers Can Reject Specific Requests over the Internet

A firewall blocks unwanted traffic and permits wanted traffic. Its purpose is to create a safety barrier between a private network and the public. It works by filtering incoming data and determines by it’s rules if the data is allowed to enter a network.

Monitoring

In order to know when an individual server is down or not functioning as expected, a monitoring software is deployed. It renders constant surveillance and gives reports according to statistics such as the amount of traffic, the speed of the request handling, and the status of servers.

In A Nut Shell. What happens when you type in type https://www.google.com and press ENTER?

  1. The browser receives the URL and parses it into its protocol (https ) , domain name (www.google.com ), port (443 ), and location (implicitly, root / ).
  2. The browser checks if the IP address to the domain name is already in its own or the OS’s cache. If so, it begins communication with the webserver. Otherwise, it uses DNS to get the IP address of the domain name.
  3. The browser communicates with the webserver over TCP/IP by sending a HTTPS request to the webserver.
  4. The webserver receives the request, gets the resource to satisfy the request, and sends the resource to the client using HTTPS.

--

--