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

156 Understanding IPv6, Second Edition

Duplicate Address Detection

IPv4 nodes use ARP Request messages and a method called gratuitous ARP to detect a duplicate unicast IPv4 address on the local link. Similarly, IPv6 nodes use the Neighbor Solicitation message to detect duplicate address use on the local link in a process known as duplicate address detection that is described in RFC 4862.

With IPv4 gratuitous ARP, the Source Protocol Address and Target Protocol Address fields in the ARP Request message header are set to the IPv4 address for which duplication is being detected. In IPv6 duplicate address detection, the Target Address field in the Neighbor Solicitation message is set to the IPv6 address for which duplication is being detected.

Duplicate address detection differs from address resolution in the following ways:

In the duplicate address detection Neighbor Solicitation message, the Source Address field in the IPv6 header is set to the unspecified address (::). The address being queried for duplication cannot be used until it is determined that there are no duplicates.

In the Neighbor Advertisement reply to a duplicate address detection Neighbor Solicitation message, the Destination Address in the IPv6 header is set to the link-local scope allnodes multicast address (FF02::1). The Solicited flag in the Neighbor Advertisement message is set to 0. Because the sender of the duplicate address detection Neighbor Solicitation message is not using the desired IP address, it cannot receive unicast Neighbor Advertisements. Therefore, the Neighbor Advertisement is multicast.

Upon receipt of the multicast Neighbor Advertisement with the Target Address field set to the IP address for which duplication is being detected, the node disables the use of the duplicate IP address on the interface. If the node does not receive a Neighbor Advertisement that defends the use of the address, it initializes the address on the interface.

An IPv6 node does not perform duplicate address detection for anycast addresses. Anycast addresses are not unique to a node.

Duplicate Address Detection Example—Part 1

Host B has a global address of 2001:DB8::2:260:8FF:FE52:F9D8. Host A is attempting to use the global address of 2001:DB8::2:260:8FF:FE52:F9D8. However, before Host A can use this address, it must verify its uniqueness through duplicate address detection.

Host A sends a Neighbor Solicitation message to the solicited-node multicast address FF02::1:FF52:F9D8, as shown in Figure 6-21.

Chapter 6 Neighbor Discovery

157

Ethernet Header

Dest MAC is 33-33-FF-52-F9-D8 IPv6 Header

Source Address is ::

• Destination Address is FF02::1:FF52:F9D8

Host A

• Hop limit is 255

 

Neighbor Solicitation Header

Tentative IP: 2001:DB8::2:260:8FF:FE52:F9D8

• Target Address is 2001:DB8::2:260:8FF:FE52:F9D8

 

1 Send Multicast Neighbor Solicitation

Neighbor Solicitation

MAC: 00-60-08-52-F9-D8

IP: 2001:DB8::2:260:8FF:FE52:F9D8

Host B

Figure 6-21 A multicast Neighbor Solicitation message for duplicate address detection

Network Monitor Capture

Here is the Neighbor Solicitation message for this example as displayed by Network Monitor 3.1 (frame 1 of capture 06_06 in the \NetworkMonitorCaptures folder on the companion CD-ROM):

Frame:

-Ethernet: Etype = IPv6

+DestinationAddress: 3333FF 52F9D8

+SourceAddress: 00B0D0 234733 EthernetType: IPv6, 34525(0x86dd)

-Ipv6: Next Protocol = ICMPv6, Payload Length = 24

+Versions: IPv6, Internet Protocol, DSCP 0 PayloadLength: 24 (0x18)

NextProtocol: ICMPv6, 58(0x3a) HopLimit: 255 (0xFF)

+SourceAddress: 0:0:0:0:0:0:0:0 DestinationAddress: FF02:0:0:0:0:1:FF52:F9D8

-Icmpv6: Neighbor Solicitation, Target = 2001:DB8:0:2:260:8FF:FE52:F9D8 MessageType: Neighbor Solicitation, 135(0x87)

-NeighborSolicitation: Code: 0 (0x0)

Checksum: 20279 (0x4F37) Reserved: 0 (0x0)

TargetAddress: 2001:DB8:0:2:260:8FF:FE52:F9D8

Notice the use of the unspecified address (::) in the Source Address field in the IPv6 header and the lack of the Source Link-Layer Address option.

