in Computer Networks retagged by
823 views
8 votes
8 votes

A TCP connection has been established between hosts $\text{A}$ and $\text{B. A}$ receives a packet from $\text{B}$ with the following field values shown below:

  • Sequence: $1001$
  • Acknowledgment: $5001$
  • Window size: $3000$
  • [TCP Payload Size: $52]$


Note: the size of the TCP payload is not a field, but is the number of bytes in the TCP payload, which the receiver can determine from the header lengths and total length, so we treat it here as something that can be determined from the headers. TCP payload size represents total length minus header length.

Which of the following are possible valid responses from $\text{A}$, i.e., which represent TCP packets that A might generate immediately after receiving this packet? Keep in mind the possibility that data or ACK packets might be lost or delayed in the connection.

  1. Sequence: $5001$
    Acknowledgment: $1053$
    Window size: $2000$
    [TCP Payload Size: $1000]$
     
  2. Sequence: $1053$
    Acknowledgment: $5001$
    Window size: $3000$
    [TCP Payload Size: $1000]$
     
  3. Sequence: $6001$
    Acknowledgment: $1053$
    Window size: $2000$
    [TCP Payload Size: $1000]$
     
  4. Sequence: $8001$
    Acknowledgment: $1053$
    Window size: $2000$
    [TCP Payload Size: $1000]$
in Computer Networks retagged by
823 views

4 Comments

what window size specifically

mean here?? 

0
0
Window size advertised by server..
0
0

$ \large{\colorbox{yellow}{Detailed video solution of this question with direct time stamp}}$

All India Mock Test 4 - Solutions Part 1

0
0

2 Answers

6 votes
6 votes

The original question can be found at the following source: Berkeley PDF, Page 2, Question 1.

 

 

Validity test:
$\bullet$  Sequence $_{\text {response }}>=5001$
$\bullet$ (Sequence $_{\text {response }}+$ Payload $\left._{\text {response }}\right) \leq \left(\right.$ Acknowledgement $_{\text {first }}+$ Window size $\left._{\text {first }}\right)=(5001+$ 3000) $=8001$

The source of the Validity test is  Berkeley PDF, Page 8,
A may send any packet with sequence number ranging from  $5001$ to $8000$.

Now, let's understand the question again. B is saying, "I need data from 5001 and can hold till 8000," so why will A ever send from 6001 and not 5001? Why is A not sending from 5001? The reason must be that A has already sent from 5001 to 6000.

Consider the case – B asks for data from 5001, and the window size at B is, suppose, just 1000. So, B just sent an ACK, saying that the ACK number is 5001, and the Window size is 1000. Immediately after that, B realizes that the window has more space because the application layer has consumed more data. So, what will B do? Will B wait for data from 5001 to 6000 and then announce that the window has increased and can accommodate more data, or will B announce immediately? Obviously, there is no point in waiting for the data and then announcing; hence, B will send a SECOND ACK and will announce immediately, saying, "ACK number is 5001, and Window size is 3000." In the question, the ACK sent by B is the SECOND ACK.

Now, A will receive 2 ACKs back-to-back. The moment it receives the first ACK, it will send data from 5000 to 6000. However, upon receiving the SECOND ACK from B, it will realize that B's window is even larger. Let me send data from 6001. So, A receives the (SECOND) ACK, which requests data from 5001 to 8000, and is still sending data from 6001.

edited by

4 Comments

@rexritz That word was the crux of the question.

Hope you have learned something new from this question.

2
2

@Sachin Mittal 1 Sir, is it safe to claim that there are a multitude of scenarios under which host \(\mathrm{A}\) may send any number of packets with sequence number ranging from \(\mathrm{5001}\) to \(\mathrm{8000}\) to host \(\mathrm{B}\), a few of them being –

  1. \(\mathrm{A}\) receives two \(\mathrm{ACK}\)s back-to-back, or,
  2. \(\mathrm{A}\) receives only one \(\mathrm{ACK}\) from \(\mathrm{B}\), but, \(\mathrm{MSS}\) is restricted to (say) \(\mathrm{1000 \ Bytes}\), or,
  3. \(\mathrm{A}\) receives only one \(\mathrm{ACK}\) from \(\mathrm{B}\), but, data bytes from sequence number (say) \(\mathrm{6001}\) to \(\mathrm{8000}\) were yet not ready while data bytes from \(\mathrm{5001}\) to \(\mathrm{6000}\) were under transmission, or,
  4. \(\mathrm{A}\) receives only one \(\mathrm{ACK}\) from \(\mathrm{B}\), and there are parallelly executing threads pushing the packets onto the transmission line?
0
0
But it in question it is already given that window size is 3000. So why is there the Possibility of assuming 1000 window size.
0
0
1 vote
1 vote

Host B is saying

This packet contain data from byte no 1001-1052

Next expecting 5001

I can store upto 3000B without oveflowing my buffer

 

A)

This packet contain data from byte no 5001-6001

Next expecting 1053 from B

I can store upto 2000B without oveflowing my buffer

ACK and SEQ numbers are correct not overflowing buffer it can be send

 

B)

This packet contain data from byte no 1053-2052

Next expecting 5001 from B

I can store upto 3000B without oveflowing my buffer

ACK and SEQ numbers are incorrect

 

C)

This packet contain data from byte no 6001-7001

Next expecting 1053 from B

I can store upto 2000B without oveflowing my buffer

ACK and SEQ numbers are correct not overflowing buffer.Maybe already send the previous frame or it a delayed ACK from B. it can be send

 

D)

This packet contain data from byte no 8001-9001

Next expecting 1053 from B

I can store upto 2000B without oveflowing my buffer

ACK and SEQ numbers are correct

issue here is that the window size 3000B the unACKed data cant exceede the window size.

If we send this frame unACKed will exceede the reciever window size hece it can’t be send

 

Answer:

Related questions