Skip to main content

Command Palette

Search for a command to run...

Computer Networking Fundamentals

Updated
10 min read
Computer Networking Fundamentals
S

✨Avid Learner 👨‍💻Associate Programmer Analyst @ Moody's

Have you ever imagined a world without the internet? The internet has become an integral part of our daily life. It is being used for various purposes like video calling to our friends and family members, watching or uploading a video on YouTube, sending important mails and other documents through various applications etc. Even while you are reading this blog, internet has played a major role. But have you ever thought how does all of this works? How does email works, how the data transfers from one computer to the other?

Well, in this blog we are going to cover the major topics related to the working of the internet and see what all protocols and rules are being followed whenever two or more remote computers communicate with each other.

What is internet? How did it begin?

Before understanding how does the internet works, let us see what does internet means. It simply refers to the connection of two or more computers. This connection can range from a small area, and expand among various countries.

The interconnection of a large number of these computers across countries which helps us to communicate with each other create a network which is known as the internet.

The evolution of internet begin around the early 1960's when the government agencies and research workers wanted to communicate with each other and transfer files among each other. The first agency to do this was ARPA (Advanced Research Project Agencies). This allowed various researchers, scientists and engineers to communicate and transfer the files from one location to the other.

Types of Networks

As we have discussed that a network is just a collection of computers, now let us see various types of networks according to their coverage area.

LAN (Local Area Network)

LAN refers to the interconnection of computers withing a small range such as within an office or within a building. This is controlled by a single person or a department.

A number of LAN's when connected together form a metropolitan area network.

MAN (Metropolitan Area Network)

MAN refers to the connection of computers across cities. It can owned privately or publicly. Computers are connected through various modems/ routers and wires. A number of computers in the MAN when connected together form the WAN.

WAN (Wide Area Network)

This refers to the connection of various computers across countries. Not owned by a private firm, but it is available to the general public. Computers are connected using physical devices such as optical fiber cables which transmits the data to various locations.

The Client-Server Architecture

Before discussing about the OSI model, which forms the basis of internet and networking, let us first see what is client-server architecture / 2-tier architecture.

Client-Server-Architecture.png

Whenever we want to access a website, we make a request to a remote server in some other location through our browser. Here the client is the browser (which makes the requests). A server can accept this request.

For example, if you want to access www.google.com, then you will be typing this in the browser, which is the client. As soon as you press enter, a request goes to one of the servers of google, which is present at some other location. The server will accept this request, and in response will be sending back a bunch of files which will be received by our browser and it will render it to show the homepage of google. During this communication process, the client and the server communicate with each other using various protocols, such as HTTP.

Protocols are the set of rules and standards, which tell how the communication has to be done. Some of the important and well known protocols have been discussed further in this blog.

Working of the internet - The OSI model

Now that we have seen how does a client and a server communicate with each other to transfer various files and other information, let us see the underlying structure of the internet, which is the Open Systems Interconnection Model (OSI Model).

OSI-Model.png

The OSI model is needed to provide a standard or the universal way of communication between various applications. The message which has to be sent passes through these different layers and each layers adds its own functionalities. It defines the protocols at different layers which can be used and implemented by the vendors in their software or the hardware. OSI model consists of 7 layers and it is more of a theoretical approach than practical implementation.

In the modern internet, the TCP/IP model is used which consists of 5 layers and is practically implementable.

Layers in the OSI model

1.) Application Layer

It refers to the various applications with which the user interacts, example - WhatsApp, Gmail etc. They act as a window to the various clients and processes to connect with the network. The protocols which are used in this layer include HTTP (Hypertext Transfer Protocol), File Transfer Protocol (FTP), Post Office Protocol (POP), Simple Mail Transfer Protocol (SMTP), and Domain Name System (DNS).

2.) Presentation Layer

This layer is responsible for deciding how the data has to be presented to the user. Also decides how the data has to be encrypted/decrypted and compressed. The presentation layer takes the data from the application layer and then prepares it to transfer it to the session layer.

3.) Session Layer

The session layer is mainly responsible for creating, maintaining and synchronizing sessions (communication channels) and ensures that the session remains open while the data transfer is being done. This layer also adds checkpoints, so that if there is some error during data transfer, then later on the data transfer begins from the last checkpoint and not from the beginning.

4.) Transport Layer

The transport layer received the data from the session layer and breaks it into smaller pieces known as segments when the data is begin sent from the sender to the receiver and arranges these segments according to their sequence number on the opposite end. It provides the services of flow control, which ensures that the source and the destination communicate at a correct rate. Two important protocol which are used in this layer are TCP (Transmission Control Protocol) and UDP (User Datagram Protocol).

5.) Network Layer

The network layer takes the data from the transport layer and breaks it into smaller pieces known as packets. Routers are present in this layer which route the data packets from from the source network to the destination network. Protocol which is used in network layer is IP (Internet Protocol).

6.) Data Link Layer

