Hi folks ☀️,
In this article, I’ll break down the OSI Model—the framework that explains how networks communicate. I’ll guide you through each layer—- making complex network processes simple to understand.
I’ll also show you which protocols are used at each layer, giving you a clear view of how data flows across networks. Let’s get started!
What is the OSI Model ?
The Open Systems Interconnection (OSI) model is a theoretical model created by the International Organization for Standardization(ISO) which enables different communication systems to communicate with each other,using standard protocols.
In simple terms ,the OSI Model is like the universal language for computer networking. It breaks down communication systems into 7 layers, each stacked on top of the other.
Each layer has tasked with a specific job and communicates with the layers above and below itself.
Why OSI Model is used ?
OSI Model used troubleshooting network problems.Although modern day Internet does not strictly follow the OSI Model it follows the TCP/IP protocol suite. Whether there is a lag in a Youtube livestream ,or there is website being down for thousands of users, the OSI Model helps us to breakdown the issues and narrow down it into a specific layers which saves a lot o unnecessary work.
What are the 7 layers of OSI Model ?
The 7 conceptual layers of the OSI Model are as follows :-
1. Physical Layer :-
This layer includes the hardware components such as cables and switches to transfer data. In this layer the data is converted into bit stream i.e.strings of 0’s and 1’s .The physical layer of both devices must also agree on a signal convention so that the 1’s can be distinguished from the 0’s on both devices.
2. Data link Layer :-
The data link layer is very similar to the network layer, except that the data link layer enables data transfer between two devices on the same network. The data link layer takes packets from the network layer and breaks them into smaller pieces called frames.
The data link layer is also responsible for flow control and error control in intra-network communication (The transport layer only does flow control and error control for inter-network communications).
3. Network Layer :-
The network layer helps transfer data between two different networks. If both devices are on the same network, this layer is not needed. It divides the segments from the transport layer into smaller units called packets at the sender’s end, then reassembles them at the receiving device. The network layer also determines the best physical path, or route, for the data to reach its destination. This process is called routing.
Packets are small units of data transmitted over a network, containing information such as the destination, source, and payload.
Network layer protocols include IP , ICMP (Internet Control Message Protocol), IGMP (Internet Group Management Protocol), and the IPsec suite.
4. Transport Layer :-
The Transport Layer is reponsible for reassembling the segments into data so that the session layer consume on the recieving side . It is also resposible for taking data from the sessions layer and breaking it up into chunks before sending into Layer 3(network layer).
segments are smaller chunks of data that the transport layer breaks down for transmission across a network.
The Transport layer protocols include TCP (Transmission Control Protocol) and UDP (User Datagram Protocol).
5. Session Layer :-
The session layer is responsible for the opening and closing communiucation between two devices .
The time between when the communication is opened and closed is known as the session
The session layer ensures that the session stays open still the data exchange between devices is completed.
The session layer has a feature like checkpoint which ,in case of a disconnect between the devices enables the session to resume from the last checkpoint.
6. Presentation Layer :-
This layer prepares the data so that the application layer can use it. In other words, the presentation layer makes the data ready for applications to work with. It handles translating data into a format that the receiving device's application layer can understand.
If the devices are using different encoding methods, the presentation layer translates the incoming data into a format the application layer can understand.
When communicating over an encrypted connection, the presentation layer adds encryption on the sender’s side and decrypts it on the receiver’s side, so the application layer receives the data in a readable, unencrypted form.
Encryption is the process of converting plain, readable data into a secure, coded format that can only be accessed by someone with the correct key or password. It helps protect information from being accessed or understood by unauthorized users.
Additionally, the presentation layer compresses data it receives from the application layer before passing it on to layer 5. This helps improve communication speed by reducing the amount of data that needs to be transferred.
7. Application Layer :-
This layer is the only layer that communicates with the user data.Software application like web browser and email client rely on the application layer to communicate.
This layer is responsible for the protocols and data manipulation that the software uses to present meaningful information to the user. It ensures that the data the software needs is properly formatted and displayed in a way that makes sense.
The application layer protocols include HTTP, which is used for transferring web pages, and SMTP (Simple Mail Transfer Protocol), which is used for sending emails.
How Data Travels Through the OSI Model
In order for human-readable information(eg-messages) to be transferred over a network from one device to another, the data must travel down the seven layers of the OSI Model on the sending device and then travel up the seven layers on the receiving end.
For example: Let’s say you want to send a message to a friend using WhatsApp. You type your message in the WhatsApp app on your phone and click send . The WhatsApp app will pass your message to the application layer, which will select the right protocol (like TCP) and pass the data to the presentation layer. The presentation layer might compress the message before it moves to the session layer, which starts the communication session.
Next, the data reaches the transport layer, where it gets divided into smaller pieces called segments. These segments are then turned into packets at the network layer, which breaks them down further into frames at the data link layer. The data link layer sends these frames to the physical layer, where they are converted into a stream of 1s and 0s and sent over a physical connection, like Wi-Fi.
When your friend’s phone receives the message through Wi-Fi, the data follows the same process but in reverse. The physical layer converts the 1s and 0s into frames, which are passed to the data link layer. The data link layer reassembles these frames into packets, and the network layer turns the packets into segments for the transport layer. The transport layer then reassembles the segments into the complete message.
The message flows into the session layer, which passes it to the presentation layer, where any compression is removed. Finally, the presentation layer sends the raw message to the application layer, where it’s displayed in the WhatsApp app on your friend’s phone, ready for them to read and reply.
— End