The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+28 votes
6.3k views

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}$
asked in Computer Networks by Boss (19.1k points)
edited by | 6.3k views
0
anyone ???
+10
Actual window size=min(congestion window size,receiver-advertised window size)

So here actual window size=min(12000,4000)=4000B

A packet size is 2000B. So 2 packets can be sent in one window and these two acks are received.

So now according to slow start phase, the congestion window size doubles itself ie 2*4000B=8000B.
+8

yes, correct answer is 8000, because the size of window increases by one MSS each time an acknowledgement is received.

So, 4000 + 2000 + 2000 = 8000.

8 Answers

+42 votes
Best answer

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

answered by Veteran (396k points)
edited by
+1
This is most precise answer as in selected answer blindly 1 MSS is increased and in question it is slow start phase which are contradictory.
0
Nicely explained sir.
+2

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                                 

 

+2

@tusharp

Please check this  and correct if wrong:
1) IN slow start phase Wc increase by 1MSS after every ACK and nearly exponentially AFTER EVERY ROUND [Round ==> whole window sent and acknowledged]

1) IN Congestion avoidance phase Wc increase by 1MSS after every ROUND not after every ACK

0
....
+1

@jatin khachane 1 It is not about round, It is about per packet Acknowledgement in both slow start and congestion avoidance phases. Formulae used in both phases are :-

1) In slow-start phase, 

                                           $cwnd = cwnd \;+ \;1\; packet\; per \; acknowledgement$

   Please check here.

2) In congestion avoidance phase ,

                                           $cwnd = cwnd \;+ \frac{1}{\left \lfloor cwnd \right \rfloor}*\;1\; packet\; per \; acknowledgement$

   Please check here.

   Reference              

+1

@ankitgupta.1729

For Slow start phase ..we can say that cwnd increases by 1MSS after every acknowledgement and doubles after every round trip time (Round trip time means all segments get acknowledge in current window)

For Congestion avoidance phase ..what can we say then what happens after every acknowledge and every RTT ? in words then

+1

@jatin khachane 1 yes, right. We can say this in case of slow-start. In case of congestion avoidance, cwnd is increased by $\frac{1}{cwnd}$ after every successful acknowledgement. For example , suppose, currently I have cwnd size = 3 , now after 1st acknowledgement, it will be $(3 +  \frac{1}{3})$ , after 2nd ack , it will be $(3 +  \frac{1}{3}+ \frac{1}{3})$ and after 3rd ack, it will be $(3 +  \frac{1}{3}+ \frac{1}{3}+\frac{1}{3} )$ which is same as cwnd = 3+1 = 4. So, linear growth in cwnd size . So, we can say that size of cwnd increased by  $\frac{1}{cwnd}$ after every successful acknowledgement and after each RTT , it will be added by 1 MSS i.e. Linear growth in congestion avoidance.

+2
Imp point to note here is RTT is not ack for single segment here ..RTT = all segments in current window get acknowledge

Then we can say

In slow start => increases by 1MSS after every ACK and exponentially after every RTT

In congestion avoidance ==> increases by 1/floor(cwnd) after every ack and increases by 1 after every RTT
0

@Denson George where you find this that threshold value <= receiver window size

?

+10 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 !!!
answered by Active (4.9k points)
+2
In slow start phase we double the CNWD with each acknowledgement unless there is a timeout or 3 Ack's and once these events occur the slowstart or AI phase starts respectively . So In the question ,

The it is saying slowstart phase so , we need to double the CNWD with each Ack until we reach a threshold which is 12000 in this case , so

4000*2 for 1st Ack and 8000 * 2 for next Ack  since the maximum threshold is 12000 at the end of slow start phase it will be 12,000 (which is asked in question) and hereafter for the next acknowledgements AI phase will start.

Please let me know If I am wrong .
+8 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.

answered by Boss (12.4k points)
0
So is it fact that the threshold is always set to half of the receiver window and not wait for it to timeout?
+3 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

answered by Active (2k points)
+1 vote

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                                 

 

 

 

 

answered by (495 points)
edited by
0 votes

Here,

RWND = 12000 B

ssthresh = RWND (initially; Given there has been no timeout / packet loss )

Current CWND = 4000 B

1 MSS = 2000 B

If   cwnd <= ssthresh then
       // Each time an Ack is received:
        cwnd = cwnd + 1 MSS
else  cwnd >  ssthresh
      //Each time an Ack is received:
        cwnd = cwnd + MSS * [ MSS / cwnd ]
endif

Two ACKs received, thus

CWND = 4000 + 2000 = 6000 (after first ACK )

CWND = 6000 + 2000 = 8000 (after second ACK)

ssthresh is not 6000 B but 12000 B, because no packets has yet been lost / timeout, thus ssthresh is unchanged.

REF:

answered by Loyal (9.4k points)
edited by
0
Why threshold here is 12000 can u explain please
0 votes

I read all the answer but none is exactly correct :

note 3 important things :

1) if cwnd<ssthresh the congestion avoidance phase will continue with each ack window size will be increased by1.

2) even if cwnd=sthresh congestion avoidance phase will continue with a ack window size will be increased by1.

3)if cwnd>ssthresh ccongestion avoidance phase will start i.e cwnd=cwnd+1/(floor(cwnd)) wth each ack.

now read arjun's answer.

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

 

answered by Active (1.6k points)
edited by
–2 votes

In slow start phase we double the CNWD with each acknowledgement unless there is a timeout or 3 Ack's and once these events occur the slowstart or AI phase starts respectively . So In the question , 

The it is saying slowstart phase so , we need to double the CNWD with each Ack until we reach a threshold which is 12000 in this case , so 

4000*2 for 1st Ack and 8000 * 2 for next Ack  since the maximum threshold is 12000 at the end of slow start phase it will be 12,000 (which is asked in question) and hereafter for the next acknowledgements AI phase will start.

Please let me know If I am wrong .

answered by (307 points)
Answer:

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,109 questions
53,222 answers
184,630 comments
70,463 users