#!/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/Def_LOW_UNSPEC.seq,v 1.7 2003/04/22 04:26:45 akisada 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
#---------------------------------------
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 ( LOW vs UNSPEC )
#---------------------------------------
vLogHTML("Default Router Preference
LOW vs. UNSPEC");
#---------------------------------------
# Router1
#---------------------------------------
vCPP("-DPREF=$ROUTE::LOW -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
#---------------------------------------
vCPP("-DPREF=$ROUTE::UNSPEC -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("TN did not receive ICMP Echo Reply to Host1 from NUT.");
}else{
vLog("TN received ICMP Echo Reply to Host1 from NUT.");
}
#---------------------------------------
#----- Ping from Host2
#---------------------------------------
$retval=SendRecv($IF,echo_req_Host2_via_RT1,$IF,echo_rep_Host2_via_RT1);
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 ( UNSPEC vs LOW )
#---------------------------------------
vLogHTML("Default Router Preference
UNSPEC vs. LOW");
#---------------------------------------
# Router1
#---------------------------------------
vCPP("-DPREF=$ROUTE::UNSPEC -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
#---------------------------------------
vCPP("-DPREF=$ROUTE::LOW -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_RT2);
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.");
}
#---------------------------------------
#----- Ping from Host2
#---------------------------------------
$retval=SendRecv($IF,echo_req_Host2_via_RT1,$IF,echo_rep_Host2_via_RT2);
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
RA w/ Preference=LOW vs. RA w/ Preference=UNSPEC
=head1 TARGET
=begin html
Host=end html =head1 SYNOPSIS =begin html
Def_LOW_UNSPEC.seq [-tooloption ...] -pkt ROUTE.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=LOW | | | | |<--------------+ | | | RA from RT1 | | Pref=UNSPEC| | | |<------------------------------+ | | RA from RT2 | | | | | |<--------------#-----------------------+ | Echo Request (via RT1) +---------------#---------------------->| | Echo Reply (via RT1)(*1) | | | | | |<--------------#-------------------------------+ Echo Request (via RT1) +---------------#------------------------------>| Echo Reply (via RT1)(*2) | | | | | | | | | | ==================(INITIALIZE)=================== | | | | | | Pref=UNSPEC| | | | |<--------------+ | | | RA from RT1 | | Pref=LOW | | | |<------------------------------+ | | RA from RT2 | | | | | |<--------------#-----------------------+ | Echo Request (via RT1) +-------------------------------#------>| | Echo Reply (via RT2)(*3) | | | | | |<--------------#-------------------------------+ Echo Request (via RT1) +-------------------------------#-------------->| Echo Reply (via RT2)(*4) | | | | | | | | | |
(INITIALIZATION) 1. RT1 Sends RA w/ Preference=LOW 2. RT2 Sends RA w/ Preference=UNSPEC 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 RT1(*2) (INITIALIZATION) 7. RT1 Sends RA w/ Preference=UNSPEC 8. RT2 Sends RA w/ Preference=LOW 9. HOST1 Sends Echo Request 10. NUT Sends Echo Reply to HOST1 via RT2(*3) 11. HOST2 Sends Echo Request 12. NUT Sends Echo Reply to HOST2 via RT2(*4)=end html =head1 JUDGEMENT =begin html
(*1) PASS: HOST1 receives Echo Reply via RT1
(*2) PASS: HOST2 receives Echo Reply via RT1
(*3) PASS: HOST1 receives Echo Reply via RT2
(*4) PASS: HOST2 receives Echo Reply via RT2=end html =head1 SEE ALSO =begin html
ROUTE.pm ROUTE.def=end html =cut