ICMP cooperates with TCP/IP which is Network layer, used to handle error-reporting messages and query messages between endpoints. An ICMP packet can diagnose the result of transmission failure. Its packets consist of several formats which are Type, Code and Checksum that are shown in the following figure. They indicate the purpose of the ICMP packet.