2

Since ICMP and ICMPv6 have different IP protocol numbers, it's technically possible for an IPv4 host to receive an ICMPv6 packet or for an IPv6 host to receive an ICMP packet. Is the host's behavior in this case specified by any standard? I haven't seen anything in any RFC.

  • You cannot put ICMPv6 in an IPv4 packet because you cannot create the ICMPv6 pseudo-header for the required ICMPv6 checksum (the ICMP checksum is optional for IPv4, but required for IPv6) with an IPv4 packet header. – Ron Maupin May 4 at 21:02
2

RFC 8200 states that the "next header" field in IPv6 uses the same values as the "protocol" field in IPv4.

However, RFC 4443 states:

Every ICMPv6 message is preceded by an IPv6 header ... The ICMPv6 header is identified by a Next Header value of 58 ...

And RFC 792 states:

ICMP messages are sent using the basic IP header.
...
Version
4

I interpret these two statements in the way that ICMP packets are not only identified by the "protocol" or "next header" field, but that this protocol is identified by a logical AND combination of IP version and "protocol" / "next header" number.

This would mean that a "protocol" value of 58 in an IPv4 packet does not mean ICMPv6 and a "next header" value of 1 in an IPv6 packet does not mean ICMP(v4).

If this interpretation is true, you have to react the same way as if you received a packet with an unknown "protocol" or "next header" number.

1

ICMPv4 is encapsulated in an IPv4 packet, and ICMPv6 in IPv6. There is no way an IPv4-only host would receive and parse an IPv6 packet (and vice versa).

  • That's not true. The IP protocol number space is shared by both IPv4 and IPv6. While a legal host or router should never generate ICMP-in-IPv6 or ICMPv6-in-IPv4, a misbehaving host or router could, and a host implementation would still need to be able to handle that case. – joshlf May 4 at 19:38
  • You can't even address an IPv6 packet for an IPv4 destination - how is it supposed to receive the packet? Encapsulating ICMPv6 in IPv4 doesn't make sense. – Zac67 May 4 at 19:47
  • Let me be more concrete: What happens if I receive an IPv4 packet whose protocol number is set to 58? – joshlf May 4 at 19:50
  • 1
    Likely, there's no protocol handler registered and the packet is dropped as unknown protocol. – Zac67 May 4 at 19:55
  • 1
    Given that practically all IPv6 hosts also support IPv4, ICMPv4 in IPv6 could potentially be parsed. However, this is host-specific and becoming off-topic here. – Zac67 May 4 at 20:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.