Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
What are the types of ICMP message types?
Internet Control Message Protocol (ICMP) is a network layer protocol that reports errors and provides diagnostic information about network connectivity issues. ICMP messages are categorized into specific types, each identified by a unique type number and accompanied by detailed codes.
ICMP message types are divided into two main categories:
- Error Reporting Messages − Notify about network errors and problems
- Query Messages − Request and provide network status information
Error Reporting Messages
Error reporting messages notify the source when packets cannot be delivered or when network issues occur. The router or destination host generates these messages and sends them back to the source.
Destination Unreachable (Type 3)
This message occurs when a router cannot locate a path to deliver the packet to its intended destination. The packet is discarded, and this error message is sent back to the source host. Common codes include network unreachable, host unreachable, and port unreachable.
Redirect (Type 5)
Routers send redirect messages to inform hosts of a better route to reach a destination. When a gateway router receives a packet that should be sent through a different router on the same network, it forwards the packet and sends a redirect message to the source, allowing future packets to take the optimal path.
Time Exceeded (Type 11)
This message is generated when a packet's Time-to-Live (TTL) field reaches zero, indicating the packet has traveled through too many routers without reaching its destination. This prevents packets from circulating indefinitely in routing loops.
Query Messages
Query messages are used for network diagnostics and obtaining information about network devices. These messages typically come in request-reply pairs.
Echo Request (Type 8) & Echo Reply (Type 0)
The most common ICMP messages, used by the ping command. An echo request is sent to test connectivity, and the destination responds with an echo reply. This pair determines whether communication is possible between two hosts and measures round-trip time.
Timestamp Request (Type 13) & Timestamp Reply (Type 14)
These messages measure the time required for packets to travel between hosts. The timestamp request includes the sending time, and the reply contains both the original timestamp and the reply time, allowing calculation of network delay.
Common ICMP Message Types
| Type | Message | Category | Purpose |
|---|---|---|---|
| 0 | Echo Reply | Query | Response to ping request |
| 3 | Destination Unreachable | Error | Cannot reach destination |
| 5 | Redirect | Error | Better route available |
| 8 | Echo Request | Query | Ping command |
| 11 | Time Exceeded | Error | TTL expired |
Conclusion
ICMP message types are essential for network troubleshooting and error reporting. Error messages help identify connectivity problems, while query messages provide diagnostic capabilities like ping and network timing measurements.
