#!/usr/bin/perl # # Copyright (C) 2003, 2004, 2005 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/rtinfo_16.seq,v 1.7 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_2 $ '; } 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 $cnt=0; # loop counter $viarouter=0; # Router ID vCPP("-DPREF=$ROUTE::MED -DROUTER_LT=$ROUTE::ROUTER_LIFE_TIME"); #--------------------------------------- #----- initialize NUT #--------------------------------------- vLogHTML("*** Initialization phase ***"); flushtables($V6evalTool::NutDef{System}); #----- start Capturing vLogHTML("*** 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 ( w/ 16 Route Info Opts ) #--------------------------------------- vLogHTML("RA w/ 16 Route Information Options
HIGH-LOW vs. MED-MED
"); #--------------------------------------- # Router1 #--------------------------------------- vClear($IF); vSend($IF, ra_16RtInfo_RT1_HL); vSleep($ROUTE::RA_DELAY); vSend($IF, na_tn2nut_sourceLLA_destinationLLA_targetLLA_RT1); #--------------------------------------- # Router2 #--------------------------------------- vClear($IF); vSend($IF, ra_16RtInfo_RT2_MM); vSleep($ROUTE::RA_DELAY); vSend($IF, na_tn2nut_sourceLLA_destinationLLA_targetLLA_RT2); vSleep($ROUTE::NA_DELAY); for($cnt=1; $cnt<=$ROUTE::MAXRTINFO; $cnt++){ $viarouter=($cnt+1)%2+1; $sndpkt="echo_req_Host"."$cnt"."_via_RT1"; $rcvpkt="echo_rep_Host"."$cnt"."_via_RT"."$viarouter"; #--------------------------------------- #----- Ping from HostN #--------------------------------------- $retval=SendRecv($IF,$sndpkt,$IF,$rcvpkt); if ($retval != 0){ $totalret++; vLog("TN did not receive ICMP Echo Reply to Host1 from NUT."); }else{ vLog("TN received ICMP Echo Reply to Host1 from NUT."); } } #--------------------------------------- #----- initialize NUT #--------------------------------------- vLogHTML("*** Re-initialization phase ***"); flushtables($V6evalTool::NutDef{System}); #----- start Capturing vLogHTML("*** Testing phase ***"); #--------------------------------------- #----- SEND RA ( w/ 16 Route Info Opts ) #--------------------------------------- vLogHTML("RA w/ 16 Route Information Options
HIGH-LOW vs. MED-MED
"); #--------------------------------------- # Router1 #--------------------------------------- vClear($IF); vSend($IF, ra_16RtInfo_RT1_MM); vSleep($ROUTE::RA_DELAY); vSend($IF, na_tn2nut_sourceLLA_destinationLLA_targetLLA_RT1); #--------------------------------------- # Router2 #--------------------------------------- vClear($IF); vSend($IF, ra_16RtInfo_RT2_HL); vSleep($ROUTE::RA_DELAY); vSend($IF, na_tn2nut_sourceLLA_destinationLLA_targetLLA_RT2); vSleep($ROUTE::NA_DELAY); for($cnt=1; $cnt<=$ROUTE::MAXRTINFO; $cnt++){ $viarouter=$cnt%2+1; $sndpkt="echo_req_Host"."$cnt"."_via_RT1"; $rcvpkt="echo_rep_Host"."$cnt"."_via_RT"."$viarouter"; #--------------------------------------- #----- Ping from HostN #--------------------------------------- $retval=SendRecv($IF,$sndpkt,$IF,$rcvpkt); if ($retval != 0){ $totalret++; vLog("TN did not receive ICMP Echo Reply to Host1 from NUT."); }else{ vLog("TN received ICMP Echo Reply to Host1 from NUT."); } } 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/ 16 Route Information Options
=end html =head1 TARGET =begin html
Host
=end html =head1 SYNOPSIS =begin html
rtinfo_16.seq [-tooloption ...] -pkt RTINFO.def
-tooloption: v6eval tool option
=end html =head1 TOPOLOGY =begin html
                                     HOST16
                                       |
            ---------------+-----------+--- Link16
                           |
                          RT17       HOST15
                           |           |
            -------+-------+-----------+--- Link15
                   |
                   :
                (SNIP)
                   :                 HOST2
                   |                   |
            -------+-------+-----------+--- Link2
                           |
                          RT3        HOST1
                           |           |
            -------+-------+-------+---+--- Link1
                   |               |
                   RT2            RT1
                   |               |
            -------+-------+-------+------- Link0
                           |
                          NUT
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
:
:
:
:
(SNIP)
(SNIP)
(SNIP)
(SNIP)
:
:
:
:
HOST15 global 3ffe:501:ffff:115::1 Host on Link15
HOST16 global 3ffe:501:ffff:116::1 Host on Link16
=end html =head1 INITIALIZATION =begin html
Flush Default Router List
Flush Routing Table
Flush Neighbor Cache
Flush Prefix List
=end html =head1 TEST PROCEDURE =begin html
NUT             RT1             RT2    HOST[1~16]
 |               |               |       |
 ==================(INITIALIZE)===========
 |               |               |       |
 |Link16Pref=LOW |               |       |
 |Link15Pref=HIGH|               |       |
 |     :         |               |       |
 | Link2Pref=LOW |               |       |
 | Link1Pref=HIGH|               |       |
 |       Pref=MED|               |       |
 |<--------------+               |       | RA from RT1
 |               | Link16Pref=MED|       |
 |               | Link15Pref=MED|       |
 |               |      :        |       |
 |               |  Link2Pref=MED|       |
 |               |  Link1Pref=MED|       |
 |               |       Pref=MED|       |
 |<------------------------------+       | RA from RT2
 |               |               |       |
 |<--------------#-----------------------+ Echo Request from HOST1(via RT1) 
 +---------------#---------------------->| Echo Reply   to   HOST1(via RT1)(*1)
 |               |               |       |
 |<--------------#-----------------------+ Echo Request from HOST2(via RT1) 
 +-------------------------------#------>| Echo Reply   to   HOST2(via RT2)(*2)
 |               |               |       |
 :               :               :       :
                   (SNIP)
 :               :               :       :
 |               |               |       |
 |<--------------#-----------------------+ Echo Request from HOST15(via RT1) 
 +---------------#---------------------->| Echo Reply   to   HOST15(via RT1)(*15)
 |               |               |       |
 |<--------------#-----------------------+ Echo Request from HOST16(via RT1) 
 +-------------------------------#------>| Echo Reply   to   HOST16(via RT2)(*16)
 |               |               |       |
 |               |               |       |
 ==================(INITIALIZE)===========
 |               |               |       |
 | Link16Pref=MED|               |       |
 | Link15Pref=MED|               |       |
 |      :        |               |       |
 |  Link2Pref=MED|               |       |
 |  Link1Pref=MED|               |       |
 |       Pref=MED|               |       |
 |<--------------+               |       | RA from RT1
 |               |Link16Pref=LOW |       |
 |               |Link15Pref=HIGH|       |
 |               |     :         |       |
 |               | Link2Pref=LOW |       |
 |               | Link1Pref=HIGH|       |
 |               |       Pref=MED|       |
 |<------------------------------+       | RA from RT2
 |               |               |       |
 |<--------------#-----------------------+ Echo Request from HOST1(via RT1) 
 +-------------------------------#------>| Echo Reply   to   HOST1(via RT2)(*17)
 |               |               |       |
 |<--------------#-----------------------+ Echo Request from HOST2(via RT1) 
 +---------------#---------------------->| Echo Reply   to   HOST2(via RT1)(*18)
 |               |               |       |
 :               :               :       :
                   (SNIP)
 :               :               :       :
 |               |               |       |
 |<--------------#-----------------------+ Echo Request from HOST15(via RT1) 
 +-------------------------------#------>| Echo Reply   to   HOST15(via RT2)(*31)
 |               |               |       |
 |<--------------#-----------------------+ Echo Request from HOST16(via RT1) 
 +---------------#---------------------->| Echo Reply   to   HOST16(via RT1)(*32)
 |               |               |       |

