leo
leo

Reputation: 53

TCP RTT calculation timestamp

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.

Upvotes: 2

Views: 4791

Answers (1)

caf
caf

Reputation: 239061

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 corresponding ACK for that data was recieved was the RTT for that segment/acknowledgement.

Upvotes: 1

Related Questions