3. Understanding ICMPv6 Messages
Internet
Control Message Protocol (ICMP) for IPv4 (ICMPv4) is used in IPv4
networks to allow nodes to send and respond to error message and
informational messages. For example, when a source node uses the Ping
command to send ICMP Echo Request messages (ICMP type 8 messages) to a
destination node, the destination node can respond with ICMP Echo
messages (ICMP type 0 messages) indicating its presence on the network.
On
IPv6 networks, ICMP for IPv6 (ICMPv6) fulfills the same functions that
ICMPv4 does on IPv4 networks—namely, to provide a mechanism for
exchanging error messages and informational messages. ICMPv6 also
provides information messages for the following:
Neighbor Discovery (ND) The process by which hosts and routers discover each other on the network so that they can communicate at the data-link layer.
Multicast Listener Discovery (MLD) The process by which membership in multicast groups is determined and maintained.
3. Understanding Neighbor Discovery
Neighbor
Discovery (ND) is the process by which nodes on an IPv6 network can
communicate with each other by exchanging frames at the data-link
layer. ND performs the following functions on an IPv6 network:
Enables
IPv6 nodes (IPv6 hosts and IPv6 routers) to resolve the link-layer
address of a neighboring node (a node on the same physical or logical
link)
Enables IPv6 nodes to determine when the link-layer address of a neighboring node has changed
Enables IPv6 nodes to determine whether neighboring nodes are still reachable
Enables IPv6 routers to advertise their presence, on-link prefixes, and host configuration settings
Enables IPv6 routers to redirect hosts to more optimal routers for a specific destination
Enables IPv6 hosts to discover addresses, address prefixes, and other configuration settings
Enables IPv6 hosts to discover routers attached to the local link
To
understand how ND works, it helps to first compare this with the
similar processes used in IPv4. In IPv4, you use three separate
mechanisms to manage node-to-node communication:
Address Resolution Protocol (ARP)
A data-link layer protocol that resolves IPv4 addresses assigned to
interfaces to their corresponding MAC-layer addresses. This enables
network adapters to receive frames addressed to them and send response
frames to their source. For example, before a host can send a packet to
a destination host whose IPv4 address is 172.16.25.3, the sending host
first needs to use ARP to resolve this destination address (if the host
is on the same LAN) or the IP address of the local gateway (if the host
is on a different LAN) to its corresponding 48-bit MAC address (such as
00-13-20-08-A0-D1).
ICMPv4 Router Discovery
These ICMPv4 messages enable routers to advertise their presence on
IPv4 networks and enable hosts to discovery the presence of these
routers. When Router Discovery is enabled on a router, the router
periodically sends Router Advertisements to the all-hosts multicast
address (224.0.0.1) to indicate to hosts on the network that the router
is available. When Router Discovery is enabled on hosts, the hosts can
send Router Solicitations to the all-routers multicast address
(224.0.0.2) to obtain the address of the router and assign this address
as the host’s default gateway.
ICMPv4 Redirect
Routers use these ICMPv4 messages to inform hosts of more optimal
routers to use for specific destinations. ICMPv4 Redirect messages are
needed because hosts typically cannot determine the best router on
their subnet to send remote traffic for a given destination.
On
IPv4 networks, these three mechanisms enable nodes on a network segment
to communicate on a link. On IPv6 networks, these three mechanisms are
replaced by the five ICMPv6 message types shown in Table 5.
Table 5. ICMPv6 Message Types Used for Neighbor Discovery
Message type | ICMPv6 type | Description |
---|
Router Solicitation | 133 | Sent
by IPv6 hosts to the link-local scope all-routers multicast address
(FF02::2) to discover IPv6 routers present on the local link. |
Router Advertisement | 134 | Sent
periodically by IPv6 routers to the link-local scope all-nodes
multicast address (FF02::1), or sent to the unicast address of a host
in response to receiving a Router Solicitation message from that host.
Router Advertisement messages provide hosts with the information needed
to determine link prefixes, link MTU, whether to use DHCPv6 for address
autoconfiguration, and lifetime for autoconfigured addresses. |
Neighbor Solicitation | 135 | Sent
by IPv6 hosts to the solicited-node multicast address of a host to
discover the link-layer address of an IPv6 node, or sent to the unicast
address of the host to verify the reachability of the host. |
Neighbor Advertisement | 136 | Sent
by an IPv6 node to the unicast address of a host in response to
receiving a Neighbor Solicitation message from the host, or sent to the
link-local scope all-nodes multicast address (FF02::1) to inform
neighboring nodes of changes to the host’s link-layer addresses. |
Redirect | 137 | Sent
by an IPv6 router to the unicast address of a host to inform the host
of a more optimal first-hop address for a specific destination. |
Note
The
solicited-node multicast address, which is used as the destination
address for ICMPv4 Neighbor Solicitation messages (ICMPv6 type 135
messages) when address resolution is being performed, is a special type
of multicast address composed of the prefix FF02::1:FF00:0/104 followed
by the last 24 bits of the IPv6 address that is being resolved. The
advantage of using this multicast address for address resolution in
IPv6 is that typically only the targeted host is disturbed on the local
link. By contrast, the ARP messages used in IPv4 for address resolution
queries are sent to the MAC-layer broadcast address, which disturbs all
hosts on the local segment. IPv6 nodes listen on all their assigned
IPv6 addresses, including their solicited-node multicast addresses. |