Answers:
直觉:
$ grep -A 2 initcwnd `find /usr/src/linux/include -type f -iname '*h'`
出:
/usr/src/linux/include/net/tcp.h:
/* TCP initial congestion window as per draft-hkchu-tcpm-initcwnd-01 */
#define TCP_INIT_CWND 10
如果我对您的理解正确,那么您正在寻找snd_cwnd
初始化TCP套接字时参数集的初始值。
看起来从linux内核开始,在linux / include / net / tcp.h中引入了2.6.39
一个宏,该宏在初始化TCP套接字时填充的值。TCP_INIT_CWND
snd_cwnd
我知道此代码在的内核中的位置IPv4
,但是不幸的是,它似乎没有使用任何宏来填充早于的内核的值。2.6.39
/* net/ipv4/tcp_ipv4.c from 2.6.37 kernel */
static int tcp_v4_init_sock(struct sock *sk)
{
struct inet_connection_sock *icsk = inet_csk(sk);
struct tcp_sock *tp = tcp_sk(sk);
....
....
....
/* So many TCP implementations out there (incorrectly) count the
* initial SYN frame in their delayed-ACK and congestion control
* algorithms that we must have the following bandaid to talk
* efficiently to them. -DaveM
*/
tp->snd_cwnd = 2;
....
....
....
}
IPv6
在内部tcp_v6_init_sock()
函数中也存在类似的初始化代码net/ipv6/tcp_ipv6.c