-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Etherate not measuring latency #54
Comments
Hi @aapocketz - thanks for reporting this issue and I am very sorry for such a long delay in responding, I have been changing jobs so life is crazy right now :) At first glance this looks like an issue with netem. I'm looking at this URL, please correct me if I am wrong as I am not a netem expert. It seems that netem uses the queuing discipline layer of the network stack within the Kernel to implement features like extra latency. Example from that URL:
Etherate bypasses this part of the networking stack to reduce latency and improve efficiency (simply put, it's less code to run within the Kernel for each packet that is sent). This is the relevant section within the Etherate source: https://github.com/jwbensley/Etherate/blob/master/defaults.c#L239-L249 If you are able to, you can comment out that section of code, recompile Etherate and try gain? Or I can add a CLI flag to disable this bypass technique if you like? |
I forgot to mention about the latency...
I mainly use Etherate in the lab and this is somewhere without Internet connectivity so there is no accurate or guaranteed time source (e.g. NTP). Etherate has to use a technique that doesn't rely on NTP or PTP to calculate the one way delay from the Tx to Rx host. To calculate one-way delay there is no need for both hosts to have their time sources in sync with each other (which in a lab with no Internet/NTP access is vital!). It works like this:
This provides a best case figure for the network delay from Tx to Rx. The ping output you have provided also includes application processing time (ping gets the time values, puts that in a packet, gives it to the kernel to send, the Kernel sends it down to the NIC etc.). So ping is showing (in your output) an average application level one-way delay of 0.536ms and Etherate is showing a network level one-way delay of 0.006ms. |
So I disabled the qdisc bypass, which certainly had an effect, as the test took a long time to complete when adding just 10ms of delay. Unfortunately the latency calculation doesn't reflect this increased amount of delay.
I guess I am really having trouble buying into your algorithm is effective for calculating one way latency.
I don't see how ΔRx includes the propagation delay, as these are frames that are sent back to back. As a thought experiment imagine two supercomputers on either side of the galaxy. The sending computer can generate a frame and transmit nearly instantly. Similarly the receiving computer can receive the frame and process it nearly instantly as well. The sender sends two frames back to back, so ΔTx=0. It takes 100 million years for each message to propagate across the galaxy. The receiver receives both frames, back to back, so ΔRx=0. The 100 million years isn't embedded anywhere in the variables you are measuring.
This isn't totally relevant but there isn't really anything from stopping you from setting up NTP in the lab with no internet or GPS. Just make one computer use its own clock source as the master clock and configure the other machines as clients to sync time from that machine. That being said I think NTP is only so accurate and its accuracy can be driven by latency, so it may be unsuitable for highly accurate latency measurements at least in an environment with high latency. |
@aapocketz very quick reply - Etherate is not meant for use between VMs, I will update the documentation to make this clearer, it is meant for real physical interfaces. Depending on the type of virtual interface being used all sorts of weird stuff can happen so I will make that clearer. As for the latency issue I haven't had time to look into this yet - just wanted to let you know I'm not ignoring you ;) |
ISSUE TYPE
VERSION DETAILS
SUMMARY
I have two Ubuntu 16.04 VMs each running Etherate in a private network (vboxnet0). I use netem to simulate a delay in linux, I expect to get a higher latency value measurement corresponding to this delay. I observe no change latency measurement when running the test.
Looking at the source code and the FAQ regarding it (https://null.53bits.co.uk/index.php?page=etherate-faqs#how-does-etherate-measure-delay) it appears it does a strategy where it repeatedly measures the different between transmission and receiving times for pairs of transmitted frames. I could see how this could maybe measure some sort of packet jitter but I don't see how its possible to measure latency in a unidirectional manner without some sort of precisely synchronized clock between the systems (for example a GPSDO).
STEPS TO REPRODUCE
This is an example run using netem and a delay of 100ms
The text was updated successfully, but these errors were encountered: