#!/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); #--------------------------------------------------------------# # Processing Binding Refresh Requests #--------------------------------------------------------------# vLogHTML('==== Processing Binding Refresh Requests ====
'); vSend($IF0, ra_ha0_to_multi); vSend($IF0, na_ha0lla_to_nut0); # 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)) { exit $V6evalTool::exitFail; } #RR my $kcn = "00112233445566778899aabbccddeeff00112233"; my $home_nonce_index = 10; my $careof_nonce_index = 20; vSend($IF0, ra_r1_to_multi); vSend($IF0, na_r1lla_to_nut1); vSend($IF0, echorequest_tunnel_tn_to_nut1); my ($ret, $hot_cookie, $cot_cookie) = return_routability_nut1_to_tn($IF0, $kcn, $home_nonce_index, $careof_nonce_index); if (0 != $ret) { vLogHTML('TN cannot complete Return Routability Procedure.'); exit $V6evalTool::exitFail; } # wait for Binding Update from MN $ret = wait_bu_from_cn_at_linkx($IF0, $kcn, $home_nonce_index, $careof_nonce_index, $hot_cookie, $cot_cookie); if (0 != $ret) { vLogHTML('TN cannot get Binding Update.'); exit $V6evalTool::exitFail; } vSleep(3); vSend($IF0, ra_r1_to_multi); vSend($IF0, na_r1lla_to_nut1); # sending binding refresh request vSend($IF0, bindingrequest_tn_to_nut1); my $check_hoti = 0; my $check_coti = 0; my $n; my $home_nonce = getHomeNonce($home_nonce_index); my $careof_nonce = getCareOfNonce($careof_nonce_index); for ($n=0; $n<5; $n++) { last if ($check_hoti == 1 && $check_coti == 1); %ret = vRecv($IF0, 5, 0, 0, hoti_nut1_to_ha0, coti_nut1_to_tn); if(0 == $ret{status}) { # got HOTI Message from NUT1 if ( $ret{recvFrame} eq hoti_nut1_to_ha0) { $check_hoti = 1; $hot_cookie = get_cookie('Frame_Ether.Packet_IPv6.Packet_IPv6', \%ret); # print src/dst addresses vLogHTML("source address = $ret{\"Frame_Ether\.Packet_IPv6\.Hdr_IPv6\.SourceAddress\"}
"); vLogHTML("destination address = $ret{\"Frame_Ether\.Packet_IPv6\.Hdr_IPv6\.DestinationAddress\"}
"); my $cpp = ''; $cpp .= "-DHOT_NONCE_INDEX=$home_nonce_index "; $cpp .= "-DHOT_NONCE=\\\"$home_nonce\\\" "; $cpp .= "-DHOT_HOTCOOKIE=\\\"$hot_cookie\\\" "; $cpp .= "-DKCN=\\\"$kcn\\\" "; vCPP($cpp); my %hot = vSend($IF0, hot_tn_to_nut1_via_ha0); if(defined($hot{"Frame_Ether.Packet_IPv6.Packet_IPv6.Hdr_MH_HoT"})) { vLogHTML('Sending HoT
'); vLogHTML("home init cookie = ".$hot{"Frame_Ether.Packet_IPv6.Packet_IPv6.Hdr_MH_HoT.InitCookie"}."
"); vLogHTML("home keygen token = ".$hot{"Frame_Ether.Packet_IPv6.Packet_IPv6.Hdr_MH_HoT.KeygenNonce"}."
"); vLogHTML("home nonce index = ".$hot{"Frame_Ether.Packet_IPv6.Packet_IPv6.Hdr_MH_HoT.Index"}."
"); vLogHTML("* home nonce = $home_nonce
"); vLogHTML("* Kcn = $kcn
"); # print src/dst addresses vLogHTML("source address = $hot{\"Frame_Ether\.Packet_IPv6\.Hdr_IPv6\.SourceAddress\"}
"); vLogHTML("destination address = $hot{\"Frame_Ether\.Packet_IPv6\.Hdr_IPv6\.DestinationAddress\"}
"); } } # got COTI Message from NUT1 if ( $ret{recvFrame} eq coti_nut1_to_tn) { $check_coti = 1; $cot_cookie = get_cookie('Frame_Ether.Packet_IPv6', \%ret); # print src/dst addresses vLogHTML("source address = $ret{\"Frame_Ether\.Packet_IPv6\.Hdr_IPv6\.SourceAddress\"}
"); vLogHTML("destination address = $ret{\"Frame_Ether\.Packet_IPv6\.Hdr_IPv6\.DestinationAddress\"}
"); my $cpp = ''; $cpp .= "-DCOT_NONCE_INDEX=$careof_nonce_index "; $cpp .= "-DCOT_NONCE=\\\"$careof_nonce\\\" "; $cpp .= "-DCOT_COTCOOKIE=\\\"$cot_cookie\\\" "; $cpp .= "-DKCN=\\\"$kcn\\\" "; vCPP($cpp); my %cot = vSend($IF0, cot_tn_to_nut1); if(defined($cot{"Frame_Ether.Packet_IPv6.Hdr_MH_CoT"})) { vLogHTML('Sending CoT
'); vLogHTML("care-of init cookie = ".$cot{"Frame_Ether.Packet_IPv6.Hdr_MH_CoT.InitCookie"}."
"); vLogHTML("care-of keygen token = ".$cot{"Frame_Ether.Packet_IPv6.Hdr_MH_CoT.KeygenNonce"}."
"); vLogHTML("care-of nonce index = ".$cot{"Frame_Ether.Packet_IPv6.Hdr_MH_CoT.Index"}."
"); vLogHTML("* care-of nonce = $careof_nonce
"); vLogHTML("* Kcn = $kcn
"); # print src/dst addresses vLogHTML("source address = $cot{\"Frame_Ether\.Packet_IPv6\.Hdr_IPv6\.SourceAddress\"}
"); vLogHTML("destination address = $cot{\"Frame_Ether\.Packet_IPv6\.Hdr_IPv6\.DestinationAddress\"}
"); } } } } if ($check_hoti != 1 || $check_coti != 1){ vLogHTML('TN cannot complete Return Routability Procedure.'); exit $V6evalTool::exitWarn; } # receive Binding Update $bu_check=0; $cpp = ''; $cpp .= "-DHOT_NONCE_INDEX=$home_nonce_index "; $cpp .= "-DHOT_NONCE=\\\"$home_nonce\\\" "; $cpp .= "-DHOT_HOTCOOKIE=\\\"$hot_cookie\\\" "; $cpp .= "-DCOT_NONCE_INDEX=$careof_nonce_index "; $cpp .= "-DCOT_NONCE=\\\"$careof_nonce\\\" "; $cpp .= "-DCOT_COTCOOKIE=\\\"$cot_cookie\\\" "; $cpp .= "-DKCN=\\\"$kcn\\\" "; vCPP($cpp); for ($n=0; $n<5; $n++){ %ret = vRecv($IF0, 5, 0, 0, bindingupdate_nut1_to_tn); if( $ret{recvFrame} eq 'bindingupdate_nut1_to_tn') { vLogHTML("TN received Binding Update(w/HAO) from NUT1.
"); get_binding_update_value('Frame_Ether.Packet_IPv6.Hdr_MH_BU', \%ret); $bu_check++; last; } } if (0 == $bu_check) { vLogHTML('TN could not get Binding Update from NUT1.
'); exit $V6evalTool::exitWarn; } vLogHTML("OK
"); exit $V6evalTool::exitPass; ################################################################ __END__ =head1 NAME ProcessingBRR - Processing Binding Refresh Requests =head1 TARGET =begin html
Host
=end html =head1 SYNOPSIS =begin html
ProcessingBRR.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

Processing Binding Refresh Requests

       HA0     NUT1     R1      TN
        |       |       |       |
        |       | <---- |       | RA
        |       |       |       |
        | <---- |       |       | Binding Update (*1) 
        | ----> |       |       | Binding Acknowledgement
        |       |       |       |
        |       | <------------ | Echo Request (out: HA0->NUT1, in: TN->NUT0)
        | <==== |       | ----> | Home Test Init(HoTI)
        |       | ------------> | Care-of Test (CoTI)
        | ====> |       | <---- | Home Test (HoT)
        |       | <------------ | Care-of Test (CoTI)
        | <==== |       | ----> | reversed tunneled Echo Reply (out:NUT1->HA0, in:NUT0->TN)
        |       | ------------> | Binding Update
        |       |       |       |
        |       | <------------ | Binding Refresh Request
        | <==== |       | ----> | Home Test Init(HoTI)
        |       | ------------> | Care-of Test (CoTI)
        | ====> |       | <---- | Home Test (HoT)
        |       | <------------ | Care-of Test (CoTI)
        |       | ------------> | Binding Update
        |       |       |       |
=end html =head1 JUDGEMENT =begin html
(*1) PASS: HA0 receives Binding Update
(*2) PASS: TN doesn't receive Binding Update
=end html =head1 REFERENCE =begin html
draft-ietf-mobileip-ipv6-20.txt
11.7.4 Receiving Binding Refresh Requests
   When a mobile node receives a packet containing a Binding Refresh
   Request message and there already exists a Binding Update List entry
   for the source of the Binding Refresh Request, it SHOULD start a
   return routability procedure.  The mobile node MAY also choose to
   ignore the Binding Refresh Request.  Also, the mobile node can at any
   time delete its binding from a correspondent node.
=end html