<?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 Elias Igwegbu on Medium]]></title>
        <description><![CDATA[Stories by Elias Igwegbu on Medium]]></description>
        <link>https://medium.com/@igwegbu_94567?source=rss-1ea6ce851418------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Elias Igwegbu on Medium</title>
            <link>https://medium.com/@igwegbu_94567?source=rss-1ea6ce851418------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 20:49:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@igwegbu_94567/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/@igwegbu_94567/what-happens-when-you-type-google-com-in-your-browser-and-press-enter-14009dcc9c19?source=rss-1ea6ce851418------2</link>
            <guid isPermaLink="false">https://medium.com/p/14009dcc9c19</guid>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[load-balancing]]></category>
            <category><![CDATA[http-request]]></category>
            <dc:creator><![CDATA[Elias Igwegbu]]></dc:creator>
            <pubDate>Mon, 17 Apr 2023 03:50:52 GMT</pubDate>
            <atom:updated>2023-04-17T03:50:52.127Z</atom:updated>
            <content:encoded><![CDATA[<p>Author: Elias Igwegbu. April 2023</p><p><strong>1.</strong> <strong>Introduction</strong></p><p>This article explains in plain English, in a style that should be easy for the layman to understand, the sequence of events from the time a user types in google.com into the address bar of his web browser and presses enter, to the time the web page is displayed on his screen. For simplicity, examples in this blog will be based on a computer running Linux.</p><p><strong>2.</strong> <strong>The URL: What the Customer Ordered</strong></p><p>The text “google.com” typed by the user is known as a URL (Uniform Resource Locator). In this case the URL provided is just the domain name, google.com, which identifies a computer system or service on the network. In this instance it is simply a label for the website that the user wants to view, much like picking a name in a phonebook in order to make a phone call.</p><p>The web browser usually has no idea where this web page is located, but like looking up a phone number in a phone book, the web browser knows how to find out. The web browser is a programme that is running on our local computer, known as the <em>client</em>, and is attempting to display information that may be available in an entirely different computer, known as the <em>server</em>. The web page may be located in a computer, called the <em>web server</em>, that could be thousands of miles away from the user, and even in another country. The system that enables the web browser to discover the location of the web page is called the Domain Name System (DNS).</p><p><strong>3.</strong> <strong>The DNS Request: The Computer Network’s Phone Book</strong></p><p>Computers on a network identify one another using a number like <em>35.175.135.222</em> and not a name like <em>igwegbu.tech</em>. This number is called the IP address of the computer. IP is short for Internet Protocol. At present there are two schemes for IP addresses: the original IP version 4 scheme, and the newer IP version 6 scheme designed to extend and replace it. IP version 4 is still by far the most common and available on most computers.</p><p>In order for the web browser to download and display the requested web page, it first needs to find out the computer where the web page is being hosted. The DNS provides a structured mechanism for doing exactly that. The process starts with the web browser (or other application) requesting the operating system (like Linux or Microsoft Windows) via a service called the <em>stub resolver</em> to lookup the domain name and obtain an IP address. Each computer maintains a local inventory of IP addresses and host names, called the <em>hosts</em> file (located in /etc/hosts on Linux computers). The stub resolver checks this file. If it can’t find the IP address in the hosts file it escalates the task to another computer listed in its records known as the <em>DNS recursive resolver</em>. There are many possible DNS recursive resolvers out there on the Internet. Some of the most popular ones include the Google DNS resolver 8.8.8.8 and Cloudflare DNS resolver 1.1.1.1. The particular one to use can be specified in the client computer’s configuration files as part of its system setup by the system administrator. On a Linux computer the file <em>/etc/resolv.conf</em> contains configuration information about the DNS recursive resolver that has been configured for our client computer.</p><p>The DNS recursive resolver undertakes the task of locating the IP address and escalates this task to other computers (or servers) as necessary. The IP address may be found in the <em>cache</em> of any of these intermediary servers. Ultimately the request may reach the authoritative DNS server, or <em>nameserver</em>, for that website’s domain.</p><p>A DNS server has records, called A records, showing the IP addresses for all domains or subdomains in its custody. Besides these records bearing the IP addresses, the DNS server also maintains several other types of records for the domains in its custody. These include CNAME, DNAME, MX, TXT and NS.</p><p>Once the DNS system has successfully located the required IP address, it is passed back to the stub resolver, which maintains a cache for future reference, and then finally to the browser that requested the service. Now armed with the correct IP address of the computer that is apparently hosting the website, the browser can now initiate a communication with it.</p><p><strong>4.</strong> <strong>TCP/IP: Enabling Computers to Communicate over a Network</strong></p><p>Once the IP address has been discovered, the next step is to initiate communication with the host computer that has the required web page in its custody.</p><p>TCP (Transport Control Protocol) and IP (Internet Protocol), together generally known as TCP/IP, is a simplified four-layer model that governs the communications between computers on the Internet. The four layers are abstractions known as the Link, Internet, Transport and Application layers. The Transport Layer, in particular, defines the transport protocols (or set of rules) called TCP and UDP (User Datagram Protocol) which are used by computers to exchange information. TCP requires a handshake and confirmation for each data packet sent, and is as such very accurate but slower than UDP which is “<em>stateless</em>”. TCP is used for communication where lost packets would not be tolerated, like web browsing, whereas UDP is used in applications where a few lost packets would not be critical, such as in video streaming.</p><p>In addition to the 4-layer TCP/IP abstraction model, there is also the 7-layer Open Systems Interconnection (OSI) model. Both the TCP/IP and the OSI models are comparable but different. On the OSI model, Layer-4 is the Transport Layer, and covers TCP and UDP protocols, while layer 7 is the Application Layer that covers protocols like HTTP (hyper-text transmission protocol) and SSH (secure shell).</p><p><strong>5.</strong> <strong>Firewall — Keeping out unwanted visitors.</strong></p><p>Security and privacy are very important on the Internet. Therefore, it is necessary for computers to only allow access to trusted visitors. The firewall is a key part of the mechanism for doing this.</p><p>At the fundamental level, armed with an IP address, you can locate a computer anywhere on the Internet, but in order to penetrate the computer you still need to pass through one of its many ports. Ports are logical, rather than physical, abstractions, numbered 0 to 65,535. Although ports function just like physical ports on a computer, they are purely logical abstractions. Still, access through these ports is restricted and controlled by software known as the firewall. For example, to retrieve a web page from a web server, you typically need access to port 80 on the web server’s computer. Computers can be configured to use different port numbers for different purposes, but some port numbers are reserved or recommended for some well-known services, such as 80 for HTTP, 443 for HTTPS (secure HTTP) or 22 for secure shell (SSH).</p><p>So, in order for our client to be able communicate with the web server, appropriate ports must be open on both the client and server computers.</p><p>The system administrator or installer of the web server software configures (i.e. opens) the right ports during software installation.</p><p>The traffic between our client computer and the Internet also passes through a number of intermediary devices, such as a router or a proxy server. A router separates the internal, private, network (intranet) from the external, public network or Internet. Computers (like our client computer) sitting behind the router may have IP addresses (called private IP addresses) that are not accessible from the Internet. A system known as NAT (Network Address Translation) makes it possible to relay traffic received by the router to the appropriate computer within the internal network (or Local Area network, LAN).</p><p><strong>6.</strong> <strong>HTTPS/SSL: The Application Layer</strong></p><p>Armed with the correct IP address, and hopefully with the right ports open, our browser crafts a message known as an HTTP Request that will be despatched to the web server, requesting for the web page to be sent across.</p><p>Web browsers display information using a combination of content and mark-up information, structured in a logical format known as HTML — HyperText Markup Language. The resulting document is known as a web page and is stored on the web server, as a static file, or one that can be generated on request by an <em>application</em> server.</p><p>The main protocol governing the exchange of this web page document is known as HTTP (HyperText Transfer Protocol), or HTTPS (for the securely encrypted version). HTTP operates at Layer 7 of the OSI model. Years ago, HTTPS was mostly used for exchanging sensitive data like e-commerce or personal data, but nowadays due to rising concerns about privacy online and the preponderance of e-commerce, HTTPS is now very much mainstream on major websites, and a request for google.com is most likely going to be handled over HTTPS rather than plain HTTP. Google maintains a service called Chrome’s HTTP Strict Transport Security (HSTS) preload list, which enables web browsers to know in advance if they should send messages to a registered website as HTTPS by default.</p><p>There are several different types of HTTP requests — GET, PUT, POST, HEAD, DELETE, OPTIONS, etc. To download a web page, our browser would typically craft and send a GET request.</p><p>A HTTP message (which can be a <em>request</em>, to a server, or a <em>response</em> from it) is a simple message consisting of a one-line start-line, an optional set of headers containing information about the message (or metadata), a blank line and an optional body that contains the main content of the message.</p><p><strong>7.</strong> <strong>Load-balancer: The “Good” Man In the Middle</strong></p><p>You may have heard of the term “man in the middle” in connection with hostile network actors (or <em>hackers</em>) intercepting a message on the Internet. Well, load balancers are the exact opposite: they intercept the message meant for the web server, but for a very good purpose — to help spread the load on individual servers in a very busy website, to provide redundancy for security purposes, or to increase the overall capacity of a website.</p><p>A load balancer could be software, such as HAProxy, installed on a virtual or physical machine somewhere, or a dedicated piece of purpose-built hardware. HAProxy, in particular, is a very popular <em>open-source</em> software-based load balancer, capable of handling very heavy workloads. A proxy server typically sits between a <em>client</em> computer and the Internet. HAProxy sits between the Internet and the web <em>servers</em>, and is thus also known as a <em>reverse</em> proxy server.</p><p>For a large website like google.com, a cluster of load balancers could even be required, in order to cope with the high workload. Therefore, in trying to reach google.com, the IP address that our web browser has obtained is most likely not that of the actual web server that will provide the web page, but that of the load balancer or other proxy server. Regardless, our web server will communicate with this server, whatever it is, as if it were the actual web server, over HTTP/S. The load balancer will re-route the request to the appropriate web server, using one of several load balancing algorithms (such as <em>round-robin, least-connections, URI-hash, </em>among others) to select the particular server that will serve us, depending on the actual configuration of the load balancers.</p><p>Load balancers can also provide a feature known as <em>SSL/TLS termination</em> or <em>SSL offloading.</em> This feature means that the encrypted HTTPS Request can be decrypted by the load balancer for inspection before forwarding either the plain or the re-encrypted message to the web-browsers. SSL/TSL termination can relieve the web servers of the burden of having to decrypt and encrypt messages and to manage the SSL certificates involved in the process. However, the traffic between the reverse proxy and the web servers is thus still vulnerable to man-in-the-middle attack, even though the risk is reduced if this portion of the network is on a private intranet.</p><p><strong>8.</strong> <strong>Web Server: the HTTP Warehouse</strong></p><p>One way to think of the web server is like a warehouse (or warehousing <em>service</em>) that serves <em>static</em> web pages. The web server typically consists of software (like Apache, Nginx, Cloudflare, LiteSpeed or Microsoft IIS), running on a dedicated computer (virtual or physical) on the network. So, when, finally, our browser has been able to reach the web server (or one of the web servers behind the load balancer), the “customer’s” order can hopefully now be fulfilled by locating and serving the requested web page. But in modern websites like google.com the situation is more complicated.</p><p>For a start, the URL google.com merely provides the domain name, and does not explicitly mention the <em>filename</em> of the actual web page, like <em>index.html</em>. When the filename is omitted, as in the URL google.com, a default is assumed, and is typically index.html or similar.</p><p><strong>9.</strong> <strong>The Application Server: The Website’s Kitchen</strong></p><p>Even if the filename were explicitly mentioned, the requested file may in fact not exist on the web server, just like a meal ordered in a restaurant may not actually exist, but could be prepared in the kitchen at a short notice.</p><p>Typically, the requested web page needs to be generated on demand, or <em>dynamically</em>, by the <em>application</em> server. The application server is an application that may sit in the same computer as the web server or, typically, in a different computer on the network. In any case the web server will contact the application server, which could be using DNS and TCP/IP again over the network, in order to try and obtain the requested web page.</p><p>The application server hosts the application that defines the application’s logic. The application server also stores the source code for the application.</p><p><strong>10.</strong> <strong>The Database: The Website’s Data Store</strong></p><p>A database is a software system for storing a large amount of data in a structured way for easy access and retrieval. There are several types of databases, but the most common type is known as relational databases. A relational database stores data in tables which consist of rows called records and columns called fields, and are related to one another via key column(s). Examples of relational databases include Oracle, MySQL, Microsoft SQL Server and PostgreSQL. Relational databases share a common language for manipulating them, known as SQL (Structured Query Language, often pronounced like “sequel”). There is now a growing interest in a new class of non-relational or NoSQL databases, such as MongoDB.</p><p>In a modern website like google.com, web pages display content that is constantly changing. Current relevant data is maintained in a dedicated database. In order to construct the web page, the application server connects to this database and queries it for the relevant data. The application server then uses this data to construct the requested web page and then passes the web page over to the web server.</p><p><strong>11.</strong> <strong>HTTP Response: Message to the browser</strong></p><p>Once the web browser has obtained the requested web page, it crafts a suitable message known as HTTP Response which will be sent back to the web browser in fulfilment of the order. Like the HTTP Request, the response consists of a status line, a set of headers and a body. The first line of the message contains a status code, such as 200 (OK), 301 (Moved Permanently) and 404 (Not Found). The body typically contains the actual web page in HTML format.</p><p>If the requested web page was not found or not available for any reason, the web server sends back an appropriate HTTP Response message, often using a template web page dedicated for that feedback.</p><p>The journey of the HTTP Response message passes through the reverse proxy server (load balancer), if any, in either plain or encrypted form, between the web server and the reverse proxy server. When using SSL termination, the reverse proxy server re-encrypts the message before sending it to the web browser.</p><p>The route taken by the HTTP Request and the return route taken by the HTTP Response message may be slightly different, due to the large number of intermediaries on the Internet. Further, both the HTTP Request and HTTP Response messages are sent not as a single package but as a large number of tiny pieces known as packets, in order to optimise the usage of the network capacity, or bandwidth. The packets are re-assembled once received. The feedback mechanism in TCP ensures that every packet is correctly received or retransmitted in order to ensure accurate delivery of the complete message.</p><p><strong>12.</strong> <strong>Painting the Picture</strong></p><p>The browser uses the data in the HTTP/S response to paint a picture of the web page on the screen. The complete web page is likely composed of several pieces which are requested separately by the web browser and joined together in other to build a complete web page. These pieces may include text, images, video clips and other content.</p><p>The different elements of the complete web page are described by an object-oriented model known as the Document Object Model (DOM). The DOM enables developers to programmatically manipulate parts of the web page in order to modify it, using scripts typically written in JavaScript. The DOM also provides a way to access the components of the web page in order to style the web page using CSS (Cascading Style Sheets).</p><p><strong>13.</strong> <strong>Conclusion</strong></p><p>After a user types google.com into the address bar of his web browser, he triggers a long chain of events which could involve several other computers and other resources on the local and external networks/Internet. The process utilises several quite complex technologies. All these can take place in a fraction of a second. The complexity of the process is totally transparent to the user, which makes the web browsing experience so magical, at least until the dreaded 404 message appears… a reminder that web pages are resources that may be sourced from miles away, using several advanced technologies that we know so little about.</p><p>Author: Elias Igwegbu. April 2023</p><p><em>Elias Igwegbu is an engineer, and an applied technology enthusiast and writes from the UK.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14009dcc9c19" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>