in Computer Networks edited by
31,188 views
45 votes
45 votes

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 $5$th 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$? 

  1. $12$
  2. $14$
  3. $16$
  4. $18$
in Computer Networks edited by
31.2k views

4 Comments

There is lot of confusion got created on the question https://gateoverflow.in/230305/slidind-window-protocol#c240121

Can someone clear that

0
0
This strategy not work here
0
0
0
0

8 Answers

66 votes
66 votes
Best answer

Total $16$ packet Transmission

Correct Answer: $C$

edited by

1 comment

edited by

why is 1,2,3,4 sent at once, only 1,2,3 should be sent at once(due to window size 3) then it recieves a cummulative ACK and then 4,5,6 should be sent from which 5 gets lost then recieve ACK for 4 and then 5,6,7 should be sent and so on. Shouldn't we consider the window size 3, given in the question and cummulative ACKs in GBN?

8
8
61 votes
61 votes

Since all packets are ready initially itself, we can assume a timeout is detected after all possible packets are sent. So, the sending happens as shown in figure (I draw the figure assuming 10 packets. For 9 packets answer will be 16).

by

24 Comments

Why 6th packet gets an error
0
0
Every fifth packet A sends gets lost as per the question. This includes the discarded packets also.
2
2
@suraksha When an ACK is received, the window moves. That is why it is called "sliding" window.
2
2

yes Ok.

1
1
Sir can you please post the diagram for same qstn  SR protocol. Its a bit confusing.. Thanx in advance :)
0
0
Why are packets numbered 0-9 and not 0-8 if there are 9 packets?
6
6
In case of selective repeat protocol 11 packets will be sent. right?

If frames are 0-8

Then frame 4 and 8 need to be resent Only.
1
1
Sir in the question it is specified  there is 9 packets...so either it would be 0-8 or 1-9..not 0-9 ithink...right?
2
2
edited by

Sir, please help me. I am having a doubt here. 

The question asked above is same, only the window size is 4 instead of 3. So now how many transmissions will be there?

Me and my friends are having a doubt like should it be 21 or 23 or some other value. 

What should be the correct answer?

0
0

I agree with all procedure.Ans should be 16 only for this question.

but @Arjun sir AFAIK GBN never accepts out of order packet so it wont give acknowledgement for out of order packets So as per ur diagram from the beginning for the 5th and 6th numbered packet Receiver wont give Acknowledgement. Bcoz it will discard any out of order packet @time it is expecting for 4th numbered packet only.

1
1
@Nashreen

I am getting as 26
1
1
@VS for nashreen answer ,it is 20
0
0
Why are you not considering the window size as 3.

0 1 2 safely reached . And we switched to next window of size 3.

Now 3,4,5 are transmitted due to frame size 3 , now since frame 4 is lost , you need to retransmit frame 4 and 5 first then only you can switch to next window and transmit 6 ......

I don't know why you are switching to next window , even if the current window packet 4 has not reached safely?

How can you transmit 6.  ???????????

I am having doubt please clarify.
0
0
When 4th packet gets lost then the ACKs received for 5th and 6th packet are discarded. Are those ACKs, actually NAKs or ACKs with seq. no as 4( asking for 4th packet)?? Also, does the timeout occurs for the fourth packet's ACK?
0
0
edited by

@VS @Nashreen Sultana @reena_kandari for your question 

The question asked above is same, only the window size is 4 instead of 3. So now how many transmissions will be there?

Yes , For window size 4 answer will be 21 not 23,26,20
2
2
edited by
@Rajesh Pradhan Yes , Your statement is right . @Arjun Sir, There need small correction in Diagram however answer is right .

as per ur diagram from the beginning for the 5th and 6th numbered packet Receiver wont give Acknowledgement. Bcoz it will discard any out of order packet @time it is expecting for 4th numbered packet only.
Above statement is required for correction in Diagram . 
1
1

@RISHABH SHRIVAS, please Use small fonts rather than these large ones!! make the things more readable.

0
0
Sorry for that . Done :)
0
0
bad explanation...somehow ppl just find d answer widout clear explanation
0
0
@Sunita Please explain it better :)

@Rishabh Thanks, I'll add.
1
1
@Arjun Sir, Please give the solution considering SR protocol
0
0
Hi, just a query here. Why are we considering individual ACKs rather than Cummulative ACKs
0
0

