LAYER NUMBER 5 – THE SESSION LAYER
SESSION ESTABLISHMENT AND MAINTENANCE
Establishes, manages and terminates communication sessions between presentation layer entities
When two computers exchange information, it is useful to think of this interaction as a conversation. The main aim of having this conversation is to exchange data. To ensure that a computer is actually able and ready to receive data, it might be useful to have some sort of formal "handshake" before sending any data. During the handshake, the computers might also exchange some parameters that will dictate how the data is sent (what size chunks, etc).
A good analogy is that of a telephone call to a friend. Supposing the data you want to send is "I have won the Lottery!"
Before you send this data,
(a) you might first establish that it is indeed your friend you are speaking to,
"Is that you Betty?", to which she will reply “Yes.”
(b) establish that she is able to receive information,
"Can you talk, are you sitting down?”, etc, again to which she’ll give you an idea of perhaps how much data she is able to handle, like “Sure I can talk, but not for long, I have to leave the house before the shops close.”
This is the equivalent of the handshake in networking terms. You have now established a connection state with the recipient. You can now send the data, "I have won the Lottery!"
Back to the networking scene, two computers will first establish the session, sometimes also referred to as "placing the call". During the handshake, the computers might agree on parameters such as how large the chunks of data to be sent should be. Once the handshake is over, the computers can start sending the data.
This type of data transfer where a session is established before the data is sent is called a "connection oriented" data transfer (It is quite possible though, to skip the whole session layer business and send data as it arrives. This of course is referred to as connectionless data transfer).
The session layer is also responsible for maintaining the session as the data transfer progresses. This is quite a job. It might include constant exchange of various parameters that "keep the link alive" (for connectionless data transfer, no connection state is maintained). Back to our earlier analogy of the telephone call, maintaining the connection state would be the same as occasionally asking, “Are you still there?” or “Can you hear me?” for example.
Once the data is sent, it is again the job of the session layer to formally terminate the session, perhaps again by using some form of handshake where each side acknowledges that the session is over.
Click here to continue to the Transport Layer