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: 1 comment
-
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.
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_info
may help. You can get it usinggetsockopt(..., IPPROTO_TCP, TCP_INFO, ...)
(see for example the iperf3tcp_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.