DEV Community

Cover image for Decoding the Layers: A Journey Through the OSI Model!
Pavankumar Hegde
Pavankumar Hegde

Posted on • Updated on

Decoding the Layers: A Journey Through the OSI Model!

Table of Contents

  1. Introduction
  2. Overview of the OSI Model
  3. Layer 1: Physical Layer
  4. Layer 2: Data Link Layer
  5. Layer 3: Network Layer
  6. Layer 4: Transport Layer
  7. Layer 5: Session Layer
  8. Layer 6: Presentation Layer
  9. Layer 7: Application Layer
  10. Conclusion
  11. Additional Resources

Introduction

The OSI (Open Systems Interconnection) Model is a conceptual model that characterizes and standardizes the communication functions of a telecommunication or computing system without regard to its underlying internal structure and technology. Its goal is the interoperability of diverse communication systems with standard protocols.

Let’s Understand........

Okay, that was the proper definition of the OSI model. The definition looks quite simple and to the point, but when it comes to the elucidation of the OSI model, many of us get confused and are not able to realize what it is. The first thing that comes to people’s mind when they hear the OSI model is that they will have to do a lot of memorization and cramming. This was exactly what happened when I read about OSI Layers the first time.

So, in this article, we will see about the OSI model and its seven layers. Therefore, read this article if you need to understand what the OSI model is all about.

Overview of the OSI Model

The OSI Model

OSI stands for “Open Systems Interconnection”. The exact definition of the OSI Model has been already given above. In simpler words, to be precise, the OSI model is a tool used by IT professionals to actually model or trace the actual flow of how data transfers in networks. So, basically, the OSI model is a logical model/representation of how the network systems are supposed to send data (or, communicate) to each other.

What is it composed of?

The OSI Model breaks down this data transfer/communication procedure into different components (called layers). Why layers, because those components follow a proper order of execution. For example, the Physical Layer in which the “physical” wiring and connections take place, the Data Link Layer in which switching takes place, etc. In total, seven layers together make up the OSI Model.

Why does the OSI model matter?

Although the modern Internet does not strictly follow the OSI Model (it more closely follows the simpler Internet protocol suite), the OSI Model is still very useful for troubleshooting network problems. Whether it’s one person who can’t get their laptop on the Internet, or a website being down for thousands of users, the OSI Model can help to break down the problem and isolate the source of the trouble. If the problem can be narrowed down to one specific layer of the model, a lot of unnecessary work can be avoided.

What are the 7 layers of the OSI Model?

  • Layer 1: Physical Layer
  • Layer 2: Data Link Layer
  • Layer 3: Network Layer
  • Layer 4: Transport Layer
  • Layer 5: Session Layer
  • Layer 6: Presentation Layer
  • Layer 7: Application Layer

Decoding OSI: Unveiling the 7 Layers


The seven abstraction layers of the OSI model can be defined as follows, from top to bottom:

Layer 7: Application Layer

  • This is the only layer that directly interacts with data from the user.
  • Software applications like web browsers and email clients rely on the application layer to initiate communications.
  • However, it should be made clear that client software applications are not part of the application layer;
  • rather the application layer is responsible for the protocols and data manipulation that the software relies on to present meaningful data to the user.

Important ports and protocols include:

  • HTTP (Hypertext Transfer Protocol): Port 80 *(HTTP) and **443 *(HTTPS**) are crucial for web communication.
  • FTP (File Transfer Protocol): Port *21 *(control) and *20 *(data) are commonly used for file transfers.
  • SMTP (Simple Mail Transfer Protocol): Port 25 is used for email communication.
  • POP3 (Post Office Protocol 3): Port 110 is used for receiving emails.
  • IMAP (Internet Message Access Protocol): Port 143 is used for accessing and managing email on a server.

