ICMP (Internet Control Message Protocol)


What is ICMP?

In this lesson, we will focus on ICMP Protocol. We will learn what is ICMP meaning, ICMP Header, ICMP Types and more on this network protocol. Internet Control Message Protocol is simply one of the Layer 3 Protocols. In IP networks, devices send Internet Control Message Protocol encapsulated in IP packet. The general role of ICMP Protocol is generate error packets about the network devices and it is used in troubleshooting activities. As a summary, it supports IP routing, diagnostics and error reporting.


Network engineers use ICMP Protocol generally for troubleshooting activities. The main two troubleshooting commands for network engineers , “ping” and “traceroute”, works with Internet Control Message Protocol . In every passed node, TTL value in the IP packet decrease one. And when it is 0, that node sends ICMP message to the sender, about the reachability of the destination.


Internet Control Message Protocol does not guaranteed the delivery. A hundred percent security is not required already.


You can use Subnetting Cheat Sheet for You Subnetting Calculations.


ICMP Message and ICMP Header Format

ICMP Message is sent as encapsulated in IP Packet. ICMP Packets uses fixed 8 bytes (64 bits) header and a variable size data part. The size of the data part is changed according to the used type and code values.


icmp-header-how, ICMP Header Format

In the ICMP Message, firstly there is an ICMP Header in the front. This Internet Control Message Protocol Message , consist of the below areas:

  • Type (8 bits)
  • Code (8 bits)
  • Checksum (16 bits)
  • Unused (32 bits)



We can devide ICMP Messages into two category accourding to their goals. These Message Categories are:

  • Error Messages
  • Informational / Query Messages


You can Practice On Various Network Topologies With Packet Tracer Labs Page!


ICMP Type And Code Fields

ICMP Header has three main areas as we mentione above: Type, Code and Checksome. Here;

  • Type” is the format of DHCP Message.
  • Code” is a detailed description of DHCP Message.


What are these ICMP Type and Code values? Let’s see firtly Type values and their meanings. And then we will talk about the ICMP Code values. The Type values and Internet Control Message Protocol messages are below:



0 Echo reply
3 Destination unreachable
4 Source quench
5 Redirect
8 Echo
9 Router advertisement
10 Router selection
11 Time exceeded
12 Parameter problem
13 Timestamp
14 Timestamp reply
15 Information request
16 Information reply
17 Address mask request
18 Address mask reply
30 Traceroute

ICMP Types and ICMP Messages Table, Internet Control Message Protocol


ICMP Type 3: Destination Unreachable Codes

ICMP Code values give detailed information about the error case. One of these error type is Destination Unreachable. ICMP Type 3 Destination Unreachable Codes and descriptions are given below:


Destination Unreachable Code
0 Net is unreachable
1 Host is unreachable
2 Protocol is unreachable
3 Port is unreachable
4 Fragmentation is needed and Don’t Fragment was set
5 Source route failed
6 Destination network is unknown
7 Destination host is unknown
8 Source host is isolated
9 Communication with destination network is administratively prohibited
10 Communication with destination host is administratively prohibited
11 Destination network is unreachable for type of service
12 Destination host is unreachable for type of service
13 Communication is administratively prohibited
14 Host precedence violation
15 Precedence cutoff is in effect


ICMP Destination Unreachable, ICMP Codes and Meanings Table, Internet Control Message Protocol



ICMP Type 5: Redirect Codes

Another one is Redirection used for reporting. ICMP Type 5 Redirection Codes and descriptions are given below:


Redirect Code
0 Redirect datagram for the network (or subnet)
1 Redirect datagram for the host
2 Redirect datagram for the type of service and network
3 Redirect datagram for the type of service and host



ICMP Type 9: Router Advertisement


Router Advertisement Code
0 Normal router advertisement
16 Does not route common traffic



ICMP Type 11: Time Exceeded Codes

Time Exceeded Code
0 Time to Live exceeded in transit
1 Fragment reassembly time exceeded



ICMP Type 12: Parameter Problem Codes

Parameter Problem Code
0 Pointer indicates the error
1 Missing a required option
2 Bad length



ICMP Echo Request Messages (Type 8) and ICMP Echo Reply Messages (Type 0) messages are two messages, that are sent and received in a successfull communication.


ICMPv4 and ICMPv6

ICMPv4 is the ICMP version that is used for IPv4. With the development of IPv6, ICMP also needed to enhanced to support IPv6. This enhancements provide ICMPv6.




ICMPv6 is the IPv6 enabled enhanced version of ICMPv4. Internet Control Message Protocol version 6 has similar functions that ICMPv4 supports. Beside these functions, it also has additional features.


AdditionalIy to the Internet Control Message Protocol version 4 functions, ICMPv6 supports:

  • IPv6 Neighbour Discovery Process
  • Multicast Listener Discovery Protocol
  • Path MTU Discovery


