in Computer Networks edited by
16,992 views
49 votes
49 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}$
in Computer Networks edited by
17.0k views

4 Comments

Maximum window size=12000B

Threshold =12000/2=6000B

MSS= 2000B

Current window size= 4000B

In slow start phase next window size=4000*2=8000B > 6000B(threshold)

So increment should of MSS only.

After 2 ACKs, current window size= 4000+ 2000+2000= 8000B
0
0
Jo window size smjh gya

Use congestion control smjh me pakka ayega
2
2

@arpit_18  Yes. We increase window size exponentially in the slow-start phase. Consider initial window size as 1. You sent 1 MSS to the receiver. Once you receive the acknowledgement from the receiver, you will increase window size by 1 MSS. Now the sender window size has become 2. So the sender will send 2 MSS. Now remember one thing, the sender will increase its window size by 1 MSS FOR EVERY ACKNOWLEDGEMENT it receives. So here, it will receive 2 acknowledgements and it will increase window size by 2. It will become 4 now. 

I hope your doubt is cleared!

0
0

10 Answers

69 votes
69 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 or archive

Correct Answer: $B$

edited by
by

4 Comments

edited by

Slow start begins initially with a congestion window size (CWND) of 1, 2, 4 or 10 MSS. The value for the congestion window size will be increased by one with each acknowledgement (ACK) received, effectively doubling the window size each round-trip time.

Source: https://en.wikipedia.org/wiki/TCP_congestion_control#Slow_start


Each time an ACK is received, the congestion window is increased by one segment.

The sender starts by transmitting one segment and waiting for its ACK. When that ACK is received, the congestion window is incremented from one to two, and two segments can be sent.  When each of those two segments is acknowledged, the congestion window is increased to four. This provides an exponential growth, although it is not exactly exponential because the receiver may delay its ACKs, typically sending one ACK for every two segments that it receives.

Source: https://tools.ietf.org/html/rfc2001

1
1

The reference link in ankitgupta.1729 comment is old and wont work.

 https://youtu.be/Cy2cRpwXCvE?t=682 is where that reference is now.

1
1

If we take threshold=12000/2=6000 then for the second ACK TCP enters Congestion avoidance Phase (since first ACK is making it 6000) hence it will be increasing the congestion window by MSS/floor(congestion_window) as is given by  ankitgupta.1729 in his comment above. But then we will get a congestion window size in some fraction and not integer. And we can’t just take ceil of that cause we dont have any std saying that we shd. So i looked in the RFC  https://www.rfc-editor.org/rfc/rfc5681#page-4

In this is clearly mentioned:

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

Hence we shd take threshold=12000 and NOT 12000/2 (cause in the question it’s clearly given that “No packets are lost and there are no time-outs” till now) and now even for the second ACK TCP will be in Slow start phase and THIS is why we are gonna be incrementing the congestion_window by MSS even for second ACK!

0
0
16 votes
16 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.

3 Comments

So is it fact that the threshold is always set to half of the receiver window and not wait for it to timeout?
0
0

chhotu explanation is not correct and many peope upvote it

image source:KuroseRoss Book

1
1
edited by

@Chhotu But sir  the [congestion threshold = min(recv win, cws)/2]  then why are you taking  [recv win/2]  here??

see this → https://web.archive.org/web/20180619020529/http://www.ece.virginia.edu/~mv/edu/ee136/Lectures/congestion-control/tcp-congestion-control.pdf

This is from Forouzan :

The sender has two pieces of information: the receiver-advertised window size and

the congestion window size. The actual size of the window is the minimum of these two.

Actual window size= minimum (rwnd, cwnd)

It sets the value of the threshold to one-half of the current window size.

please help in this! 

0
0
12 votes
12 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 !!!

2 Comments

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 .
3
3
great👍
0
0
5 votes
5 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

Answer:

Related questions