Flow Control Protocols Compared: Stop-and-Wait, Go-Back-N, and Selective Repeat
Compare and contrast Stop-and-Wait, Go-Back-N, and Selective Repeat flow control protocols. This guide explains their mechanisms, highlighting their differences in efficiency and reliability, and helping you understand how these protocols manage data transmission rates in computer networks.
Comparing Flow Control Protocols: Stop-and-Wait, Go-Back-N, and Selective Repeat
Introduction to Flow Control
Flow control in computer networks manages the rate of data transmission between sender and receiver to prevent data loss or network congestion. If a receiving device can't process data as quickly as it arrives, it could cause buffer overflows and lead to data loss. Flow control protocols ensure that data is sent at a rate the receiver can handle. Three common approaches are Stop-and-Wait, Go-Back-N, and Selective Repeat.
Stop-and-Wait Protocol
Stop-and-Wait is a simple flow control mechanism where the sender transmits one frame at a time and waits for an acknowledgment (ACK) from the receiver before sending the next. It's easy to understand and implement but is very inefficient for high-bandwidth networks because only one packet can be in transit at a time.
Characteristics:
- One frame sent at a time.
- Sender waits for ACK before sending the next frame.
- Used for noiseless channels; no error handling.
- Half-duplex transmission (one direction at a time).
Sliding Window Protocols
Sliding window protocols significantly improve efficiency by allowing the sender to transmit multiple frames before waiting for acknowledgments. This reduces the idle time and improves throughput (the amount of data transmitted per unit of time). They use sequence numbers to track packets.
Types of Sliding Window Protocols:
- Go-Back-N ARQ
- Selective Repeat ARQ
Go-Back-N ARQ
In Go-Back-N ARQ (Automatic Repeat reQuest), the sender can transmit up to N frames (where N is the window size) before waiting for an acknowledgment. If an error occurs (a frame is lost or corrupted), the receiver discards all subsequent frames. The sender, upon timing out (not receiving an ACK), retransmits all frames starting from the one that caused the error.
Selective Repeat ARQ
Selective Repeat ARQ is more efficient than Go-Back-N. Only the lost or corrupted frames are retransmitted. The receiver buffers out-of-order packets, requesting only the specific missing or damaged frames. Both the sender and receiver have the same window size.
Comparison: Stop-and-Wait vs. Sliding Window
Feature | Stop-and-Wait | Sliding Window |
---|---|---|
Frames in Transit | One | Multiple |
Efficiency | Low | High |
Acknowledgment | After each frame | After multiple frames |
Duplex | Half-duplex | Full-duplex |
Propagation Delay | High | Low |
Link Utilization | Low | High |
Comparison: Go-Back-N vs. Selective Repeat
Feature | Go-Back-N | Selective Repeat |
---|---|---|
Retransmissions | Entire window | Only lost/corrupted frames |
Bandwidth Efficiency | Lower (especially at high error rates) | Higher |
Complexity | Lower | Higher |
Window Size (Sender) | N | N |
Window Size (Receiver) | 1 | N |
Frame Ordering | Sequential | Reordering may be needed at receiver |
Buffering | No buffering at receiver | Buffering at receiver |
Acknowledgement | Cumulative | Individual |
Conclusion
Stop-and-wait is simple but inefficient. Sliding window protocols (Go-Back-N and Selective Repeat) offer much higher throughput. Selective Repeat is the most efficient but also the most complex. The choice of protocol depends on the balance between complexity and performance needed for a particular application.