#!/usr/bin/perl
#
# Copyright (C) 2003 IPv6 Promotion Council,
# NIPPON TELEGRAPH AND TELEPHONE CORPORATION (NTT),
# Yokogwa Electoric Corporation, YASKAWA INFORMATION SYSTEMS Corporation
# and NTT Advanced Technology Corporation(NTT-AT) All rights reserved.
#
# Technology Corporation.
#
# 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.
#
#--------------------------------------------------------------#
# ENTRANCE
#--------------------------------------------------------------#
# Set the test version used for the display.
BEGIN { $V6evalTool::TestVersion = '$Name: MIPv6_2_0_5 $';}
# Import the package.
use V6evalTool;
use mip6cnt;
#--------------------------------------------------------------#
# INITIALIZATION
#--------------------------------------------------------------#
CNT_IsSupport(ABNORMAL);
CNT_Initilize();
SD_RA();
SQ_NS();
SQ_Echo();
SQ_EchoHoa_BE();
SQ_RR();
SQ_BU(BuRegHoa_Forein,"-DBU_LIFETIME=105");
SQ_EchoHoa();
SQ_HoTI();
CNT_Wait(240);
#--------------------------------------------------------------#
# TEST PROCEDURE
#--------------------------------------------------------------#
CNT_TEST_Start();
#====================
# UnBU_Home->BA
#====================
$status=SQ_UnBU_Home(BuDereg_Home,"-DBU_LIFETIME=0",BaDeregNonAuth_Home);
if($status eq 'TimeOut'){
LOG_Err("MN does not receive Binding Acknowledgement");
goto EXIT;
}
if($status eq 'UnKnown'){
LOG_Err("MN does not receive Binding Acknowledgement");
goto EXIT;
}
if( GetREV(BA,Status) != 136){
LOG_Err("BA - Status is not set to 136");
goto EXIT;
}
if( IsExistOpt('Auth') ne '' ){
LOG_Err("BA - Binding Authentication Data option is included");
goto EXIT;
}
if(GetSND(IPv6,SourceAddress) ne GetREV(IPv6,DestinationAddress)){
LOG_Err("BA - The Destination Address is not set to the Source Address of the Bidning Update");
goto EXIT;
}
if( IsExistOpt('RH') ne '' ){
LOG_Err("BA - Type2 Routing Header is included");
goto EXIT;
}
if($status eq 'Replace'){
LOG_Err("BA - " . GetUnKnownInfoMsg() );
goto EXIT;
}
#================================
# Echo Request -> Echo Reply
#================================
$status=SQ_Echo_RH();
if($status eq 'TimeOut'){
LOG_Err("MN does not receive Echo Reply");
goto EXIT;
}
if($status eq 'UnKnown'){
LOG_Err("MN does not receive Echo Reply");
goto EXIT;
}
if( GetCoAAddress() ne GetREV(IPv6,DestinationAddress) ){
LOG_Err("Echo Reply - The Destination Address is not set to the MN Care-of Address");
goto EXIT;
}
if( IsExistOpt('RH') eq '' ){
LOG_Err("Echo Reply - Type2 Routing Header is not included");
goto EXIT;
}
if($status eq 'Replace'){
LOG_Err("Echo Reply - " . GetUnKnownInfoMsg() );
goto EXIT;
}
#--------------------------------------------------------------#
# JUDGEMENT
#--------------------------------------------------------------#
LOG_OK("BA(*1) - MN receives Binding Acknowledgement");
LOG_OK("BA(*1) - The Destination Address is set to the Source Address of the Bidning Update");
LOG_OK("BA(*1) - Type 2 Routing Header is not included");
LOG_OK("BA(*1) - The Status field is set to 136");
LOG_OK("BA(*1) - Binding Authorization Data option is not included");
LOG_OK("Echo Reply(*2) - MN receives ICMP Echo Reply");
LOG_OK("Echo Reply(*2) - The Destination Address is set to the Source Address of ICMP Echo Request");
LOG_OK("Echo Reply(*2) - The Status field is set to 1");
LOG_OK("Echo Reply(*2) - The Home Address field is set to the value in the Home Address Option in the ICMP Echo Request");
#--------------------------------------------------------------#
# EXIT
#--------------------------------------------------------------#
if( $status eq 'OK' ){
exit $V6evalTool::exitPass;
}
else {
EXIT:
exit $V6evalTool::exitFail;
}
=head1 NAME
CN-4-2-3 - Home Nonce Index timeout - De-Registration from the home link
=head1 TARGET
=begin html
Host
=end html
=head1 TOPOLOGY
=begin html
HA----------R2----------R1----------R0
| | | |
| | | |
|----MN' |---- |----MN |----CN(NUT)
| | | |
| | | |
Home Link Link2 Link1 Link0
(Foreign) (Foreign)
| Link0 |
3ffe:501:ffff:100::/64 |
|
| Link1 |
3ffe:501:ffff:101::/64 |
Foreign Link |
| Link2 |
3ffe:501:ffff:102::/64 |
Foreign Link 2 |
| Home Link |
3ffe:501:ffff:104::/64 |
Home Link |
| CN(NUT) |
3ffe:501:ffff:100::X Auto Configuration (InterfaceID) |
|
| MN(in Link1) |
3ffe:501:ffff:101::Y Increased in each test (InterfaceID) |
MN care-of address |
| MN'(MN in Home Link) |
3ffe:501:ffff:104::Y Increased in each test (InterfaceID) |
MN home address |
| R0(Link0) |
3ffe:501:ffff:100::1 |
|
| R1(Link1) |
3ffe:501:ffff:101::1 |
|
| R2(Link2) |
3ffe:501:ffff:102::1 |
|
| HA(Home Link) |
3ffe:501:ffff:104::1 |
|
=end html
=head1 INITIALIZATION
=begin html
Reboot NUT (reboot.rmt)
=end html
=head1 TEST PROCEDURE
=begin html
MN' MN R1 HA R0 CN(NUT)
| | | | | |
| | | | |------>| 1.RA
| | | | | |
| | | | |------>| 2.NS
| | | | | |
| | | | |<------| 3.NA
| | | | | |
| |-------------->|-------------->| 4.Echo Request
| | | | | |
| |<--------------|<--------------| 5.Echo Reply
| | | | | |
| |------------------------------>| 6.Echo Request(Home Address option)
| | | | | |
| |<------------------------------| 7.BE(Status=1)
| | | | | |
| |------------------------------>| 8.CoTI
| | | | | |
| |-------------->|-------------->| 9.HoTI
| | | | | |
| |<------------------------------| 10.CoT
| | | | | |
| |<--------------|<--------------| 11.HoT
| | | | | |
| |------------------------------>| 12.BU
| | | | | |
| |<------------------------------| 13.BA
| | | | | |
| |------------------------------>| 14.Echo Request(Home Address option)
| | | | | |
| |<------------------------------| 15.Echo Reply(Type2 Routing Header)
| | | | | |
|-------------------------------------->| 16.HoTI
| | | | | |
|<--------------------------------------| 17.HoT
| | | | | |
| | | | | | Expire MAX_NONCE_LIFE(240s)
| | | | | |
|-------------------------------------->| 18.BU
| | | | | |
|<--------------------------------------| 19.BA(Status=136) (*1)
| | | | | |
|-------------------------------------->| 20.Echo Request
| | | | | |
| |<------------------------------| 21.Echo Reply(Type2 Routing Header) (*2)
| | | | | |
1. Send Router Advertisement.
2. Send Neighbor Solicitation.
3. Receive Neighbor Advertisement.
4. Send ICMP Echo Request.
5. Receive ICMP Echo Reply.
6. Send ICMP Echo Request(Home Address option).
7. Receive Binding Error(Status=1).
8. Send Care-of Test Init.
9. Send Home Test Init.
10. Receive Care-of Test.
11. Receive Home Test.
12. Send Binding Update.
13. Receive Binding Acknowledgement.
14. Send ICMP Echo Request(Home Address option).
15. Receive ICMP Echo Reply(Type2 Routing Header).
16. Send Home Test Init.
17. Receive Home Test.
*Expire MAX_NONCE_LIFE(240s)
18. Send Binding Update.
19. Receive Binding Acknowledgement(Status=136).
20. Send ICMP Echo Request.
21. Receive ICMP Echo Reply(Type2 Routing Header).
Packet Format
18. Binding Update(No Home Address option)
19. Binding Acknowledgement(No Type2 Routing Header and Binding Authorization Data option)
IPv6 header
Mobility header
Binding Acknowledgement
(Not include Binding Authorization Data option)
20. ICMP Echo Request
21. ICMP Echo Reply(Type2 Routing Header)
=end html
=head1 JUDGEMENT
=begin html
(*1) MN' receives Binding Acknowledgement.
- The Destination Address is set to the Source Address of the Binding Update (MN home address).
- The Status field is set to 136.
- Binding Authorization Data option is not included.
(*2) MN receives ICMP Echo Reply. (Binding Cache entry is not deleted.)
- The Destination Address is set to MN care-of address.
- Type 2 Routing Header is included.
=end html
=head1 REFERENCE
=begin html
(draft-ietf-mobileip-ipv6-24.txt)
9.5.1 Receiving Binding Updates
If the receiving node no longer recognizes the Home Nonce Index
value, Care-of Nonce Index value, or both values from the Binding
Update, then the receiving node MUST send back a Binding
Acknowledgement with status code 136, 137, or 138, respectively.
5.2.7 Updating Node Keys and Nonces
Correspondent nodes generate nonces at regular intervals. It is
recommended to keep each nonce (identified by a nonce index)
acceptable for at least MAX_TOKEN_LIFETIME seconds (see Section 12)
after it has been first used in constructing a return routability
message response. However, the correspondent node MUST NOT accept
nonces beyond MAX_NONCE_LIFETIME seconds (see Section 12) after the
first use. As the difference between these two constants is 30
seconds, a convenient way to enforce the above lifetimes is to
generate a new nonce every 30 seconds. The node can then continue to
accept tokens that have been based on the last 8 (MAX_NONCE_LIFETIME
/ 30) nonces. This results in tokens being acceptable
MAX_TOKEN_LIFETIME to MAX_NONCE_LIFETIME seconds after they have been
sent to the mobile node, depending on whether the token was sent at
the beginning or end of the first 30 second period. Note that the
correspondent node may also attempt to generate new nonces on demand,
or only if the old nonces have been used. This is possible, as long
as the correspondent node keeps track of how long a time ago the
nonces were used for the first time, and does not generate new nonces
on every return routability request.
12. Protocol Constants
MAX_NONCE_LIFETIME 240 seconds
9.5.4 Sending Binding Acknowledgements
If the Status field in the Binding Acknowledgement contains the value
136 (expired home nonce index), 137 (expired care-of nonce index), or
138 (expired nonces) then the message MUST NOT include the Binding
Authorization Data mobility option. Otherwise, the Binding
Authorization Data mobility option MUST be included, and MUST meet
the specific authentication requirements for Binding Acknowledgements
as defined in Section 5.2.
=end html
=cut