Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Sep 1997 23:15:18 -0400
From:      Matthew Hunt <hunt@mph124.rh.psu.edu>
To:        Michael Richards <026809r@dragon.acadiau.ca>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Ping bug?
Message-ID:  <19970904231518.50368@mph124.rh.psu.edu>
In-Reply-To: <199709050210.XAA19228@dragon.acadiau.ca>; from Michael Richards on Thu, Sep 04, 1997 at 11:10:24PM -0300
References:  <199709050210.XAA19228@dragon.acadiau.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Sep 04, 1997 at 11:10:24PM -0300, Michael Richards wrote:

> I have an interesting problem with ping. I don't know if it is a bug or
> not.

I vote not. :-)

> The man page says that the -Q switch will shut it up when it comes to error
> messages.

It says it won't display ICMP error messages.  That doesn't mean
that it won't print other diagnostics.

> ping: sendto: Host is down
> ping: wrote lib226-1.acadiau.ca 64 chars, ret=-1
> 
> According to the man page, it shouldn't give me any errors. Even funnier, it
> seems to behave correctly if I just start off pinging it once. As soon as I
> try pinging a second time in a row, it spits out these error messages...

When you first start ping, and the destination is on the local network,
your box sends an ARP request to find out the destination's hardware
address.  If the destination is down, no responses are going to come
back, so ping doesn't print anything.

After a certain amount of failed ARP queries, your machine will add
an entry to the routing table saying that the host is unreachable, in
order to keep from sending out further ARP queries.  Ping will display
this "host unreachable" error; it is not the result of receiving an
ICMP error packet.  The "host unreachable" route is short-lived, and
looks like this:

Destination        Gateway            Flags     Refs     Use     Netif Expire
128.118.126.2      link#1             UHRLW       0       10       ed0     14

ICMP error messages include things like "TTL exceeded" and other
"unrechable" messages delevered by a router (i.e. the destination is
not on the local network).  Here's an example:

mph124:~$ ping 147.160.223.15
PING 147.160.223.15 (147.160.223.15): 56 data bytes
36 bytes from 205.219.15.229: Time to live exceeded
Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
 4  5  00 5400 d1dd   0 0000  01  01 7652 128.118.126.83  147.160.223.15 

Adding "-Q" would suppress displaying that ICMP error, received from
the router at 205.219.15.229.

Hope this helps.

-- 
Matthew Hunt <mph@pobox.com> * Think locally, act globally.
finger hunt@mph124.rh.psu.edu for PGP public key.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970904231518.50368>