问题描述
我正在努力获取tcp连接的性能参数,这些参数是带宽。我打算使用从linux 2.6起支持的 tcp_info
结构,它保存有关tcp连接的元数据。可以使用 tcp_info
上的 getsockopt()
函数调用来检索信息。我花了很多时间找到一个很好的文档,解释了该结构中的所有参数,但是找不到一个。
I am working on getting the performance parameters of a tcp connection and one these parameters is the bandwidth. I am intending to use the tcp_info
structure supported from linux 2.6 onwards, which holds the meta data about a tcp connection. The information can be retrieved using the getsockopt()
function call on tcp_info
. I have spent lot of time finding a good documentation which explains all the parameters in that structure, but couldn't find one.
我测试了一个小程序来检索对于tcp连接,从 tcp_info
的值,我发现大多数时间的测量的MSS值为零。做长的故事短 - 是否有一个链接, tcp_info
的完整详细信息,并且使用这些值也是可靠的。
Also I tested a small program to retrieve the values from tcp_info
for a tcp connection where I found the measured MSS values for most of the time as zero.To make long story short-Is there a link to follow for which has complete details ontcp_info
and also is it reliable to use these values.
推荐答案
p>这里是一个关于linux tcp_info的结构和使用的 RenéPfeiffer,但有几件值得注意的事情:
Here is a fairly comprehensive write-up of the structure and use of the linux tcp_info by René Pfeiffer but there are a couple of things worth noting:
- 作者需要查看这些重复的数据,因为没有聚合
- 作者将指向tcp.c来源作为任何这些数据含义的最终权威。我不知道你希望从最大分段大小获得什么,但希望你认为它意味着其他的东西。
如果你真正感兴趣的精确测量带宽你需要使用的测量设备,在被测试的系统以外,甚至拉动 ioctls
将影响你感兴趣的现象关于。被动电线嗅探器是获得真正准确结果的唯一方法。最后,根据您的应用,带宽是一个非常宽泛的伞,将许多测量(例如延迟,往返时间,变化性,抖动等)变成一个类别。
If you are truly interested in exact measurements of bandwidth you need to use a measurement device which is outside the system being tested as even pulling the ioctls
will affect the phenomenon you are interested in knowing about. A passive wire sniffer is the only way to get truly accurate results. Finally, depending on your application, "bandwidth" is a really broad umbrella which flattens many measurements (e.g. latency, round-trip-time, variability, jitter, etc.) into one category.
这篇关于关于结构tcp_info的良好文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!