Tech moves fast! Stay ahead of the curve with Techopedia!
Join nearly 200,000 subscribers who receive actionable tech insights from Techopedia.
Automatic Repeat ReQuest (ARQ), also called Automatic Repeat Query, is an error-control protocol that automatically initiates a call to retransmit any data packet or frame after receiving flawed or incorrect data. When the transmitting device fails to receive an acknowledgement signal to confirm the data has been received, it usually retransmits the data after a predefined timeout and repeats the process a predetermined number of times until the transmitting device receives the acknowledgement.
ARQs are often used to assure reliable transmissions over an unreliable service.
Three main types of the ARQ are the Stop-and-wait ARQ, Go-Back-N ARQ, and Selective Repeat ARQ. Stop-and-wait ARQ is the simplest ARQ. It has one frame at a time sent with no additional frames sent until reception of the previous one is confirmed via an acknowledgement signal.
Go-Back-N ARQ is a much more complex protocol. It allows frames to be sent even if previous frames were received without an acknowledgement signal. This protocol keeps track of the sequence. When the last frame is received, it requests re-transmission of the frames sent without an acknowledgement. This is repeated until all frames are received with an acknowledgement signal. However, this protocol may result in many frames being sent multiple times, which can be avoided by using the Selective Repeat ARQ protocol.
Selective Repeat ARQ may be used for the delivery and acknowledgement of sent data packets or the delivery of subdivided messages in sub-units. In the first methodology, the protocol continues to accept and acknowledge frames sent after an initial error. It continues doing this until a specified number of frames have been received, called window size. There is a window size for both transmitting and receiving and they must be equal. The sequence numbers of all frames not received are tracked and sent back to the transmitter.
The sender continues sending frames of unacknowledged data until its window size is reached (it has emptied its window). When this happens, the sender re-sends the frame number given by the acknowledgement signals and continues where it is left off. To ensure whether all frames are received, the size of the sending and receiving windows must be half the maximum sequence number. Thus, if the receiving window is larger than half the maximum sequence number, some or even all of the frames resent, after the required timeouts, are duplicates but not recognized as such. If the sender moves its window (called sliding window) for every acknowledgement received, the number of acknowledgements and the largest sequence number must be equal and half of that number must be the window size used by the receiver.
In the second methodology using subdivided messages, the process is different. Non-continuous communication channels are used where messages vary in length, but the protocols treat the message as a single unit. Alternately, each message may be subdivided into sub-blocks, which are of a fixed length, in a process called packet segmentation. Each message contains a variable number of sub-blocks. Each non-acknowledged response carries an additional bit flag indicating each sub-block successfully received. Each re-transmission decreases in length, it only contains the non-acknowledged sub-blocks.
ARQs with variable length messages have increased difficulty with longer messages, because each repeated message is full length. However, selective retransmission of variable length messages, when using Selective Repeat ARQ, eliminates the difficulty with delivering longer messages. Less difficulty is evidenced by retention of successfully delivered sub-blocks after each transmission and the decrease in the number of outstanding sub-blocks after each transmission.
ARQ protocols reside in the Data Link or Transport layers of the OSI model. TCP uses a variant of Go-Back-N ARQ to ensure reliable data transmission over the Internet protocol. However, it does not guarantee delivery of data packets. If TCP uses Selective Acknowledgement (SACK), Selective Repeat ARQ is used. When local area networks (LAN) have noisy environments, Selective Repeat ARQ is employed with packet segmentation.