What happens when you type google.com in your browser
https://en.wikipedia.org/wiki/Google_Search

What happens when you type google.com in your browser

Introduction

In this article, we are going to discuss behind the scenes what happens when we search for a URL (Uniform Resource Locator) such as https://www.google.com in a browser such as Chrome. This is something that we do practically every day and the process behind that simple task that only takes a few seconds is a lot more complex than you imagine.

Explanation of some key concepts to understand the process

First of all, it is important to understand the following concepts:

web page:?A document that can be displayed in a?web browser?such as Firefox, Google Chrome, Opera, Microsoft Internet Explorer or Edge, or Apple's Safari. These are also often called just "pages."

website:?A collection of web pages that are grouped together and usually connected in various ways. Often called a "website" or a "site."

webserver:?A computer that hosts a website on the Internet.

A website understands what is called?HTML?(HyperText Markup Language). So these "pages" are located in computers (web servers) that provide the service of storing said files and waiting for someone to request them to deliver the content. They are called servers because their purpose is to serve the content that they hold to whoever asks for it.

There are different types of servers, such as:?database servers,?file servers,?mail servers,?print servers,?web servers,?game servers, and?application servers. In this article, we are going to focus mostly on?web servers?and a little bit on application servers.?Application servers?can be used as web servers too, but their primary job is to enable interaction between end-user clients and server-side application code. The code represents what is often called?business logic?to generate and deliver?dynamic content, such as transaction results, decision support, or real-time analytics.

HTTP:?Hypertext Transfer Protocol is an application protocol that defines a language for clients and servers to speak to each other.

IP (Internet Protocol) address:?To identify each device in the?world-wide-web, the Internet Assigned Numbers Authority (IANA) assigns an IP address as a unique identifier to each device on the Internet.

DNS:?Domain Name System is like an address book for websites. When you type a web address in your browser,?the browser looks at the DNS to find the website's IP address before it can retrieve the website. The browser needs to find out which server the website lives on, so it can send?HTTP?messages to the right place.

TCP/IP:?Transmission Control Protocol and Internet Protocol are communication protocols that define how data should travel across the internet. This is part of the?OSI?(Open Systems Interconnection)?model?which is a conceptual and logical model that describes the universal standard of communication functions of a telecommunication system. TCP/IP is part of the?transport layer (layer 4)?in the OSI model.

Firewall:?This is a division between a private network and an outer network (such as the internet). Allow, limit, and block network traffic based on preconfigured rules in the hardware or software, analyzing data packets that request entry to the network. In addition to limiting access to computers and networks.

SSL (Secure Sockets Layer):?This is a protocol that uses what is known as an 'asymmetric' Public Key Infrastructure (PKI) system. If the webpage that you are visiting has an SSL certificate (you should look for the padlock icon next to the URL) that means that the communication between you and the browser is secured. Is part of the presentation layer (layer 2) of the OSI model that was explained above. So when a webpage uses HTTPS (Hypertext Transfer Protocol Secure) that means that it has an SSL certificate and your communication is secure.

Load Balancer:?This is something widely used by large corporations to be able to satisfy a large amount of traffic through their web pages and also as a way to mitigate SPOF (Single Point Of Failure). A Load Balancer's purpose is to distribute incoming traffic across multiple servers, which increases the efficiency, reliability, and availability of your site. If one web server crashes all of a sudden, this special server (the load balancer itself is a server) automatically redirects the traffic to the remaining web servers.

Web Server:?A software that delivers content of web pages.

Database:?Are used for storing, maintaining, and accessing any sort of data. In this article, I am going to talk about RDBMS (Relational Database Management Systems) such as?MySQL.

The actual process

So now after a brief explanation of some key concepts, we can know talk about what is happening when we try to access to google URL.

So what happens when you type: https://www.google.com in your web browser:

  • The browser goes to the?DNS server?and finds the real address (IP?address) of the server that the website lives on.
  • Once the IP address is known the browser makes an?HTTP?request (GET request) to the IP address to obtain the content of the site via the?TCP/IP?protocol.
  • The request is checked by the server's?firewall?to make that everything is alright and there are not any security violations.
  • Once the server (webserver) receives the request sent by the browser after going through the firewall, the?load balancer?(server) if any, answers the request sending the data (also via TCP/IP protocol) along with the?SSL certificate?to initiate a secure session over?HTTPS.
  • Finally, the information is received by the web browser that made the request and now the information (usually: HTML, CSS, and JavaScript) is interpreted and rendered by the browser, showing the final result which is the website that you asked for, in this case: www.google.com

This is a simple explanation of the process, we can talk for hours about each point that was explained above, but it serves the purpose to understand what is happening behind the scenes when you search for a URL in the browser.

Diagram of the process explained above

I am a visual person so here you have a diagram showing all the concepts that we talked about earlier, in this case, I use the example of searching the URL: https://www.foobar.com

No hay texto alternativo para esta imagen

Note:?In the diagram above I used?Nginx?as the web server,?HaProxy?as the load balancer,?MySQL?for the database,?and sumologic?for the monitoring, to show you some of the most used in the market but of course that there are others options.

Resources:

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

Agustin Flom的更多文章

  • Startup School - Ycombinator

    Startup School - Ycombinator

    Espa?ol: Desde hace un tiempo, mi interés se ha centrado en el fascinante ecosistema de las startups, y recientemente…

    1 条评论
  • Recursion in computer science:

    Recursion in computer science:

    Introduction In programming, a recursive function is known as a function that calls itself over and over until a base…

  • Objects in Python

    Objects in Python

    Introduction: There are different types of programming languages, like: procedural programming language…

  • Dynamic Libraries in C for Linux

    Dynamic Libraries in C for Linux

    Why use libraries: In C there are two types of libraries (Static library and Dynamic library), some time ago I did a…

    2 条评论
  • How to use static libraries in C

    How to use static libraries in C

    Today I want to talk about a topic that can save you a lot of time and that is libraries. There are two types of…

  • GCC process breakdown

    GCC process breakdown

    Introduction: In some programming languages like C you need to compile your code in order to be executed, I would like…

    3 条评论

社区洞察

其他会员也浏览了