View previous topic :: View next topic |
Author |
Message |
ErnstlAT n00b


Joined: 22 Nov 2002 Posts: 15 Location: Vienna, Austria
|
Posted: Fri Apr 18, 2003 10:33 am Post subject: High precision 'ping' in Gentoo portage? |
|
|
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 |
|
 |
puddpunk l33t


Joined: 20 Jul 2002 Posts: 681 Location: New Zealand
|
Posted: Fri Apr 18, 2003 12:46 pm Post subject: |
|
|
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 |
|
 |
puddpunk l33t


Joined: 20 Jul 2002 Posts: 681 Location: New Zealand
|
Posted: Fri Apr 18, 2003 1:04 pm Post subject: |
|
|
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  |
|
Back to top |
|
 |
homerjay n00b


Joined: 13 Oct 2002 Posts: 13 Location: Scotland
|
Posted: Fri Apr 18, 2003 4:54 pm Post subject: Re: High precision 'ping' in Gentoo portage? |
|
|
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 |
|
 |
|