首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在centOS6上获取` `tcp选项时间戳`

如何在centOS6上获取` `tcp选项时间戳`
EN

Stack Overflow用户
提问于 2017-05-22 18:36:00
回答 1查看 189关注 0票数 0

在centOS7上,我可以使用getsockopt(x,IPPROTO_TCP, TCP_TIMESTAMP, x, x)来获取tcp时间戳,TCP_TIMESTAMP是在netinet/tcp.h中定义的,但是当我使用centOS6时,我找不到它。

那么有没有人在centOS6上成功地做到了呢?非常感谢!

EN

回答 1

Stack Overflow用户

发布于 2017-05-23 20:33:22

在第4页中,引入tcp时间戳的rfc-1323指出:

(3)往返测量

代码语言:javascript
复制
       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协议定义之后引入的一个选项,它被认为是可选的,您可能会遇到不支持它的实现。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44110724

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档