3.3.1-Problems On Stop and Wait Flow Control
3.3.1-Problems On Stop and Wait Flow Control
A set of procedures which are used for restricting the amount of data that a sender can send to the receiver.
Sender sends the next packet only after it receives the acknowledgement for the previous packet.
It works under the following assumptions-
o Communication channel is perfect.
o No error occurs during transmission.
How it Works?
Now, let us analyze in depth how the transmission is actually carried out-
= (Transmission delay + Propagation delay + Queuing delay + Processing delay) packet + (Transmission delay + Propagation delay + Queuing delay
+ Processing delay)ACK
Assume-
Queuing delay and processing delay to be zero at both sender and receiver side.
Transmission time for the acknowledgement to be zero since it’s size is very small.
Total time taken in sending one data packet = (Transmission delay + Propagation delay)packet + (Propagation delay)ACK
We know,
So, we have-
Total time taken in sending one data packet = (Transmission delay)packet + 2 x Propagation delay
Efficiency-
where-
Thus,
Factors Affecting Efficiency-
We know,
Number of bits that can be sent through the channel per second is called as its throughput.
Advantages-
Limitations-
Point-01:
Sender will keep waiting for the acknowledgement for infinite time.
Receiver will keep waiting for the data packet for infinite time.
Point-03:
Sender will keep waiting for the acknowledgement for infinite time.
Receiver will keep waiting for another data packet for infinite time.
Important Notes-
Note-01:
Note-02:
Bandwidth Utilization /Effective Bandwidth /Maximum data rate possible /Maximum achievable throughput
Note-03:
Stop and Wait protocol performs better for LANs than WANs.
This is because-
Efficiency of the protocol is inversely proportional to the distance between sender and receiver.
So, the protocol performs better where the distance between sender and receiver is less.
The distance is less in LANs as compared to WANs.
The main problem faced by the Stop and Wait protocol is the occurrence of deadlock due to-
How it works?
Stop and wait ARQ works similar to stop and wait protocol.
It provides a solution to all the limitations of stop and wait protocol.
Stop and wait ARQ includes the following three extra elements.
Thus, we can say-
= Stop and Wait Protocol + Time Out Timer + Sequence Numbers for Data Packets and Acknowledgements
NOTE:
For any sliding window protocol to work without any problem, the following condition must be satisfied-
Available Sequence Numbers >= Sender Window Size + Receiver Window Size
Stop and wait ARQ is a one bit sliding window protocol where-
=1+1
=2
Thus,
Time out timer helps to solve the problem of lost data packet.
After sending a data packet to the receiver, sender starts the time out timer.
If the data packet gets acknowledged before the timer expires, sender stops the time out timer.
If the timer goes off before receiving the acknowledgement, sender retransmits the same data packet.
After retransmission, sender resets the timer.
This prevents the occurrence of deadlock.
2. Problem of Lost Acknowledgement-
Sequence number on data packets help to solve the problem of delayed acknowledgement.
Consider the acknowledgement sent by the receiver gets lost.
Then, sender retransmits the same data packet after its timer goes off.
This prevents the occurrence of deadlock.
The sequence number on the data packet helps the receiver to identify the duplicate data packet.
Receiver discards the duplicate packet and re-sends the same acknowledgement.
Role of Sequence Number on Data Packets
Step-01:
Step-02:
Step-03:
Step-04:
Step-05:
Receiver receives the data packet and discovers it is the duplicate packet.
It expects the data packet with sequence number-1 but receiving the data packet with sequence number-0.
It discards the duplicate data packet and re-sends acknowledgement ACK-1.
ACK-1 requests the sender to send a data packet with sequence number-1.
This avoids the inconsistency of data.
Conclusion-
Had the sequence numbers not been allotted to the data packets, receiver would have accepted the duplicate data packet thinking of it
as the new data packet.
This is how sequence numbers allotted to the data packets prove to be useful for identifying the duplicate data packets and discarding
them.
3. Problem of Delayed Acknowledgement-
Step-01:
Step-03:
Acknowledgement ACK-1 sent by the receiver gets delayed in reaching the sender.
Step-04:
Step-05:
Receiver receives the data packet and discovers it is the duplicate packet.
It expects the data packet with sequence number-1 but receiving the data packet with sequence number-0.
It discards the duplicate data packet and re-sends acknowledgement ACK-1.
ACK-1 requests the sender to send a data packet with sequence number-1.
Step-06:
Conclusion-
Had the sequence numbers not been allotted to the acknowledgements, sender would have accepted the duplicate acknowledgement
thinking of it as the new acknowledgement for the latest data packet sent by it.
This is how sequence numbers allotted to the acknowledgements prove to be useful for identifying duplicate acknowledgements and
discarding them.
If receiver receives a corrupted data packet from the sender, it sends a negative acknowledgement (NAK) to the sender.
NAK requests the sender to send the data packet again.
Stop and Wait Protocol Vs Stop and Wait ARQ-
The following comparison table states the differences between the two protocols-
Data packet sent by the sender can never get corrupt. Data packet sent by the sender may get corrupt.
There is no concept of time out timer. Sender starts the time out timer after sending the data packet.
Data packets and acknowledgements are numbered using
There is no concept of sequence numbers.
sequence numbers.
The major limitation of Stop and Wait ARQ is its very less efficiency.