@Arjun  sir,

@Tuhin Dutta  sir,

In GBN the timeout timer is maintained for First outstanding frames for Entire send window..eg

When Ws = 4,5,6 TO timer for 4 is maintained and window slides when ACK for 4 comes ..So if 5th one also lost with 4th [2 losses in same window ] ..it will be handled by retransmision of window 4,5,6 because TO timer for 4 expires ..

Am i right sir??

0
0

@Arjun Sir , GBN uses cumulative ACK right? then why here individual ACK are shown?

see here → https://www.geeksforgeeks.org/difference-between-stop-and-wait-gobackn-and-selective-repeat/

0
0
12 votes
12 votes

16 is the answer

Q doesn't say that only after 3rd packet B will send theacknowledgement for 1st packet from A
So we can say

"All packets are ready and immediately available for transmission"

packet1 from A - Tranmit1
       acknowledgement (ack) for packet1(pckt) from B
packet2 from A - Transmit2
       ack for pckt2 from B
packet3 from A - Transmit3
       ack for pckt3 from B
packet4 from A - Transmit4
       ack for pckt4 from B
packet5 from A - Transmit 5          (packet5 lost, so no ack from B for pckt5)
packet6 from A - Transmit 1          (go back n, so no ack for pckt6 also)
packet7 from A - Transmit 2          (go back n, so no ack for pckt7 also)
                             Timeout for packet5
packet5 from A - Transmit 3
       ack for pckt5 from B
packet6 from A - Transmit 4
       ack for pckt6 from B
packet7 from A - Transmit 5         (packet7 lost, so no ack for pckt7)
packet8 from A - Transmit 1         (go back n, so no ack for pckt8 also)
packet9 from A - Transmit 2         (go back n, so no ack for pckt9 also)
                             Timeout for packet7
packet7 from A - Transmit 3
       ack for pckt7 from B
packet8 from A - Transmit 4
       ack for pckt8 from B
packet9 from A - Transmit 5         (packet9 lost, so no ack for pckt9)
                             Timeout for packet9
packet9 from A - Transmit 1
       ack for pckt9 from B

B now receives all 9 packets.
In total 16 transmits from station A

4 Comments

Yes! Please explan time out criteria ?
0
0
window size = 3

so as per Q   5th packet is lost  implies till 4th packet transmission is fine and ACK is also received but 5th one is lost so current window status is 5th 6th 7th packet as window size is 3.  5th one lost so no ACK. so sender keeps waiting till timeout for ACK. After timeout retransmission takes place.   

GBN receiver window size one till 5th is received nothing goes forward
0
0
Okay.
@Neal
Means if window size is 'n' then wait for ack up to n packets and after that time out .
0
0
12 votes
12 votes
I think the most intuitive way to get how Go back N work is to remember this 2 points and try it yourself

1. The window should slide ahead as we go on receiving ack and we will miss ack only for frame which is lost i.e frame 5 according to question

2. We should go back and send frame starting from frame no which was lost till the end of current window size.

Suppose if frame 5th was lot we should resent 5  6 7 because currently these 3 frames are in window.

PS: we should also count frames which were sent but discarded as out of order frame

Let's say we have 9 frames to send

1 2 3 4 5 6 7 8  9

We will send 1 then window will slide and currently 2 3 4 will be frame in the window then we will send 2 window will slide now currently 3 4 5 will be in window snapshot then we will send 3 and window will slide again and current snapshot will have 4 5 6 in window then next 4 will be sent current snapshot will be 5 6 7.

Now point 2 if 5th one is lost then what frames will be sent again well start from 5th and go to end of window that is 7 as window size is 3 so 5 6 7 will be sent again. Try to work it out by using above 2 points plus don't forget to slide the window ahead as you go on sending frame and receive ack. Remember 5 6 7 were sent before as 5 was not received 6 7 were discarded make sure you count then as well

If you get it right the sequence you will get at the end is

1 2 3 4 5 6 7 5 6 7 8 9 7 8 9 9

Good luck

1 comment

Very good explanation

Also in GBN protocol, we can send both cumulative and independent ACK, So how to know when to use cumulative and when to go for independent bcoz answer will vary due to this point
1
1
Answer:

Related questions