0
5.4kviews
What do you mean by flow control compare flow control techniques.
1 Answer
0
34views

Flow Control:

  • A technique to control the rate of flow of frames (packets or messages).
  • Flow control regulates the amount of data a source can send without overwhelming the receiver. If the upper layer at the source computer produces data faster than the upper layer at the destination computer can consume it, the receiver will be overwhelmed with data.
  • To control the flow of data, the receiver needs to send some feedback to the sender to inform the latter it is overwhelmed with data.
  • The network layer in the Internet, however, does not directly provide any flow control. The datagrams are sent by the sender when they are ready without any attention to the readiness of the receiver.
  • Flow control is a set of procedures that tells the sender how much data it can transmit before it must wait for an acknowledgement (ACK) from the receiver.
  • Any receiving device has a limited speed at which it can process incoming data and a limited amount of memory in which to store incoming data.
  • The rate of processing at the receiver is often slower than the rate of transmission. For this reason, each receiving device has memory called buffer, reserved for storing incoming data until they are processed.
  • If the buffer is full, the receiver must be able to tell the sender to halt transmission until it is once again able to receive. Two main techniques have been developed to control the flow of data across communication links:

    1) Stop-and-Wait flow control

    2) Sliding window flow control

1) Stop-and-Wait Flow Control:

  • In stop-and-wait method of flow control, the sender waits for an acknowledgement after every frame it sends. Figure1 shows the concept of stop-and-wait flow control.
  • Only when an acknowledgement has been received by the sender then it sends the next frame. This process of alternately sending and waiting repeats until the sender transmits an End of Transmission (EOT) frame.
  • The advantage of stop-and-wait is simplicity and each frame is checked and acknowledged before the next frame is sent. The disadvantage of stop-and-wait is inefficiency because it is slow.
  • Each frame must travel all the way to the receiver and an acknowledgement must travel all the way back before the next frame can be sent. If the distance between devices is long, the time spent waiting for an ACK between each frame can add significantly to the total transmission time.
  • In the stop-and-wait method of flow control, the sender sends one frame and waits for an acknowledgement before sending the next frame. vi. The Stop-and-Wait protocol is a connection-oriented protocol that provides flow and error control.

enter image description here

2) Sliding Window Flow Control:

  • In the sliding window method of flow control, the sender can transmit several frames before needing an acknowledgement. The receiver acknowledges only some of the frames using a single ACK to confirm the receipt of multiple data frames.
  • The sliding window refers to imaginary boxes at both the sender and the receiver. This window can hold frames. The frames are numbered from 0 to n —1. For example, if n = 9, the frames are numbered 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 2, 2 ...
  • The size of the window is n-1. Sliding window covers one frame less. The window can hold n-1 frames at sender and receiver end, therefore, a maximum of n-1 frames may send before an acknowledgment is required.

Sender Window: At the beginning of a transmission, the sender's window contains n-1 frames. As frames are sent out, the left boundary of the window moves inward, shrinking the size of the window as shown in Figure 2. For example,

enter image description here

  • Given a window size of 8, if frames 0 through 4 have been sent and no ACK has been received, the sender's window contains three frames (5, 6, and 7).
  • If an ACK numbered 4 is received, four frames (0, 1, 2, and 3) are arrived undamaged and the sender's window expands to include the next five frames in its buffer. At this point, the sender's window contains seven frames (5, 6, 7, 8, 0, 1, and 2).
  • The sliding window of the sender shrinks from the left when frames of data are sent and expands to the right when ACKs are received.

Receiver Window: At the beginning of transmission, the receiver window does not contain n-1 frames but n-) spaces for frames. As new frames come in, the size of the receiver window shrinks as shown in Figure 3. The receiver window represents not the number of frames received but the number of frames that may still be received before an ACK must be sent. For example,

  • Given a window size of 8. The window has shrunk by one, so the receiver may now accept seven frames before it is required to send an ACK.

enter image description here

  • If four frames (0, 1, 2, and 3) have arrived but have not been acknowledged, the window will contain four frame spaces.
  • As each ACK is sent out, the receiving window expands to include as many new frame spaces as newly acknowledged frames.
  • The window expands to include as many new frame spaces (S) equal to the number of the most recently acknowledged frame (P) minus the number of the previously acknowledged frame (Q).

    S = P — Q

  • The sliding window of the receiver shrinks from the left when frames of data are received and expands to the right when ACKs are sent.
Please log in to add an answer.