IPv6 Neighbor Discovery Message Options

There are 5 message options (small data structures containing network information) that can be used in building the various Neighbor Discovery messages:

 

Source Link-Layer Address option  

The Source Link-Layer Address option can be used in the Neighbor Solicitation, Router Solicitation and Router Advertisement ND messages. It is used to provide the Link-Layer (e.g. MAC) address of the node sending the ND message to the recipient node. This is an optimization since that node would normally need to do an Address Resolution to obtain this Link-Layer address when it replies.nd source linklayer option

The Type field (8 bits) contains the value 1 (for Source Link Layer Address option).

The Length field (8 bits) contains the length of the option in bytes. For Ethernet this would be 2 bytes (for the Type and Length fields), plus 6 bytes (for a MAC address), for a total of 8 bytes.

The Link-Layer Address field (variable size, e.g. 6 bytes for Ethernet MAC address) contains the Link Layer address of the sender of the message.

 

Target Link-Layer Address option 

The Source Link-Layer Address option can be used in the Neighbor Advertisement and Redirect ND messages. It is used to provide the Link-Layer (e.g. MAC) address of the target node to the recipient node. This is an optimization since that node would normally need to do an Address Resolution to obtain this Link-Layer address in the near future.nd source linklayer option

The Type field (8 bits) contains the value 2 (for Target Link Layer Address option).

The Length field (8 bits) contains the length of the option in bytes. For Ethernet this would be 2 bytes (for the Type and Length fields), plus 6 bytes (for a MAC address), for a total of 8 bytes.

The Link-Layer Address field (variable size, e.g. 6 bytes for Ethernet MAC address) contains the Link Layer address of the target node.

 

Prefix Information option 

The Prefix Information option is used only in the Router Advertisement message. An IPv6 router uses this option to communicate information about one IPv6 subnet prefix to other nodes in the subnet. Multiple Prefix Information options can be included in a single Router Advertisement message. This information is used by IPv6 compliant nodes to do Stateless Address Auto Configuration (SLAAC). Internal nodes normally generate one (or even two) global addresses from each advertised subnet prefix during SLAAC. This option has the following syntax:

prefix info option

The Type field (8 bits) contains the value 3 (for Prefix Information option).

The Length field (8 bits) contains the length of the option in bytes. For Ethernet this would be 2 bytes (for the Type and Length fields), plus 6 bytes (for a MAC address), for a total of 8 bytes. [note typo in image - second field should be Length, not Code]

The Prefix Length field (8 bits) specifies the number of leading bits in the Prefix that are valid (and value from 0 to 128, most often 64).

The L flag (1 bit) is also known as the on-link flag.

L=1 indicates that this prefix can be used for on-link determination.

L=0 indicates that this advertisement makes no statement about whether this prefix can be used for on-link determination.

The A flag (1 bit) is also known as the autonomous address configuration flag.

A=1 indicates that this prefix can be used for autonomous address configuration as specified in RFC 2462, "IPv6 Stateless Address Autoconfiguration", December 1998. Autonomous means it can do address configuration on its own, without further help from any outside node.

A=0 indicates that this advertisement makes no statement about whether this prefix can be used for autonomous address configuration.

The Reserved1 field (6 bits) is unused and must be set to zero.

The Valid Lifetime field (32 bits) is the length of time in seconds (relative to when the packet is sent) that addresses generated from this prefix by SLAAC remain in the valid state. A value of 0xffffffff represents infinity (the valid state will never end for an address with this valid lifetime value). This is how nodes learn the subnet default valid lifetime value for this prefix. Values of up to 4.2 billion seconds can be specified, which is about 136 years. The Valid Lifetime must always be greater than or equal to the Preferred Lifetime.

The Preferred Lifetime field (32 bits) is the length of time in seconds (relative to when the packet is sent) that addresses generated from this prefix by SLAAC remain in the preferred state. A value of 0xffffffff represents infinity (the preferred state will never end for an address with this preferred lifetime value). This is how nodes learn the subnet default preferred lifetime value for this prefix. Values of up to 4.2 billion seconds can be specified, which is about 136 years. The Preferred Lifetime must always be less than or equal to the Valid Lifetime.

The Reserved2 field (32 bits) is unused and must be set to zero.

The Prefix field contains a 128 bit IPv6 address prefix. The bits after "prefix length" bits must all be set to zero. For example, if prefix length is 64, then the last 64 bits must be zero. Routers should not advertise the link-local prefix (fe80::/64) or the site-local prefix (fec0::/64). If a node receives an advertisement for those prefixes, it should ignore it. A router can advertise Global (e.g. 2001:db8:100:1000::/64) and/or Unique Local Address (e.g. fd12:3456:7890:1000::/64) prefixes.

 

Redirected Header option 

This option is used only in the ND Redirect message. It has the following syntax:nd redirect option

The Type field (8 bits) contains the value 4 for Redirected Header option.

The Length field (8 bits) contains the length of the option in bytes.

The Reserved field (48 bits) is unused and must be set to zero.

The IP Header + Data field (variable size) contains as much of the packet that needs to be redirected as possible, truncated so that the entire redirect ND packet does not exceed 1280 bytes.

 

MTU option 

The MTU option is used only in the Router Advertisement message, and has the following sytnax:

nd MTU option

The Type field (8 bits) contains the value 5 for MTU option.

The Length field (8 bits) contains the length of the option in 8 byte units. This will always be the value 1, which means the length is 8 bytes.

The Reserved field (16) bits is unused and must be set to zero.

The MTU field (32 bits) contains the recommended MTU for the link.