What happens when you type google.com in your browser and press Enter
Let's break down what happens when you type "google.com" into your browser and press Enter, focusing on each step from DNS request to database interaction:
TERMINOLOGIES
DNS REQUEST
Your browser initiates a DNS request to resolve the domain name "google.com" into an IP address. The request is sent to a DNS resolver, which queries the DNS hierarchy to find the IP address associated with "google.com".
TCP/IP(TRANSMISSION CONTROL PROTOCOL / INTERNET PROTOCOL)
Having resolved google.com with its associated IP address. TCP/IP stands for Transmission Control Protocol/Internet Protocol and is a suite of communication protocols used to interconnect network devices on the internet. The TCP/IP has 4 layers which are the physical layer, the network layer, the transport layer and the application layer.
TCP, the transport layer is responsible for sending bits of data over the internet to the client in an organized yet stable manner. It also manages and monitors how a message is assembled into smaller packets before they are then transmitted over the internet and reassembled in the right order at the destination address. This is why you can pause and resume downloads after some time.
UDP(User Datagram Protocol), the transport layer also like TCP is a communication protocol used across the Internet for especially time-sensitive transmissions such as video playback or DNS lookups. A typical example would be a game stream or a live video which freezes and then resumes to the current display whenever the network goes bad or other issues occur. In this situation, data is lost and not monitored. Hence UDP is used for an application that needs to receive data quickly even if accuracy suffers.
FIREWALL
The TCP connection may pass through a firewall, a network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules. The firewall ensures that only authorized traffic is allowed to pass through, protecting against malicious attacks.
HTTPS/SSL
If "google.com" uses HTTPS, your browser initiates an SSL handshake with the server. SSL (Secure Sockets Layer) is a cryptographic protocol that encrypts the data transmitted between your browser and the server, ensuring confidentiality and integrity of the communication. During the SSL handshake, cryptographic keys are exchanged and the server's identity is verified using digital certificates.Hyper Text Transfer Protocol Secure (HTTPS) is the secure version of HTTP. HTTP requests and responses are sent and made in plain text which is visible and readable to anyone and hence not safe from hackers and definitely not confidential. Imagine having to make a transaction with your credit card online over an HTTP connection, this would be very unsafe as your important information could be hijacked by hackers. HTTPS which is the secure version of HTTP provides security to users. And how does HTTPS work? This is where SSL(Secure Sockey Layer) comes into play.
HTTPS uses SSL to encrypt communications. SSL protocols use what is known as an ‘asymmetric’ Public Key Infrastructure (PKI) system. An asymmetric system uses two ‘keys’ to encrypt communications, a ‘public’ key and a ‘private’ key. Anything encrypted with the public key can only be decrypted by the private key and vice-versa.
When an HTTPS connection is initiated, the website will send its SSL certificate which contains the public key needed to begin the session to your web browser. This process involves what is called the ‘SSL handshake’. The SSL handshake involves the generation of shared secrets to establish a uniquely secure connection between yourself and the website.
领英推荐
When a trusted SSL Digital Certificate is used during an HTTPS connection, users will see a padlock icon in the browser address bar.
LOAD BALANCER
Large-scale websites like Google often use load balancers to distribute incoming traffic across multiple servers. The load balancer sits between your browser and the server farm, routing requests to the least busy server based on factors like server load, geographic location, or server health. This ensures efficient resource utilization and high availability of the website.
WEB SERVERS
A web server is software and hardware that uses HTTP and other protocols to respond to client requests made over the World Wide Web.
A static web server, or stack, consists of a computer (hardware) with an HTTP server (software). We call it “static” because the server sends its hosted files as-is to your browser. Static web servers contain static content like HTML, CSS, JAVASCRIPT and plain text files. Basically, they contain everything we see on google’s website but without interactive perks. Imagine you type in google.com and hit Enter, then the same website returns but you can’t type in the search box, or sign in to your google account, you just have the same images and texts you see on google every day but without being able to interact with them, that is static content and that is what web servers hold.
A dynamic web server consists of a static web server plus extra software, most commonly an application server and a database. We call it “dynamic” because the application server updates the hosted files before sending content to your browser via the HTTP server.
APPLICATION SERVER
In the case of Google, the web server may communicate with various application servers running Google's services, such as search, Gmail, or Drive. These application servers execute server-side code, handle user requests, and interact with databases to generate dynamic content.
DATABASE
Finally, information is kept somewhere right? Be it for access, updating, deleting or business analytics. A database is information set up for easy access, management and updating.
Databases are used for storing, maintaining and accessing any sort of data, keeping track of customers and users, securing personal information and so on.
A database is a collection of data and is usually managed by a Database Management System (DBMS). This is where your account details and information needed by google are stored. So when we request data, it is gotten from here and sent back and now you have a fully functional google website living on your browser.
Below is an image to better describe all that was written above.
Software engineer || Backend || AlX Graduated
10 个月???? ????? ???? ??
Full Stack Software Engineer: ALX Graduate | Game Dev | Android ROM Dev | White HAT | ESP32 & Raspberry Pi dev | Environmental activist ?? | Cat obsession ?? | Let's Build the Extraordinary!
10 个月Good write-up well done ????