Sie sind auf Seite 1von 9

Internet Control Message Protocol (ICMP) messages

1. ICMP segment structure


2. [edit] Header

The ICMP header starts after the IPv4 header. All ICMP packets will have an 8 byte header and
variable sized data section. The first 4 bytes of the header will be consistent. The first byte is for
the ICMP type. The second byte is for the ICMP code. The third and fourth bytes are a checksum
of the entire ICMP message. The contents of the remaining 4 bytes of the header will vary based
on the ICMP type and code.[1]

ICMP error messages contain a data section that includes the entire IP header plus the first 8
bytes of the packet that generated the error message. The ICMP datagram is then encapsulated in
a new IP datagram.[1]

Bits 0-7 8-15 16-23 24-31


0 Type Code Checksum
32 Rest of Header

• Type - ICMP type as specified below.


• Code - Subtype to the given type.
• Checksum - Error checking data. Calculated from the ICMP header+data, with value 0
for this field. The algorithm is the same as the header checksum for IPv4.
• Rest of Header - Four byte field. Will vary based on the ICMP type and code.

3. [edit] Padding data

Padding data follows the ICMP header (in octets):

• The Linux "ping" utility pads ICMP to a total size of 56 bytes in addition to the 8 byte
header.
• Windows "ping.exe" pads, by default, to a total size of 32 bytes in addition to the 8 byte
header.

4. [edit] List of permitted control messages (incomplete list)

Type Code Description


0 - Echo Reply[3] 0 Echo reply (used to ping)
1 and 2 Reserved
3 - Destination 0 Destination network unreachable
Unreachable[4] 1 Destination host unreachable
2 Destination protocol unreachable
3 Destination port unreachable
4 Fragmentation required, and DF flag set
5 Source route failed
6 Destination network unknown
7 Destination host unknown
8 Source host isolated
9 Network administratively prohibited
10 Host administratively prohibited
11 Network unreachable for TOS
12 Host unreachable for TOS
13 Communication administratively prohibited
4 - Source Quench 0 Source quench (congestion control)
0 Redirect Datagram for the Network
1 Redirect Datagram for the Host
5 - Redirect Message
2 Redirect Datagram for the TOS & network
3 Redirect Datagram for the TOS & host
6 Alternate Host Address
7 Reserved
8 - Echo Request 0 Echo request
9 - Router Advertisement 0 Router Advertisement
10 - Router Solicitation 0 Router discovery/selection/solicitation
0 TTL expired in transit
11 - Time Exceeded[5]
1 Fragment reassembly time exceeded
0 Pointer indicates the error
12 - Parameter Problem: Bad
1 Missing a required option
IP header
2 Bad length
13 - Timestamp 0 Timestamp
14 - Timestamp Reply 0 Timestamp reply
15 - Information Request 0 Information Request
16 - Information Reply 0 Information Reply
17 - Address Mask Request 0 Address Mask Request
18 - Address Mask Reply 0 Address Mask Reply
19 Reserved for security
20 through 29 Reserved for robustness experiment
30 - Traceroute 0 Information Request
31 Datagram Conversion Error
32 Mobile Host Redirect
33 Where-Are-You (originally meant for IPv6)
34 Here-I-Am (originally meant for IPv6)
35 Mobile Registration Request
36 Mobile Registration Reply
37 Domain Name Request
38 Domain Name Reply
SKIP Algorithm Discovery Protocol, Simple Key-
39
Management for Internet Protocol
40 Photuris, Security failures
ICMP for experimental mobility protocols such as Seamoby
41
[RFC4065]
42 through 255 Reserved

Internet Control Message Protocol (ICMP) Parameters

(last updated 2010-04-22)

Registries included below:


- ICMP Type Numbers
- Code Fields
- ICMP Extension Object Classes

Registry Name: ICMP Type Numbers


Reference: [RFC2939]
Registration Procedures: IESG Approval or Standards Action

Note:
The Internet Control Message Protocol (ICMP) has many messages that
are identified by a "type" field.