The data link layer takes the data from the network layer and breaks these packets into smaller units of data known as frames. The data link layer adds the MAC (Media Access Control) address of the source device and the destination device. Protocol used here is Ethernet.

7.) Physical Layer

Physical layer mainly consists of the hardware devices such as cables, repeaters and hubs which are used to transmit the data through wires. An interesting fact is that the countries are connected with each other through these cables only which are underlying in the ocean. The data is transmitted within these cables at the speed of light ! 😮😮

The OSI model tells us that how the data has to be transferred from the source to the destination. But you might be wondering that how are the source and the destination devices identified on this large and complex connection of thousands of networking devices? 🤔❓

unicast.jpg

Well for identifying a device we need the IP address, MAC address and the port number as the basic requirements

1.) Requirement of IP address

An IP address is a 32-bit number which consists of 4 fields. Example: 135.168.0.1. The first 3 fields in the IP address tells us that to which network does the device belongs to, the last field is used to denote the Host-ID. An IP address is used by various routers to route the data packets to the correct numbers.

2.) Requirement of MAC address

A MAC address is a 48-bit number and every interface of your device such as ethernet, blue-tooth, Wi-Fi etc. all have different MAC addresses. It is used to identify the correct device within a network.

3.) Requirement of Port Numbers

Once it is identified that in which network the device is and it is also identified that to which device the data has to be sent, port numbers come into picture.

Consider this, on your device you are playing a game, chatting on an application and sending an email. The data corresponding to every application reaches the destination device. Now how it is identified that which data belongs to which application ?🤔 - Port Numbers is the answer to this.

Port Numbers are used to distinguish among the various applications which might be running on a device. Example - HTTP protocol runs on port 80.

Port Numbers are of 3 types:

3.1.) Well defined port number - These port numbers are already reserved by well known protocols such as TCP, FTP etc. It ranges from 0-1023.

3.2.) Reserved Port Numbers - Already registered by the well known applications such as mongoDB which runs on port 27017. These port numbers ranges from 1024-49151

3.3.) Dynamic Port Numbers - Can be used for our personal use, or by some other application. Ranges from 49152 to 65535. The OS itself assigns the dynamic port numbers to the various services and processes.

Discussion of various important and well known protocols

1.) HTTP (Hypertext Transfer Protocol) - This protocol is used when the client and server communicate with each other and HTTP tells how the client and server will be communicating with each other and how data transfer has to be done among them. It runs on Port number 80.

2.) TCP (Transmission Control Protocol )- It is the transport layer protocol. TCP ensures that all the data will reach the destination from the source and there will be no loss of data while transfer. Used while sending mails, where each and every information has to be transmitted correctly.

3.) UDP (User Datagram Protocol) - It is another transport layer protocol but unlike TCP, UDP doesn't guarantees that all the data will reach the destination. There can be few packet drops while transmission of data if UDP is used, hence it is unreliable. Used during video calling, livestreaming etc.

4.) DNS (Domain name system) - It is used to resolve the domain names to IP addresses to locate the servers. It is like the phonebook of the internet where there is an IP address corresponding to every website. To resolve domain names, firstly the request goes to the root DNS servers, which provide the path to the top level domain servers (TLD). Few examples of TLD servers are .io, .com, .org. These servers in response give the IP address corresponding to the website entered into the browser.

5.) ICMP (Internet Control Message Protocol) - This protocol is mainly used for diagnostic purposes and can be used by networking devices to send error messages if the communication between the two hosts is not happening properly.

6.) IP (Internet protocol) - This protocol is used in the network layer and converts the segments into packets. Ensures that all the data reaches the destination. Adds the network/IP address of the source and the destination.

7.) DHCP (Dynamic Host Configuration Protocol) - This protocol is uses IP address and assigns a unique IP address to each of the device which is connected within a network. With the IP address, it also provides the subnet mask, default gateway IP address and the DNS address.

8.) FTP (File Transfer Protocol) - This protocol is used to transfer files from one server to the another in an efficient and reliable manner.

9.) ARP (Address Resolution Protocol) - It is used when we know the IP address of the destination device but its MAC (Physical Address) is not known. The sender makes an ARP request which contains the destination device. The destination device makes an ARP reply with its MAC address.

10.) SSH (Secure Shell) - It is a network layer protocol which helps us to create sessions to connect and login to the terminal of a remote computer. Connections made with SSH are secure, means all the passwords, text which are begin sent over the internet are encrypted.

Summary

In this blog, we covered the basics and fundamentals of networking, discussed how the world of internet began, various types of networks along with the client server architecture for communication process.

Then the OSI model was discussed which explains the working of the internet and we also got to know how a particular device can be identified on the network. Lastly, some of the important protocols which are used in networking were discussed.

With this, we come to an end of this blog . I hope that you have got a basic understanding of how the internet works. Hope you enjoyed it, and if you did, don't forget to like it ! Thank You !😊😊