OSI Model Explained

The Open Systems Interconnection (OSI) model is a conceptual framework for understanding and standardizing how different networking protocols and technologies communicate with each other in a network.  

There are 7 layers in the model. 

7 Layers of the OSI Model and Examples

Physical Layer (Layer 1) 

This is the lowest layer of the OSI model. On this layer, the raw bits are transmitted physically over copper cables, fiber optics, and wireless signals. Characteristics such as voltage levels, cable specifications, data rates, and physical connectors are defined on this layer. 

Data Link Layer (Layer 2) 

This layer establishes a reliable link between two directly connected nodes over a physical medium. The data link layer has two sublayers:  

Logical Link Control (LLC) sublayer: This layer handles flow control and error checking

Media Access Control (MAC) sublayer: This layer deals with addressing and access to the physical medium.

Network Layer (Layer 3) 

The network layer routes data packets between different networks. It addresses, forwards, and routes data across various network segments. The IP (Internet Protocol) operates at this layer. 

Transport Layer (Layer 4) 

This layer is responsible for end-to-end communication between devices. It manages:  

Segmentation: This is the process where a large packet of data (files, videos, etc.) are divided into smaller segments before transmitting them on a network. This is done to ensure that the segments fall within the maximum payload size specified by the network.

Reassembly: This is the reverse process where the multiple segments are joined at the receiver’s end so that the files are received in full.

Flow control: This is the process of managing the speed at which data is sent to make sure that the receiver is not overwhelmed, which could lead to data loss due to congestion.

Error detection: These are techniques that are used to identify whether data transmitted over the network has been corrupted during transmission.

Correction: This is the next step after error detection. Once errors are detected, the transport layer attempts to fix the errors by asking for retransmission of corrupted packets.

The Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP) are examples of transport layer protocols. 

Session Layer (Layer 5) 

The session layer establishes, maintains, and terminates communication sessions between two devices. It manages: 

Dialogue control: This manages the communication process between two applications.

It ensures that data exchange follows a predefined structure or protocol to prevent conflicts, such as two applications trying to send data simultaneously or out of order.

Synchronization: This coordinates the timing and sequencing of data exchange between two applications. It ensures that data is sent and received in a manner that both sender and receiver can understand and interpret correctly. These mechanisms help avoid issues such as data arriving too quickly for the receiver to process.

In summary, the session layer ensures that data is sent, received, and processed in a way that maintains meaningful communication and prevents conflicts or confusion during a session.  

Presentation Layer (Layer 6) 

This layer handles data translation, encryption, compression, and other transformations necessary to ensure that the application layer of another system can understand data from the application layer of one system. It ensures that data is presented in a consistent format across different devices and platforms. 

Application Layer (Layer 7) 

The application layer is the topmost layer of the OSI model and is the one closest to the end-user. It provides network services directly to applications. Examples of application layer protocols include HTTP (Hypertext Transfer Protocol), FTP (File Transfer Protocol), SMTP (Simple Mail Transfer Protocol), and DNS (Domain Name System). 

How Data Flows Through the OSI Layers?

To explain this in detail, let’s take the example of a video call on WhatsApp between Mike and Sara.

Application Layer (Layer 7) 

Mike’s WhatsApp initiates the call. It prepares the audio and video data streams for transmission. 

Presentation Layer (Layer 6) 

The presentation layer is responsible for data translation and encryption. WhatsApp encrypts the audio and video data streams using a secure encryption algorithm. 

 

Encrypted Audio and Video Streams

Session Layer (Layer 5) 

The session layer plays a significant role in managing the video conference session. 

Session establishment: Mike’s application initiates a session request to Sara’s application. It includes session negotiation details, such as supported encryption algorithms and session parameters. 

 

Session Layer Data:
Session Request
Supported Encryption: AES – 256
Session ID: 99876432
Encrypted Audio and Video Streams

 

Session confirmation: Sara’s application receives the session request, negotiates session parameters, and confirms the session. 

 

Session Layer Data:
Session Confirmation
Supported Encryption: AES – 256
Session ID: 99876432

 

During the session, the session layer manages aspects like session timeouts, retransmissions, and session termination. 

Transport Layer (Layer 4) 

The transport layer adds headers for data segmentation and error checking. 

Data is divided into smaller packets, each carrying a portion of the encrypted audio and video streams. 

 

Transport Layer Headers:
Source Port: 12345
Destination Port: 54321
Sequence Numbers

Network Layer (Layer 3) 

The network layer handles routing and addressing. 

 

Network Layer Headers:
Source IP: 192.168.1.2 (Mike’s computer)
Destination IP: 192.168.1.3 (Sara’s computer)

Data Link Layer (Layer 2) 

The data link layer adds MAC addresses for local network communication. 

 

Data Link Layer Frames:
Source MAC: AA:BB:CC:DD:EE:FF (Mike’s computer)
Destination MAC: 11:22:33:44:55:66 (Sara’s computer)

Physical Layer (Layer 1) 

The entire frame, including data link layer frames, is converted into signals suitable for transmission over the physical medium. 

The encrypted audio and video streams and session management data are transmitted securely from Mike’s computer to Sara’s computer.  

Sara’s computer receives the packets, and as they traverse the OSI model in reverse, the layers handle decryption, reassembly, and session management to ensure a secure and reliable video conference call. 

 

 

 

Indusface
Indusface

Indusface is a leading application security SaaS company that secures critical Web, Mobile, and API applications of 5000+ global customers using its award-winning fully managed platform that integrates web application scanner, web application firewall, DDoS & BOT Mitigation, CDN, and threat intelligence engine.