Computer Networks · Flow Control and Sliding Window
Stop-and-Wait Protocol: Basic Mechanism
Overview
Flow control is the mechanism that makes the sender follow the receiver, transmitting data only when the receiver can accept it.
Stop-and-Wait is the simplest flow control protocol: the sender transmits one packet, stops, and waits for an acknowledgement before sending the next.
Its simplicity is its main strength, but it leaves the sender idle while waiting for each ACK.
Key concepts
- Flow control: the sender always follows the receiver — packets are sent only if the receiver is in a position to receive them.
- Closed loop protocol: another name for flow control protocols, because the sender's behaviour is driven by feedback from the receiver.
- Stop-and-Wait: the simplest flow control mechanism — the sender sends one packet, stops and waits for the receiver's acknowledgement, and sends the next packet only after the ACK arrives.
- Individual acknowledgement: every packet is acknowledged on its own before the next one is sent (packet 1 → ACK → packet 2 → ACK → packet 3 ...).
How it works
- The sender sends packet number 1.
- Packet 1 is received and consumed by the receiver.
- The receiver asks for packet 2, saying "yes, I received packet number 1" (the acknowledgement).
- Only then does the sender send packet number 2.
- The receiver receives packet 2 and says "I have received packet number 2".
- Only then does the sender send packet number 3, and so on.
In short: send one packet → stop → wait until the receiver says it is done → then send the next packet.
Comparison
| Aspect | Stop-and-Wait |
|---|---|
| Advantage | Very simple to implement |
| Disadvantage | Efficiency loss due to waiting, shown using a timeline diagram (the sender sits idle while waiting for the ACK) |
Revision summary
- Flow control = sender follows receiver = closed loop protocol.
- Stop-and-Wait sends exactly one packet, then stops and waits for the acknowledgement.
- The next packet is sent only after the ACK for the current one arrives.
- Each packet is individually acknowledged (packet 1 → ACK → packet 2 → ACK → packet 3 ...).
- Advantage: very simple to implement.
- Disadvantage: the sender sits idle while waiting for the ACK, demonstrated via a timeline diagram.
Previous-year exam insights
- Stop-and-Wait is a reliable protocol only when combined with error detection (checksum) and retransmission: the receiver sends a positive ACK for a correctly received frame and a negative ACK (or silence) for a corrupted one, and the sender retransmits on timeout.
Asked inGATE 1992 - If each transmission attempt succeeds independently with probability p (no error), the number of attempts needed for one packet is geometric with mean 1/p; for N packets the expected total number of transmissions is N/p.
Asked inGATE 2006 - Stop-and-Wait needs only 1-bit sequence numbers (0 and 1 alternating), because at most one frame is outstanding at a time;
the window sizes are sender window = 1 and receiver window = 1.
Asked inUGC NET 2020 - Stop-and-Wait is also called simplex stop-and-wait when data flows in only one direction; the general stop-and-wait protocol is a restricted (closed-loop) simplex protocol, not an unrestricted one.
Asked inUGC NET 2020 - Efficiency (link utilization) of Stop-and-Wait = 1/(1+2a) where a = propagation time / transmission time;
throughput = frame size / (transmission time + 2×propagation time + ACK time). - The sender's idle waiting time in Stop-and-Wait is one full round-trip time (RTT = 2×propagation delay), which is the source of its poor utilization on links with large bandwidth-delay product.