#!/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/Def_MED_MED.seq,v 1.8 2003/04/22 04:26:45 akisada 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 $ROUTER_LIFE_TIME=60; $RT1cnt=0; $RT2cnt=0; 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!"); #--------------------------------------- #----- RA PHASE #--------------------------------------- vLogHTML("Default Pref=MEDIUM vs. Default Pref=MEDIUM"); #--------------------------------------- # Router1 #--------------------------------------- vCPP("-DPREF=$ROUTE::MED -DROUTER_LT=$ROUTER_LIFE_TIME"); vClear($IF); vSend($IF, RA_RT1); vSleep($ROUTE::RA_DELAY); vSend($IF, na_tn2nut_sourceLLA_destinationLLA_targetLLA_RT1); #--------------------------------------- # Router2 #--------------------------------------- vCPP("-DPREF=$ROUTE::MED -DROUTER_LT=$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=SendRecvRetFrame(\$Frame,$IF,echo_req_Host1_via_RT1, $IF, echo_rep_Host1_via_RT1, echo_rep_Host1_via_RT2); if ($retval != 0){ vLog("TN did not receive ICMP Echo Reply to Host1 from NUT."); }else{ if($Frame eq 'echo_rep_Host1_via_RT1' ) { $RT1cnt++; }else{ $RT2cnt++; } vLog("TN received ICMP Echo Reply to Host1 from NUT."); } #--------------------------------------- #----- Ping from Host2 #--------------------------------------- $retval=SendRecvRetFrame(\$Frame,$IF,echo_req_Host2_via_RT1,$IF, echo_rep_Host2_via_RT1, echo_rep_Host2_via_RT2); if ($retval != 0){ vLog("TN did not receive ICMP Echo Reply to Host2 from NUT."); }else{ if($Frame eq 'echo_rep_Host2_via_RT1' ) { $RT1cnt++; }else{ $RT2cnt++; } vLog("TN received ICMP Echo Reply to Host2 from NUT."); } #--------------------------------------- #----- Ping from Host3 #--------------------------------------- $retval=SendRecvRetFrame(\$Frame,$IF,echo_req_Host3_via_RT1,$IF, echo_rep_Host3_via_RT1, echo_rep_Host3_via_RT2); if ($retval != 0){ vLog("TN did not receive ICMP Echo Reply to Host3 from NUT."); }else{ if($Frame eq 'echo_rep_Host3_via_RT1' ) { $RT1cnt++; }else{ $RT2cnt++; } vLog("TN received ICMP Echo Reply to Host3 from NUT."); } #--------------------------------------- #----- Ping from Host4 #--------------------------------------- $retval=SendRecvRetFrame(\$Frame,$IF,echo_req_Host4_via_RT1,$IF, echo_rep_Host4_via_RT1, echo_rep_Host4_via_RT2); if ($retval != 0){ vLog("TN did not receive ICMP Echo Reply to Host4 from NUT."); }else{ if($Frame eq 'echo_rep_Host4_via_RT1' ) { $RT1cnt++; }else{ $RT2cnt++; } vLog("TN received ICMP Echo Reply to Host4 from NUT."); } #--------------------------------------- #----- Ping from Host5 #--------------------------------------- $retval=SendRecvRetFrame(\$Frame,$IF,echo_req_Host5_via_RT1,$IF, echo_rep_Host5_via_RT1, echo_rep_Host5_via_RT2); if ($retval != 0){ vLog("TN did not receive ICMP Echo Reply to Host5 from NUT."); }else{ if($Frame eq 'echo_rep_Host5_via_RT1' ) { $RT1cnt++; }else{ $RT2cnt++; } vLog("TN received ICMP Echo Reply to Host5 from NUT."); } #--------------------------------------- #----- Ping from Host6 #--------------------------------------- $retval=SendRecvRetFrame(\$Frame,$IF,echo_req_Host6_via_RT1,$IF, echo_rep_Host6_via_RT1, echo_rep_Host6_via_RT2); if ($retval != 0){ vLog("TN did not receive ICMP Echo Reply to Host6 from NUT."); }else{ if($Frame eq 'echo_rep_Host6_via_RT1' ) { $RT1cnt++; }else{ $RT2cnt++; } vLog("TN received ICMP Echo Reply to Host6 from NUT."); } #--------------------------------------- #----- Ping from Host7 #--------------------------------------- $retval=SendRecvRetFrame(\$Frame,$IF,echo_req_Host7_via_RT1,$IF, echo_rep_Host7_via_RT1, echo_rep_Host7_via_RT2); if ($retval != 0){ vLog("TN did not receive ICMP Echo Reply to Host7 from NUT."); }else{ if($Frame eq 'echo_rep_Host7_via_RT1' ) { $RT1cnt++; }else{ $RT2cnt++; } vLog("TN received ICMP Echo Reply to Host7 from NUT."); } #--------------------------------------- #----- Ping from Host8 #--------------------------------------- $retval=SendRecvRetFrame(\$Frame,$IF,echo_req_Host8_via_RT1,$IF, echo_rep_Host8_via_RT1, echo_rep_Host8_via_RT2); if ($retval != 0){ vLog("TN did not receive ICMP Echo Reply to Host8 from NUT."); }else{ if($Frame eq 'echo_rep_Host8_via_RT1' ) { $RT1cnt++; }else{ $RT2cnt++; } vLog("TN received ICMP Echo Reply to Host8 from NUT."); } #--------------------------------------- #----- Ping from Host9 #--------------------------------------- $retval=SendRecvRetFrame(\$Frame,$IF,echo_req_Host9_via_RT1,$IF, echo_rep_Host9_via_RT1, echo_rep_Host9_via_RT2); if ($retval != 0){ vLog("TN did not receive ICMP Echo Reply to Host9 from NUT."); }else{ if($Frame eq 'echo_rep_Host9_via_RT1' ) { $RT1cnt++; }else{ $RT2cnt++; } vLog("TN received ICMP Echo Reply to Host9 from NUT."); } #--------------------------------------- #----- Ping from Host10 #--------------------------------------- $retval=SendRecvRetFrame(\$Frame,$IF,echo_req_Host10_via_RT1,$IF, echo_rep_Host10_via_RT1, echo_rep_Host10_via_RT2); if ($retval != 0){ vLog("TN did not receive ICMP Echo Reply to Host10 from NUT."); }else{ if($Frame eq 'echo_rep_Host10_via_RT1' ) { $RT1cnt++; }else{ $RT2cnt++; } vLog("TN received ICMP Echo Reply to Host10 from NUT."); } #--------------------------------- # Judgement #--------------------------------- if ($RT1cnt > 0 && $RT2cnt > 0){ vLog("NUT seems to deliver packet in ramdom."); }else{ $totalret++; vLog("NUT does NOT seem to deliver packet in ramdom."); vLog("Default route for above 10 nodes are always same."); } if (($RT1cnt + $RT2cnt) == 10){ vLog("NUT replyed to all PING."); }else{ $totalret++; vLog("NUT does NOT replyed to all PING."); } vLogHTML("RT1:RT2=$RT1cnt:$RT2cnt"); if ($totalret != 0) { seqNG(); }else{ seqOK(); } ########################################################## #end ######################################################################## __END__ =head1 NAME RA w/ Preference=MED vs. RA w/ Preference=MED =head1 TARGET =begin html
Host
=end html =head1 SYNOPSIS =begin html
Def_MED_MED.seq [-tooloption ...] -pkt ROUTE.def
-tooloption: v6eval tool option
=end html =head1 TOPOLOGY =begin html
                                     HOST10
                                       |
            ---------------+-----------+--- Link10
                           |
                          RT11       HOST9
                           |           |
            -------+-------+-----------+--- Link9
                   |
                   :
                (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
Link3 global 3ffe:501:ffff:103::/64 other link
Link4 global 3ffe:501:ffff:104::/64 other link
Link5 global 3ffe:501:ffff:105::/64 other link
Link6 global 3ffe:501:ffff:106::/64 other link
Link7 global 3ffe:501:ffff:107::/64 other link
Link8 global 3ffe:501:ffff:108::/64 other link
Link9 global 3ffe:501:ffff:109::/64 other link
Link10 global 3ffe:501:ffff:110::/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
RT3~11 ..... no data is required .....
HOST1 global 3ffe:501:ffff:101::1 Host on Link1
HOST2 global 3ffe:501:ffff:102::1 Host on Link2
HOST3 global 3ffe:501:ffff:103::1 Host on Link3
HOST4 global 3ffe:501:ffff:104::1 Host on Link4
HOST5 global 3ffe:501:ffff:105::1 Host on Link5
HOST6 global 3ffe:501:ffff:106::1 Host on Link6
HOST7 global 3ffe:501:ffff:107::1 Host on Link7
HOST8 global 3ffe:501:ffff:108::1 Host on Link8
HOST9 global 3ffe:501:ffff:109::1 Host on Link9
HOST10 global 3ffe:501:ffff:110::1 Host on Link10
=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~10]
 |           |           |       |
 ===========(INITIALIZE)===========
 |           |           |       |
 |   Pref=MED|           |       |
 |<----------+           |       | RA from RT1
 |           |   Pref=MED|       |
 |<----------------------+       | RA from RT2
 |           |           |       |
 |<----------#-------------------+ Echo Request from HOST1(via RT1) 
 +----------(#)---------(#)----->| Echo Reply   to   HOST1(via RT1 or RT2)(*1)
 |           |           |       |
 |<----------#-------------------+ Echo Request from HOST2(via RT1) 
 +----------(#)---------(#)----->| Echo Reply   to   HOST2(via RT1 or RT2)(*2)
 |           |           |       |
 |<----------#-------------------+ Echo Request from HOST3(via RT1) 
 +----------(#)---------(#)----->| Echo Reply   to   HOST3(via RT1 or RT2)(*3)
 |           |           |       |
 |<----------#-------------------+ Echo Request from HOST4(via RT1) 
 +----------(#)---------(#)----->| Echo Reply   to   HOST4(via RT1 or RT2)(*4)
 |           |           |       |
 |<----------#-------------------+ Echo Request from HOST5(via RT1) 
 +----------(#)---------(#)----->| Echo Reply   to   HOST5(via RT1 or RT2)(*5)
 |           |           |       |
 |<----------#-------------------+ Echo Request from HOST6(via RT1) 
 +----------(#)---------(#)----->| Echo Reply   to   HOST6(via RT1 or RT2)(*6)
 |           |           |       |
 |<----------#-------------------+ Echo Request from HOST7(via RT1) 
 +----------(#)---------(#)----->| Echo Reply   to   HOST7(via RT1 or RT2)(*7)
 |           |           |       |
 |<----------#-------------------+ Echo Request from HOST8(via RT1) 
 +----------(#)---------(#)----->| Echo Reply   to   HOST8(via RT1 or RT2)(*8)
 |           |           |       |
 |<----------#-------------------+ Echo Request from HOST9(via RT1) 
 +----------(#)---------(#)----->| Echo Reply   to   HOST9(via RT1 or RT2)(*9)
 |           |           |       |
 |<----------#-------------------+ Echo Request from HOST10(via RT1) 
 +----------(#)---------(#)----->| Echo Reply   to   HOST10(via RT1 or RT2)(*10)
 |           |           |       |
 |           |           |       | Check the ratio RT1:RT2(*11)

(INITIALIZATION)
1. RT1 Sends RA w/ Preference=MED
2. RT2 Sends RA w/ Preference=MED
3. HOST1 Sends Echo Request
4. NUT Sends Echo Reply to HOST1 via RT1 or RT2(*1)
5. HOST2 Sends Echo Request
6. NUT Sends Echo Reply to HOST2 via RT1 or RT2(*2)
7. HOST3 Sends Echo Request
8. NUT Sends Echo Reply to HOST3 via RT1 or RT2(*3)
9. HOST4 Sends Echo Request
10. NUT Sends Echo Reply to HOST4 via RT1 or RT2(*4)
11. HOST5 Sends Echo Request
12. NUT Sends Echo Reply to HOST5 via RT1 or RT2(*5)
13. HOST6 Sends Echo Request
14. NUT Sends Echo Reply to HOST6 via RT1 or RT2(*6)
15. HOST7 Sends Echo Request
16. NUT Sends Echo Reply to HOST7 via RT1 or RT2(*7)
17. HOST8 Sends Echo Request
18. NUT Sends Echo Reply to HOST8 via RT1 or RT2(*8)
19. HOST9 Sends Echo Request
20. NUT Sends Echo Reply to HOST9 via RT1 or RT2(*9)
21. HOST10 Sends Echo Request
22. NUT Sends Echo Reply to HOST10 via RT1 or RT2(*10)
23. Check the ratio RT1:RT2(*11)
=end html =head1 JUDGEMENT =begin html
(*1)
    PASS: HOST1 receives Echo Reply via RT1 or RT2
(*2)
    PASS: HOST2 receives Echo Reply via RT1 or RT2
(*3)
    PASS: HOST3 receives Echo Reply via RT1 or RT2
(*4)
    PASS: HOST4 receives Echo Reply via RT1 or RT2
(*5)
    PASS: HOST5 receives Echo Reply via RT1 or RT2
(*6)
    PASS: HOST6 receives Echo Reply via RT1 or RT2
(*7)
    PASS: HOST7 receives Echo Reply via RT1 or RT2
(*8)
    PASS: HOST8 receives Echo Reply via RT1 or RT2
(*9)
    PASS: HOST9 receives Echo Reply via RT1 or RT2
(*10)
    PASS: HOST10 receives Echo Reply via RT1 or RT2
(*11)
    Number of ICMP Echo Reply via RT1 = RepRT1
    Number of ICMP Echo Reply via RT2 = RepRT2
    PASS: (RepRT1:RepRT2 = n:10-n)  1<=n<=9
=end html =head1 SEE ALSO =begin html
ROUTE.pm
ROUTE.def
=end html =cut