[PATCH v5] tcp: Limit fast retransmit to one per loss event
Every duplicate ACK unconditionally triggered a fast retransmit,
even when the ACK sequence hadn't advanced.
Guard fast retransmit on !conn->retries, and increment retries
after the first retransmit. This is a quick fix to stop the
amplification storm. Full compliance with RFC 5681 Section 3.2
(three duplicate ACKs) is left to a later patch.
As a fast retransmit is now accounted in conn->retries, the next
retransmission timeout is doubled (tcp_timer_ctl() uses conn->retries
as backoff exponent).
In TAP_FIN_RECVD path, tcp_tap_window_update() returns true for any
non-zero window because of which tcp_data_from_sock() gets called
for every ACKs(even for unchanged duplicate ACK). If the send window
is full calling tcp_data_from_sock() re-armed the retransmission
timer via conn_flag(),so periodic duplicate ACKs could delay
retransmission indefinitely and prevent a half-closed connection
from recovering. Therefore, only call tcp_data_from_sock() when
the ACK or window actually changed.
Link: https://bugs.passt.top/show_bug.cgi?id=224
Reported-by: Ada Urbaniec
On Mon, 30 Nov 2026 12:14:14 +0530
Anshu Kumari
Every duplicate ACK unconditionally triggered a fast retransmit, even when the ACK sequence hadn't advanced.
Guard fast retransmit on !conn->retries, and increment retries after the first retransmit. This is a quick fix to stop the amplification storm. Full compliance with RFC 5681 Section 3.2 (three duplicate ACKs) is left to a later patch.
As a fast retransmit is now accounted in conn->retries, the next retransmission timeout is doubled (tcp_timer_ctl() uses conn->retries as backoff exponent).
In TAP_FIN_RECVD path, tcp_tap_window_update() returns true for any non-zero window because of which tcp_data_from_sock() gets called for every ACKs(even for unchanged duplicate ACK). If the send window is full calling tcp_data_from_sock() re-armed the retransmission timer via conn_flag(),so periodic duplicate ACKs could delay retransmission indefinitely and prevent a half-closed connection from recovering. Therefore, only call tcp_data_from_sock() when the ACK or window actually changed.
Link: https://bugs.passt.top/show_bug.cgi?id=224 Reported-by: Ada Urbaniec
Signed-off-by: Anshu Kumari
Added from v4:
Reviewed-by: Jon Maloy
participants (2)
-
Anshu Kumari
-
Stefano Brivio