ICMP: (Internet Control Message Protocol)

What is ICMP?

ICMP Message format

ICMP Message types

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


What is ICMP?

<--- IP datagram --->

IP header ICMP header

ICMP message format

type (8-bit) code (8-bit) checksum (16-bit)

contents depends on type and code

Type - These 8 bits determine the ICMP message type a shown in the Table 1.

Code - These 8 bits determine the ICMP message code as shown in the Table 1.

Checksum - These 16-bits are the ones's complement of the one's complement sum of the ICMP message starting with the ICMP Type

 


Table 1. ICMP Message Types

Type Code Description Query Error

0

0

Echo reply (Ping reply)

*

 

3

 

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

Destination unreachable

Network unreachable

Host unreachable

Protocol unreachable

Port unreachable

Fragmentation needed but don’t fragment bit set

Source route failed

Destination network unknown

Destination host unknown

Source host isolated (obsolete)

Destination network administratively prohibited

Destination host administratively prohibited

Network unreachable for TOS

Host unreachable for TOS

Communication adminstratively prohibited by filtering

Host pecedence violation

Precedence cutoff in effect

 

*

*

*

*

*

*

*

*

*

*

*

*

*

*

*

*

4

0

Source quench (elementary flow control)  

*

5

 

0

1

2

3

Redirect

Redirect for network

Redirect for host

Redirect for type-of-service and network

Redirect for type-of-service and host

 

*

*

*

*

8

0

Echo request (Ping request)

*

 

9

10

0

0

Router advertisement

Router solicitation

*

*

 

11

 

0

1

Time exceeded:

Time-to-live equals 0 during transmit

Time-to-live equals 0 during re-assembly

 

*

*

12

 

0

1

Parameter problem:

IP header bad (catchall error)

Required option missing

 

*

*

13

14

0

0

Timestamp request

Timestamp reply

*

*

 

15

16

0

0

Information request

Information reply

*

*

 

17

18

0

0

Address mask request

Address mask reply

*

*

 

It can be seen from this table that Ping uses an ICMP message:
type 0, code 0 for a reply and
type 8, code 0 (for a request)


The full specifications for the ICMP messages (rfc792)
can be viewed from:
http://www.cis.ohio-state.edu/htbin/rfc/rfc792.html