(INITIALIZATION)
1. RT1 Sends RA w/ 16 RouteInfoOptions
2. RT2 Sends RA w/ 16 RouteInfoOptions
3. HOST1 Sends Echo Request
4. NUT Sends Echo Reply to HOST1 via RT1(*1)
5. HOST2 Sends Echo Request
6. NUT Sends Echo Reply to HOST2 via RT2(*2)
(SNIP)
31. HOST15 Sends Echo Request
32. NUT Sends Echo Reply to HOST15 via RT1(*15)
33. HOST16 Sends Echo Request
34. NUT Sends Echo Reply to HOST16 via RT2(*16)
(INITIALIZATION)
35. RT1 Sends RA w/ 16 RouteInfoOptions
36. RT2 Sends RA w/ 16 RouteInfoOptions
37. HOST1 Sends Echo Request
38. NUT Sends Echo Reply to HOST1 via RT2(*17)
39. HOST2 Sends Echo Request
40. NUT Sends Echo Reply to HOST2 via RT1(*18)
(SNIP)
65. HOST15 Sends Echo Request
66. NUT Sends Echo Reply to HOST15 via RT2(*31)
67. HOST16 Sends Echo Request
68. NUT Sends Echo Reply to HOST16 via RT1(*32)
=end html =head1 JUDGEMENT =begin html
(*1)
    PASS: HOST1 receives Echo Reply via RT1
(*2)
    PASS: HOST2 receives Echo Reply via RT2
 :
(SNIP)
 :
(*15)
    PASS: HOST15 receives Echo Reply via RT1
(*16)
    PASS: HOST16 receives Echo Reply via RT2
(*17)
    PASS: HOST1 receives Echo Reply via RT2
	(*1~16)
	Echo reply to HOST(2n-1) via RT1
	Echo reply to HOST(2n) via RT2
	1<=n<=8
(*18)
    PASS: HOST2 receives Echo Reply via RT1
 :
(SNIP)
 :
(*31)
    PASS: HOST15 receives Echo Reply via RT2
(*32)
    PASS: HOST16 receives Echo Reply via RT1
	(*17~32)
	Echo reply to HOST(2n-1) via RT2
	Echo reply to HOST(2n) via RT1
	9<=n<=16
=end html =head1 SEE ALSO =begin html
ROUTE.pm
RTINFO.def
=end html =cut