#!/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_10.seq,v 1.4 2005/04/13 06:30:49 akisada Exp $ # ######################################################################## use rdisc; BEGIN {} END {} if($V6evalTool::NutDef{'Type'} ne 'host') { exitRouterOnly($Link0); #NOTREACHED } vCapture($Link0); $pktdesc{'local_ra_tr1'} = ' Send RA (rltime=45, rtime=10000) w/o SLL: '. 'TR1 (link-local) -> all-nodes multicast address'; $pktdesc{'local_ra_tr2'} = ' Send RA (rltime=45, rtime=10000) w/o SLL: '. 'TR2 (link-local) -> all-nodes multicast address'; unless(v6LC_2_2_10($Link0)) { exitFail($Link0); #NOTREACHED } exitPass($Link0); #NOTREACHED # # perldoc # ######################################################################## __END__ =head1 NAME =begin html
V6LC_2_2_10 - Default Router Switch =end html =begin html=end html =head1 TARGET =begin html
Host=end html =head1 TOPOLOGY =begin html
=end html =head1 SETUP =begin htmlTN2 | ----+-------+-------+--- LinkX | | TR1 TR2 HUT | | | ----+-------+-------+--- Link0
Link0 global 3ffe:501:ffff:100::/64 link-local fe80::/64 LinkX global 3ffe:501:ffff::/64 link-local fe80::/64 TR1 global 3ffe:501:ffff:100:200:ff:fe00:a0a0 link-local fe80::200:ff:fe00:a0a0 ether 00:00:00:00:a0:a0 TR2 global 3ffe:501:ffff:100:200:ff:fe00:a1a1 link-local fe80::200:ff:fe00:a1a1 ether 00:00:00:00:a1:a1 HUT global 3ffe:501:ffff:100::<NutDef.Link0_addr> link-local fe80::<NutDef.Link0_addr> ether <NutDef.Link0_addr> TN2 global 3ffe:501:ffff::<TnDef.Link0_addr> link-local fe80::<TnDef.Link0_addr> ether <TnDef.Link0_addr> HUT global 3ffe:501:ffff:100::<NutDef.Link0_addr> link-local fe80::<NutDef.Link0_addr> ether <NutDef.Link0_addr>
=end html =head1 TEST PROCEDURE =begin htmlnone
- Verify that a host maintains at least two routers in its Default Router List and will switch routers when the router in use fails.=end html =head1 JUDGEMENT =begin html
TN2 TR1 TR2 HUT | | | | | | --> | | RA (multicast) | | | | | ------+-------------> | Echo Request (via TR1) | | | <-- | NS (multicast) [Judgment #1] | | ------------> | NA | <-----+-------------- | Echo Reply (via TR1) [Judgment #1] | | | | | | | --> | RA (multicast) | | | | | ------+-------------> | Echo Request (via TR1) | <-----+-------------- | Echo Reply (via TR1) | | | | | * | | Reachable Time expires | | | | | ------+-------------> | Echo Request (via TR1) | | <------------ | NS [Judgment #2] | | <------------ | NS | | <------------ | NS | | | | | ------+-------------> | Echo Request (via TR1) | | | <-- | (multicast) [Judgment #3] | | | | V 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 = 45 reachable time = 10000 retrans timer = 1000 Prefix Information option prefix length = 64 L = 1 A = 1 valid Lifetime = 2592000 preferred lifetime = 604800 prefix = 3ffe:501:ffff:100::2. Send Echo RequestIPv6 header source = TN2 (global) destination = HUT (global) Echo Request3. Observe NSIPv6 header hop limit = 255 source = HUT (link-local) destination = TR1 (solicited-node multicast address) NS target = TR1 (link-local) SLL option4. Send NAIPv6 header hop limit = 255 source = TR1 (link-local) destination = HUT (link-local) NA R = 1 S = 1 O = 1 target = TR1 (link-local) TLL option5. Observe Echo ReplyIPv6 header source = HUT (global) destination = TN2 (global) Echo Reply6. Send RAIPv6 header hop limit = 255 source = TR2 (link-local) destination = all-nodes multicast address RA cur hop limit = 64 M = 0 O = 0 router lifetime = 45 reachable time = 10000 retrans timer = 1000 Prefix Information option prefix length = 64 L = 1 A = 1 valid Lifetime = 2592000 preferred lifetime = 604800 prefix = 3ffe:501:ffff:100::7. Send Echo Request every 3 seconds for 30 secondsIPv6 header source = TN2 (global) destination = HUT (global) Echo Request8. Observe MAX_UNICAST_SOLICIT NSs, when reachable time expires.IPv6 header hop limit = 255 source = HUT (link-local) destination = TR1 (link-local) NS target = TR1 (link-local) SLL optionNode constants: MAX_UNICAST_SOLICIT: 3 transmissions9. Send Echo RequestIPv6 header source = TN2 (global) destination = HUT (global) Echo Request10. Observe MAX_MULTICAST_SOLICIT NSsIPv6 header hop limit = 255 source = HUT (link-local) destination = TR2 (solicited-node multicast address) NS target = TR2 (link-local) SLL optionNode constants: MAX_MULTICAST_SOLICIT: 3 transmissions
[Judgment #1] The HUT should transmit a Neighbor Solicitation with a Target Address equal to TR1's link-local address. The HUT should send an Echo Reply to TN2 via TR1 in response to Packet A.=end html =head1 CLEANUP =begin html
[Judgment #2] The HUT should send Echo Replies to TR1's link local address until Reachable Time expires. When Reachable Time expires, the HUT should send 3 Neighbor Solicitations to TR1's link local address.
[Judgment #3] The HUT selects TR2 from its Default Router list. The HUT sends Neighbor Solicitations to TR2's link local address. After sending the packets to TR2, the HUT probes TR2 as a side effect.
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 TR2 HUT | | | | --> | | RA | | | | | --> | RA | | | 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 = 0 reachable time = 30000 retrans timer = 1000 Prefix Information option prefix length = 64 L = 1 A = 1 valid Lifetime = 0 preferred lifetime = 0 prefix = 3ffe:501:ffff:100::2. Send RAIPv6 header hop limit = 255 source = TR2 (link-local) destination = all-nodes multicast address RA cur hop limit = 64 M = 0 O = 0 router lifetime = 0 reachable time = 30000 retrans timer = 1000 Prefix Information option prefix length = 64 L = 1 A = 1 valid Lifetime = 0 preferred lifetime = 0 prefix = 3ffe:501:ffff:100::
## # =end html # =pod =head1 REFERENCE =begin html# 5.3. Garbage Collection and Timeout Requirements ### The conceptual data structures described above use different # mechanisms for discarding potentially stale or unused information. ### From the perspective of correctness there is no need to periodically # purge Destination and Neighbor Cache entries. Although stale # information can potentially remain in the cache indefinitely, the # Neighbor Unreachability Detection algorithm ensures that stale # information is purged quickly if it is actually being used. ### To limit the storage needed for the Destination and Neighbor Caches, # a node may need to garbage-collect old entries. However, care must # be taken to insure that sufficient space is always present to hold # the working set of active entries. A small cache may result in an # excessive number of Neighbor Discovery messages if entries are # discarded and rebuilt in quick succession. Any LRU-based policy that # only reclaims entries that have not been used in some time (e.g., ten # minutes or more) should be adequate for garbage-collecting unused # entries. ### A node should retain entries in the Default Router List and the # Prefix List until their lifetimes expire. However, a node may # garbage collect entries prematurely if it is low on memory. If not # all routers are kept on the Default Router list, a node should retain # at least two entries in the Default Router List (and preferably more) # in order to maintain robust connectivity for off-link destinations. ### When removing an entry from the Prefix List there is no need to purge # any entries from the Destination or Neighbor Caches. Neighbor # Unreachability Detection will efficiently purge any entries in these # caches that have become invalid. When removing an entry from the # Default Router List, however, any entries in the Destination Cache # that go through that router must perform next-hop determination again # to select a new default router. ##
=end html =cutRFC 2461 - Neighbor Discovery for IPv6