Computer Network | Flow control Methods: Stop and Wait


Some times sending data packets at higher rate to a less efficient receiver may cause for the discarding of data from the buffer and lead to data loss. Flow control methods are used to avoid this dilemma.

Stop and Wait

When the data packet from the sender reaches at the receiver it returns a success message and once the sender acknowledges the success return it will go for the the next one. This sequence of protocols are know as stop and wait method of flow control.

In theoretical questions Tq and Tprocess usually approximates as zero. Generally Transmission delay for the acknowledgement will be negligibly small (about 10-3 times) compared to transmission delay for the data,which may also can approximate to zero.

Piggybacking is a concept where data is send along with acknowledgment and other control information during bidirectional communication. So in Piggybacking acknowledgement time will become equal to that of propagation transmission time.

Cases where Tacknowledgement, Tq and Tprocess is approximated as zero, total time can be written as

Ttotal = Tt- data + 2 *Tpropagation

A better control method makes efficient communication. Here, as propagation delay become larger, the sender have to wait much longer to send next packet of data, which leads to a inefficient communication.

Efficiency η = useful time/ total cycle time

η = TtTtotal time = Tt (Tt+ 2 Tp) = 1(1+ 2 (TpTt))= 1(1+ 2a) [ a = TpTt ]

In networking throughput is the amount of bits a system is able to send in seconds.

Throughput = L(Ttotal) =(L/BW)*BW(Ttotal) = (Tt-data) * BW(Ttotal)=η* BW

Some times throughput is also called effective bandwidth or bandwidth utilization

  • The efficiency will decrease with increase in distance between sender and receiver, so stop and wait flow control method is better with LAN and less efficient for WAN.
  • As the size of data packet increases the efficiency of stop and wait flow control method becomes high, so its is better for larger packets of data.

Failures and solutions of stop and wait

The protocols of wait and stop flow control methods defined as, after sending a data packet to receiver, the sender has to wait until the acknowledgement is get back to the sender from the receiver as described above.

Case 1: Data missing

By any cause if the "data" get missed in between sender and receiver, the receiver will wait for the data and sender will wait for the acknowledgement and both of them will get into a deadlock.

To avoid the deadlock usually will go with a "time out timer", so that if the acknowledgement did not receive with in specified time out time the device will consider it as data loss and continue with next packet. This method with addition of timer is known as S&W with ARQ (stop and wait with automatic request).

Case 2: Duplicate packet problem

Suppose the data send by sender is received and receiver and it had replied with acknowledgement, but but what if during the propagation the acknowledgement it get lost?, sender will continue to send same data after specific duration declared on time out timer and it causes for the duplication of data multiple times at the receiver. This scenario is called "duplicated packet problem".

Addition of unique sequence number to the data packets, makes each packets distinguishable for receiver, hence the duplication can be eliminated.

Case 2: Delayed acknowledgement

Suppose sender had send a packet of data D1 and by some reason its acknowledgement A2 got delayed , by the way 'time out timer' triggered the resenting of same data packet (say D1') second time and you got its acknowledgement A2'. Acknowledging of A2' turned to sending of next packet of data D2 and before reaching its real acknowledgment A3 if delayed acknowledgment A2 reaches at the the sender it may misunderstand A2 as A3 and may go for sending of next packet.

In order to remove this issue, with each acknowledgment has to be named with sequential id numbers, so that it is differentiable to the sender.

So Along with Stop and wait algorithm if we use time out timer, sequential ID for data and acknowledgment all of communication problems can be resolved.

Comments