TCP newreno: improve after_idle ssthresh

Adjust ssthresh in after_idle to the maximum of
the prior ssthresh, or 3/4 of the prior cwnd. See
RFC2861 section 2 for an in depth explanation for
the rationale around this.

As newreno is the default "fall-through" reaction,
most tcp variants will benefit from this.

Reviewed by:	tuexen
MFC after:	2 weeks
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D22438
This commit is contained in:
Richard Scheffenegger 2020-09-25 10:23:14 +00:00
parent f1cba2b70c
commit 1567c937e2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=366149

View File

@ -213,9 +213,16 @@ newreno_after_idle(struct cc_var *ccv)
* wirespeed, overloading router and switch buffers along the way.
*
* See RFC5681 Section 4.1. "Restarting Idle Connections".
*
* In addition, per RFC2861 Section 2, the ssthresh is set to the
* maximum of the former ssthresh or 3/4 of the old cwnd, to
* not exit slow-start prematurely.
*/
rw = tcp_compute_initwnd(tcp_maxseg(ccv->ccvc.tcp));
CCV(ccv, snd_ssthresh) = max(CCV(ccv, snd_ssthresh),
CCV(ccv, snd_cwnd)-(CCV(ccv, snd_cwnd)>>2));
CCV(ccv, snd_cwnd) = min(rw, CCV(ccv, snd_cwnd));
}