Session Layer
The 5th layer of the OSI model, responsible for establishing, managing, and terminating communication sessions between applications.
Overview & Functions
The Session Layer works between the Transport Layer (Layer 4) and the Presentation Layer (Layer 6).
The Manager
Creates, manages, and cleanly closes communication.
Main Functions
1. Establishment
Creates a communication session between sender and receiver. (e.g., User logs into a server).
2. Management
Keeps the session active during communication, handling synchronization and coordination.
3. Termination
Properly closes the session when communication ends. (e.g., Logging out from a website).
4. Dialog Control
Controls who can send data and when. Supports Half-Duplex (one at a time) and Full-Duplex (both simultaneously).
5. Synchronization
Adds checkpoints. If connection fails at 4GB during a 5GB transfer, it resumes from 4GB instead of 0.
6. Token Management
Prevents two devices from sending data at the same time using a token system.
Working Process
Session Creation
Connection between applications is established.
Authentication
User identity may be verified (e.g., validating credentials).
Data Exchange
Actual communication takes place between the client and server.
Synchronization
Checkpoints are created periodically to ensure data integrity during transfer.
Session Closing
Session is cleanly terminated after completion.
Session Layer Protocols
NetBIOS
Allows applications on different computers to communicate over a LAN. Widely used in Windows networking.
- Naming
- Session management
- Data transfer
RPC (Remote Procedure Call)
Allows one computer to execute functions on another computer.
- Cloud services
- Distributed systems
SMB (Server Message Block)
Used primarily in Windows networks for sharing resources.
- File sharing
- Printer sharing
- Resource sharing
PPTP
Point-to-Point Tunneling Protocol.
- VPN communication
- Secure tunneling
Comparisons & Architecture
| Transport Layer vs Session Layer | ||
|---|---|---|
| Feature | Transport (L4) | Session (L5) |
| Main Role | End-to-end delivery | Session management |
| Data Unit | Segment | Data |
| Reliability | Error & flow control | Session synchronization |
| Session Layer vs Presentation Layer | |
|---|---|
| Session Layer | Presentation Layer |
| Manages sessions | Manages data format |
| Synchronization | Encryption/compression |
| Dialog control | Translation |
| Session establishment | Data representation |
OSI vs TCP/IP Regarding Session Layer
OSI Model
- • Separate Session Layer exists (Layer 5)
- • Dedicated session management
TCP/IP Model
- • No separate session layer
- • Functions are combined in the Application layer and Transport layer.