Layer 5 (Session): sessions & timeouts
Honest answer up front: in the TCP/IP world, Layer 5 is thin. The classic OSI model puts a dedicated Session layer between Transport (Layer 4) and Presentation (Layer 6), but real networks don't implement it as a separate piece — its job is split between TCP below and the application above. Still, the idea of a session is very real and very useful for troubleshooting. A session is a sustained, stateful conversation: it has to be set up, kept alive, and torn down. When sessions drop, you get logged out, you re-authenticate constantly, or a long-running connection dies for no obvious reason — and that's the family of problems this page is about.
📶 Network troubleshooting series — OSI Layers 1–7
What "session" really means here
Because Layer 5 overlaps Layers 4 and 7, it's easiest to understand by examples of session-style behavior you actually meet:
- Session setup and teardown. Opening a connection, doing some work, then closing it cleanly. A session that isn't torn down properly can linger and leak resources.
- Authentication sessions. After you log in, a token or cookie keeps you logged in so you don't re-enter credentials on every click. When that session expires or gets dropped, you're bounced back to a login screen.
- TLS session resumption. Secure connections cache a session so a reconnect can skip the full handshake. If resumption fails, every reconnect pays the full setup cost.
- RPC and NetBIOS. Remote procedure calls and older Windows file-sharing rely on a session staying open between client and server for the duration of the work.
- Half-open connections. One side thinks the session is alive while the other has already gone away — so data sent into it simply vanishes until something times out.
Common Layer 5 symptoms
- Sessions drop mid-use. A remote desktop, SSH, VPN, or database connection that was working suddenly freezes or disconnects.
- Repeated re-authentication. You get asked to log in again far more often than you should, as if your session keeps being forgotten.
- Unexpected logouts. An app or site signs you out while you're still active.
- Long-lived connections die. Idle SSH sessions, database pools, or streaming connections break after a few minutes of quiet — the hallmark of an idle timeout.
The usual culprit: idle timeouts
Most "my long connection keeps dropping" problems trace to a NAT table or a firewall in the middle silently dropping the session after a period of no traffic. Your router and many firewalls only remember an active connection for a limited time; once it goes quiet past that window, the entry is purged. Both ends still think the session is open, so it becomes half-open — and the moment either side sends data, it's met with silence or a reset. Idle SSH terminals, database connection pools, and IoT links are the classic victims.
How to diagnose and mitigate
- Time it. If the drop happens after a consistent idle interval (commonly 5–30 minutes of no traffic), that's an idle timeout, not a random network fault. A predictable clock is the giveaway.
- Rule out the lower layers first. Confirm the path is stable with a sustained ping test and that the port stays open (Layer 4). If the link itself is flapping, fix that before blaming the session.
- Enable keepalives. Turn on application or TCP keepalives so a trickle of traffic keeps the NAT/firewall entry alive. For SSH, set
ServerAliveInterval 60; most VPN clients, database drivers, and RDP have an equivalent keepalive or "keep connection alive" setting. - Tune the timeouts. If you control the firewall or VPN, raise the idle-session timeout so it comfortably exceeds your real idle gaps. On the app side, lengthen the session/token lifetime if logouts are too aggressive.
- Check token and clock issues for re-auth loops. Constant re-authentication can come from expired or rejected session tokens, or a device clock that's badly out of sync — fix the clock and confirm credentials are being stored, not discarded.
🔧 Inspect it with our free tools
One browser tool tells you whether dropped sessions are a path problem or something higher up:
- Run the Ping Test and give it a longer look. Spiky latency and jitter are what silently kill long-lived sessions — VPNs, SSH, calls — by tripping NAT and firewall idle timeouts.
- Read the spread. Steady, flat latency means the session drops are higher up — auth or the app itself — not the path, so stop chasing the network and check keepalives and token lifetimes.
Stop guessing — is it the network or your machine?
Acutis Go pinpoints whether dropped sessions and re-auth loops come from an unstable link, a NAT/firewall timeout, or your own device — running a 60-second check and telling you plainly where the break is. Free, no account to try.
Get Acutis Go — free
Acutis