tcp: rfc 5681: implementing fast retransmit and recovery
|Reported by:||a-star||Owned by:||axeld|
|Component:||Network & Internet/TCP||Version:||R1/Development|
|Keywords:||tcp, gsoc, slow start||Cc:|
Implementing the fast retransmit and recovery algorithm as specified in rfc 5681.
Added new variable fFlightSizePrev to store the value of flight size when the first duplicate aknowledgement is encountered. It is required since rfc 5681 mandates that any “additional data sent in limited transmit MUST NOT be included” in the following calculation:
On receipt of 3rd dup ACK, set ssthresh = max(FlightSize/2, 2*SMSS)
Instead of increasing cwnd as cwnd = ssthresh + 3*SMSS, I have choosen to increase it by the actual amount of data that has left the network but hasn't been cumutatively acknowledged, i.e., the difference between the current flightSize and fFlightSizePrev + SMSS (for the retransmitted segment).
The rfc tells us to increase cwnd by SMSS on every dup ACK after the 3rd. It also describes an attack that uses duplicate ACKs to cause a higher than appropriate sending rate and a way to fight it:
“TCP MAY limit the number of times cwnd is artifically inflatead during loss recovery to the number of outstanding segments (or, an approximation thereof)”
I also changed the way duplicate ACK were being recognized. For dup ACKs the acknowledgement field will read a value equal to fSendUnacknowledged and not smaller than it. The same was mentioned in the book “TCP/IP Illustrated Volume 2: The Implementation”.
“When previously unsent data is available and the new value of cwnd and the receiver’s advertised window allow, a TCP SHOULD send 1*SMSS bytes of previously unsent data.”
Also shifted the position where fDuplicateAcknowledgeCount was being reset to 0. It is now under Acknowledged and not under _Receive. This was done since multiple parts of the Receive function make use of Acknowledged function and not all those parts pass through the previous reset position. For example, the header prediction part calls Acknowledged but doesn't pass through further processing in _Receive.
Change History (6)
by , 3 years ago
by , 3 years ago