#!/usr/bin/perl # # $Copyright$ # # $TAHI: ct/mip6/CN_DeleteBindingZero.seq,v 1.8.4.6 2002/01/29 05:39:44 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', bindingupdate => ' Send Binding Update (A bit is not set)', delete_binding => ' Send Binding Update (Lifetime is zero)', bindingacknowledgement => ' Recv Binding Acknowledgement (with Binding Cache entry)', bindingacknowledgement_no_bce => ' Recv Binding Acknowledgement (no Binding Cache entry)', 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 - Lifetime is zero ##################
"); 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, bindingupdate); %ret = vRecv($IF0, 5, 0, 0, param_problem, bindingacknowledgement, bindingacknowledgement_no_bce); if($ret{recvFrame} eq 'param_problem') { vLogHTML('NUT does not support this function.
'); exit $V6evalTool::exitNS; } vClear($IF0); %ret = vSend($IF0, delete_binding); vLogHTML("Wait Binding Acknowledgement
"); %ret = vRecv($IF0, 5, 0, 0, bindingacknowledgement, bindingacknowledgement_no_bce); if($ret{status} != 0) { vLogHTML('No response from NUT
'); vLogHTML('NG
'); exit $V6evalTool::exitFail; } if($ret{recvFrame} eq 'bindingacknowledgement_no_bce') { vLogHTML('NUT sends back Binding Acknowledgement, directly.
'); vLogHTML('This packet may not reach MN.
'); vLogHTML('WARN
'); exit $V6evalTool::exitWarn; } if($ret{recvFrame} ne 'bindingacknowledgement') { vLogHTML('Can not receive Binding Acknowledgement
'); vLogHTML('NG
'); exit $V6evalTool::exitFail; } my $lifetime = 0; my $refresh = 0; if((defined($ret{'Frame_Ether.Packet_IPv6.Hdr_Destination.Opt_MIPBindingAck.Lifetime'})) && (defined($ret{'Frame_Ether.Packet_IPv6.Hdr_Destination.Opt_MIPBindingAck.Refresh'}))) { $lifetime = $ret{'Frame_Ether.Packet_IPv6.Hdr_Destination.Opt_MIPBindingAck.Lifetime'}; $refresh = $ret{'Frame_Ether.Packet_IPv6.Hdr_Destination.Opt_MIPBindingAck.Refresh'}; } else { exit $V6evalTool::exitFatal; } vLogHTML("Get Binding Acknowledgement !
"); vLogHTML("Lifetime = $lifetime
"); vLogHTML("Refresh = $refresh
"); if(($lifetime != 0) || ($refresh != 0)) { vLogHTML('WARN
'); exit $V6evalTool::exitWarn; } #open(XXX, "> log.txt"); # #while(($key, $value) = each %ret) { # print XXX "$key\t$value\n"; #} # #close(XXX); vLogHTML(OK); exit $V6evalTool::exitPass; ################################################################ __END__ =head1 NAME CN_DeleteBindingZero - Lifetime is zero(care-of addr != home addr) =head1 TARGET =begin html
Host and Router
=end html =head1 SYNOPSIS =begin html
CN_DeleteBindingZero.seq [-tooloption ...] -pkt CN_DeleteBindingZero.def
-tooloption: v6eval tool option
=end html =head1 TOPOLOGY =begin html
                                                      MN'
                                                      |
                                      --------+-------+------- LinkY
                                              |
                                              R2      MN
                                              |       |
Link1 --------+-------        --------+-------+-------+------- LinkX
              |                       |
             NUT                      R1
              |                       |
Link0 --------+-----------------------+-----------------------
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
R1(Link0) 3ffe:501:ffff:100:200:ff:fe00:a0a0  
MN 3ffe:501:ffff:102:200:ff:fe00:0004 home address
MN' 3ffe:501:ffff:103:200:ff:fe00:0004 care-of address
=end html =head1 TEST PROCEDURE =begin html
       NUT      R1      MN      MN'
        |       |       |       |
        | <---- |       |       | RA
        |       |       |       |
        | <-------------------- | Echo Request
        | ----> |       |       | NS
        | <---- |       |       | NA
        | --------------------> | Echo Reply (*1)
        |       |       |       |
        | <---- |       |       | NA
        |       |       |       |
        | <-------------------- | Binding Update
        |       |       |       |
        | <-------------------- | Binding Update (Lifetime is zero)
        | --------------------> | Binding Acknowledgement (*2)
        |       |       |       |

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 Cache entry operation
        3.1. MN' sends Binding Update to Cache a Binding
        3.2. MN' sends Binding Update to Delete a Binding
        3.3. Wait Binding Acknowledgement
        3.4. Receive Binding Acknowledgement
=end html =head1 JUDGEMENT =begin html
(*1) PASS: MN' receives Echo Reply
(*2) PASS: MN' receives Binding Acknowledgement
     WARN: MN receives Binding Acknowledgement
=end html =head1 REFERENCE =begin html
<draft-ietf-mobileip-ipv6-15.txt>
5.1. Binding Update Option
   If the care-of address for the binding (specified either in an
   Alternate Care-of Address sub-option in the Binding Update option, if
   present, or in the Source Address field in the packet's IPv6 header)
   is equal to the home address of the mobile node, the Binding Update
   option indicates that any existing binding for the mobile node MUST
   be deleted.  Likewise, if the Lifetime field in the Binding Update
   option is equal to 0, the Binding Update option indicates that any
   existing binding for the mobile node MUST be deleted.  In each of
   these cases, a Binding Cache entry for the mobile node MUST NOT be
   created in response to receiving the Binding Update.
8.2. Receiving Binding Updates
   If the Binding Update is valid according to the tests above, then the
   Binding Update is processed further as follows:
    -  If the Lifetime specified in the Binding Update is nonzero and
       the specified Care-of Address is not equal to the home address
       for the binding, then this is a request to cache a binding for
       the mobile node.  If the Home Registration (H) bit is set in the
       Binding Update, the Binding Update is processed according to the
       procedure specified in Section 9.1; otherwise, it is processed
       according to the procedure specified in Section 8.3.
    -  If the Lifetime specified in the Binding Update is zero or the
       specified Care-of Address matches the home address for the
       binding, then this is a request to delete the mobile node's
       cached binding.  If the Home Registration (H) bit is set in the
       Binding Update, the Binding Update is processed according to the
       procedure specified in Section 9.2; otherwise, it is processed
       according to the procedure specified in Section 8.4.
8.4. Requests to Delete a Binding
   When a node receives a Binding Update, it MUST validate it and
   determine the type of Binding Update according to the steps described
   in Section 8.2.  This section describes the processing of a valid
   Binding Update that requests a node to delete a mobile node's binding
   from its Binding Cache, for which the Home Registration (H) bit is
   not set in the Binding Update.  In this case, the receiving node MUST
   delete any existing entry in its Binding Cache for this mobile node.
=end html =head1 SEE ALSO =begin html
CN_Common.def
=end html =cut