OSI Model — Session Layer
Communication between two applications is rarely one isolated message. It is a conversation — opened, kept in order, and closed when finished. The session layer is the OSI model’s name for that conversation management, known formally as dialog control.
The role of the layer
The session layer is Layer 5 of the OSI model. Its job is to establish, manage, and terminate the dialogues — called sessions — between applications on two hosts. A session is a continuing exchange: a login, a remote shell, a file transfer in progress, or a database connection. The session layer keeps that exchange organised from the first request to the final goodbye.
Its functions are often described with the single phrase dialog control, because the layer decides the rules of the conversation rather than its content. The content belongs to Layer 7; the representation belongs to Layer 6; the running dialogue belongs to Layer 5.
The session lifecycle
Every session moves through three broad phases:
- Establishment — the two applications agree to communicate. This may include authentication and agreeing on parameters for the dialogue.
- Data exchange (management) — the session stays open while data flows; the layer maintains the dialogue and can insert checkpoints.
- Termination — one or both sides close the session and release the resources it used.
Keeping these phases distinct matters: a well-behaved protocol closes sessions cleanly so that buffered data is delivered and resources are freed, instead of being abandoned when a process simply stops.
Dialog control: half vs full duplex
Dialog control decides how the two endpoints take turns. There are two modes:
| Mode | Behaviour | Analogy |
|---|---|---|
| Half-duplex | The conversation flows in one direction at a time; the two sides take turns. | Walkie-talkie |
| Full-duplex | Both sides can transmit and receive simultaneously. | Telephone call |
Half-duplex suits some control protocols where strict turn-taking avoids clashes. Full-duplex is the common mode for modern data sessions, where each direction flows independently and the practical performance is roughly the sum of both directions.
Checkpoints and recovery
Some sessions transfer huge amounts of data over hours: a database backup, a large software update, a long file transfer. If the link fails near the end, restarting from zero would be wasteful. The session layer solves this by inserting checkpoints into the data stream. If the transfer is interrupted, it can resume from the last acknowledged checkpoint rather than from the beginning.
Session-related protocols
OSI is a conceptual model, so it names functions rather than one universal session protocol. The classic examples of protocols or services associated with session management include:
- NetBIOS — a legacy programming interface and set of services used for name resolution and session establishment on local networks; it provides a session service between applications.
- RPC (Remote Procedure Call) — lets a program call a procedure on another host as if it were local; it maintains the session in which those calls take place.
- SMB and database connection protocols often keep a long-lived session open between client and server.
- RTP/RTCP are sometimes cited because they manage a media session’s continuity, though they are generally classified as application-layer protocols.
How real stacks handle sessions
An accurate and exam-relevant point: the TCP/IP stack does not cleanly implement an OSI session layer. The four-layer TCP/IP model folds OSI Layers 7, 6, and 5 together into a single application layer. This means session-like behaviour is provided in different places:
- TCP (transport layer) performs the connection establishment and teardown that opens and closes the pipe, but that is a transport connection, not an application dialogue.
- Application protocols manage the actual session: HTTP sessions and cookies, TLS sessions, SMB sessions, database connections, and Remote Procedure Call contexts.
So while OSI describes a separate Layer 5, in a real network the session function is spread across TCP and the application protocols. That is why you will rarely hear an engineer say “the session layer did it”. You still need the OSI terminology because the exam uses it.
Review
Check what you have learned with these review questions. The key terms and sources from this lesson are listed below the quiz.
| Key term | Meaning |
|---|---|
| Session layer | Layer 5 of OSI; establishes, manages, and terminates dialogues between applications. |
| Session | A continuing exchange between two application processes. |
| Dialog control | The rules governing which side may transmit and when. |
| Half-duplex | Communication in one direction at a time; the sides take turns. |
| Full-duplex | Simultaneous transmission in both directions. |
| Checkpoint | A recovery point placed in a session so it can resume after an interruption. |
| NetBIOS | Legacy LAN name and session service between applications. |
| RPC | Remote Procedure Call; runs procedures on a remote host within a session. |
Sources & references
- Braden, R. RFC 1122: Requirements for Internet Hosts — Communication Layers (1989), on the layering model. rfc-editor.org/rfc/rfc1122.
- IANA. Service Name and Transport Protocol Port Number Registry. iana.org.
- ISO/IEC 7498-1. Information technology — Open Systems Interconnection — Basic Reference Model, which describes the session layer. iso.org.
- Cisco. CCNA (200-301) Exam Topics, Network Fundamentals. cisco.com.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.