edited by
41,447 views
87 87 votes

Suppose that the maximum transmit window size for a TCP connection is $12000$ $\text{bytes}$. Each packet consists of $2000$ $\text{bytes}$. At some point in time, the connection is in slow-start phase with a current transmit window of $4000$ $\text{bytes}$. Subsequently, the transmitter receives two acknowledgments. Assume that no packets are lost and there are no time-outs. What is the maximum possible value of the current transmit window?

  1. $4000$ $\text{bytes}$
  2. $8000$ $\text{bytes}$
  3. $10000$ $\text{bytes}$
  4. $12000$ $\text{bytes}$

15 Answers

Best answer
106 106 votes

In slow-start phase, for each ACK, the sender increases the current transmit window by Maximum Segment Size (MSS). In the question it is given a packet consists of $2000$ bytes and that can be taken as MSS. So, after two ACKs, current transmit window
$= 4000 + 2000 + 2000$
$= 8000$

http://www.ece.virginia.edu/~mv/edu/ee136/Lectures/congestion-control/tcp-congestion-control.pdf or archive

Correct Answer: $B$

edited by
23 23 votes

Since recvWind = 12000B and Packet Size = 2000B (or MSS )

 receiverWindow = 6 MSS and currentSenderWindow = 2MSS

Slow Start Threshold = receiverWindow/2 = 3 MSS (2 MSS < 3 MSS which implies transmission is in Slow Start Phase)

After receiving first ACK: currentSenderWindow should increase exponentially to 4 MSS but since threshold = 3 MSS, currentSenderWindow Size goes to threshold which is 3 MSS then 
After receiving second ACK: Since now it is in Congestion avoidance phase sender window size increases linearly which makes currentSenderWindow = 4 MSS = 4 * 1 MSS = 4 * 2000 B  = 8000 B

Thanks to @Nilesh Agrawal ji.

14 14 votes
Packet size (MSS Maximum segment size)= 2000 B
Advertized window size (RWND)= 12000 B
Sender's Current window size (CWND)= 4000 B
CWND = 2 * MSS --- > This means that the sender can send upto 2 packets at this point and it did.
That is why it now recieves 2 Acks of those two packets sent
So it can now increase the CWND by 1 MSS for each packet acknowledged.
So Current Window Size = 4000 + 2* MSS = 8000 THis is the answer.
 
Now it can send upto 4 packets and if it receives 4 Acks for those packets sent then it will increment its window to 12000
 
This link will be of help !!!
10 10 votes

This is very good question I think there are some things which require some clarification.

Q)What is the Slow start state Threshold value according to the question?

According to the question It is given to Assume no packet losses and no timeouts. Which implies the ssthreshold value did not ever change from the intial value. And what is that initial value?

   The initial value of ssthresh SHOULD be set arbitrarily high (e.g.,
   to the size of the largest possible advertised window), but ssthresh
   MUST be reduced in response to congestion.  Setting ssthresh as high
   as possible allows the network conditions, rather than some arbitrary
   host limit, to dictate the sending rate.  In cases where the end
   systems have a solid understanding of the network path, more
   carefully setting the initial ssthresh value may have merit (e.g.,
   such that the end host does not create congestion along the path).

Link for the above referrence can be found here  https://www.rfc-editor.org/rfc/rfc5681#page-4

As they mentioned that there are no packet losses and timeouts that's basically saying that there is no congestion in the network which implies that sended now needs to maintain window size so as not to overwhelm reciver side window .Therefore sender window size<=reciever window size and sender window size's maximum value=reciver window from which we can say that reciever window size is given as 12000 bytes.

(I think directly saying that given value is the maximum window size of TCP connection  so lets take it as reciever window size doesn't explain lot of things as to why we take it like that)* 

Anyway moving on,

The ssthreshold value will be 12000bytes.


I mean even if you think logically when there is no network congestion the packet drops will happen when you send more packets than what reciever can handle so sender needs to start avoiding congestion(caused by packet drops at reciever buffer) by not rapidly increasing the window size more than threshold which is equal to reciever window size. And sender adjusts the threshold when it detects packet drops in future.

Q)TCP uses cummulative ACKs so should we treat the 2 ACKs given in question as cummulative ACKs or Selective ACKs?

In general when we think of TCP protocol we say that it uses cummulative ACKs but TCP protocol implementation with selective ACKs is also posssible

  TCP Selective Acknowledgment Options

Status of this Memo

   This document specifies an Internet standards track protocol for the
   Internet community, and requests discussion and suggestions for
   improvements.  Please refer to the current edition of the "Internet
   Official Protocol Standards" (STD 1) for the standardization state
   and status of this protocol.  Distribution of this memo is unlimited.

Abstract

   TCP may experience poor performance when multiple packets are lost
   from one window of data.   With the limited information available
   from cumulative acknowledgments, a TCP sender can only learn about a
   single lost packet per round trip time.  An aggressive sender could
   choose to retransmit packets early, but such retransmitted segments
   may have already been successfully received.

   A Selective Acknowledgment (SACK) mechanism, combined with a
   selective repeat retransmission policy, can help to overcome these
   limitations.  The receiving TCP sends back SACK packets to the sender
   informing the sender of data that has been received. The sender can
   then retransmit only the missing data segments.

   This memo proposes an implementation of SACK and discusses its
   performance and related issues.

Link for above refference : https://www.rfc-editor.org/rfc/rfc2018.txt

so now lets see what kind of acks we are using in this question, The slow start phase always starts with sender side transmission window= 1MSS. I hope everybody agree with this statement. In the question it is given that, 

