Re: icmp command

Juergen Schoenwaelder (schoenw@gaertner.de)
Wed, 9 Jul 1997 01:23:47 +0200

dinesh@newsnet.com.au (Dinesh Pullat) said:

Dinesh> I tried command: icmp trace 10 $host
Dinesh> where host is the IP address of a host that was momentarily
Dinesh> down. Now, I expected it to return the last reachable host in
Dinesh> the chain (just like the normal traceroute) but, instead it
Dinesh> returned {0.0.0.0 -1}

Dinesh> I'm trying to run the above command and establish where it
Dinesh> fails so I know where on the network I must check.

The icmp trace command is not a full blown traceroute. It only sends
out a single ICMP echo request with a time to live set to 10 in your
case. The host does not respond (because it is down) and hence you do
not get an answer. If you want to find the last reachable host, you
have to write a loop which increments the time to live value:

set last ""
for {set i 1} {1} {incr i} {
set hop [icmp trace $i $host]
set rtt [lindex $hop 1]
if {$rtt < 0} {
return $last
}
set last [lindex $hop 0]
}

Note that sometimes you get no response from hosts somewhere on the
path so you would like to go on for a while to check if you really
found the end. Look at the traceroute scripts in the source code for
more examples.
Juergen

-- 
Juergen Schoenwaelder     <schoenw@gaertner.de>     (Tel: +49-531-23873-0)
Gaertner Datensysteme, Hamburger Strasse 273a, 38114 Braunschweig, Germany
--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.