Stop-and-wait ARQ

From Wikipedia, the free encyclopedia

Stop-and-wait ARQ is one kind of Automatic Repeat-reQuest (ARQ) method, in which the communication is done one frame at time. After each frame the sender waits for ACK (acknowledgement) signal and doesn't send any further frames until it is received. If the received frame is damaged or lost, the receiver discards it and does not send an ACK. If a certain time, known as the timeout, passes without ACK, the sender sends the frame again.

The above behavior is the simplest Stop-and-Wait implementation. However, in a real life implementation there are problems to be addressed.

One problem is where the ACK sent by the receiver is damaged or lost. In this case, the sender doesn't receive the ACK, times out, and sends the frame again. Now the receiver has two copies of the same frame, and doesn't know if the second one is a duplicate frame or the next frame of the sequence carrying identical data.

Another problem is when the sender's timeout runs out before the frame reaches the receiver. In this case the sender resends the same packet. Eventually the receiver gets two copies of the same frame, and sends an ACK for each one. The sender, waiting for a single ACK, receives two ACKs, which may cause problems if it assumes that the second ACK is for the next frame in the sequence.

To avoid these problems, the most common solution is to define a 1 bit sequence number which is attached to the header of the frame. This sequence number alternates (from 0 to 1) in subsequent frames. When the receiver sends an ACK, it attaches the sequence number of the next packet it expects. This way, the receiver can detect duplicated frames by checking if the frame sequence numbers alternate. If two subsequent frames have the same sequence number, they are duplicates, and the second frame is discarded. Similarly, if two subsequent ACKs have the same sequence number, they are acknowledging the same frame.

This is very inefficient compared to other ARQs, because the time between packets, if the ACK and the data are received successfully is twice the transit time (assuming the turnaround time can be zero). The throughput on the channel is a very small fraction of what it could be. To solve this problem, one can send more than one packet at a time with a larger sequence number and use one ACK for a set. This is what is done in Go-Back-N ARQ and the Selective Repeat ARQ. (Source: Tannenbuam, Andrew S. Computer Networks 4th ed. ISBN 0130661023)