In an IPv6 header, if you see the value “58”, this is the ICMPv6 Packet.

In ICMPv6 Packet, like ICMPv4 there are different fields. These fields are similar to version 4. Let’s remember these fields:




We use ICMPv6 with IPv6 Neighbor Solicitation Messages. And we use IPv6 Neighbor Solicitation Message to determine the link-local address of a destination. Here, type 135 represents this IPv6 Neighbor Solicitation Messages. When this message reaches the destination, as a reply, destination sends a IPv6 Neighbor Advertisement Message. Here, the type is 136.


Internet Control Message Protocol version 6 is also used for IPv6 Router Advertisement Messages with type 134. If these messags are response to a Solicitation Message, the type 133 is used.


ICMPv6 Message Types

ICMPv6 has different message types for different message categories like ICMPv4. Here, we can divide ICMPv6 Messages into two category like version 4:

  1. Error Messages
  2. Informational Messages


Error Messages ad their type values are below:

  • Destination Unreachable (Type 1)
  • Packet Too Big (Type 2)
  • Time Exceeded (Type 3)
  • Parameter Problem (Type 4)


Informational Messages are also below:

  • Echo Request (Type 128)
  • Echo Reply (Type 129)


We can also talk about the IPv6 Neighbour Discovery and ICMPv6. In ICMPv6, there are different type values:

  • Router Solicitation (Type 133)
  • Router Advertisement (Type 134)
  • Neighbor Solicitation (Type 135)
  • Neighbor Advertisement (Type 136)
  • Redirect (Type 137)


Like ICMPv4, ICMPv6 also has the Code values. You can also check the code values of these different types below:



ICMPv6 Error Messages

Type Code
Value Meaning Value Meaning
1 Destination unreachable 0 no route to destination
1 communication with destination administratively prohibited
2 beyond scope of source address
3 address unreachable
4 port unreachable
5 source address failed ingress/egress policy
6 reject route to destination
7 Error in Source Routing Header
2 Packet too big 0
3 Time exceeded 0 hop limit exceeded in transit
1 fragment reassembly time exceeded
4 Parameter problem 0 erroneous header field encountered
1 unrecognized Next Header type encountered
2 unrecognized IPv6 option encountered



ICMPv6 Informational Messages

128 Echo Request 0
129 Echo Reply 0
130 Multicast Listener Query (MLD) 0 There are two subtypes of Multicast Listener Query messages:

  • General Query, used to learn which multicast addresses have listeners on attached link.
  • Multicast-Address-Specific Query, used to learn if a particular multicast address has any listeners on attached link.
138 Router Renumbering 0 Router Renumbering Command
1 Router Renumbering Result
255 Sequence Number Reset
139 ICMP Node Information Query 0 The Data field contains an IPv6 address which is the Subject of this Query.
1 The Data field contains a name which is the Subject of this Query, or is empty, as in the case of a NOOP.
2 The Data field contains an IPv4 address which is the Subject of this Query.
140 ICMP Node Information Response 0 A successful reply.
1 The Responder refuses to supply the answer.
2 The Qtype of the Query is unknown to the Responder.

ICMPv6 Error Messages, ICMPv6 Type, Code and Description, Internet Control Message Protocol version 6

Informational Messages, ICMPv6 Type, Code and Description, Internet Control Message Protocol version 6

Neighbour Discovery, ICMPv6 Type, Code and Description, Internet Control Message Protocol version 6



ICMP Frequently Asked Questions

What is the main purpose of ICMP?

The main purpose of Internet Control Message Protocol is to check data transfer. It check if the data reach its exact destination at the right time or not.


What is the purpose of ICMP messages?

The purpose of ICMP messages is to give information about IP packet processing. This is basically a feedback mechanism. We can check if our ip packet is sent to the destination or not with these messages. This messages are also used for topology change information. If there is a topology change in the network, other devices are informed with these messages.



Is ICMP used for ping?

Sure, Internet Control Message Protocol is used for ping. Another usage of this protocol is with traceroute command. When we need to check the reachability of any destination, we use ping command. In other words, we ping the destination. This means that, our device will send ICMP Echo Request to the destination and receive ICMP Echo Reply from that device if the destination is reachable.



What is the port number of ICMP?

There is no specific port for Internet Control Message Protocol. But, this protocol uses types and codes. 



Where we use ICMP Protocol?

Internet Control Message Protocol is used on network devices that are layer 3 cabaple like routers, hosts. Any errors and updated on these devices are announced with this protocol.



In which layer does ICMP work?

Internet Control Message Protocol is a network layer, layer 3 protocol of OSI Reference Model. It works in layer 3 like IP, OSPF etc.


Lesson tags: icmp
Back to: CCNA 200-301 > Network Fundamentals

Leave a Reply

Your email address will not be published. Required fields are marked *

CCNA 200-301