Stop and Wait ARQ (Automatic Repeat reQuest) is one of the simplest protocols used for reliable data transmission in computer networks. It is a flow control and error control mechanism that ensures data is transmitted correctly between sender and receiver, especially over noisy or unreliable communication channels.
Stop and Wait ARQ is a protocol where the sender transmits a single data frame, then waits for an acknowledgment (ACK) from the receiver before sending the next frame. If the sender does not receive an acknowledgment within a specified timeout period, it assumes that the frame was lost or corrupted and retransmits it.
This protocol is used in connection-oriented communication and provides both flow control and error control. It is primarily implemented in the Data Link Layer and Transport Layer of the OSI model.
The Stop and Wait ARQ protocol follows these steps:
Sender Transmits a Frame: The sender transmits a data frame with a sequence number (typically 0 or 1) and starts a timer.
Receiver Processes the Frame: The receiver checks the received frame for errors.
Receiver Sends Acknowledgment:
If the frame is received correctly, the receiver sends an acknowledgment (ACK) with the sequence number of the next expected frame.
If the frame is corrupted, the receiver discards it and does not send an acknowledgment.
Sender Waits for Acknowledgment:
If the sender receives the correct ACK before the timer expires, it sends the next frame.
If the timer expires before receiving an ACK, the sender assumes the frame or the ACK was lost and retransmits the same frame.
Sequence Numbers: To handle duplicate frames (which can occur if an ACK is lost), the protocol uses sequence numbers. In the simplest form of Stop and Wait ARQ, only two sequence numbers (0 and 1) are needed, as there is at most one unacknowledged frame at any time.
The timeout period is the maximum time the sender waits for an acknowledgment before retransmitting a frame. It should be set to at least the round-trip time (RTT), which is the time it takes for a frame to reach the receiver plus the time it takes for an acknowledgment to return to the sender.
If the timeout period is too short, the sender may retransmit frames unnecessarily. If it's too long, the protocol becomes inefficient when frames or acknowledgments are lost.
In Stop and Wait ARQ, sequence numbers are used to identify frames and their corresponding acknowledgments. Since there is at most one unacknowledged frame at any time, only two sequence numbers (0 and 1) are needed.
The sequence number alternates between 0 and 1 for each new frame. The acknowledgment number indicates the sequence number of the next expected frame.
Propagation delay is the time it takes for a frame to travel from the sender to the receiver. It affects the efficiency of the Stop and Wait ARQ protocol, especially over long-distance networks.
The efficiency of Stop and Wait ARQ is relatively low, especially over long-distance networks or high-bandwidth channels. This is because the sender must wait for an acknowledgment before sending the next frame, leading to idle time.
The efficiency can be calculated as:
Efficiency = Transmission Time / (Transmission Time + 2 * Propagation Time + Processing Time)
Where:
Transmission Time is the time it takes to transmit a frame.
Propagation Time is the time it takes for a frame to travel from the sender to the receiver.
Processing Time is the time it takes for the receiver to process a frame and generate an acknowledgment.
For a simplified calculation, assuming negligible processing time:
Efficiency = 1 / (1 + 2a)
Where a is the ratio of propagation time to transmission time.
Simplicity: Stop and Wait ARQ is simple to implement and understand.
Error Control: It provides reliable data transmission by detecting and retransmitting lost or corrupted frames.
Flow Control: It prevents the sender from overwhelming the receiver by ensuring that the receiver has processed the current frame before the next one is sent.
Low Buffer Requirements: Since there is at most one unacknowledged frame at any time, the buffer requirements are minimal.
Low Efficiency: The protocol is inefficient, especially over long-distance networks or high-bandwidth channels, due to the idle time while waiting for acknowledgments.
Underutilization of Bandwidth: The channel is often idle, leading to underutilization of the available bandwidth.
High Latency: The protocol introduces latency, as each frame must be acknowledged before the next one can be sent.
Vulnerability to Channel Noise: In noisy channels, frequent retransmissions may be required, further reducing efficiency.
Despite its limitations, Stop and Wait ARQ is used in various applications:
Local Area Networks (LANs): In LANs, where propagation delays are small, Stop and Wait ARQ can be efficient enough for many applications.
Low-Bandwidth Channels: In channels with low bandwidth, the efficiency loss due to waiting for acknowledgments may be acceptable.
Simple Devices: In simple devices with limited processing power and memory, Stop and Wait ARQ provides a straightforward way to ensure reliable data transmission.
Educational Purposes: Stop and Wait ARQ is often used to introduce the concepts of flow control and error control in networking courses.
To address the limitations of Stop and Wait ARQ, several improvements and alternatives have been developed:
Go-Back-N ARQ: Allows the sender to transmit multiple frames before receiving an acknowledgment, up to a specified window size. If an error is detected, all frames from the error onwards must be retransmitted.
Selective Repeat ARQ: Similar to Go-Back-N, but only the frames with errors need to be retransmitted, improving efficiency.
Sliding Window Protocol: A generalized form of flow control that encompasses both Go-Back-N and Selective Repeat ARQ.
Stop and Wait ARQ is a simple yet effective protocol for reliable data transmission in computer networks. It provides both flow control and error control, ensuring that data is transmitted correctly between sender and receiver. While it has limitations in terms of efficiency, especially over long-distance networks or high-bandwidth channels, it remains useful in various applications, particularly in local area networks and simple devices.
For more advanced applications requiring higher efficiency, alternatives such as Go-Back-N ARQ, Selective Repeat ARQ, or the Sliding Window Protocol may be more appropriate.
Test Your Knowledge
Take a quiz to reinforce what you've learned
Exam Preparation
Access short and long answer questions for written exams