DEV Community

junior dev
junior dev

Posted on

How does the internet work?

About 4.9 billion people use the internet ever day, about 63% of the world's population log onto their computer's to connect to the internet but do we really know what's going on when do that? Do we even know what the internet actually is or how it works? Personally I have been asked this question and I didn't know the answer so I have decided to do some research and write a post with my findings.

There are probably about 5 steps on how the internet works which include

1. A request is sent to the DNS (Domain Name System) server.
2. DNS translates the domain name to IP address.
3. Your browser uses the IP address to send a request to Google servers.
4. Google server responds with the required files (HTML, CSS, Javascript).
5. Your browser loads the received files.

1:
Before anything else the first thing we need to talk about is the URL which stands for 'Uniform Resource Locator' which is something we use to tell the browser what we want. http:// (Hypertext transfer protocol): The first part of the URL suggests what protocol the browser should use. A Protocol in simple terms is a set of rules which the browser and the server follow to communicate to each other. www.google.com is the domain name which specifies which of the servers we want to contact. Now using this URL a request is first sent to your ISP (Internet Service Provider). The ISP forwards your request on to a DNS server.

2:
The next thing to happen would be the DNS translates the address to an IP address. When we make our request to the DNS server using the domain name www.google.com it finds the IP address and returns it back to us.

3:
Now that we have got the IP address of the Google servers we can easily contact it. Now your browser will send a request to the google servers using the IP address from the previous step requesting the google homepage from the servers.

4:
Servers have a particular software running on their machines which tells them how to respond when they get a request from a client (here www.google.com).

In our case, we sent a request to the server getting the homepage of google to which it responds by sending a copy of the HTML, CSS, and JS file present on the server to our browser which is needed to display the google homepage.

5:
Our browser receives three different files. Starting from the HTML, this file is responsible for defining the structure of the website that is it just tells the browser which part of the page is a heading, footer, image, etc. No styling is involved in this file. You can also assume HTML as the skeleton of the human body responsible for providing the structure to your body.

The CSS file is responsible for styling the whole website. It the reason you see the different colourful websites on the web. CSS is like the skin and clothes on your body which is responsible for making all of us look different.

In the last comes the Javascript which is like the muscles in a human body which is responsible for your movement and how you respond to different things. This is the programming language developers use to make the website dynamic and interactive my making the website respond to different user actions. For example, when you click on logout on any website mostly a confirmation window appears asking if you really want to log out or not.

Oldest comments (0)