#!/usr/bin/perl
#
# $Copyright$
#
# $Id: FloodPing.seq,v 1.1.1.1 2000/10/31 22:39:10 sekiya Exp $
#
######################################################################
BEGIN {
$V6evalTool::TestVersion = '$Name: $';
}
use V6evalTool;
sub ping_one();
%pktdesc = (
echo_request => 'Send Echo Request (Link-Local Address)',
echo_reply => 'Recv Echo Reply (Link-Local Address)',
ns => 'Recv Neighbor Solicitation',
na => 'Send Neighbor Advertisement',
);
$IF=Link0;
$nodes=1;
#----- get arguments
foreach (@ARGV) {
/^times=([0-9]+)/ && do {$times=$1; next; };
print STDERR "Unknown option $_\n";
}
#----- start Capturing
vCapture($IF);
#----- make NCE
vLog("--- Initialize ---");
vLog("make NCE");
ping_one();
#----- start test
vLog("--- Test ---");
$pktname="echo_request";
for($i=0; $i < $times; $i++){
$pktnames[$i]="$pktname";
}
vSend($IF, @pktnames);
#----- check NUT
vRecv($IF, 2, 0, 0,);
vLog("--- JUDGME ---");
ping_one();
vLogHTML('Looks OK, Please check whether NUT have crashed.');
exit $V6evalTool::exitPass;
end;
sub ping_one(){
vSend($IF, echo_request);
%ret = vRecv($IF, 5, 0, 0, ns, echo_reply);
if ($ret{status} != 0) {
vLogHTML('No response from NUT');
vLogHTML('NG');
exit $V6evalTool::exitFail;
}
if ($ret{recvFrame} eq 'ns') {
vSend($IF, na);
%ret = vRecv($IF, 5, 0, 0, echo_reply);
if ($ret{status} != 0) {
vLogHTML('Cannot receive Echo Reply
');
vLogHTML('NG');
exit $V6evalTool::exitFail;
}
}
if ($ret{recvFrame} ne 'echo_reply') {
vLogHTML('Cannot receive Echo Reply
');
vLogHTML('NG');
exit $V6evalTool::exitFail;
}
}
######################################################################
__END__
=head1 NAME
FloodPing.seq - Flood ping
=head1 TARGET
Host and Router
=head1 SYNOPSIS
B [I]
=head1 INITIALIZATION
Make neighbor cache entry for TN.
1. Send echo request.
2. If TN receive NS, sends NA.
3. Wait echo reply.
[TN] --------------> [NUT]
echo request
[TN] <------------- [NUT]
(NS)
[TN] --------------> [NUT]
(NA)
[TN] <------------- [NUT]
echo reply
=head1 TEST PROCEDURE
TN and NUT is on the same link.
=over 4
---+--------+--- Link0
| |
+-+-+ +--+-+
|NUT| | TN |
+---+ +----+
Figure. 1
=back
TN sends echo request packets as fast. the number of packets is specify
times option.
[TN] --------> [NUT]
request
[TN] --------> [NUT]
request
[TN] --------> [NUT]
request
.
.
.
[TN] --------> [NUT]
request
After sent the flood packet, send echo request once more.
If TN receive NS, send NA. And wait echo reply packet from
NUT.
=head1 JUDGMENT
PASS : echo reply packet received.
FAIL : don't received echo reply packet.
=head1 NOTES
If the judgement is PASS, you must check that NUT have not been
crashed by your eyes. Becouse the test can't detect it.
=head1 TERMINATION
NONE
=head1 SEE ALSO
perldoc V6evalTool
=cut