Session Layer in OSI Model: Functions, Design Issues & Synchronization
0Sahil Dubey
COMPUTER NETWORKS • CHAPTER 32
Session Layer in OSI Model: Functions, Design Issues & Synchronization
Imagine two computers are working together on a long task.
They start communication, exchange data for some time, pause at important points and finally close the communication.
If something fails in the middle, starting the whole work again may waste a lot of time.
The Session Layer was designed to help organise this kind of long-running communication.
Layer 5Session Layer
Dialog ControlWho communicates and when
SynchronizationCheckpoints and recovery
Session ManagementStart, maintain and end
Direct Answer
The Session Layer is Layer 5 of the OSI model. It manages logical communication sessions between applications.
Its major functions include session establishment, session maintenance, session termination, dialog control, token management, synchronization and recovery.
Synchronization allows checkpoints to be placed inside long communication so that after a failure, work may continue from a recent checkpoint instead of restarting everything.
What Is the Session Layer?
The Session Layer is the fifth layer of the OSI reference model.
It sits between the Transport Layer and Presentation Layer.
Its job is to organise communication sessions between applications.
Simple Definition:
The Session Layer establishes, manages, synchronizes and terminates communication sessions between applications.
Transport Layer can move data between application processes.
But long application communication may need more than simple data transfer.
For example:
When should the communication session start?
Which side is allowed to perform a particular action?
Where should checkpoints be placed?
What happens if the communication stops in the middle?
How should the session end?
The Session Layer focuses on organising and controlling a communication conversation, not on routing packets or providing physical transmission.
What Is a Session?
A session is a logical period of communication between two application entities.
It has a beginning, an active communication period and an end.
1. Start
Establish the communication session.
2. Manage
Control the ongoing dialog.
3. Synchronize
Insert checkpoints when required.
4. End
Terminate the session cleanly.
Session Life:
Start -> Manage -> Synchronize -> End
Session Communication Concept
Application A
Session User
SESSION MANAGEMENT
Dialog + Sync + Control
Application B
Session User
Functions of the Session Layer
1
Session Establishment
Creates a logical session between communicating applications.
2
Session Maintenance
Keeps track of an active communication session.
3
Session Termination
Ends the session after communication finishes.
4
Dialog Control
Coordinates which side can communicate and in what manner.
5
Token Management
Can use logical permission tokens to control sensitive session operations.
6
Synchronization
Places synchronization points or checkpoints in long communication.
7
Recovery
Helps communication resume from a known synchronization point after interruption.
8
Activity Management
Helps organise logical activities inside a longer session.
Session Establishment
Before a managed communication session can begin, the two session users must agree to start it.
During establishment, parameters related to the session may be agreed.
Examples include:
Session identity
Dialog behaviour
Synchronization requirements
Session control options
Session Establishment:
“Let us begin this communication session.”
Session Maintenance
Once the session is active, the Session Layer helps maintain its logical state.
It may keep track of:
Who currently has permission to perform an operation.
Where synchronization points exist.
Which activity is currently active.
Whether communication must be paused or resumed.
Session Termination
After communication is complete, the session should be closed properly.
A controlled termination is useful because both sides know that the session has ended normally.
Session termination is a logical session-management function. It should not be confused with TCP FIN-based connection termination at the Transport Layer.
Dialog Control in Session Layer
Dialog control defines how the two communicating entities participate in a session.
A dialog may conceptually be organised as:
One side at a time.
Both sides communicating in both directions.
Dialog-Control Visual
Half-Duplex Style
One participant communicates at a time.
User A
User B
Full-Duplex Style
Communication can occur in both directions.
User A
User B
Dialog Control:
Controls the direction and organisation of conversation between session users.
Token Management
Some session operations should not be performed by both sides at the same moment.
A logical token can be used to give permission to one participant.
User A
Wants permission
SESSION
TOKEN
User B
Waits until token is passed
Simple Idea:
Whoever holds the required session token gets permission to perform that controlled session operation.
A Session Layer token is a logical permission-control concept. It is not the same as an Ethernet frame, IP packet or security login token.
Synchronization in Session Layer
Synchronization is one of the most important Session Layer concepts.
During a long data exchange, synchronization points can be inserted at selected positions.
These points work like checkpoints.
Synchronization Point:
A known point in a long communication from which the session may be logically resumed after interruption.
Checkpointing Explained
Suppose a large file or long transaction has been processed in several parts.
Instead of restarting from zero after a failure, the session can remember completed checkpoints.
Long Session With Synchronization Points
Start0%
CP-120%
CP-240%
CP-360%
CP-480%
Finish100%
Checkpoint Trick:
Failure after checkpoint → Resume from last safe point instead of repeating everything.
Minor and Major Synchronization
OSI Session concepts distinguish different levels of synchronization.
Minor Synchronization
Used for lighter intermediate synchronization during an activity.
Major Synchronization
Marks a more significant synchronization boundary and can support stronger activity-level recovery control.
Exam Point:
Synchronization points divide long communication into manageable sections so recovery can begin from a known point.
Session Recovery After Failure
Consider a session with checkpoints every 100 units.
A failure occurs at unit 370.
Last Safe Checkpoint
300 units completed.
Failure
Communication stops at 370.
Recovery
Resume logically from checkpoint 300.
Only work after the last checkpoint may need to be repeated.
Recovery Rule:
Restart from the last valid synchronization point.
Activity Management
A long session can contain several logical activities.
The Session Layer can conceptually organise these activities so they can be started, interrupted, resumed or completed in a controlled manner.
Activity 1
Login session begins.
Activity 2
Large task begins.
Activity 3
Task synchronized.
Activity 4
Session ends.
Session Layer Design Issues
A Session Layer design must solve several control problems.
Session Identification
How is one logical session distinguished from another?
Session Establishment
How do both participants agree to begin?
Dialog Discipline
Who is allowed to communicate or perform a controlled action?
Token Management
How is permission passed between participants?
Synchronization
Where should recovery checkpoints be inserted?
Resynchronization
After failure, from which known point should communication continue?
Session Release
How should the session end normally?
Failure Handling
What should happen if one participant disappears or the underlying connection fails?
Activity Management
How should long session activities be organised?
Dialog Discipline as a Design Issue
If two participants perform an exclusive operation at the same time, the session can become inconsistent.
The design must therefore define:
Who can initiate a particular operation.
When control can change sides.
Whether communication is one-way-at-a-time or two-way.
Orderly Session Release
A session should ideally end in a controlled way.
Both participants should know whether:
The work completed normally.
The session was aborted.
Recovery may be required.
Session release is about logical conversation management. Transport connection release is a lower-layer function.
Resynchronization as a Design Issue
After an interruption, the two sides must agree about the point from which the session will continue.
If one side believes checkpoint 5 is valid while the other side believes checkpoint 4 is valid, recovery becomes inconsistent.
Resynchronization Goal:
Both sides return to one agreed, known session state.
Failure Handling
Failures can happen because of:
Network interruption
Application crash
System restart
Unexpected session termination
The Session Layer concept therefore includes recovery and resynchronization mechanisms for long-running communication.
Session Layer vs Transport Layer
Transport Layer
Provides process-to-process data transport.
Session Layer
Organises logical communication sessions.
Application
Uses the communication for user or software tasks.
Point
Transport Layer
Session Layer
OSI Layer
Layer 4
Layer 5
Main Focus
Process-to-process transport
Logical session management
Reliability
Can provide reliable transport, such as TCP
Uses session-level synchronization and control concepts
Dialog Control
Not its primary OSI role
Important function
Synchronization Points
Not a standard Transport Layer checkpoint function
Important Session Layer concept
Examples
TCP, UDP
Often implemented inside higher-level protocols and applications in modern networks
Easy Trick:
Transport = Move the data.
Session = Manage the conversation.
The TCP/IP model does not normally define a separate Session Layer.
Session-related functions are generally handled by:
Application protocols
Application frameworks
Remote procedure mechanisms
Login or communication software
Important Exam Difference:
OSI has a separate Session Layer.
TCP/IP normally combines these higher-level responsibilities into its Application Layer.
Simple Real-Life Examples of Session Layer Concepts
Example 1 — Long File Operation
A large operation begins.
Checkpoints are created after important sections.
Communication fails.
Work resumes from the last known checkpoint.
Example 2 — Remote Login Session
User starts a logical login session.
Commands and responses continue inside that session.
User logs out and the session ends.
Example 3 — Database Conversation
An application opens a logical database session.
Multiple requests are exchanged.
Session state may be maintained until the application disconnects.
Modern real applications may implement these session-like functions at the Application Layer rather than using a standalone OSI Session Layer protocol.
Solved Session Synchronization Examples
Example 1: Resume From Last Checkpoint
A 500 MB data operation creates a checkpoint every 50 MB.
Failure occurs after 370 MB.
Checkpoint Interval = 50 MB
Last Completed Checkpoint = 350 MB
Failure Point = 370 MB
The session can logically resume from:
350 MB checkpoint
Only:
370 - 350 = 20 MB
of already-performed work may need to be repeated.
Example 2: Number of Checkpoints
A task is 1000 units long.
A checkpoint is created every 100 units.
Number of intervals = 1000 / 100
= 10
There are 10 checkpoint intervals across the operation.
Example 3: Failure Near the End
Checkpoints exist at:
100, 200, 300, 400, 500
Failure occurs at 470.
The last valid checkpoint is:
400
Repeated work:
470 - 400 = 70 units
Example 4: No Synchronization
Suppose a 2-hour task has no checkpoints.
Failure occurs after 1 hour 50 minutes.
If no recovery point exists:
The application may have to repeat the complete operation from the beginning.
This shows why synchronization points are useful for long-running work.
Example 5: Dialog Token
Two applications should not update the same shared session activity at the same moment.
A logical token is given to Application A.
Application A performs the controlled operation.
Application B waits.
After the token is passed, Application B may perform the operation.
Example 6: Session vs Transport Failure
Suppose a long application session uses a lower-layer connection.
The lower-layer connection fails after checkpoint 6.
After a new underlying connection is created, application/session logic may attempt to continue from:
Checkpoint 6
instead of repeating all work from the start.
Session Layer Remember Tricks
Layer Number:
Session = Layer 5
Main Job:
Manage the conversation.
Session Life:
Start -> Maintain -> Synchronize -> End
Dialog Control:
Who talks and when?
Token Management:
Who has permission?
Synchronization:
Where can we safely restart?
Checkpoint:
Save a known communication point.
Recovery:
Resume from the last valid checkpoint.
OSI vs TCP/IP:
OSI has Session Layer.
TCP/IP usually handles these functions inside Application Layer software.
Common Session Layer Exam Mistakes
1. Session Layer is Layer 4.
Wrong. Transport is Layer 4. Session is Layer 5.
2. Session Layer performs IP routing.
Wrong. Routing is a Network Layer function.
3. Session Layer and Transport Layer are the same.
Wrong. Transport moves application data between processes, while Session Layer organises logical communication sessions.
4. Synchronization means clock synchronization.
Not in this context. Session synchronization mainly refers to checkpoints and controlled recovery positions.
5. Checkpoints prevent every failure.
Wrong. They do not prevent failure. They reduce how much work may need to be repeated after failure.
6. Token management means password authentication.
Wrong. Here token management means logical permission control for session operations.
7. Session termination is always TCP FIN.
Wrong. TCP FIN is Transport Layer connection termination. Session termination is logical Session Layer management.
8. Session Layer is always separately implemented in modern TCP/IP applications.
Wrong. TCP/IP normally does not define a separate Session Layer. Applications often implement session functions themselves.
Wrong. Synchronization and checkpointing are Session Layer concepts in the OSI model.
10. Full-duplex communication means only one side can speak at a time.
Wrong. Full-duplex communication supports both directions.
11. A session is always identical to one TCP connection.
Wrong. A logical application session and a Transport Layer connection are different concepts.
12. Recovery must always restart from zero.
Wrong. With valid synchronization points, recovery may continue from a recent known point.
40 Important Session Layer Questions With Answers
1. What is the Session Layer?
The Session Layer is Layer 5 of the OSI model and manages logical communication sessions between applications.
2. Which OSI layer number is the Session Layer?
Layer 5.
3. Which layer is above the Session Layer?
Presentation Layer, Layer 6.
4. Which layer is below the Session Layer?
Transport Layer, Layer 4.
5. What is the main job of the Session Layer?
Its main job is to establish, manage, synchronize and terminate logical communication sessions.
6. What is a session?
A session is a logical period of communication between two application entities.
7. What is session establishment?
It is the process of creating and agreeing to begin a logical communication session.
8. What is session maintenance?
It means maintaining the logical state and control of an active session.
9. What is session termination?
It is the controlled ending of a logical application communication session.
10. What is dialog control?
Dialog control manages the direction and organisation of communication between session participants.
11. What is token management?
Token management uses logical permission control so that only the permitted participant performs certain session operations.
12. What is synchronization?
Synchronization means inserting known points or checkpoints into a long communication so recovery can return to a controlled position.
13. What is a synchronization point?
It is a known checkpoint in a session that can be used as a recovery position.
14. Why are checkpoints useful?
They reduce the amount of work that must be repeated after an interruption.
15. What happens after a session failure?
Session recovery may try to continue from the latest valid synchronization point.
16. What is resynchronization?
Resynchronization is the process of restoring both session participants to an agreed known synchronization state after an interruption.
17. What is minor synchronization?
Minor synchronization provides intermediate synchronization points inside ongoing session activity.
18. What is major synchronization?
Major synchronization marks a more significant synchronization boundary for stronger activity-level control and recovery.
19. What is activity management?
Activity management organises logical activities inside a longer session so they can be controlled systematically.
20. Does Session Layer perform routing?
No. Routing is a Network Layer function.
21. Does Session Layer provide port numbers?
Port addressing belongs mainly to the Transport Layer.
22. What is the difference between Session and Transport Layer?
Transport Layer moves data between application processes, while Session Layer manages the logical communication session.
23. What is the difference between Session and Presentation Layer?
Session Layer manages communication sessions, while Presentation Layer handles data representation and format-related functions.
24. Does TCP/IP have a separate Session Layer?
Normally no. TCP/IP generally places these higher-level session functions inside application-layer software.
25. What is dialog discipline?
Dialog discipline defines how session participants take turns or coordinate controlled operations.
26. What does half-duplex style mean?
It means one participant communicates at a time in the controlled dialog.
27. What does full-duplex style mean?
It means communication can take place in both directions.
28. Is Session Layer token management the same as a security token?
No. Here token means logical permission to perform a controlled session operation.
29. What is orderly session release?
It is the controlled closing of a session so both participants know the communication ended normally.
30. What is an abnormal session termination?
It is an unexpected session ending caused by failure, crash or communication interruption.
31. A task has checkpoints at 100, 200, 300 and 400. Failure occurs at 360. From where should it resume?
From the last valid checkpoint, 300.
32. A 500 MB task has a checkpoint every 50 MB. Failure occurs at 370 MB. What is the last checkpoint?
350 MB.
33. In the same example, how much completed work after the checkpoint may need to be repeated?
370 - 350 = 20 MB.
34. Why should both sides agree on the same recovery point?
Because different recovery states can make the session inconsistent.
35. Can session synchronization prevent network failure?
No. It helps recovery after failure but does not prevent the failure itself.
36. Why is synchronization useful for long operations?
Because repeating a small section after failure is more efficient than restarting the complete operation.
37. Is a TCP connection always equal to an application session?
No. A TCP connection is a Transport Layer connection, while a logical application session is a higher-level concept.
38. What are the three easiest Session Layer keywords to remember?
Dialog control, token management and synchronization.
39. What is the major benefit of session recovery?
It reduces unnecessary repetition of already-completed work.
40. Give the easiest Session Layer memory line.
Session Layer manages the conversation: it starts the session, controls the dialog, adds checkpoints, helps recovery and closes the session.
20 Session Layer MCQs With Answers
1. Session Layer is OSI Layer:
A. 3
B. 4
C. 5
D. 6
Answer: C — Layer 5
2. The layer above Session Layer is:
A. Network
B. Transport
C. Presentation
D. Data Link
Answer: C
3. The layer below Session Layer is:
A. Transport
B. Presentation
C. Application
D. Physical
Answer: A
4. Main Session Layer function is:
A. Routing packets
B. Managing communication sessions
C. MAC addressing
D. Signal transmission
Answer: B
5. Which is a Session Layer function?
A. Dialog control
B. IP routing
C. Frame CRC only
D. Cable encoding
Answer: A
6. Synchronization points are also called:
A. Routers
B. Checkpoints
C. Ports
D. Frames
Answer: B
7. Checkpoints mainly help in:
A. Recovery
B. IP addressing
C. DNS resolution
D. Frequency allocation
Answer: A
8. Token management controls:
A. Session operation permission
B. IP address class
C. MAC address size
D. Router TTL
Answer: A
9. Dialog control decides:
A. Who communicates and how
B. Which cable is used
C. Which IP class exists
D. Ethernet CRC
Answer: A
10. Session recovery normally resumes from:
A. Random byte
B. Last valid checkpoint
C. Router table
D. First Ethernet frame
Answer: B
11. Session Layer is between:
A. Network and Data Link
B. Presentation and Transport
C. Physical and Data Link
D. Application and Physical
Answer: B
12. TCP/IP normally has:
A. Separate mandatory Session Layer
B. No separate Session Layer
C. Two Session Layers
D. Session Layer below Network
Answer: B
13. Which layer handles process-to-process delivery?
A. Session
B. Transport
C. Presentation
D. Physical
Answer: B
14. Which Session Layer concept helps long-running tasks?
A. Synchronization
B. ARP
C. CIDR
D. CSMA/CD
Answer: A
15. Major and minor are types of:
A. Synchronization
B. IP classes
C. Ethernet frame
D. Routing table
Answer: A
16. Session establishment means:
A. Starting a logical communication session
B. Assigning an IP address
C. Creating Ethernet cable
D. Fragmenting packets
Answer: A
17. Which does NOT belong to Session Layer?
A. Synchronization
B. Dialog control
C. Token management
D. IP routing
Answer: D
18. Resynchronization means:
A. Returning both sides to an agreed known session state
B. Changing subnet mask
C. Increasing Ethernet speed
D. Assigning MAC address
Answer: A
19. If failure occurs at 470 and last checkpoint is 400, recovery should normally begin from:
A. 0
B. 300
C. 400
D. 470
Answer: C
20. Best memory line for Session Layer is:
A. Manage the conversation
B. Route the packet
C. Transmit electrical bits
D. Learn MAC addresses
Answer: A
Frequently Asked Questions
What is the Session Layer in simple words?
The Session Layer is OSI Layer 5 and manages logical communication sessions between applications.
What are the main functions of the Session Layer?
Major functions include session establishment, maintenance, termination, dialog control, token management, synchronization and recovery.
What is Session Layer synchronization?
Synchronization inserts known checkpoints into long communication so recovery can continue from a controlled point after an interruption.
What is a checkpoint?
A checkpoint is a synchronization point that marks a known state in a long session.
What is dialog control?
Dialog control manages how the two session participants communicate and coordinate their actions.
What is token management?
Token management is a logical permission-control mechanism that allows selected session operations to be performed by the participant holding the required token.
What is session recovery?
Session recovery attempts to resume communication from the latest valid synchronization point after failure.
What is resynchronization?
Resynchronization restores both session participants to an agreed known session state after communication is interrupted.
What is the difference between Session Layer and Transport Layer?
Transport Layer provides process-to-process transport, while Session Layer manages the logical conversation between communicating applications.
Does TCP/IP have a separate Session Layer?
No. TCP/IP normally handles session-related functions inside its Application Layer protocols and software.
What is major synchronization?
Major synchronization marks an important session boundary that can support stronger recovery and activity control.
What is minor synchronization?
Minor synchronization provides lighter intermediate checkpoints inside an ongoing session activity.