到目前为止,linux中的命令'sysctl‘在全局上改变了整个系统的拥塞控制算法。但是拥塞控制,其中TCP窗口大小和其他类似的参数是变化的,通常是每个TCP连接。所以我的问题是:
还是我错过了一些琐碎的东西?如果是,那又是什么呢?
发布于 2011-06-07 19:46:36
这是在iperf中使用-Z选项完成的-补丁是这里。
这就是它的实现方式(PerfSocket.cpp,第93行):
if ( isCongestionControl( inSettings ) ) {
#ifdef TCP_CONGESTION
Socklen_t len = strlen( inSettings->mCongestion ) + 1;
int rc = setsockopt( inSettings->mSock, IPPROTO_TCP, TCP_CONGESTION,
inSettings->mCongestion, len);
if (rc == SOCKET_ERROR ) {
fprintf(stderr, "Attempt to set '%s' congestion control failed: %s\n",
inSettings->mCongestion, strerror(errno));
exit(1);
}
#else
fprintf( stderr, "The -Z option is not available on this operating system\n");
#endif
其中mCongestion是一个字符串,其中包含要使用的算法的名称。
发布于 2011-03-17 11:19:15
通过get/setsockopt,这似乎是可能的。我找到的唯一文档是:http://lkml.indiana.edu/hypermail/linux/net/0811.2/00020.html
发布于 2018-08-17 08:19:28
在较新版本的Linux中,可以使用ip路由为特定目标设置拥塞控制.充血。
如果有人熟悉这个方法,请编辑这篇文章。
https://stackoverflow.com/questions/4688924
复制相似问题