Opened 2 years ago

Closed 2 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:
Has a Patch: yes Platform: All

Description

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 Changed 2 years ago by a-star

Has a Patch: set

comment:2 Changed 2 years ago by axeld

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 Changed 2 years ago by a-star

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

comment:4 Changed 2 years ago by jessicah

Resolution: fixed
Status: newclosed

Applied in hrev51385.

Note: See TracTickets for help on using tickets.