diff options
author | hsu <hsu@FreeBSD.org> | 2003-03-13 01:43:45 +0000 |
---|---|---|
committer | hsu <hsu@FreeBSD.org> | 2003-03-13 01:43:45 +0000 |
commit | 896f13eb8e3acbd612c65af6592524bda6b13423 (patch) | |
tree | 82fcbefe531202f28044b8d8c168ea784fe4a6d7 | |
parent | 22308242217f3e9bc1fffc2f8a45c762d541779c (diff) | |
download | FreeBSD-src-896f13eb8e3acbd612c65af6592524bda6b13423.zip FreeBSD-src-896f13eb8e3acbd612c65af6592524bda6b13423.tar.gz |
Add support for RFC 3390, which allows for a variable-sized
initial congestion window.
-rw-r--r-- | sys/netinet/tcp_input.c | 11 | ||||
-rw-r--r-- | sys/netinet/tcp_reass.c | 11 |
2 files changed, 18 insertions, 4 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 91c90d8..c80cf8b 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -129,6 +129,11 @@ static int tcp_do_rfc3042 = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3042, CTLFLAG_RW, &tcp_do_rfc3042, 0, "Enable RFC 3042 (Limited Transmit)"); +static int tcp_do_rfc3390 = 0; +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; @@ -2745,10 +2750,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)) || + 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) { diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 91c90d8..c80cf8b 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -129,6 +129,11 @@ static int tcp_do_rfc3042 = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3042, CTLFLAG_RW, &tcp_do_rfc3042, 0, "Enable RFC 3042 (Limited Transmit)"); +static int tcp_do_rfc3390 = 0; +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; @@ -2745,10 +2750,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)) || + 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) { |