Stop-and-Wait ARQ(Automatic Repeat Request) is one of the fundamental protocols used for achieving reliable data transfer. It is a flow control protocol used by the data link layer to regulate the transmission of data between a sender and a receiver.
The primary purpose of the Stop-and-Wait ARQ Protocol is to ensure that each data packet sent by the sender is received and acknowledged by the receiver before the next packet is sent. This acknowledgment-based approach allows for error detection and recovery, ensuring the integrity and reliability of the transmitted data.
What is the Stop and Wait ARQ?
Stop and Wait ARQ can be said to be an improvement over the stop and wait protocol. In stop and wait, if the sender received no acknowledgement it would keep on waiting for an infinite amount of time for it. In this case, however, if the acknowledgement is not received within a certain period of time, the sender retransmits the same packet.
Stop and Wait ARQ uses a timeout timer and sequence numbers to improve upon the Stop and Wait protocol. So in a way :
Let’s look at various scenarios:
Scenario 1: Sender receives acknowledgement before timeout.
This is the ideal scenario. Sender sends the frame and starts it’s timeout timer. The frame is received timely by the recevier and an acknowledgement is sent. Sender receives the acknowledgement before it’s timeout timer expires. It then transmits the next frame.
Scenario 2: The Frame sent by the sender is lost.
In this case:
- The sender sends the frame and starts the timeout timer.
- Frame gets lost in transmission. It is not received by the receiver. Hence, no acknowledgement is sent.
- The sender waits for the acknowledgement.
- Timeout period expires. Sender retransmits the data frame.
- Receiver receives the data frame and sends acknowledgement.
- Acknowledgement is received before the timeout timer expires.
Scenario 3: The acknowledgement is lost.
In this case:
- The sender sends the frame and starts the timeout timer.
- Receiver receives the frame and sends the acknowledgement.
- The acknowledgement gets lost in transmission.
- The sender waits for the acknowledgement.
- Timeout period expires. Sender retransmits the data frame.
- Receiver receives the data frame. It uses the frame’s sequence number and realises that it is the same frame. It discards this frame and resends the acknowledgement.
- Acknowledgement is received before the timeout timer expires.
Scenario 4: The acknowledgement is received after the timeout expires.
In this case:
- The sender sends the frame and starts the timeout timer.
- Receiver receives the frame and sends the acknowledgement.
- The sender waits for the acknowledgement.
- The acknowledgement arrives late. Timeout period expires. Sender retransmits the data frame.
- Receiver receives the data frame. It uses the frame’s sequence number and realises that it is the same frame. It discards this frame and resends the acknowledgement.
Characterstics of Stop and Wait ARQ
- ARQ stands for Automatic Repeat Request.
- Only one frame is transmitted at a time
- Sender Window Size = 1
- Receiver Window Size = 1
- Propagation Delay : Amount of time taken taken by frame to travel from one router to another.
- Round Trip Time = 2 * Propagation Delay
- Efficiency (η) is the ratio of the transmission time to the total time. The total time in this case is the sum of the transmission time and the round trip time.
- In stop and wait, this efficiency is extremely low when compared to other protocols like Go Back N and Selective Repeat. This is due to the waiting time introduced after each frame transmission. Thus, stop-and-wait is more suitable for scenarios where reliability is prioritized over throughput.
- Retransmission = 1
- Number of available sequence numbers in this protocol are 2.
Advantages of Stop-and-Wait ARQ:
The Stop-and-Wait ARQ Protocol offers several advantages in network communication:
Simplicity and Ease of Implementation
The protocol’s simplicity makes it relatively easy to understand and implement in various network environments, making it suitable for basic communication needs.
Error Detection and Recovery
The acknowledgment-based mechanism of the protocol allows for error detection. If the sender does not receive an acknowledgment within the timeout period, it assumes the packet was lost or corrupted and initiates retransmission, ensuring reliable data delivery.
Ensuring Sequential Delivery
The protocol guarantees that data packets are delivered sequentially. This feature is beneficial in applications where the order of data packets is crucial, such as streaming multimedia or file transfers.
Limitations of Stop-and-Wait ARQ:
Low Efficiency and Throughput:
The protocol operates in a stop-and-wait manner, where the sender must wait for acknowledgment before sending the next packet. This results in lower efficiency and reduced data throughput, especially in high-speed networks.
Increased Latency:
The round-trip time (RTT) for each packet, including transmission and acknowledgment, contributes to increased latency. This latency can affect real-time applications that require minimal delays, such as voice and video communication.
Inefficiency in High Bandwidth-Delay Networks:
In networks with high bandwidth and significant delays, the Stop-and-Wait Protocol may underutilize the available bandwidth, leading to decreased network efficiency.
In summary, the stop-and-wait ARQ protocol ensures reliable data transmission, as it guarantees that each frame is acknowledged before the next frame is sent. However, it can result in inefficiencies and reduced throughput due to the inherent waiting time.