- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Internet Control Message Protocol (ICMP)
Internet Control Message Protocol (ICMP) works in the network layer of the OSI model and the internet layer of the TCP/IP model. It is used to send control messages to network devices and hosts. Routers and other network devices monitor the operation of the network. When an error occurs, these devices send a message using ICMP. Messages that can be sent include "destination unreachable", "time exceeded", and "echo requests".
- ICMP is a network layer protocol.
- ICMP messages are not passed directly to the data link layer. The message is first encapsulated inside the IP datagram before going to the lower layer.
Types of ICMP messages
- Information Messages − In this message, the sender sends a query to the host or router and expects an answer. For example, A host wants to know if a router is alive or not.
- Error-reporting message − This message report problems that a router or a host (destination) may encounter when it processes an IP packet.
- Query Message − It helps a router or a network manager to get specific information from a router or another host.
|Error-Reporting Messages||3||Destination unreachable|
|Query Message||8 or 0||Echo request or reply|
|13 or 14||Timestamp request or reply|
|17 or 18||Address mask request or reply|
|10 or 9||Router Solicitation or advertisement|
- Source Quench − It requests to decrease the traffic rate of message sending from source to destination.
- Time Exceeded − When fragments are lost in a network the fragments hold by the router will be dropped and then ICMP will take the source IP from the discarded packet and inform the source, that datagram is discarded due to the time to live field reaches zero, by sending time exceeded message.
- Fragmentation Required − When a router is unable to forward a datagram because it exceeds the MTU of the next-hop network and the DF (Don't Fragment) bit is set, the router is required to return an ICMP Destination Unreachable message to the source of the datagram, with the Code indicating fragmentation is needed and DF (Don’t Fragment) set.
- Destination Unreachable − This error message indicates that the destination host, network, or port number that is specified in the IP packet is unreachable. This may happen due to the destination host device is down, an intermediate router is unable to find a path to forward the packet, and a firewall is configured to block connections from the source of the packet.
- Redirect Message − A redirect error message is used when a router needs to tell a sender that it should use a different path for a specific destination. It occurs when the router knows a shorter path to the destination.
ICMP Basic Error Message Format
A basic ICMP error message would have the following format −
- Type − The type field identifies the type of the message.
- Code − The code field in ICMP describes the purpose of the message.
- Checksum − The checksum field is used to validate ICMP messages.
- What is ICMP Protocol?
- What are the types of ICMP message types?
- Explain the Error Reporting Messages in ICMP Protocol
- Serial Line Internet Protocol (SLIP)
- Network Control Protocol (NCP)
- Link Control Protocol (LCP)
- Internet Protocol version 6 (IPv6) Header
- What is Invisible Internet Protocol (I2P)?
- What is Adaptive Internet Protocol (AIP)?
- Logical Link Control Adaptation Protocol (L2CAP)
- What is Media Gateway Control Protocol (MGCP)?
- What is the Server Message Block (SMB) Protocol?
- What is Transmission Control Protocol (TCP) in Computer Network?
- What are the Stream Control Transmission Protocol (SCTP) services?
- Protocol and Protocol Hierarchies