#!/usr/bin/perl # # Copyright (C) 2003 Yokogawa Electric Corporation, # INTAP(Interoperability Technology Association # for Information Processing, Japan). 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. However, using this software for the # purpose of testing or evaluating any products including merchantable # products may be permitted without any notification to the copyrighters. # # # # 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/router-select/raMED_rtinfoHIGH_DEFAULT.seq,v 1.5 2003/04/22 04:26:46 akisada Exp $ # $TINY: RA_GA_Success.seq,v 1.14 2002/03/05 17:13:55 miyata Exp $ # ######################################################################## BEGIN { $V6evalTool::TestVersion = '$Name: REL_2_1_1 $ '; } use V6evalTool; use ROUTE; #------------------------------------------------------ #----- get sequence arguments #------------------------------------------------------ #$howto_initNUT="none"; #$send = "ok"; #$DAD_GA=$DAD_LCNA::DADTransmitsGA; #$DAD_GA =~ tr/a-z/A-Z/ ; checkNUT(host); #----- test condition $IF=Link0; # network interface $totalret=0; # return value $retval=0; # return value vCPP("-DPREF=$ROUTE::MED -DROUTER_LT=$ROUTE::ROUTER_LIFE_TIME"); #--------------------------------------- #----- initialize NUT #--------------------------------------- vLog("*** initialization phase ***"); flushtables($V6evalTool::NutDef{System}); #----- start Capturing vLog("*** Target testing phase ***"); vCapture($IF); vClear($IF); #--------------------------------------- #----- LLA PHASE #----- Wait DAD NS from NUT or timeout #--------------------------------------- vLog("TN wait DAD NS(DADNS_from_NUT) from NUT for $ROUTE::wait_dadns [sec],"); #%ret=vRecv($IF,$WAIT_DADNS,0,0,DADNS_from_NUT); #if ($ret{status} != 0){ # vLog("TN wait DAD NS from NUT for $wait_dadns, but NUT had not transmit DAD NS"); # seqNG(); #} vLog("TN received DAD NS from NUT."); #--------------------------------------- #----- Wait RS from NUT or timeout #--------------------------------------- #%ret=vRecv($IF,$MORE_WAIT_RS,0,0,RS_from_NUT); #if ($ret{status} != 0){ # vLog("TN wait RS from NUT for $MORE_WAIT_RS, but NUT had not transmit RS"); # seqNG(); #} vLog("OK! Let's go ahead!"); #--------------------------------------- #----- SEND RA ( MED vs LOW+RIO_HIGH ) #--------------------------------------- #--------------------------------------- # Router1 #--------------------------------------- vCPP("-DPREF=$ROUTE::MED -DROUTER_LT=$ROUTE::ROUTER_LIFE_TIME"); vClear($IF); vSend($IF, RA_RT1); vSleep($ROUTE::RA_DELAY); vSend($IF, na_tn2nut_sourceLLA_destinationLLA_targetLLA_RT1); #--------------------------------------- # Router2 #--------------------------------------- vClear($IF); vSend($IF, ra_RT2_linkANY_LOW_RTINFO_HIGH_60); vSleep($ROUTE::RA_DELAY); vSend($IF, na_tn2nut_sourceLLA_destinationLLA_targetLLA_RT2); vSleep($ROUTE::NA_DELAY); #--------------------------------------- #----- Ping from Host1 #--------------------------------------- $retval=SendRecv($IF,echo_req_Host1_via_RT1,$IF,echo_rep_Host1_via_RT2); if ($retval != 0){ $totalret++; vLog("NUT did not choose correct Router."); }else{ vLog("NUT choose correct Router."); } #--------------------------------------- #----- Ping from Host2 #--------------------------------------- $retval=SendRecv($IF,echo_req_Host2_via_RT1,$IF,echo_rep_Host2_via_RT2); if ($retval != 0){ $totalret++; vLog("NUT did not choose correct Router."); }else{ vLog("NUT choose correct Router."); } #--------------------------------------- #----- initialize NUT #--------------------------------------- vLog("*** Re-initialization phase ***"); flushtables($V6evalTool::NutDef{System}); vLog("*** Target testing phase ***"); #--------------------------------------- #----- SEND RA ( MED vs LOW+RIO_HIGH ) #--------------------------------------- #--------------------------------------- # Router1 #--------------------------------------- vClear($IF); vSend($IF, ra_RT1_linkANY_LOW_RTINFO_HIGH_60); vSleep($ROUTE::RA_DELAY); vSend($IF, na_tn2nut_sourceLLA_destinationLLA_targetLLA_RT1); #--------------------------------------- # Router2 #--------------------------------------- vCPP("-DPREF=$ROUTE::MED -DROUTER_LT=$ROUTE::ROUTER_LIFE_TIME"); vClear($IF); vSend($IF, RA_RT2); vSleep($ROUTE::RA_DELAY); vSend($IF, na_tn2nut_sourceLLA_destinationLLA_targetLLA_RT2); vSleep($ROUTE::NA_DELAY); #--------------------------------------- #----- Ping from Host1 #--------------------------------------- $retval=SendRecv($IF,echo_req_Host1_via_RT1,$IF,echo_rep_Host1_via_RT1); if ($retval != 0){ $totalret++; vLog("NUT did not choose correct Router."); }else{ vLog("NUT choose correct Router."); } #--------------------------------------- #----- Ping from Host2 #--------------------------------------- $retval=SendRecv($IF,echo_req_Host2_via_RT1,$IF,echo_rep_Host2_via_RT1); if ($retval != 0){ $totalret++; vLog("NUT did not choose correct Router."); }else{ vLog("NUT choose correct Router."); } if ($totalret != 0) { vLog("NUT does not deal with Preference correctly."); seqNG(); }else{ vLog("NUT deals with Preference correctly."); seqOK(); } ########################################################## #end ######################################################################## __END__ =head1 NAME =begin html
RA w/ Preference=MED vs. RA w/ Preference=LOW, Route Information Option (LinkANY:Preference=HIGH)=end html =head1 TARGET =begin html
Host=end html =head1 SYNOPSIS =begin html
raMED_rtinfoHIGH_DEFAULT.seq [-tooloption ...] -pkt RTINFO.def
=end html =head1 TOPOLOGY =begin html-tooloption: v6eval tool option
HOST2 | ---------------+-----------+--- Link2 | RT3 HOST1 | | -------+-------+-------+---+--- Link1 | | RT2 RT1 | | -------+-------+-------+------- Link0 | NUT
=end html =head1 INITIALIZATION =begin html
Link0 global 3ffe:501:ffff:100::/64 Testing link Link1 global 3ffe:501:ffff:101::/64 other link Link2 global 3ffe:501:ffff:102::/64 other link RT1(Link0) global 3ffe:501:ffff:100::a0a0 Alternative router link-local fe80::200:ff:fe00:a0a0 ether 00:00:00:00:a0:a0 RT2(Link0) global 3ffe:501:ffff:100::a1a1 Alternative router link-local fe80::200:ff:fe00:a1a1 ether 00:00:00:00:a1:a1 HOST1 global 3ffe:501:ffff:101::1 Host on Link1 HOST2 global 3ffe:501:ffff:102::1 Host on Link2
=end html =head1 TEST PROCEDURE =begin htmlFlush Default Router List Flush Routing Table Flush Neighbor Cache Flush Prefix List
NUT RT1 RT2 HOST1 HOST2 | | | | | ====================(INITIALIZE)=================== | | | | | | Pref=MED| | | | |<---------------+ | | | RA from RT1 | |LinkANYPref=HIGH| | | | | Pref=LOW| | | |<--------------------------------+ | | RA from RT2 | | | | | |<---------------#------------------------+ | Echo Request (via RT1) +---------------------------------#------>| | Echo Reply (via RT2)(*1) | | | | | |<---------------#--------------------------------+ Echo Request (via RT1) +---------------------------------#-------------->| Echo Reply (via RT2)(*2) | | | | | | | | | | ====================(INITIALIZE)=================== | | | | | |LinkANYPref=HIGH| | | | | Pref=LOW| | | | |<---------------+ | | | RA from RT1 | | Pref=MED| | | |<--------------------------------+ | | RA from RT2 | | | | | |<---------------#------------------------+ | Echo Request (via RT1) +----------------#----------------------->| | Echo Reply (via RT1)(*3) | | | | | |<---------------#--------------------------------+ Echo Request (via RT1) +----------------#------------------------------->| Echo Reply (via RT1)(*4) | | | | | | | | | |
(INITIALIZATION) 1. RT1 Sends RA w/ Preference=MED 2. RT2 Sends RA w/ Preference=LOW, RouteInfoOption(LinkANY:Preference=HIGH) 3. HOST1 Sends Echo Request 4. NUT Sends Echo Reply to HOST1 via RT2(*1) 5. HOST2 Sends Echo Request 6. NUT Sends Echo Reply to HOST2 via RT2(*2) (INITIALIZATION) 7. RT1 Sends RA w/ Preference=LOW, RouteInfoOption(LinkANY:Preference=HIGH) 8. RT2 Sends RA w/ Preference=MED 9. HOST1 Sends Echo Request 10. NUT Sends Echo Reply to HOST1 via RT1(*3) 11. HOST2 Sends Echo Request 12. NUT Sends Echo Reply to HOST2 via RT1(*4)
[NOTIFICATION] LinkANY=(::/0)=end html =head1 JUDGEMENT =begin html
(*1) PASS: HOST1 receives Echo Reply via RT2
(*2) PASS: HOST2 receives Echo Reply via RT2
(*3) PASS: HOST1 receives Echo Reply via RT1
(*4) PASS: HOST2 receives Echo Reply via RT1=end html =head1 SEE ALSO =begin html
ROUTE.pm RTINFO.def=end html =cut