Home » Computer Networks

Types of ICMP Messages and ICMP Message Format

We will explain you about types of ICMP messages and ICMP (Internet Control Message Protocol) message format.
Submitted by Mahima Rao, on December 24, 2018

ICMP shares error reporting and devices status by messages. Messages created by ICMP are divided into 2 categories:

1) Error Reporting Messages

These are messages from which the ICMP reports to errors. The list of common error reporting messages is being given below.

  • Destination Unreachable (Code 3):
    If a router cannot locate the path for a packet, then in such an event the packet is discarded and the destination is sent to the destination unreachable message.
  • Source Quench (Code 4):
    As you know the IP does not have the flow control. The Sending device does not have any information about whether the speed forwarded by the data forwarded by the router forwarding and processing host is according to the host. The IP discards some packets when sending speed is high. In this situation ICMP provides flow control and sends source quench messages to source device.
  • Redirect (Code 5):
    Because routing is a dynamic process and only routers participate in it, so a host has information about only one router (gateway). So when this host sends a data, then the data will go through that router to the correct router. In this situation, gateway router redirection message will send so that the host's routing information can be updated and the host can send data directly to the correct router.
  • Time Exceeded (Code 11):
    A router uses the routing table to forward any packet. If the routing table is not correct and there are errors, then in such an event, the packet roaps only in the loop. To avoid this situation, every packet contains a time to live field. The value of this field decreases on every router. As soon as the value of this field is zero, this packet is discarded by the router. In this situation, the Time Exceeded message is sent to the router source.
  • Parameter Unintelligible (Code 12):
    If a router or a destination host packet finds a field empty, then discards that packet and sends the parameter unintelligible message to the source.

2) Query Messages

These are the messages from which the ICMP queries for the status of a host. The list of common query messages is being given below with their code.

  • Echo Request (Code 8) & Echo reply (code 0):
    This pair of Query Messages is used to diagnose problems in the network. Both of these messages determine whether two hosts can communicate with each other or not.
  • Time-stamp Request (Code 13) & Time stamp Reply (Code 14):
    The time it takes to travel a host from one host to another host is detected by time stamp request & reply messages.
  • Address Mask Request (Code 17) & Address Mask Reply (Code 18):
    A host may be aware of its own IP address but it is not necessary that it is aware of its own subnet mask. To know your subnet mask sends the address mask request to the host router and the router sends this host's subnet mask address as the mask reply message. If the host is aware of the router's address, then he sends the request directly to the router, otherwise this request is broadcast.

ICMP (Internet Control Message Protocol) Message Format

So far you learned about 2 types of messages sent by ICMP. Let's now try to know the format of ICMP messages. The format of the lower ICMP message is being showcased below:

Although ICMP header is different for each message type, 3 fields of the beginning are similar in all messages. The total size of these 3 fields is 4 byte. These fields are being given in detail.

  • Type:
    This defines the type of field message. For example, when doing any type of error report, the code related to that error is defined in this field. Similarly if there is a query message then this field will come in that query's code.
  • Code:
    For error messages, this defines the sub type of field error. For example, if the destination unreachable error has occurred, then the code field will indicate what type of destination is unreachable error such as network unreachable (code 0), host unreachable (code 1) or protocol unreachable (code 2) error etc. These sub types of Errors are also defined by codes.
  • Checksum:
    The checksum is calculated by the header and the data that is used to detect the errors.
  • Rest of the Header:
    As you know the ICMP message is encapsulated in the IP datagram. Rest of the header section in the ICMP message shows the remaining IP header.
  • Data:
    In the context of error messages, the packet in this section contains the complete information of the packet.





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.



Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.