Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
What is Session Layer in the Computer Network?
The Session Layer is the fifth layer in the OSI model and one of the upper layers that provide user-oriented services. It sits between the Presentation Layer and Transport Layer, managing communication sessions between applications on different devices.
The session layer provides a defined set of services to the presentation layer and controls the structure and interaction between application programs. It synchronizes communication, manages the direction of information flow, and handles session establishment, maintenance, and termination. The service definition and protocol specifications are defined in ISO 8326 and ISO 8327.
Design Issues
The session layer is considered the thinnest layer with the fewest protocols in the OSI model. Its primary objective is to create, maintain, and synchronize dialogs between communicating upper layers. Communication can occur between users or applications, requiring careful management of session establishment and termination.
Session to Transport Communication
The session layer coordinates connection and release of dialog connections between communicating applications by interfacing with the transport layer. Three types of communication mappings are possible:
-
One-to-one − Each session layer connection maps to one transport layer connection
-
Many-to-one − Multiple session layer connections share one transport layer connection
-
One-to-many − One session layer connection uses multiple transport layer connections for service
Dialog Management
The session layer decides whose turn it is to communicate in half-duplex mode applications. Half-duplex communication allows only one side to transmit at a time, requiring alternation between sending and receiving.
Dialog management is implemented using a data token that is transmitted back and forth between communicating parties. Only the party possessing the token has the right to transmit data, ensuring orderly communication.
Activity Management
The session layer enables users to delimit data into logical units called activities. Each activity is treated as separate and independent from preceding and following activities. This mechanism is useful for:
-
Multi-file transfers − Delimiting files in large transfer operations
-
Quarantining − Collecting all data of a multi-message exchange before processing
-
Atomic operations − Ensuring all-or-nothing execution of related operations
For example, a bank transaction involving record locking, value updating, and unlocking must complete entirely or not at all. If a client or network failure occurs mid-transaction, quarantining prevents records from remaining locked indefinitely.
Exception Handling
The session layer provides a general-purpose mechanism for reporting and handling errors that occur during session management. This includes managing abnormal session termination, network failures, and application-level errors that require session recovery or cleanup.
Conclusion
The Session Layer manages communication sessions between applications, providing dialog control, activity management, and synchronization services. It ensures orderly data exchange through token-based communication and handles session establishment, maintenance, and graceful termination between network devices.
