diff options
author | jlemon <jlemon@FreeBSD.org> | 2000-05-06 03:31:09 +0000 |
---|---|---|
committer | jlemon <jlemon@FreeBSD.org> | 2000-05-06 03:31:09 +0000 |
commit | 8a3c72bb35758d483f05567e3ff8926bee1a8813 (patch) | |
tree | 22b719c35e23206090023b078760d76bcd4627e7 /sys/netinet/tcp_output.c | |
parent | 796be5b52651cb1727e79565d25b60e69d1f738a (diff) | |
download | FreeBSD-src-8a3c72bb35758d483f05567e3ff8926bee1a8813.zip FreeBSD-src-8a3c72bb35758d483f05567e3ff8926bee1a8813.tar.gz |
Implement TCP NewReno, as documented in RFC 2582. This allows
better recovery for multiple packet losses in a single window.
The algorithm can be toggled via the sysctl net.inet.tcp.newreno,
which defaults to "on".
Submitted by: Jayanth Vijayaraghavan <jayanth@yahoo-inc.com>
Diffstat (limited to 'sys/netinet/tcp_output.c')
-rw-r--r-- | sys/netinet/tcp_output.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 238d25a..736e128 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -98,6 +98,9 @@ int ss_fltsz_local = TCP_MAXWIN; /* something large */ SYSCTL_INT(_net_inet_tcp, OID_AUTO, local_slowstart_flightsize, CTLFLAG_RW, &ss_fltsz_local, 1, "Slow start flight size for local networks"); +int tcp_do_newreno = 1; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, newreno, CTLFLAG_RW, &tcp_do_newreno, + 0, "Enable NewReno Algorithms"); /* * Tcp output routine: figure out what should be sent and send it. */ @@ -118,6 +121,7 @@ tcp_output(tp) u_char opt[TCP_MAXOLEN]; unsigned ipoptlen, optlen, hdrlen; int idle, sendalot; + int maxburst = TCP_MAXBURST; struct rmxp_tao *taop; struct rmxp_tao tao_noncached; #ifdef INET6 @@ -778,12 +782,12 @@ send: */ if (!callout_active(tp->tt_rexmt) && tp->snd_nxt != tp->snd_una) { - callout_reset(tp->tt_rexmt, tp->t_rxtcur, - tcp_timer_rexmt, tp); if (callout_active(tp->tt_persist)) { callout_stop(tp->tt_persist); tp->t_rxtshift = 0; } + callout_reset(tp->tt_rexmt, tp->t_rxtcur, + tcp_timer_rexmt, tp); } } else if (SEQ_GT(tp->snd_nxt + len, tp->snd_max)) @@ -889,7 +893,7 @@ out: tp->t_flags &= ~TF_ACKNOW; if (tcp_delack_enabled) callout_stop(tp->tt_delack); - if (sendalot) + if (sendalot && (!tcp_do_newreno || --maxburst)) goto again; return (0); } |