OSI Layers in Computer Networks
OSI - stands for Open Systems Interconnection.
It is a structure or layout which describes how the data is transferred across a network. A network is a group of devices (servers, laptops, phones, etc.) interconnected via cables, wires or even wireless.
There are seven layers in the OSI model (OSI structure):
Application Layer (7th Layer)
Presentation Layer (6th Layer)
Session Layer (5th Layer)
Transport Layer (4th Layer)
Network Layer (3rd Layer)
Data Link Layer (2nd Layer)
Physical Layer (1st Layer)
1. Application Layer
It is the 7th and last layer in the OSI model. It is the actual application where the user interacts with the server. Here, the data is user-friendly. Eg: Web Pages, Apps, etc.
Example: When a user requests the website ibasa.in in the browser, then the website is opened in the browser, where he can able to interact with it. Here the web page ibasa.in is an application layer.
2. Presentation Layer
It is the 6th Layer in the OSI model. In this Layer, the data is properly encrypted with the TLS (Transport Layer Security), and even it can decrypt it. Here, data is also compressed to faster transfer. This Layer ensures that data is in proper format to deliver to the application layer.
3. Session Layer
It is the 5th Layer in the OSI model. This Layer Manages the connection between the user and the server. A session is like a conversation between two devices or applications, and the session layer ensures that this conversation should happen smoothly and securely.
Example: User Logging into a secured website with a username and password.
4. Transport Layer
It is the 4th Layer in the OSI model. Here, the data is broken down into small packets. This Layer ensures the reliability (data is transferred with accuracy without any loss) of the data.
In this layer, there are TCP and UDP connections. Both are used to transfer the data.
Transport Control Protocol:
Ensures complete data is transferred without any loss. It is Reliable.
A Connection is established before the communication between the client (user) and server.
Example: Web browsing and chatting platforms use TCP connection.
Drawback: TCP has the latency. The data can be transferred slowly.
User Datagram Protocol:
Ensures quick transfer of the data.
It is useful when speed is more important than accuracy.
Example: For video calls, online gaming UDP connection is used.
Drawback: It is unreliable. The data can be lost while having a UDP connection.
Note: Protocol is nothing, it is just a set of rules.
5. Network Layer
It is the 3rd Layer in the OSI Model. It handles the routing, addressing and delivering of the data packets. It assigns a sender and receiver IP address to each data packet for proper delivery of the data.
Routing determines the best path for the data to travel to its destination (here is the server) from its source (client or user).
Example: When you access a website, the Network Layer ensures your request is routed from your device to the server.
6. Data Link Layer
It is the 2nd Layer in the OSI Model. It transforms the data packages into thin data frames. It also detects the errors in the data transmission. Sometimes also correct those errors.
Example: When your laptop connects to a wifi router the data link layer ensures a reliable data frame is received and sent via a wireless medium.
7. Physical Layer
It is the first layer in the OSI model. In these, the data is in the form of electrical signals or radio waves. This layer is physically connected to the data. The data frames coming from the data link layer get converted into electrical signals or radio waves. Cables and wires are referred to as a physical layer.
If data frames are coming via wifi, then they will convert as radio waves in the physical layer via air medium.
If data frames are coming via ethernet, then they will convert as electrical signals in the physical layer via wires or cables.
Example: Wireless data transfer using a physical layer that forms radio waves when the device is connected to wifi.
Example: Loading of a web page when the user makes a request in the browser
When a user types ibasa.in in the browser (Application Layer).
Then user device communicates with a DNS server to resolve the domain name to an IP address (Application & Presentation Layers).
A session is established with the user and the server (Session Layer).
The user request is broken down into packets (Transport Layer) and routed over the internet (Network Layer).
The packets are sent as electrical signals or radio waves (Physical Layer) over the user’s internet connection.
The server processes the request and sends the response back, travelling back up the OSI layers to the user’s browser, where the page is displayed.
Conclusion:
In conclusion, Open Systems Interconnections is a layout which consists of 7 layers. From Application Layer to Physical Layer. It ensures that the data is transferred properly and securely across the network. It gives a basic understanding of how the data gets transferred from one device to another.