Registry:
Type Name Reference
---- ------------------------- ---------
0 Echo Reply [RFC792]
1 Unassigned [JBP]
2 Unassigned [JBP]
3 Destination Unreachable [RFC792]
4 Source Quench [RFC792]
5 Redirect [RFC792]
6 Alternate Host Address [JBP]
7 Unassigned [JBP]
8 Echo [RFC792]
9 Router Advertisement [RFC1256]
10 Router Solicitation [RFC1256]
11 Time Exceeded [RFC792]
12 Parameter Problem [RFC792]
13 Timestamp [RFC792]
14 Timestamp Reply [RFC792]
15 Information Request [RFC792]
16 Information Reply [RFC792]
17 Address Mask Request [RFC950]
18 Address Mask Reply [RFC950]
19 Reserved (for Security) [Solo]
20-29 Reserved (for Robustness Experiment) [ZSu]
30 Traceroute [RFC1393]
31 Datagram Conversion Error [RFC1475]
32 Mobile Host Redirect [David Johnson]
33 IPv6 Where-Are-You [Bill Simpson]
34 IPv6 I-Am-Here [Bill Simpson]
35 Mobile Registration Request [Bill Simpson]
36 Mobile Registration Reply [Bill Simpson]
37 Domain Name Request [RFC1788]
38 Domain Name Reply [RFC1788]
39 SKIP [Markson]
40 Photuris [RFC2521]
41 ICMP messages utilized by experimental [RFC4065]
mobility protocols such as Seamoby
42-255 Reserved [JBP]

Registry Name: Code Fields


Reference: [RFC2939]
Registration Procedures: IESG Approval or Standards Action

Note:
Many of these ICMP types have a "code" field. Here we list the types
again with their assigned code fields.

Registry:
Type Name Reference
---- ------------------------- ---------
0 Echo Reply [RFC792]

Codes
0 No Code

1 Unassigned [JBP]

2 Unassigned [JBP]

3 Destination Unreachable [RFC792]

Codes
0 Net Unreachable [RFC792]
1 Host Unreachable [RFC792]
2 Protocol Unreachable [RFC792]
3 Port Unreachable [RFC792]
4 Fragmentation Needed and Don't [RFC792]
Fragment was Set [RFC792]
5 Source Route Failed [RFC792]
6 Destination Network Unknown [RFC1122]
7 Destination Host Unknown [RFC1122]
8 Source Host Isolated [RFC1122]
9 Communication with Destination [RFC1122]
Network is Administratively Prohibited
10 Communication with Destination Host is [RFC1122]
Administratively Prohibited
11 Destination Network Unreachable for Type [RFC1122]
of Service
12 Destination Host Unreachable for Type of [RFC1122]
Service
13 Communication Administratively Prohibited [RFC1812]
14 Host Precedence Violation [RFC1812]
15 Precedence cutoff in effect [RFC1812]
4 Source Quench [RFC792]

Codes
0 No Code

5 Redirect [RFC792]

Codes
0 Redirect Datagram for the Network (or subnet)
1 Redirect Datagram for the Host
2 Redirect Datagram for the Type of Service and Network
3 Redirect Datagram for the Type of Service and Host

6 Alternate Host Address [JBP]

Codes
0 Alternate Address for Host

7 Unassigned [JBP]

8 Echo [RFC792]

Codes
0 No Code

9 Router Advertisement [RFC1256]

Codes
0 Normal router advertisement [RFC3344]
16 Does not route common traffic [RFC3344]

10 Router Selection [RFC1256]

Codes
0 No Code

11 Time Exceeded [RFC792]

Codes
0 Time to Live exceeded in Transit
1 Fragment Reassembly Time Exceeded

12 Parameter Problem [RFC792]

Codes
0 Pointer indicates the error
1 Missing a Required Option [RFC1108]
2 Bad Length

13 Timestamp [RFC792]

Codes
0 No Code
14 Timestamp Reply [RFC792]

Codes
0 No Code

15 Information Request [RFC792]

Codes
0 No Code

16 Information Reply [RFC792]

Codes
0 No Code

17 Address Mask Request [RFC950]

Codes
0 No Code

18 Address Mask Reply [RFC950]

Codes
0 No Code

19 Reserved (for Security) [Solo]

20-29 Reserved (for Robustness Experiment) [ZSu]

30 Traceroute [RFC1393]

31 Datagram Conversion Error [RFC1475]

32 Mobile Host Redirect [David Johnson]

33 IPv6 Where-Are-You [Bill Simpson]

34 IPv6 I-Am-Here [Bill Simpson]

35 Mobile Registration Request [Bill Simpson]

36 Mobile Registration Reply [Bill Simpson]

39 SKIP [Markson]

40 Photuris [RFC2521]

Codes
0 = Bad SPI
1 = Authentication Failed
2 = Decompression Failed
3 = Decryption Failed
4 = Need Authentication
5 = Need Authorization

41-252 Unassigned
253 RFC3692-style Experiment 1 (*) [RFC4727]
254 RFC3692-style Experiment 2 (*) [RFC4727]

(*) It is only appropriate to use these values in explicitly-


configured experiments; they MUST NOT be shipped as defaults in
implementations. See RFC 3692 for details.

