PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Noms de domaine > comp.protocols.tcp-ip > Should ping timeout or hang if remote host down?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.protocols.tcp-ip TCP and IP network protocols.

Should ping timeout or hang if remote host down?

Réponse
 
LinkBack Outils de la discussion
Vieux 29/09/2006, 11h54   #1
mark.bergman@thales-is.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Should ping timeout or hang if remote host down?

What should ping do if the remote host is switched off? - should it
hang indefinitely, or timeout?

I have two Red Hat Linux machines that behave differently on pinging a
host that is down - one hangs indefinitely, and another comes back
after a couple of seconds with an error message.

(I am yet to play with ping options regarding number of packets, and
timeouts, just wondered what default behaviour ought to be, or if it
depends on network topology etc)

TIA
Mark

  Réponse avec citation
Vieux 29/09/2006, 12h27   #2
Mikael Bouillot
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Should ping timeout or hang if remote host down?

> What should ping do if the remote host is switched off? - should it hang
> indefinitely, or timeout?


I think the question doesn't apply, as ping is stateless. It sends ICMP
echo requests and prints out a line whenever it receives a packet.

If the received packet is an ICMP echo reply, it will print the "normal"
line. For any other packet (for example, an ICMP host unreachable or ICMP
ttl exceeded packet), it will print a corresponding line.

And if it doesn't receive any packet, it won't print any line.


Mikael
  Réponse avec citation
Vieux 29/09/2006, 12h39   #3
David Schwartz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Should ping timeout or hang if remote host down?


mark.bergman@thales-is.com wrote:

> I have two Red Hat Linux machines that behave differently on pinging a
> host that is down - one hangs indefinitely, and another comes back
> after a couple of seconds with an error message.


What error does it report? And does it terminate on the error?

DS

  Réponse avec citation
Vieux 29/09/2006, 13h15   #4
Karl Kleinpaste
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Should ping timeout or hang if remote host down?

mark.bergman@thales-is.com writes:
> I have two Red Hat Linux machines that behave differently on pinging a
> host that is down - one hangs indefinitely, and another comes back
> after a couple of seconds with an error message.


An educated guess says the first of those two hosts is running a quite
old release of RH -- probably 6.x or perhaps 7.x, my memory is fuzzy
on exactly when.

There was a bug in their ping as distributed then, which caused ping
to hang. It caused me grief because some network sanity-checking
scripts of mine depended on standard, historical ping behavior of
"ping -c3 some.host" in which ping returns with an error result after
getting dead air from the down machine.

Upgrade.
  Réponse avec citation
Vieux 30/09/2006, 00h42   #5
Barry Margolin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Should ping timeout or hang if remote host down?

In article <1159527243.538337.176550@k70g2000cwa.googlegroups .com>,
mark.bergman@thales-is.com wrote:

> What should ping do if the remote host is switched off? - should it
> hang indefinitely, or timeout?
>
> I have two Red Hat Linux machines that behave differently on pinging a
> host that is down - one hangs indefinitely, and another comes back
> after a couple of seconds with an error message.
>
> (I am yet to play with ping options regarding number of packets, and
> timeouts, just wondered what default behaviour ought to be, or if it
> depends on network topology etc)
>
> TIA
> Mark


It depends on the ping version and options.

With some versions of ping, the default behavior is to send up to 3
packets, and report success if any of them get a response, otherwise
report failure. So if the remote host is down, it will return an error
message.

With others, the default behavior is to send packets until you press
control-C, and display details about all the responses received. In
this case, if the remote host is down, it won't display anything.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
  Réponse avec citation
Vieux 30/09/2006, 03h58   #6
Jim Carlock
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Should ping timeout or hang if remote host down?

<mark.bergman@thales-is.com> wrote:
> What should ping do if the remote host is switched off? - should it
> hang indefinitely, or timeout?


Z:\>ping microsoft.com
Pinging microsoft.com [207.46.250.119] with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 207.46.250.119:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

Z:\>ping google.com

Pinging google.com [72.14.207.99] with 32 bytes of data:

Reply from 72.14.207.99: bytes=32 time=1618ms TTL=237
Reply from 72.14.207.99: bytes=32 time=283ms TTL=237
Reply from 72.14.207.99: bytes=32 time=637ms TTL=237
Reply from 72.14.207.99: bytes=32 time=540ms TTL=237

Ping statistics for 72.14.207.99:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 283ms, Maximum = 1618ms, Average = 769ms

Good luck.

- -
Jim Carlock
Post replies to the group.


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 05h25.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,14402 seconds with 14 queries