IPv6 Core Protocols Implementation

One of the main functions of the ND protocol is address resolution, that is, determining the link-layer address of a given IPv6 address. The IPv6 address must be a unicast address and considered on-link.
When a node has packets to send to a destination, the node must determine whether the destination is on-link or off-link and subsequently how to reach the destination. This process is known as next-hop determination, which works as follows. The sending node first decides whether the destination is on-link based on the definitions described in Section 5.2. If it is, the next-hop address is the same as the destination address. For an off-link destination, a router is selected from the Default Router List. In this case the next-hop address is the same as the address of the default router. Next-hop determination completes at this point.
The next step is to resolve the link-layer address of the next-hop address. The node begins the resolution procedure by sending out a Neighbor Solicitation packet destined for the solicited-node multicast address of the next-hop address. The source address of the Neighbor Solicitation packet is set to the source address of the packet that prompted the address resolution(*). The node must include the link-layer address that corresponds to the source address in the Source Link-Layer Address option when sending a multicast Neighbor Solicitation packet. A node may already have the link-layer address of the destination but the information may be stale. In this case the...