Ever imagined what happens when you type a URL in the address bar of the browser and hit enter?
What happens when you click on a link?
What is the Internet? How does the Web work?
What is client, server, https, domain name system server, etc.? What do we mean by these jargons?
By the end of this article, you will be well versed in the Internet and all its related technology!
What is Internet?
The Internet is a global network of interconnections of computers. It's like a big spider web where each node of the web is like a computer. The Internet, in simple words, is the connection of all the computers in the world. As the computers are interconnected due to this network "Internet,“ they can talk with each other, communicate, and exchange information.
For example, a person in India using his computer can communicate with another computer used by the person in the USA. They can send emails, pictures, and pdf’s to each other. Thanks to the Internet.
Let us understand the Internet in depth with a diagram.
We understood the main work and meaning of the internet - linking computers and communicating with one another. Exchanging information was the main goal of the Internet.
We understood the concept of the Internet, but still, how does a website stored on the server get loaded in your browser just by typing the URL? How does all this happen? Is it magic? Let's understand the inner engineering of this masterpiece, Internet.
When we type URL (fancy name for link) in the browser, the website gets loaded. So this happens due to the client server architecture and its request response model.
Client - Server Architecture(Request Response Model)
So when client(user/device/browser) enters the URL(link) in the browser, a request is made to the server(a machine that contains your website code and runs 24×7). The server(machine containing your website code) then sends a response back with the website code, and this code is rendered by the browser, and you can see the website.
So in simple terms, the client (user) sends a request to the server (the machine containing the website’s code), and the server in return sends the website's code as a response. This website's code is rendered by the browser, and successfully you can see the website and use it.
What is HTTP?
HTTP stands for HyperText Transfer Protocol. Http is basically a set of rules used to transfer the web document containing hyperlinks (plain old links).
So some rules are to be followed if we need to send a web/text document containing links; this is the primary role of HTTP. So while communicating between systems, we follow the HTTP.
Let's go a bit more in depth about client-server communication.
As shown in the above diagram, the client-server communication is not that simple; it's quite complicated. Let's try to understand in simple layman's terms. The client sends a request to the server, and the server, in return, sends a response as files containing the website’s code, but how does the browser (client) know the address of the server where the website is stored? We only know the name of the website (domain name), for example, google.com, but how, by just typing google.com in the browser, does it reach the server, as the client (browser) does not know the address of the server where the website is stored?
This address of the server is found by translating the domain name (name of the website, for example, google.com) into its corresponding IP address, and this IP address is the address of the server where the website's code is stored. This translation of domain to IP address is done by the Domain Name System Server (DNS Server). In the above diagram, you can see how complex the process of translating a domain to an IP is; this process of translating a domain to an IP is called DNS Resolution. It's a bit complex; it involves communicating with root servers and their top-level domains, then the authoritative name server, and so on, until the IP address of the website is not returned by the DNS to the browser.
Once we get the IP address of the server, we then use HTTP to communicate with the server, and then the request-response cycle continues…
Conclusion
The Internet is a global network of interconnected computers. Using the Internet, computers communicate with each other.
There’s a lot in terms of loading a URL; the client sends a request to the server, and the server sends a response giving the website’s code. The client uses HTTPS to communicate. For the client to communicate with the server using HTTPS, first it needs to know the IP address of the server. We get the IP address of the server from the DNS server; it does DNS resolution and gives us the IP address of the server, and then we use HTTP to communicate with the server(and then the request response cycle goes on).