Computer Networks

Layer 5 — Session

Dialogs: setup, teardown, and checkpoints. Thin in TCP/IP, explicit in some RPC systems.

Level: beginner

What is it?

Layer 5 in OSI manages a conversation: establish, checkpoint, recover, tear down. TCP already gives a byte-stream session; HTTP/2 streams and TLS sessions absorbed more. RPC systems (and NetBIOS) made this layer visible.

Why does it matter?

It is the layer people fail to name in interviews, and the right answer is: the function exists, the internet did not keep it as a separate protocol suite.

Mental model

The phone call, not the words and not the copper: who is talking to whom, and can we resume.

How it works

  • Purpose: organize a dialog between two presentation entities.
  • PDU: data, sometimes with a session id.
  • Examples: RPC conversations, SMB sessions, TLS session resumption as a cousin.
  • On TCP/IP this is folded into TCP + the application.

Real-world usage

  • RPC frameworks
  • SMB
  • Interview mnemonics

Common mistakes

  • Inventing a session protocol that TCP already is

Interview questions

Why does L5 feel empty on the internet?

TCP’s connection is already a session. Applications added their own (HTTP/2 streams, TLS sessions).

Prerequisites

Related concepts

Continue learning

Browse the full computer science library