Stop-and-Wait ARQ

The Stop-and-Wait ARQ (Automatic Repeat reQuest) protocol is one of the simplest methods used for ensuring reliable data transmission over unreliable channels. It is widely used in data link layer communication, where the sender and receiver exchange data with guarantees of correctness, error-free transmission, and acknowledgment.

Key Concepts of Stop-and-Wait ARQ:

  1. Sender-Receiver Interaction:
    • The sender sends a single data frame and waits for an acknowledgment (ACK) from the receiver before sending the next frame.
    • If the acknowledgment is not received within a specified timeout period, the sender retransmits the frame.
  2. Acknowledgment (ACK):
    • The receiver sends an acknowledgment (ACK) for each frame received. If a frame is lost or corrupted, the receiver does not send an ACK, prompting the sender to retransmit the frame.
  3. Timeout:
    • A timer is set at the sender’s side when a frame is transmitted. If the sender does not receive an ACK within a set period (timeout), the sender assumes the frame was lost and retransmits it.
  4. Error Handling:
    • If a frame is received with an error (e.g., corruption or loss), the receiver does not acknowledge it, causing the sender to retransmit the frame.

Steps in Stop-and-Wait ARQ:

  1. Sender Sends Frame 1:
    • The sender sends Frame 1 and starts a timer.
  2. Receiver Acknowledges:
    • The receiver receives Frame 1, checks for errors, and sends an ACK (positive acknowledgment) if the frame is error-free.
  3. Sender Receives ACK:
    • The sender waits for the acknowledgment from the receiver. If the sender receives the acknowledgment within the timeout period, it sends the next frame.
  4. Timeout:
    • If the sender does not receive the acknowledgment within the timeout period (due to the frame being lost, corrupted, or delayed), the sender retransmits Frame 1.
  5. Repeat the Process:
    • This cycle repeats for each frame. The sender sends one frame, waits for acknowledgment, and retransmits if no acknowledgment is received.

Detailed Example:

Let’s consider a simple scenario where the sender and receiver exchange data using Stop-and-Wait ARQ:

Assumptions:

  • Frame size: 1,000 bits per frame
  • Transmission rate: 500 bps
  • Round-trip time (RTT): 2 seconds
  • Timeout period: 3 seconds (slightly greater than RTT)
  • Total frames: 3 frames to be sent

Steps:

  1. Step 1: The sender sends Frame 1 and starts a timer (timeout period = 3 seconds).
  2. Step 2: The receiver receives Frame 1, checks for errors, and sends ACK1 after 1 second (assuming no error in transmission).
  3. Step 3: The sender receives ACK1 after 1 second, and the timer stops. The sender sends Frame 2 and waits for ACK2.
  4. Step 4: The receiver receives Frame 2, checks for errors, and sends ACK2.
  5. Step 5: The sender receives ACK2 and sends Frame 3.
  6. Step 6: The receiver receives Frame 3, checks for errors, and sends ACK3.

If any frame is lost, say Frame 2, the process will look like this:

  1. Step 1: The sender sends Frame 1.
  2. Step 2: The receiver acknowledges Frame 1 by sending ACK1.
  3. Step 3: The sender sends Frame 2 and waits for ACK2.
  4. Step 4: Frame 2 is lost during transmission, so the receiver does not send ACK2.
  5. Step 5: The sender waits for ACK2 but times out after 3 seconds.
  6. Step 6: The sender re transmits Frame 2.
  7. Step 7: The receiver receives Frame 2, checks for errors, and sends ACK2.
  8. Step 8: The sender receives ACK2, then sends Frame 3.
  9. Step 9: The receiver acknowledges Frame 3 with ACK3.

Diagram Representation:

If Frame 2 were lost, the sequence would proceed with the retransmission of Frame 2 after the timeout.


Flow Control in Stop-and-Wait ARQ:

  1. Sender Waits for ACK: The sender waits for the receiver to acknowledge a frame before sending the next one. This prevents the sender from overwhelming the receiver and ensures that the receiver has enough buffer space to process incoming frames.
  2. Receiver Buffer: The receiver can only hold one frame at a time since the sender waits for an acknowledgment before sending the next frame. This is a simple form of flow control, limiting the sender to sending only one frame at a time.
  3. Efficiency: While Stop-and-Wait ARQ guarantees reliable transmission, it is inefficient for high-speed or high-latency networks because the sender must wait for an acknowledgment for every frame, leading to idle times. For example, if the round-trip time (RTT) is large, the sender spends most of its time waiting rather than transmitting.

Advantages of Stop-and-Wait ARQ:

  1. Simplicity: Easy to implement and understand. It only involves sending one frame at a time and waiting for a response.
  2. Reliability: Ensures that all frames are transmitted correctly by requiring an acknowledgment for each frame before moving on to the next.
  3. Error Detection: Since each frame is acknowledged separately, errors in transmission are easily detected, and retransmissions can be handled.

Disadvantages of Stop-and-Wait ARQ:

  1. Inefficiency: The sender is often idle, especially in networks with high round-trip times (RTT). The time spent waiting for each acknowledgment reduces the throughput.
  2. Low Bandwidth Utilization: For high-speed networks, Stop-and-Wait underutilizes the link since it can only send one frame at a time.
  3. Timeout Overhead: If the acknowledgment is lost or delayed, the sender has to wait for the timeout period, resulting in additional delays and retransmissions.

Conclusion:

Stop-and-Wait ARQ is a simple and reliable protocol for ensuring correct data transmission, particularly in low-speed or low-latency networks. However, it is not efficient for high-speed networks due to the waiting time between sending frames and receiving acknowledgments. For more efficient communication, protocols like Go-Back-N or Selective Repeat are often used in systems with high-speed or high-latency requirements.

Leave a Reply

Your email address will not be published. Required fields are marked *