<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shaza Aly on Medium]]></title>
        <description><![CDATA[Stories by Shaza Aly on Medium]]></description>
        <link>https://medium.com/@shaza.aly?source=rss-2055f939144d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mcS5s-uoJb-ybqFuTOn5_g.jpeg</url>
            <title>Stories by Shaza Aly on Medium</title>
            <link>https://medium.com/@shaza.aly?source=rss-2055f939144d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 17:21:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shaza.aly/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What happens when you type google.com in your browser and press Enter]]></title>
            <link>https://medium.com/@shaza.aly/0x11-what-happens-when-you-type-google-com-in-your-browser-and-press-enter-8e6f647b0403?source=rss-2055f939144d------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e6f647b0403</guid>
            <dc:creator><![CDATA[Shaza Aly]]></dc:creator>
            <pubDate>Mon, 09 Oct 2023 21:13:08 GMT</pubDate>
            <atom:updated>2023-10-09T22:09:40.921Z</atom:updated>
            <content:encoded><![CDATA[<p>Introduction</p><p>Have you ever wondered what happens behind the scenes when you type “<a href="https://www.google.com/">https://www.google.com</a>&quot; into your browser’s address bar and hit Enter? This seemingly simple action triggers a fascinating series of processes that make the web work seamlessly. In this article, we will explore step by step what happens when you initiate this request and how various components work together to deliver the web page you requested.</p><h3>DNS Request (Domain Name System):</h3><p>DNS, or Domain Name System, is a critical component of the internet that acts as a directory service for translating human-friendly domain names (like <a href="http://www.example.com/">www.google.com</a>) into IP addresses (like 192.168.1.1) that computers and networking equipment use to locate each other on the internet.</p><p>- When you type the URL “https://www.google.com&quot; in your browser and press Enter, the first thing that happens is a DNS request.</p><p>Your computer will first check its<strong> local DNS cache </strong>to see if it has recently resolved that domain. If it finds a match, it uses the cached IP address and doesn’t need to go further.</p><p>If the IP address isn’t in the local cache, your computer sends a query to a <strong>DNS resolver</strong> server. This resolver can be provided by your Internet Service Provider (<strong>ISP</strong>) or a third-party DNS service <strong><em>like Google DNS or Cloudflare DNS.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/0*HrQ56hx1f2g8pGBy.png" /></figure><p>Resource <a href="https://think.unblog.ch/en/how-to-check-and-query-dns-caching/">https://think.unblog.ch/en/how-to-check-and-query-dns-caching/</a></p><blockquote><em>Once the browser has the IP address of “</em><a href="http://www.google.com/"><em>www.google.com</em></a><em>,&quot; it establishes a TCP (Transmission Control Protocol) connection to the web server</em></blockquote><h3>TCP/IP Connection:</h3><p>TCP is one of the core protocols in the TCP/IP suite, It is responsible for <strong>establishing and maintaining a connection between two devices</strong>, ensuring the reliable and ordered delivery of data packets.</p><p>Key features of TCP include error checking, data sequencing, flow control, and acknowledgment of received data.</p><p><strong>IP is another essential component of TCP/IP. </strong>IP is another essential component of TCP/IP, It <strong>handles the addressing and routing of data packets across a network.</strong></p><ul><li>IP assigns unique IP addresses to devices on a network, allowing them to find each other. There are two main versions of IP in use today: IPv4 (32-bit addresses) and IPv6 (128-bit addresses).</li></ul><h4>Process:</h4><h4>Connection Establishment (TCP)</h4><p><strong>When two devices wish to communicate using TCP, they go through a three-way handshake process to establish a connection.</strong></p><p>The <strong>sender </strong>(client) sends a <strong>SYN </strong>(synchronize) packet to the <strong>receiver </strong>(server). The receiver responds with a <strong>SYN-ACK (synchronize-acknowledge</strong>) packet. Finally, the <strong>sender </strong>acknowledges the response with an <strong>ACK packe</strong>t. This handshake ensures both parties are ready to communicate</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/323/0*A-iqgZ5E03--hNRb.jpeg" /></figure><p>Resource <a href="https://www.scaler.com/topics/computer-network/tcp-3-way-handshake/">https://www.scaler.com/topics/computer-network/tcp-3-way-handshake/</a></p><h4>Data Transfer (TCP):</h4><p>Once the connection is established, data can be transmitted, Data is divided into <strong>packets</strong>, each with a sequence number, The receiver acknowledges receipt of each packet.</p><blockquote><em>If a packet is lost or corrupted, it is retransmitted. This ensures data reliability and integrity.</em></blockquote><h4>Firewalls may inspect individual packets of data as they pass between your computer and the internet, here it comes:</h4><h3>Firewalls</h3><p>play a crucial role in the context of browsing request sending by acting <strong><em>as a barrier between your computer and the internet. </em></strong>They are designed to enhance the security and control of your network traffic, including web browsing requests. Here’s how firewalls work in this context:</p><p><strong>1. Packet Filtering:</strong></p><ul><li>Firewalls <strong>inspect individual packets of data as they pass between your computer and the internet. </strong>Each packet contains information about its source, destination, and the type of data it carries.</li><li>Firewalls use a set of predefined rules to decide which packets are allowed to pass through and which should be blocked.</li><li>In the context of browsing, firewalls can filter out potentially harmful or malicious packets, helping to protect your computer from threats.</li></ul><p><strong>2. Port-Based Filtering:</strong></p><ul><li>Firewalls can also filter traffic based on the network ports used. Ports are like designated doors for specific types of traffic</li><li>Web browsing typically uses ports 80 (HTTP) and 443 (HTTPS). Firewalls can be configured to allow or block traffic on these ports.</li><li>For instance, they can block access to certain websites by blocking traffic on these ports, effectively preventing browsing requests to those sites.</li></ul><blockquote><em>TCP ensures that the SSL/TLS handshake messages are delivered reliably between the client (browser) and the server.</em></blockquote><h4>HTTPS/SSL</h4><p>The HTTPS/SSL handshake is a crucial process that occurs when your web browser sends a request to a secure website (one that uses HTTPS) to establish a secure encrypted connection. It ensures that the data transmitted between your browser and the web server remains confidential and cannot be intercepted or tampered with during transmission. Here’s how the HTTPS/SSL handshake works in the context of a browser request:</p><p>**1. Initiating the Connection:**</p><p>- When you enter a URL with “https://” into your browser’s address bar (e.g., <a href="https://www.example.com),/">https://www.example.com),</a> your browser knows that it needs to establish a secure connection.</p><p>- It sends a request to the web server, indicating its intention to establish a secure connection.</p><p><strong>**2. Server Authentication (Server Hello):**</strong></p><p>- The <strong><em>web server responds </em></strong>with a message that includes its SSL/TLS certificate. This <strong><em>certificate contains the server’s public key </em></strong>and is signed by a trusted Certificate Authority (CA).</p><p>- Your browser checks if the certificate is valid, not expired, and signed by a trusted CA. If everything checks out, it proceeds to the next step.</p><p><strong>**3. Client Key Exchange:**</strong></p><p>- Your<strong><em> browser generates a symmetric encryption key, called the “pre-master secret.”</em></strong></p><p>- It <strong>encrypts this pre-master secret with the server’s public key (from the certificate) and sends it back to the server.</strong></p><p><strong>**4. Server Key Exchange:**</strong></p><p>- The web server decrypts the pre-master secret using its private key, which only the server knows.</p><p>- Both the client (your browser) and server now have the same pre-master secret, which will be used for symmetric encryption and decryption of data.</p><p>**5. Session Key Creation:**</p><p>- The client and server independently derive a session key from the pre-master secret. This session key will be used for encrypting and decrypting data during the current session.</p><p>**6. Secure Data Transfer:**</p><p>- With the session key established, the browser and server switch to using symmetric encryption for data transfer. This is much faster and efficient than asymmetric encryption used in the initial handshake.</p><p>- All data exchanged between your browser and the server is encrypted and can only be decrypted by parties with the session key.</p><p>**7. Secure Connection Established:**</p><p>- Once the handshake is complete, your browser displays a padlock icon or other indicators to show that the connection is secure.</p><p>- You can now safely send your request (such as loading a webpage) over this encrypted connection.</p><p>The HTTPS/SSL handshake ensures that the data sent between your browser and the web server is secure and private. It provides encryption, server authentication, and data integrity, making it a fundamental component of secure web browsing.</p><blockquote><em>When a client (such as a web browser) makes an HTTPS request to a web application, it first reaches a load balancer.</em></blockquote><blockquote><em>a load balancer is a critical component in the architecture </em>after HTTPS/SSL encryption.</blockquote><p>The load balancer is typically configured to listen on the HTTPS port (usually 443) to accept secure connections.</p><h3>Load Balancer:</h3><p><strong>SSL Termination (Optional):</strong></p><ul><li>In some cases, the load balancer can perform SSL termination. This means it decrypts the incoming SSL traffic from clients before forwarding it to backend servers.</li><li>Decrypting at the load balancer allows it to inspect and manipulate the traffic, apply security policies, and offload the CPU-intensive SSL decryption from the backend servers.</li><li>The load balancer then <em>re-encrypts the traffic before sending it to the backend </em>servers if SSL termination is not performed.</li></ul><p>The load balancer uses load-balancing algorithms to distribute incoming requests among multiple backend servers.</p><p>This ensures that each server receives a balanced share of the incoming traffic, improving performance and fault tolerance.</p><p><strong>Request Forwarding:</strong></p><ul><li>The load balancer forwards the client’s HTTPS request to one of the backend servers based on the load-balancing algorithm’s decision.</li><li>It establishes a new SSL connection to the chosen backend server if SSL termination was performed, or it forwards the encrypted request if SSL termination was not done.</li></ul><p><strong>Backend Processing:</strong></p><ul><li>The selected backend server receives the request, which is typically still encrypted if SSL termination was not performed at the load balancer.</li><li>The backend server processes the request, which may involve executing application logic, querying databases, and generating responses.</li></ul><p><strong>Web Server:</strong></p><ul><li>The web server (e.g., Apache, Nginx) receives the request from the load balancer.</li><li>A web server is a software application responsible for handling HTTP requests from clients (usually web browsers) and sending back HTTP responses, which typically include web pages and associated resources.</li><li><strong>Static Content Delivery:</strong> Web servers are excellent at serving static content such as HTML files, CSS stylesheets, JavaScript files, images, and other assets. These resources are pre-existing files that don’t change in response to user interactions.</li><li>In many cases, especially for high-traffic websites, web servers work in conjunction with load balancers to distribute incoming requests across multiple backend servers. This ensures even distribution of the workload and improved performance and availability</li></ul><ol><li><strong>Application Server (Optional):</strong></li></ol><ul><li>An application server is a software component that specializes in executing server-side code and handling dynamic content generation. It works closely with the web server to deliver interactive and data-driven web applications.</li><li>In some cases, there is an application server (e.g., Tomcat, Node.js) that processes dynamic content or executes server-side code (e.g., handling user logins).</li></ul><p><strong>Key Functions of an Application Server:</strong></p><ol><li><strong>Dynamic Content Generation:</strong> Unlike static resources served by the web server, dynamic content varies based on user input, database queries, or other factors. Application servers generate this content on-the-fly. For example, when you log in to a web application, the application server handles the authentication process and retrieves personalized data.</li><li><strong>Server-Side Code Execution:</strong> Application servers execute server-side scripts or code written in languages like Python, Ruby, Node.js, or Java. This code performs business logic, processes forms, and communicates with databases.</li><li><strong>Database Interaction:</strong> If an application requires data storage and retrieval, the application server communicates with databases. It can send SQL queries to retrieve or update information in a structured manner.</li><li><strong>Session Management:</strong> Application servers often manage user sessions, maintaining state information between different HTTP requests. This is crucial for user authentication and maintaining user-specific data.</li></ol><p><strong>Database (Optional):</strong></p><ul><li>Databases are specialized software systems designed for storing, organizing, and retrieving structured data efficiently.</li></ul><p><strong>Key Functions of a Database:</strong></p><ol><li><strong>Data Storage:</strong> Databases store data in structured tables, ensuring data integrity and consistency. Examples include user profiles, product details, and transaction records.</li><li><strong>Data Retrieval:</strong> Application servers interact with databases through queries to fetch specific data as requested by users. Databases use query languages like SQL (Structured Query Language) for this purpose.</li><li><strong>Data Manipulation:</strong> Databases support operations like inserting, updating, and deleting data records. This ensures that data remains accurate and up-to-date.</li><li><strong>Data Security:</strong> Databases implement security features such as user authentication, authorization, and encryption to protect sensitive data.</li><li><strong>Scalability:</strong> Databases can be designed to scale horizontally (adding more servers) or vertically (increasing server resources) to handle growing data loads.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IcNmQ1PqhMMpA1XW.png" /></figure><p>https://imgur.com/a/8rzV5uQ</p><p><strong>Conclusion</strong></p><p>The journey from typing “<a href="https://www.google.com/">https://www.google.com</a>&quot; to seeing search results involves a complex interplay of components, protocols, and security measures. Understanding this process not only satisfies your curiosity but also highlights the intricate web infrastructure that enables our everyday internet experiences. The next time you press Enter, you’ll have a deeper appreciation for the seamless magic happening behind the scenes.</p><p><strong>Resources:</strong></p><p>HOW TO CHECK DNS CACHING</p><p>What is TCP 3 Way Handshake?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e6f647b0403" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>