What Happens When You Type google.com on the Web Browser the Press Enter...

What Happens When You Type google.com on the Web Browser the Press Enter...

Domain Name System (DNS) Request

Whenever you enter a domain name or website on your browser, the browser saves the DNS record in its cache.

Thus, when you type a domain name like "google.com" on your web browser, it checks its cache for the most recent copy of the DNS record for that domain.

If there is a recent copy of the DNS record for that domain, the browser uses the IP address in the cache to send a request to the server. This speeds up the process of converting the domain name to an IP address because it bypasses the need to send a request to the DNS server.

However, if the browser cache does not have a recent copy of the DNS record or if the DNS record has been updated since the last time it was cached, the browser sends a request to the DNS server to convert the domain name to an IP address.


DNS Lookup Process:

The browser sends a request to the local DNS resolver, which is often provided by the internet service provider (ISP). The local DNS resolver checks its cache for the most recent copy of the DNS record for the domain. If it has it, it sends the IP address back to the browser. If the local DNS resolver does not have the most recent copy of the DNS record, it sends a request to a root nameserver. The root nameserver replies with the address of a top-level domain (TLD) nameserver, such as .com

The local DNS resolver sends a request to the TLD nameserver.

The TLD nameserver responds with the address of the authoritative nameserver for the domain.

The local DNS resolver sends a request to the authoritative nameserver.

The authoritative nameserver responds with the IP address for the domain.

The local DNS resolver sends the IP address back to the browser.

The browser sends a request to the server at the IP address to retrieve the webpage.


The duration for which the DNS record is cached (known as the "TTL" or "Time To Live") is determined by the authoritative nameserver and can be customized by the domain owner.


TCP/IP connectivity

TCP (Transmission Control Protocol) and IP (Internet Protocol) are two of the primary protocols that constitute the internet. They work in conjunction to establish a link between a client and a server and facilitate the exchange of data between them. When you input "google.com" into a web browser, the browser employs TCP/IP to establish a link with the server that hosts the website.


The browser uses IP to send a request to the server to establish a connection.

The server receives the request and sends a message back acknowledging the request to establish a connection. This is known as the handshake procedure.

Once the handshake is completed, the browser can use TCP to send a request for the webpage it wants to access (in this instance, the homepage of google.com). This request is made using TCP, which ensures that the request is sent reliably and in the correct sequence.

The server receives the request and sends the HTML code for the homepage of google.com back to the browser. This response is also sent using TCP to ensure dependable transmission.

The browser receives the HTML code and uses it to display the webpage on your screen. Any resources (such as images) that the webpage requires are also requested and received using TCP/IP.


Firewall protection

A firewall is a security system that regulates and monitors incoming and outgoing network traffic based on predetermined security policies. Its primary objective is to safeguard a network from external threats, such as hackers and malware.

When you type a URL like "google.com" into your browser, the request that your browser makes to Google's server passes through the firewall en route. The firewall examines the incoming request to ensure that it is permitted based on its security policies.



HTTPS/SSL

HTTPS (Hypertext Transfer Protocol Secure) is a safe version of HTTP, which is used to transmit data on the internet. It encrypts the data sent between your browser and Google's server.


SSL (Secure Sockets Layer) and TLS (Transport Layer Security) are encryption protocols that ensure the safety of data transmitted over HTTPS.


When your browser connects to Google's server using HTTPS, it agrees with Google's server on the version of SSL/TLS to use and creates a secure, encrypted channel for data transmission.

To explain what is happening here, let me use an analogy.

HTTPS is like a locked box used to send messages over the internet. When you use HTTPS to send a message, you put it in the locked box and send it to the recipient. Only the recipient has the key to unlock the box and read the message.


SSL/TLS are like special codes used to lock and unlock the box. When you use HTTPS to send a message, you and the recipient agree on the code to use to lock and unlock the box. This way, only you and the recipient know the code and can read the message.