Registry Name: ICMP Extension Object Classes and Class Sub-types


Reference: [RFC4884]
Range Registration Procedures Notes
----------- ------------------------------
---------------------------------
0-246 First Come First Served
247-255 Private Use

Object
Class Value Class Name Reference
----------- -------------------------------------------- ---------
1 MPLS Label Stack Class [RFC4950]

Sub-types [RFC4950]
C-Type (Value)
0 Reserved [RFC4950]
1 Incoming MPLS Label Stack [RFC4950]
0x02-0xF6 Unassigned [RFC4950]
0xF7-0xFF Reserved for private use [RFC4950]

Allocation Policy: C-Type values for Class-num 1 are


assignable on a first-come-first-serve (FCFS) basis
[RFC2434].

2 Interface Information Object [RFC5837]

Sub-types [RFC5837]
C-Type (Bit Number)
0-1 Interface Role field [RFC5837]

Interface Roles
0 Incoming IP Interface [RFC5837]
1 Sub-IP Component of Incoming IP Interface
[RFC5837]
2 Outgoing IP Interface [RFC5837]
3 IP Next-hop [RFC5837]

2 Unallocated - allocatable with Standards Action


[RFC5837]
3 Unallocated - allocatable with Standards Action
[RFC5837]
4 ifIndex included [RFC5837]
5 IP Address Sub-object included [RFC5837]
6 Name Sub-object included [RFC5837]
7 MTU included [RFC5837]

REFERENCES
----------
[RFC792] Postel, J., "Internet Control Message Protocol", STD 5,
RFC 792, USC/Information Sciences Institute, September 1981.

[RFC950] Mogul, J., and J. Postel, "Internet Standard Subnetting


Procedure", STD 5, RFC 950, Stanford, USC/Information
Sciences Institute, August 1985.

[RFC1108] Kent, S., "U.S. Department of Defense Security Options for


the Internet Protocol", RFC 1108, November 1991.

[RFC1122] R. Braden, Ed., "Requirements for Internet Hosts --


Communication Layers", RFC 1122, October 1989.

[RFC1256] Deering, S., Editor, "ICMP Router Discovery Messages",


RFC 1256, Xerox PARC, September 1991.

[RFC1393] Malkin, G., "Traceroute Using an IP Option", RFC 1393,


Xylogics, Inc., January 1993.

[RFC1475] Ullmann, R., "TP/IX: The Next Internet", RFC 1475, Process
Software Corporation, June 1993.

[RFC1788] W. Simpson, "ICMP Domain Name Messages", RFC 1788, April 1995.

[RFC1812] Baker, F., "Requirements for IP Version 4 Routers", RFC 1812,


Cisco Systems, June 1995.

[RFC2434] T. Narten and H. Alvestrand, "Guidelines for Writing


an IANA Considerations Section in RFCs", RFC 2434, October 1998.

[RFC2521] P. Karn and W. Simpson, "ICMP Security Failures Messages",


RFC 2521, March 1999.

[RFC2939] R. Droms, "Procedures and IANA Guidelines for Definition of


New DHCP Options and Message Types", RFC 2939, September 2000.

[RFC3344] C. Perkins, Ed., "IP Mobility Support for IPv4", RFC 3344,
August 2002.

[RFC4065] J. Kempf, "Instructions for Seamoby and Experimental


Mobility Protocol IANA", RFC 4065, July 2005.

[RFC4727] B. Fenner, "Experimental values In IPv4, IPv6, ICMPv4, ICMPv6,


UDP and TCP Headers", RFC 4727, November 2006.

[RFC4884] R. Bonica, D. Gan, P. Nikander, D. Tappan and C. Pignataro,


"Extended ICMP to Support Multi-part Messages", RFC 4884,
April 2007.

[RFC4950] R. Bonica, D. Gan, D. Tappan and C. Pignataro, "ICMP Extensions


for
MultiProtocol Label Switching", RFC 4950, August 2007.

[RFC5837] A. Atlas, Ed., R. Bonica, Ed., C. Pignataro, Ed., JR. Rivers, N.


Shen,
"Extending ICMP for Interface and Next-hop Identification", RFC
5837,
April 2010.

PEOPLE
------
[JBP] Jon Postel, <postel&isi.edu>, September 1995.

[David Johnson]

[Markson] Tom Markson, <markson&osmosys.incog.com>, September 1995.

[Simpson] Bill Simpson, <Bill.Simpson&um.cc.umich.edu>, October 1995.

[Solo]

[ZSu] Zaw-Sing Su <ZSu&TSCA.ISTC.SRI.COM>

[]