Layer 6: Presentation Layer

  • This layer is primarily responsible for preparing data so that it can be used by the application layer;
  • in other words, layer 6 makes the data presentable for applications to consume.
  • The presentation layer is responsible for translation, encryption, and compression of data.
  • Two communicating devices communicating may be using different encoding methods, so layer 6 is responsible for translating incoming data into a syntax that the application layer of the receiving device can understand.
  • If the devices are communicating over an encrypted connection, layer 6 is responsible for adding the encryption on the sender’s end as well as decoding the encryption on the receiver's end so that it can present the application layer with unencrypted, readable data.
  • Finally, the presentation layer is also responsible for compressing data it receives from the application layer before delivering it to layer 5.
  • This helps improve the speed and efficiency of communication by minimizing the amount of data that will be transferred.

Layer 5: Session Layer

  • This is the layer responsible for opening and closing communication between the 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 long enough to transfer all the data being exchanged, and then promptly closes the session in order to avoid wasting resources.
  • The session layer also synchronizes data transfer with checkpoints.

For example, if a 100 megabyte file is being transferred, the session layer could set a checkpoint every 5 megabytes. In the case of a disconnect or a crash, after 52 megabytes have been transferred, the session could be resumed from the last checkpoint, meaning only 50 more megabytes of data need to be transferred. Without the checkpoints, the entire transfer would have to begin again from scratch.

Layer 4: Transport Layer

  • Layer 4 is responsible for end-to-end communication between the two devices. This includes taking data from the session layer and breaking it up into chunks called segments before sending it to layer 3.
  • The transport layer on the receiving device is responsible for reassembling the segments into data the session layer can consume.
  • The transport layer is also responsible for flow control and error control.
  • Flow control determines an optimal speed of transmission to ensure that a sender with a fast connection does not overwhelm a receiver with a slow connection.
  • The transport layer performs error control on the receiving end by ensuring that the data received is complete, and requesting a retransmission if it isn’t.

Transport layer protocols include the Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP).

Layer 3: Network Layer

  • The network layer is responsible for facilitating data transfer between two different networks.
  • If the two devices communicating are on the same network, then the network layer is unnecessary.
  • The network layer breaks up segments from the transport layer into smaller units, called packets, on the sender’s device, and reassembling these packets on the receiving device.
  • The network layer also finds the best physical path for the data to reach its destination; this is known as routing.

Network layer protocols include IP, the Internet Control Message Protocol (ICMP), the Internet Group Message Protocol (IGMP), and the IPsec suite.

Layer 2: Data Link Layer

  • The data link layer is very similar to the network layer, except the data link layer facilitates 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.
  • Like the network layer, 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).

Layer 1: Physical Layer

  • This layer includes the physical equipment involved in the data transfer, such as the cables and switches.
  • This is also the layer where the data gets converted into a bit stream, which is a string of 1s and 0s.
  • The physical layer of both devices must also agree on a signal convention so that the 1s can be distinguished from the 0s on both devices.

Conclusion

This was a short and to-the-point article explaining the OSI Model, to help out all those who are having a hard time understanding the model. Hope it will help you understand the OSI model, in case you are stuck and trying to by-heart and cram the OSI Layers.

Also, you can refer to this awesome YouTube video to get a clear picture of the OSI Model -

Alt text

Video Credits: RealPars YouTube Channel

A simple mnemonic for memorizing the names of OSI layers:

[Top to Bottem]

  • All People Seem To Need Data Processing
  • A Priest Says Ten Nuns Doing Pushups

[Bottem to Top]

  • Please Do Not Throw Sausage Pizza Away

This is for Hindi People:

  • Andhra Pradesh Se Train New Delhi Pahuchi

Connect with Me

Feel free to reach out for collaborations, questions, or just to say hello!

Additional Resources

  1. https://www.cloudflare.com/learning/ddos/glossary/open-systems-interconnection-model-osi/
  2. https://youtu.be/Ilk7UXzV_Qc?si=lcxkEnoJszTKCLYw

Recent Blog Posts

  1. Unlocking the Secrets: A Guide to TCP 3-Way Handshake

  2. Securing Connections: A Comprehensive Guide to IPSec and VPN Mastery

Top comments (0)