ICMP (Internet Control Message Protocol) is a part of IP layer. ICMP messages are transmitted within IP datagrams. An IP datagram consists of an ICMP message with IP header.
ICMP communicates either error messages or query messages. To communicate a message it has a type field and a code field. A type field consists of 15 different values viz. 0, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, to identify the type of ICMP message and a code field to specify the condition following the type. e.g. An echo request (ping request) has a type field value 8 and a code field value 0.