#!/usr/bin/perl # # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Yokogawa Electric Corporation. # All rights reserved. # # Redistribution and use of this software in source and binary # forms, with or without modification, are permitted provided that # the following conditions and disclaimer are agreed and accepted # by the user: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in # the documentation and/or other materials provided with # the distribution. # # 3. Neither the names of the copyrighters, the name of the project # which is related to this software (hereinafter referred to as # "project") nor the names of the contributors may be used to # endorse or promote products derived from this software without # specific prior written permission. # # 4. No merchantable use may be permitted without prior written # notification to the copyrighters. # # 5. The copyrighters, the project and the contributors may prohibit # the use of this software at any time. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHTERS, THE PROJECT AND # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING # BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS # FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. IN NO EVENT SHALL THE # COPYRIGHTERS, THE PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # $TAHI: ct/nd.p2/v6LC_2_2_19.seq,v 1.1 2007/11/27 01:43:43 akisada Exp $ # ######################################################################## use rdisc; BEGIN {} END {} vCapture($Link0); unless(commonSetup_1_1($Link0)) { exitInitFail($Link0); #NOTREACHED } $pktdesc{'local_ra'} = ' Send RA w/ SLL (prefixlen=96): '. 'TR1 (link-local) -> all-nodes multicast address'; $pktdesc{'local_ereq'} = ' Send Echo Request: TN1 (global) -> NUT (global)'; $pktdesc{'local_erep'} = ' Recv Echo Reply: NUT (global) -> TN1 (global)'; $pktdesc{'local_mcast_ns_sll'} = ' Recv NS w/ SLL: NUT (global) -> '. 'TN1 (global) solicited-node multicast address'; $pktdesc{'local_na'} = ' Send NA (rSO) w/ TLL: TN1 (global) -> NUT (global)'; unless(v6LC_2_2_19($Link0)) { exitFail($Link0); #NOTREACHED } exitPass($Link0); #NOTREACHED # # perldoc # ######################################################################## __END__ =head1 NAME =begin html
V6LC_2_2_12_A - Router Advertisement Processing, Cur Hop Limit (Unspecified) =end html =begin html=end html =head1 TARGET =begin html
Host/Router=end html =head1 TOPOLOGY =begin html
=end html =head1 SETUP =begin html| TR1 TN1 NUT | | | ----+-------+-------+--- Link0
Link0 global 3ffe:501:ffff:100::/64 link-local fe80::/64 NUT global 3ffe:501:ffff:100::<NutDef.Link0_addr> link-local fe80::<NutDef.Link0_addr> ether <NutDef.Link0_addr> TR1 global 3ffe:501:ffff:100:200:ff:fe00:a0a0 link-local fe80::200:ff:fe00:a0a0 ether 00:00:00:00:a0:a0 TN1 global 3ffe:501:ffff:100::<TnDef.Link0_addr> link-local fe80::<TnDef.Link0_addr> ether <TnDef.Link0_addr>
This minimal setup procedure provides the NUT with a default router TR1, a global prefix, and ensures that the NUT can communicate with TR1.=end html =head1 TEST PROCEDURE =begin htmlTR1 NUT | | ========= if NUT is a host | | | --> | RA | | * | Wait (MAX_RTR_SOLICITATION_DELAY + RetransTimer * DupAddrDetectTransmits) | | if NUT is a router | | | * configure a default route with TR1 as the next hop | | ========= | | | ----> | Echo Request | <-- | NS | ----> | NA | <---- | Echo Reply | | V V
1. Send RAIPv6 header hop limit = 255 source = TR1 (link-local) destination = all-nodes multicast address RA cur hop limit = 64 M = 0 O = 0 router lifetime = 1800 reachable time = 0 retrans timer = 0 Prefix Information option prefix length = 64 L = 1 A = 1 valid Lifetime = 2592000 preferred lifetime = 604800 prefix = 3ffe:501:ffff:100::2. Wait (MAX_RTR_SOLICITATION_DELAY + RetransTimer * DupAddrDetectTransmits)Host constants: MAX_RTR_SOLICITATION_DELAY: 1 secondNode constants: RETRANS_TIMER : 1,000 millisecondsHost Variables: RetransTimer Default : RETRANS_TIMER millisecondsNode Variables: DupAddrDetectTransmits Default : 13. Send Echo RequestIPv6 header source = TR1 (link-local) destination = NUT (link-local) Echo Request4. Observe NSIPv6 header hop limit = 255 source = NUT (link-local) destination = TR1 (solicited-node multicast address) NS target = TR1 (link-local) SLL option5. Send NAIPv6 header hop limit = 255 source = TR1 (link-local) destination = NUT (link-local) NA R = 1 S = 1 O = 1 target = TR1 (link-local) TLL option6. Observe Echo ReplyIPv6 header source = NUT (link-local) destination = TR1 (link-local) Echo Reply
- Verify that a host properly processes the Cur Hop Limit field of a Router Advertisement.=end html =head1 JUDGEMENT =begin html
TR1 TN1 NUT | | | | | ----> | Echo Request | | <-- | NS [Judgment #1] | | ----> | NA | | <---- | Echo Reply | | | ================= if NUT is a host | --> | | RA | | | if NUT is a router | | * configure the CurHopLimit to value of 0(zero) | | | ================= | | | | | ----> | Echo Request | | <---- | Echo Reply [Judgment #2] | | | V V V
1. Send Echo RequestIPv6 header source = TN1 (link-local) destination = NUT (link-local) Echo Request2. Observe NSIPv6 header hop limit = 255 source = NUT (link-local) destination = TN1 (solicited-node multicast address) NS target = TN1 (link-local) SLL option3. Send NAIPv6 header hop limit = 255 source = TN1 (link-local) destination = NUT (link-local) NA R = 0 S = 1 O = 1 target = TN1 (link-local) TLL option4. Observe Echo ReplyIPv6 header hop limit = 64 source = NUT (link-local) destination = TR1 (link-local) Echo Reply5. Send RAIPv6 header hop limit = 255 source = TR1 (link-local) destination = all-nodes multicast address RA cur hop limit = 0 M = 0 O = 0 router lifetime = 1800 reachable time = 0 retrans timer = 0 Prefix Information option prefix length = 64 L = 1 A = 1 valid Lifetime = 2592000 preferred lifetime = 604800 prefix = 3ffe:501:ffff:100::6. Send Echo RequestIPv6 header source = TN1 (link-local) destination = NUT (link-local) Echo Request7. Observe Echo ReplyIPv6 header hop limit = 64 source = NUT (link-local) destination = TN1 (link-local) Echo Reply
[Judgment #1] The NUT should respond to the Request from TN1. Observe the Hop Limit value in the Echo Reply packet the NUT transmits.=end html =head1 CLEANUP =begin html
[Judgment #2] The NUT should respond to the Request from TN1. The Hop Limit value in the Echo Reply should be the same as was used in step 2.
The Cleanup procedure should cause the NUT to transition Neighbor Cache entries created in this test to state INCOMPLETE and remove any entries from its Default Router and Prefix Lists.=end html =cut # =head1 REFERENCE # # =begin html #TR1 TN1 NUT | | | | --> | | RA | | | | | --> | NA | | | | | ----> | Echo Request | | <---- | Echo Reply | | | | * | Wait (DELAY_FIRST_PROBE_TIME) | | | | | <---- | NS | | <---- | NS | | <---- | NS | | | | --> | | NA | | | | ----> | | Echo Request | <---- | | Echo Reply | | | * | | Wait (DELAY_FIRST_PROBE_TIME) | | | | <---- | | NS | <---- | | NS | <---- | | NS | | | V V V
1. Send RAIPv6 header hop limit = 255 source = TR1 (link-local) destination = all-nodes multicast address RA cur hop limit = 64 M = 0 O = 0 router lifetime = 1800 reachable time = 0 retrans timer = 0 Prefix Information option prefix length = 64 L = 1 A = 1 valid Lifetime = 0 preferred lifetime = 0 prefix = 3ffe:501:ffff:100::2. Send NA w/ TLL (diff)IPv6 header hop limit = 255 source = TN1 (link-local) destination = all-nodes multicast address NA R = 0 S = 0 O = 1 target = TN1 (link-local) TLL option address = TRX (ether)3. Send Echo RequestIPv6 header source = TR1 (link-local) destination = NUT (link-local) Echo Request4. Observe Echo ReplyIPv6 header source = NUT (link-local) destination = TR1 (link-local) Echo Reply5. Wait (DELAY_FIRST_PROBE_TIME)Node constants: DELAY_FIRST_PROBE_TIME: 5 seconds6. Observe MAX_UNICAST_SOLICIT NSsIPv6 header hop limit = 255 source = NUT (link-local) destination = TR1 (link-local) NS target = TR1 (link-local) SLL optionNode constants: MAX_UNICAST_SOLICIT: 3 transmissions7. Send NA w/ TLL (diff)IPv6 header hop limit = 255 source = TR1 (link-local) destination = all-nodes multicast address NA R = 1 S = 0 O = 1 target = TR1 (link-local) TLL option address = TRX (ether)8. Send Echo RequestIPv6 header source = TR1 (link-local) destination = NUT (link-local) Echo Request9. Observe Echo ReplyIPv6 header source = NUT (link-local) destination = TR1 (link-local) Echo Reply10. Wait (DELAY_FIRST_PROBE_TIME)Node constants: DELAY_FIRST_PROBE_TIME: 5 seconds11. Observe MAX_UNICAST_SOLICIT NSsIPv6 header hop limit = 255 source = NUT (link-local) destination = TR1 (link-local) NS target = TR1 (link-local) SLL optionNode constants: MAX_UNICAST_SOLICIT: 3 transmissions
## # =end html # =pod =head1 REFERENCE =begin html# 6.2.1. Router Configuration Variables ### A router MUST allow for the following conceptual variables to be # configured by system management. The specific variable names are # used for demonstration purposes only, and an implementation is not # required to have them, so long as its external behavior is consistent # with that described in this document. Default values are specified # to simplify configuration in common cases. ### The default values for some of the variables listed below may be # overridden by specific documents that describe how IPv6 operates over # different link layers. This rule simplifies the configuration of # Neighbor Discovery over link types with widely differing performance # characteristics. ### For each multicast interface: ### (snip) ### AdvCurHopLimit # The default value to be placed in the Cur Hop Limit # field in the Router Advertisement messages sent by # the router. The value should be set to that # current diameter of the Internet. The value zero # means unspecified (by this router). ### Default: The value specified in the "Assigned # Numbers" RFC [ASSIGNED] that was in effect at the # time of implementation. ### (snip) ### The above variables contain information that is placed in outgoing # Router Advertisement messages. Hosts use the received information to # initialize a set of analogous variables that control their external # behavior (see Section 6.3.2). Some of these host variables (e.g., # CurHopLimit, RetransTimer, and ReachableTime) apply to all nodes # including routers. In practice, these variables may not actually be # present on routers, since their contents can be derived from the # variables described above. # However, external router behavior MUST be the same as host behavior with # respect to these variables. In particular, this includes the occasional # randomization of the ReachableTime value as described in Section 6.3.2. ### Protocol constants are defined in Section 10. ### 6.3.4. Processing Received Router Advertisements ### Some Router Advertisement fields (e.g., Cur Hop Limit, Reachable Time # and Retrans Timer) may contain a value denoting unspecified. In such # cases, the parameter should be ignored and the host should continue # using whatever value it is already using. In particular, a host MUST # NOT interpret the unspecified value as meaning change back to the # default value that was in use before the first Router Advertisement # was received. This rule prevents hosts from continually changing an # internal variable when one router advertises a specific value, but # other routers advertise the unspecified value. ### On receipt of a valid Router Advertisement, a host extracts the # source address of the packet and does the following: ### - If the address is not already present in the host's Default # Router List, and the advertisement's Router Lifetime is non- # zero, create a new entry in the list, and initialize its # invalidation timer value from the advertisement's Router # Lifetime field. ### - If the address is already present in the host's Default Router # List as a result of a previously-received advertisement, reset # its invalidation timer to the Router Lifetime value in the # newly-received advertisement. ### - If the address is already present in the host's Default Router # List and the received Router Lifetime value is zero, immediately # time-out the entry as specified in Section 6.3.5. ### To limit the storage needed for the Default Router List, a host MAY # choose not to store all of the router addresses discovered via # advertisements. However, a host MUST retain at least two router # addresses and SHOULD retain more. Default router selections are made # whenever communication to a destination appears to be failing. Thus, # the more routers on the list, the more likely an alternative working # router can be found quickly (e.g., without having to wait for the # next advertisement to arrive). ### If the received Cur Hop Limit value is non-zero the host SHOULD set # its CurHopLimit variable to the received value. ### If the received Reachable Time value is non-zero the host SHOULD set # its BaseReachableTime variable to the received value. If the new # value differs from the previous value, the host SHOULD recompute a # new random ReachableTime value. ReachableTime is computed as a # uniformly-distributed random value between MIN_RANDOM_FACTOR and # MAX_RANDOM_FACTOR times the BaseReachableTime. Using a random # component eliminates the possibility Neighbor Unreachability # Detection messages synchronize with each other. ### In most cases, the advertised Reachable Time value will be the same # in consecutive Router Advertisements and a host's BaseReachableTime # rarely changes. In such cases, an implementation SHOULD insure that # a new random value gets recomputed at least once every few hours. ### The RetransTimer variable SHOULD be copied from the Retrans Timer # field, if the received value is non-zero. ##
=end html =cutRFC 2461 - Neighbor Discovery for IPv6