158 Understanding IPv6, Second Edition

Duplicate Address Detection Example—Part 2

Host B, having registered the multicast MAC address of 33-33-FF-52-F9-D8 with its Ethernet adapter, receives and processes the Neighbor Solicitation message. Host B notes that the source address is the unspecified address. Host B then responds with a multicast Neighbor Advertisement message, as shown in Figure 6-22.

Ethernet Header

Dest MAC is 33-33-00-00-00-01 IPv6 Header

Source Address is 2001:DB8::2:260:8FF:FE52:F9D8

Destination Address is FF02::1

Hop limit is 255

Neighbor Advertisement Header

Target Address is 2001:DB8::2:260:8FF:FE52:F9D8 Neighbor Discovery Option

Target Link-Layer Address

Host A

Tentative IP: 2001:DB8::2:260:8FF:FE52:F9D8

Neighbor Advertisement

2 Send Multicast Neighbor Advertisement

IP: 2001:DB8::2:260:8FF:FE52:F9D8

Host B

Figure 6-22 The multicast Neighbor Advertisement message

Network Monitor Capture

Here is the Neighbor Advertisement message for this example as displayed by Network Monitor 3.1 (frame 2 of capture 06_06 in the \NetworkMonitorCaptures folder on the companion CD-ROM):

Frame:

-Ethernet: Etype = IPv6

+DestinationAddress: 333300 000001

+SourceAddress: 006008 52F9D8 EthernetType: IPv6, 34525(0x86dd)

-Ipv6: Next Protocol = ICMPv6, Payload Length = 32

+Versions: IPv6, Internet Protocol, DSCP 0 PayloadLength: 32 (0x20)

NextProtocol: ICMPv6, 58(0x3a) HopLimit: 255 (0xFF)

SourceAddress: 2001:DB8:0:2:260:8FF:FE52:F9D8 DestinationAddress: FF02:0:0:0:0:0:0:1

-Icmpv6: Neighbor Advertisement, Target = 2001:DB8:0:2:260:8FF:FE52:F9D8 MessageType: Neighbor Advertisement, 136(0x88)

- NeighborAdvertisement:

Chapter 6 Neighbor Discovery

159

Code: 0 (0x0)

Checksum: 61832 (0xF188)

- NeighborAdvertisementFlag: 536870912 (0x20000000)

R:

(0...............................

)

Not

router

S:

(.0..............................

)

Not

solicited

O:

(..1

.............................)

Override

Rsv:

(...

00000000000000000000000000000)

 

 

TargetAddress: 2001:DB8:0:2:260:8FF:FE52:F9D8 - TargetLinkLayerAddress:

Type: Target Link-Layer Address, 2(0x2) Length: 1, in unit of 8 octets

Address: 00-60-08-52-F9-D8

Notice the use of the link-local scope all-nodes multicast address as the destination address and the values of the Solicited and Override flags.

Router Discovery

Router discovery is the process through which nodes attempt to discover the set of routers on the local link. Router discovery in IPv6 is similar to ICMP router discovery for IPv4 described in RFC 1256. ICMP router discovery is a set of ICMP messages that allow IPv4 hosts to determine the presence of local routers, determine which local router is automatically configured as a default gateway, and automatically switch to a different router as their default gateway when the current default gateway becomes unavailable.

An important difference between ICMPv4 router discovery and IPv6 router discovery is the mechanism through which a new default router is selected when the current one becomes unavailable. In ICMPv4 router discovery, the Router Advertisement message includes an Advertisement Lifetime field. Advertisement Lifetime is the time after which the router can be considered unavailable. In the worst case, a router can become unavailable and hosts will not attempt to discover a new default router until the Router Advertisement time has elapsed.

IPv6 has a Router Lifetime field in the Router Advertisement message. This field indicates the length of time that the router can be considered a default router. However, if the current default router becomes unavailable, the condition is detected through neighbor unreachability detection instead of the Router Lifetime field in the Router Advertisement message. Because neighbor unreachability detection determines that the router is no longer reachable, a new router is chosen immediately from the default router list or the host sends a Router Solicitation message to determine if additional default routers are present on the link. For more information, see the “Neighbor Unreachability Detection” section in this chapter.

