Opened 5 years ago

Closed 5 years ago

#13630 closed task (fixed)

tcp: rfc 5681: implementing fast retransmit and recovery

Reported by: a-star Owned by: axeld
Priority: normal Milestone: Unscheduled
Component: Network & Internet/TCP Version: R1/Development
Keywords: tcp, gsoc, slow start Cc:
Blocked By: Blocking:
Platform: All


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.

Attachments (2)

Change History (6)

comment:1 by a-star, 5 years ago

patch: 01

comment:2 by axeld, 5 years ago

Just a coding style review yet:

  • You sometimes miss the space after if: if(...) -> if (...). You also make this mistake in other patches you submitted; I only mention it here.
  • What does the "Prev" mean in fFlightSizePrev? If it's "Previous" it should 1) come first, and 2) there is no reason not to add those 4 characters.

comment:3 by a-star, 5 years ago

No new changes. New patch as a result of changes to a previous patch (#13629).

comment:4 by jessicah, 5 years ago

Resolution: fixed
Status: newclosed

Applied in hrev51385.

Note: See TracTickets for help on using tickets.