tags:

views:

1128

answers:

2

I've been researching TCP congestion control recently, however one question plagues me...

If I understand everything correctly, TCP will not send NEW data unless allowed by the cwnd (congestion window) and rwnd (the receiving side's window). In other words:

if(flightSize < MIN(cwnd, rwnd))
{
    // Send some new data (if possible)
    // Taking into account other details that we don't need
    // to get into such as Nagle's algorithm, etc.
}

Where flightSize is the amount of data that has been sent but not yet acknowledged.

Let us assume that TCP is going along, sending data, and increasing cwnd as appropriate. Let's say cwnd = [10 full packets], and the flightSize == cwnd. Then packet loss occurs in the network, and the sender's retransmission timer goes off. How/When does New Reno retransmit the unacknowledged data?

Here's my current understanding/misunderstanding:

When the timer goes off, the cwnd will be reset to [1 full packet], the oldest sent but unacknowledged packet will be resent, the rto will be doubled, and the retransmission timer will be reset. So if we say the rto was 1 second when the timer went off, it will get updated to 2 seconds, and the retransmission timer will get started again with a wait time of 2 seconds.

Here is why I'm confused:

In the above situation, TCP will resend only a single packet. Even if that packet gets ACKed right away, TCP cannot send any NEW data because cwnd is still less than the flightSize. So what does it do? Sit around and wait until the 2 second retransmission timer goes off again before it resends another packet? Does it force a resend of the old data since it can't send new data? Does it reset the flightSize, and reconsider all previously sent data to be unsent?

I've read all the RFC's I could find, and all kinds of guides and explanations of TCP. I must have missed something somewhere...


Clarification: I was considering multiple losses, where TCP is not using SACK.

If duplicate acks are received, TCP will resend the oldest ack on the 3rd duplicate ack (fast retrasmit) and will send new data on and after the 4th duplicate ack (fast recovery). My question concerns what happens if the TCP sender gets less than 3 dup acks?

A: 

Request for clarification: are you considering a single packet loss? Or multiple losses within a window?

In a single loss case, there will be duplicate acknowledgements received because of packets received after the lost one. I believe New Reno will transmit subsequent packets ("NEW data") in response to the duplicate acks. This then resets the timeout timer.

Emil
I was considering multiple losses, where TCP is not using SACK.If duplicate acks are received, TCP will resend the oldest ack on the 3rd duplicate ack (fast retrasmit) and will send new data on and after the 4th duplicate ack (fast recovery). But what if the TCP sender only gets 2 dup acks?
Robbie Hanson
I was considering multiple losses, where TCP is not using SACK.If duplicate acks are received, TCP will resend the oldest ack on the 3rd duplicate ack (fast retrasmit) and will send new data on and after the 4th duplicate ack (fast recovery). But what if the TCP sender only gets 2 dup acks?
Robbie Hanson
You would get only stop getting duplicate acks if the remote is no longer receiving packets (e.g., loss or end of window). But if you are really seeing multiple losses, that should indicate congestion and you will probably wind up in slow-start.
Emil
+1  A: 

I found the answer in the book "TCP/IP Illustrated, Volume 2", section 25.11, pages 842-844:

[On a retransmission timeout] the next send sequence number (snd_nxt) is set to the oldest unacknowledged sequence number (snd_una). ... By moving snd_nxt back, [TCP can begin to retransmit all unacknowledged data].

In other words, the flightSize will get reset, so data can continue to be sent (in slow start mode). It's just that some of this data may be data that has already been sent before. A cumulative ack might come along that prevents all data from being resent though.

Robbie Hanson