TCP RTT计算时间戳
我这里有一个简单的问题,如何计算 TCP 连接中的往返时间。我使用 tcpdump 获取了通信数据包。在tcp数据包中,有时间戳选项,包括TSval和TSval。 TSecr。 RFC 1323说它可以用来计算RTT。不过没说怎么做,或者说我没找到。无论如何,我对此感到困惑。任何人都可以向我解释这一点吗?我只是想知道如何计算单个发送消息的 rtt 并且它是 ack,而不是平均 rtt。
i have a simple question here, how to calculate the round-trip time in a tcp connection. I got the communication packets using tcpdump. In tcp packet, there are timestamp options, including TSval & TSecr. RFC 1323 says it can be used to calculate RTT. However, it didn't say how, or I didn't find it. Anyway, I am confused about this. Anyone can explain this to me? I just want to know how to calculate rtt for a single sent msg and it's ack, not the average rtt.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不能使用 TS 字段来计算 RTT,除非您还可以访问用于生成时间戳的时间戳时钟。
但是,如果您有使用
tcpdump
记录的数据包副本,那么您可能会记录时间戳,指示每个数据包的发送或接收时间。您可以使用这些时间戳 - 发送段 A 的时间与接收该数据的相应ACK
时间之间的差异是该段/确认的 RTT。You cannot use the TS fields to calculate the RTT unless you also have access to the timestamp clock that was used to generate the timestamps.
However, if you have copies of the packets recorded with
tcpdump
, then you likely have timestamps recorded indicating when each packet was sent or recieved. You can use these timestamps - the difference between when segment A was sent and when the correspondingACK
for that data was recieved was the RTT for that segment/acknowledgement.