Write a brief note on ICMP (Internet Control Message Protocol) using its frame formats.


Q.) Write a brief note on ICMP (Internet Control Message Protocol) using its frame formats.

Subject: Computer Networks

Introduction to ICMP

The Internet Control Message Protocol (ICMP) is an integral part of IP, the Internet Protocol. It is used by network devices, like routers, to send error messages and operational information indicating success or failure when communicating with another IP address. ICMP is mainly used to send messages to indicate, for example, that a requested service is not available or that a host or router could not be reached.

ICMP Message Types

ICMP has several different types of messages that it can send. These include:

  1. Echo Reply (Type 0): This is the reply to an echo request. It is used to ping.

  2. Destination Unreachable (Type 3): This message is generated by the host or its inbound gateway to inform the client that the destination is unreachable for some reason.

  3. Source Quench (Type 4): This message is sent by a router to the host to request it to decrease the pace at which it's sending traffic to the internet destination.

  4. Redirect (Type 5): This message is sent by routers to hosts to suggest a better route.

  5. Echo Request (Type 8): This message is used to test the reachability of a host on an IP network and can be used to troubleshoot network issues. It is commonly known as a ping.

  6. Time Exceeded (Type 11): This message is sent by a host or router to indicate that a fragment of a datagram has not arrived in time and has been discarded, or that the datagram has been reassembled.

  7. Parameter Problem (Type 12): This message is sent if a node has encountered a problem while processing the IP header of a packet.

  8. Timestamp Request and Reply (Type 13 and 14): These messages are used to measure the time delay between hosts.

  9. Information Request and Reply (Type 15 and 16): These are obsolete types that were used to obtain the IP address of a network.

ICMP Frame Format

The ICMP message has a specific format. It is encapsulated within an IP datagram, with the ICMP message in the data section of the IP datagram. The ICMP header starts after the IP header and is identified by the IP protocol number '1'. The ICMP header has the following fields:

  • Type (8 bits): This field indicates the type of the message. The values range from 0 to 255.

  • Code (8 bits): This field gives more information about the type field. The values also range from 0 to 255.

  • Checksum (16 bits): This field is used for error-checking of the header. The checksum field is calculated by taking the 16-bit one's complement of the one's complement sum of the ICMP message starting with the Type field.

  • Identifier and Sequence Number (16 bits each): These fields are used by the Echo and Echo Reply messages to match the requests with the replies.

  • Data: This field contains the data of the ICMP message. The data can include a portion of the IP datagram that caused the ICMP error message to be generated.

Here is a table that shows the difference between the fields:

Field Purpose Example
Type Indicates the type of the message 0 for Echo Reply, 8 for Echo Request
Code Gives more information about the type 0 for network unreachable in Destination Unreachable message
Checksum Used for error-checking of the header Calculated value
Identifier Used by Echo and Echo Reply messages Any number
Sequence Number Used by Echo and Echo Reply messages Any number
Data Contains the data of the ICMP message Portion of the IP datagram

ICMP Error Reporting

ICMP is often used to report error messages. For example, if a datagram cannot reach its destination, the destination host sends a Destination Unreachable message back to the source host. This message contains the IP header and the first 8 bytes of the data from the datagram that caused the error. This allows the source host to identify the datagram that caused the error and take corrective action.

ICMP Query Messages

ICMP also supports query messages. These are typically used to diagnose network-related issues. The most common query message is the Echo Request and Echo Reply (ping). The source host sends an Echo Request to a destination host, which then replies with an Echo Reply. This allows the source host to determine whether the destination host is reachable and measure the round-trip time for packets to travel from the source to the destination and back.

Conclusion

ICMP is a crucial protocol in IP networks, providing error reporting and operational information that aids in troubleshooting and network operation. However, it also has its limitations and potential issues. For example, ICMP does not make IP reliable. It does not guarantee that all errors are reported or that ICMP error messages themselves will be delivered. Despite these limitations, ICMP remains a fundamental tool for maintaining and diagnosing IP networks.

Diagram: Not necessary for this answer.

Summary

ICMP (Internet Control Message Protocol) is an integral part of IP and is used by network devices to send error messages and operational information. It has different message types and a specific frame format.

Analogy

ICMP is like a messenger that delivers error messages and operational information between network devices, similar to how a postal service delivers mail between addresses.

Quizzes
Flashcards
Viva Question and Answers

Quizzes

What is the purpose of ICMP?
  • To send error messages and operational information
  • To establish a connection between devices
  • To encrypt data during transmission
  • To manage network traffic