<s>
ping	B-Protocol
is	O
a	O
computer	B-Architecture
network	I-Architecture
administration	O
software	B-Application
utility	I-Application
used	O
to	O
test	O
the	O
reachability	O
of	O
a	O
host	B-Device
on	O
an	O
Internet	B-Protocol
Protocol	I-Protocol
(	O
IP	O
)	O
network	O
.	O
</s>
<s>
Ping	B-Protocol
measures	O
the	O
round-trip	O
time	O
for	O
messages	O
sent	O
from	O
the	O
originating	O
host	B-Device
to	O
a	O
destination	O
computer	O
that	O
are	O
echoed	O
back	O
to	O
the	O
source	O
.	O
</s>
<s>
The	O
name	O
comes	O
from	O
active	O
sonar	B-Application
terminology	O
that	O
sends	O
a	O
pulse	B-Algorithm
of	O
sound	O
and	O
listens	O
for	O
the	O
echo	B-Protocol
to	O
detect	O
objects	O
under	O
water	O
.	O
</s>
<s>
Ping	B-Protocol
operates	O
by	O
means	O
of	O
Internet	B-Protocol
Control	I-Protocol
Message	I-Protocol
Protocol	I-Protocol
(	O
ICMP	B-Protocol
)	O
packets	B-Protocol
.	O
</s>
<s>
Pinging	O
involves	O
sending	O
an	O
ICMP	B-Protocol
echo	I-Protocol
request	I-Protocol
to	O
the	O
target	O
host	B-Device
and	O
waiting	O
for	O
an	O
ICMP	B-Protocol
echo	I-Protocol
reply	I-Protocol
.	O
</s>
<s>
The	O
program	O
reports	O
errors	O
,	O
packet	B-Protocol
loss	I-Protocol
,	O
and	O
a	O
statistical	O
summary	O
of	O
the	O
results	O
,	O
typically	O
including	O
the	O
minimum	O
,	O
maximum	O
,	O
the	O
mean	O
round-trip	O
times	O
,	O
and	O
standard	B-General_Concept
deviation	I-General_Concept
of	O
the	O
mean	O
.	O
</s>
<s>
The	O
command-line	O
options	O
of	O
the	O
ping	B-Protocol
utility	I-Protocol
and	O
its	O
output	O
vary	O
between	O
the	O
numerous	O
implementations	O
.	O
</s>
<s>
Many	O
systems	O
provide	O
a	O
companion	O
utility	O
ping6	B-Protocol
,	O
for	O
testing	O
on	O
Internet	B-Protocol
Protocol	I-Protocol
version	I-Protocol
6	I-Protocol
(	O
IPv6	B-Protocol
)	O
networks	O
,	O
which	O
implement	O
ICMPv6	B-Protocol
.	O
</s>
<s>
The	O
ping	B-Protocol
utility	I-Protocol
was	O
written	O
by	O
Mike	O
Muuss	O
in	O
December	O
1983	O
during	O
his	O
employment	O
at	O
the	O
Ballistic	O
Research	O
Laboratory	O
,	O
now	O
the	O
US	O
Army	O
Research	O
Laboratory	O
.	O
</s>
<s>
A	O
remark	O
by	O
David	O
Mills	O
on	O
using	O
ICMP	B-Protocol
echo	I-Protocol
packets	B-Protocol
for	O
IP	O
network	O
diagnosis	O
and	O
measurements	O
prompted	O
Muuss	O
to	O
create	O
the	O
utility	O
to	O
troubleshoot	O
network	O
problems	O
.	O
</s>
<s>
The	O
author	O
named	O
it	O
after	O
the	O
sound	O
that	O
sonar	B-Application
makes	O
,	O
since	O
its	O
methodology	O
is	O
analogous	O
to	O
sonar	B-Application
's	O
echolocation	O
.	O
</s>
<s>
The	O
backronym	O
Packet	B-Protocol
InterNet	I-Protocol
Groper	I-Protocol
for	O
PING	B-Protocol
has	O
been	O
used	O
for	O
over	O
30	O
years	O
,	O
and	O
although	O
Muuss	O
says	O
that	O
from	O
his	O
point	O
of	O
view	O
PING	B-Protocol
was	O
not	O
intended	O
as	O
an	O
acronym	O
,	O
he	O
has	O
acknowledged	O
Mills	O
 '	O
expansion	O
of	O
the	O
name	O
.	O
</s>
<s>
The	O
first	O
released	O
version	O
was	O
public	B-Application
domain	I-Application
software	I-Application
;	O
all	O
subsequent	O
versions	O
have	O
been	O
licensed	O
under	O
the	O
BSD	B-Operating_System
license	I-Operating_System
.	O
</s>
<s>
Ping	B-Protocol
was	O
first	O
included	O
in	O
4.3BSD	B-Operating_System
.	O
</s>
<s>
The	O
FreeDOS	B-Application
version	O
was	O
developed	O
by	O
Erick	O
Engelke	O
and	O
is	O
licensed	O
under	O
the	O
GPL	B-License
.	O
</s>
<s>
Tim	O
Crawford	O
developed	O
the	O
ReactOS	B-Application
version	O
.	O
</s>
<s>
It	O
is	O
licensed	O
under	O
the	B-License
MIT	I-License
License	I-License
.	O
</s>
<s>
RFC	O
1122	O
prescribes	O
that	O
any	O
host	B-Device
must	O
process	O
ICMP	B-Protocol
echo	I-Protocol
requests	I-Protocol
and	O
issue	O
echo	B-Protocol
replies	I-Protocol
in	O
return	O
.	O
</s>
<s>
The	O
following	O
is	O
the	O
output	O
of	O
running	O
ping	B-Protocol
on	O
Linux	O
for	O
sending	O
five	O
probes	O
(	O
1-second	O
interval	O
by	O
default	O
,	O
configurable	O
via	O
-i	O
option	O
)	O
to	O
the	O
target	O
host	B-Device
www.example.com	O
:	O
</s>
<s>
The	O
measurement	O
had	O
a	O
standard	B-General_Concept
deviation	I-General_Concept
of	O
0.748	O
ms.	O
</s>
<s>
In	O
cases	O
of	O
no	O
response	O
from	O
the	O
target	O
host	B-Device
,	O
most	O
implementations	O
display	O
either	O
nothing	O
or	O
periodically	O
print	O
notifications	O
about	O
timing	O
out	O
.	O
</s>
<s>
Possible	O
ping	B-Protocol
results	O
indicating	O
a	O
problem	O
include	O
the	O
following	O
:	O
</s>
<s>
In	O
case	O
of	O
error	O
,	O
the	O
target	O
host	B-Device
or	O
an	O
intermediate	O
router	O
sends	O
back	O
an	O
ICMP	B-Protocol
error	O
message	O
,	O
for	O
example	O
host	B-Device
unreachable	O
or	O
TTL	O
exceeded	O
in	O
transit	O
.	O
</s>
<s>
In	O
addition	O
,	O
these	O
messages	O
include	O
the	O
first	O
eight	O
bytes	O
of	O
the	O
original	O
message	O
(	O
in	O
this	O
case	O
header	O
of	O
the	O
ICMP	B-Protocol
echo	I-Protocol
request	I-Protocol
,	O
including	O
the	O
quench	O
value	O
)	O
,	O
so	O
the	O
ping	B-Protocol
utility	I-Protocol
can	O
match	O
responses	O
to	O
originating	O
queries	O
.	O
</s>
<s>
Generic	O
composition	O
of	O
an	O
ICMP	B-Protocol
packet	B-Protocol
:	O
</s>
<s>
IPv4	O
Header	O
(	O
in	O
blue	O
)	O
:	O
protocol	O
set	O
to	O
1	O
(	O
ICMP	B-Protocol
)	O
and	O
Type	O
of	O
Service	O
set	O
to	O
0	O
.	O
</s>
<s>
ICMP	B-Protocol
Header	O
(	O
in	O
red	O
)	O
:	O
</s>
<s>
Checksum	O
(	O
16	O
bits	O
)	O
,	O
the	O
16-bit	O
one	O
's	O
complement	O
of	O
the	O
one	O
's	O
complement	O
sum	O
of	O
the	O
packet	B-Protocol
.	O
</s>
<s>
For	O
IPv4	O
,	O
this	O
is	O
calculated	O
from	O
the	O
ICMP	B-Protocol
message	O
starting	O
with	O
the	O
Type	O
field	O
(	O
the	O
IP	B-Protocol
header	I-Protocol
is	O
not	O
included	O
)	O
.	O
</s>
<s>
For	O
IPv6	B-Protocol
this	O
is	O
calculated	O
from	O
the	O
ICMP	B-Protocol
message	O
,	O
prepended	O
with	O
an	O
IPv6	B-Protocol
pseudo-header	O
.	O
</s>
<s>
Header	O
Data	O
(	O
32	O
bits	O
)	O
field	O
,	O
which	O
in	O
this	O
case	O
(	O
ICMP	B-Protocol
echo	I-Protocol
request	I-Protocol
and	O
replies	O
)	O
,	O
will	O
be	O
composed	O
of	O
an	O
identifier	O
(	O
16	O
bits	O
)	O
and	O
sequence	O
number	O
(	O
16	O
bits	O
)	O
.	O
</s>
<s>
ICMP	B-Protocol
Payload	O
:	O
payload	O
for	O
the	O
different	O
kind	O
of	O
answers	O
;	O
can	O
be	O
an	O
arbitrary	O
length	O
,	O
left	O
to	O
implementation	O
detail	O
.	O
</s>
<s>
However	O
,	O
the	O
packet	B-Protocol
including	O
IP	O
and	O
ICMP	B-Protocol
headers	O
must	O
be	O
less	O
than	O
the	O
maximum	B-Protocol
transmission	I-Protocol
unit	I-Protocol
of	O
the	O
network	O
or	O
risk	O
being	O
fragmented	B-Protocol
.	O
</s>
<s>
The	O
echo	B-Protocol
request	I-Protocol
(	O
ping	B-Protocol
)	O
is	O
an	O
ICMP/ICMP6	O
message	O
.	O
</s>
<s>
In	O
practice	O
,	O
most	O
Linux	O
systems	O
use	O
a	O
unique	O
identifier	O
for	O
every	O
ping	B-Protocol
process	O
,	O
and	O
sequence	O
number	O
is	O
an	O
increasing	O
number	O
within	O
that	O
process	O
.	O
</s>
<s>
The	O
echo	B-Protocol
reply	I-Protocol
is	O
an	O
ICMP	B-Protocol
message	O
generated	O
in	O
response	O
to	O
an	O
echo	B-Protocol
request	I-Protocol
;	O
it	O
is	O
mandatory	O
for	O
all	O
hosts	O
and	O
must	O
include	O
the	O
exact	O
payload	O
received	O
in	O
the	O
request	O
.	O
</s>
<s>
The	O
identifier	O
and	O
sequence	O
number	O
can	O
be	O
used	O
by	O
the	O
client	O
to	O
associate	O
each	O
echo	B-Protocol
request	I-Protocol
with	O
its	O
reply	O
.	O
</s>
<s>
The	O
payload	O
of	O
the	O
packet	B-Protocol
is	O
generally	O
filled	O
with	O
ASCII	B-Protocol
characters	I-Protocol
,	O
as	O
the	O
output	O
of	O
the	O
tcpdump	B-Protocol
utility	O
shows	O
in	O
the	O
last	O
32	O
bytes	O
of	O
the	O
following	O
example	O
(	O
after	O
the	O
eight-byte	O
ICMP	B-Protocol
header	O
starting	O
with	O
)	O
:	O
</s>
<s>
This	O
allows	O
ping	B-Protocol
to	O
compute	O
the	O
round	O
trip	O
time	O
in	O
a	O
stateless	B-Protocol
manner	O
without	O
needing	O
to	O
record	O
the	O
time	O
of	O
transmission	O
of	O
each	O
packet	B-Protocol
.	O
</s>
<s>
The	O
payload	O
may	O
also	O
include	O
a	O
magic	O
packet	B-Protocol
for	O
the	O
Wake-on-LAN	B-Protocol
protocol	O
,	O
but	O
the	O
minimum	O
payload	O
,	O
in	O
that	O
case	O
,	O
is	O
longer	O
than	O
shown	O
.	O
</s>
<s>
The	O
Echo	B-Protocol
Request	I-Protocol
typically	O
does	O
not	O
receive	O
any	O
reply	O
if	O
the	O
host	B-Device
was	O
sleeping	O
in	O
hibernation	O
state	O
,	O
but	O
the	O
host	B-Device
still	O
wakes	O
up	O
from	O
sleep	O
state	O
if	O
its	O
interface	O
is	O
configured	O
to	O
accept	O
wakeup	O
requests	O
.	O
</s>
<s>
If	O
the	O
host	B-Device
is	O
already	O
active	O
and	O
configured	O
to	O
allow	O
replies	O
to	O
incoming	O
ICMP	B-Protocol
Echo	I-Protocol
Request	I-Protocol
packets	B-Protocol
,	O
the	O
returned	O
reply	O
should	O
include	O
the	O
same	O
payload	O
.	O
</s>
<s>
This	O
may	O
be	O
used	O
to	O
detect	O
that	O
the	O
remote	O
host	B-Device
was	O
effectively	O
woken	O
up	O
,	O
by	O
repeating	O
a	O
new	O
request	O
after	O
some	O
delay	O
to	O
allow	O
the	O
host	B-Device
to	O
resume	O
its	O
network	O
services	O
.	O
</s>
<s>
If	O
the	O
host	B-Device
was	O
just	O
sleeping	O
in	O
low	O
power	O
active	O
state	O
,	O
a	O
single	O
request	O
wakes	O
up	O
that	O
host	B-Device
just	O
enough	O
to	O
allow	O
its	O
Echo	B-Protocol
Reply	I-Protocol
service	O
to	O
reply	O
instantly	O
if	O
that	O
service	O
was	O
enabled	O
.	O
</s>
<s>
The	O
host	B-Device
does	O
not	O
need	O
to	O
wake	O
up	O
all	O
devices	O
completely	O
and	O
may	O
return	O
to	O
low-power	O
mode	O
after	O
a	O
short	O
delay	O
.	O
</s>
<s>
Such	O
configuration	O
may	O
be	O
used	O
to	O
avoid	O
a	O
host	B-Device
to	O
enter	O
in	O
hibernation	O
state	O
,	O
with	O
much	O
longer	O
wake-up	O
delay	O
,	O
after	O
some	O
time	O
passed	O
in	O
low	O
power	O
active	O
mode	O
.	O
</s>
<s>
To	O
conduct	O
a	O
denial-of-service	O
attack	O
,	O
an	O
attacker	O
may	O
send	O
ping	B-Protocol
requests	O
as	O
fast	O
as	O
possible	O
,	O
possibly	O
overwhelming	O
the	O
victim	O
with	O
ICMP	B-Protocol
echo	I-Protocol
requests	I-Protocol
.	O
</s>
<s>
This	O
technique	O
is	O
called	O
a	O
ping	B-General_Concept
flood	I-General_Concept
.	O
</s>
<s>
Ping	B-Protocol
requests	O
to	O
multiple	O
addresses	O
,	O
ping	B-Protocol
sweeps	I-Protocol
,	O
may	O
be	O
used	O
to	O
obtain	O
a	O
list	O
of	O
all	O
hosts	O
on	O
a	O
network	O
.	O
</s>
