The session layer is level five of the seven level OSI model. It responds to service requests from the presentation layer and issues service requests to the transport layer.
The session layer provides the mechanism for opening, closing and managing a session between end-user application processes, i.e. a semi-permanent dialogue. Communication sessions consist of requests and responses that occur between applications. Session layers are commonly used in application environments that make use of remote procedure calls (RPCs).
An example of a session layer protocol is the OSI protocol suite Session Layer Protocol, also known as X.225 or ISO 8327. In case of a connection loss this protocol may try to recover the connection. If a connection is not used for a long period, the session layer protocol may close it and re-open it. It provides for either full duplex or half-duplex operation and provides synchronization points in the stream of exchanged messages.
Other examples of session-layer implementations include Zone Information Protocol (ZIP) – the AppleTalk protocol that coordinates the name binding process; and Session Control Protocol (SCP) – the DECnet Phase IV session layer protocol.
Session layer support in the Internet
The Session layer does not exist as a separate protocol layer or process in the four or five layer TCP/IP model, but its functionality is partly provided by the TCP/IP model transport layer, and partly by some TCP/IP model application layer protocols. However, a major part of its functionality is typically unused in Internet applications.
The OSI model made the session layer responsible for “graceful close” of sessions, which is a property of the TCP protocol, provided by the four-way SYN handshake process.
The OSI model also made the session layer responsible for session checkpointing and recovery, which is not usually used in the Internet protocols suite. However, there are a few applications layer protocols where the concept is useful. The idea is to allow information on different streams, perhaps originating from different sources, to be properly combined. In particular, it deals with synchronization issues, and ensuring nobody ever sees inconsistent versions of data, and similar things.
One application which is fairly intuitively clear is web conferencing. Here, we want to make sure that the streams of audio and video match up – or in other words, that we do not have lip synch problems. We may also want to do floor control – ensuring that the person displayed on screen and whose words are relayed is the one selected by the speaker, or by some other criteria.
Another big application is in live TV programs, where streams of audio and video need to be seamlessly merged from one to the other so that we do not have half a second of blank airtime, or half a second when we transmit two pictures simultaneously.
In brief: the session layer establishes, manages and terminates connections (sessions) among cooperating applications. It also adds traffic flow information.
List of Session layer services
- Authentication
- Permissions
- Session restoration (checkpointing and recovery)
Examples
- ADSP – AppleTalk Data Stream Protocol
- ASP – AppleTalk Session Protocol
- H.245 – Call Control Protocol for Multimedia Communication
- ISO-SP – OSI Session Layer Protocol (X.225 – ISO 8327)
- iSNS – Internet Storage Name Service
- L2F – Layer 2 Forwarding Protocol
- L2TP – Layer 2 Tunneling Protocol
- NetBIOS – Network Basic Input Output System
- PAP – Password Authentication Protocol
- PPTP – Point-to-Point Tunneling Protocol
- RPC – Remote Procedure Call Protocol
- RTCP – Real-time Transport Control Protocol
- SMPP – Short Message Peer-to-Peer
- SCP – Secure Copy Protocol
- SIP – Session Initiation Protocol
- SSH – Secure Shell
- ZIP – Zone Information Protocol
- SDP – Sockets Direct Protocol