In addition to configuring a default router, IPv6 router discovery also configures the following:

The default setting for the Hop Limit field in the IPv6 header.

A determination of whether the node should use an address protocol, such as Dynamic Host Configuration Protocol for IPv6 (DHCPv6), for addresses and other configuration parameters.

160Understanding IPv6, Second Edition

The timers used in neighbor unreachability detection and the retransmission of Neighbor Solicitations.

The list of network prefixes defined for the link. Each network prefix contains both the IPv6 network prefix and its valid and preferred lifetimes. If indicated, a network prefix combined with the interface identifier creates a stateless IP address configuration for the receiving interface. A network prefix also defines the range of addresses for nodes on the local link.

The MTU of the local link.

Specific routes to add to the routing table.

The IPv6 router discovery processes are the following:

IPv6 routers pseudo-periodically send a Router Advertisement message on the local link advertising their existence as routers. They also provide configuration parameters such as default hop limit, MTU, prefixes, and routes. For more information about how often routers send pseudo-periodic router advertisements, see section 6.2.4 of RFC 4861.

Active IPv6 hosts on the local link receive the Router Advertisement messages and use the contents to maintain the default router and prefix lists, autoconfigure addresses, add routes, and configure other parameters.

A host that is starting sends a Router Solicitation message to the link-local scope allrouters multicast address (FF02::2). If the starting host is already configured with a unicast address, the Router Solicitation is sent with a unicast source address. Otherwise, the Router Solicitation is sent with an unspecified source address (::). Upon receipt of a Router Solicitation message, all routers on the local link send a Router Advertisement message to either the unicast address of the host that sent the Router Solicitation (if the source address of the Router Solicitation is a unicast address), or to the link-local scope all-nodes multicast address (FF02::1) (if the source address of the Router Solicitation message is unspecified). The host receives the Router Advertisement messages and uses their contents to build the default router and prefix lists and set other configuration parameters. The number of Router Solicitations sent before abandoning the router discovery process is set by a configurable variable. RFC 4861 uses the variable name of MAX_RTR_SOLICITATIONS and recommends a value of 3.

Router Discovery Example—Part 1

Host A has the Ethernet MAC address of 00-B0-D0-E9-41-43. The router has an Ethernet MAC address of 00-10-FF-D6-58-C0 and a corresponding link-local address of FE80::210:FFFF:FED6:58C0. To forward packets to off-link destinations, Host A must discover the presence of the router.

Chapter 6 Neighbor Discovery

161

As part of the startup process, Host A sends a multicast Router Solicitation message to the address FF02::2 before it has confirmed the use of its corresponding link-local address, as shown in Figure 6-23.

Ethernet Header

 

• Destination MAC is 33-33-00-00-00-02

 

IPv6 Header

 

• Source Address is ::

Host A

• Destination Address is FF02::2

MAC: 00-B0-D0-E9-41-43

• Hop limit is 255

IP: none

Router Solicitation Header

 

1 Send Multicast Router Solicitation

Router Solicitation

MAC: 00-10-FF-D6-58-C0

IP: FE80::210:FFFF:FED6:58C0

Router

Figure 6-23 The multicast Router Solicitation message

Network Monitor Capture

Here is the Router Solicitation message for this example as displayed by Network Monitor 3.1 (frame 1 of capture 06_07 in the \NetworkMonitorCaptures folder on the companion CDROM):

Frame:

-Ethernet: Etype = IPv6

+DestinationAddress: 333300 000002

+SourceAddress: 00B0D0 E94143 EthernetType: IPv6, 34525(0x86dd)

-Ipv6: Next Protocol = ICMPv6, Payload Length = 8

+Versions: IPv6, Internet Protocol, DSCP 0 PayloadLength: 8 (0x8)

NextProtocol: ICMPv6, 58(0x3a) HopLimit: 255 (0xFF)

+SourceAddress: 0:0:0:0:0:0:0:0 DestinationAddress: FF02:0:0:0:0:0:0:2

-Icmpv6: Router Solicitation

MessageType: Router Solicitation, 133(0x85)

-RouterSolicitation: Code: 0 (0x0)

Checksum: 31672 (0x7BB8) Reserved: 0 (0x0)

Notice the use of the unspecified address (::) as the source and that the Source Link-Layer Address option is not included.