When you enter "google.com" into your browser, the browser is like the sender of the message. The server hosting google.com is like the recipient. The browser sends a request for the webpage using HTTPS, which is like putting the request in a locked box and sending it to the server. The server then sends the webpage back to the browser using HTTPS, which is like putting the webpage in the locked box and sending it back to the browser.


Load-balancer

A load balancer is a tool that distributes incoming network traffic across a group of servers or resources. Its main function is to ensure that the traffic is distributed evenly across the servers to prevent overloading any single server and to increase the overall capacity and reliability of the system.


Google, which receives billions of website visitors a day, requires many servers to serve all these users. Therefore, they need to set up a load balancer to ensure that some servers are not overburdened while others are underutilized. When a browser tries to access google.com, the load balancer receives the incoming request from the browser and forwards it to one of the servers in the Google server network. The server chosen will depend on the type of load balancing algorithm implemented.


Web Server?

A web server is a software that is in charge of managing requests for web pages from clients (such as a browser attempting to access google.com). When a client sends a request for a web page to a website server, the server handles the request and returns the appropriate response to the client.

This means that Google's server will obtain a request from the load balancer when attempting to access google.com.

The web server would then handle the request and produce a response, which would usually consist of the HTML, CSS, and JavaScript files that make up the web page.

The website server would then send this response back to the load balancer, which would forward it to the browser. The browser would then use the HTML, CSS, and JavaScript files to display the web page for the user.


Server for Applications and Database

Unlike the web server, the application server handles dynamic content. When using "google.com," the application server will be responsible for producing the search results (which change based on the query you input into the search engine).


When you submit a search query to Google, the request is first sent to the load balancer, which forwards it to one of the web servers in the Google server network. The web server then sends the request to the application server, which handles the request and produces the search results. Depending on the complexity of the search query, the application server may need to make a request to a database to retrieve the necessary data.

For instance, if you are searching for a particular product on an e-commerce website, the application server may need to obtain information about the product from a database.

Once the application server has acquired the required data, it sends it back to the website server, which includes it in the response that is sent back to the browser. The browser then uses this information to display the search results to you.


Displaying the Web Page

When a browser receives a response from a website server, it processes the HTML, CSS, and JavaScript files that are included in the response in order to display the web page. The displaying process involves interpreting the HTML and CSS code, displaying any images or other media that are included on the page, and executing any JavaScript code that is present on the page.


In your instance, your browser would receive the response from the website server, which includes the HTML, CSS, and JavaScript files that make up the Google web page. The browser will utilize these files to display the webpage and present it to you. This method typically includes the following:

presenting the text and pictures on the webpage in the appropriate positions

arranging the text and design in line with the CSS styles

performing any JavaScript code that exists on the webpage

After the webpage has been entirely displayed, you can now engage with it by pressing links, typing text, or interacting with other features on the webpage.


This is a summary on what happens:

  1. The browser checks its DNS cache for any existing record it has for google.com. If it doesn't find one, it makes a DNS request to your configured DNS server to resolve google.com to an IP address.
  2. The DNS server looks up the IP address for google.com in its records, and returns the IP address to your browser. Common IP addresses for google.com include 142.250.190.78, 142.250.190.110 etc.
  3. Your browser opens a TCP connection to the IP address on port 80 (default HTTP port). It sends a HTTP GET request for the / path.
  4. The request goes to a Google front-end load balancer which forwards the request to a Google webserver.
  5. The Google web server handles the request and sends back a HTTP response containing the contents of the google.com homepage.
  6. The browser renders the HTML, CSS, JavaScript etc and displays the Google homepage to you.
  7. The browser also caches the DNS lookup, so future requests to google.com skip steps 1-2 until the cache expires.
  8. The connection remains open for some time to handle additional resource requests and render the full page.
  9. Once done, the TCP connection is closed or persists for future browsing on google.com.

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

Ephraim Shikanga的更多文章

社区洞察

其他会员也浏览了