How to measure one-way latency? #1844
-
|
Hello, I want to measure one-way latency using iperf3. I found the following line in Is Additionally, how can I do this for TCP? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Hi,
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.
|
Beta Was this translation helpful? Give feedback.
-
|
Getting one-way latency is a hard problem, server and client clocks have to be in-sync within 1ms to get any level of useful accuracy. iperf doesn't have this feature, however owamp / twamp has been designed to get this specifically. |
Beta Was this translation helpful? Give feedback.
Hi,
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.
tcp_infomay help. You can get it usinggetsockopt(..., IPPROTO_TCP, TCP_INFO, ...)(see for example the iperf3tcp_info.cfile). However, it seems that it only calculates RTT, but maybe by dividing it by 2 you can get an approximate one-way latency.