You are on page 1of 14

MITA DUTTA Electrical Engineering Department Jadavpur University

FLOW CONTROL

Flow control is a technique for assuring that transmitting entity does not overwhelm a receiving entity with data i.e. the sending station must not send frames at a rate faster then the receiving station can absorb them. Flow Control Techniques: Stop-and-Wait Protocol Sliding Window Protocol GO Back N Protocol Selective Repeat Protocol STOP-and- WAIT PROTOCOL The receiver provide feedback to the sender.
1

MITA DUTTA Electrical Engineering Department Jadavpur University

The sender sends one frame and then waits for an acknowledgement before proceeding.

Fig. Operation with no loss


2

MITA DUTTA Electrical Engineering Department Jadavpur University

Dealing with Damaged Frames Adding a timer (on sender) The receiver would only send an ACK if the data were correctly received After timeout, the sender send the frame again. A lost data frame can be resent by using a timer. When an Acknowledgement is lost The senders timer eventually timeout The sender resends the same data frame After the data frame is received, the receiver sends acknowledgment again.

MITA DUTTA Electrical Engineering Department Jadavpur University

Fig. Lost Packet

MITA DUTTA Electrical Engineering Department Jadavpur University

Fig. Lost ACK

MITA DUTTA Electrical Engineering Department Jadavpur University

Fig. timeout for ACK Remarks

MITA DUTTA Electrical Engineering Department Jadavpur University

In stop-and-wait protocol, the source sends a packet and only after the acknowledgement is received from the destination is the next packet sent. This is a simple protocol, but it results in lots of delay, and the channel bandwidth is not used efficiently. The throughput will be very poor. SLIDING WINDOW PROTOCOL

Concept
At any instant of time, the sender maintains a set of sequence numbers which correspond to the frames it is permitted to send. Such frames are said to be a set of the sending window. Similarly, the receiver also maintains a receiving window which indicates the set of frames it is allowed to receive.

MITA DUTTA Electrical Engineering Department Jadavpur University

A window can be visualized as a circle. The upper and lower edges of a sending window indicate the set of packets which are allowed to be sent but have not been acknowledged. The upper and lower edges of a receiving window indicate the set of packets it may accept.

Sending Window When a frame is sent, the upper edge of the window is advanced by one When an acknowledgement is received, the lower edge of the window is advanced by one. Receiving Window

MITA DUTTA Electrical Engineering Department Jadavpur University

Any received frame with the sequence number outside the window is discarded. When a frame whose sequence number is equal to the window is received, the window is rotated by one.

MITA DUTTA Electrical Engineering Department Jadavpur University

Fig. A sliding Window Size of One There are many options as to when to send the acknowledgement. One option is the window size. If the sliding window size is seven, the source can send up to seven packets without waiting for the acknowledgement. The destination can send an acknowledgement after receiving all seven packets. If the destination has not received packet four, it can send an acknowledgement indicating that up to packet three were received. As shown in Figure, if B sends ACK three, the source knows that up to packet three were received correctly, and it sends all the packets from four onwards again.

10

MITA DUTTA Electrical Engineering Department Jadavpur University

Fig. Sliding Window Protocol

Go-Back-N (GBN) Protocol

Go-Back-N is a Protocol, in which the sending process continues to send a number of frames specified by a window size even without receiving an ACK packet from the receiver. The receiver process keeps track of sequence number of the next
11

MITA DUTTA Electrical Engineering Department Jadavpur University

frame it expects to receive, and sends that number with every ACK it sends. The receiver will ignore any frame that does not have the exact sequence number it expects -- whether that frame is a "past" duplicate of a frame it has already ACK'ed or

whether that frame is a "future" frame past the lost packet it is waiting for. Once the sender has sent all of the frames in its window, it will detect that all of the frames since the first lost frame are outstanding, and will go back to sequence number of the last ACK it received from the receiver process and fill its window starting with that frame and continue the process over again. Senders window size is n (n > 1) At most n outstanding frames can be sent

12

MITA DUTTA Electrical Engineering Department Jadavpur University

After receiving a damaged frame Receiver discards all subsequent frames Sender retransmits the damaged frame and all its successors after the times out

Fig. GBN Protocol

Selective Repeat Protocol


Receivers window size is n (n>1) At most n frames can be buffered
13

MITA DUTTA Electrical Engineering Department Jadavpur University

Receiver stores all the correct frames following the bad one The sender retransmits only the bad frame not all its successors

Fig. Selective Repeat

14

You might also like