Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_input.c
Show First 20 Lines • Show All 153 Lines • ▼ Show 20 Lines | |||||
VNET_DEFINE(int, tcp_do_rfc3390) = 1; | VNET_DEFINE(int, tcp_do_rfc3390) = 1; | ||||
SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3390, CTLFLAG_VNET | CTLFLAG_RW, | SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3390, CTLFLAG_VNET | CTLFLAG_RW, | ||||
&VNET_NAME(tcp_do_rfc3390), 0, | &VNET_NAME(tcp_do_rfc3390), 0, | ||||
"Enable RFC 3390 (Increasing TCP's Initial Congestion Window)"); | "Enable RFC 3390 (Increasing TCP's Initial Congestion Window)"); | ||||
SYSCTL_NODE(_net_inet_tcp, OID_AUTO, experimental, CTLFLAG_RW, 0, | SYSCTL_NODE(_net_inet_tcp, OID_AUTO, experimental, CTLFLAG_RW, 0, | ||||
"Experimental TCP extensions"); | "Experimental TCP extensions"); | ||||
VNET_DEFINE(int, tcp_do_initcwnd10) = 1; | VNET_DEFINE(int, tcp_initcwnd_in_mss) = 10; | ||||
SYSCTL_INT(_net_inet_tcp_experimental, OID_AUTO, initcwnd10, CTLFLAG_VNET | CTLFLAG_RW, | SYSCTL_INT(_net_inet_tcp, OID_AUTO, initcwnd_in_mss, CTLFLAG_VNET | CTLFLAG_RW, | ||||
&VNET_NAME(tcp_do_initcwnd10), 0, | &VNET_NAME(tcp_initcwnd_in_mss), 0, | ||||
"Enable RFC 6928 (Increasing initial CWND to 10)"); | "Slow-start flight size (initial congestion window) in number of segments"); | ||||
VNET_DEFINE(int, tcp_do_rfc3465) = 1; | VNET_DEFINE(int, tcp_do_rfc3465) = 1; | ||||
SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3465, CTLFLAG_VNET | CTLFLAG_RW, | SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3465, CTLFLAG_VNET | CTLFLAG_RW, | ||||
&VNET_NAME(tcp_do_rfc3465), 0, | &VNET_NAME(tcp_do_rfc3465), 0, | ||||
"Enable RFC 3465 (Appropriate Byte Counting)"); | "Enable RFC 3465 (Appropriate Byte Counting)"); | ||||
VNET_DEFINE(int, tcp_abc_l_var) = 2; | VNET_DEFINE(int, tcp_abc_l_var) = 2; | ||||
SYSCTL_INT(_net_inet_tcp, OID_AUTO, abc_l_var, CTLFLAG_VNET | CTLFLAG_RW, | SYSCTL_INT(_net_inet_tcp, OID_AUTO, abc_l_var, CTLFLAG_VNET | CTLFLAG_RW, | ||||
▲ Show 20 Lines • Show All 182 Lines • ▼ Show 20 Lines | cc_conn_init(struct tcpcb *tp) | ||||
} | } | ||||
/* | /* | ||||
* Set the initial slow-start flight size. | * Set the initial slow-start flight size. | ||||
* | * | ||||
* RFC5681 Section 3.1 specifies the default conservative values. | * RFC5681 Section 3.1 specifies the default conservative values. | ||||
* RFC3390 specifies slightly more aggressive values. | * RFC3390 specifies slightly more aggressive values. | ||||
* RFC6928 increases it to ten segments. | * 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 | * If a SYN or SYN/ACK was lost and retransmitted, we have to | ||||
* reduce the initial CWND to one segment as congestion is likely | * reduce the initial CWND to one segment as congestion is likely | ||||
* requiring us to be cautious. | * requiring us to be cautious. | ||||
*/ | */ | ||||
if (tp->snd_cwnd == 1) | if (tp->snd_cwnd == 1) | ||||
tp->snd_cwnd = tp->t_maxseg; /* SYN(-ACK) lost */ | tp->snd_cwnd = tp->t_maxseg; /* SYN(-ACK) lost */ | ||||
else if (V_tcp_do_initcwnd10) | else if (V_tcp_initcwnd_in_mss) | ||||
tp->snd_cwnd = min(10 * tp->t_maxseg, | tp->snd_cwnd = min(V_tcp_initcwnd_in_mss * tp->t_maxseg, | ||||
max(2 * tp->t_maxseg, 14600)); | max(2 * tp->t_maxseg, V_tcp_initcwnd_in_mss * 1460)); | ||||
else if (V_tcp_do_rfc3390) | else if (V_tcp_do_rfc3390) | ||||
tp->snd_cwnd = min(4 * tp->t_maxseg, | tp->snd_cwnd = min(4 * tp->t_maxseg, | ||||
max(2 * tp->t_maxseg, 4380)); | max(2 * tp->t_maxseg, 4380)); | ||||
else { | else { | ||||
/* Per RFC5681 Section 3.1 */ | /* Per RFC5681 Section 3.1 */ | ||||
if (tp->t_maxseg > 2190) | if (tp->t_maxseg > 2190) | ||||
tp->snd_cwnd = 2 * tp->t_maxseg; | tp->snd_cwnd = 2 * tp->t_maxseg; | ||||
else if (tp->t_maxseg > 1095) | else if (tp->t_maxseg > 1095) | ||||
▲ Show 20 Lines • Show All 3,344 Lines • Show Last 20 Lines |