Introduction
Flow control regulates data transmission between sender and receiver to prevent buffer overflow or underflow. It ensures efficient, reliable communication by controlling the sender’s data rate according to receiver capacity and network conditions.
"Flow control is the mechanism that prevents a fast sender from overwhelming a slow receiver in data communication." -- Andrew S. Tanenbaum
Definition and Objectives
Definition
Flow control: process of managing data rate between two nodes to ensure receiver buffers are not exceeded and data integrity is maintained.
Primary Objectives
- Prevent receiver buffer overflow.
- Maintain data transmission synchronization.
- Maximize throughput without loss.
- Adapt to varying network conditions.
Secondary Goals
Reduce retransmissions, minimize latency, and improve overall connection stability.
Importance in Transport Layer
Transport Layer Role
Ensures end-to-end data delivery, reliability, and error control. Flow control is critical to guarantee receiver readiness.
Relationship to Reliability
Complements error control by controlling data volume; prevents data loss due to overflow.
Interaction with Other Layers
Works with network and data link layers for congestion control and error detection.
Flow Control Mechanisms
Stop-and-Wait
Sender transmits one frame, waits for acknowledgment before sending next. Simple, but inefficient at high delays.
Sliding Window
Allows multiple frames in transit. Sender maintains a window of frames permitted to send before receiving ACKs.
Credit-Based Control
Receiver grants credits indicating how many data units sender can transmit.
Rate-Based Control
Sender adjusts sending rate dynamically based on feedback.
Stop-and-Wait Protocol
Operation
Send one packet; wait for ACK; retransmit if timeout.
Advantages
Simplicity, easy implementation, reliable for low bandwidth-delay products.
Disadvantages
Poor utilization of link capacity in high latency networks; low throughput.
Use Cases
Simple control channels, error-prone links, or minimal hardware.
Sliding Window Protocol
Concept
Sender maintains a window of frames allowed for transmission; slides forward on ACK reception.
Types
- Go-Back-N: retransmit all frames after a lost frame.
- Selective Repeat: retransmit only erroneous frames.
Efficiency
Higher throughput, better link utilization, suitable for high bandwidth-delay product networks.
Window Management
Dynamic adjustment depending on network feedback and receiver buffer size.
Window Size and Sequence Numbers
Window Size
Defines number of unacknowledged frames allowed in transmission; impacts throughput and buffer usage.
Sequence Numbers
Unique identifiers for frames; enable ordering and loss detection.
Maximum Window Size
Limited by sequence number space to avoid ambiguity.
Wrap-Around Handling
Modulus arithmetic used to manage sequence number cycling.
| Parameter | Description |
|---|---|
| Window Size | Number of frames sender can transmit without ACK |
| Sequence Number Space | Range of valid sequence numbers (e.g., 0 to 2^n-1) |
| ACK Number | Next expected sequence number by receiver |
Flow Control in TCP
TCP Sliding Window
Dynamic window size advertised by receiver via window field in TCP header.
Receiver Window
Indicates buffer space available; limits sender’s outstanding data.
Window Scaling
Extension to support windows larger than 65,535 bytes.
Zero Window
Receiver signals no buffer space; sender pauses transmission.
Window Update
Receiver sends window update when buffer frees space.
Buffer Management
Receiver Buffers
Store incoming data until application reads; size impacts flow control.
Sender Buffers
Hold sent but unacknowledged data for potential retransmission.
Buffer Overflow
Leads to data loss; flow control mechanisms prevent this.
Buffer Allocation Strategies
Static vs dynamic allocation; trade-off between memory use and performance.
Congestion Avoidance vs Flow Control
Flow Control
Prevents receiver overload; end-to-end control at transport layer.
Congestion Control
Prevents network overload; controls data rate globally using feedback.
Interaction
Independent but complementary; TCP integrates both.
Performance Considerations
Throughput
Window size directly impacts throughput; larger windows increase efficiency.
Latency
Stop-and-wait increases latency; sliding window reduces it.
Error Rates
High error rates require retransmissions; impact flow control effectiveness.
Buffer Sizes
Must be balanced against memory constraints and expected traffic volume.
Common Algorithms and Standards
Go-Back-N ARQ
Retransmits all frames after lost or erroneous one; simple but bandwidth-heavy.
Selective Repeat ARQ
Retransmits only erroneous frames; complex but efficient.
TCP Flow Control Algorithm
Uses advertised window and acknowledgments to adjust sending rate.
Standard Protocols
TCP, SCTP, and some data link layer protocols implement flow control variants.
Sliding Window Algorithm:1. Initialize send_base and next_seq_num to 0.2. While next_seq_num < send_base + window_size: Send packet[next_seq_num]. next_seq_num += 1.3. On ACK receipt for packet i: send_base = i + 1.4. If send_base == next_seq_num: Stop timer. Else: Restart timer.References
- Peterson, L. L., & Davie, B. S. Computer Networks: A Systems Approach, 5th ed., Morgan Kaufmann, 2011, pp. 213-235.
- Tanenbaum, A. S., & Wetherall, D. J. Computer Networks, 5th ed., Pearson, 2010, pp. 245-270.
- Stevens, W. R. TCP/IP Illustrated, Volume 1: The Protocols, Addison-Wesley, 1994, pp. 180-210.
- Kurose, J. F., & Ross, K. W. Computer Networking: A Top-Down Approach, 7th ed., Pearson, 2017, pp. 260-290.
- RFC 793: Transmission Control Protocol, Postel, J., IETF, 1981, pp. 1-74.