Stop and Wait Protocol || Stop and Wait ARQ Protocol || Data link layer || Computer Networks || CN

Sudhakar AtchalaAbout 4 min readMar 19, 2025Watch original
THE SUMMARYAI-generated

Stop and Wait Protocol: Detailed Summary

Key Concepts:

  • Stop and Wait Protocol
  • Frame Loss
  • Acknowledgement Loss (Duplicate Frame Problem)
  • Delayed Acknowledgement
  • Timer
  • Sequence Number
  • Automatic Repeat Request (ARQ)

1. Introduction to Stop and Wait Protocol

The Stop and Wait protocol is a simple data transmission protocol where the sender sends one frame and then waits for an acknowledgement (ACK) from the receiver before sending the next frame. The receiver, upon receiving a frame, sends an ACK back to the sender. This process repeats for each frame. The protocol is named "Stop and Wait" because the sender stops transmitting after sending a frame and waits for the ACK.

2. Problems in Stop and Wait Protocol

The video identifies three main problems associated with the basic Stop and Wait protocol:

  • Frame Loss: The frame sent by the sender is lost during transmission.
  • Acknowledgement Loss: The acknowledgement sent by the receiver is lost during transmission.
  • Delayed Acknowledgement: The acknowledgement is significantly delayed in reaching the sender.

3. Frame Loss Problem and Solution

Problem: The sender sends a frame, but it never reaches the receiver. The receiver waits for a frame, and the sender waits for an acknowledgement, leading to a deadlock.

Solution: Implement a timer at the sender side for each frame.

  • Process:
    1. The sender sends a frame and starts a timer (e.g., 20 milliseconds).
    2. If the sender doesn't receive an ACK within the timer period, it assumes the frame was lost.
    3. The sender retransmits the same frame.
  • Stop and Wait ARQ: Adding a timer to the Stop and Wait protocol transforms it into Stop and Wait Automatic Repeat Request (ARQ). ARQ means that the sender automatically retransmits the frame if an acknowledgement is not received within a specified time.

4. Acknowledgement Loss Problem and Solution (Duplicate Frame Problem)

Problem: The receiver successfully receives the frame and sends an ACK, but the ACK is lost. The sender's timer expires, and it retransmits the same frame. The receiver now receives a duplicate frame.

Solution: Add sequence numbers to the frames.

  • Process:
    1. The sender assigns a sequence number (e.g., 0, 1, 2...) to each frame. For example, the first frame is labeled "Frame 0."
    2. The sender sends "Frame 0" to the receiver.
    3. The receiver receives "Frame 0" and sends an ACK, but the ACK is lost.
    4. The sender's timer expires, and it retransmits "Frame 0."
    5. The receiver, upon receiving "Frame 0" again, recognizes it as a duplicate because it already has "Frame 0."
    6. The receiver discards the duplicate frame and re-sends the ACK for "Frame 0."
  • Duplicate Frame Handling: The receiver identifies duplicate frames by checking the sequence number. If it already has a frame with that sequence number, it discards the new frame.

5. Delayed Acknowledgement Problem and Solution

Problem: The receiver receives a frame and sends an ACK, but the ACK is significantly delayed. The sender's timer expires, and it retransmits the frame. Later, both the delayed ACK and the ACK for the retransmitted frame arrive at the sender. The sender might misinterpret the delayed ACK as an acknowledgement for a subsequent frame.

Solution: Add sequence numbers to the acknowledgements as well.

  • Process:
    1. The sender sends "Frame 0."
    2. The receiver receives "Frame 0" and sends "ACK 0," but it is delayed.
    3. The sender's timer expires, and it retransmits "Frame 0."
    4. The receiver receives "Frame 0" again and sends another "ACK 0."
    5. The delayed "ACK 0" arrives at the sender.
    6. The sender, having already received an "ACK 0" (the non-delayed one), recognizes the delayed "ACK 0" as a duplicate and discards it.
    7. The sender then sends "Frame 1."
    8. Eventually, "ACK 1" arrives, and the process continues.
  • Acknowledgement Numbering: By including the sequence number in the acknowledgement (e.g., ACK 0, ACK 1), the sender can correctly identify which frame the acknowledgement refers to and discard any delayed or duplicate acknowledgements.

6. Stop and Wait ARQ: Comprehensive Solution

Stop and Wait ARQ addresses the problems of frame loss, acknowledgement loss, and delayed acknowledgement by combining the Stop and Wait protocol with:

  • Timer: To detect frame loss.
  • Sequence Numbers: Added to both frames and acknowledgements to identify duplicate frames and acknowledgements.

7. Conclusion

The Stop and Wait protocol is a fundamental data transmission protocol. While simple, it suffers from inefficiencies due to its stop-and-wait nature and is susceptible to errors caused by frame loss, acknowledgement loss, and delayed acknowledgements. The Stop and Wait ARQ protocol enhances the basic protocol by adding timers and sequence numbers, making it more robust and reliable for data transmission.

AI summaries can miss context or contain errors. Check important details against the original video.

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.