summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorhiren <hiren@FreeBSD.org>2015-10-27 09:43:05 +0000
committerhiren <hiren@FreeBSD.org>2015-10-27 09:43:05 +0000
commit9d3e0245b758d8331d329301421f2d1a1e67e5ae (patch)
tree80647440e6b13448008e102ff521d010be8ddd31 /sys/netinet
parent569bd9e319e6a1f05c1451df58af6729a7582b02 (diff)
downloadFreeBSD-src-9d3e0245b758d8331d329301421f2d1a1e67e5ae.zip
FreeBSD-src-9d3e0245b758d8331d329301421f2d1a1e67e5ae.tar.gz
Add sysctl tunable net.inet.tcp.initcwnd_segments to specify initial congestion
window in number of segments on fly. It is set to 10 segments by default. Remove net.inet.tcp.experimental.initcwnd10 which is now redundant. Also remove the parent node net.inet.tcp.experimental as it's not needed anymore and also because it was not well thought out. Differential Revision: https://reviews.freebsd.org/D3858 In collaboration with: lstewart Reviewed by: gnn (prev version), rwatson, allanjude, wblock (man page) MFC after: 2 weeks Relnotes: yes Sponsored by: Limelight Networks
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_input.c18
-rw-r--r--sys/netinet/tcp_var.h4
2 files changed, 10 insertions, 12 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 64971f3..8f56620 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -159,13 +159,10 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3390, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(tcp_do_rfc3390), 0,
"Enable RFC 3390 (Increasing TCP's Initial Congestion Window)");
-SYSCTL_NODE(_net_inet_tcp, OID_AUTO, experimental, CTLFLAG_RW, 0,
- "Experimental TCP extensions");
-
-VNET_DEFINE(int, tcp_do_initcwnd10) = 1;
-SYSCTL_INT(_net_inet_tcp_experimental, OID_AUTO, initcwnd10, CTLFLAG_VNET | CTLFLAG_RW,
- &VNET_NAME(tcp_do_initcwnd10), 0,
- "Enable RFC 6928 (Increasing initial CWND to 10)");
+VNET_DEFINE(int, tcp_initcwnd_segments) = 10;
+SYSCTL_INT(_net_inet_tcp, OID_AUTO, initcwnd_segments,
+ CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_initcwnd_segments), 0,
+ "Slow-start flight size (initial congestion window) in number of segments");
VNET_DEFINE(int, tcp_do_rfc3465) = 1;
SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3465, CTLFLAG_VNET | CTLFLAG_RW,
@@ -364,6 +361,7 @@ cc_conn_init(struct tcpcb *tp)
* RFC5681 Section 3.1 specifies the default conservative values.
* RFC3390 specifies slightly more aggressive values.
* RFC6928 increases it to ten segments.
+ * Support for user specified value for initial flight size.
*
* If a SYN or SYN/ACK was lost and retransmitted, we have to
* reduce the initial CWND to one segment as congestion is likely
@@ -371,9 +369,9 @@ cc_conn_init(struct tcpcb *tp)
*/
if (tp->snd_cwnd == 1)
tp->snd_cwnd = tp->t_maxseg; /* SYN(-ACK) lost */
- else if (V_tcp_do_initcwnd10)
- tp->snd_cwnd = min(10 * tp->t_maxseg,
- max(2 * tp->t_maxseg, 14600));
+ else if (V_tcp_initcwnd_segments)
+ tp->snd_cwnd = min(V_tcp_initcwnd_segments * tp->t_maxseg,
+ max(2 * tp->t_maxseg, V_tcp_initcwnd_segments * 1460));
else if (V_tcp_do_rfc3390)
tp->snd_cwnd = min(4 * tp->t_maxseg,
max(2 * tp->t_maxseg, 4380));
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index 07a28fe..2a2a148 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -621,7 +621,7 @@ VNET_DECLARE(int, tcp_mssdflt); /* XXX */
VNET_DECLARE(int, tcp_minmss);
VNET_DECLARE(int, tcp_delack_enabled);
VNET_DECLARE(int, tcp_do_rfc3390);
-VNET_DECLARE(int, tcp_do_initcwnd10);
+VNET_DECLARE(int, tcp_initcwnd_segments);
VNET_DECLARE(int, tcp_sendspace);
VNET_DECLARE(int, tcp_recvspace);
VNET_DECLARE(int, path_mtu_discovery);
@@ -633,7 +633,7 @@ VNET_DECLARE(int, tcp_abc_l_var);
#define V_tcp_minmss VNET(tcp_minmss)
#define V_tcp_delack_enabled VNET(tcp_delack_enabled)
#define V_tcp_do_rfc3390 VNET(tcp_do_rfc3390)
-#define V_tcp_do_initcwnd10 VNET(tcp_do_initcwnd10)
+#define V_tcp_initcwnd_segments VNET(tcp_initcwnd_segments)
#define V_tcp_sendspace VNET(tcp_sendspace)
#define V_tcp_recvspace VNET(tcp_recvspace)
#define V_path_mtu_discovery VNET(path_mtu_discovery)
OpenPOWER on IntegriCloud