I was reading a textbook which describe Go-Back-N (GBN) protocol with Finate State Machines as pictures below show:
^ mean initial state. So my questions are:
Q1-THis is the interactive animations link to GBN https://media.pearsoncmg.com/aw/ecs_kurose_compnetwork_7/cw/content/interactiveanimations/go-back-n-protocol/index.html
And let’s say we are sending packet 0, packet 1 and packet 2, and packet 1 is lost beforen it arrive receiver. So when it is timeout, GBN will make sender re-send packet 1 and packet 2, And I found an interesting thing which is,if you try the link with above scenario and you send packet 3 just before timeout occurs,this action reset the timer, because you can see the timeout is postponed(otherwise you will see packet 1,2,3 flying in screen).But according to the sender’s FSM, after you send packet 3, timeout occurs immediately, then the sender will re-send packet 1 and packet 2, but it didn’t happen as timeout is postponed, which contradicts the fact that time is only get reseted when
base = nextseqnum?
Q2-On the receiver’s FSM, why it needs to set
expectedseqnum = 1 and make a packet based on it? why we cannot set
expectedseqnum = 0 as the only initialized action?