#!/usr/bin/perl
#
# $Copyright$
#
# $TAHI: ct/mip6/CN_IncorrectSeqNoAck.seq,v 1.1.2.5 2002/01/07 08:19:02 akisada Exp $
#
BEGIN { $V6evalTool::TestVersion = '$Name: $'; }
use V6evalTool;
$IF0 = Link0;
%pktdesc = (
echorequest => ' Send Echo Request from MN to NUT (no Home Address Option)',
echoreply => ' Recv Echo Reply from NUT to MN (no Routing Header)',
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',
echorequest0 => ' Send Echo Request (Binding Update Option - SeqNumber is 0)',
echorequest1 => ' Send Echo Request (Binding Update Option - SeqNumber is 1)',
bindingupdate => ' Send Binding Update Option - SeqNumber is 0',
echoreply0 => ' Recv Echo Reply from NUT to MN (with Binding Cache entry)',
echoreply1 => ' Recv Echo Reply from NUT to MN (with Binding Cache entry)',
bindingacknowledgement => ' Recv Binding Acknowledgement',
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("#### Binding Update test #####################################
");
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, echorequest0);
vLogHTML("Wait Echo Reply
");
%ret = vRecv($IF0, 5, 0, 0, param_problem, echoreply0);
if($ret{status} != 0) {
vLogHTML('No response from NUT
');
vLogHTML('NG
');
exit $V6evalTool::exitFail;
}
if($ret{recvFrame} eq 'param_problem') {
vLogHTML('NUT does not support this function.
');
exit $V6evalTool::exitNS;
}
if($ret{recvFrame} ne 'echoreply0') {
vLogHTML('Can not receive Echo Reply
');
vLogHTML('NG
');
exit $V6evalTool::exitFail;
}
%ret = vSend($IF0, echorequest1);
vLogHTML("Wait Echo Reply
");
%ret = vRecv($IF0, 5, 0, 0, echoreply1);
if($ret{status} != 0) {
vLogHTML('No response from NUT
');
vLogHTML('NG
');
exit $V6evalTool::exitFail;
}
if($ret{recvFrame} ne 'echoreply1') {
vLogHTML('Can not receive Echo Reply
');
vLogHTML('NG
');
exit $V6evalTool::exitFail;
}
%ret = vSend($IF0, bindingupdate);
%ret = vRecv($IF0, 5, 0, 0, bindingacknowledgement);
if($ret{status} != 0) {
vLogHTML('No response from NUT
');
vLogHTML('NG
');
exit $V6evalTool::exitFail;
}
if($ret{recvFrame} ne 'bindingacknowledgement') {
vLogHTML('Can not receive Binding Acknowledgement
');
vLogHTML('NG
');
exit $V6evalTool::exitFail;
}
vLogHTML(OK);
exit $V6evalTool::exitPass;
################################################################
__END__
=head1 NAME
CN_IncorrectSeqNoAck - Sequence number too small((A) bit isn't set)
=head1 TARGET
=begin html
Host and Router=end html =head1 SYNOPSIS =begin html
CN_IncorrectSeqNoAck.seq [-tooloption ...] -pkt CN_IncorrectSeqNoAck.def
=end html =head1 TOPOLOGY =begin html-tooloption: v6eval tool option
MN'''
|
----------------+-------+------- LinkY''
|
R4 MN''
| |
--------+-------+-------+------- LinkY'
|
R3 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 LinkY' 3ffe:501:ffff:104::/64 foreign link' LinkY'' 3ffe:501:ffff:105::/64 foreign link'' R1(Link0) 3ffe:501:ffff:100:200:ff:fe00:a0a0 MN 3ffe:501:ffff:102:200:ff:fe00:000c home address MN' 3ffe:501:ffff:103:200:ff:fe00:000c care-of address MN'' 3ffe:501:ffff:104:200:ff:fe00:000c care-of address MN''' 3ffe:501:ffff:105:200:ff:fe00:000c care-of address
NUT R1 MN MN' MN'' MN'''
| | | | | |
| <---- | | | | | RA
| | | | | |
| <-------------------- | | | Echo Request
| ----> | | | | | NS
| <---- | | | | | NA
| --------------------> | | | Echo Reply (*1)
| | | | | |
| <---- | | | | | NA
| | | | | |
| <-------------------- | | | Echo Request including Binding Update (Sequence Number is 0)
| --------------------> | | | Echo Reply (*2)
| | | | | |
| <---------------------------- | | Echo Request including Binding Update (Sequence Number is 1)
| ----------------------------> | | Echo Reply (*3)
| | | | | |
| <------------------------------------ | Binding Update (Sequence Number is 0)
| ------------------------------------> | Binding Acknowledgement (*4)
| | | | | |
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 Update operation 3.1. MN' sends Echo Request including Binding Update 3.2. Wait Echo Reply 3.3. Receive Echo Reply
3.4. MN'' sends Echo Request including Binding Update 3.5. Wait Echo Reply 3.6. Receive Echo Reply
3.7. MN''' sends incorrect Binding Update 3.8. Wait Response 3.9. Receive Binding Acknowledgement=end html =head1 JUDGEMENT =begin html
(*1) PASS: MN' receives Echo Reply
(*2) PASS: MN' receives Echo Reply
(*3) PASS: MN'' receives Echo Reply
(*4) PASS: MN''' receives Binding Acknowledgement=end html =head1 REFERENCE =begin html
<draft-ietf-mobileip-ipv6-15.txt>
8.2. Receiving Binding Updates
Before accepting a Binding Update option received in any packet, the receiving node MUST validate the Binding Update according to the following tests:
- The packet meets the specific authentication requirements for
Binding Updates, defined in Section 4.4.
- The packet MUST contain a Home Address option.
- The Option Length field in the Binding Update option is greater
than or equal to the length specified in Section 5.1.
- The Sequence Number field in the Binding Update option is greater
than the Sequence Number received in the previous Binding Update
for this home address, if any. As noted in Section 4.6, this
Sequence Number comparison MUST be performed modulo 2**8.
If the mobile node sends a sequence number which is not greater than the sequence number from the last successful Binding Update, then the receiving node MUST send back a Binding Acknowledgement with status code 141, and the last accepted sequence number in the Sequence Number field of the Binding Acknowledgement.=end html =head1 SEE ALSO =begin html
CN_Common.def=end html =cut