speedtest icon indicating copy to clipboard operation
speedtest copied to clipboard

Calculate ping amplitude

Open mikhailnov opened this issue 5 years ago • 3 comments

LibreTest looks very useful, thakns a lot, but there is a feature that is not imlemented but would be very useful. I am looking for a tool to self host it on a webinar server (with BigBlueButton). I often need information about maximium ping amplitude. If I understood correctly, jitter is ((previous ping)-(last ping))/(number of measures), but it does not anwer an important question:

  • should we expect WebRTC from the user sound to qua-qua (like a frog) from time to time?

Average jitter may be low, e.g. ping may be around 100 ms most of the time, but it may be 800 ms from time to time. If 800 ms happens rarely, an average jitter like it is now will not show that this problem exists. It may be so in case of an unstable mobile broadband connection, for example.

So, my feature request is: print minimal ping, maximal ping and ideally draw a plot of pings time.

mikhailnov avatar May 06 '20 11:05 mikhailnov

That is a legitimate question.

To be honest, I'm not too happy with the current algorithm for ping and jitter estimation and I plan to change it in the future.

The value that you get in the ping test is the minimum ping, the jitter is a bit more complicated, but essentially it's the variance between consecutive pings calculated as a sort of weighed average: https://github.com/librespeed/speedtest/blob/6fbe21f2f74f76def581c3354325048a2abe4e8e/speedtest_worker.js#L633

This behavior was introduced in the September 2019 update, and since then I've noticed that it tends to somewhat overestimate jitter, so a better algorithm is needed. Before that, it was a simple average for both, which was undershooting it considerably in my opinion.

Feel free to propose a solution if you want. I can't give you an ETA of course, LibreSpeed is not my job.

adolfintel avatar May 06 '20 18:05 adolfintel

Hi guys, I read how ping/jitter is calculated here. A line graph would be the best and could be updated each 200ms as dl/ul speed. If difference is less or more ms, then graph the diff.

kakarata avatar Jun 18 '20 19:06 kakarata

RFC 3550 estimates interarrival jitter (defined as an estimate of the the mean deviation of the difference in packet spacing at the receiver compared to the sender for a pair of packets, which is equivalent to the difference in the 'relative transit time' for the two packets):

jitter = jitter * 0.9375 + instjitter * 0.0625

"This algorithm is the optimal first-order estimator and the gain parameter 1/16 (0.0625) gives a good noise reduction ratio while maintaining a reasonable rate of convergence." (https://tools.ietf.org/html/rfc3550#section-6.4.1)

SCG82 avatar Sep 19 '20 13:09 SCG82