Sub topic 16
Polling and Token Passing
This chapter covers controlled-access protocols. These give each station its turn to transmit, so frames never collide. It assumes you know the medium access control problem, transmission delay (Tt) and propagation delay (Tp), and why ALOHA and CSMA/CD lose capacity to collisions. It also derives the efficiency formulas GATE questions ask for.
Why controlled access exists
Random-access protocols let stations transmit whenever they want and repair the damage afterwards. As load rises, collisions waste more and more of the channel. Controlled-access protocols take the opposite approach. A station may send only when it has explicit permission, so no collisions occur. The price is waiting overhead, which is time spent passing permission around even when nobody has data.
The two standard schemes are polling and token passing.
Polling
In polling, one primary station (the master or controller) asks the secondary stations in turn whether they have data.
- The primary sends a poll message to station 1.
- If station 1 has data, it sends a frame, up to some limit per poll. Otherwise it replies with a short "nothing to send" message (or, in some designs, stays silent for a timeout).
- The primary moves on to station 2, and so on, cycling forever.
Bluetooth piconets and some industrial buses work this way.
Polling has two costs:
- Poll overhead. Every poll takes time even if the station has nothing to send.
- Single point of failure. If the primary fails, the whole network stops.
Polling efficiency
Let Tt be the time to send one frame and Tpoll the time spent on one poll. That time includes the poll message, its propagation, and the reply or timeout. If each poll allows k frames:
efficiency = k·Tt / (k·Tt + Tpoll)
Raising k improves efficiency. It also raises the delay seen by other stations, because the cycle gets longer.
Token passing
Token passing removes the central primary. A small special frame called the token circulates among the stations in a fixed logical order. Only the station holding the token may transmit. When it finishes, or when its token holding time (THT) expires, it passes the token to its successor.
IEEE 802.5 Token Ring, token bus (802.4) and FDDI use this idea. In a ring, the order is the physical order of the stations.
Token release strategies
The efficiency depends on when the sender puts the token back on the ring.
| Strategy | Token is released | Effect |
|---|---|---|
| Delayed token release | After the frame's header has returned to the sender | Only one frame on the ring at a time, longer cycle |
| Early token release | Right after the last bit of the frame is sent | Several frames can be on the ring at once, shorter cycle |
Deriving the efficiency
Let N be the number of stations. Let Tt be the frame transmission time and Tp the propagation time around the whole ring. Define a = Tp / Tt. Passing the token to the next neighbour takes about Tp/N, since the neighbours are on average one Nth of the ring apart.
Delayed release. Each station transmits for Tt. It then waits Tp for the frame to come all the way round, and then the token travels Tp/N to the next station.
- Time per station: Tt + Tp + Tp/N
- One full cycle of N stations: N·Tt + (N + 1)·Tp
- Useful time per cycle: N·Tt
efficiency = N·Tt / (N·Tt + (N+1)·Tp) = 1 / (1 + a(N+1)/N)
Early release. The sender releases the token as soon as it finishes sending, so the Tp wait disappears for each station.
- One full cycle: N·Tt + Tp
efficiency = N·Tt / (N·Tt + Tp) = 1 / (1 + a/N)
For large N, early release approaches 100% efficiency. Delayed release approaches 1/(1 + a) and stays limited by the ring length.
Worked example
Ten stations share a ring. A frame takes Tt = 1 ms to send, and the ring propagation time is Tp = 2 ms, so a = 2.
- Delayed release: cycle = 10·1 + 11·2 = 32 ms, so efficiency = 10/32 = 0.3125.
- Early release: cycle = 10·1 + 2 = 12 ms, so efficiency = 10/12 ≈ 0.833.
def polling_efficiency(t_frame, t_poll, frames_per_poll=1):
useful = frames_per_poll * t_frame
return useful / (useful + t_poll)
def token_efficiency(n, t_frame, ring_delay, early_release):
cycle = n * t_frame + (ring_delay if early_release
else (n + 1) * ring_delay)
return n * t_frame / cycle
print(round(polling_efficiency(1.0, 0.1), 3)) # 0.909
print(round(token_efficiency(10, 1.0, 2.0, False), 4)) # 0.3125
print(round(token_efficiency(10, 1.0, 2.0, True), 3)) # 0.833The cycle formulas assume every station always has a frame to send. This is the saturated, or maximum-load, case that GATE questions normally mean. At light load the cycle is shorter, but efficiency in the sense of useful traffic is also lower.
Delay behaviour and comparison
Token passing is deterministic. With a limit of one THT per visit, a station waits at most about (N − 1)·THT plus the token travel time before it gets the token. This bounded delay is why controlled access suits real-time and industrial traffic. CSMA/CD offers no such bound, because a frame can lose repeated backoff draws.
| Property | CSMA/CD | Polling | Token passing |
|---|---|---|---|
| Collisions | Yes | No | No |
| Delay at light load | Very low | Waits for the next poll | Waits for the token |
| Efficiency at heavy load | Drops | Stays high | Stays high |
| Central controller | No | Yes | No |
| Bounded access delay | No | Yes | Yes |
Failure modes and common errors
- Lost token. If the token is corrupted or its holder crashes, the ring goes silent. A designated monitor station detects the silence with a timer and generates a new token.
- Duplicate token. Two tokens would let two stations transmit and corrupt each other. The monitor detects this and removes the extra token.
- Orphan frame. If the sender fails before removing its frame, the frame circulates forever. The monitor marks frames it passes, and destroys a frame it sees a second time.
- Mixing up the two formulas. Delayed release has (N + 1) in the denominator, and early release has a single Tp. Check which strategy the question states.
- Using the wrong Tp. In these formulas Tp is the propagation delay around the entire ring, not between two neighbours.
- Forgetting overhead in polling. The poll time includes its own propagation and the reply. A question may give these separately, and you must add them.
Exercise
A token ring has N = 5 stations. Each frame takes Tt = 2 ms to transmit, and the propagation time around the ring is Tp = 4 ms. Under saturated load, compute the efficiency with (a) early token release and (b) delayed token release.
Show answer
Here a = Tp/Tt = 2. (a) Early release: cycle = N·Tt + Tp = 10 + 4 = 14 ms, so efficiency = 10/14 ≈ 0.714. (b) Delayed release: cycle = N·Tt + (N+1)·Tp = 10 + 24 = 34 ms, so efficiency = 10/34 ≈ 0.294.
Exercise
A polling system gives each station permission to send up to 3 frames per poll. A frame takes 0.5 ms to send, and each poll costs 0.3 ms. What is the efficiency when the station always uses its full allowance?
Show answer
Useful time = 3 × 0.5 = 1.5 ms. Efficiency = 1.5 / (1.5 + 0.3) = 1.5/1.8 ≈ 0.833.