Recent from talks
Nothing was collected or created yet.
ICMPv6
View on Wikipedia| Communication protocol | |
General structure of ICMPv6 Messages | |
| Abbreviation | ICMPv6 |
|---|---|
| Purpose | Auxiliary Protocol for IPv6 |
| Introduction | December 1995 |
| OSI layer | Network layer |
| RFC(s) | 4443 |
| Internet protocol suite |
|---|
| Application layer |
| Transport layer |
| Internet layer |
| Link layer |
Internet Control Message Protocol version 6 (ICMPv6) is the implementation of the Internet Control Message Protocol (ICMP) for Internet Protocol version 6 (IPv6).[1] ICMPv6 is an integral part of IPv6 and performs error reporting and diagnostic functions.
ICMPv6 has a framework for extensions to implement new features. Several extensions have been published, defining new ICMPv6 message types as well as new options for existing ICMPv6 message types. For example, Neighbor Discovery Protocol (NDP) is a node discovery protocol based on ICMPv6 which replaces and enhances functions of ARP.[2] Secure Neighbor Discovery (SEND) is an extension of NDP with extra security. Multicast Listener Discovery (MLD) is used by IPv6 routers for discovering multicast listeners on a directly attached link, much like Internet Group Management Protocol (IGMP) is used in IPv4. Multicast Router Discovery (MRD) allows the discovery of multicast routers.
Message types and formats
[edit]ICMPv6 messages may be classified as error messages and information messages. ICMPv6 messages are transported by IPv6 packets in which the IPv6 Next Header value for ICMPv6 is set to the value 58.
The ICMPv6 message consists of a header and the protocol payload. The header contains only three fields: Type (8 bits), Code (8 bits), and Checksum (16 bits).
| Offset | Octet | 0 | 1 | 2 | 3 | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Octet | Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
| 0 | 0 | Type | Code | Checksum | |||||||||||||||||||||||||||||
| 4 | 32 | Message body | |||||||||||||||||||||||||||||||
| 8 | 64 | ||||||||||||||||||||||||||||||||
| ⋮ | ⋮ | ||||||||||||||||||||||||||||||||
- Type: 8 bits
- Specifies the type of the message. Values in the range from 0 to 127 (high-order bit is 0) indicate an error message, while values in the range from 128 to 255 (high-order bit is 1) indicate an information message.
- Code: 8 bits
- The Code field value depends on the message type and provides an additional level of message granularity.
- Checksum: 16 bits
- Provides a minimal level of integrity verification for the ICMP message. The checksum is calculated from the ICMP message (starting with the Type field), prepended with an IPv6 pseudo-header.[1] See below.
- Message body: Variable
- Contents depends on the message.
Types
[edit]Control messages are identified by the value in the type field. The code field gives additional context information for the message. Some messages serve the same purpose as the correspondingly named ICMP message types.
| Type | Code | ||
|---|---|---|---|
| Value | Meaning | Value | Meaning |
| ICMPv6 Error Messages | |||
| 1 | Destination unreachable | 0 | no route to destination |
| 1 | communication with destination administratively prohibited | ||
| 2 | beyond scope of source address | ||
| 3 | address unreachable | ||
| 4 | port unreachable | ||
| 5 | source address failed ingress/egress policy | ||
| 6 | reject route to destination | ||
| 7 | Error in Source Routing Header | ||
| 2 | Packet too big | 0 | |
| 3 | Time exceeded | 0 | hop limit exceeded in transit |
| 1 | fragment reassembly time exceeded | ||
| 4 | Parameter problem | 0 | erroneous header field encountered |
| 1 | unrecognized Next Header type encountered | ||
| 2 | unrecognized IPv6 option encountered | ||
| 100 | Private experimentation | ||
| 101 | Private experimentation | ||
| 127 | Reserved for expansion of ICMPv6 error messages | ||
| ICMPv6 Informational Messages | |||
| 128 | Echo Request | 0 | |
| 129 | Echo Reply | 0 | |
| 130 | Multicast Listener Query (MLD) | 0 |
There are two subtypes of Multicast Listener Query messages:
These two subtypes are differentiated by the contents of the Multicast Address field, as described in section 3.6 of RFC 2710 |
| 131 | Multicast Listener Report (MLD) | 0 | |
| 132 | Multicast Listener Done (MLD) | 0 | |
| 133 | Router Solicitation (NDP) | 0 | |
| 134 | Router Advertisement (NDP) | 0 | |
| 135 | Neighbor Solicitation (NDP) | 0 | |
| 136 | Neighbor Advertisement (NDP) | 0 | |
| 137 | Redirect Message (NDP) | 0 | |
| 138 | Router Renumbering[3] | 0 | Router Renumbering Command |
| 1 | Router Renumbering Result | ||
| 255 | Sequence Number Reset | ||
| 139 | ICMP Node Information Query | 0 | The Data field contains an IPv6 address which is the Subject of this Query. |
| 1 | The Data field contains a name which is the Subject of this Query, or is empty, as in the case of a NOOP. | ||
| 2 | The Data field contains an IPv4 address which is the Subject of this Query. | ||
| 140 | ICMP Node Information Response | 0 | A successful reply. The Reply Data field may or may not be empty. |
| 1 | The Responder refuses to supply the answer. The Reply Data field will be empty. | ||
| 2 | The Qtype of the Query is unknown to the Responder. The Reply Data field will be empty. | ||
| 141 | Inverse Neighbor Discovery Solicitation Message | 0 | |
| 142 | Inverse Neighbor Discovery Advertisement Message | 0 | |
| 143 | Multicast Listener Discovery (MLDv2) reports[4] | ||
| 144 | Home Agent Address Discovery Request Message | 0 | |
| 145 | Home Agent Address Discovery Reply Message | 0 | |
| 146 | Mobile Prefix Solicitation | 0 | |
| 147 | Mobile Prefix Advertisement | 0 | |
| 148 | Certification Path Solicitation (SEND) | ||
| 149 | Certification Path Advertisement (SEND) | ||
| 151 | Multicast Router Advertisement (MRD) | ||
| 152 | Multicast Router Solicitation (MRD) | ||
| 153 | Multicast Router Termination (MRD) | ||
| 155 | RPL Control Message | ||
| 160 | Extended Echo Request[5] | 0 | Request Extended Echo |
| 161 | Extended Echo Reply[5] | 0 | No Error |
| 1 | Malformed Query | ||
| 2 | No Such Interface | ||
| 3 | No Such Table Entry | ||
| 4 | Multiple Interfaces Satisfy Query | ||
| 200 | Private experimentation | ||
| 201 | Private experimentation | ||
| 255 | Reserved for expansion of ICMPv6 informational messages | ||
Note that the table above is not comprehensive. The current complete list of assigned ICMPv6 types can be found at this link: IANA: ICMPv6 Parameters.
Checksum
[edit]ICMPv6 provides a minimal level of message integrity verification by the inclusion of a 16-bit checksum in its header. The checksum is calculated starting with a pseudo-header of IPv6 header fields according to the IPv6 standard,[6] which consists of the source and destination addresses, the packet length and the next header field, the latter of which is set to the value 58. Following this pseudo header, the checksum is continued with the ICMPv6 message. The checksum computation is performed according to Internet protocol standards using 16-bit ones' complement summation, followed by a final ones' complement of the checksum itself and inserting it into the checksum field.[7] Note that this differs from the way it is calculated for IPv4 in ICMP, but is similar to the calculation done in TCP.
| Offset | Octet | 0 | 1 | 2 | 3 | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Octet | Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
| 0 | 0 | Source Address | |||||||||||||||||||||||||||||||
| 4 | 32 | ||||||||||||||||||||||||||||||||
| 8 | 64 | ||||||||||||||||||||||||||||||||
| 12 | 96 | ||||||||||||||||||||||||||||||||
| 16 | 128 | Destination Address | |||||||||||||||||||||||||||||||
| 20 | 160 | ||||||||||||||||||||||||||||||||
| 24 | 192 | ||||||||||||||||||||||||||||||||
| 28 | 224 | ||||||||||||||||||||||||||||||||
| 32 | 256 | ICMPv6 Length | |||||||||||||||||||||||||||||||
| 36 | 288 | Zeroes | Next Header (58) | ||||||||||||||||||||||||||||||
Format
[edit]The payload of an ICMPv6 message varies according to the type of message being sent. It begins at bit 32 immediately after the header described above. For some messages such as destination unreachable or time exceeded there is no defined message body.
| Bit offset | 0–7 | 8–15 | 16–31 | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 1 | Code | Checksum | |||||||||||||||||||||||||||||
| 32 | Unused | |||||||||||||||||||||||||||||||
| 64 | Message body (Variable Size) | |||||||||||||||||||||||||||||||
| Bit offset | 0–7 | 8–15 | 16–31 | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 3 | Code | Checksum | |||||||||||||||||||||||||||||
| 32 | Unused | |||||||||||||||||||||||||||||||
| 64 | Message body (Variable Size) | |||||||||||||||||||||||||||||||
Others define a use only for the first four bytes of the body with no other defined content:
| Bit offset | 0–7 | 8–15 | 16–31 | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2 | 0 | Checksum | |||||||||||||||||||||||||||||
| 32 | MTU | |||||||||||||||||||||||||||||||
| 64 | Message body (Variable Size) | |||||||||||||||||||||||||||||||
| Bit offset | 0–7 | 8–15 | 16–31 | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 4 | Code | Checksum | |||||||||||||||||||||||||||||
| 32 | Pointer | |||||||||||||||||||||||||||||||
| 64 | Message body (Variable Size) | |||||||||||||||||||||||||||||||
| Bit offset | 0–7 | 8–15 | 16–31 | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 128 | 0 | Checksum | |||||||||||||||||||||||||||||
| 32 | Identifier | Sequence Number | ||||||||||||||||||||||||||||||
| 64 | Data (Variable Size) | |||||||||||||||||||||||||||||||
| Bit offset | 0–7 | 8–15 | 16–31 | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 129 | 0 | Checksum | |||||||||||||||||||||||||||||
| 32 | Identifier | Sequence Number | ||||||||||||||||||||||||||||||
| 64 | Data (Variable Size) | |||||||||||||||||||||||||||||||
In the case of NDP messages the first four bytes are either reserved or used for flags/hoplimit. While the rest of the body has unspecified structured data:
| Bit offset | 0–7 | 8–15 | 16–31 | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 133 | 0 | Checksum | |||||||||||||||||||||||||||||
| 32 | Reserved | |||||||||||||||||||||||||||||||
| 64 | Options (Variable Size) | |||||||||||||||||||||||||||||||
| Bit offset | 0–7 | 8–15 | 16–31 | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 134 | 0 | Checksum | |||||||||||||||||||||||||||||
| 32 | Cur Hop Limit | Managed Address Flag | Other Configuration Flag | Reserved | Router Lifetime | |||||||||||||||||||||||||||
| 64 | Reachable Time | |||||||||||||||||||||||||||||||
| 96 | Retrans Time | |||||||||||||||||||||||||||||||
| 128 | Options (Variable Size) | |||||||||||||||||||||||||||||||
| Bit offset | 0–7 | 8–15 | 16–31 | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 135 | 0 | Checksum | |||||||||||||||||||||||||||||
| 32 | Reserved | |||||||||||||||||||||||||||||||
| 64 | Target Address (16 bytes) | |||||||||||||||||||||||||||||||
| 192 | Options (Variable Size) | |||||||||||||||||||||||||||||||
| Bit offset | 0–7 | 8–15 | 16–31 | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 136 | 0 | Checksum | ||||||||||||||||||||||||||||||
| 32 | From Router (R) | Solicited Flag(S) | Override(O) | Reserved | |||||||||||||||||||||||||||||
| 64 | Target Address (16 bytes) | ||||||||||||||||||||||||||||||||
| 192 | Options (Variable Size) | ||||||||||||||||||||||||||||||||
For a redirect the first bytes of the message body are reserved but not used. This is followed by a Target and destination address. Unspecified options can be attached to the end:
| Bit offset | 0–7 | 8–15 | 16–31 | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 137 | 0 | Checksum | |||||||||||||||||||||||||||||
| 32 | Reserved | |||||||||||||||||||||||||||||||
| 64 | Target Address (16 bytes) | |||||||||||||||||||||||||||||||
| 192 | Destination Address (16 bytes) | |||||||||||||||||||||||||||||||
| 320 | Options (Variable Size) | |||||||||||||||||||||||||||||||
Message processing
[edit]When an ICMPv6 node receives a packet, it must undertake actions that depend on the type of message. The ICMPv6 protocol must limit the number of error messages sent to the same destination to avoid network overloading. For example, if a node continues to forward erroneous packets, ICMP will signal the error to the first packet and then do so periodically, with a fixed minimum period or with a fixed network maximum load. An ICMP error message must never be sent in response to another ICMP error message.
References
[edit]- ^ a b A. Conta; S. Deering (March 2006). M. Gupta (ed.). Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification. Network Working Group. doi:10.17487/RFC4443. STD 89. RFC 4443. Internet Standard 89. Obsoletes RFC 2463. Updates RFC 2780. Updated by RFC 4884.
- ^ T. Mrugalski; M. Siodelski; B. Volz; A. Yourtchenko; M. Richardson; S. Jiang; T. Lemon; T. Winters (November 2018). Dynamic Host Configuration Protocol for IPv6 (DHCPv6). Internet Engineering Task Force. doi:10.17487/RFC8415. ISSN 2070-1721. RFC 8415. Proposed Standard. sec. 3. Obsoletes RFC 3315, 3633, 3736, 4242, 7083, 7283 and 7550.
- ^ M. Crawford (August 2000). Router Renumbering for IPv6. Network Working Group. doi:10.17487/RFC2894. RFC 2894. Proposed Standard.
- ^ R. Vida; L. Costa, eds. (June 2004). Multicast Listener Discovery Version 2 (MLDv2) for IPv6. Network Working Group. doi:10.17487/RFC3810. RFC 3810. Proposed Standard. Updates RFC 2710. Updated by RFC 4604.
- ^ a b R. Bonica; R. Thomas; J. Linkova; C. Lenart; M. Boucadair (February 2018). PROBE: A Utility for Probing Interfaces. Internet Engineering Task Force. doi:10.17487/RFC8335. ISSN 2070-1721. RFC 8335. Proposed Standard. Updates RFC 4884.
- ^ S. Deering; R. Hinden (July 2017). Internet Protocol, Version 6 (IPv6) Specification. Internet Engineering Task Force. doi:10.17487/RFC8200. STD 86. RFC 8200. Internet Standard 86. sec. 8.1. Obsoletes RFC 2460.
- ^ R. Braden; D. Borman; C. Partridge (September 1988). Computing the Internet Checksum. Network Working Group. doi:10.17487/RFC1071. RFC 1071. Informational. Updated by RFC 1141.
External links
[edit]ICMPv6
View on GrokipediaIntroduction
Definition and Purpose
ICMPv6, or Internet Control Message Protocol version 6, is a core supporting protocol within the IPv6 suite, assigned the Next Header value of 58 in the IPv6 header. It serves primarily to report errors encountered during the processing of IPv6 datagrams and to facilitate diagnostic functions essential for network operation. Unlike transport protocols, ICMPv6 operates at the network layer to convey control messages that help maintain the reliability and efficiency of IPv6 communications. The protocol's key purposes include delivering error messages, such as those indicating destination unreachable, packet too big, time exceeded, or parameter problems, which inform senders of issues in datagram transmission. It also supports informational and query messages, exemplified by echo request and echo reply, enabling network diagnostics like reachability testing. Furthermore, ICMPv6 underpins higher-level protocols by providing mechanisms for path maximum transmission unit (MTU) discovery through packet too big messages and neighbor discovery via specialized message types in the Neighbor Discovery Protocol (NDP). ICMPv6 plays a vital role in IPv6 network management, enabling troubleshooting of connectivity issues, notification of congestion, and support for IPv6-specific features such as stateless address autoconfiguration. These functions ensure robust error handling and adaptive routing in modern networks. Defined primarily in RFC 4443 (2006), ICMPv6 messages are encapsulated directly within IPv6 packets, without an intervening IP header, allowing seamless integration into the IPv6 protocol stack.Historical Development and Standards
ICMPv6 originated as an integral component of the IPv6 protocol suite, developed in the mid-1990s by the Internet Engineering Task Force (IETF) through its IP Next Generation (IPng) working group to provide error reporting and diagnostic functions tailored to IPv6, succeeding the ICMP protocol for IPv4. The IPng effort, formalized in recommendations published in early 1995, addressed the limitations of IPv4, including address exhaustion, by designing a new network layer protocol family that included ICMPv6 from the outset. The initial specification for ICMPv6 appeared in RFC 1885, published in December 1995, as part of the core IPv6 protocol documents. Key milestones in ICMPv6's standardization followed the evolution of IPv6 itself. Refinements to the protocol were incorporated in RFC 2463, released in December 1998, which updated the IPv6 specification and provided a more mature definition of ICMPv6 messages. This was superseded by RFC 4443 in March 2006, establishing the current baseline standard for ICMPv6 by clarifying message formats, processing rules, and integration requirements while obsoleting RFC 2463. Subsequent updates addressed specific enhancements, such as path MTU discovery mechanisms relying on ICMPv6's Packet Too Big message, initially detailed in RFC 1981 from August 1996 and further integrated with neighbor discovery in RFC 4861 from September 2007; extended echo request and reply options for advanced diagnostics were added in RFC 8335 in March 2018. More recent advancements have extended ICMPv6's role in modern IPv6 deployments. In November 2024, RFC 9685 introduced listener subscription options for IPv6 Neighbor Discovery Protocol, enabling efficient multicast and anycast address handling via ICMPv6 extensions. Complementing this, RFC 9673, published in October 2024, refined IPv6 hop-by-hop options processing procedures, ensuring ICMPv6 compatibility with emerging network behaviors. The Internet Assigned Numbers Authority (IANA) maintains the official registry for ICMPv6 parameters, assigning message types in the range 0-255, with types 0-127 designated for error messages and 128-255 for informational and query messages. Unlike its predecessor ICMPv4, ICMPv6 was engineered from the ground up to support IPv6's 128-bit address architecture and to remove reliance on broadcast mechanisms, instead leveraging multicast for functions like neighbor discovery.Protocol Fundamentals
Integration with IPv6
ICMPv6 messages are encapsulated directly within IPv6 packets, serving as the payload following the IPv6 header and any preceding extension headers, with the Next Header field set to the protocol number 58 to identify the ICMPv6 protocol.[4] Unlike some upper-layer protocols, the ICMPv6 checksum computation incorporates a pseudo-header derived from IPv6 header fields—such as source and destination addresses, payload length, and the value 58 in the Upper Layer Packet Length field—but does not include the full IPv6 header itself.[5] As an integral component of the IPv6 protocol suite, ICMPv6 is utilized by all IPv6 nodes, including hosts and routers, to perform essential error reporting and diagnostic functions, ensuring reliable network operation.[6] Every IPv6 implementation is required to fully support ICMPv6; this mandatory inclusion is necessary for basic IPv6 connectivity and functionality.[6] ICMPv6 interacts closely with IPv6 header mechanisms, including extension headers, fragmentation, and routing processes, to report errors such as reassembly timeouts via Time Exceeded messages or routing failures through Destination Unreachable messages.[7] It also enables critical features like Path MTU Discovery (PMTUD) by conveying Packet Too Big messages that inform senders of the maximum transmittable unit along a path, allowing dynamic adjustment of packet sizes to avoid fragmentation.[8] In processing IPv6 hop-by-hop options, routers may optionally generate ICMPv6 Parameter Problem messages (Code 2) when encountering unrecognized options in the Hop-by-Hop Options header, facilitating error reporting as defined in updated IPv6 procedures.[9] ICMPv6 leverages IPv6's Traffic Class field for prioritization of diagnostic messages and the Flow Label for identifying packet flows during transmission, ensuring these control messages receive appropriate handling within the network stack.Comparison to ICMPv4
ICMPv6 represents a significant evolution from ICMPv4, designed to address the architectural changes in IPv6 while maintaining the core purpose of error reporting and diagnostics. Like ICMPv4, which is required for all IPv4 implementations per RFC 1122, ICMPv6 is mandatory for all IPv6 nodes, ensuring consistent support for essential network functions across the protocol stack.[6][10] This integration stems from IPv6's streamlined design, where ICMPv6 messages are encapsulated directly within IPv6 packets using Next Header value 58, without the need for separate IP-layer checksums over the ICMP header, as IPv6 headers already include their own checksum for integrity. A key design improvement in ICMPv6 is the checksum calculation, which incorporates an IPv6 pseudo-header including the source and destination addresses, upper-layer packet length, and zero fields, providing enhanced protection against misdelivery compared to ICMPv4's checksum that covers only the ICMP message itself. This change eliminates vulnerabilities associated with excluding IP header fields and better suits IPv6's 128-bit addressing, allowing error messages to include full address information without truncation or fragmentation issues that could arise in ICMPv4 due to 32-bit limits. Additionally, ICMPv6 replaces IPv4's reliance on broadcast addresses for certain operations with multicast addressing, reducing network overhead and enabling more efficient group communications in IPv6 environments. Functionally, ICMPv6 expands beyond ICMPv4 by subsuming roles previously handled by separate protocols: Multicast Listener Discovery (MLD), which manages IPv6 multicast group memberships, uses ICMPv6 message types 130–132, effectively replacing the standalone Internet Group Management Protocol (IGMP) of IPv4. Similarly, the Neighbor Discovery Protocol (NDP) for address resolution and router discovery employs ICMPv6 types 133–137, supplanting the Address Resolution Protocol (ARP) and introducing capabilities like router advertisements that have no direct ICMPv4 equivalent. These expansions make ICMPv6 a more comprehensive control protocol, integral to IPv6's autoconfiguration and mobility features. ICMPv6 message types are not backward-compatible with ICMPv4, requiring distinct handling in dual-stack environments where IPv4 and IPv6 traffic coexist. For instance, ICMPv4's Type 3 (Destination Unreachable) message is mapped to ICMPv6 Type 1 with various codes (e.g., no route to destination as Code 0) or even Type 2 (Packet Too Big) for fragmentation-related issues, reflecting IPv6's end-to-end fragmentation model where routers do not fragment packets. Time Exceeded messages follow a similar pattern, with ICMPv4 Type 11 translating to ICMPv6 Type 3, but IPv6-specific codes address extended features like header extensions. In translation scenarios, such as stateless IP/ICMP conversion, these mappings ensure interoperability but highlight the protocols' structural divergences, necessitating protocol-specific processing to avoid errors.Message Structure
General Header Format
All ICMPv6 messages share a common fixed header format consisting of four octets, followed by a variable-length message body. This 4-byte header includes an 8-bit Type field, an 8-bit Code field, and a 16-bit Checksum field. The Type field determines the primary category and function of the message, with values ranging from 0 to 255; specifically, values 0 through 127 are reserved for error messages, which must not trigger the generation of additional error messages to prevent error loops, while values 128 through 255 are designated for informational or query messages, which may be nested within other messages. The Code field provides further specificity within a given Type, also spanning 0 to 255, allowing for subtypes or additional parameters relevant to the message's purpose. The Checksum field serves as the primary integrity mechanism, covering the entire ICMPv6 message (header and body) along with a pseudo-header derived from the enclosing IPv6 packet.[1] The message body follows the header and varies in length from 0 to 65,535 bytes, depending on the message type and requirements. For error messages, the body typically includes as much of the original invoking packet as possible—starting with the IPv6 header of the erroneous packet followed by subsequent payload bytes—to provide context for the error condition, though truncated if necessary to fit within the IPv6 packet's constraints. Informational messages may include arbitrary data or additional fields specific to their function, such as identifiers or sequence numbers. Unlike the header, the body lacks a dedicated length indicator; its size is instead inferred from the Payload Length field in the enclosing IPv6 header, which encompasses the entire ICMPv6 message. The overall ICMPv6 message, including header and body, is limited by the IPv6 path's minimum MTU of 1280 octets, ensuring compatibility across networks.[1] To illustrate the header structure: 0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | [Code](/page/Code) | [Checksum](/page/Checksum) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Message Body (variable)
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | [Code](/page/Code) | [Checksum](/page/Checksum) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Message Body (variable)
Checksum Calculation
The ICMPv6 checksum is a 16-bit one's complement value computed over the entire ICMPv6 message, including its header and body, prepended by a pseudo-header derived from the IPv6 header fields. This mechanism ensures the integrity of the message during transmission and verifies that it is destined for the correct recipient, incorporating IPv6 addresses to mitigate off-path attacks that could otherwise forge messages. Unlike the ICMPv4 checksum, which does not include IP addresses, the ICMPv6 approach integrates these elements directly into the computation for enhanced security.[11] The pseudo-header used in the checksum calculation is 40 bytes long and consists of the following fields, as defined for upper-layer protocols in IPv6:| Field | Size (bits) | Description |
|---|---|---|
| Source Address | 128 | IPv6 source address from the packet. |
| Destination Address | 128 | IPv6 destination address from the packet. |
| Upper-Layer Packet Length | 32 | Length of the ICMPv6 message (header plus body), equivalent to the IPv6 Payload Length minus any extension headers. |
| Zero | 24 | Set to zero. |
| Next Header | 8 | Set to 58, indicating ICMPv6. |
