Journey into the Web-Unravelling the Internet
My interest in tech aroused back when I was in high school, where I was very fascinated with how everything, especially the internet, works. How did the first computer come into existence, if operating systems are written using programming language, then how the first programming language was created, how is data transferred through wires, and what flows inside these wires, What actually is the Internet? All these endless sequences of questions were really troubling me!
Finally, After a long wait, I guess I do have a satisfactory answer to all my questions, and I will be happy if any of the readers would like to correct me if my understanding of any of the topics seems wrong! Let us start now!
How It All Began!
The Internet as we know it today, traces its origin due to competition. Interesting no? The Soviet Union in 1957 launched a satellite called "Sputnik 1". The United States was under extreme pressure to develop some advanced projects so it could compete with the soviet union. The USA launched ARPA which stands for Advance Research Project Agency. Its objective was to improve science and technology for military purposes.
Now, to communicate between different research centres which were a part of this program, like UCLA, Stanford Research Institute etc. To communicate between these different research centres, the first network, the ARPANET was made. They were using TCP(Transmission Control Protocol) for this. Arpanet was just a connection of different computers at different research centres in the states. Over time, Arpanet developed into what we now know as the Internet.
But What Is The Internet?
The Internet simply is just a network of networks. Now, what is a network? It is a bunch of interconnected devices. And these interconnected devices are connected with other interconnected devices which connect other devices and so on. How do we communicate with these devices? How are we exchanging data? Simply put, there is a set of procedures that are followed and there are defined rules for the same. These defined rules are known as protocols. There are several protocols like TCP, IP etc. which set different rules for different procedures to be followed.
The World Wide Web
While using the ARPANET, there was a problem. It was sharing of information and collaboration among researchers. Then came the Hero, Sir Tim Berners Lee-The Father of the Web. His idea was to use hypertext (which are links) that help to navigate between different pieces of information. For this, he developed the HTTP(Hypertext Transfer Protocol) for data communication and HTML(Hypertext Markup Language) for creating web pages. That is how WWW was invented.
You can think of WWW as a huge library that stores all the web pages, websites, audio, videos etc which can be accessed by requesting the librarian or in this case the web servers.
I am attaching the link to the world's first website or the world's first book in the library of the Internet.
Internet lies below the ocean
Now the natural question that should come to everyone would be, how are we connected? Short Answer-via Wires. The wires are laid below the ocean which connects different countries to the Internet. Here is a link to the submarine cable map which shows how the world is connected, via wires.
How is Data Transferred Through these wires?
The question that was constant in my mind before how data is transferred was what actually is getting transferred, like there is no physical component like water or gas that is flowing inside the wires.
Since the computer only understands high and low voltages, the electrical voltage is what flows in the wires. The computer on the server side sends a format of electrical voltage which is interpreted by the client side computer and this format of voltage is what is visible to us as our files.
Now coming to how the data is transferred. As previously stated, the transfer follows some rules which are known as protocols. For sending different types of data we have different protocols, Like the TCP. TCP ensures the complete transfer of data. So if we want to send important data, TCP can be used. Similarly, UDP is another protocol that can be used if we are okay with some data not reaching the other end. For example, we are okay with some frame drops while sending a photo on WhatsApp.
To know how are we receiving the data, let us get familiar with some terms
IP Address- it is a unique address given to our devices through which we are connected. The IP address tells the web server where the request came from and then the server sends the data to that address only.
Port Numbers- our devices have a lot of applications. now the received data from the server is not certain about which application has requested the data. To identify this, we have port numbers. Each application has its own port number which directs the received data into that application only. For example, the port number for MySql is 3306.
So the received data is sent to the IP address from where the request came and once inside, it looks for the port number to tell which application the data should be sent to.
The OSI Model-Structure of the Network
OSI stands for Open Systems Interconnected Model. It explains the steps that are taken whenever we request data from some web server. It contains 7 layers, Let us look into these;
Application Layer- This layer is what we or the user interact with. We send messages or search the web, anything through applications that we have installed on our devices, be it email or WhatsApp or any search engine.
Presentation Layer- Whatever data we sent is received by the presentation layer. Here, the conversion of the data into machine-understandable format is done. Whether it is a photo or a video or a text message, everything is converted into a stream of high and low voltages. The data is also compressed so that it becomes easier to transfer. Note that all the encryption(only visible to the person to whom the message was sent), abstraction, all this takes place at this layer only.
Sessions Layer- As the name suggests, it establishes sessions between applications and prepares them for data exchange. Once it is established, it ensures that the session remains active during the entire communication process. In this layer, the data is divided into chunks or packets, each having its own sequence number and the port number for identification
Transport Layer- It ensures the transportation of data. It is the layer that follows different protocols like TCP or UDP etc for different types of data, based on which it decides how much data is needed to be sent.
Network Layer- Since the Internet is a collection of different networks, the communication between these different networks is handled by the network layer. It ensures the best path which is to be taken for information to reach from the source to its destination. This task is handled by the router as it routes the data to its destination.
Data Link Layer- The network layer then transmits the data containing the IP address to the data link layer. the Data Link Layer ensures that messages are sent accurately and efficiently between devices on the same network, making sure they can talk to each other smoothly and without problems. It does this via MAC address, which is a physical address for the devices which are communicating. This MAC address is assigned in the Network Interface Cards and is particularly beneficial in the Local area network, helping in the unique identification of our device.
Physical layer- This consists of all the hardware devices and data in the form of 0s and 1s(electrical voltages) that are transmitted via wires and finally reaches the receiver.
With this, my first blog comes to an end! Hope you guys found it useful! Will catch you again :)
Subscribe to my newsletter
Read articles from Nikhil Bhatt directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Nikhil Bhatt
Nikhil Bhatt
Converting Tea to TypeScript