21-2 ICMP
The IP protocol has no error-reporting or error-
correcting mechanism. The IP protocol also lacks a
mechanism for host and management queries. The
Internet Control Message Protocol (ICMP) has been
designed to compensate for the above two deficiencies.
It is a companion to the IP protocol.
Topics discussed in this section:
Types of Messages
Message Format
Error Reporting and Query
Debugging Tools
21.1
General format of ICMP messages
21.2
Types of Messages
ICMP messages are divided into two broad categories:
Error-reporting messages and
Query messages
Code Field
The code field specifies the reason for the particular message
type
Data Section
The data section in error messages carries information for finding the
original packet that had the error.
In query messages, the data section carries extra information based on the
type of the query.
Note
ICMP always reports error messages to
the original source.
21.4
Figure 21.9 Error-reporting messages
21.5
Note
Important points about ICMP error messages:
❏ No ICMP error message will be generated in
response to a datagram carrying an ICMP error
message.
❏ No ICMP error message will be generated for a
fragmented datagram that is not the first fragment.
❏ No ICMP error message will be generated for a
datagram having a multicast address.
❏ No ICMP error message will be generated for a
datagram having a special address such as
[Link] or [Link].
21.6
Figure 21.10 Contents of data field for the error messages
21.7
Figure 21.11 Redirection concept
21.8
Figure 21.12 Query messages
21.9
Echo Request and Reply
The echo-request and echo-reply messages are designed for diagnostic purposes.
Timestamp Request and Reply
Two machines (hosts or routers) can use the timestamp request and
timestamp reply messages to determine the round-trip time needed for an IP
datagram to travel between them. It can also be used to synchronize the
clocks in two machines
Address-Mask Request and Reply
A host may know its IP address, but it may not know the corresponding
mask.
Router Solicitation and Advertisement
a host that wants to send data to a host on another network needs to
know the address of routers connected to its own network.
checksum
In ICMP the checksum is calculated over the entire message (header and
data).
Figure 21.13 Encapsulation of ICMP query messages
21.11
Q: Explain General format of ICMP messages with diagram.
Q : What is Internet Control Message Protocol (ICMP) in Computer Networks
21-3 IGMP
The IP protocol can be involved in two types of
communication: unicasting and multicasting. The
Internet Group Management Protocol (IGMP) is one
of the necessary, but not sufficient, protocols that is
involved in multicasting. IGMP is a companion to the
IP protocol.
Topics discussed in this section:
Group Management
IGMP Messages and IGMP Operation
Encapsulation
Netstat Utility
21.13
Figure 21.16 IGMP message types
21.14
Figure 21.17 IGMP message format
21.15
Type
This 8-bit field defines the type of message, as shown in Table. The value
of the type is shown in both hexadecimal and binary notation.
Maximum Response Time
This 8-bit field defines the amount of time in which a query must be answered
Checksum This is a 16-bit field carrying the checksum. The checksum is
calculated over the 8-byte message.
Group address
The value of this field is 0 for a general query message. The value defines
the groupid (multicast address of the group) in the special query, the
membership report, and the leave report messages.
Figure 21.18 IGMP operation
21.17
IGMP operation
Joining a Group
Leaving a Group
Monitoring Membership
Delayed Response
21.18
Joining a Group
Note
In IGMP, a membership report is sent
twice, one after the other.
21.19
Monitoring Membership
Note
The general query message does not
define a particular group.