Restarting Idle Connections

hiren panchasara hiren at
Fri Jan 29 21:51:28 UTC 2016

On 01/29/16 at 01:38P, Yongmin Cho wrote:
> Hi, all.
> I have an opinion about net.inet.tcp.initcwnd_segments.
> You know, snd_cwnd is restarted transmission after a long idle
> period(Current RTO).
> And, All of congestion control algorithm is using newreno_after_idle
> function after a long idle period.
> But, The newreno_after_idle function is not using initcwnd_segments.
> I think, The initcwnd_segments should be used in newreno_after_idle
> function, If the newreno_after_idle is called.
> I referred to rfc6928.
> Please check my opinion.

You are absolutely right. We (FreeBSD) adopted initcwnd to be 10
segments but never bothered to update newreno_after_idle() function to
reflect that in calculating cwnd after idle period. Though the comments
in that function clearly says:
"The restart window is the initial window or the last CWND, whichever is

I think we should make following change to accommodate it:

diff --git a/sys/netinet/cc/cc_newreno.c b/sys/netinet/cc/cc_newreno.c
index 97ec35f..5210a45 100644
--- a/sys/netinet/cc/cc_newreno.c
+++ b/sys/netinet/cc/cc_newreno.c
@@ -166,6 +166,10 @@ newreno_after_idle(struct cc_var *ccv)
         * See RFC5681 Section 4.1. "Restarting Idle Connections".
+       if (V_tcp_initcwnd_segments)
+               rw = min(V_tcp_initcwnd_segments * CCV(ccv, t_maxseg),
+                   max(2 * CCV(ccv, t_maxseg),
+                       V_tcp_initcwnd_segments * 1460));
        if (V_tcp_do_rfc3390)
                rw = min(4 * CCV(ccv, t_maxseg),
                    max(2 * CCV(ccv, t_maxseg), 4380));

Any inputs?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 603 bytes
Desc: not available
URL: <>

More information about the freebsd-transport mailing list