2.3 Flow Control: Stop-and-Wait ARQ & Efficiency Derivation
💡 Core Intuition: The Classroom Q&A Analogy
🍳 The Everyday Analogy: The Single-Question Professor
Imagine a classroom setting where a professor speaks to a student:
- If the professor speaks at 300 words per minute without pausing, the student's brain and pen cannot write fast enough. The student's local memory buffer overflows, and knowledge is lost.
- In the Stop-and-Wait approach, the professor asks one question, stops speaking completely, and waits in absolute silence. Only after the student raises their hand and provides an answer (Acknowledgment) does the professor proceed to the next question.
💻 Bridging to Computer Science
In computer networks, the transmitting host might be a high-performance datacenter server capable of blasting data at , while the receiving host might be an inexpensive embedded sensor or smartphone whose CPU can only ingest data at . Flow Control provides the regulatory feedback mechanism ensuring the sender never overwhelms the receiver's memory buffer.
📑Table of Contents
- ⏱️ The 4 Fundamental Delay Components
- 📐 Mathematical Derivation of Stop-and-Wait Efficiency
- 🔍 Critical Analysis of Parameter a
- 🛡️ Stop-and-Wait ARQ (Handling Noisy Channels)
- 🔄 Interactive Flagship Blueprint: Stop-and-Wait ARQ Space-Time Protocol Ladder
- 📈 Stop-and-Wait Efficiency with Packet Error Probability (P)
- 🏭 Real-World Production Context
- 📐 Numerical Applications & Worked Examples
- 🎯 Exam & Interview Pitfall Check
⏱️ The 4 Fundamental Delay Components
When analyzing any flow control protocol, we must dissect the total time elapsed during packet traversal across the network.
Channel Traversal Delay Components
Chronological latency stages for transmitting a frame across a physical link
Transmission Delay (Tt)
Time to clock all L bits onto physical medium: Tt = L / B.
Propagation Delay (Tp)
Time for physical wave to travel distance d at speed v: Tp = d / v.
Processing Delay (Tproc)
Time for receiver hardware to parse headers and compute CRC (~0 on modern NICs).
1. Transmission Delay ()
The time required for the transmitter's hardware to push all the bits of a frame onto the transmission line one by one:
- = Length of the frame in bits.
- = Bandwidth (transmission speed / bitrate) of the channel in bits per second (bps).
- Analogy: The time it takes for a convoy of cars to pass through a single tollbooth barrier.
2. Propagation Delay ()
The time required for a single bit to physically travel from the transmitter to the receiver across the physical transmission medium of distance :
- = Distance between sender and receiver in meters.
- = Signal propagation velocity through the medium in meters per second (m/s).
- In optical fiber / copper cables: (approx. the speed of light).
- In free space / vacuum / air: .
- Analogy: The time it takes for a car to drive down the highway between Mumbai and Pune after passing the tollgate.
3. Processing Delay ()
The time required by the destination host's NIC and operating system to receive the packet, remove the physical layer preamble, and compute the CRC error checksum. On modern hardware, is typically in microseconds and is conventionally assumed negligible ().
4. Queuing Delay ()
The time the packet spends waiting inside the output queues of intermediate switches and routers before being scheduled for transmission.
📐 Mathematical Derivation of Stop-and-Wait Efficiency
In the basic Stop-and-Wait protocol, the sender transmits one frame and pauses until it receives an Acknowledgment (ACK) from the receiver.
Stop-and-Wait Total Cycle Time Composition
Round-trip timeline encompassing data transit, receiver processing, and ACK return
Transmit Frame (Tt)
Sender clocks L data bits onto the channel at bitrate B.
Process & ACK (Tt,ack)
Receiver validates frame and injects ACK packet (Tt,ack ≈ 0).
Cycle Complete: Tt + 2·Tp
ACK reaches sender. Total idle wait equals round-trip propagation 2·Tp.
1. Total Cycle Time ()
The total duration of one complete Stop-and-Wait cycle is:
In standard analysis:
- An ACK packet contains only control headers with zero data payload, so its size is negligible: .
- Processing delay is negligible: .
Therefore, the total round-trip cycle time simplifies to:
2. Efficiency ()
Efficiency (), also known as Line Utilization, is the ratio of useful transmission time to the total elapsed cycle time:
Dividing the numerator and denominator by :
3. The Parameter
We define the dimensionless ratio :
Substituting into our efficiency formula gives the classic fundamental equation:
4. Throughput / Effective Bandwidth
The actual data delivery rate achieved across the channel is:
🔍 Critical Analysis of Parameter
The parameter dictates the performance of the Stop-and-Wait protocol:
🛡️ Stop-and-Wait ARQ (Handling Noisy Channels)
On an unshielded physical channel, frames or ACKs can be corrupted or lost entirely. To provide reliable transmission, Stop-and-Wait ARQ (Automatic Repeat Request) introduces four vital mechanisms:
- Error Detection (CRC): The receiver computes the CRC. If the frame is corrupted, it is silently discarded.
- Positive Acknowledgments (ACK): The receiver explicitly notifies the sender upon receiving an undamaged frame.
- Retransmission Timer (Timeout Timer / RTO): The sender starts a countdown timer immediately upon transmitting a frame. If no ACK arrives before the timer expires (), the sender assumes the frame or ACK was lost and retransmits.
- Sequence Numbers (Modulo-2 Arithmetic):
- Why are sequence numbers needed? Consider what happens if an ACK is delayed or lost:
- Sender transmits frame Receiver gets it Receiver sends ACK ACK is lost in transit!
- Sender times out and retransmits the same frame.
- Without sequence numbers, the receiver cannot know whether this incoming frame is a brand-new frame or a duplicate of the previous frame!
- How many bits are needed?
- Since at most one frame is in transit at any moment, sequence numbers only need to distinguish between the current frame and the next frame.
- 1 bit is sufficient! Sequence numbers alternate between
0and1(Modulo-2). - Data frames use sequence numbers
Frame 0andFrame 1. - ACKs carry the sequence number of the next expected frame (
ACK 1acknowledgesFrame 0and requestsFrame 1).
- Why are sequence numbers needed? Consider what happens if an ACK is delayed or lost:
🔄 Interactive Flagship Blueprint: Stop-and-Wait ARQ Space-Time Protocol Ladder
The interactive space-time protocol ladder below traces a complete failure-and-recovery cycle in Stop-and-Wait ARQ: successful transmission of Frame 0, transmission of Frame 1 whose ACK is lost in transit, sender retransmission timer expiration, and duplicate handling via 1-bit sequence numbers.
Stop-and-Wait ARQ: Lost ACK Timeout & Duplicate Recovery Ladder
Space-time protocol ladder showing transmission delay, propagation delay, lost ACK in channel, timeout expiration, and duplicate resync
Sender transmits Frame 0 across the physical link and starts its local retransmission timer (RTO). Receiver validates the CRC checksum, delivers payload to Network Layer, and advances its expectation to Frame 1.
📈 Stop-and-Wait Efficiency with Packet Error Probability ()
If the physical transmission link has a packet loss / corruption probability :
- The probability that a frame succeeds on the 1st attempt = .
- The probability that a frame requires attempts = .
- The average number of transmissions () required to successfully deliver one frame is:
Consequently, the realistic efficiency in the presence of noise is:
🏭 Real-World Production Context
Where Stop-and-Wait is Used Today: TFTP & Bootstrapping Firmware
Although high-throughput internet applications use complex sliding window protocols, Stop-and-Wait remains the protocol of choice for Trivial File Transfer Protocol (TFTP) used in PXE Network Booting:
- Network switches, IP phones, and diskless workstations fetch bootloader binaries over local Gigabit Ethernet using Stop-and-Wait lock-step transfers.
- Because the code must fit into minuscule bootstrap ROM chips (), implementing complex multi-packet sliding window queues is impractical.
- On a local low-latency LAN where , Stop-and-Wait provides nearly efficiency with virtually zero implementation complexity!
📐 Numerical Applications & Worked Examples
Example 1: Efficiency and Throughput Calculation for High-Speed Link
Problem Statement:
A communications link operates at a transmission speed of (). The protocol transmits data packets of size each. Assume that the acknowledgment frame has negligible length and the one-way propagation delay is . Compute the channel parameter , the Stop-and-Wait efficiency, and the effective throughput.
Step-by-Step Solution:
- Identify Given Parameters:
- Bandwidth .
- Packet length .
- Propagation delay .
- Calculate Transmission Delay ():
- Calculate Dimensionless Parameter :
- Calculate Protocol Efficiency ():
- Calculate Effective Throughput:
Example 2: Efficiency Evaluation under Channel Packet Error Probability
Problem Statement:
On an unshielded wireless link, the probability of frame corruption is . A Stop-and-Wait ARQ protocol is deployed with a measured delay ratio . Calculate the effective channel efficiency taking retransmissions into account.
Step-by-Step Solution:
- List the Parameters:
- Packet error probability .
- Dimensionless delay ratio .
- Apply the Noisy Channel Efficiency Formula:
- Substitute Values:
- Final Result: The noisy channel achieves an overall efficiency of .
Example 3: Sizing Minimum Frame Length to Guarantee 50% Efficiency
Problem Statement:
A communications link has a bit rate of and a one-way propagation delay of . Determine the minimum frame size required to achieve at least channel utilization using Stop-and-Wait.
Step-by-Step Solution:
- Given Parameters:
- Bandwidth .
- Propagation delay .
- Minimum target efficiency .
- Determine Upper Bound on Parameter :
- Relate to Transmission Delay ():
- Compute Frame Size ():
- Final Result: The frame size must be at least () to sustain line efficiency.
🎯 Exam & Interview Pitfall Check
Question 1: "Why are sequence numbers strictly alternating bits (0 and 1) in Stop-and-Wait ARQ instead of counting monotonically (0, 1, 2, 3...)?"
Key Focus Points:
- At any point in time, the sender has at most one outstanding unacknowledged frame.
- The receiver only ever needs to distinguish between:
- The current expected frame.
- The immediately preceding duplicate frame (arriving due to a lost ACK).
- Two distinct states ( and ) are sufficient to differentiate these two conditions. Any additional bits would waste frame header bandwidth.
Question 2: "What determines the optimal value of the Retransmission Timeout (RTO) timer?"
Key Focus Points:
- The minimum theoretical RTO must be strictly greater than the round-trip time:
- If , the timer expires before the legitimate ACK can physically travel back to the sender, causing premature retransmissions and bandwidth collapse.
Question 3: "What is the Bandwidth-Delay Product (BDP), and why is Stop-and-Wait catastrophic when BDP is large?"
Key Focus Points:
- represents the total volume of bits that can fill the physical link medium like water in a pipe.
- Stop-and-Wait injects only bits into the pipe and then pauses for .
- If , the pipe is virtually empty of the time, resulting in near-zero line utilization.
Trap 1: "Does increasing channel bandwidth always increase the efficiency of Stop-and-Wait?"
Answer: Absolutely NOT—in fact, it DECREASES efficiency! Increasing bandwidth reduces transmission delay . This increases parameter . Since , a higher bandwidth makes the efficiency drop closer to ! To maintain efficiency when upgrading bandwidth, one must proportionally increase frame size .
Trap 2: "Can Negative Acknowledgments (NAK) completely eliminate the need for timeout timers in Stop-and-Wait?"
Answer: No. A receiver can only generate a NAK if it receives a damaged frame. If the frame is lost entirely in the physical channel (e.g., absorbed by fiber attenuation), the receiver does not even know a transmission occurred and will never send a NAK! A sender-side timeout timer is mathematically indispensable.