Flow control is the process of controlling the rate at which a computer sends data. Depending
on the particular protocol, both the sender and the receiver of the data (as well as any intermediate routers, bridges, or switches) might participate in the process of controlling the flow from sender to receiver.
Flow control prevents unnecessary congestion by attempting to send data at a rate that the network can currently accomodate. A sender of data might be sending the data faster than the receiver can receive the data, so the receiver discards the data. Also, the sender might be sending the data faster than the intermediate switching devices (switches and routers) can forward the data, also causing discards. Packets can be lost because of transmission errors as well. This happens in every network, sometimes temporarily and sometimes regularly, depending on the network and the traffic patterns. The receiving computer can have insufficient buffer space to receive the next incoming frame, or possibly the CPU is too busy to process the incoming frame. Intermediate routers might need to discard the packets based on temporary lack of buffers or processing as well.
Flow control attempts to reduce unnecessary discarding of data. Comparing flows when flow control is used and when it is not used is helpful for understanding why flow control can be useful. Without flow control, some PDUs are discarded. If some reliable protocol in use happens to implement error recovery, the data is resent. The sender keeps sending as fast as possible. With flow control, the sender can be slowed enough that the original PDU can be forwarded to the receiving computer, and the receiving computer can process the PDU. Flow-control protocols do not prevent the loss of data as a result of congestion; these protocols simply reduce the amount of lost data, which, in turn, reduces the amount of retransmitted traffic, which hopefully reduces overall congestion. However, with flow control, the sender is artificially slowed or throttled so that it sends data less quickly than it could without flow control.
Table 3-5 Examples of Error-Recovery Protocols and Their Features
Feature TCP SPX LLC2
Acknowledges data in both directions? Yes Yes Yes
Uses forward acknowledgment? Yes Yes Yes
Counts bytes or frame/packets? Bytes Packets Frames
Necessitates resending of all data, or just one part and wait when resending?
OSI Transport Layer Functions 103
The CCNA exam requires that you be familiar with three features, or methods, of implementing flow control:
•
Buffering•
Congestion avoidance•
WindowingBuffering
Buffering simply means that the computers reserve enough buffer space that bursts of incoming
data can be held until processed. No attempt is made to actually slow the transmission rate of the sender of the data. In fact, buffering is such a common method of dealing with changes in the rate of arrival of data that most of us probably would just assume that it is happening. However, some older documentation refers to “three methods of flow control,” of which buffering is one of the methods, so be sure to remember it as a separate function.
Congestion Avoidance
Congestion avoidance is the second method of flow control covered here. The computer
receiving the data notices that its buffers are filling. This causes either a separate PDU or a field in a header to be sent toward the sender, signaling the sender to stop transmitting. Figure 3-9 shows an example.
Figure 3-9 Congestion-Avoidance Flow Control
Sender Receiver 1 2 3 4 5 6 Stop Go ... ..
I'm overwhelmed! I'll tell him to stop! I've caught up. I'll tell
104 Chapter 3: OSI Reference Model and Layered Communication
“Hurry up and wait” is a popular expression used to describe the process used in this congestion-avoidance example. This process is used by Synchronous Data Link Control (SDLC) and Link Access Procedure, Balanced (LAPB) serial data-link protocols. A preferred method might be to get the sender to simply slow down instead of stopping altogether. This method would still be considered congestion avoidance, but instead of signaling the sender to stop, the signal would mean to slow down. One example is the TCP/IP Internet Control Message Protocol (ICMP) source quench message. This message is sent by the receiver or some intermediate router to slow the sender. The sender can slow down gradually until source quench messages are no longer received.
Windowing
The third category of flow-control methods is called windowing. A window is the maximum amount of data that the sender can send without getting an acknowledgment. If no
acknowledgment is received by the time the window is filled, the sender must wait for acknowledgment. Figure 3-10 shows an example. The slanted lines indicate the time difference between sending a PDU and its receipt.
Figure 3-10 Windowing Flow Control—Window Size 3
In this example, the sender has a window of three frames. After the receiver acknowledges the receipt of frame 1, frame 4 can be sent. After a time lapse, the acknowledgment for frames 2 and 3 are received, which is signified by the frame sent by the receiver with the
Acknowledgment field equal to 4. So, the sender is free to send two more frames—frames 5 and 6—before another acknowledgment is received.
Table 3-6 summarizes the flow-control terms and provides examples of each type. Memorizing these terms should help trigger your memory of flow-control concepts.
Sender Window = 3 Receiver 1 2 5 6 3 4 Ack = 4 Ack = 2 3 unacknowledged, wait!
Now only 2 unacknowledged, send 1 more
Now only 1 unacknowledged, send 2 more