summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_timer.h
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2022-11-07 11:22:56 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2022-11-07 11:22:56 +0000
commit9ce5dce7bb13c9a20d8bb1c16549b96dab30af6e (patch)
treeaa51e6ca9231c856209ccae8838119cb73b133bc /sys/netinet/tcp_timer.h
parent9241d98c94747d370684e06f4f822e56ce910c94 (diff)
Modify TCP receive buffer size auto scaling to use the smoothed RTT
(SRTT) instead of the timestamp option. Since the timestamp option is disabled on some OSs (eg. Windows) or dropped by some firewalls/routers, in such a case the window size had been fixed at 16KB, this limits throughput at very low on high latency networks. Also replace "tcp_now" from 2HZ tick counter to binuptime in milliseconds to calculate the SRTT better. tested by krw matthieu jmatthew dlg djm stu stsp ok claudio
Diffstat (limited to 'sys/netinet/tcp_timer.h')
-rw-r--r--sys/netinet/tcp_timer.h42
1 files changed, 18 insertions, 24 deletions
diff --git a/sys/netinet/tcp_timer.h b/sys/netinet/tcp_timer.h
index befffd109ee..c0f417f55dc 100644
--- a/sys/netinet/tcp_timer.h
+++ b/sys/netinet/tcp_timer.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_timer.h,v 1.18 2018/05/08 15:10:33 bluhm Exp $ */
+/* $OpenBSD: tcp_timer.h,v 1.19 2022/11/07 11:22:55 yasuoka Exp $ */
/* $NetBSD: tcp_timer.h,v 1.6 1995/03/26 20:32:37 jtc Exp $ */
/*
@@ -86,27 +86,27 @@
/*
* Time constants.
*/
-#define TCPTV_MSL ( 30*PR_SLOWHZ) /* max seg lifetime (hah!) */
-#define TCPTV_SRTTBASE 0 /* base roundtrip time;
- if 0, no idea yet */
-#define TCPTV_SRTTDFLT ( 3*PR_SLOWHZ) /* assumed RTT if no info */
+#define TCPTV_MSL 30 /* max seg lifetime (hah!) */
+#define TCPTV_SRTTBASE 0 /* base roundtrip time;
+ if 0, no idea yet */
+#define TCPTV_SRTTDFLT TCP_TIME_MSEC(1500) /* assumed RTT if no info */
-#define TCPTV_PERSMIN ( 5*PR_SLOWHZ) /* retransmit persistence */
-#define TCPTV_PERSMAX ( 60*PR_SLOWHZ) /* maximum persist interval */
+#define TCPTV_PERSMIN 5 /* retransmit persistence */
+#define TCPTV_PERSMAX 60 /* maximum persist interval */
-#define TCPTV_KEEP_INIT ( 75*PR_SLOWHZ) /* initial connect keep alive */
-#define TCPTV_KEEP_IDLE (120*60*PR_SLOWHZ) /* dflt time before probing */
-#define TCPTV_KEEPINTVL ( 75*PR_SLOWHZ) /* default probe interval */
-#define TCPTV_KEEPCNT 8 /* max probes before drop */
+#define TCPTV_KEEP_INIT 75 /* initial connect keep alive */
+#define TCPTV_KEEP_IDLE 120*60 /* dflt time before probing */
+#define TCPTV_KEEPINTVL 75 /* default probe interval */
+#define TCPTV_KEEPCNT 8 /* max probes before drop */
-#define TCPTV_MIN ( 1*PR_SLOWHZ) /* minimum allowable value */
-#define TCPTV_REXMTMAX ( 64*PR_SLOWHZ) /* max allowable REXMT value */
+#define TCPTV_MIN TCP_TIME(1) /* minimum allowable value */
+#define TCPTV_REXMTMAX TCP_TIME(64) /* max allowable REXMT value */
-#define TCP_LINGERTIME 120 /* linger at most 2 minutes */
+#define TCP_LINGERTIME 120 /* linger at most 2 minutes */
-#define TCP_MAXRXTSHIFT 12 /* maximum retransmits */
+#define TCP_MAXRXTSHIFT 12 /* maximum retransmits */
-#define TCP_DELACK_MSECS 200 /* time to delay ACK */
+#define TCP_DELACK_MSECS 200 /* time to delay ACK */
#ifdef TCPTIMERS
const char *tcptimers[TCPT_NTIMERS] =
@@ -119,16 +119,10 @@ const char *tcptimers[TCPT_NTIMERS] =
#define TCP_TIMER_INIT(tp, timer) \
timeout_set_proc(&(tp)->t_timer[(timer)], tcp_timer_funcs[(timer)], tp)
-#define TCP_TIMER_ARM(tp, timer, nticks) \
+#define TCP_TIMER_ARM(tp, timer, msecs) \
do { \
SET((tp)->t_flags, TF_TIMER << (timer)); \
- timeout_add_msec(&(tp)->t_timer[(timer)], (nticks) * 500); \
-} while (0)
-
-#define TCP_TIMER_ARM_MSEC(tp, timer, msecs) \
-do { \
- SET((tp)->t_flags, TF_TIMER << (timer)); \
- timeout_add_msec(&(tp)->t_timer[(timer)], (msecs)); \
+ timeout_add_msec(&(tp)->t_timer[(timer)], (msecs)); \
} while (0)
#define TCP_TIMER_DISARM(tp, timer) \