How the web works?

Abhishek Rath
3 min readApr 11, 2021

--

Nowadays almost everything is available on the web(internet).

No matter whether you are sending an email, surfing Instagram, searching for product on your mobile phone — you are using the web. Many of us may be curious to know, “How does the web work?” and “What are other technologies/components involved ?”

In this article we will dive into the working of the web in very simplest manner. First of all let us understand what is client and server.

Clients and Servers

  • Clients are the user’s internet connected devices (for example computer, mobile ) and web accessing software called as browser(Chrome or Firefox) installed on those devices.
  • Servers are the computers, on which the websites are hosted. Simply putting, server is a computer that stores websites. When a client requests for a particular webpage, a copy of that webpage is displayed on the client’s machine.
Simple client-server model

The other components of the web

  • Your internet connection : The internet connection allows you to send and receive the data.
  • Your Mobile/PC : This is the device which is connected to internet and is used to access particular website available on the web.
  • Web Browser: The software installed on your machine which allows you to browse web.(for example Chrome, Firefox, Safari etc.)
  • TCP/IP :- TCP and IP stands for Transmission Control Protocol and Internet Protocol respectively. These are the communication protocols/rules that define how the data should travel across internet. The Internet protocol suite provides end-to-end data communication specifying how data should be addressed, transmitted, and received.
  • HTTP: Hypertext Transfer Protocol (HTTP) is an application protocol designed for communication between the client and server.
  • DNS : Domain Name Servers is like phonebook or rather address book of the internet.

Exactly what happens?

As we have understood various components of the web, let us have detailed view of what exactly happens.

When you enter a web address in the browser,

1. The browser goes to the DNS server, the address book of the web. The DNS looks up for the real address of the website you want to visit.

2. The DNS returns an IP address for the server on which the target website is hosted(for example 192.168.1.102). Remember, an IP address is a unique address that identifies a device on the internet or a local network.

3. Now the browser sends an HTTP request to the server, asking it to send copy of the webpage.

4. As we have seen above, the communication between the browser and server(i.e. client and server) takes place via TCP/IP.

5. If server approves the browser’s request, then it sends response “200” to the client. The response “200” means “Here is your website! Have a look”.

6. The server starts sending the copies of website’s files (HTML, CSS, JS and other resources) to the browser.

7. The browser receives all the information and displays into a web page.

In Short

Suppose a user enters “facebook.com” in the browser. This request is passed to DNS.

The DNS returns an IP address of the server which hosts the facebook.com.

Now the browser knows exactly which server to contact due to the IP address returned by DNS.

The browser sends an request to the server via HTTP and the web server returns a response.

The browser displays the homepage of facebook.com.

That’s all from my side. If you have any queries please reach me out through Twitter or LinkedIn. Your suggestions are always welcomed, please feel free to comment them. If you enjoyed reading this article then you can follow me on medium.

Enjoy Learning !!

--

--