#!/usr/bin/perl
#
# Copyright (C) 2002, 2003, 2004, 2005 Yokogawa Electric Corporation,
# INTAP(Interoperability Technology Association for Information
# Processing, Japan), 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.
# $TINY: confirmPing.seq,v 1.9 2002/03/05 02:59:11 masaxmasa Exp $
#
########################################################################
BEGIN { $V6evalTool::TestVersion = '$Name: REL_2_1_2 $ '; }
use V6evalTool;
use PMTU;
$IF=Link0;
$WAIT_TO_FIN_DAD=5;
%pktdesc = (
echo_request_64 => 'TN ---ICMP Echo Request (64Byte)----> NUT',
echo_reply_64 => 'TN <--ICMP Echo Reply (64Byte)----- NUT',
echo_request_1280 => 'TN ---ICMP Echo Request (1280Byte)--> NUT',
echo_reply_1280 => 'TN <--ICMP Echo Reply (1280Byte)--- NUT',
echo_request_1500 => 'TN ---ICMP Echo Request (1500Byte)--> NUT',
echo_reply_1500 => 'TN <--ICMP Echo Reply (1500Byte)--- NUT',
);
vLogHTML("Confirm if NUT can reply for variable size of ICMP Echo Request");
# Initialize
vCapture($IF);
vClear($IF);
flushtables($V6evalTool::NutDef{System});
if ($V6evalTool::NutDef{Type} eq "router"){
initNUT();
}else{
vSend($IF,ra);
vLogHTML("Ignoring DAD packets");
vSleep($WAIT_TO_FIN_DAD);
# vSend($IF,na);
}
$MaxPktSize=0;
vClear($IF);
#
# Test for 64 Byte
#
vSend($IF, echo_request_64);
%ret=vRecv($IF,5,0,0, echo_reply_64,ns,ns_srcGlobal);
if( $ret{status} != 0) {
vLogHTML("NUT can not Reply for ICMP Echo Request (size=64)
");
vLogHTML('NG');
vLogHTML("FAIL");
exit $V6evalTool::exitFail;
}elsif( $ret{recvFrame} eq 'ns' || $ret{recvFrame} eq 'ns_srcGlobal') {
if( $ret{recvFrame} eq 'ns' ) {
PMTU::sendNA();
}elsif( $ret{recvFrame} eq 'ns_srcGlobal' ) {
PMTU::sendNA_srcGlobal();
}
%ret=vRecv($IF, 5,0,0,echo_reply_64);
if( $ret{status} != 0) {
vLogHTML("TN COULD NOT receive Echo Reply from NUT
");
vLogHTML('NG');
vClear($IF);
exit $V6evalTool::exitFail;
}else {
# Correct Case
vLogHTML("TN received Echo Reply from NUT
");
vLogHTML('OK');
$MaxPktSize=64;
}
}else {
# Correct Case
vLogHTML("TN received Echo Reply from NUT
");
vLogHTML('OK');
$MaxPktSize=64;
}
#
# Test for 1280 Byte
#
vSend($IF, echo_request_1280);
%ret=vRecv($IF,5,0,0, echo_reply_1280);
if( $ret{status} != 0) {
vLogHTML("TN COULD NOT receive Echo Reply(size=1280) from NUT
");
vLogHTML('NG');
vClear($IF);
exit $V6evalTool::exitFail;
}else {
# Correct Case
vLogHTML("TN received Echo Reply from NUT
");
vLogHTML('OK');
$MaxPktSize=1280;
}
#
# Test for 1500 Byte
#
vSend($IF, echo_request_1500);
%ret=vRecv($IF,5,0,0, echo_reply_1500);
if( $ret{status} != 0) {
vLogHTML("TN COULD NOT receive Echo Reply(size=1500) from NUT
");
vLogHTML('NG');
vClear($IF);
exit $V6evalTool::exitFail;
}else {
# Correct Case
vLogHTML("TN received Echo Reply from NUT
");
vLogHTML('OK');
$MaxPktSize=1500;
}
#open FID, ">>$PMTU::LCNA_RESULTS";
#print FID "$datestr";
#print FID "\$MaxPktSize=$MaxPktSize";
#close FID;
exit $V6evalTool::exitPass;
########################################################################
__END__
=head1 NAME
confirmPing - Confirm if NUT can reply to variable size of
ICMP Echo Request
=head1 TARGET
Host
=head1 SYNOPSIS
confirmPing.seq [-tooloption ...] -p confirmPing.def
=head1 NETWORK CONFIGURATION
This test just confirms if NUT can reply to variable size of
ICMP Echo Request
In this test, NUT is a HOST, TN plays as both of HOST and Router.
Phisical Network configuration
--------+---------------+--------------
| |
NUT TN
Logical Network Configuration
NUT
|
----------------+-----------------
|
Router
|
----------------+-----------------
|
HOST-A
NUT < --- Router --- > HOST A
=head1 INITIALIZATION
The TN send a RA to assign global address prefix.
TN NUT
-------------------
===multicast RA===>
src=TN's link-local
dst=LinkLocal-all-node
M=0, O=0,
Lifetime=3600, ReachableTime=60000, RetransTimer=1005
Prefix:
L=1, A=1,
ValidLifetime=3600005, PreferredLifetime=3600005
Prefix=3ffe:501:ffff:100::, PrefixLength=64
Wait (5 sec.)
Ignoring DAD packets for global address.
=head1 TEST PROCEDURE
"confirmPing" confirms the availability of NUT for variable size of
PING.
TN NUT
| |
-+-----------------------+-
1.
TN send Echo Request size=64.
=== echo request(64) ===>
2.
NUT send Echo Reply size=64.
<< JUDGMENT 1 >>
<=== echo reply(64) ===
3.
TN send Echo Request size=1280.
=== echo request(1280) ===>
4.
NUT send Echo Reply size=1280.
<< JUDGMENT 2 >>
<=== echo reply(1280) ===
5.
TN send Echo Request size=1500.
=== echo request(1500) ===>
6.
NUT send Echo Reply size=1500.
<< JUDGMENT 3 >>
<=== echo reply(1500) ===
=head1 JUDGMENT
<< JUDGMENT 1 -PASS- >>
"PASS" means that NUT received the ICMP Echo Request
size=64Byte, and NUT can send ICMP Echo Reply size=64Byte.
<< JUDGMENT 2 -PASS- >>
"PASS" means that NUT received the ICMP Echo Request
size=1280Byte, and NUT can send ICMP Echo Reply size=1280Byte.
<< JUDGMENT 3 -PASS- >>
"PASS" means that NUT received the ICMP Echo Request
size=1500Byte, and NUT can send ICMP Echo Reply size=1500Byte.
perldoc V6evalTool
perldoc V6evalRemote
=cut