Skip to content
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

Packet loss displayed during execution is "incorrect" when timeout (-t) larger than period (-p) #156

Closed
bkuker opened this issue Aug 21, 2019 · 2 comments

Comments

@bkuker
Copy link

bkuker commented Aug 21, 2019

When the timeout is larger than the period the calculated packet loss is too high.
That calculation includes all pings sent, including those that have not timed out yet.

On the following execution, running 10 trials with 20ms period and 100ms timeout:

bkuker@bill-system:~/fping$ fping --size=200 --period=20 --count=10 --timeout=100 www.csh.rit.edu
fping: warning: timeout (-t) value larger than period (-p) produces unexpected results
www.csh.rit.edu : [0], 228 bytes, 77.5 ms (77.5 avg, 75% loss)
www.csh.rit.edu : [1], 228 bytes, 77.6 ms (77.5 avg, 60% loss)
www.csh.rit.edu : [2], 228 bytes, 77.5 ms (77.5 avg, 50% loss)
www.csh.rit.edu : [3], 228 bytes, 77.4 ms (77.5 avg, 42% loss)
www.csh.rit.edu : [4], 228 bytes, 77.4 ms (77.5 avg, 37% loss)
www.csh.rit.edu : [5], 228 bytes, 77.5 ms (77.5 avg, 33% loss)
www.csh.rit.edu : [6], 228 bytes, 77.4 ms (77.5 avg, 30% loss)
www.csh.rit.edu : [7], 228 bytes, 77.4 ms (77.5 avg, 20% loss)
www.csh.rit.edu : [8], 228 bytes, 77.6 ms (77.5 avg, 10% loss)
www.csh.rit.edu : [9], 228 bytes, 77.4 ms (77.5 avg, 0% loss)

www.csh.rit.edu : xmt/rcv/%loss = 10/10/0%, min/avg/max = 77.8/77.9/78.0

Note that no packets are lost, but by the time response [0] is returned, 77ms after request[0] was sent, requests [1], [2], and [3] have already been sent, and the responses are in flight but have not been received yet.
These requests are counted against packet loss, resulting in a 75% loss being reported.

I think the correct behavior should be that outstanding responses within the timeout period should not be counted as either lost or received.

I'm working on a simple fix I will share if you'd like to fix this behavior.

@bkuker
Copy link
Author

bkuker commented Aug 21, 2019

BTW This is my best guess about what #142 means about "unexpected results" because everything else seems as expected.

@schweikert
Copy link
Owner

fixed in #193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants