Ping (ICMP) is Layer 3 or Layer 4 Protocol?

Download PDF Version – Click Here

Video Post:

There is always a debate on is Ping (ICMP) a layer 3 or layer 4 protocol? If it is Layer 4 which protocol it uses TCP or UDP?

Ping is very common network utility to test the end to end connectivity between the two end points (can be machines, a router, etc). Ping utility uses ICMP protocol for its functioning.

ICMP is a Layer 3 protocol; it does not use any Layer 4 protocol for its functioning. It packs all its ICMP information under IP packet.

For test, I ping to my own website from my laptop – www.sakunsharma.in

Ping www.sakunsharma.in
Ping www.sakunsharma.in

 

So this ping generated following sequence of packets from my computer:

ICMP Packets
ICMP Packets

 

Now, let’s see first ICMP (ping) Echo request packet in detail:

ICMP Packet Detail 1
ICMP Packet Detail 1

 

From the above information we can see that ICMP do not use any Layer 4 protocol (TCP/UDP). It simply packs all ICMP information in ICMP header and packs that ICMP as data in Layer 3 IP Protocol and further in Layer 2 Ethernet and transmits.

So finally Ping (ICMP) is a Layer 3 Protocol.