Chapter 6 Neighbor Discovery At the end of this chapter,you should be able to do the following: ■Describe the functions of the Neighbor Discovery(ND)protocol. ■List and describe the function and format of ND options. ■List and describe the function and format of ND messages. ■Describe which ND messages use which ND options. Describe the details of the address resolution,neighbor unreachability detection, duplicate address detection,router discovery,and redirect processes. Describe the host sending algorithm in terms of host data structures and ND messages. Neighbor Discovery Overview Internet Protocol version 6 (IPv6)Neighbor Discovery (ND)is a set of messages and pro- cesses defined in RFC 4861 that determine relationships between neighboring nodes.ND replaces Address Resolution Protocol (ARP),Internet Control Message Protocol (ICMP) router discovery,and the ICMP Redirect message used in IPv4.ND also provides additional functionality. ND is used by nodes to do the following: Resolve the link-layer address of a neighboring node to which an IPv6 packet is being forwarded. ■Determine when the link-layer address of a neighboring node has changed ■Determine whether a neighbor is still reachable. ND is used by hosts to do the following: ■Discover neighboring routers. ■Autoconfigure addresses,address prefixes,routes,and other configuration parameters. ND is used by routers to do the following: ■Advertise their presence,host configuration parameters,routes,and on-link prefixes. Inform hosts of a better next-hop address to forward packets for a specific destination. 123
!"#$%&'() *# *+,%,+ ! ++ -"./ 0 12345672892:;26?97=51634=@25AB>1CD5=8=4=EF 0 G638H1=D86=1J233H?23F 0 12345672K9649>1J233H?23;32K9649>1=D86=1J233H?23F MN OPQRSPRQTSUQUVUWXRSYZUP[\OTX[]^RZ_`aUSbZYVUXRSc\^b]ZYdYRQUefRYYd_RYdPghSUi VRYYRYgReZPRgZPjklmn[oQ`dQgRQRSfZPRSRWdQZUPY`ZhYaRQpRRPPRZ_`aUSZP_PUgRYq^b SRhWdVRYrggSRYYjRYUWsQZUPTSUQUVUW\rjT]tOPQRSPRQlUPQSUWuRYYd_RTSUQUVUW\OluT] SUsQRSgZYVUXRSctdPgQ`ROluTjRgZSRVQfRYYd_RsYRgZPOTXmq^bdWYUhSUXZgRYdggZQZUPdW esPVQZUPdWZQcq ^bZYsYRgacPUgRYQUgUQ`ReUWWUpZP_v 0 jRYUWXRQ`RWZPwiWdcRSdggSRYYUedPRZ_`aUSZP_PUgRQUp`ZV`dPOTX[hdVwRQZY aRZP_eUSpdSgRgq 0 bRQRSfZPRp`RPQ`RWZPwiWdcRSdggSRYYUedPRZ_`aUSZP_PUgR`dYV`dP_Rgq 0 bRQRSfZPRp`RQ`RSdPRZ_`aUSZYYQZWWSRdV`daWRq ^bZYsYRgac`UYQYQUgUQ`ReUWWUpZP_v 0 bZYVUXRSPRZ_`aUSZP_SUsQRSYq 0 rsQUVUPeZ_sSRdggSRYYRYtdggSRYYhSReZxRYtSUsQRYtdPgUQ`RSVUPeZ_sSdQZUPhdSdfRQRSYq ^bZYsYRgacSUsQRSYQUgUQ`ReUWWUpZP_v 0 rgXRSQZYRQ`RZShSRYRPVRt`UYQVUPeZ_sSdQZUPhdSdfRQRSYtSUsQRYtdPgUPiWZPwhSReZxRYq 0 OPeUSf`UYQYUedaRQQRSPRxQi`UhdggSRYYQUeUSpdSghdVwRQYeUSdYhRVZeZVgRYQZPdQZUPq
124 Understanding IPv6,Second Edition IPv6 ND processes include the following: Router discovery During router discovery,a host discovers the local routers on an attached link.This process is equivalent to ICMPv4 router discovery.For more informa- tion,see the "Router Discovery"section in this chapter. Prefix discovery Prefix discovery is the process by which hosts discover the network prefixes for local link destinations.This is similar to the exchange of the ICMPv4 Address Mask Request and Address Mask Reply messages.For more information,see the "Router Discovery"section in this chapter. Parameter discovery The parameter discovery process enables hosts to discover additional operating parameters,including the link maximum transmission unit(MTU) and the default hop limit for outgoing packets.For more information,see the"Router Discovery"section in this chapter. Address autoconfiguration During address autoconfiguration,IP addresses are con- figured for interfaces in either the presence or absence of an address configuration server,such as a Dynamic Host Configuration Protocol for IPv6(DHCPv6)server.For more information,see Chapter 8,"Address Autoconfiguration." Address resolution Address resolution is the process by which nodes resolve a neigh- bor's IPv6 address to its link-layer address.It is equivalent to ARP in IPv4.For more infor- mation,see the "Address Resolution"section in this chapter. Next-hop determination During next-hop determination,a node determines the IPv6 address of the neighbor to which a packet is being forwarded,based on the destination address.The next-hop address is either the destination address or the address of an on- link default router.For more information,see "Host Sending Algorithm"in this chapter. Neighbor unreachability detection The neighbor unreachability detection process is the means by which a node determines that the IPv6 layer of a neighbor is no longer receiving packets or that an IPv6 address has moved to a different physical interface.For more information,see the "Neighbor Unreachability Detection"section in this chapter. Duplicate address detection During duplicate address detection,a node determines that an address considered for use is not already in use by a neighboring node.This pro- cess is equivalent to using gratuitous ARP frames in IPv4.For more information,see the "Duplicate Address Detection"section in this chapter. Redirect function The redirect function is the process of informing a host of a better first-hop IPv6 address to reach a destination.It is equivalent to the use of the ICMPv4 Redirect message.For more information,see the"Redirect Function"section in this chapter
!"##"#$%!&'(")*"+ && ,$%-. / 01 2 '$%- ')"($#! "345* #)($#! "#)*"& !5& ')"# %5% 5))5!*"(&$%678*$# !"##$#"9'$5&"%)) :; "$%+ >5? )$ %4#"")*"@A ')"$#! "3B#"!)$ %$%)*$#!*5)"7 / CD 2 "+$E($#! "3$#)*" !"##F3,*$!** #)#($#! ")*"%"), 6 "+$E"#+ & !5&&$%6("#)$%5)$ %#78*$#$##$>$&5) )*""E!*5%-" +)*":;"##5-"#7= > "$%+ >5)$ %4#"" )*"@A ')"$#! "3B#"!)$ %$%)*$#!*5)"7 / H 2 8*"55>")"($#! "3 !"##"%5F&"#* #)#) ($#! " 5(($)$ %5& "5)$%-55>")"#4$%!&'($%-)*"&$%6>5E$>'>)5%#>$##$ %'%$)I;8JK 5%()*"("+5'&)* &$>$)+ ')- $%-5!6")#7= > "$%+ >5)$ %4#"")*"@A ')" $#! "3B#"!)$ %$%)*$#!*5)"7 / L 1 C 1 '$%-5(("##5') ! %+$-'5)$ %45(("##"#5"! %? +$-'"(+ $%)"+5!"#$%"$)*")*""#"%!" 5F#"%!" +5%5(("##! %+$-'5)$ % #""4#'!*5#53%5>$!M #): %+$-'5)$ % ) ! &+ IM:K#""7= > "$%+ >5)$ %4#"":*5)"N4@G(("##G') ! %+$-'5)$ %7B / L O1 G(("##"# &')$ %$#)*" !"##F3,*$!*% ("#"# &"5%"$-*? F P#5(("##) $)#&$%6?&53"5(("##7)$#"9'$5&"%)) GA$% "$%+ ? >5)$ %4#"")*"@G(("##A"# &')$ %B#"!)$ %$%)*$#!*5)"7 / QD RST H '$%-%"E)?* (")">$%5)$ %45% ("(")">$%"#)*" 5(("## +)*"%"$-*F ) ,*$!*55!6")$#F"$%-+ ,5("(4F5#"( %)*"("#)$%5)$ % 5(("##78*"%"E)?* 5(("##$#"$)*")*"("#)$%5)$ %5(("## )*"5(("## +5% %? &$%6("+5'&) ')"7= > "$%+ >5)$ %4#""@M #)U"%($%-G&- $)*>B$%)*$#!*5)"7 / Q SV1SVO 2 8*"%"$-*F '%"5!*5F$&$)3(")"!)$ % !"##$# )*">"5%#F3,*$!*5% ("(")">$%"#)*5))*"&53" +5%"$-*F $#% & %-" "!"$$%-5!6")# )*5)5%5(("##*5#> "() 5($++""%)*3#$!5&$%)"+5!"7= > "$%+ >5)$ %4#"")*"@"$-*F J%"5!*5F$&$)3")"!)$ %B#"!)$ %$%)*$#!*5)"7 / W1TO '$%-('&$!5)"5(("##(")"!)$ %45% ("(")">$%"# )*5)5%5(("##! %#$(""(+ '#"$#% )5&"5(3$%'#"F35%"$-*F $%-% ("78*$# ? !"##$#"9'$5&"%)) '#$%--5)'$) '#GA+5>"#$% "$%+ >5)$ %4#"")*" @'&$!5)"G(("##")"!)$ %B#"!)$ %$%)*$#!*5)"7 / 0 C1 8*""($"!)+'%!)$ %$#)*" !"## +$%+ >$%-5* #) +5F"))" +$#)?* 5(("##) "5!*5("#)$%5)$ %7)$#"9'$5&"%)) )*"'#" +)*":;"##5-"7= > "$%+ >5)$ %4#"")*"@A"($"!)='%!)$ %B#"!)$ %$%)*$# !*5)"7
Chapter 6 Neighbor Discovery 125 Neighbor Discovery Message Format ND messages use the ICMPv6 message structure and ICMPv6 types 133 through 137.ND messages consist of an ND message header,composed of an ICMPv6 header and ND message specific data,and zero or more ND options.Figure 6-1 shows the format of an ND message. IPv6 Header Neighbor Discovery Neighbor Discovery Next Header =58 Message Header Message Options (ICMPv6) -Neighbor Discovery Message Figure 6-1 The format of an ND message There are five different ND messages: Router Solicitation(ICMPv6 type 133) Router Advertisement (ICMPv6 type 134) Neighbor Solicitation (ICMPv6 type 135) Neighbor Advertisement(ICMPv6 type 136) Redirect(ICMPv6 type 137) ND message options provide additional information,indicating MAC addresses,on-link net- work prefixes,on-link MTU information,redirection data,mobility information,and specific routes. To ensure that ND messages that are received have originated from a node on the local link (either a physical link or a tunnel),all ND messages are sent with a hop limit of 255.When an ND message is received,the Hop Limit field in the IPv6 header is checked.If it is not set to 255,the message is silently discarded.Verifying that the ND message has a hop limit of 255 provides protection from ND-based network attacks that are launched from off-link nodes. With a hop limit of 255,a router could not have forwarded the ND message from an off-link node. Neighbor Discovery Options ND options are formatted in type-length-value(TLV)format.Figure 6-2 shows the TLV format Type Length W Vaive w.· Figure 6-2 The TLV format for ND options
!"#$ %&'%( )*+,--./,-0-,12,345678+,--./,-190:109,.;,-?@@129A0/2?@BC)* +,--./,-:A;-D-1AE.;)*+,--./,2,.A-,,:DED:1DA;-CID/09,8G?-2AJ-12,EA9+.1AE.;)*+,--./,C KL MN OPQRSTUVWSRVXYZUQ[[V\Q ]2,9,.9,ED7,,?@@d _ `A01,9e,?@fd _ ),D/2gA9aAbD:D1.1DA;c3456781=>,?@hd _ ),D/2gA9e,?@8d _ `,,?@Bd )*+,--./,A>1DA;->9A7D9,EDj,-FA;GbD;i5]kD;EA9+.1DA;F9,,:DED: 9A01,-C ]A,;-09,12.1)*+,--./,-12.1.9,9,:,D7,2=-D:.bbD;iA9.10;;,bdF.bb)*+,--./,-.9,-,;1JD12.2A>bD+D1AElhhCm2,;.; )*+,--./,D-9,:,D7,oD+D1ED,bbD+D1AElhh >9A7D9A1,:1DA;E9A+)*Gg.-,bD+D1AElhhF.9A01,9:A0b1DA;-.9,EA9+.11,,Gb,;/12G7.b0,c]opdEA9+.1CID/09,8Gl-2AJ-12,]opEA9+.1C KL Mt OPQOuvRSTUVWRSTYZSwWxSX[ yz{|}~~ ~{~ ~~}~~ ~{~ ~~ ¡¢£ ¤¥¦§¨©¤ª«¨¬ªª¥ ¬® ¯°¥ ¦ ±²³ ´´´