diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2004-01-29 11:55:29 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2004-01-29 11:55:29 +0000 |
commit | bc1e4fe69bfb558a4402368d49843230a8010975 (patch) | |
tree | 099b8b8a7f5211b3a7c4b0b69264e9b7c645e281 /sys | |
parent | 25b87aeef769aecb8d1c002d6666cdf56afbf1d0 (diff) |
support for RFC3390 (Increasing TCP's Initial Window); ok deraadt, itojun
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/tcp_input.c | 19 | ||||
-rw-r--r-- | sys/netinet/tcp_subr.c | 3 | ||||
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 5 | ||||
-rw-r--r-- | sys/netinet/tcp_var.h | 7 |
4 files changed, 21 insertions, 13 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index d297e956bc4..2a2078b41c2 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_input.c,v 1.148 2004/01/29 10:06:21 markus Exp $ */ +/* $OpenBSD: tcp_input.c,v 1.149 2004/01/29 11:55:28 markus Exp $ */ /* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */ /* @@ -1178,6 +1178,9 @@ after_listen: TCP_TIMER_DISARM(tp, TCPT_REXMT); tp->irs = th->th_seq; tcp_mss(tp, opti.maxseg); + /* Reset initial window to 1 segment for retransmit */ + if (tp->t_rxtshift > 0) + tp->snd_cwnd = tp->t_maxseg; tcp_rcvseqinit(tp); tp->t_flags |= TF_ACKNOW; #ifdef TCP_SACK @@ -3067,6 +3070,9 @@ tcp_mss(tp, offer) tp->snd_cwnd = ulmax((tp->snd_cwnd / tp->t_maxseg) * mss, mss); } + } else if (tcp_do_rfc3390) { + /* increase initial window */ + tp->snd_cwnd = ulmin(4 * mss, ulmax(2 * mss, 4380)); } else tp->snd_cwnd = mss; @@ -3786,14 +3792,9 @@ syn_cache_get(src, dst, th, hlen, tlen, so, m) tcp_mss(tp, sc->sc_peermaxseg); /* sets t_maxseg */ if (sc->sc_peermaxseg) tcp_mss_update(tp); -#if 0 - /* - * XXX - * Initialize the initial congestion window. If we - * had to retransmit the SYN,ACK, we must initialize cwnd - * to 1 segment (i.e. the Loss Window). - */ -#endif + /* Reset initial window to 1 segment for retransmit */ + if (sc->sc_rxtshift > 0) + tp->snd_cwnd = tp->t_maxseg; tp->snd_wl1 = sc->sc_irs; tp->rcv_up = sc->sc_irs + 1; diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 6d308645b00..ddd9c25d1ab 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.73 2004/01/09 12:22:30 markus Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.74 2004/01/29 11:55:28 markus Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -131,6 +131,7 @@ int tcp_do_rfc1323 = TCP_DO_RFC1323; int tcp_do_sack = TCP_DO_SACK; /* RFC 2018 selective ACKs */ int tcp_ack_on_push = 0; /* set to enable immediate ACK-on-PUSH */ int tcp_do_ecn = 0; /* RFC3168 ECN enabled/disabled? */ +int tcp_do_rfc3390 = 0; /* RFC3390 Increasing TCP's Initial Window */ u_int32_t tcp_now; diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index c1a167a37a5..1b415e25294 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_usrreq.c,v 1.75 2004/01/06 17:38:13 markus Exp $ */ +/* $OpenBSD: tcp_usrreq.c,v 1.76 2004/01/29 11:55:28 markus Exp $ */ /* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */ /* @@ -931,6 +931,9 @@ tcp_sysctl(name, namelen, oldp, oldlenp, newp, newlen) case TCPCTL_SYN_BUCKET_LIMIT: return (sysctl_int(oldp, oldlenp, newp, newlen, &tcp_syn_bucket_limit)); + case TCPCTL_RFC3390: + return (sysctl_int(oldp, oldlenp, newp, newlen, + &tcp_do_rfc3390)); default: return (ENOPROTOOPT); } diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 22a448336eb..3a2eb273114 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_var.h,v 1.55 2004/01/14 13:38:21 markus Exp $ */ +/* $OpenBSD: tcp_var.h,v 1.56 2004/01/29 11:55:28 markus Exp $ */ /* $NetBSD: tcp_var.h,v 1.17 1996/02/13 23:44:24 christos Exp $ */ /* @@ -434,7 +434,8 @@ struct tcpstat { #define TCPCTL_ECN 14 /* RFC3168 ECN */ #define TCPCTL_SYN_CACHE_LIMIT 15 /* max size of comp. state engine */ #define TCPCTL_SYN_BUCKET_LIMIT 16 /* max size of hash bucket */ -#define TCPCTL_MAXID 17 +#define TCPCTL_RFC3390 17 /* enable/disable RFC3390 increased cwnd */ +#define TCPCTL_MAXID 18 #define TCPCTL_NAMES { \ { 0, 0 }, \ @@ -454,6 +455,7 @@ struct tcpstat { { "ecn", CTLTYPE_INT }, \ { "syncachelimit", CTLTYPE_INT }, \ { "synbucketlimit", CTLTYPE_INT }, \ + { "rfc3390", CTLTYPE_INT }, \ } struct tcp_ident_mapping { @@ -473,6 +475,7 @@ extern int tcp_do_sack; /* SACK enabled/disabled */ extern struct pool sackhl_pool; #endif extern int tcp_do_ecn; /* RFC3168 ECN enabled/disabled? */ +extern int tcp_do_rfc3390; /* RFC3390 Increasing TCP's Initial Window */ extern int tcp_syn_cache_limit; /* max entries for compressed state engine */ extern int tcp_syn_bucket_limit;/* max entries per hash bucket */ |