#!/usr/bin/perl
#
# $Copyright$
#
# $TAHI: ct/mip6/CN_PingAfterBu.seq,v 1.6.4.4 2002/01/07 08:19:03 akisada Exp $
#
BEGIN { $V6evalTool::TestVersion = '$Name: $'; }
use V6evalTool;
$IF0 = Link0;
%pktdesc = (
echorequest => ' Send Echo Request from MN to NUT (no Home Address Option)',
echorequest_ex => ' Send Echo Request from MN to NUT (Home Address Option)',
echoreply => ' Recv Echo Reply from NUT to MN (no Routing Header)',
echoreply_no_bce => ' Recv Echo Reply from NUT to MN (no Binding Cache entry)',
echoreply_bce => ' Recv Echo Reply from NUT to MN (with Binding Cache entry)',
ra_r1 => ' Send RA from R1',
ns_r1_global => ' Recv NS from NUT to R1',
na_r1_global => ' Send NA from R1 to NUT',
na_r1_linklocal => ' Send NA from R1 to NUT',
bindingupdate => ' Send Binding Update (A bit is not set)',
param_problem => ' Recv Parameter Problem',
);
vLogHTML("#### ping test ###############################################
");
vCapture($IF0);
if($V6evalTool::NutDef{Type} eq 'host') {
%ret = vSend($IF0, ra_r1);
vSleep(3);
}
%ret = vSend($IF0, echorequest);
if($V6evalTool::NutDef{Type} eq 'host') {
vLogHTML("Wait Echo Reply
");
%ret = vRecv($IF0, 5, 0, 0, echoreply);
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);
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);
if($ret{status} != 0) {
vLogHTML('No response from NUT
');
vLogHTML('NG
');
exit $V6evalTool::exitFail;
}
}
}
if($ret{recvFrame} ne 'echoreply') {
vLogHTML('Can not receive Echo Reply
');
vLogHTML('NG
');
exit $V6evalTool::exitFail;
}
vLogHTML("#### ping test (Home Address Option) #########################
");
if($V6evalTool::NutDef{Type} eq 'host') {
%ret = vSend($IF0, na_r1_linklocal);
} else {
%ret = vSend($IF0, na_r1_global);
}
vSleep(3);
vClear($IF0);
%ret = vSend($IF0, bindingupdate);
%ret = vRecv($IF0, 5, 0, 0, param_problem);
if($ret{recvFrame} eq 'param_problem') {
vLogHTML('NUT does not support this function.
');
exit $V6evalTool::exitNS;
}
vClear($IF0);
%ret = vSend($IF0, echorequest_ex);
vLogHTML("Wait Echo Reply
");
%ret = vRecv($IF0, 5, 0, 0, echoreply_bce, echoreply_no_bce);
if($ret{status} != 0) {
vLogHTML('No response from NUT
');
vLogHTML('NG
');
exit $V6evalTool::exitFail;
}
if($ret{recvFrame} eq 'echoreply_no_bce') {
vLogHTML('NUT SHOULD use a Routing header
');
vLogHTML('WARN
');
exit $V6evalTool::exitWarn;
}
if($ret{recvFrame} ne 'echoreply_bce') {
vLogHTML('Can not receive Echo Reply
');
vLogHTML('NG
');
exit $V6evalTool::exitFail;
}
vLogHTML(OK);
exit $V6evalTool::exitPass;
################################################################
__END__
=head1 NAME
CN_PingAfterBu - Ping from MN to NUT (After Binding Update)
=head1 TARGET
=begin html
Host and Router=end html =head1 SYNOPSIS =begin html
CN_PingAfterBu.seq [-tooloption ...] -pkt CN_PingAfterBu.def
=end html =head1 TOPOLOGY =begin html-tooloption: v6eval tool option
MN'
|
--------+-------+------- LinkY
|
R2 MN
| |
Link1 --------+------- --------+-------+-------+------- LinkX
| |
NUT R1
| |
Link0 --------+-----------------------+-----------------------
=end html =head1 TEST PROCEDURE =begin html
Link0 3ffe:501:ffff:100::/64 Link1 3ffe:501:ffff:101::/64 LinkX 3ffe:501:ffff:102::/64 home link LinkY 3ffe:501:ffff:103::/64 foreign link R1(Link0) 3ffe:501:ffff:100:200:ff:fe00:a0a0 MN 3ffe:501:ffff:102:200:ff:fe00:0006 home address MN' 3ffe:501:ffff:103:200:ff:fe00:0006 care-of address
NUT R1 MN MN'
| | | |
| <---- | | | RA
| | | |
| <-------------------- | Echo Request
| ----> | | | NS
| <---- | | | NA
| --------------------> | Echo Reply (*1)
| | | |
| <---- | | | NA
| | | |
| <-------------------- | Binding Update
| | | |
| <-------------------- | Echo Request (Home Address Option)
| --------------------> | Echo Reply (*2)
| | | |
1. check routing table - LinkY 1.1. Host 1.1.1. R1 sends RA 1.1.2. MN' sends Echo Request 1.2.3. Wait Echo Reply 1.1.4. Receive Echo Reply
1.2. Router 1.2.1. MN' sends Echo Request 1.2.2. Wait Echo Reply or NS 1.2.3. If NS received then send NA, and wait Echo Reply again 1.2.4. Receive Echo Reply
2. overwrite NCE on NUT 2.1. R1 sends NA
3. check Binding Cache entry operation 3.1. MN' sends Binding Update 3.2. MN' sends Echo Request including Home Address Option 3.3. Wait Echo Reply 3.4. Receive Echo Reply=end html =head1 JUDGEMENT =begin html
(*1) PASS: MN' receives Echo Reply
(*2) PASS: MN' receives Echo Reply including Routing Header
WARN: MN receives Echo Reply
=end html
=head1 REFERENCE
=begin html
<draft-ietf-mobileip-ipv6-15.txt>
8.9. Sending Packets to a Mobile Node
Before sending any packet, the sending node SHOULD examine its Binding Cache for an entry for the destination address to which the packet is being sent. If the sending node has a Binding Cache entry for this address, the sending node SHOULD use a Routing header to route the packet to this mobile node (the destination node) by way of the care-of address in the binding recorded in that Binding Cache entry. For example, assuming use of a Type 0 Routing header [6], if no other use of a Routing header is involved in the routing of this packet, the mobile node sets the fields in the packet's IPv6 header and Routing header as follows:
- The Destination Address in the packet's IPv6 header is set to
the mobile node's care-of address copied from the Binding Cache
entry.
- The Routing header is initialized to contain a single route
segment, with an Address of the mobile node's home address (the
original destination address to which the packet was being sent).
=end html
=head1 SEE ALSO
=begin html
CN_Common.def=end html =cut