#!/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); #--------------------------------------------------------------# # MN receives Binding Acknowledgement(error 132) #--------------------------------------------------------------# vLogHTML('==== MN receives Binding Acknowledgement(error 132) ====
'); # send RA from HA0 vSend($IF0, ra_ha0_to_multi); vSend($IF0, na_ha0llataga_to_nut0); vSend($IF0, na_ha0lla_to_nut0); vSend($IF0, na_ha0ga_to_nut0); # LinkX vLogHTML('MN moved to LinkX
'); vSend($IF0, ra_r1_to_multi); vSend($IF0, na_r1lla_to_nut1); # wait for Binding Update to HA0 if (0 != wait_frame_at_linkx($IF0, bindingupdate_nut1_to_ha0)) { vLogHTML('HA0 cannot receive Binding Update.'); $errorcount++; } # Clear Packets vLogHTML("Clear packet buffer."); vRecv($IF0, 1, 0, 0, ); # move to LinkY vLogHTML('MN moved to LinkY
'); vSend($IF0, ra_r2_to_multi); vSend($IF0, na_r2lla_to_nut2); # wait for Binding Update %ret = vRecv($IF0, 10, 0, 0, bindingupdate_nut2_to_ha0); vLogHTML("Sending BA(status=133)
"); if(0 == $ret{status}){ my ($acknowledge, $homeregistration, $sequencenumber, $lifetime) = get_binding_update_value('Frame_Ether.Packet_IPv6.Hdr_MH_BU', \%ret); $cpp = ''; $cpp .= "-DBA_SEQUENCENUMBER=$sequencenumber "; $cpp .= "-DBA_LIFETIME=1500 "; $cpp .= "-DBA_STATUS=133 "; vCPP($cpp); vLogHTML("HA0 send Binding Acknowledgement with Error.
"); vSend($IF0, bindingacknowledgement_ha0_to_nut2); } else { vLogHTML("HA0 cannot get Binding Update
"); exit $V6evalTool::exitFail; } # Clear Packets vLogHTML("Clear packet buffer."); vRecv($IF0, 1, 0, 0, ); %ret = vRecv($IF0, 10, 0, 0, bindingupdate_nut2_to_ha0); if(0 == $ret{status}){ my ($acknowledge, $homeregistration, $sequencenumber, $lifetime) = get_binding_update_value('Frame_Ether.Packet_IPv6.Hdr_MH_BU', \%ret); vLogHTML("NUT should not send Binding Update to HA0
"); exit $V6evalTool::exitWarn; } # LinkX vLogHTML('MN moved to LinkX
'); vSend($IF0, ra_r1_to_multi); vSend($IF0, na_r1lla_to_nut1); # wait for Binding Update %ret = vRecv($IF0, 10, 0, 0, bindingupdate_nut1_to_ha0); if(0 == $ret{status}){ my ($acknowledge, $homeregistration, $sequencenumber, $lifetime) = get_binding_update_value('Frame_Ether.Packet_IPv6.Hdr_MH_BU', \%ret); vLogHTML("NUT should not send Binding Update to HA0
"); exit $V6evalTool::exitWarn; } vLogHTML("OK
"); exit $V6evalTool::exitPass; ################################################################ __END__ =head1 NAME ReceivingBA132 - MN receives Binding Acknowledgement(error 132) =head1 TARGET =begin html
Host
=end html =head1 SYNOPSIS =begin html
ReceivingBA132.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

MN receives Binding Acknowledgement(error 132)

        HA0    NUT0     R1      R2
        |       |       |       | 
        | ----> |       |       | RA(H bit)
        |       |       |       | 
        |      NUT1     |       | 
        |       | <---- |       | RA
        |       |       |       | 
        | <---- |       |       | Binding Update (*1)
        | ----> |       |       | Binding Acknowledgement
        |       |       |       | 
        |      NUT2     |       |
        |       | <------------ | RA
        |       |       |       |
        | <---- |       |       | Binding Update (*2)
        | ----> |       |       | Binding Acknowledgement (w/ error=132)
        |       |       |       | * 132=home registration not supported
        |       |       |       | 
        |       |       |       | NUT SHOULD NOT send BU to HA0 (*3)
        |       |       |       | 
        |      NUT1     |       | 
        |       | <---- |       | RA
        |       |       |       | 
        |       |       |       | NUT SHOULD NOT send BU to HA0 (*4)
        |       |       |       | 
=end html =head1 JUDGEMENT =begin html
(*1) PASS: HA0 receives Binding Update
(*2) PASS: HA0 receives Binding Update
(*3) PASS: HA0 doesn't receive Binding Update
(*4) PASS: HA0 doesn't receive Binding Update
=end html =head1 REFERENCE =begin html
draft-ietf-mobileip-ipv6-20.txt
11.7.3 Receiving Binding Acknowledgements
   Upon receiving a packet carrying a Binding Acknowledgement, a mobile
   node MUST validate the packet according to the following tests:
   o  The packet meets the authentication requirements for Binding
      Acknowledgements, defined in Section 6.1.8 and Section 5.  That
      is, if the Binding Update was sent to the home agent, underlying
      IPsec protection is used.  If the Binding Update was sent to the
      MUST be present and have a valid value.
      be the last option and MUST not have trailing padding.
   o  The Sequence Number field matches the Sequence Number sent by the
      mobile node to this destination address in an outstanding Binding
      Update.
   Any Binding Acknowledgement not satisfying all of these tests MUST be
   silently ignored.
   When a mobile node receives a packet carrying a valid Binding
   Acknowledgement, the mobile node MUST examine the Status field as
   follows:
   o  If the Status field indicates that the Binding Update was accepted
      (the Status field is less than 128), then the mobile node MUST
      update the corresponding entry in its Binding Update List to
      indicate that the Binding Update has been acknowledged; the mobile
      node MUST then stop retransmitting the Binding Update.  In
      addition, if the value specified in the Lifetime field in the
      Binding Acknowledgement is less than the Lifetime value sent in
      the Binding Update being acknowledged, then the mobile node MUST
      subtract the difference between these two Lifetime values from the
      remaining lifetime for the binding as maintained in the
      corresponding Binding Update List entry (with a minimum value for
      the Binding Update List entry lifetime of 0).  That is, if the
      Lifetime value sent in the Binding Update was L_update, the
      Lifetime value received in the Binding Acknowledgement was L_ack,
      and the current remaining lifetime of the Binding Update List
      entry is L_remain, then the new value for the remaining lifetime
      of the Binding Update List entry should be
         max((L_remain - (L_update - L_ack)), 0)
      where max(X, Y) is the maximum of X and Y.  The effect of this
      step is to correctly manage the mobile node's view of the
      binding's remaining lifetime (as maintained in the corresponding
      Binding Update List entry) so that it correctly counts down from
      the Lifetime value given in the Binding Acknowledgement, but with
      the timer countdown beginning at the time that the Binding Update
      was sent.  Mobile nodes SHOULD send a new Binding Update well
      before the expiration of this period in order to extend the
      lifetime.  This helps to avoid disruptions in communications,
      which might otherwise be caused by network delays or clock drift.
   o  If the Status field indicates that the Binding Update was rejected
      (the Status field is greater than or equal to 128), then the
      mobile node SHOULD record in its Binding Update List that future
      Binding Updates SHOULD NOT be sent to this destination.
      Optionally, the mobile node MAY then take steps to correct the
      cause of the error and retransmit the Binding Update (with a new
      Sequence Number value), subject to the rate limiting restriction
      specified in Section 11.8.
=end html