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

Missing packet loss rate info #114

Open
kenchou opened this issue Dec 1, 2020 · 5 comments
Open

Missing packet loss rate info #114

kenchou opened this issue Dec 1, 2020 · 5 comments

Comments

@kenchou
Copy link

kenchou commented Dec 1, 2020

ping result:
100 packets transmitted, 81 received, 19% packet loss, time 99425ms

gping missing info of packet loss

@gregsadetsky
Copy link

Seconded! Would be really great to see a different color on the plot for pings that timed out

@skoehler
Copy link

skoehler commented Nov 2, 2023

I'm afraid that gping is running the normal ping command and parses its output. The ping command prints about packet loss only when it terminates. gping should send the ping packets itself, and it should have a configurable timeout after which a packet is counted as lost. Only then gping can give you realtime statistics on how many packets have been dropped in total / over a given time window.

@gregsadetsky
Copy link

I'm not sure that I follow -- ping does print about lost packets as they are being sent... or are we talking about different things?

# I disconnected and reconnected my connection in the middle of this ping session
g@tr repo (main *%) % ping 8.8.8.8 
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=114 time=3.687 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=114 time=3.210 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=114 time=3.383 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=114 time=3.551 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=114 time=3.513 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=114 time=3.323 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=114 time=3.397 ms
64 bytes from 8.8.8.8: icmp_seq=7 ttl=114 time=3.511 ms
64 bytes from 8.8.8.8: icmp_seq=8 ttl=114 time=3.240 ms
ping: sendto: No route to host
Request timeout for icmp_seq 9
ping: sendto: No route to host
Request timeout for icmp_seq 10
ping: sendto: No route to host
Request timeout for icmp_seq 11
ping: sendto: No route to host
[... snip ...]
Request timeout for icmp_seq 21
ping: sendto: No route to host
Request timeout for icmp_seq 22
ping: sendto: No route to host
Request timeout for icmp_seq 23
Request timeout for icmp_seq 24
64 bytes from 8.8.8.8: icmp_seq=25 ttl=114 time=4.090 ms
64 bytes from 8.8.8.8: icmp_seq=26 ttl=114 time=3.192 ms
64 bytes from 8.8.8.8: icmp_seq=27 ttl=114 time=3.433 ms
64 bytes from 8.8.8.8: icmp_seq=28 ttl=114 time=3.272 ms
64 bytes from 8.8.8.8: icmp_seq=29 ttl=114 time=3.199 ms

@skoehler
Copy link

skoehler commented Nov 2, 2023

Which version of ping is that? On Linux, the usual ping from the iputils package doesn't do that. I looked for an option to have that feature. I apparently missed it on my first look. But here it is:

$ ping -O 1.2.3.4
PING 1.2.3.4 (1.2.3.4) 56(84) Bytes an Daten.
noch keine Antwort für icmp_seq=1
noch keine Antwort für icmp_seq=2
noch keine Antwort für icmp_seq=3
^C
--- 1.2.3.4 ping-Statistik ---
4 Pakete übertragen, 0 empfangen, 100% packet loss, time 3040ms

$ LANG=C ping -O 1.2.3.4
PING 1.2.3.4 (1.2.3.4) 56(84) bytes of data.
no answer yet for icmp_seq=1
no answer yet for icmp_seq=2
no answer yet for icmp_seq=3
no answer yet for icmp_seq=4
no answer yet for icmp_seq=5
^C
--- 1.2.3.4 ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 5063ms

One problem with that is that it is localized depending on the locale.

@kenchou
Copy link
Author

kenchou commented Nov 5, 2023

I'm afraid that gping is running the normal ping command and parses its output. The ping command prints about packet loss only when it terminates. gping should send the ping packets itself, and it should have a configurable timeout after which a packet is counted as lost. Only then gping can give you realtime statistics on how many packets have been dropped in total / over a given time window.

emm... You're right. It parses the output results of the ping command.

https://github.com/orf/gping/blob/master/pinger/src/linux.rs#L12-L16
https://github.com/orf/gping/blob/master/pinger/src/lib.rs#L42-L53

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

3 participants