INTERNET CONTROL MESSAGE PROTOCOL

Internet Protocol is specifically limited in scope to provide the functions necessary to deliver a package of bits (an internet datagram) from a source to a destination over an interconnected system of networks. IP is an unreliable mode of transmission of data. Occasionally a gateway or destination host will communicate with a source host, for example, to report an error in datagram processing. For such purposes this protocol, the Internet Control Message Protocol (ICMP), is used.nbsp; ICMP, uses the basic support of IP as if it were a higher level protocol, however, ICMP is actually an integral part of IP, and must be implemented by every IP module.ICMP messages are sent in several situations: for example, when a datagram cannot reach its destination, when the gateway does not have the buffering capacity to forward a datagram, and when the gateway can direct the host to send traffic on a shorter route.

The Internet Protocol is not designed to be absolutely reliable. The purpose of these control messages is to provide feedback about problems in the communication environment, not to make IP reliable.The higher level protocols that use IP must implement their own reliability procedures if reliable communication is required.The ICMP messages typically report errors in the processing of datagrams. To avoid the infinite regress of messages about messages etc., no ICMP messages are sent about ICMP messages. Also ICMP messages are only sent about errors in handling fragment zero of fragemented datagrams.

ICMP messages are sent using the basic IP header. The first octet of the data portion of the datagram is a ICMP type field; the value of this field determines the format of the remaining data.

Type of Service:- 0
Protocol ICMP = 1
1.) Destination Unreachable Message
Type:- 3
Code

0 = net unreachable;

1 = host unreachable;

2 = protocol unreachable;

3 = port unreachable;

4 = fragmentation needed and Don't Fragment bit set;

5 = source route failed.

2.) Time Exceeded Message
Type 11
Code

0 = time to live exceeded in transit ( If the gateway processing a datagram finds the time to live field is zero it must discard the datagram.)

1 = fragment reassembly time exceeded. (If a host reassembling a fragmented datagram cannot complete the reassembly due to missing fragments within its time limit)

3.) Parameter Problem Message
Type 12
Code

0 = pointer indicates the error.( If the gateway or host processing a datagram finds a problem with the header parameters such that it cannot complete processing) The pointer identifies the octet of the original datagram's header  where the error was detected

4.) Source Quench Message
Type 4
Code

0 = A gateway may discard internet datagrams if it does not have the buffer space needed to queue the datagrams for output to the next network on the route to the destination network.A destination host may also send a source quench message if datagrams arrive too fast to be processed. The source quench message is a request to the host to cut back the rate at which it is sending traffic to the internet destination.

5.) Redirect Message
Type 5
Code

0 = Redirect datagrams for the Network.

1 = Redirect datagrams for the Host.

2 = Redirect datagrams for the Type of Service and Network.

3 = Redirect datagrams for the Type of Service and Host. For datagrams with the IP source route options and the gateway address in the destination address field, a redirect message is not sent even if there is a better route to the ultimate destination than the next address in the source route.

6.) Echo or Echo Reply Message
Type

8 = for echo message;

0 = for echo reply message.
Code

0 = The data received in the echo message must be returned in the echo reply message.The identifier and sequence number may be used by the echo sender to aid in matching the replies with the echo requests.

7.) Timestamp or Timestamp Reply Message
Type

13 = for timestamp message;

14 = for timestamp reply message.
Code

0 = Originate Timestamp is the time the sender last touched the message before sending it, Receive Timestamp is the time the echoer first touched it on receipt, and Transmit Timestamp is the time the echoer last touched the message on sending it.

8.) Information Request or Information Reply Message
Type

15 = for information request message;

16 = for information reply message.
Code

0 = This message may be sent with the source network in the IP header source and destination address fields zero (which means "this" network). The replying IP module should send the reply with the addresses fully specified. This message is a way for a host to find out the number of the network it is on.

For more details on ICMP refers RFC-792