From 4b52d5ee5923ac99ac68b29820f2b14a92a6a2b9 Mon Sep 17 00:00:00 2001 From: Jeffrey Hsu Date: Thu, 24 Jul 2003 23:33:33 +0000 Subject: [PATCH] Add support for RFC 3390, which allows for a variable-sized initial congestion window. This decreases the number of round-trip delays required for short HTTP transfers which never make it out of slow-start. --- sys/netinet/tcp_input.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 795c79d1c8..31f4cca7bc 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -32,7 +32,7 @@ * * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95 * $FreeBSD: src/sys/netinet/tcp_input.c,v 1.107.2.38 2003/05/21 04:46:41 cjc Exp $ - * $DragonFly: src/sys/netinet/tcp_input.c,v 1.4 2003/07/24 01:31:07 dillon Exp $ + * $DragonFly: src/sys/netinet/tcp_input.c,v 1.5 2003/07/24 23:33:33 hsu Exp $ */ #include "opt_ipfw.h" /* for ipfw_fwd */ @@ -130,6 +130,11 @@ static int tcp_do_limitedtransmit = 1; SYSCTL_INT(_net_inet_tcp, OID_AUTO, limitedtransmit, CTLFLAG_RW, &tcp_do_limitedtransmit, 0, "Enable RFC 3042 (Limited Transmit)"); +static int tcp_do_rfc3390 = 1; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3390, CTLFLAG_RW, + &tcp_do_rfc3390, 0, + "Enable RFC 3390 (Increasing TCP's Initial Congestion Window)"); + struct inpcbhead tcb; #define tcb6 tcb /* for KAME src sync over BSD*'s */ struct inpcbinfo tcbinfo; @@ -2695,10 +2700,12 @@ tcp_mss(tp, offer) * Set the slow-start flight size depending on whether this * is a local network or not. */ - if ((isipv6 && in6_localaddr(&inp->in6p_faddr)) || - (!isipv6 && in_localaddr(inp->inp_faddr))) + if (tcp_do_rfc3390) + tp->snd_cwnd = min(4 * mss, max(2 * mss, 4380)); + else if ((isipv6 && in6_localaddr(&inp->in6p_faddr)) || + (!isipv6 && in_localaddr(inp->inp_faddr))) tp->snd_cwnd = mss * ss_fltsz_local; - else + else tp->snd_cwnd = mss * ss_fltsz; if (rt->rt_rmx.rmx_ssthresh) { -- 2.41.0