Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
High precision 'ping' in Gentoo portage?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ErnstlAT
n00b
n00b


Joined: 22 Nov 2002
Posts: 15
Location: Vienna, Austria

PostPosted: Fri Apr 18, 2003 10:33 am    Post subject: High precision 'ping' in Gentoo portage? Reply with quote

I just came across an ISP's NOC (where you can ping/traceroute to hosts before you change ISP) and became the following output:
PING www.inode.at (195.58.160.3) from 217.196.64.6 : 56(84) bytes of data.
64 bytes from p133.inode.at (195.58.160.3): icmp_seq=0 ttl=252 time=1.692 msec
64 bytes from p133.inode.at (195.58.160.3): icmp_seq=1 ttl=252 time=1.104 msec
64 bytes from p133.inode.at (195.58.160.3): icmp_seq=2 ttl=252 time=1.283 msec
64 bytes from p133.inode.at (195.58.160.3): icmp_seq=3 ttl=252 time=978 usec

I've already heard of Red Hat having such a high-precision 'ping' included, but on all of my Gentoo installations I only get response times in the format "X.XX ms".

So, is there such a high-precision 'ping' somewhere available for Gentoo as well - or is that functionality just disabled by DEFINE's/compile-params (if that is, how can I make it display more numbers after the decimal point)?

Looking forward for your help,
Ernstl.at
Back to top
View user's profile Send private message
puddpunk
l33t
l33t


Joined: 20 Jul 2002
Posts: 681
Location: New Zealand

PostPosted: Fri Apr 18, 2003 12:46 pm    Post subject: Reply with quote

Are the extra 2 decimal places really going to make that much of a difference? I'm sure whatever accuracy you gain using them would be lost in the randomness of the experiment.

I don't know if there is any High precision ping for Gentoo (or at all) but there is nothing stopping you from hacking the ping code to change the sprintf format string from %0.1f to %0.3f as I don't think that accuracy is lost in the normal ping, it just isn't displayed, because it really shouldn't matter.
Back to top
View user's profile Send private message
puddpunk
l33t
l33t


Joined: 20 Jul 2002
Posts: 681
Location: New Zealand

PostPosted: Fri Apr 18, 2003 1:04 pm    Post subject: Reply with quote

Here you go:
Code:
# ebuild /usr/portage/sys-apps/netkit-base/netkit-base-0.17-r6.ebuild unpack
# cd /tmp/portage/netkit-base-0.17-r6/work/netkit-base-0.17/ping
# vi ping.c


The code you are looking for is on line 763. But just looking at it, it may need some further hacking :\

It's 1 a.m. here, so bedtime for now :P
Back to top
View user's profile Send private message
homerjay
n00b
n00b


Joined: 13 Oct 2002
Posts: 13
Location: Scotland

PostPosted: Fri Apr 18, 2003 4:54 pm    Post subject: Re: High precision 'ping' in Gentoo portage? Reply with quote

ErnstlAT wrote:
I've already heard of Red Hat having such a high-precision 'ping' included, but on all of my Gentoo installations I only get response times in the format "X.XX ms".


The ping that I've got from netkit-base 0.17-r6 will produce output like this: -

Code:
PING mainpc (192.168.0.2) 56(84) bytes of data.
64 bytes from mainpc (192.168.0.2): icmp_seq=1 ttl=64 time=0.044 ms
64 bytes from mainpc (192.168.0.2): icmp_seq=2 ttl=64 time=0.036 ms
64 bytes from mainpc (192.168.0.2): icmp_seq=3 ttl=64 time=0.035 ms
64 bytes from mainpc (192.168.0.2): icmp_seq=4 ttl=64 time=0.037 ms


0.0xx ms is xx us, as I'm sure you know, so surely that is the precision you need. Note, however, that as the ping time goes up, the accuracy goes down, so you only seem to get 3 sig figs. e.g.

Code:
PING www.inode.at (195.58.160.3) 56(84) bytes of data.
64 bytes from p133.inode.at (195.58.160.3): icmp_seq=1 ttl=245 time=89.0 ms
64 bytes from p133.inode.at (195.58.160.3): icmp_seq=2 ttl=245 time=66.8 ms
64 bytes from p133.inode.at (195.58.160.3): icmp_seq=3 ttl=245 time=92.7 ms


I don't know if this is what you expected or not.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum