CSC263 ยท 2078 ยท 10 marks
What is flow control? Explain Stop-and-Wait ARQ with suitable example. How is it different from G-Back-N ARQ?
What is flow control? Explain Stop-and-Wait ARQ with suitable example. How is it different from G-Back-N ARQ?[10]
Quick answer
Flow control is a set of procedures that tells the sender how much data or how many frames it can transmit before overwhelming the receiver. It is a technique that allows two stations working and processing at different speeds to communicate with each other effectively.
Flow Control and ARQ Protocols
1. What is Flow Control? (2 marks)
: "Flow control is basically a technique that gives permission to two stations that are working and processing at different speeds to communicate with another. It is a set of procedures that explains how much data or frames it can transfer before data overwhelms the receiver."
Why it is needed:
- The sender may be faster than the receiver
- Without flow control, the receiver's buffer may overflow
- Data corruption or loss can occur if data rate is not matched on both sides
2. Stop-and-Wait ARQ (4 marks)
Definition
Stop-and-Wait ARQ (Automatic Repeat reQuest) is an error control and flow control protocol in which:
- The sender transmits one frame at a time
- The sender stops and waits for an acknowledgement (ACK) from the receiver before sending the next frame
- If the ACK is not received within a timeout period, the sender retransmits the same frame
Working Mechanism
| Step | Action |
|---|---|
| 1 | Sender sends Frame 0 |
| 2 | Sender starts a timer and waits |
| 3 | Receiver receives Frame 0, sends ACK 1 |
| 4 | Sender receives ACK 1, sends Frame 1 |
| 5 | Process repeats... |
Cases in Stop-and-Wait ARQ
Case 1: Normal Operation (No Error)
Sender Receiver
|------- Frame 0 ------------>|
|<------- ACK 1 --------------|
|------- Frame 1 ------------>|
|<------- ACK 0 --------------|
Case 2: Lost Frame
Sender Receiver
|------- Frame 0 ---X | (Frame lost)
| [Timer expires] |
|------- Frame 0 ------------>| (Retransmit)
|<------- ACK 1 --------------|
Case 3: Lost ACK
Sender Receiver
|------- Frame 0 ------------>|
| ACK 1 ---X | (ACK lost)
| [Timer expires] |
|------- Frame 0 ------------>| (Retransmit)
|<------- ACK 1 --------------|
Example
Suppose a sender wants to send 4 frames: F0, F1, F2, F3.
Sender Channel Receiver
|----F0--------> |
| ----F0------->|
| <---ACK1------|
|<----ACK1------| |
|----F1--------> |
| ----F1------->|
| <---ACK0------|
|<----ACK0------| |
... and so on
- Sender sends F0, waits for ACK
- Receiver gets F0, sends ACK1 (ready for frame 1)
- Sender gets ACK1, sends F1
- This continues until all frames are sent
Limitation
: "Stop-and-Wait ARQ is inefficient compared to other ARQs, because the time between packets is twice the transit time. The throughput on the channel is a fraction of what it could be."
3. Go-Back-N ARQ (3 marks)
Definition
Go-Back-N ARQ is a sliding window protocol where:
- The sender can transmit multiple frames (up to a window size N) without waiting for individual ACKs
- If an error occurs in frame i, the sender must go back and retransmit frame i and all subsequent frames (i, i+1, i+2, ...) even if those subsequent frames were received correctly
Working Mechanism
Sender Receiver
|---F0---> |
|---F1---> |
|---F2---> (Error in F2) |
|---F3---> |
|<---ACK0, ACK1, NAK2-------------|
|---F2---> (Retransmit F2) |
|---F3---> (Retransmit F3) |
|<---ACK2, ACK3-------------------|
4. Difference: Stop-and-Wait ARQ vs Go-Back-N ARQ (1 mark)
| Feature | Stop-and-Wait ARQ | Go-Back-N ARQ |
|---|---|---|
| Frames sent at a time | Only 1 frame | Multiple frames (window size N) |
| Efficiency | Very low (waits after each frame) | Higher throughput |
| On error | Retransmit only the 1 failed frame | Retransmit failed frame + all subsequent frames |
| Window size | 1 | N (N > 1) |
| Buffer at receiver | Not needed | May need buffer |
| Complexity | Simple | More complex |
| Bandwidth utilization | Poor (channel idle during wait) | Better utilization |
: "To solve this problem (inefficiency of Stop-and-Wait), one can send more than one packet at a time. This is what is done in Go-Back-N ARQ and the Selective Repeat mechanisms."
Summary
- Flow control ensures the sender does not overwhelm the receiver
- Stop-and-Wait ARQ is simple but inefficient -- only one frame is in transit at a time
- Go-Back-N ARQ improves efficiency by allowing a window of N frames to be sent, but on error, all frames from the error point onward must be retransmitted
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.