#!/usr/bin/perl
#
# $Copyright$
#
# $TAHI: ct/mip6/CN_Init.seq,v 1.7 2001/10/05 06:39:03 masaxmasa Exp $
#
BEGIN { $V6evalTool::TestVersion = '$Name: $'; }
use V6evalTool;
$IF0 = Link0;
%pktdesc = (
echorequest_h1 => ' Send Echo Request from H1 to NUT',
echorequest_h2 => ' Send Echo Request from H2 to NUT',
echorequest_h3 => ' Send Echo Request from H3 to NUT',
echoreply_h1 => ' Recv Echo Reply from NUT to H1',
echoreply_h2 => ' Recv Echo Reply from NUT to H2',
echoreply_h3 => ' Recv Echo Reply from NUT to H3',
ns_h1 => ' Recv NS from NUT to H1',
ns_r1_global => ' Recv NS from NUT to R1',
na_h1 => ' Send NA from H1 to NUT',
na_r1_global => ' Send NA from R1 to NUT',
ra_r1 => ' Send RA from R1',
);
#### reboot.rmt ##############################################
$ret = vRemote(
"reboot.rmt",
""
);
if($ret != 0) {
vLogHTML('Can not reboot
');
vLogHTML('NG');
exit $V6evalTool::exitFatal;
}
#### mip6EnableCN.rmt ##############################################
$ret = vRemote(
"mip6EnableCN.rmt",
""
);
if($ret != 0) {
vLogHTML('Can enable Correspondent Node function
');
vLogHTML('NG');
exit $V6evalTool::exitFatal;
}
#### route.rmt ###############################################
if($V6evalTool::NutDef{Type} eq 'host') {
vSend($IF0, ra_r1);
vSleep(3);
} else {
$ret = vRemote(
"route.rmt",
"cmd=add",
"prefix=default",
"gateway=3ffe:501:ffff:100:200:ff:fe00:a0a0"
);
if($ret != 0) {
vLogHTML('Can not configure routing table');
vLogHTML('NG');
exit $V6evalTool::exitFatal;
}
}
vLogHTML("#### check routing table - Link0 #############################
");
vCapture($IF0);
%ret = vSend($IF0, echorequest_h1);
vLogHTML("Wait Neighbor Solicitation or Echo Reply
");
%ret = vRecv($IF0, 5, 0, 0, ns_h1, echoreply_h1);
if($ret{status} != 0) {
vLogHTML('No response from NUT
');
vLogHTML('NG
');
exit $V6evalTool::exitFail;
}
if($ret{recvFrame} eq 'ns_h1') {
%ret = vSend($IF0, na_h1);
vLogHTML("Wait Echo Reply
");
%ret = vRecv($IF0, 5, 0, 0, echoreply_h1);
if($ret{status} != 0) {
vLogHTML('No response from NUT
');
vLogHTML('NG
');
exit $V6evalTool::exitFail;
}
}
if($ret{recvFrame} ne 'echoreply_h1') {
vLogHTML('Can not receive Echo Reply
');
vLogHTML('NG
');
exit $V6evalTool::exitFail;
}
vLogHTML("#### check routing table - LinkX #############################
");
vClear($IF0);
%ret = vSend($IF0, echorequest_h2);
if($V6evalTool::NutDef{Type} eq 'host') {
vLogHTML("Wait Echo Reply
");
%ret = vRecv($IF0, 5, 0, 0, echoreply_h2);
if($ret{status} != 0) {
vLogHTML('No response from NUT
');
vLogHTML('NG
');
exit $V6evalTool::exitFail;
}
} else {
vLogHTML("Wait Neighbor Solicitation or Echo Reply
");
%ret = vRecv($IF0, 5, 0, 0, ns_r1_global, echoreply_h2);
if($ret{status} != 0) {
vLogHTML('No response from NUT
');
vLogHTML('NG
');
exit $V6evalTool::exitFail;
}
if($ret{recvFrame} eq 'ns_r1_global') {
%ret = vSend($IF0, na_r1_global);
vLogHTML("Wait Echo Reply
");
%ret = vRecv($IF0, 5, 0, 0, echoreply_h2);
if($ret{status} != 0) {
vLogHTML('No response from NUT
');
vLogHTML('NG
');
exit $V6evalTool::exitFail;
}
}
}
if($ret{recvFrame} ne 'echoreply_h2') {
vLogHTML('Can not receive Echo Reply
');
vLogHTML('NG
');
exit $V6evalTool::exitFail;
}
vLogHTML("#### check routing table - LinkY #############################
");
vClear($IF0);
%ret = vSend($IF0, echorequest_h3);
vLogHTML("Wait Echo Reply
");
%ret = vRecv($IF0, 5, 0, 0, echoreply_h3);
if($ret{status} != 0) {
vLogHTML('No response from NUT
');
vLogHTML('NG
');
exit $V6evalTool::exitFail;
}
if($ret{recvFrame} ne 'echoreply_h3') {
vLogHTML('Can not receive Echo Reply
');
vLogHTML('NG
');
exit $V6evalTool::exitFail;
}
vLogHTML(OK);
exit $V6evalTool::exitPass;
################################################################
__END__
=head1 NAME
CN_Init - Initialization
=head1 TARGET
=begin html
Host and Router=end html =head1 SYNOPSIS =begin html
CN_Init.seq [-tooloption ...] -pkt CN_Init.def
=end html =head1 TOPOLOGY =begin html-tooloption: v6eval tool option
H3
|
--------+-------+------- LinkY
|
R2 H2
| |
Link1 --------+------- --------+-------+-------+------- LinkX
| |
NUT R1 H1
| | |
Link0 --------+-----------------------+---------------+-------
=end html =head1 INITIALIZATION =begin html
Link0 3ffe:501:ffff:100::/64 Link1 3ffe:501:ffff:101::/64 LinkX 3ffe:501:ffff:102::/64 LinkY 3ffe:501:ffff:103::/64 R1(Link0) 3ffe:501:ffff:100:200:ff:fe00:a0a0
NUT H1 R1 H2 H3
| | | | |
| <---- | | | | Echo Request
| ----> | | | | NS
| <---- | | | | NA
| ----> | | | | Echo Reply (*1)
| | | | |
| <-------------------- | | Echo Request
| ------------> | | | NS
| <------------ | | | NA
| --------------------> | | Echo Reply (*2)
| | | | |
| <---------------------------- | Echo Request
| ----------------------------> | Echo Reply (*3)
| | | | |
1. check routing table - Link0 1.1. H1 sends Echo Request 1.2. Wait Echo Reply or NS 1.3. If NS received then send NA, and wait Echo Reply again 1.4. Receive Echo Reply
2. check routing table - LinkX 2.1. Host 2.1.1. H2 sends Echo Request 2.1.2. Wait Echo Reply 2.1.3. Receive Echo Reply
2.2. Router 2.1.1. H2 sends Echo Request 2.1.2. Wait Echo Reply or NS 2.1.3. If NS received then send NA, and wait Echo Reply again 2.1.4. Receive Echo Reply
3. check routing table - LinkY 3.1. H3 sends Echo Request 3.2. Wait Echo Reply 3.3. Receive Echo Reply=end html =head1 JUDGEMENT =begin html
(*1) PASS: H1 receives Echo Reply
(*2) PASS: H2 receives Echo Reply
(*3) PASS: H3 receives Echo Reply=end html =head1 SEE ALSO =begin html
CN_Common.def=end html =cut