#!/usr/bin/perl # # Copyright (C) 2003 Yokogawa Electric Corporation , # INTAP(Interoperability Technology Association for Information # Processing, Japan) , IPA (Information-technology Promotion Agency,Japan) # Copyright (C) IBM Corporation 2003. # All rights reserved. # # 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. # # Author: Kazuo Hiekata # @title = (); %result = (); BEGIN { $V6evalTool::TestVersion = '$Name: REL_2_1_2 $'; } use V6evalTool; use mip6MN_common; #--------------------------------------------------------------# # check if NUT is host or router #--------------------------------------------------------------# if($V6evalTool::NutDef{Type} ne 'host') { vLogHTML("This test is for the host only"); exit $V6evalTool::exitHostOnly; } $IF0_NUT = $V6evalTool::NutDef{Link0_device}; $IF0 = Link0; vCapture($IF0); #--------------------------------------------------------------# # Initialization #--------------------------------------------------------------# init_mn(); # Assuming MN is at Link0 vSend($IF0, ra_ha0_to_multi); vSend($IF0, na_ha0lla_to_nut0); vSleep(3); # Clear Packets vClear($IF0); #--------------------------------------------------------------# # NUT sends Binding Update to HA when returning home #--------------------------------------------------------------# vLogHTML('==== NUT sends Binding Update to HA when returning home ====
'); # move to LinkX vLogHTML('MN moved to LinkX
'); vSend($IF0, ra_r1_to_multi); vSend($IF0, na_r1lla_to_nut1); if (0 != wait_frame_at_linkx($IF0, bindingupdate_nut1_to_ha0)) { vLogHTML('HA0 cannot get Binding Update from NUT1.
'); vLogHTML('NG'); exit $V6evalTool::exitFail; } # move to Link0 vLogHTML('MN moved to Link0
'); vSend($IF0, ra_ha0_to_multi); vSend($IF0, na_ha0llataga_to_nut0); vSend($IF0, na_ha0ga_to_nut0); %ret = vRecv($IF0, 10, 0, 0, bindingupdate_nut0_to_ha0); if(0 != $ret{status}) { vSend($IF0, ra_ha0_to_multi); vSend($IF0, na_ha0llataga_to_nut0); vSend($IF0, na_ha0ga_to_nut0); %ret = vRecv($IF0, 10, 0, 0, bindingupdate_nut0_to_ha0); } if(0 == $ret{status}) { my ($acknowledge, $homeregistration, $sequencenumber, $lifetime) = get_binding_update_value('Frame_Ether.Packet_IPv6.Hdr_MH_BU', \%ret); if ( 1 == $acknowledge ) { my $cpp = ''; $cpp .= "-DBA_SEQUENCENUMBER=$sequencenumber "; $cpp .= "-DLIFETIME=$lifetime "; vCPP($cpp); vSend($IF0, bindingacknowledgement_ha0_to_nut0); } else { vLogHTML("Binding Update doesn't set (A) bit.
"); vLogHTML('NG'); exit $V6evalTool::exitFail; } } else { vLogHTML('HA0 cannot get Binding Update from NUT0.
'); vLogHTML('NG'); exit $V6evalTool::exitFail; } vLogHTML('OK
'); exit $V6evalTool::exitPass; ################################################################ __END__ =head1 NAME ReturningHome - NUT sends Binding Update to HA when returning home =head1 TARGET =begin html
Host
=end html =head1 SYNOPSIS =begin html
ReturningHome.seq [-tooloption ...] -pkt MN_Common.def
-tooloption: v6eval tool option
=end html =head1 TOPOLOGY =begin html
                                      |
                                      R       TN
                                      |       |
                              --------+-------+--------------- LinkZ



                                      |
                                      R2             NUT2
                                      |               |
                              --------+---------------+------- LinkY



                                      |       |
                                      HA2     R1     NUT1
                                      |       |       |
                              --------+-------+-------+------- LinkX



                          |           |
             NUT0        HA1          HA0
              |           |           |
Link0 --------+-----------+-----------+-----------------------
Link0 3ffe:501:ffff:100::/64 home link
LinkX 3ffe:501:ffff:102::/64  
LinkY 3ffe:501:ffff:103::/64  
LinkZ 3ffe:501:ffff:104::/64  
HA0(Link0) 3ffe:501:ffff:100:200:ff:fe00:a1a1/64  
HA1(Link0) 3ffe:501:ffff:100:200:ff:fe00:a2a2/64  
HA2(LinkX) 3ffe:501:ffff:102:200:ff:fe00:a3a3  
R1(LinkX) 3ffe:501:ffff:102:200:ff:fe00:a4a4  
R2(LinkY) 3ffe:501:ffff:103:200:ff:fe00:a5a5  
TN(LinkZ) 3ffe:501:ffff:104:200:ff:fe00:a6a6  
=end html =head1 TEST PROCEDURE =begin html
NUT sends Binding Update to HA when returning home

        HA0    NUT1     R1
        |       |       |
        |       | <---- | RA
        |       |       |
        | <---- |       | Binding Update (*1)
        | ----> |       | Binding Acknowledgement
        |       |       |
        |      NUT0     |
        |       |       |
        | ----> |       | RA
        |       |       |
        | <---- |       | Binding Update (*2)
        | ----> |       | Binding Acknowledgement
        |       |       |
=end html =head1 JUDGEMENT =begin html
(*1) PASS: HA0 receives Binding Update from NUT1
(*2) PASS: HA0 receives Binding Update from NUT0
=end html =head1 REFERENCE =begin html
draft-ietf-mobileip-ipv6-20.txt
11.5.4 Returning Home
   A mobile node detects that it has returned to its home link through
   the movement detection algorithm in use (Section 11.5.1), when the
   mobile node detects that its home subnet prefix is again on-link.
   The mobile node SHOULD then send a Binding Update to its home agent,
   to instruct its home agent to no longer intercept or tunnel packets
   for it.  In this home registration, the mobile node MUST set the
   Acknowledge (A) and Home Registration (H) bits, set the Lifetime
   field to zero, and set the care-of address for the binding to the
   mobile node's own home address.  The mobile node MUST use its home
   address as the source address in the Binding Update.
   When sending this Binding Update to its home agent, the mobile node
   must be careful in how it uses Neighbor Solicitation [12] (if needed)
   to learn the home agent's link-layer address, since the home agent
   will be currently configured to intercept packets to the mobile
   node's home address for Duplicate Address Detection (DAD).  In
   particular, the mobile node is unable to use its home address as the
   Source Address in the Neighbor Solicitation until the home agent
   stops defending the home address.
=end html