Understanding the Web

Understanding the Web

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

Have you ever wondered what exactly happens when you type in a web address in your web browser and press enter? This topic is something that has been written so many times that if you did a quick Google search about it you will find thousands of articles about it. You may wonder why all these fuss for just one simple action in a browser, typing in an address and hitting enter. Well, you guessed it right, it’s not so simple after all.

Lets say you are asked “What happens when you open your eyes?” someone may answer this question detailing about the brain-eye coordination, someone else may detail in the muscular activity and even someone may take the question spiritual rather than physical. So that’s exactly why there are all these articles about this one topic.

So lets first understand what www.google.com is before we go anywhere else. To do that we have to dissect it, dissecting www.google.com will give us 2 things.?

  1. The domain namegoogle.com
  2. The subdomainwww

What is Domain?Name?

A domain name is an identification string registered in the DNS(Domain Name Server) that defines a realm of administrative autonomy, authority or control within the Internet. In our example google.com is the domain name.

What is a Subdomain?

A subdomain is an additional part to your main domain name. Subdomains are created to organize and navigate to different sections of a website. A website can have multiple subdomains or child domains.

So in our example, google.com has several subdomains, for example, to mention a few:

  • mail — mail.google.com
  • developers — developers.google.com
  • docs — docs.google.com

Here mail, developer and docs are all subdomains of google.com.?

So what is the point of discussing all these? Well just like all those 3 subdomains, www is also a subdomain of google.com (www.google.com).

So when you type in www.google.com and hit enter, you are requesting a subdomain page of google.com. So we typed in www.google.com in the address bar and hit Enter, so what happens next?

Address Resolution

So the first thing the browser is going to do is resolve www.google.com, so what do we mean by resolve?

So everything on the internet has an IP address, IP address is literally an address of a specific device on the internet and it’s through the IP address that we can communicate. So every domain name and subdomain has an IP address and is registered in a DNS (Domain Name Server). So what is DNS?

Domain Name Server?(DNS)

Well DNS is a server that contains a map of domain names to their IP addresses. This is the server the browser contact in order to resolve the IP address from the address.

So right after we hit Enter the browser now contacts the DNS to get the IP address of www.google.com. And then the DNS replies to the browser with the IP address of www.google.com. So what happens next?

Browser sends a request to the IP?address

Now since the browser now has the IP address, now it can contact the server to serve its contents. Usually this request is done through a GET request. Once the browser sends a GET request, the server replies with its contents, which is usually an HTML code. So what happens next?

Translate the?code

Now the browser got the HTML code from the www.google.com server, so now the browser has to translate the code received and make it human readable.

So you may be wondering how is just one server going to handle billions of request everyday? Well it's not because there are hundreds of servers. But how does one coordinate all these servers to serve the same content? Well now we go to the concept of Load Balancing. So what is a load balancer?

Load Balancer

When we make a request to www.google.com, the first component of the host server’s architecture we hit will be a load balancer. The load balancer will first present an SSL certificate, launching the HTTPS validation process explained above. It will also serve as an endpoint for encryption; meaning, everything passed in and out of the host server will be respectively decrypted and encrypted at this juncture.

However, security is not the primary function of load balancing software. As the name suggests, the load balancer’s job is to delegate client requests evenly across the web servers at this IP address. This is critical behavior for any website with moderate to high traffic. For example, a website like “facebook.com” might employ thousands of largely identical web servers, each the files necessary to load the website in your browser. The load balancer makes sure that each of these web server instances receive an even number of requests, as one web server would be immediately overwhelmed by the traffic a site like Facebook receives. But what is a SSL certificate? Well for that we have to talk about what a secure connection is.

Securing the Connection

HTTPS (Hypertext Transport Protocol Secure) is a secure version of HTTP (Hypertext Transport Protocol). It dictates a secure transfer of information using SSL (Secure Sockets Layer) encryption. SSL is yet another protocol which standardizes the method of encryption. Before a client and server can establish an HTTPS connection, they must undergo a validation procedure, commonly referred to as a “handshake”. Put simply, this handshake looks like the client and server sharing a unique cipher with one another which they can then use to encrypt and decrypt the extent of their following communications. But who or what protects the server? It is the Firewall. So what is a Firewall?

No alt text provided for this image

Firewall

Now that our connection to www.google.com has been secured and our request delegated to an available web server, we must pass through that server’s firewall. A firewall wall is a security mechanism which regulates traffic in an out of a server. While SSL is concerned with protecting the content of a communication itself, firewalls make sure the host is only communicated with trusted entities in the first place. It does this by managing the opening and closing of ports, as well as validating the service or client attempting to access an opened port.

Web Server

Finally, we’ve made connection with the software which will serve us the webpage we’ve requested. A web server is the component of server architecture tasked with actually relaying static web pages to the client. As I mentioned above, often times many identical web servers will sit behind a load balancer serving the same content to different client requests. More often than not, HTML files are being served. If the webpage we’ve requested is dynamic, the web server will need some help generating a static page for delivery.

Application Server

An application server runs any programs, applications or codebases needed to serve the client a webpage. Say you’re querying a file conversion site to convert a .jpeg into a .png. The web server will take your request — in this case the file to convert — and pass it on to an application server which will run a program to perform the actual conversion. When the conversion has been made, the converted .png will be returned to the web page, which will in turn serve it to the client. The application server could also be used to populate an HTML file with dynamic content stored on an adjacent database server.

Database

When we make the request for this page, an application server might query a database to find the most recent posts stored within. For example, you arrive at a website to which you’re already logged in. The the page appears, your name is listed at the top right, along with a greeting. The server has a record of your IP stored in a database along with your name and all sort of other information which is relevant to your unique interaction with this webpage.

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

社区洞察

其他会员也浏览了