在centOS7上,我可以使用getsockopt(x,IPPROTO_TCP, TCP_TIMESTAMP, x, x)来获取tcp时间戳,TCP_TIMESTAMP是在netinet/tcp.h中定义的,但是当我使用centOS6时,我找不到它。
那么有没有人在centOS6上成功地做到了呢?非常感谢!
发布于 2017-05-23 20:33:22
在第4页中,引入tcp时间戳的rfc-1323指出:
(3)往返测量
TCP implements reliable data delivery by retransmitting
segments that are not acknowledged within some retransmission
timeout (RTO) interval. Accurate dynamic determination of an
appropriate RTO is essential to TCP performance. RTO is
determined by estimating the mean and variance of the
measured round-trip time (RTT), i.e., the time interval
between sending a segment and receiving an acknowledgment for
it [Jacobson88a].
Section 4 introduces a new TCP option, "Timestamps", and then
defines a mechanism using this option that allows nearly
every segment, including retransmissions, to be timed at
negligible computational cost. We use the mnemonic RTTM
(Round Trip Time Measurement) for this mechanism, to
distinguish it from other uses of the Timestamps option.因此,在连接的两端引入的时间戳可以通过将精确的时间戳附加到段并确定从一端到另一端的往返时间来精确地确定重传TimeOut间隔。
这些通常出现在SYN初始化段中,用于确定初始往返时间,然后在连接进行时定期确定变化或网络拥塞。
此外,作为TCP协议定义之后引入的一个选项,它被认为是可选的,您可能会遇到不支持它的实现。
https://stackoverflow.com/questions/44110724
复制相似问题