0% found this document useful (0 votes)
20 views

Internet Control Message Protocol

ICMP is a network layer protocol used for error reporting and network diagnosis. It works by sending and receiving datagrams with an IP header and ICMP header containing fields for type, code, and checksum. Common ICMP messages include echo requests/replies used for ping, time exceeded messages sent when TTL reaches 0, and destination unreachable messages sent if a packet cannot be delivered.

Uploaded by

Beryl Nisha
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Internet Control Message Protocol

ICMP is a network layer protocol used for error reporting and network diagnosis. It works by sending and receiving datagrams with an IP header and ICMP header containing fields for type, code, and checksum. Common ICMP messages include echo requests/replies used for ping, time exceeded messages sent when TTL reaches 0, and destination unreachable messages sent if a packet cannot be delivered.

Uploaded by

Beryl Nisha
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Internet Control Message Protocol (ICMP)

Internet Control Message Protocol (ICMP) is a network layer protocol that is used to diagnose
communication errors and perform network diagnostics. ICMP is a supporting protocol that
works with IP to provide error control and operational information.

🔵What are the uses of ICMP?

ICMP has two main uses:

▶️Error reporting: ICMP sends messages from the receiver to the sender when data does not
come through as it should. For example, if a packet is too large for the receiver, the receiver will
drop the packet and reply back with an ICMP message to the sender.

▶️Network diagnosis: ICMP is used to perform network diagnosis by using tools like ping and
traceroute. Ping is a simple kind of traceroute that sends an echo-request message to a
destination and measures the time taken for the echo-reply message to come back.

🔵How does ICMP work?

ICMP works by sending and receiving datagrams that contain an IP header and an ICMP header.
The ICMP header has three fields:

▶️Type: This field specifies the kind of message, such as echo-request, echo-reply, time exceeded,
destination unreachable, etc. There are different types of messages for different purposes.

▶️Code: This field provides more details about the type of message, such as the reason for
destination unreachable or the type of parameter problem.

▶️Checksum: This field is used to verify the integrity of the ICMP header and data. It is calculated
by adding all 16-bit words in the header and data and taking the one's complement of the sum.

The ICMP header may also contain additional data depending on the type of message. For
example, an echo-request message may contain a sequence number and a timestamp to
measure round-trip time.

🔵 What are some examples of ICMP messages?

Some common ICMP messages are:

▶️Echo-request and echo-reply: These messages are used by ping to test connectivity and
latency between two devices. The sender sends an echo-request message with a sequence
number and a timestamp, and the receiver sends back an echo-reply message with the same
sequence number and timestamp. The sender can then calculate the round-trip time by
subtracting the timestamp in the echo-reply from the timestamp in the echo-request.
▶️Time exceeded: This message is sent by a router when it discards a packet because its time to
live (TTL) field has reached zero. The TTL field is decremented by one at every hop along the
route, and when it reaches zero, it means that the packet has been in transit for too long and may
be looping. The time exceeded message informs the sender that the packet did not reach its
destination and may indicate a routing problem.

▶️Destination unreachable: This message is sent by a router or a host when it cannot deliver a
packet to its destination for some reason. There are different codes for different reasons, such as
network unreachable, host unreachable, protocol unreachable, port unreachable, etc.

You might also like