162 Understanding IPv6, Second Edition

Router Discovery Example—Part 2

The router, having registered the multicast MAC address of 33-33-00-00-00-02 with its Ethernet adapter, receives and processes the Router Solicitation. The router responds with a multicast Router Advertisement message containing configuration parameters and local link prefixes, as shown in Figure 6-24.

Ethernet Header

 

• Dest MAC is 33-33-00-00-00-01

 

IPv6 Header

 

• Source Address is FE80::210:FFFF:FED6:58C0

 

• Destination Address is FF02::1

 

• Hop limit is 255

 

Router Advertisement Header

 

• Cur Hop Limit, Flags, Router/Reachable/Retrans

 

Neighbor Discovery Options

Host A

• Source Link-Layer Address

 

• MTU

MAC: 00-B0-D0-E9-41-43

• Prefix Information

IP: none

Router Advertisement

 

2 Send Multicast Router Advertisement

MAC: 00-10-FF-D6-58-C0

IP: FE80::210:FFFF:FED6:58C0

Router

Figure 6-24 The unicast Router Advertisement message

Network Monitor Capture

Here is the Router Advertisement message for this example as displayed by Network Monitor 3.1 (frame 2 of capture 06_07 in the \NetworkMonitorCaptures folder on the companion CD-ROM):

Frame:

-Ethernet: Etype = IPv6

+DestinationAddress: 333300 000001

+SourceAddress: 0010FF D658C0 EthernetType: IPv6, 34525(0x86dd)

-Ipv6: Next Protocol = ICMPv6, Payload Length = 88

+Versions: IPv6, Internet Protocol, DSCP 28 PayloadLength: 88 (0x58)

NextProtocol: ICMPv6, 58(0x3a) HopLimit: 255 (0xFF)

SourceAddress: FE80:0:0:0:210:FFFF:FED6:58C0 DestinationAddress: FF02:0:0:0:0:0:0:1

-Icmpv6: Router Advertisement

MessageType: Router Advertisement, 134(0x86)

Chapter 6 Neighbor Discovery

163

-RouterAdvertisement: Code: 0 (0x0)

Checksum: 24725 (0x6095)

CurHopLimit: 64 (0x40)

-RouterAdvertisementFlag:

M:(0.......) Not managed address configuration

O:(.0......) Not other stateful configuration

A: (..0.....) Not a Mobile IP Home Agent RouterPreference: (...00...) Medium,0(0x0)

Reserved: (.....000) RouterLifetime: 1800 (0x708) ReachableTime: 0 (0x0) RetransTimer: 0 (0x0)

- SourceLinkLayerAddress:

Type: Source Link-Layer Address, 1(0x1) Length: 1, in unit of 8 octets

Address: 00-10-FF-D6-58-C0 - PrefixInformation:

Type: Prefix Information, 3(0x3) Length: 4, in unit of 8 octets PrefixLength: 64 (0x40)

-Flags: 192 (0xC0)

L:(1.......) On-Link determination allowed

A:(.1......) Autonomous address-configuration

R:(..0.....) Not router Address

S:(...0....) Not a site prefix

P: (....0...) Not a router prefix Rsv: (.....000)

ValidLifetime: 2592000 (0x278D00) PreferredLifetime: 604800 (0x93A80) Reserved: 0 (0x0)

Prefix: 2001:DB8:0:F282:0:0:0:0 - PrefixInformation:

Type: Prefix Information, 3(0x3) Length: 4, in unit of 8 octets PrefixLength: 64 (0x40)

-Flags: 192 (0xC0)

L:(1.......) On-Link determination allowed

A:(.1......) Autonomous address-configuration

R:(..0.....) Not router Address

S:(...0....) Not a site prefix

P: (....0...) Not a router prefix

Rsv: (.....000)

ValidLifetime: 2592000 (0x278D00)

PreferredLifetime: 604800 (0x93A80)

Reserved: 0 (0x0)

Prefix: FD5A:29F1:D005:F282:0:0:0:0

This Router Advertisement contains two prefixes—one for 2001:DB8:0:F282::/64 and one for FD5A:29F1:D005:F282::/64. Notice how both the global prefix and the unique local prefix use the same subnet identifier (F282).

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