ByteByte CityCity
All lessons
OSI Model

Why VoIP Calls Drop at 32 Seconds: The Session Layer | OSI Layer 5

8:17 Watch on YouTube

A branch-office call rings, connects, both sides hear each other perfectly — and at thirty-two seconds it hangs up. Every call. Every time. The road is fine, the address is fine, the doors are open: every delivery worked, and the conversation broke. In this episode Professor Flows explains the Session layer using Byte City's delivery window: open, maintain, close.

You'll learn

Chapters

  1. 0:00The call that hangs up at thirty-two seconds
  2. 0:31The delivery window: open, maintain, close
  3. 1:19A session is not a connection
  4. 1:46Checkpoints: resume, don't restart
  5. 2:16Taking turns: half-duplex and full-duplex
  6. 2:45The phone call: where you can see Layer 5
  7. 3:22SIP: INVITE, RINGING, OK, ACK, BYE
  8. 4:03The real names, and the honest footnote
  9. 5:07The real thing: reading the call log
  10. 6:25Exam corner
  11. 6:39Sessions you use every day, timeouts and keep-alives
  12. 7:25Recap and next time

The written lesson

The problem: the call that hangs up at 32 seconds

A user in the branch office calls head office. It rings. They pick up. Both sides can hear each other perfectly. And at thirty-two seconds, the call hangs up. Every call. Every time.

The road is fine. The address is fine. The doors are open: the voice was getting through. Every delivery worked. It's the conversation that broke. That is Layer 5 of the OSI model: the Session layer.

The delivery window: open, maintain, close

A diagram titled The delivery window - open, maintain, close. A TCP truck travels between your computer and the server below an open window with a green lamp. A banner reads While the window is open
While the window is open, any number of deliveries can go back and forth.

The Layer 4 lesson got one delivery to one door. But a conversation isn't one delivery. It's dozens, sometimes thousands, and somebody has to keep track of the whole thing.

In the OSI model lesson, we called that job the delivery window. Before two houses start trading, they open a window between them: who are you, what are we doing, what rules are we following?

While the window is open, deliveries go back and forth: cube trucks, bullhorn shouts, whichever fits. When the houses are finished, the window is closed properly, so neither side is left waiting for something that will never come.

Open. Maintain. Close. That is the whole job of Layer 5.

A session is not a connection

The delivery window open above a LOGGED IN tag while a TCP truck drives along a bar labelled a connection opens... and closes. A banner reads The session stays: a session is not a connection
Connections open and close underneath. The session stays open above them.

Don't confuse the window with the truck's call-ahead from the Layer 4 lesson. That three-way handshake opens one trip.

The window is bigger than that. It can stay open across many trips, and it is still there when each trip ends.

Think of being logged in to a website. While you click around, your browser opens and closes connections to the server all the time, and you stay logged in. That is the window. The connections come and go. The session stays.

Checkpoints and taking turns

Between a sender and a receiver, green flags read got up to 3 and got up to 6, with pieces 7 and 8 on the road. A banner reads Synchronisation: the download that resumes instead of restarting
After a break, the transfer picks up from the last flag, not from piece one.

The window has two more jobs, both for long conversations.

First, checkpoints. Sending something big takes time, and roads break. So every so often the two houses agree a marker: "we've got up to here." If the window is interrupted, they pick up from the last marker, not from the beginning. Engineers call this synchronisation. If you have ever watched a download resume instead of restarting, you have felt the idea.

Second, taking turns. Some conversations let both sides talk at once. Others work like a walkie-talkie: one talks, the other waits, then they swap. The window keeps that order, so the houses don't shout over each other. This is dialogue control, and the two styles are full-duplex (both at once) and half-duplex (one at a time).

Careful: the Layer 1 lesson used the same two words for cables. Same idea, different place: here it is the conversation, not the wire.

The phone call: where you can actually see Layer 5

Arrows between a branch phone and a head office phone read INVITE, RINGING, OK and ACK. Below, a row of small pieces is labelled The voice - bullhorn shouts, UDP, a separate lane
SIP opens the window. The voice rides its own lane.

Layer 5 feels abstract until you watch one phone call.

When your desk phone calls another, three separate things happen. The ringing, the answering and the hanging up are the window: open, maintain, close. The voice itself is a stream of bullhorn shouts riding UDP, because on a live call late is worse than lost. And the voice travels in a separate lane, through different doors, from the messages that set the call up.

The window's real name here is SIP, the Session Initiation Protocol. Its messages have plain-English names:

  1. INVITE: "I'd like to talk."
  2. RINGING: the far phone is ringing.
  3. OK: "I've picked up."
  4. ACK: "I heard you pick up. Let's go."

At the end of the call comes BYE, a final OK, and the window closes.

Because the call setup and the voice are separate, they can break separately. A call can ring, connect, and have no audio at all: the window opened, but the voice lane is blocked. Or, like our user, the voice is perfect and the call still drops: the voice lane is fine, and the window is broken.

The real names, and an honest footnote

In Byte CityReal name
The delivery windowA session
Opening the windowSession establishment
Keeping it openSession maintenance
Closing it properlySession termination
The checkpoint markerSynchronisation point
Taking turnsDialogue control (half-duplex / full-duplex)
The call setupSIP, the Session Initiation Protocol

For the exam, the protocols filed under Layer 5 are SIP, NetBIOS, RPC (remote procedure call) and PPTP, an old VPN protocol.

Now the honest footnote. The OSI model lesson said OSI lost as a design and won as a language, and Layer 5 is where you see that most clearly. Real networks have no separate session box in the wiring. The window's jobs are real, but they are done inside the applications and the libraries they use. Layer 5 is a job description, not a machine.

