Problem-03:
Station A needs to send a message consisting of 9 packets to station B using a sliding
window (window size 3) and go back n error control strategy. All packets are ready and
immediately available for transmission.
If every 5th packet that A transmits gets lost (but no ACKs from B ever get lost), then what
is the number of packets that A will transmit for sending the message to B?
Solution-
Given-
Total number of packets to be sent = 9
Go back N is used where N = 3
Every 5th packet gets lost
Step-01:
Since sender window size is 3, so sender sends 3 packets (1, 2, 3)-
Total packets sent till now from sender side = 3
Step-02:
After receiving the acknowledgement for packet-1, sender slides its window and sends
packet-4.
Total packets sent till now from sender side = 4
Step-03:
After receiving the acknowledgement for packet-2, sender slides its window and sends
packet-5.
Total packets sent till now from sender side = 5
Step-04:
After receiving the acknowledgement for packet-3, sender slides its window and sends
packet-6.
Total packets sent till now from sender side = 6
Step-05:
After receiving the acknowledgement for packet-4, sender slides its window and sends
packet-7.
Total packets sent till now from sender side = 7
Step-06:
According to question, every 5th packet gets lost.
So, packet-5 gets lost and when time out occurs, sender retransmits packet-5.
In Go back N, all the following packets are also discarded by the receiver.
So, packet-6 and packet-7 are discarded by the receiver and they are also
retransmitted.
Thus, the entire window is retransmitted.
So, we have-
Total packets sent till now from sender side = 10
Now, the next 5th packet that will be lost will be packet-7. (6, 7, 5, 6, 7)
Step-07:
After receiving the acknowledgement for packet-5, sender slides its window and sends
packet-8.
Total packets sent till now from sender side = 11
Step-08:
After receiving the acknowledgement for packet-6, sender slides its window and sends
packet-9.
Total packets sent till now from sender side = 12
Step-09:
According to question, every 5th packet gets lost.
So, packet-7 gets lost and when time out occurs, sender retransmits packet-7 and
the following packets.
Thus, the entire window is retransmitted.
So, we have-
Total packets sent till now from sender side = 15
Now, the next 5th packet that will be lost will be packet-9. (8, 9, 7, 8, 9)
Step-10:
After receiving the acknowledgement for packet-7, sender slides its window.
Total packets sent till now from sender side = 15
Step-11:
After receiving the acknowledgement for packet-8, sender slides its window.
Total packets sent till now from sender side = 15
Step-12:
According to question, every 5th packet gets lost.
So, packet-9 gets lost and when time out occurs, sender retransmits packet-9.
So, we have-
Total packets sent till now from sender side = 16
Finally, all the 9 packets got transmitted which took total 16 number of transmissions.