[smokeping-users] Updated tcpping probe and script

Chris Wilson chris+smokeping at aptivate.org
Sat Dec 3 16:18:26 CET 2011


Hi Richard,

Thanks for your prompt reply :)

On Sat, 3 Dec 2011, Richard van den Berg wrote:

> What version of tcptraceroute is included with CentOS 5? Before I could 
> get your version 1.8 of tcpping to work on Debian using tcptraceroute 
> 1.5beta7+debian-4 I had to fix some bugs:
>
> 1) You introduced a dependency on bash using the $[${ttl}-1] syntax on
>    line 58. This is fine, but then the shebang needs to be changed to
>    #!/bin/bash since #!/bin/sh cannot be assumed to be bash on all
>    systems.

Thanks for spotting that. I agree, but I'm surprised it didn't work on 
Debian. Does sh point to dash on that system, and doesn't dash support 
arithmetic?

> 2) You cannot put the stderr redirection 2>&1 inside the $cmd variable on 
> line 58. This needs to be placed after $cmd when called on line 68 instead.

Yes, you're right, thanks.

> After this the output is:
>
> $ /tmp/tcpping.1.8 -D www.cisco.com
> debug: tcptraceroute -f 254 -m 255 -q 1 -w 3 www.cisco.com
> Unexpected output from tcptraceroute: Selected device eth0, address 
> 94.142.246.140, port 59896 for outgoing packets
> Unexpected output from tcptraceroute: Tracing the path to www.cisco.com 
> (88.221.32.170) on TCP port 80 (www), 255 hops max
> Unexpected output from tcptraceroute: 254 
> a88-221-32-170.deploy.akamaitechnologies.com (88.221.32.170) [open]  4.238 ms
>
> I am very interested to see what the output of "tcptraceroute -f 254 -m 255 
> -q 1 -w 3 www.cisco.com" looks like on your system.

Completely different to the above :(

[chris at central-server-1 ~]$ sudo tcptraceroute -f 254 -m 255 -q 1 -w 3 
www.cisco.com
traceroute to www.cisco.com (72.163.4.161), 255 hops max, 40 byte packets
255  www1.cisco.com (72.163.4.161)  316.157 ms

[chris at central-server-1 ~]$ tcptraceroute -V
Modern traceroute for Linux, version 2.0.1, Feb 26 2009
Copyright (c) 2006  Dmitry Butskoy,   License: GPL

> Writing a perl module that calls a shell script that uses the 
> tcptraceroute executable really does not sound like the best approach. 
> In fact, when I wrote tcpping I was not aware there are much better ways 
> to measure tcp round trip times. I can recommend hping2 or hping3 (see 
> www.hping.org) which gives output like this:

Yes, I have used hping, and if I'd known it would be so much work to fix 
TCPPing.pm and tcpping to work on my system, I probably would have 
adapted the module to use hping instead :)

I think that I will do that now.

Cheers, Chris.
-- 
Aptivate | http://www.aptivate.org | Phone: +44 1223 760887
The Humanitarian Centre, Fenner's, Gresham Road, Cambridge CB1 2ES

Aptivate is a not-for-profit company registered in England and Wales
with company number 04980791.



More information about the smokeping-users mailing list