What happens when you type google.com in your browser and press Enter
Ami Choudhary
Junior Developer & Administrative Accountant | Recent Coding Graduate with a Passion for Building Tech-Driven Business Solutions
Every internet user knows the outcome of typing a specific website page e.g. www.google.com on their given browsers. It would immediately direct you to that website. That’s obvious isn’t it? ?But, hold on a second, would everyone be having the knowledge on what goes on behind the scenes for that website to appear on your browser after you hit enter? I don’t think so. There are a few steps that are involved & are necessary for the website to appear the way it does. Hello! My Name is Ami Choudhary and I’ll be taking you through the backend process of how the website appears on our given browsers after we’ve typed in the URL (Uniform Resource Locator).
Before we dive into the steps involved. We need to understand the “client-server” relationship. Let’s ask ourselves this question. How can we communicate with the Google website? For that, we require a computer that has a browser. Therefore, our browser on our computer is what we call the client. And then, our Google is our server. Google server responds to the requests made by the client. Thus, a client-server relationship is a relationship in which one program - the client browser, requests a service or a resource from another program – the Google server. So folks, we have just touched the tip of the iceberg. There are still many detailed steps in between the client and the server in a client-server relationship model that we need to deep dive in. So let’s start!
DNS Request
When we type in www.google.com into our specific browser(Safari, Chrome, Firefox etc.) and click enter, the first thing our browser would do is, categorize and break down the URL into simpler readable parts. The first part of the URL that would be read is the google.com. This is our Domain Name. Basically, a domain name is a unique and easy to remember addresses that are used to access websites. And then, we have something called the IP (Internet Protocol) address. An IP address is the unique identifying number assigned to every device that’s connected to the internet. It’s like a “numeric label” assigned to devices that use the internet to communicate. IP addresses have a specific format -There should be 4 numbers (from 0-255) separated by dots. For e.g. 8.95.101.60. Every website has it’s own unique IP address. Just imagine if you have many websites you want to browse, like Facebook, google, Instagram etc. Will you be able to memorize all their different IP addresses? Absolutely not! Why put yourself through that torture? That’s where the domain name comes in play. Domain names are the alphabetic representation for the IP address. Us human beings, we tend to memorize words better than numerical data. Therefore, the DNS (Domain Name System) is here for us to remember the IP address of each domain out there. Supposing the browser can’t recognize a domain name (it’s not stored in the cache), then, it’s going to ask the DNS for the IP address corresponding to that specific domain name.
The DNS Request first goes through the resolver. The resolver is our ISP (Internet Service Provider), and if it doesn’t find the IP in its cache, it’s going to request the root server that is aware of our TLD (Top level Domain). Our top-level domain is .com (for others, it can be .org, .net etc.). If the TLD server still doesn’t know the IP, it points the resolver to the Authoritative Name Servers. In most cases, there’s always more than one server name attached to a domain name. Therefore, any of those server names can give the IP for the domain name they’re attached to. Finally, the resolver has acquired the specific IP address and sends it back to the browser that will perform its request to the corresponding server.
TCP/IP
Till now we’ve seen the role of IP addresses in communicating data over the internet. But, it’s not the only form of protocol. We have something known as the TCP (Transmission Control protocol) as well. It is basically a communications standard that enables computing devices to exchange messages over a network. It’s a set of rules that define how the clients and servers interact with each other over the network, how data should be broken down into “packets” to ensure the successful delivery of data and messages over the internet. In our example:- when a client requests the google website, the information would be converted accordingly.
Firewall
A firewall is an essential part of the network security. It helps in monitoring the incoming and outgoing network traffic and decides whether to allow or block specific traffic depending on whether it’s safe or is a threat. When we type www.google.com, the browser asks for this website at it’s specific IP address, but, the request will first be processed by a firewall which will decide if it’s safe or it’s a threat to the security of the server. The browser itself can be equipped with a firewall to detect if the IP address given by the DNS request is a potential risk.
HTTPS/SSL
Now, let’s move to the next part of the process after the browser already has the IP address of the google website. The browser will now move to the https:// part of the URL (https://www.google.com) given. HTTPS (HyperText Transfer Protocol Secure) is a secure version of the regular HTTP.? And if you aren’t familiar with HTTP then it’s basically an application layer protocol that is designed to transfer data between networked devices. In other terms, it’s the main way to transfer data between a browser and a website (in our case google). HTTP and HTTPS requests include GET, POST, PUT amongst others. But, what’s the hype about HTTPS? Well, the HTTPS responses and requests are all encrypted. Thus, when we browse for example https://www.google.com, because of the https, we know the website is secure. And so, the user is certain that their data can’t be stolen by a third party and be misused by fraudsters.
Then we move to the SSL (Secure Sockets Layer). This is a standard technology for securing an internet connection by encrypting data sent between a website and a browser. Or, even between two servers. It has a similar use to the https. In that, it prevents hackers from seeing or stealing any information that is transferred by the user. This certificate needs to be issued from a trusted Certificate Authority. An example would be DigiCert. When a website has this certificate, we can see a little padlock on the left side, next to the name of the website. On certain browsers and certain kinds of SSL certificates, the search bar turns green!
领英推荐
Load Balancer
Let’s move to the role of the load balancer. Supposing, just like you, several individuals at the same time are trying to load the google website on their browsers, we know that websites run on the servers. And for a website like google, where the traffic is consequent, it’s almost impossible for it to be hosted on a single server as it may encounter a SPOF (Single Point of Failure) if the server is down that would result in the whole website being down. And, that’s not what we want right? That’s where the load balancer steps in. A load balancer is basically a software program that distributes network requests(traffic) between several servers. It does this using different load-balancing algorithms. The most commonly used load-balancer is the HAproxy & an example of the algorithm we can use is the round-robin algorithm. The round-robin algorithm will distribute the requests evenly alternating between all the servers or depending on the load of the server.
Web Server
A web server can be defined as a computer software and underlying hardware that accepts requests via HTTP/HTTPS. Once the requests have been evenly distributed by the load-balancer to their appropriate servers, they will be processed by one or more web servers. The web servers will therefore serve the static content corresponding to the IP address, and will serve it as an HTTP or HTTPS response accordingly.
Application Server
While web servers are responsible for displaying the static content of a webpage (basically web servers are the basic block of any web page), application servers on the other hand are software programs that are responsible for operating applications, communicating with databases, managing user information. In short, they bring dynamism into the picture! Currently, most websites are dynamic. In that it’s possible to interact with the website, save information into it, log into it with a username and password etc. That’s why it’s necessary to have an application server.
Database
The Database is the final step in our web infrastructure model. A database is a structured set of data held in a computer, especially one that is accessible in various ways. And a DBMS (Data Base Management System) is a program that is going to interact with that database and retrieve, add and modify data into it. There are various kinds of database models. In our case, when the individual searches for a website, the database will store information about the user, amongst other additional information like products, orders etc. An example is:- MySQL. This is an example of a relational database. A database is the central location for the things mentioned. In addition to this, it allows one to store complex data structures with minimal effort! Makes life easy right?
In this article we have seen the different processes that are present in a web stack. In conclusion, we can say that it only takes a few seconds for all the above agents to act consequently to receive a response for the URL that was typed by the user in the browser. I hope this article has brought you a clearer understanding of what actually happens behind the scenes.
Thank you for reading! :)
Solutions Architect
1 年Hi Ami, great article! You have covered the entire round-trip communication. Keep up the good work and keep posting :)
Helping Young Adults Build Resilience & Thrive | Mental Health Counselor | Mindset & Wellness Coach
1 年Congratulations on your first technical blog! Great information on here that was easy to understand!