The Session Layer

   Dialogs

The Transport Layer allows simultaneous communication in both directions across a channel (full-duplex); however, a meaningful conversation requires a dialog, in which only one party speaks at a time.

Token Passing

The Session Layer provides a service that allows the application to conduct a dialog: when one node is "talking," the other is "listening." This is managed by a system called "token passing." As we can see on the Token Passing Diagram, only the node that has the token may talk. When that node is finished talking, it passes the token to the other node. The nodes pass the token back and forth to control the dialog.

Token Passing

Token Passing

Activity Management

In a dialog, it is also necessary to identify where data starts and ends as it flows between the nodes participating in a conversation. For example, if a file transfer application is transferring several files, the receiving node must be told where one file ends and the next starts. Markers, called "delimiters," can be inserted into the data stream by the sender, but then the recipient has to scan the stream for them, and that effort requires computing cycles. Data that looks like delimiters can also confuse the recipient.

Activity management solves these problems by dividing the data stream into "activities." For the file transfer example, each file becomes an activity. The Session Layer signals the start and end of activities by inserting control information into the Session Layer header.

Sync Points

Within activities, the Session Layer supports "sync points." In a human dialog, sync points amount roughly to asking "Did you get that?" They allow you to make sure that the other person understands what you have said, or has written it down, before you continue talking.

Sync points perform a similar function for programs. A sync point tells the recipient, "Process everything I have sent you before we go on." Using the file transfer application as an example, a sync point might mean, "Write all the data I have sent you to disk before you take any more." Then, if something happens to disturb the flow of data after that point, both ends of the connection are confident that they can start over from the last sync point.