Skip to content

How to measure one-way latency? #1844

Answered by davidBar-On
choiyhking asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

Is transit the one-way latency?

Yes, but only if the timers of the client and the server are fully synchronized. Note that the code you found is for estimating the jitter (see the code that follows these lines), where the variance of the latency is important, not the latency itself.

Additionally, how can I do this for TCP?

tcp_info may help. You can get it using getsockopt(..., IPPROTO_TCP, TCP_INFO, ...) (see for example the iperf3 tcp_info.c file). However, it seems that it only calculates RTT, but maybe by dividing it by 2 you can get an approximate one-way latency.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by choiyhking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants