Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
51
Добавлен:
11.04.2015
Размер:
22.9 Mб
Скачать

Chapter 6 Neighbor Discovery

135

Subnet 1

Router 2

Router 1

Subnet 2

 

Rest of IPv6 Network

Figure 6-11 An example configuration in which the Route Information option is used

Using the Route Information option, Router 2 is configured to advertise the prefix of Subnet 2. Upon receipt of router advertisements from both routers, hosts on Subnet 1 automatically add a default route with Router 1 as its next-hop address and a specific route for the Subnet 2 prefix with Router 2 as its next-hop address. Now all the hosts on Subnet 2 are reachable by hosts on Subnet 1 without having to rely on redirects from Router 1.

A computer running Windows Server 2008, Windows Vista, Windows XP, or Windows Server 2003, acting as an IPv6 router that does not have a default route that is configured to be published, will send Route Information options in Router Advertisements to inform hosts of the subnet prefixes of the other subnets to which the IPv6 router is attached.

Neighbor Discovery Messages

All the functions of IPv6 ND are performed with the following messages:

Router Solicitation

Router Advertisement

Neighbor Solicitation

Neighbor Advertisement

Redirect

136 Understanding IPv6, Second Edition

Router Solicitation

The Router Solicitation message is sent by IPv6 hosts to discover the presence of IPv6 routers on the link. A host sends a multicast Router Solicitation message to prompt IPv6 routers to respond immediately, rather than waiting for an unsolicited Router Advertisement message.

For example, assuming that the local link is Ethernet, in the Ethernet header of the Router Solicitation message you will find these settings:

The Source Address field is set to the MAC address of the sending network adapter.

The Destination Address field is set to 33-33-00-00-00-02.

In the IPv6 header of the Router Solicitation message, you will find the following settings:

The Source Address field is set to either a link-local IPv6 address assigned to the sending interface or the IPv6 unspecified address (::).

The Destination Address field is set to the link-local scope all-routers multicast address (FF02::2).

The Hop Limit field is set to 255.

Figure 6-12 shows the structure of the Router Solicitation message.

Type

= 133

Code

= 0

Checksum

Reserved

Options

• • •

Figure 6-12 The structure of the Router Solicitation message

The following list describes the fields in the Router Solicitation message:

Type The value of this field is 133.

Code The value of this field is 0.

Checksum The value of this field is the ICMPv6 checksum.

Reserved This is a 32-bit field reserved for future use and set to 0.

Source Link-Layer Address option When present, the Source Link-Layer Address option contains the link-layer address of the sender. For an Ethernet node, the Source Link-Layer Address option contains the Ethernet MAC address of the sending host. The address in the Source Link-Layer Address option is used by the receiving router to determine the unicast MAC address of the host to which the corresponding unicast Router Advertisement is sent.

Chapter 6 Neighbor Discovery

137

Network Monitor Capture

Here is an example of a Router Solicitation message as displayed by Network Monitor 3.1 (capture 06_04 in the \NetworkMonitorCaptures folder on the companion CD-ROM):

Frame:

+Ethernet: Etype = IPv6

+Ipv6: Next Protocol = ICMPv6, Payload Length = 16 - Icmpv6: Router Solicitation

MessageType: Router Solicitation, 133(0x85)

-RouterSolicitation: Code: 0 (0x0)

Checksum: 19232 (0x4B20) Reserved: 0 (0x0)

-SourceLinkLayerAddress:

Type: Source Link-Layer Address, 1(0x1)

Length: 1, in unit of 8 octets

Address: 00-B0-D0-23-47-33

Router Advertisement

IPv6 routers send unsolicited Router Advertisement messages pseudo-periodically—that is, the interval between unsolicited advertisements is randomized to reduce synchronization issues when there are multiple advertising routers on a link—and solicited Router Advertisement messages in response to the receipt of a Router Solicitation message. The Router Advertisement message contains the information required by hosts to determine the link prefixes, the link MTU, specific routes, whether or not to use address autoconfiguration, and the duration for which addresses created through address autoconfiguration are valid and preferred.

For example, assuming that the local link is Ethernet, in the Ethernet header of the Router Advertisement message, you will find these settings:

The Source Address field is set to the MAC address of the sending network adapter.

The Destination Address field is set to either 33-33-00-00-00-01 or the unicast MAC address of the host that sent a Router Solicitation from a unicast address.

In the IPv6 header of the Router Advertisement message, you will find the following settings:

The Source Address field is set to the link-local address assigned to the sending interface.

The Destination Address field is set to either the link-local scope all-nodes multicast address (FF02::1) or the unicast IPv6 address of the host that sent the Router Solicitation message from a unicast address.

The Hop Limit field is set to 255.

Figure 6-13 shows the structure of the Router Advertisement message.

138 Understanding IPv6, Second Edition

Type

Code

Checksum

Current Hop Limit

Managed Address Configuration Flag

Other Stateful Configuration Flag

Home Agent Flag

Default Router Preference

Reserved

Router Lifetime

Reachable Time

Retrans Timer

Options

= 134

= 0

• • •

Figure 6-13 The structure of the Router Advertisement message

The fields in the Router Advertisement message are as follows:

Type The value of this field is 134.

Code The value of this field is 0.

Checksum The value of this field is the ICMPv6 checksum.

Current Hop Limit The Current Hop Limit field indicates the default value of the Hop Limit field in the IPv6 header for packets sent by hosts that receive this Router Advertisement message. The size of this field is 8 bits. A current hop limit of 0 indicates that the default value of the Hop Limit field is not specified by the router.

Managed Address Configuration flag The Managed Address Configuration flag indicates, when set to 1, that hosts receiving this Router Advertisement message must use an address configuration protocol such as DHCPv6 to obtain addresses in addition to the addresses that might be derived from stateless address autoconfiguration. The size of this field is 1 bit.

Other Stateful Configuration flag The Other Stateful Configuration flag indicates, when set to 1, that hosts receiving this Router Advertisement message must use an address configuration protocol (for example, DHCPv6) to obtain non–address configuration information. The size of this field is 1 bit.

Home Agent flag The Home Agent flag is defined in RFC 3775 for Mobile IPv6. For more information, see Appendix F.

Default Router Preference The Default Router Preference field indicates the level of preference for this router as the default router. If multiple routers advertise themselves as default routers, you can configure the routers so that they advertise with different preference levels. Valid values in binary are 01 (High), 00 (Medium), and 11 (Low). If the

Chapter 6 Neighbor Discovery

139

preference is set to 10, the receiving host should assume a value of 0 for the Router Lifetime field, effectively disabling the advertising router as a default router. The size of this field is 2 bits. This field is described in RFC 4191.

A typical configuration that can use the default router preference is a subnet that has two routers connected to the Internet or an organization intranet—one router is the primary router, and another router is a slower, secondary router intended to provide fault tolerance for the primary router. Both routers advertise themselves as default routers; however, the primary router advertises a default router preference of 01 (High) and the secondary router advertises a default router preference of 00 (Medium). If the primary router becomes unavailable, the hosts on the subnet will use the secondary router until the primary router becomes available.

Reserved This is a 3-bit field reserved for future use and set to 0.

Router Lifetime The Router Lifetime field indicates the lifetime (in seconds) of the router as the default router. The size of this field is 16 bits. The maximum Router Lifetime value is 65,535 seconds (about 18.2 hours). A value of 0 indicates that the router cannot be considered a default router; however, all other information contained in the Router Advertisement is still valid. A computer running Windows Server 2008, Windows Vista, Windows XP, or Windows Server 2003 acting as an IPv6 router that does not have a default route that is configured to be published sets the Router Lifetime field to 0.

Reachable Time The Reachable Time field indicates the amount of time (in milliseconds) that a node can consider a neighboring node reachable after receiving a reachability confirmation. The size of this field is 32 bits. A value of 0 indicates that the router does not specify the reachable time. For more information, see the “Neighbor Unreachability Detection” section in this chapter.

Retransmission Timer The Retransmission Timer field indicates the amount of time (in milliseconds) between retransmissions of Neighbor Solicitation messages. The size of this field is 32 bits. The retransmission timer is used during neighbor unreachability detection. A value of 0 indicates that the router does not specify the retransmission timer value.

The options that can be present in a Router Advertisement message are the following:

Source Link-Layer Address option When present, the Source Link-Layer Address option contains the link-layer address of the interface on which the Router Advertisement message was sent. This option can be omitted when the router is load-balancing across multiple link-layer addresses.

MTU option When present, the MTU option contains the MTU of the link. It is typically sent on links that have a variable MTU or in switched environments that have multiple link-layer technologies on the same link.

Соседние файлы в папке Lecture 2_10