ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Computer Networks
    CSI-417
    Progress0 / 18 topics
    Topics
    1. Analogue and Digital Transmission2. Noise3. Media4. Encoding5. Asynchronous and Synchronous Transmission6. Protocol Design Issues7. Network System Architectures (OSI, TCP/IP)8. Error Control9. Flow Control10. Data Link Protocols (HDLC, PPP)11. Local Area Networks and MAC Layer Protocols (Ethernet, Token Ring)12. Multiplexing13. Switched and IP Networks14. Inter-networking15. Routing16. Bridging17. Transport Layer Protocols (TCP/IP, UDP)18. Network Security Issues
    CSI-417›Flow Control
    Computer NetworksTopic 9 of 18

    Flow Control

    7 minread
    1,177words
    Intermediatelevel

    Flow Control in Computer Networks

    Flow control refers to the techniques and mechanisms used to manage the rate at which data is transmitted between sender and receiver in a network. Its primary goal is to ensure that the sender does not overwhelm the receiver with too much data too quickly, allowing for efficient and reliable communication. This becomes especially important when the processing or buffer capacity of the receiver is limited or when there are delays in the network.

    Without flow control, data may be sent faster than the receiver can process or store it, leading to packet loss, data corruption, and congestion. Flow control helps avoid these issues by regulating the data flow and ensuring smooth communication between devices.


    Types of Flow Control

    Flow control can be classified into two broad types:

    1. Open-loop Flow Control
    2. Closed-loop Flow Control

    1. Open-Loop Flow Control

    • Definition: In open-loop flow control, the sender does not have direct feedback from the receiver to adjust the rate of data transmission. Instead, the sender sends data at a fixed rate or predetermined amount based on some initial setup or assumptions about the receiver’s capacity.
    • Characteristics:
      • No real-time feedback or adjustment based on network conditions.
      • Simple and does not require complex interaction between sender and receiver.
      • Typically used in less critical scenarios or when the sender and receiver’s processing power and buffer sizes are known to be sufficient.
    • Example: Sending data at a fixed rate or using a pre-determined packet size (in some scenarios like broadcasting).

    2. Closed-Loop Flow Control

    • Definition: In closed-loop flow control, the sender adjusts its rate of transmission based on feedback from the receiver. This feedback allows the sender to adapt to the receiver’s capacity in real-time, ensuring that the sender does not overwhelm the receiver.
    • Characteristics:
      • Provides dynamic, real-time control of data transmission.
      • More efficient in ensuring that data is sent at an optimal rate.
      • Commonly used in networking protocols like TCP, where both sender and receiver communicate to ensure data is being transmitted at a sustainable rate.
    • Examples: TCP Flow Control using windowing mechanisms and Sliding Window techniques.

    Flow Control Mechanisms

    1. Stop-and-Wait Flow Control

    • How it works: This is one of the simplest forms of flow control. After sending a data frame, the sender waits for an acknowledgment (ACK) from the receiver before sending the next frame. If the sender doesn’t receive an ACK within a certain time, it retransmits the frame.

    • Characteristics:

      • Simple and easy to implement.
      • Inefficient in high-latency or high-speed networks due to idle times while waiting for acknowledgments.
      • Used in protocols like HDLC (High-Level Data Link Control) and X.25.
    • Drawbacks:

      • Inefficient because only one frame is sent at a time, leading to underutilization of the network bandwidth, especially in high-speed or long-distance connections.

    2. Sliding Window Flow Control

    • How it works: Sliding window flow control allows multiple frames to be sent without waiting for an acknowledgment after each frame. The sender can send a set number of frames (window size) before receiving an acknowledgment. The window slides forward as the sender receives acknowledgments from the receiver.

    • Characteristics:

      • More efficient than Stop-and-Wait because multiple frames can be in transit at once.
      • The receiver uses a buffer to store the incoming data until it can be processed, and it notifies the sender of how much buffer space is available (known as the "window size").
      • The sender adjusts its transmission rate according to the available buffer size and the window size.
      • Commonly used in TCP (Transmission Control Protocol) and X.25.
    • Example: In TCP, the receiver’s available buffer space determines the size of the sliding window, allowing the sender to send a maximum number of frames (determined by the window size) before needing an acknowledgment.

    3. TCP Flow Control (Windowing)

    • How it works: TCP uses a dynamic sliding window mechanism for flow control. The receiver advertises its available buffer space, and the sender adjusts the amount of data it sends based on this available buffer size. This ensures that the sender doesn't overwhelm the receiver by sending more data than it can handle.

    • Key Components:

      • Advertised Window Size: This is the amount of buffer space the receiver has available for incoming data.
      • Sender Window Size: The sender's window size determines how many bytes of data it can send before waiting for an acknowledgment.
      • Flow Control in TCP: The sender cannot send more data than the receiver’s buffer can accommodate. The receiver controls the flow by adjusting the advertised window size.
    • Steps in TCP Flow Control:

      1. The sender checks the advertised window size (which is sent by the receiver in the TCP header).
      2. The sender sends data, making sure not to exceed the receiver’s available buffer.
      3. The receiver processes the data and sends back an acknowledgment (ACK) with the updated window size.
      4. The sender adjusts its sending rate based on the updated window size.
    • Example: If the receiver can handle 2,000 bytes of data in its buffer, it advertises a window size of 2,000 bytes. The sender then sends up to 2,000 bytes of data. If the receiver processes some data and frees up space, it may send a new window size (e.g., 1,500 bytes), signaling to the sender to reduce the amount of data it is sending.


    Buffering in Flow Control

    Buffering plays a key role in flow control by temporarily storing data that is being transmitted over the network. The receiver uses buffers to store incoming data while it is being processed.

    • Receiver Buffering: This prevents the receiver from being overwhelmed if the sender transmits too much data too quickly. If the receiver’s buffer is full, the receiver will indicate this by reducing the window size in protocols like TCP, signaling the sender to slow down.

    • Sender Buffering: The sender may also use buffers to hold data that has been transmitted but not yet acknowledged, allowing the sender to handle retransmissions efficiently if needed.


    Advantages and Disadvantages of Flow Control Techniques

    Technique Advantages Disadvantages
    Stop-and-Wait - Simple to implement. - Inefficient in high-speed networks.
    - Ensures reliable transmission with error control. - Causes delays due to waiting for ACKs.
    Sliding Window - More efficient than Stop-and-Wait. - More complex to implement.
    - Allows for higher throughput. - Can still be inefficient in very high-speed networks.
    TCP Flow Control - Dynamic, adjusts to network conditions. - May require additional processing for managing window size and buffers.
    - Prevents congestion and data loss. - Requires both the sender and receiver to maintain proper buffer management.

    Conclusion

    Flow control is a vital part of ensuring efficient data transmission in computer networks. It ensures that the sender does not send more data than the receiver can handle, avoiding congestion, data loss, and buffer overflow. Techniques such as Stop-and-Wait, Sliding Window, and TCP Flow Control help maintain the balance between data transmission speed and receiver capacity. The choice of flow control mechanism depends on the specific requirements of the network, such as speed, efficiency, and reliability.

    Previous topic 8
    Error Control
    Next topic 10
    Data Link Protocols (HDLC, PPP)

    Past Papers

    Open this section to load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time7 min
      Word count1,177
      Code examples0
      DifficultyIntermediate