At some point in time, the connection is in slow-start phase with a current transmit window of 4000 Bytes. which implies size=2MSS which suggest that RTT time is already over since the slow start phase began. that means sender recieved ACK for the segment it sent during the last RTT and current window size is 2MSS and the instance the question is in is 2nd RTT. They mentioned "Subsequently, the transmitter receives two acknowledgments" which implies that the transmitter recived 2 more ACKs after the window size become 2MSS/4000 bytes. In conclusion what they are saying is that in this protocol we are using Selective ACKs instead of Cummulative ACKs as we got 2 acks for 2 segments. 

A lot of people in the solutions mentioned  that in the slow start phase the sender window size increases exponentially with each ACK. This is the case only if the protocol is using cummulative ACKs

Q) so now we get that it is selective Acks how do you get the answer?

For each ACK in slow start phase the sender window size is increased by 1MSS. Because for each RTT we are doubling the sender window size that is same for both type of ACKs in slow start phase. As the sender receives "window size" number of selective Acks increasing the size by 1 for each selective Ack is basically doubling it by the end of RTT.

So now with everything clear we can just proceed to the answer easily. SSTHRESHOLD value=12000 bytes.
Sender window size after recieving 1st ack=4000+2000=>6000 bytes
sender window size after reieving 2nd ack=6000+2000=>8000 bytes.

so the answer=8000 bytes.

Some more clarification:
First of all thanks for bearing with me till now, As given in the first referrence I have provided it is mentioned that ssthreshold should be set arbitarily high which can be taken as maximum reciever window size and it also makes sense to take it as intial value because sending more bytes than that is bound to cause packet dropping at reciver buffer.


So what if we take the ssthreshold value as reciever window size/2 it can also be said as arbitarily high value and then we get ssthreshold value as 6000 right so why can't we do that? 

You can absolutely do that no doubt in that. But when u do that after recieving the first ACK the sender window size reaches 6000 bytes which is equal to ssthreshold. As soon as the sender window size hits ssthreshold value the sender window will start applying congestion avoidane logic which suggest that for each ACK it recieve it should increase the window size by $\frac{MSS}{cwnd }$ Therfore it increases the window size by 2000/3 = 667 bytes after second Ack
which gives us the transmitter window size=6667 bytes

As it is mentioned in the question,maximum possible value of the current transmit window will be 8000 bytes which is option B

(I am not an expert in the subject so if there are any misconceptions on my part pls do point them out with correct concepts in the comments). Thank you.



 

edited by
9 9 votes

In slow start phase, window size increases exponentially upon receiving 1 ack till threshold and after that collision avoidance phase start where window size is increased 1 mss after every acknowledgement till max window is reached.

Slow start : 1,2 4 ,8... threshold

Collision avoidance: threshold+1, threshold +2.....Max window size

Threshold = max transit window size/2

In given question Max window size is 12000B and therefore

Threshold = 6000

So the sequence of transit will be

1st 2000

2nd 4000 1 ack received

3rd 6000 1ack received

4th 8000

Hence, Answer is 8000 B

7 7 votes

We know that In slow-start phase, for each ACK, the sender increases the current transmit window exponentially.

We are given that maximum transmit window size for a TCP Conn = 12000 B.

Now as per question due to congestion, the TCP Conn would come to slow-start phase which is:

 

TCP THRESHOLD WINDOW SIZE NEW = TCP CURRENT WINDOW SIZE / 2 

 =>   12000/2 = 6000 Bytes.

 

The current window size has been incremented to 4000 B which is <  TCP THRESHOLD WINDOW SIZE ( 6000 B )

 

Now we are given a scenario after these actions have been performed.

 

We send two packets and then we receive ACK of them one by one.

As per question before any ACK came out of these two packets TCP CURRENT WINDOW SIZE = 4000 B.

On

 

RECEIVING 1st ACK = 2 * TCP CURRENT WINDOW SIZE

                                   = 2 * 4000 B

                                   = 8000 B  but it should be <= TCP THRESHOLD WINDOW SIZE acc to congestion algorithm therefore 

                                   TCP CURRENT WINDOW SIZE = 6000 Byte

Now the TCP CURRENT WINDOW SIZE = TCP THRESHOLD WINDOW SIZE, therefore, TCP CURRENT WINDOW SIZE now will increase linearly as the algorithm is in congestion avoidance phase therefore on 

 

RECEIVING 2nd ACK:

                                       TCP CURRENT WINDOW SIZE = TCP CURRENT WINDOW SIZE + 1 MSS

                                                                                            = 6000B + 2000B

                                                                                            = 8000 Bytes                                 

 

 

 

 

edited by
Answer:
Position:
Show:

Related questions

45 45 votes
7 answers 7 answers
20.6k
20.6k views
Ishrat Jahan asked Nov 2, 2014
20,629 views
A $20$ $\text{Kbps}$ satellite link has a propagation delay of $400$ $\text{ms}$. The transmitter employs the "go back $n$ $ARQ$" scheme with $n$ set to $10$. Assuming th...
46 46 votes
6 answers 6 answers
18.9k
18.9k views
Ishrat Jahan asked Nov 2, 2014
18,866 views
In a sliding window $ARQ$ scheme, the transmitter's window size is $N$ and the receiver's window size is $M$. The minimum number of distinct sequence numbers required to ...
69 69 votes
8 answers 8 answers
36.2k
36.2k views
Ishrat Jahan asked Nov 2, 2014
36,204 views
A TCP message consisting of $2100$ $bytes$ is passed to IP for delivery across two networks. The first network can carry a maximum payload of $1200$ $bytes$ per frame an...
93 93 votes
9 answers 9 answers
30.1k
30.1k views
Ishrat Jahan asked Nov 2, 2014
30,059 views
Consider a simplified time slotted MAC protocol, where each host always has data to send and transmits with probability $p$ = $0.2$ in every slot. There is no backoff and...