Carrier Sense Multiple Access (CSMA) Protocols
p-Persistent CSMA: Probabilistic Transmission
Read aloud is unavailable in this browser.
The Elegant Middle Ground
We've explored two extreme strategies for CSMA behavior:
- 1-persistent: When idle, transmit with probability 1 (certainty)
- Non-persistent: When busy, back off without monitoring
Each has clear disadvantages. 1-persistent causes guaranteed collisions among waiting stations. Non-persistent wastes channel capacity with unnecessary idle time.
p-Persistent CSMA offers an elegant middle ground: when sensing an idle channel, transmit with probability p < 1, and defer to the next slot with probability 1-p. This introduces controlled randomization that spreads transmissions over time, reducing collisions without abandoning the channel entirely.
By the end of this page, you will understand: (1) The p-persistent CSMA algorithm and its slotted structure, (2) Why probabilistic transmission reduces collisions, (3) How to choose the optimal value of p, (4) Mathematical throughput analysis, and (5) How p-persistent relates to 1-persistent and non-persistent as special cases.
The Probabilistic Insight
The key insight behind p-persistent CSMA is this: even when the channel appears idle, multiple stations may be ready to transmit simultaneously. If all of them transmit immediately (as in 1-persistent), they collide.
What if, instead of everyone transmitting, each station flips a biased coin to decide whether to transmit?
- With probability p: Transmit now
- With probability 1-p: Wait for the next time slot, then try again
If p = 0.3 and three stations are ready:
- Expected transmitters = 3 × 0.3 = 0.9 (usually 0 or 1)
- Probability all three transmit = 0.3³ = 0.027 (2.7%)
- Probability exactly one transmits = 3 × 0.3 × 0.7² = 0.441 (44.1%)
By choosing p appropriately, we can dramatically reduce collision probability!
| N Stations | p = 1.0 | p = 0.5 | p = 0.3 | p = 0.1 |
|---|---|---|---|---|
| 2 | 100% | 25% | 9% | 1% |
| 3 | 100% | 12.5% | 2.7% | 0.1% |
| 5 | 100% | 3.1% | 0.24% | 0.001% |
| 10 | 100% | 0.1% | 0.0006% | ~0% |
Randomization is a powerful technique for breaking symmetry. When multiple identical processes (stations) face the same situation (idle channel), deterministic behavior leads to identical actions (collision). Random decisions create diversity, allowing one to succeed while others wait.
The p-Persistent CSMA Algorithm
p-persistent CSMA operates in a slotted time structure. Time is divided into slots, where each slot duration typically equals the maximum propagation delay (τ). This slotting is crucial for synchronizing station behavior.
Note: Unlike slotted ALOHA where slots equal frame transmission time, p-persistent CSMA uses slots equal to propagation delay—much shorter.
- •Frame Ready: When the network layer passes a frame to the link layer for transmission, proceed to step 2.
- •Sense Channel: At the start of a time slot, sample the channel state.
- •If BUSY: Wait until the channel becomes idle (persistent monitoring), then go to step 4.
- •If IDLE: Generate a random number r uniformly distributed between 0 and 1.
- •If r ≤ p: Transmit the frame immediately. Proceed to step 7.
- •If r > p: Wait for one time slot, then return to step 2.
- •Wait for Outcome: Monitor for collision. If collision, handle collision (backoff). If successful, transmission complete.
Key characteristics:
- Slotted time: Decisions are made at discrete slot boundaries (slot = τ, the propagation delay)
- Persistent when busy: Like 1-persistent, stations monitor a busy channel continuously
- Probabilistic when idle: Unlike 1-persistent, stations don't transmit with certainty
- Defer with probability 1-p: Stations that 'lose' the coin flip wait one slot and try again
- Repeating slots: A station may defer for multiple consecutive slots until it finally 'wins' the coin flip
Tracing Through Examples
Let's trace through p-persistent behavior with p = 0.5 (50% transmission probability per idle slot).
Scenario: Three waiting stations
Station X finishes transmitting. Stations A, B, C are all waiting with frames to send. Time is slotted with slot duration = τ.
Slot 1: Channel becomes idle
| Station | Random r | Action |
|---|---|---|
| A | 0.23 | r < 0.5 → TRANSMIT |
| B | 0.71 | r > 0.5 → Wait |
| C | 0.45 | r < 0.5 → TRANSMIT |
Collision! Both A and C transmitted.
After collision resolution (both back off)...
Stations A and C enter collision backoff. Station B still has its original frame.
Alternative scenario (same setup, different random values):
Slot 1:
| Station | Random r | Action |
|---|---|---|
| A | 0.82 | r > 0.5 → Wait |
| B | 0.91 | r > 0.5 → Wait |
| C | 0.67 | r > 0.5 → Wait |
No transmission! All three deferred.
Slot 2:
| Station | Random r | Action |
|---|---|---|
| A | 0.31 | r < 0.5 → TRANSMIT |
| B | 0.55 | r > 0.5 → Wait |
| C | 0.88 | r > 0.5 → Wait |
Success! Only A transmitted. B and C will try in subsequent slots.
Slot 2 + Transmission time: A is transmitting. B and C sense busy, monitor.
After A finishes:
Slot 1 (after A):
| Station | Random r | Action |
|---|---|---|
| B | 0.42 | r < 0.5 → TRANSMIT |
| C | 0.78 | r > 0.5 → Wait |
Success! B transmits. C defers again.
Eventually, C transmits successfully.
In the alternative scenario, all three stations succeeded without any collision! The random coin flips naturally spread transmissions across slots. While collisions are still possible, they're probabilistically reduced.
Choosing the Optimal Value of p
The performance of p-persistent CSMA depends critically on the choice of p. But what's the optimal value?
The tradeoff:
- p too large (e.g., p = 0.9): Multiple stations likely to transmit → High collision rate
- p too small (e.g., p = 0.1): Stations wait many slots before transmitting → High idle time
Optimal p depends on the number of competing stations (N):
If N stations are waiting, we want exactly ONE to transmit on average. This suggests:
$$p_{optimal} \approx \frac{1}{N}$$
With this choice:
- Expected transmitters = N × (1/N) = 1
- Probability of exactly 1 transmitter is maximized
| N Stations | Optimal p | P(exactly 1 transmits) | P(collision) |
|---|---|---|---|
| 2 | 0.50 | 50% | 25% |
| 3 | 0.33 | 45% | 26% |
| 5 | 0.20 | 41% | 26% |
| 10 | 0.10 | 39% | 26% |
| 20 | 0.05 | 38% | 26% |
| ∞ | 1/N → 0 | ~37% (1/e) | ~26% |
The estimation problem:
The optimal p depends on N, the number of competing stations. But how can a station know N at any given moment? This is a fundamental challenge:
- N varies over time: Stations come and go; traffic is bursty
- N is not directly observable: A station can sense busy/idle, but not count competitors
- Static p is suboptimal: A fixed p works well for one value of N, poorly for others
Solutions in practice:
- Conservative static p: Choose p for expected worst-case N (e.g., p = 0.1)
- Adaptive p: Adjust p based on observed collision rate (more collisions → lower p)
- Hybrid approaches: p-persistent for initial transmission, exponential backoff for retries
The IEEE 802.11 approach: WiFi doesn't use pure p-persistent CSMA but uses a contention window that effectively adapts p. The window doubles after each collision (lowering effective p) and resets after success.
As N → ∞ with p = 1/N, the probability that exactly one station transmits approaches 1/e ≈ 36.8%. This is the same limit we saw in slotted ALOHA! The connection isn't coincidental—both systems use the 'optimal' strategy of one expected transmission per opportunity.
Throughput Analysis of p-Persistent CSMA
Let's analyze the throughput of p-persistent CSMA mathematically.
Model:
- G = Offered load (frames per transmission time)
- a = τ/T_frame = Propagation delay / Frame transmission time
- p = Transmission probability per idle slot
- S = Throughput (successful frame transmissions per unit time)
Simplified throughput derivation:
The analysis is complex due to the slotted structure and persistent monitoring. For the case when a << 1 (small slots relative to frame time), the throughput can be approximated as:
$$S \approx \frac{G \cdot e^{-G} \cdot (1 + a)}{1 + e^{-G}(1 - p^{-1})}$$
For the special case when p = 1 (1-persistent): $$S = \frac{G \cdot e^{-G} \cdot (1 + G + aG(1 + G + aG/2))}{\text{complex denominator}}$$
Throughput behavior:
| p Value | Behavior | Best For |
|---|---|---|
| p → 0 | Very low throughput (too much deferral) | Never optimal |
| p small | Low collisions but high idle time | High N scenarios |
| p optimal | Maximum throughput | Matching N |
| p large | High collisions | Low N scenarios |
| p = 1 | Reduces to 1-persistent | Very light load |
| p | Throughput S | Collision Rate | Idle Ratio |
|---|---|---|---|
| 0.05 | 0.51 | Low | High |
| 0.1 | 0.56 | Low-Medium | Medium-High |
| 0.2 | 0.52 | Medium | Medium |
| 0.3 | 0.48 | Medium-High | Low-Medium |
| 0.5 | 0.41 | High | Low |
| 1.0 | 0.35 | Very High | Zero |
Notice that throughput varies significantly with p. Choosing wrong p can reduce throughput by 20-30% compared to optimal. This sensitivity is why adaptive mechanisms (like 802.11's contention window) are preferred in practice over static p values.
p-Persistent as a Unifying Framework
The p-persistent framework provides a unifying view of CSMA variants. By adjusting p and channel-busy behavior, we can derive other protocols as special cases.
p-persistent generalizes CSMA:
| Protocol | Transmission Probability | When Busy | Effect |
|---|---|---|---|
| 1-Persistent | p = 1 | Monitor continuously | Maximum urgency, high collisions at load |
| Non-Persistent | p = 1 when idle | Random backoff (no monitoring) | Breaks synchronization but wastes idle time |
| p-Persistent | 0 < p < 1 | Monitor continuously | Tunable tradeoff |
| Slotted ALOHA | p per slot | No sensing | No carrier sensing; base case |
The spectrum of aggressiveness:
We can order CSMA variants by how 'aggressively' they attempt transmission:
← More Conservative More Aggressive →
Non-Persistent → p-Persistent (p small) → p-Persistent (p large) → 1-Persistent
- Conservative: Lower collision rate but higher latency and idle time
- Aggressive: Lower latency when successful but more collisions under load
Since optimal p depends on current load (unknown at transmission time), the best practical approach is adaptive: start aggressive, become more conservative after collisions. This is essentially what exponential backoff achieves—dynamically adjusting the effective transmission probability based on observed congestion.
Implementation Considerations
Implementing p-persistent CSMA requires careful attention to several practical considerations.
Slotting requirements:
Slotted Time Structure
- •Slot synchronization: All stations must agree on slot boundaries. This requires either a global clock or distributed synchronization mechanism.
- •Slot size = propagation delay (τ): Slots must be long enough that a transmission starting at slot start is detected by all stations within that slot.
- •Preamble transmission: The frame preamble must be detectable within one slot time, allowing other stations to sense that the channel became busy.
- •Slot boundary decisions: Stations make transmit/defer decisions exactly at slot boundaries, not at arbitrary times.
Random number generation:
Each decision requires a uniform random number in [0, 1]:
- Hardware RNG: Best for security and true randomness
- PRNG with unique seed: Each station uses different seed (e.g., based on MAC address)
- Quality matters: Poor randomness causes statistical clustering → increased collisions
Collision handling:
p-persistent reduces but doesn't eliminate collisions. When collisions occur:
- Detection: Via CSMA/CD (wired) or timeout/NAK (wireless)
- Backoff: Typically exponential backoff rather than p-persistent retry
- Retry: After backoff, frame is retransmitted using the normal algorithm
Pure p-persistent CSMA is rarely used in practice because: (1) Slot synchronization adds complexity, (2) Static p is suboptimal for varying loads, (3) Adaptive mechanisms like exponential backoff perform better. However, p-persistent concepts influence modern protocols—the slot time and contention window in 802.11 reflect p-persistent ideas.
KEEP LEARNING
Keep learning for free.
Read the complete lesson, save your notes and pick up where you left off with a free account. No card needed.