LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-24-2020, 06:04 PM   #1
paziulek
Member
 
Registered: Mar 2009
Location: N.C.
Distribution: "gentoo|debian|arch"
Posts: 106

Rep: Reputation: 11
ping and rtt calculation/display


hi all!

does anybody know why ping sometimes displays two decimal places for xx.10 only, sometimes - it does xx.1 ?
I cant see any logic here - it does that for .10 only.. no other hundredths of a ms...


ping utility, iputils-s20180629
Linux deb10 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64 GNU/Linux
Attached Thumbnails
Click image for larger version

Name:	wtfping.jpg
Views:	10
Size:	311.8 KB
ID:	33711  

Last edited by paziulek; 07-24-2020 at 08:18 PM.
 
Old 07-24-2020, 06:54 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
I get double digits, and triple digits for the summary:
Code:
$ ping -c3 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=58 time=3.67 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=58 time=3.46 ms
64 bytes from 1.1.1.1: icmp_seq=3 ttl=58 time=3.47 ms

--- 1.1.1.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 3.462/3.537/3.679/0.111 ms
$ uname -a
Linux odroid 3.10.107-190 #1 SMP PREEMPT Mon Sep 4 20:41:37 UTC 2017 armv7l armv7l armv7l GNU/Linux
$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"
$ ping -V
ping utility, iputils-s20121221

Last edited by berndbausch; 07-24-2020 at 06:57 PM.
 
Old 07-24-2020, 07:17 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,760

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
If I understand the question, of the different versions I have tested only 3 significant digits are displayed but never xx.10.

Code:
pinging localhost
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.057 ms

Pinging a wifi device on my network
64 bytes from sprinkler.localnet (192.168.0.212): icmp_seq=1 ttl=100 time=4.94 ms

Pinging google.com
64 bytes from atl14s08-in-f142.1e100.net (216.58.193.142): icmp_seq=1 ttl=119 time=31.6 ms

Last edited by michaelk; 07-24-2020 at 07:18 PM.
 
Old 07-24-2020, 08:21 PM   #4
paziulek
Member
 
Registered: Mar 2009
Location: N.C.
Distribution: "gentoo|debian|arch"
Posts: 106

Original Poster
Rep: Reputation: 11
I am sorry! - forgot about the attachment

I watched the rrt for a few minutes, then re-tried and it did come back with just 1 decimal for all ms - the only exception was the .10 - so no difference between now and the original post

attaching again
Attached Thumbnails
Click image for larger version

Name:	wtfping.jpg
Views:	9
Size:	311.8 KB
ID:	33712  

Last edited by paziulek; 07-24-2020 at 08:23 PM.
 
Old 07-24-2020, 08:39 PM   #5
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
I had not seen your attachment, sorry. Well your ping is six years younger than mine; perhaps they gradually develop the capability of displaying decimal digits.

Seriously, I tend to consider this a (very) minor bug. I may have a Debian 10 VM lying around to check this.
 
Old 07-24-2020, 09:08 PM   #6
paziulek
Member
 
Registered: Mar 2009
Location: N.C.
Distribution: "gentoo|debian|arch"
Posts: 106

Original Poster
Rep: Reputation: 11
well, what's minor and not depends where and how the results are being used. If rounding up the values is not doing what it what was planned, than the results are wrong.
for you or me, this is a 'minor' one but i guess when you try to eg. sort the results it might give you a misleading outcome. Not even looking at the byte count... I guess things are either right, or wrong.

Last edited by paziulek; 07-24-2020 at 09:13 PM.
 
Old 07-24-2020, 09:10 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,760

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
I finally saw the same thing as in your attachment. I assume it is due to some rounding error in the calculation on how the utility creates the output that produces the "anomaly". It would take a bit to examine the source code but since it is a minor bug not worth the effort.

Last edited by michaelk; 07-24-2020 at 09:12 PM.
 
Old 07-24-2020, 09:33 PM   #8
paziulek
Member
 
Registered: Mar 2009
Location: N.C.
Distribution: "gentoo|debian|arch"
Posts: 106

Original Poster
Rep: Reputation: 11
shared what i planned to share - someone will examine the source code...

BTW
"Logic will take you from A to B"
in this case:
"Logic will take you from A to around the corner of B"
But that's not Albert anymore...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculation of rtt from ns2 trace file maria_seb Linux - Wireless Networking 1 03-20-2013 10:19 AM
I cannot ping with command 'ping IP' address but can ping with 'ping IP -I eth0' sanketmlad Linux - Networking 2 07-15-2011 05:32 AM
[SOLVED] Ping shell script to report high rtt celembor Linux - Software 11 12-02-2009 07:12 AM
Accessing RTT values calculated by the kernel shrishailnk Linux - Networking 0 03-21-2008 09:30 AM
calculate the RTT of a datagram trscookie Linux - Networking 6 04-06-2006 06:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration