I am studying about ICMP procotol and the ping program that uses ICMP messages. But I am not sure which ICMP messages are exactly used by the ping program

I know that

echo reply
echo request
time exceeded - TTL

But I am not sure if destination unreachable is used, or any other ICMP message


1 Answer 1


If issuing the command:


Then the local device generates an ICMP Echo (Type 8, code 0) which is sent outbound. The device then waits to receive an ICMP Echo Reply (Type 0, code 0).

If the packets TTL expires before reaching its destination, then an ICMP Time Exceeded (Type 11, code 0) packet is sent to the originator of the ICMP Echo.

When using Traceroute and the ICMP packet reaches the final destination, normally a ICMP Port Unreachable (Type 3, code 3) will be sent back towards the source.

If a device in the forwarding path does not know how to route towards the destination it will send an ICMP Net Unreachable (Type 3, code 0). This is true no matter what kind of packet was sent from the beginning, ICMP or not.

Note that many administrators filter ICMP (often on lacking knowledge) so that ICMP packets may not be received back.

  • so, the destination unreachable is indeed used by ping?
    – Mark
    Apr 6, 2014 at 12:42
  • Not really. Echo and Echo reply are the only ones used unless a device does not know how to forward the packet. It's not the job of ping to generate that message, it would be up to the Network Operating System (NOS) or the IP stack of a that device.
    – Daniel Dib
    Apr 6, 2014 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.