What happens when you type google.com in your browser and press Enter
Every day you open up your browser and navigate to your favorite websites-whether news or social media sites. You explore this page through a URL or clicking on a link to the page. Have you ever wondered what happens when you type a URL on your web browser and press Enter? How did the images on certain post show up in your browser? In this post, we’ll look at what happens when you type https://www.google.com in your browser and press enter.
Where To Begin…
We can break down the address we are querying into a few different parts. In every web address, there is always a domain name. google.com is our domain name in this case. Besides, our URL has a subdomain (“www.”) and the communication protocol ("https://"), which are going to be discussed latter in this post.
A website is a collection of web pages or digital documents that are accessible over the internet. It can be put simply as nothing more than a file hosted and served to you from a computer, specified by a web address. So, whenever you enter the address www.google.com , your browser tries to find where this website files are located. To achieve this, the browser must first determine the host devices IP address.
Every web address has an IP address. When you connect your device to the internet, a unique, numerical identifier is allocated to your device. This IP address is hard for human being to remember. That’s why it is much easier for you to use domain names unlike IP addresses. So, in our case, when we enter www.google.com , the browser must first look for IP address associated with this domain. This is where the browser employs Domain Name System (DNS).
Domain Name System (DNS)
Prior to technically access the Domain Name System (DNS), the browser will first consult its local cache. Upon communication with a website, the browser will store the domain and its corresponding IP address in the cache for future reference. Therefore, if the browser has recently communicated with www.google.com , the request can be immediately directed to the appropriate IP. In the event that the domain is not recorded in the local cache, the next point of reference is the cache of the internet service provider, which operates in a similar manner albeit on a larger scale.
If the domain remains unpaired with an IP, your browser shall initiate a search within the DNS. The initial tier of this system is comprised of a root name server. It is noteworthy that there are solely thirteen of these servers dispersed throughout the world, although each server is essentially a cluster of numerous identical instances. These authoritative name servers scrutinize the top-level domain of the requested address and subsequently redirect traffic to an authoritative name server that corresponds to it. In our particular case, the top-level domain of our web address is ".com", and we are directed to the ".com" authoritative name server.
DNS Request: The initial stage of the procedure involves a DNS request, wherein DNS, an acronym for Domain Name System, assumes the responsibility of converting human-readable domain names such as www.google.com into IP addresses that are comprehensible to computers. Upon locating the address, the server shall provide an A record, which is a record that directly maps a domain or subdomain to an IP. In this instance, the IP associated with www.google.com is 99.84.32.15 and shall be returned to our browser. With the IP address of the server that hosts www.google.com now available, we are prepared to request the files from this server, which our browser can then render as a webpage.
Internet Protocol
There exist various protocols that establish distinct communication standards across the internet. One of the primary protocols currently implemented is TCP/IP, which stands for Transmission Control Protocol/Internet Protocol. This protocol is characterized by its connection and reliability features. TCP establishes a persistent connection between the host and client prior to data transfer. Once the connection is confirmed, data can be transmitted, and for every packet of data sent from the server to the client, a verification of receipt is made.
Upon obtaining the IP address of the web server that accommodates Google's website, your browser proceeds to initiate a connection with the server through the utilization of TCP/IP. The Transmission Control Protocol (TCP) is accountable for the establishment of a dependable connection between two devices over the internet, whereas the Internet Protocol (IP) is responsible for the routing of data packets between devices. This is the type of connection that we will establish with the server hosting www.google.com . Now that we have its IP address, we can proceed with the connection.
HTTPS/SSL Connection
When we enter the web address www.google.com , taking the precaution of prefixing it with "https://" ensures a secure connection. The HTTP protocol, which is layered on top of TCP/IP, is a fundamental means of communication on the internet, and its secure extension, HTTPS, is designed to facilitate the secure transfer of information through the use of SSL (Secure Sockets Layer) encryption. SSL is a protocol that standardizes encryption methods. Prior to establishing an HTTPS connection, a client and server must undergo a validation procedure, commonly referred to as a "handshake". This process involves the exchange of a unique cipher between the client and server, which is then used to encrypt and decrypt subsequent communications. While our dealings with google.com may not involve particularly sensitive information, encrypted communication is essential for activities such as online banking transactions or the sharing of social security numbers.
Load Balancer
Upon making a request to www.google.com , the initial component of the host server's architecture encountered is a load balancer. The load balancer assumes the responsibility of presenting an SSL certificate, thereby initiating the HTTPS validation process as previously elucidated. Additionally, it serves as an endpoint for encryption, ensuring that all incoming and outgoing traffic to and from the host server is decrypted and encrypted, respectively, at this point.
It is noteworthy, however, that load balancing software is not primarily designed for security purposes. As the name implies, the load balancer's primary function is to distribute client requests evenly across the web servers associated with this IP address. This is a critical function for websites with moderate to high traffic. For instance, a website such as facebook.com may utilize thousands of nearly identical web servers, each containing the necessary files to load the website on a user's browser. The load balancer guarantees that each of these web server instances receives an equitable number of requests, as a single web server would be quickly overwhelmed by the traffic that a website like Facebook attracts.
领英推荐
Firewall
Having established a secure connection to google.com and delegated our request to an available web server, we must now navigate through the server's firewall. A firewall serves as a security mechanism that regulates incoming and outgoing traffic to a server. While SSL is primarily concerned with safeguarding the content of communication, firewalls ensure that the host only communicates with trusted entities. This is achieved by managing the opening and closing of ports and validating the service or client attempting to access an opened port. Fortunately, we are a trustworthy party, and google.com grants us access to the web server through its firewall.
Web Server
Ultimately, we have established a connection with the software that will provide us with the requested webpage. Within server architecture, the web server is responsible for transmitting static web pages to the client. It is common for multiple identical web servers to operate behind a load balancer, catering to various client requests. Typically, HTML files are served, but in the case of dynamic webpages, the web server may require assistance in generating a static page for delivery.
Application Server
An application server is responsible for executing any programs, applications, or codebases required to provide the client with a webpage. For instance, if a user wishes to convert a .jpeg file into a .png format using a file conversion website, the web server will receive the request, including the file to be converted, and forward it to the application server. The application server will then execute a program to carry out the conversion process. Once the conversion is complete, the resulting .png file will be sent back to the web page, which will subsequently deliver it to the client. Additionally, the application server can be utilized to populate an HTML file with dynamic content that is stored on a neighboring database server.
Database
Seldom does a web server retain an HTML page in its original form for serving purposes. Typically, these HTML pages serve as templates for dynamic content. For instance, upon loading facebook.com on my browser, I am presented with a timeline containing text and images shared by my "friends" on the platform. However, it is highly likely that your facebook.com appears distinct from mine, despite sharing the same form. This is because we both receive the same page, albeit populated with unique content. When we request this page, an application server may query a database to retrieve the latest posts from our friends, which have been previously stored. Alternatively, if you visit a website where you are already logged in, the page will display your name and a greeting at the top right corner, which is specific to you. This is because the server has a record of your IP address, name, and other pertinent information relevant to your individual interaction with the webpage, all of which are stored in a database.
The diagram below illustrates how it works in simpler terms.
Conclusion
In conclusion, upon entering https://www.google.com into one's web browser and subsequently pressing Enter, a series of intricate processes take place in the background, enabling the user to access the Google homepage. Beginning with the initial DNS request and culminating in the ultimate database access, numerous systems collaborate harmoniously to furnish the user with the desired information.