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


DNS Lookup

The Domain Name System (DNS) acts like a giant phonebook for the internet. It translates human-readable domain names (like "google.com") into machine-readable IP addresses (like 172.217.7.206, which is a current IP for Google).

But how do I actually get the IP address corresponding to the domain name I searched for ?

  • it sends a request to a DNS server, typically provided by your internet service provider (ISP). (ISPs play a vital role in the DNS process, but they don't manage the domain name registry itself.). In our case we are searching for type A DNS Records, which is a type the DNS Translates into an IP address.

  • When you connect to the internet through your ISP, it provides you with a DNS server address. This DNS server acts as the initial point of contact for resolving domain names.
  • When you enter a domain name like "google.com," your browser contacts this ISP-provided DNS server.
  • If the answer isn't in the cache, the ISP's DNS server acts as a middleman, querying the authoritative nameservers (specified by the domain name's NS records). Once retrieved, the IP address is sent back to your browser and cached for future use.

Now of Course you’re asking what NS Records are ?

NS records are like signposts on a highway, directing the DNS to the correct location (authoritative nameserver) where the actual DNS information for your domain resides.

  • This record tells the DNS where to find the authoritative DNS server for your domain name. If you use a third-party DNS provider(Like the ISP),? they will provide you with the NS record values to point to their nameservers. Incorrect NS records can completely disrupt the DNS lookup process, as the DNS wouldn't know where to find the A record information for your domain.

So Ns in a ISP’s DOmain name space points to the authorized domain name servers

TCP/IP and HTTPS/SSL

Now that your browser has the IP address for Google's server (e.g., 172.217.7.206, current IP for Google), it needs to establish a reliable connection for data transfer. This is where TCP (Transmission Control Protocol) comes in.

Before initiating data transfer, your device sends a SYN (Synchronize) packet to Google's server. The server responds with a SYN-ACK (Synchronize Acknowledgment) packet, and your device completes the handshake with an ACK (Acknowledgment) packet. This handshake confirms a reliable connection (Three-way handshake).

This is because TCP offers mechanisms to ensure reliable data transfer with a high probability (It tries to not drop any packets).

Once the TCP connection is established, your browser sends an HTTP (Hypertext Transfer Protocol) request message to Google's server. This request typically specifies the desired resource (e.g., the homepage for "google.com") using verbs like GET or POST.

Google's server processes the request, retrieves the necessary files like HTML, CSS, and JavaScript, and sends an HTTP response message back to your browser. The response contains the requested data and additional information like status codes.

HTTPS/SSL:?

This is the secure version of HTTP. It adds a layer of encryption using TLS/SSL.

SSL/TLS Certificate:

This is a digital document issued by a trusted Certificate Authority (CA) that verifies the identity of a website. It contains cryptographic keys used to encrypt and decrypt data during an HTTPS connection.Only the authorized parties (browser and server) possess the decryption key, allowing them to understand the transmitted data. This helps prevent you from unknowingly interacting with a fraudulent website designed to steal your information.

Data(The Web Page) is broken into packets, and each packet is assigned a sequence number.

The receiving end acknowledges receipt of packets, and retransmission occurs for missing or corrupted packets.

It's becoming increasingly common practice for websites to use HTTPS even when sensitive information isn't involved. This is because it helps to:

  • Prevent eavesdropping: With an SSL certificate, the data traveling between the browser and the website is encrypted, making it unreadable to anyone trying to intercept it.
  • Ensure authenticity: The SSL certificate verifies that you're actually connecting to the real website you intend to visit, and not a fake one set up by attackers.

?

Firewalls

Firewalls act as security barriers between your internal network (e.g., your home network) and the public internet. They filter incoming and outgoing traffic based on predetermined rules.

Source and Destination: Firewalls can verify the IP addresses of the computers involved (your device and the website) and allow or deny communication based on predefined rules.

Port Numbers: HTTPS typically uses port 443 for communication. Firewalls can ensure that traffic claiming to be HTTPS is indeed using the correct port.

Certificate Validity: Some advanced firewalls can be configured to check the validity of SSL/TLS certificates presented by websites. However, this usually involves additional setup and might not be a default behavior. The firewall might check if the certificate is valid (issued by a trusted CA) and hasn't expired. This can be an additional security measure to help prevent connections to fraudulent websites that might use invalid certificates.

However, it's important to note that firewalls typically don't decrypt the actual data being exchanged during the HTTPS connection. They primarily focus on controlling the flow of traffic based on predefined parameters.

Load Balancing?

The load balancer acts like a smart traffic director. It receives your request for google.com and analyzes factors like your location and current server load.

Based on this analysis, the load balancer directs your request to the nearest and least busy Google data center that can handle your search efficiently. This minimizes travel time (latency) for your request.

Google doesn't publicly disclose the exact details of their load balancer for security reasons. However, based on information available from industry sources and Google's own publications, it's widely believed that Google uses a custom-built load balancer called Maglev

Web Server/Application server

Web servers:

Think of a web server like a librarian who retrieves and delivers books (the static content) from a library (the website's storage) based on your requests (URLs). Similarly, A web server is essentially a software program that sits between your web browser and a website's backend. Its primary responsibility is to deliver static content (like HTML pages, images, CSS files, and JavaScript) to users in response to their requests. If the resources are found, the web server sends them back to your browser.

Examples: Apache, Nginx, Microsoft IIS

?Your browser receives the HTTP response and starts interpreting it. It understands the HTML structure, applies the CSS styles, and executes any JavaScript code present and, finally, your browser renders the page on your screen, just as you see it.

Application servers:

An application server is a more heavyweight software program that acts as a platform for executing business logic and generating dynamic content. It sits behind a web server and handles the complex interactions between the user interface (web browser) and the backend systems (databases, application logic code).

Examples: Apache Tomcat, JBoss, WebLogic Server

Think of an application server as a head chef in a restaurant. It receives orders (requests) from the web server (waiter), retrieves ingredients (data) from the pantry (database), processes them according to recipes (business logic), and prepares the final dish (dynamic content) to be delivered to the customer (web browser).

Data Base?

Imagine a giant filing cabinet that stores information electronically. That's basically a database! It's an organized collection of data, like a library for information you can access and manage easily.

If you have a Google account and are signed in while browsing, Google might access a user database to Remember your search settings and filters.

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

社区洞察

其他会员也浏览了