Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在这里有一个简单的问题,如何计算 tcp 连接中的往返时间。我使用 tcpdump 获得了通信数据包。在 tcp 数据包中,有时间戳选项,包括 TSval 和 TSecr。RFC 1323 说它可以用来计算 RTT。但是,它没有说如何,或者我没有找到它。无论如何,我对此感到困惑。任何人都可以向我解释这个吗?我只想知道如何计算单个发送的 msg 的 rtt,它是 ack,而不是平均 rtt。
您不能使用 TS 字段来计算 RTT,除非您还可以访问用于生成时间戳的时间戳时钟。
但是,如果您有使用 记录的数据包副本tcpdump,那么您可能会记录时间戳,指示每个数据包的发送或接收时间。您可以使用这些时间戳 - 发送段 A 的时间与接收到相应数据的时间之间的差异ACK是该段/确认的 RTT。
tcpdump
ACK