When someone says "that's a session problem", they mean the deliveries work and the conversation doesn't.

The real thing: reading the call log

A phone system call log: INVITE, 100 Trying, 180 Ringing, 200 OK and an RTP line reading audio flowing, then seven 200 OK retransmit lines marked no ACK received and a BYE reading no ACK - timer expired (32 s)
OK goes out again and again with no ACK in reply, until the far end sends BYE at 32 seconds.

Every phone system keeps a call log. This is our user's call. The INVITE goes out. Ringing comes back. Then OK: the far end picked up. The RTP line shows the voice flowing on its own lane.

Now look at what is missing. After OK, the caller's phone is supposed to send ACK: "I heard you pick up." It never arrives. So the far end sends OK again. And again. After thirty-two seconds it gives up, sends BYE, and hangs up. The window was never properly opened, so it was closed.

Where did the ACK go? A firewall between the two offices had a rule for the voice lane and a rule for the first messages of the call, and it silently dropped that one message. Every delivery worked. The conversation didn't. Add a rule that lets the call-setup messages through in both directions, and the calls stay up.

The tip: when voice works and calls still drop, or calls connect and nobody can hear anything, stop looking at the road. Look at the window. Voice over IP gets a complete lesson of its own.

For the Network+ exam: which OSI layer is responsible for opening, maintaining and closing the dialogue between two applications? Layer 5, Session. Layer 4 gets one delivery there. Layer 5 runs the conversation. Note the port in the log too: SIP call setup uses 5060, or 5061 when it is encrypted with TLS.

Sessions you use every day

The Byte City delivery window with its green lamp lit and a van outside, 5 Session highlighted in the layer stack. A card reads A timeout: after a quiet spell the window is closed from one end
Every window has a clock: after a quiet spell, one end closes it.

You use windows all day without seeing them. Staying logged in to a website is a session. Opening a file on the office server, the one down the hall from the Layer 3 lesson, is a session. A remote desktop is a session.

And every window has a clock. If one side vanishes, say a laptop lid is closed or a cable pulled, the other side can't wait forever. After a quiet spell, the window is closed from one end. That is a timeout, and it is why a remote desktop kicks you off after lunch.

It is also why some applications send a small "still there?" every minute or so. That is a keep-alive: it stops a quiet conversation being mistaken for a dead one.

Quick answers

What does the session layer do?

It opens, maintains and closes the conversation between two applications. It also sets checkpoints so an interrupted exchange can resume, and controls whose turn it is to talk.

What is the difference between a session and a connection?

A connection, such as one TCP connection, carries one exchange. A session is the whole conversation and can outlive many connections, which is how you stay logged in to a website.

Why do VoIP calls drop after 32 seconds?

Usually because the ACK that confirms the call never reaches the far end. The far end keeps resending OK, gives up after 32 seconds and hangs up. A firewall silently dropping the ACK is a common cause.

What is SIP used for?

SIP, the Session Initiation Protocol, sets up and ends calls with messages such as INVITE, RINGING, OK, ACK and BYE. The voice itself travels separately, over UDP.

Which protocols work at OSI Layer 5?

For the Network+ exam: SIP, NetBIOS, RPC and PPTP.

Key terms

Session
—
the conversation between two applications, which can stay open across many connections.
Establishment, maintenance, termination
—
opening the session, keeping it open, and closing it properly.
Synchronisation point
—
an agreed checkpoint, so an interrupted transfer resumes instead of restarting.
Dialogue control
—
who talks when: full-duplex (both at once) or half-duplex (one at a time).
SIP
—
the Session Initiation Protocol, which sets up and ends calls.
Timeout
—
closing a session from one end after a quiet spell.
Keep-alive
—
a small "still there?" message that stops a quiet session being closed as dead.
Next: "Your Connection Is Not Private": TLS and Encoding | OSI Layer 6

Quick quiz

Five questions on this lesson. Pick an answer to see why.

  1. 1. VoIP calls ring, connect and both sides hear each other, but every call drops after 32 seconds. The call log shows 200 OK resent with no ACK. Likely cause?
  2. 2. A user's VoIP calls ring and connect normally, but neither side can hear anything. What is the most likely explanation?
  3. 3. A user stays logged in to a web app all afternoon while the browser opens and closes many TCP connections. Which statement is correct?
  4. 4. A long transfer is interrupted and then continues from the last agreed marker instead of starting over. Which Session layer function is this?
  5. 5. Which of these protocols does Network+ material file under OSI Layer 5, the Session layer?

Keep learning

Previous

Thumbnail for Ping Works, Page Won't Load: Ports, TCP and UDP | OSI Layer 49:32
OSI Model

Ping Works, Page Won't Load: Ports, TCP and UDP | OSI Layer 4

Numbered doors, the truck that calls ahead and the bullhorn that doesn't.

9:32 Watch

Next

Thumbnail for "Your Connection Is Not Private": TLS and Encoding | OSI Layer 68:11
OSI Model

"Your Connection Is Not Private": TLS and Encoding | OSI Layer 6

The packing room: the label printer, the vacuum sealer and the lock on door 443.

8:11 Watch

Related

Thumbnail for The OSI Model Explained: 7 Layers in One City9:50
OSI Model

The OSI Model Explained: 7 Layers in One City

A city, seven floors, and why the model lost as a design and won as a language.

9:50 Watch

Exam objectives: CompTIA Network+ N10-009: 1.1 (OSI model, Layer 5), 1.4 (SIP 5060/5061), 5.3 (VoIP troubleshooting), 5.5 (reading logs).

Byte City is not affiliated with or endorsed by CompTIA.