Course contents

Unit 3: Network ModelsLesson 3.1.3 (4 of 14 in this unit)16 of 95 in the Network Fundamentals course

OSI Layer 5: Session

A conversation breaks halfway through. How do applications know what work remains?

Beginner · 6 min read · Before this: The OSI model

Technical definition

The OSI Session layer is layer 5 of the OSI reference model. It establishes, manages and terminates sessions between presentation entities, providing dialogue control and synchronisation services.

In plain English: Organises a conversation between applications: starting it, coordinating the exchange and ending it.

What this layer does

A conversation may need rules for who sends next or a shared checkpoint from which work can resume. A checkpoint is an agreed record of completed work.

Recovery needs support at both ends; naming a session does not make a file transfer resumable. In modern networks, applications often manage their own conversation state instead of using a separate OSI session protocol.

A session is a managed conversation; a web login is not proof of a separate layer 5 protocol.

Follow one request from PC-1

PC-1 is a user's computer opening a page on the lab web server. Its IPv4 address is 192.168.1.20/24 and its gateway is R1 at 192.168.1.1. The server is on another subnet, at 203.0.113.20/24, with gateway 203.0.113.1. The /24 means that the first 24 bits identify each subnet. R1 joins the two subnets.

Session: the same request, a different responsibility
Session: the same request, a different responsibilityPC-1 connects over Ethernet to R1 Gi0/0. R1 Gi0/1 connects to the lab server over a second Ethernet link. PC-1 uses 192.168.1.20/24, R1 uses 192.168.1.1/24 and 203.0.113.1/24, and the server uses 203.0.113.20/24. The server listens on TCP port 443.LAN A · 192.168.1.0/24LAN B · 203.0.113.0/24PC-1R1 · routerWeb server192.168.1.20/24203.0.113.20/24Eth0Gi0/0Gi0/1Eth0192.168.1.1/24203.0.113.1/24TCP example: PC-1 source port 51524 → server destination port 443

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Two Ethernet links and one router; addresses are examples and no NAT is used. The server subnet is reserved for documentation.

In this request: A resumable transfer application can record completed chunks and request the remaining chunks after reconnecting. The application must implement that behaviour.

The interface labels identify the ends of the cables: Eth0 is the example Ethernet interface on each host, while Gi0/0 and Gi0/1 are R1's two Gigabit Ethernet interfaces. Actual device names vary. An IP address identifies an interface; TCP port 443 identifies the HTTPS service endpoint. It is not a physical socket on the router.

Where it fits in the other model

The four-layer TCP/IP model groups these responsibilities into its Application layer. This is a functional comparison, not a requirement for a separate header at every OSI layer.

The trade-off is between a more detailed vocabulary and a simpler description of deployed protocols. OSI names seven responsibilities; the four-layer TCP/IP model groups some of them together. Neither view requires a separate header for every named responsibility.

When it does not work

After a broken connection, ask whether the application supports resuming work and whether both ends still have valid state. Re-establishing TCP does not automatically resume a file from its last byte or restore a login. A transfer checkpoint or an authenticated session can expire independently of the physical link. Troubleshoot the application's recovery rules as well as connectivity.

Try a practical check

Use PowerShell on Windows for this observation exercise. These commands inspect your own connection or request a public example service; they do not configure R1 or contact the documentation server in the figure.

$response = Invoke-WebRequest -UseBasicParsing -Uri 'https://example.com' -SessionVariable lessonSession $response.StatusCode $lessonSession.Cookies.Count

Use Windows PowerShell 5.1 or PowerShell 7. -SessionVariable keeps web-session state in a variable for later requests. The cookie count may be zero: a site need not set a cookie. This demonstrates application-managed state, not an OSI session-layer packet capture, a login, or a resumable transfer. No account is needed for this public example.

Your task: identify one useful field in the result, state what it shows, then name something it cannot prove. If the command is unavailable or a request is blocked, record that limitation rather than treating it as proof of a failed layer.

Check your understanding

Predict · scenario 1

A TCP connection is restored after a file transfer fails. Must the application resume the file automatically?

Technical references