What is OSI Model | 7 Layers Explained

The OSI model (Open Systems Interconnection model) is a conceptual framework that describes how data is transmitted over a network. It is divided into seven layers, with each layer responsible for a specific function. I’ll try to give you a simplified explanation of each layer and an example of what it does:

  1. Physical Layer: This layer deals with the physical aspects of data transmission, such as cables, connectors, and signal strength. An example of this layer would be a network cable, which physically connects devices together.
  2. Data Link Layer: This layer is responsible for providing error-free transmission of data over a physical link. It does this by adding a header and trailer to the data, which includes error detection and correction information. An example of this layer would be Ethernet, which is used to connect computers to a local area network.
  3. Network Layer: This layer is responsible for routing data between different networks. It uses logical addresses to identify the source and destination of data packets. An example of this layer would be the Internet Protocol (IP), which is used to route data across the Internet.
  4. Transport Layer: This layer provides reliable, end-to-end delivery of data by dividing large data packets into smaller segments and ensuring they are received in the correct order. An example of this layer would be the Transmission Control Protocol (TCP), which is used to provide reliable data transmission over the Internet.
  5. Session Layer: This layer establishes, maintains, and terminates communication sessions between applications running on different devices. An example of this layer would be the Remote Procedure Call (RPC), which is used to enable communication between different applications.
  6. Presentation Layer: This layer deals with the formatting and encryption of data to ensure it can be understood by different systems. An example of this layer would be the Secure Sockets Layer (SSL), which is used to encrypt data transmitted over the internet.
  7. Application Layer: This layer provides network services to applications and end-users. It includes protocols for file transfer, email, and remote login. An example of this layer would be the Simple Mail Transfer Protocol (SMTP), which is used to send email over the internet.

In addition to understanding each of the OSI layers, it’s good to understand what Encapsulation and Decapsulation are. They are processes that occur at different layers of the OSI model and are essential for data transmission over a network.

  • Encapsulation is the process of adding headers and trailers to data as it moves down the layers of the OSI model. Each layer adds its own header and trailer, which contains specific information about the data, such as the sender and receiver addresses, error-checking information, and protocol identification. The encapsulated data is then passed down to the next layer.
  • Decapsulation, on the other hand, is the process of removing the headers and trailers from the data as it moves up the layers of the OSI model. Each layer checks and removes its own header and trailer before passing the data up to the next layer. The decapsulation process continues until the original data is reached, which is then delivered to the appropriate application.

To give an example, let’s say a user wants to send an email to another user over the internet. The email is first encapsulated at the application layer by adding an SMTP header and trailer. It is then passed down to the transport layer, where a TCP header and trailer are added to ensure reliable delivery. Next, at the network layer, an IP header is added to route the email to its destination. Finally, at the physical layer, the email is converted into a series of electrical signals and transmitted over the network.

At the receiver’s end, the electrical signals are converted back into digital data and are passed up through the physical layer to the application layer. Each layer removes its respective header and trailer until the original email message is received intact.