#!/usr/bin/perl
#
# Copyright (C) 1999, 2000, 2001, 2002, 2003 Yokogawa Electric Corporation,
# IPA (Information-technology Promotion Agency, 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/spec/RH_DuplicateAddress.seq,v 1.2 2001/10/05 06:39:18 masaxmasa Exp $
#
######################################################################
BEGIN {
$V6evalTool::TestVersion = '$Name: REL_2_1_1 $';
}
use V6evalTool;
if($V6evalTool::NutDef{Type} ne 'router') {
vLogHTML("This test is for the router only
");
exit $V6evalTool::exitRouterOnly;
}
%pktdesc = (
echo_request_on_link0 => 'Send Echo Request (Link0)',
echo_request_on_link1 => 'Recv Echo Request (Link1)',
echo_request_off_link0 => 'Recv Echo Request (from Link0 to Link1) (Link0)',
echo_request_off_link1 => 'Recv Echo Request (from Link0 to Link1) (Link1)',
echo_request_ex_to_link0 => 'Send Echo Request (Routing Header) (Link0)',
echo_request_ex_to_link1 => 'Recv Echo Request (Routing Header) (Link1)',
echo_request_dupex_to_link0 => 'Send Echo Request (Routing Header with Duplicate Address) (Link0)',
echo_request_dupex_to_link1 => 'Recv Echo Request (Routing Header with Duplicate Address) (Link1)',
echo_reply_on_link0 => 'Recv Echo Reply (Link0)',
echo_reply_on_link1 => 'Recv Echo Reply (Link1)',
unicast_ns_global_link0 => 'Recv Multicast Neighbor Solicitation - global (Link0)',
multicast_ns_global_link0 => 'Recv Multicast Neighbor Solicitation - global (Link0)',
multicast_ns_global_link1 => 'Recv Multicast Neighbor Solicitation - global (Link1)',
multicast_ns_linklocal_link0 => 'Recv Multicast Neighbor Solicitation - link-local (Link0)',
multicast_ns_linklocal_link1 => 'Recv Multicast Neighbor Solicitation - link-local (Link1)',
na_global_link0 => 'Send Neighbor Advertisement - global (Link0)',
na_global_link1 => 'Send Neighbor Advertisement - global (Link1)',
na_linklocal_link0 => 'Send Neighbor Advertisement - link-local (Link0)',
na_linklocal_link1 => 'Send Neighbor Advertisement - link-local (Link1)',
);
######################################################################
$IF0 = Link0;
$IF1 = Link1;
vCapture($IF0);
vCapture($IF1);
vLogHTML(' -- Test Preparation (Link0) --');
vSend($IF0, echo_request_on_link0);
%ret = vRecv($IF0, 5, 0, 0, multicast_ns_global_link0, multicast_ns_linklocal_link0, unicast_ns_global_link0, echo_reply_on_link0);
if($ret{status} != 0) {
vLogHTML('No response from NUT (Link0)
');
goto fail;
}
if($ret{recvFrame} eq 'multicast_ns_global_link0') {
vSend($IF0, na_global_link0);
%ret = vRecv($IF0, 5, 0, 0, echo_reply_on_link0);
if($ret{status} != 0) {
vLogHTML('Cannot receive Echo Reply (Link0)
');
goto fail;
}
}
if($ret{recvFrame} eq 'multicast_ns_linklocal_link0') {
vSend($IF0, na_linklocal_link0);
%ret = vRecv($IF0, 5, 0, 0, echo_reply_on_link0);
if($ret{status} != 0) {
vLogHTML('Cannot receive Echo Reply (Link0)
');
goto fail;
}
}
if($ret{recvFrame} eq 'unicast_ns_global_link0') {
vSend($IF0, na_global_link0);
%ret = vRecv($IF0, 5, 0, 0, echo_reply_on_link0);
if($ret{status} != 0) {
vLogHTML('Cannot receive Echo Reply (Link0)
');
goto fail;
}
}
if($ret{recvFrame} eq 'echo_reply_on_link0') {
vLogHTML('Receive Echo Reply (Link0)
');
vLogHTML('OK');
}
######################################################################
vClear($IF0);
vClear($IF1);
vLogHTML(' -- Test Preparation (Link1) --');
vSend($IF1, echo_request_on_link1);
%ret = vRecv($IF1, 5, 0, 0, multicast_ns_global_link1, multicast_ns_linklocal_link1, unicast_ns_global_link1, echo_reply_on_link1);
if($ret{status} != 0) {
vLogHTML('No response from NUT (Link1)
');
goto fail;
}
if($ret{recvFrame} eq 'multicast_ns_global_link1') {
vSend($IF1, na_global_link1);
%ret = vRecv($IF1, 5, 0, 0, echo_reply_on_link1);
if($ret{status} != 0) {
vLogHTML('Cannot receive Echo Reply (Link1)
');
goto fail;
}
}
if($ret{recvFrame} eq 'multicast_ns_linklocal_link1') {
vSend($IF1, na_linklocal_link1);
%ret = vRecv($IF1, 5, 0, 0, echo_reply_on_link1);
if($ret{status} != 0) {
vLogHTML('Cannot receive Echo Reply (Link1)
');
goto fail;
}
}
if($ret{recvFrame} eq 'unicast_ns_global_link1') {
vSend($IF1, na_global_link1);
%ret = vRecv($IF1, 5, 0, 0, echo_reply_on_link1);
if($ret{status} != 0) {
vLogHTML('Cannot receive Echo Reply (Link1)
');
goto fail;
}
}
if($ret{recvFrame} eq 'echo_reply_on_link1') {
vLogHTML('Receive Echo Reply (Link1)
');
vLogHTML('OK');
}
######################################################################
vSend($IF0, na_global_link0);
vLogHTML('Make NCE certainly (Link0)');
vSend($IF1, na_global_link1);
vLogHTML('Make NCE certainly (Link1)');
vClear($IF0);
vClear($IF1);
vLogHTML(' -- Test Preparation (ICMPv6 Echo) --');
vSend($IF0, echo_request_off_link0);
%ret = vRecv($IF1, 5, 0, 0, echo_request_off_link1);
if($ret{status} != 0) {
vLogHTML('No response from NUT (Link1)
');
goto fail;
}
if($ret{recvFrame} eq 'echo_request_off_link1') {
vLogHTML('Receive Echo Request (Link1)
');
vLogHTML('OK');
}
######################################################################
vSend($IF0, na_global_link0);
vLogHTML('Make NCE certainly (Link0)');
vSend($IF1, na_global_link1);
vLogHTML('Make NCE certainly (Link1)');
vClear($IF0);
vClear($IF1);
vLogHTML(' -- Test Preparation (ICMPv6 Echo, Routing Header) --');
vSend($IF0, echo_request_ex_to_link0);
%ret = vRecv($IF1, 5, 0, 0, echo_request_ex_to_link1);
if($ret{status} != 0) {
vLogHTML('No response from NUT (Link1)
');
goto fail;
}
if($ret{recvFrame} eq 'echo_request_ex_to_link1') {
vLogHTML('Receive Echo Request (Link1)
');
vLogHTML('OK');
}
######################################################################
vSend($IF0, na_global_link0);
vLogHTML('Make NCE certainly (Link0)');
vSend($IF1, na_global_link1);
vLogHTML('Make NCE certainly (Link1)');
vClear($IF0);
vClear($IF1);
vLogHTML(' -- Test --');
vSend($IF0, echo_request_dupex_to_link0);
%ret = vRecv($IF1, 5, 0, 0, echo_request_dupex_to_link1);
if($ret{status} != 0) {
vLogHTML('No response from NUT
');
goto fail;
}
if($ret{recvFrame} eq 'echo_request_dupex_to_link1') {
vLogHTML('Receive Echo Request (Link1)
');
goto pass;
}
goto fail;
######################################################################
pass:
vLogHTML('OK');
exit $V6evalTool::exitPass;
fail:
vLogHTML('NG');
exit $V6evalTool::exitFail;
######################################################################
__END__
=head1 NAME
RH_DuplicateAddress - Routing Header include Duplicate address
=head1 TARGET
Router
=head1 SYNOPSIS
=begin html
RH_DuplicateAddress.seq [-tooloption ...] -pkt RH_DuplicateAddress.def -tooloption : v6eval tool option=end html =head1 INITIALIZATION 1. Check Link0 Global Address Reachability 2. Check Link1 Global Address Reachability 3. Check Global Address Reachability (from Link0 to Link1) 4. Check support of Routing Header =head1 TEST PROCEDURE 1. Send Echo Request (Link0) 2. Receive Echo Request (Link1) Test Topology is: H2 | Link3 ---------+---------+---------- 3ffe:501:ffff:103::/64 | R3 | Link2 ---------+---------+---------- 3ffe:501:ffff:102::/64 | R2(TN) | Link1 ---------+---------+---------- 3ffe:501:ffff:101::/64 | R1(NUT) | Link0 ---------+---------+---------- 3ffe:501:ffff:100::/64 | H1 (TN) Echo Request Data is: IPv6 Header Version = 6 Traffic Class = 0 FlowLabel = 0 PayloadLength = 280 NextHeader = 43 (Routing Header) HopLimit = 64 SourceAddress = H1 - Tester Global Address (Link0) DestinationAddress = R1 (Link0) - Target Global Address (Link0) Routing Header NextHeader = 58 (ICMPv6) HeaderExtLength = 32 RoutingType = 0 SegmentsLeft = 16 Reserved = 0 Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R2 (Link1) - Tester Global Address (Link1) Address = R3 (Link2) Address = H2 ICMPv6 Echo Request Type = 128 (Echo Request) Code = 0 Checksum = (auto) Identifier = 0 SequenceNumber = 0 PayloadData = {1, 2, 3, 4, 5, 6, 7, 8} =head1 JUDGMENT PASS : echo request packet received. FAIL : don't received echo request packet. Echo Request Data is: IPv6 Header Version = 6 TrafficClass = 0 FlowLabel = 0 PayloadLength = 280 NextHeader = 43 (Routing Header) HopLimit = 50 SourceAddress = H1 - Tester Global Address (Link0) DestinationAddress = R2 (Link1) - Tester Global Address (Link1) Routing Header NextHeader = 58 (ICMPv6) HeaderExtLength = 32 RoutingType = 0 SegmentsLeft = 2 Reserved = 0 Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R1 (Link0) - Target Global Address (Link0) Address = R3 (Link2) Address = H2 ICMPv6 Echo Request Type = 128 (Echo Request) Code = 0 Checksum = (auto) Identifier = 0 SequenceNumber = 0 PayloadData = {1, 2, 3, 4, 5, 6, 7, 8} =head1 SEE ALSO perldoc V6evalTool =cut