#!/usr/bin/perl
#
# $Copyright_v6PC$
#
# $Intap$
# $TINY: RA_decVLT.seq,v 1.9 2002/03/05 17:13:55 miyata Exp $
# 

########################################################################
BEGIN { $V6evalTool::TestVersion = '$Name:  $ '; }
use V6evalTool;
use SAA;

#------------------------------------------------------
#----- get sequence arguments
#------------------------------------------------------
$howto_initNUT="none";
$send = "ok";
foreach (@ARGV) {
# How to configure address of NUT?
# sample: boot, ra, manual+_GLOBAL0A0N_UCAST
    /^addrconf=(\S+)/ && do {$SAA::howto_addrconf=$1; next; };

# How to initialize NUT?
# sample: none, DADSuccess_boot, DADFail_boot
    /^init=(\S+)/     && do {$howto_initNUT=$1; next; };

# "none" if send no pakcet to NUT in state DADPostSendNS
# sample: ok, none
    /^send=(\S+)/     && do {$send=$1; next; };

# sequence debug options
# sample: qR
    /^sd=(\S+)/       && do {$seqdebugopt=$1; next; };
    seqERROR("Unknown sequence option '$_'");
}
#------------------------------------------------------

#----- test condition
$IF=Link0;                 # network interface

$max_retry_count = 10;     # retry if NUT state becomes DADPostSendNS
$max_retry_count = 2 if $SAA::sd =~ /q/;    # quick retry
$send_interval  = 1;
	       # 1[sec] time between DAD NS and DAD NS, send to NUT
               #     (RandomDelay is 0-1sec  e.g. default RetransTimer 1000msec)

$DAD_GA = $SAA::DADTransmitsGA;
$DAD_GA =~ tr/a-z/A-Z/ ;


$longVLT = 90;
$shortVLT = 20;
$sleepadj = 0;

##########################################################
#----- Check Target Type

$type=$V6evalTool::NutDef{Type};
if($type eq router) {
    vLogHTML("This test is for the host only<BR>");
    exit $V6evalTool::exitHostOnly;
}

if($type ne host) {
    vLogHTML(ndErrmsg("ERROR: $V6evalTool::NutDef{Type}: ".
		      "Unknown target type<BR>"));
    exit $V6evalTool::exitFail;
}

##########################################################
#----- initialize NUT
vLog("*** Target initialization phase ***");
if($V6evalTool::NutDef{System} ne "manual"){ vSleep($SAA::test_interval); }
$rret=vRemote("reboot_async.rmt","","timeout=$SAA::wait_rebootcmd");
vLog("reboot_async.rmt returned status $rret");

#----- start Capturing
vLog("*** Target testing phase ***");
vCapture($IF);

#----- LLA PHASE
#----- Wait DAD NS from NUT or timeout
vLog("TN wait DAD NS(DADNS_from_NUT) from NUT for $SAA::wait_dadns{$SAA::howto_addrconf} [sec],");

%ret1=vRecv($IF,$SAA::wait_dadns{$SAA::howto_addrconf},0,0,DADNS_from_NUT);

if ($ret1{status} != 0){
    vLog("TN wait DAD NS from NUT for $SAA::wait_dadns{$SAA::howto_addrconf}, but NUT had not transmit DAD NS");
    seqNG();
}

#----- RA PHASE
vLog("TN received DAD NS from NUT.");
vLog("OK! Let's go ahead!");
%ret2=vRecv($IF,$SAA::wait_rs,0,0,RS_from_NUT,RS_from_NUT_wSLL);

if ($ret2{status} != 0){
    vLog("Though TN had waited RS from NUT for $SAA::wait_rs,");
    vLog(" NUT seems not to send RS.");
    vLog(" Anyway TN is sending Unsolicited RA (Prefix=Global)");
}else{
    vLog("TN received RS from NUT.");
    vLog("TN is sending RA (Prefix=Global)");
}

#--------------------------
# First RA
#--------------------------

vSend($IF, RA_GA0_VLT90);
#--- VLT=90/PLT=45

$t0 = time();

#----- Wait DAD NS from NUT or timeout
vLog("TN wait DAD NS for Global address from NUT for $SAA::wait_dadns{ra} [sec],");

%ret3=vRecv($IF,$SAA::wait_dadns{ra},0,0,DADNS_from_NUT_GA0Tgt);

if ($ret3{status} == 0){
#----- check if NUT's address is configured
    vLog("NUT had transmitted DAD NS for its Global address.");

    $t0 = time();  #-- Here is the better posiotion for t0
    vLog("DAD complete time= $t0");
    vSleep($SAA::wait_addrconf_with_RA);

    if (seqCheckNUTAddrConfiguredGA($IF,
	SOLNS_from_TN_GA0Tgt, 
	NA_from_NUT_GA0Tgt, 
	NA_from_NUT_GA0Tgt_woTLL, 
	NA_from_GA0NUT_GA0Tgt, 
	NA_from_GA0NUT_GA0Tgt_woTLL) eq TRUE) {
       	vLog("NUT assigned Global address to the interface.");
        if ($DAD_GA eq "NO") {
            vLog("NUT transmit DAD NS though DADTransmitsGA == NO");
            seqNG();
    	}else{
       	    vLog("OK! Let's go ahead.");
    	}
    }else{
        vLog("NUT did not assign Global address.");
       	seqNG();
    }
} elsif ($ret3{status} != 0){
    $sleepadj = 5;
    vLog("NUT had not transmitted DAD NS for Global address.");
    if (seqCheckNUTAddrConfiguredGA($IF,
	SOLNS_from_TN_GA0Tgt, 
	NA_from_NUT_GA0Tgt, 
	NA_from_NUT_GA0Tgt_woTLL, 
	NA_from_GA0NUT_GA0Tgt, 
	NA_from_GA0NUT_GA0Tgt_woTLL) eq TRUE) {
       	vLog("NUT assigned Global address to the interface.");
        if ($DAD_GA eq "YES") {
            vLog("NUT did not transmit DAD NS though DADTransmitsGA == YES");
            seqNG();
    	}else{
       	    vLog("But it is OK if Global address consists of MAC address as LLA.");
       	    vLog("OK! Let's go ahead.");
    	}
    }else{
        vLog("NUT did not assign Global address.");
       	seqNG();
    }
}

$t1 = time();
#--- Wait 1/2 of $longerVLT
vSleep($t0 + ($longVLT/2) + 5 - $t1);

#--------------------------
# Send RA with shorter VLT(2nd)
#--------------------------

vSend($IF, RA_GA0_VLT20);
#--- VLT=20/PLT=10
$t2 = time();

#----- Wait DAD NS from NUT or timeout
vLog("TN wait DAD NS for Global address from NUT for $SAA::wait_dadns{ra} [sec],");

%ret4=vRecv($IF,$SAA::wait_dadns{ra},0,0,DADNS_from_NUT_GA0Tgt,DADNS_any, DADNS_any_wSLL);

if ($ret4{status} == 0){
#----- check if NUT's address is configured
    vLog("NUT transmitted DAD NS for its Global address");
    vLog("by receiving RA with greater VLT.");
    vSleep($SAA::wait_addrconf_with_RA);

    if (seqCheckNUTAddrConfiguredGA($IF,
	SOLNS_from_TN_GA0Tgt, 
	NA_from_NUT_GA0Tgt, 
	NA_from_NUT_GA0Tgt_woTLL, 
	NA_from_GA0NUT_GA0Tgt, 
	NA_from_GA0NUT_GA0Tgt_woTLL) eq TRUE) {
       	vLog("The address is still available.");
        if ($DAD_GA eq "NO") {
            vLog("NUT transmitted DAD NS though DADTransmitsGA == NO");
            seqNG();
    	}
       	vLog("OK! Let's go ahead.");
    }else{
       	vLog("The address is not available.");
        seqNG();
    }
} elsif ($ret4{status} != 0){
    vLog("NUT did not transmitted DAD NS for Global address");
    vLog("by receiving RA with greater VLT.");
    if (seqCheckNUTAddrConfiguredGA($IF,
	SOLNS_from_TN_GA0Tgt, 
	NA_from_NUT_GA0Tgt, 
	NA_from_NUT_GA0Tgt_woTLL, 
	NA_from_GA0NUT_GA0Tgt, 
	NA_from_GA0NUT_GA0Tgt_woTLL) eq TRUE) {
       	vLog("The address is still available.");
       	vLog("OK! Let's go ahead.");
    }else{
       	vLog("The address is not available.");
       	seqNG();
    }
}

#--------------------------
# Sleep until 3 sec before expiration of VLT in the 2nd RA since receiving it
#--------------------------

$t3 = time();
vSleep($t2+$shortVLT-$t3-3);

vLog("3 sec before the expiration of VLT in the 2nd RA since receiving it.");
vLog("Confirming whether assinged address is available.");
if (seqCheckNUTAddrConfiguredGA($IF,
	SOLNS_from_TN_GA0Tgt, 
	NA_from_NUT_GA0Tgt, 
	NA_from_NUT_GA0Tgt_woTLL, 
	NA_from_GA0NUT_GA0Tgt, 
	NA_from_GA0NUT_GA0Tgt_woTLL) eq TRUE) {
    vLog("The address is still available.");
}else{
    vLog("The address is not available.");
    seqNG();
}

#--------------------------
# Sleep until 3 sec after expiration of VLT in the 2nd RA since receiving it
#--------------------------

vSleep(6);

vLog("3 sec after the expiration of VLT in the 2nd RA since receiving it.");
vLog("Confirming whether assinged address is available.");
if (seqCheckNUTAddrConfiguredGA($IF,
	SOLNS_from_TN_GA0Tgt, 
	NA_from_NUT_GA0Tgt, 
	NA_from_NUT_GA0Tgt_woTLL, 
	NA_from_GA0NUT_GA0Tgt, 
	NA_from_GA0NUT_GA0Tgt_woTLL) eq TRUE) {
    vLog("The address is still available.");
}else{
    vLog("The address is not available.");
    seqNG();
}

#--------------------------
# Sleep until 10 sec before expiration of VLT in the 1st RA since receiving it
#--------------------------

$t4 = time();
vSleep($t0+$longVLT-$t4-10);

#--------------------------
# Send RA with shorter VLT again(3rd)
#--------------------------

vSend($IF, RA_GA0_VLT20);
#--- VLT=20/PLT=10
$t5 = time();

#----- Wait DAD NS from NUT or timeout
vLog("TN wait DAD NS for Global address from NUT for $SAA::wait_dadns{ra} [sec],");

%ret5=vRecv($IF,$SAA::wait_dadns{ra},0,0,DADNS_from_NUT_GA0Tgt,DADNS_any, DADNS_any_wSLL);

if ($ret5{status} == 0){
#----- check if NUT's address is configured
    vLog("NUT transmitted DAD NS for its Global address");
    vLog("by receiving RA with greater VLT.");
    vSleep($SAA::wait_addrconf_with_RA);

    if (seqCheckNUTAddrConfiguredGA($IF,
	SOLNS_from_TN_GA0Tgt, 
	NA_from_NUT_GA0Tgt, 
	NA_from_NUT_GA0Tgt_woTLL, 
	NA_from_GA0NUT_GA0Tgt, 
	NA_from_GA0NUT_GA0Tgt_woTLL) eq TRUE) {
       	vLog("The address is still available.");
        if ($DAD_GA eq "NO") {
            vLog("NUT transmitted DAD NS though DADTransmitsGA == NO");
            seqNG();
        }
       	vLog("OK! Let's go ahead.");
    }else{
       	vLog("The address is not available.");
        seqNG();
    }
} elsif ($ret5{status} != 0){
    vLog("NUT did not transmitted DAD NS for Global address");
    vLog("by receiving RA with greater VLT.");
    if (seqCheckNUTAddrConfiguredGA($IF,
	SOLNS_from_TN_GA0Tgt, 
	NA_from_NUT_GA0Tgt, 
	NA_from_NUT_GA0Tgt_woTLL, 
	NA_from_GA0NUT_GA0Tgt, 
	NA_from_GA0NUT_GA0Tgt_woTLL) eq TRUE) {
       	vLog("The address is still available.");
       	vLog("OK! Let's go ahead.");
    }else{
       	vLog("The address is not available.");
       	seqNG();
    }
}

#--------------------------
# Sleep until 3 sec before expiration of VLT in the 1st RA since receiving it
#--------------------------

$t6 = time();
vSleep($t0+$longVLT-$t6-3);

vLog("3 sec before the expiration of VLT in the 1st RA since receiving it.");
vLog("Confirming whether assinged address is available.");
if (seqCheckNUTAddrConfiguredGA($IF,
	SOLNS_from_TN_GA0Tgt, 
	NA_from_NUT_GA0Tgt, 
	NA_from_NUT_GA0Tgt_woTLL, 
	NA_from_GA0NUT_GA0Tgt, 
	NA_from_GA0NUT_GA0Tgt_woTLL) eq TRUE) {
    vLog("The address is still available.");
}else{
    vLog("The address is not available.");
    seqNG();
}

#--------------------------
# Sleep until 3 sec after expiration of VLT in the 1st RA since receiving it
#--------------------------

vSleep(6);

vLog("3 sec after the expiration of VLT in the 1st RA since receiving it.");
vLog("Confirming whether assinged address is available.");
if (seqCheckNUTAddrConfiguredGA($IF,
	SOLNS_from_TN_GA0Tgt, 
	NA_from_NUT_GA0Tgt, 
	NA_from_NUT_GA0Tgt_woTLL, 
	NA_from_GA0NUT_GA0Tgt, 
	NA_from_GA0NUT_GA0Tgt_woTLL) eq TRUE) {
    vLog("The address is still available.");
}else{
    vLog("The address is not available.");
    seqNG();
}

#--------------------------
# Sleep until 3 sec before expiration of VLT in the 3rd RA since receiving it
#--------------------------

$t7 = time();
vSleep($t5+$shortVLT-$t7-3);

vLog("3 sec before the expiration of VLT in the 3rd RA since receiving it.");
vLog("Confirming whether assinged address is available.");
if (seqCheckNUTAddrConfiguredGA($IF,
	SOLNS_from_TN_GA0Tgt, 
	NA_from_NUT_GA0Tgt, 
	NA_from_NUT_GA0Tgt_woTLL, 
	NA_from_GA0NUT_GA0Tgt, 
	NA_from_GA0NUT_GA0Tgt_woTLL) eq TRUE) {
    vLog("The address is still available.");
}else{
    vLog("The address is not available.");
    seqNG();
}

#--------------------------
# Sleep until 3 sec after expiration of VLT in the 3rd RA since receiving it
#--------------------------

vSleep(6);

vLog("3 sec after the expiration of VLT in the 1st RA since receiving it.");
vLog("Confirming whether assinged address is available.");
if (seqCheckNUTAddrConfiguredGA($IF,
	SOLNS_from_TN_GA0Tgt, 
	NA_from_NUT_GA0Tgt, 
	NA_from_NUT_GA0Tgt_woTLL, 
	NA_from_GA0NUT_GA0Tgt, 
	NA_from_GA0NUT_GA0Tgt_woTLL) eq TRUE) {
    vLog("The address is still available.");
    seqNG();
}else{
    vLog("The address is not available.");
    seqOK();
}


##########################################################


#end
########################################################################
__END__

=head1 NAME

RA_decVLT - check the address expiration process. NUT receives RAs three times which contain one Global Prefix, and second RA contains less VLT value than first one.(Assigning and Expiring Global address)

=head1 TARGET

All Node

=head1 SYNOPSIS

RA_decVLT.seq [-tooloption ...] -pkt <packetdef> [addrconf=<addrconfname>] 

  -tooloption   : v6eval tool option
  <packetdef>   : packet definition file (v6eval tool option)
  <addrconfname>: how to configure address on NUT; boot/reboot

=begin html
<PRE>
 detail of v6eval tool option: see perldoc V6evalTool.pm, perldoc V6evalRemote.pm
</PRE>

=end html


=head1 INITIALIZATION

=begin html
<PRE>
 Reboot NUT or Initialize interface of NUT or Initialize IPv6 stack of NUT.
</PRE>

=end html

=head1 TEST PROCEDURE

=over 1

=item Test for Unicast address autoconfiguration

The following tests are prepared in this test package. See INDEX file.

B<Test for all node>

   When NUT receives RA which contains Global Prefix, NUT assignes 
   autoconfigured address. Later NUT receives different RA which contains
   same prefix but greater VLT than first one before first VLT exires.
   At this point, NUT resets its VLT using second VLT, and the assinged 
   address MUST expire second VLT[sec] later.

B<Test sequence>

  TN                            NUT
  ---------------------------------
  Initialize NUT

  Configure address of NUT (reboot or interface initialization etc...)

  TN wait the DAD NS sent from NUT
  <=== Judgement #1: DAD NS =======
        name: DADNS_from_NUT

  <=== Judgement #2: RS ===========
        name: RS_from_NUT, RS_from_NUT_wSLL

  ==== Action #1: RA =============>
        name: RA_GA0_VLT90
        (1st RA VLT=longVLT)

  <=== Judgement #3: DAD NS =======
        name: DADNS_from_NUT_GA0Tgt


  Wait for 5+DupAddrDetectTransmits*(RetransTimer/1000)[sec]

  Check if NUT's address is configured
  ==== Action #2: SOL NS =========>
        name: SOLNS_from_TN_GA0Tgt

  <=== Judgement #4: SOL NA =======
        name: 
	      NA_from_NUT_GA0Tgt, 
	      NA_from_NUT_GA0Tgt_woTLL, 
	      NA_from_GA0NUT_GA0Tgt, 
	      NA_from_GA0NUT_GA0Tgt_woTLL


  Wait until (longVLT*1/2)+5[sec] pasts since receiving 1st RA

  ==== Action #3: RA =============>
        name: RA_GA0_VLT20
        (2nd RA  VLT=shortVLT)

  X<== Judgement #5: DAD NS =======
        name: DADNS_from_NUT_GA0Tgt,DADNS_any, DADNS_any_wSLL

  Check if NUT's address is configured
  ==== Action #4: SOL NS =========>
        name: SOLNS_from_TN_GA0Tgt

  <=== Judgement #6: SOL NA =======
        name: 
	      NA_from_NUT_GA0Tgt, 
	      NA_from_NUT_GA0Tgt_woTLL, 
	      NA_from_GA0NUT_GA0Tgt, 
	      NA_from_GA0NUT_GA0Tgt_woTLL


  Wait until (shortVLT)-3[sec] pasts since receiving 2nd RA

  Check if NUT's address is configured
  ==== Action #5: SOL NS =========>
        name: SOLNS_from_TN_GA0Tgt

  <=== Judgement #7: SOL NA =======
        name: 
	      NA_from_NUT_GA0Tgt, 
	      NA_from_NUT_GA0Tgt_woTLL, 
	      NA_from_GA0NUT_GA0Tgt, 
	      NA_from_GA0NUT_GA0Tgt_woTLL


  Wait until (shortVLT)+3[sec] pasts since receiving 2nd RA

  Check if NUT's address is configured
  ==== Action #6: SOL NS =========>
        name: SOLNS_from_TN_GA0Tgt

  <=== Judgement #8: DAD NA =======
        name: 
	      NA_from_NUT_GA0Tgt, 
	      NA_from_NUT_GA0Tgt_woTLL, 
	      NA_from_GA0NUT_GA0Tgt, 
	      NA_from_GA0NUT_GA0Tgt_woTLL


  Wait until (longVLT)-10[sec] pasts since receiving 1st RA

  ==== Action #7: RA =============>
        name: RA_GA0_VLT20
        (3rd RA  VLT=shortVLT)

  X<== Judgement #9: SOL NS =======
        name: 
	      NA_from_NUT_GA0Tgt, 
	      NA_from_NUT_GA0Tgt_woTLL, 
	      NA_from_GA0NUT_GA0Tgt, 
	      NA_from_GA0NUT_GA0Tgt_woTLL

  Check if NUT's address is configured
  ==== Action #8: SOL NS =========>
        name: SOLNS_from_TN_GA0Tgt

  <=== Judgement #10: SOL NA =======
        name: 
	      NA_from_NUT_GA0Tgt, 
	      NA_from_NUT_GA0Tgt_woTLL, 
	      NA_from_GA0NUT_GA0Tgt, 
	      NA_from_GA0NUT_GA0Tgt_woTLL


  Wait until (longVLT)-3[sec] pasts since receiving 1st RA

  Check if NUT's address is configured
  ==== Action #9: SOL NS =========>
        name: SOLNS_from_TN_GA0Tgt

  <=== Judgement #11: DAD NA =======
        name: 
	      NA_from_NUT_GA0Tgt, 
	      NA_from_NUT_GA0Tgt_woTLL, 
	      NA_from_GA0NUT_GA0Tgt, 
	      NA_from_GA0NUT_GA0Tgt_woTLL


  Wait until (longVLT)+3[sec] pasts since receiving 1st RA

  Check if NUT's address is configured
  ==== Action #10: SOL NS =========>
        name: SOLNS_from_TN_GA0Tgt

  <=== Judgement #12: DAD NA ======
        name: 
	      NA_from_NUT_GA0Tgt, 
	      NA_from_NUT_GA0Tgt_woTLL, 
	      NA_from_GA0NUT_GA0Tgt, 
	      NA_from_GA0NUT_GA0Tgt_woTLL


  Wait until (shortVLT)-3[sec] pasts since receiving 3rd RA

  Check if NUT's address is configured
  ==== Action #11: SOL NS =========>
        name: SOLNS_from_TN_GA0Tgt

  <=== Judgement #13: SOL NA =======
        name: 
	      NA_from_NUT_GA0Tgt, 
	      NA_from_NUT_GA0Tgt_woTLL, 
	      NA_from_GA0NUT_GA0Tgt, 
	      NA_from_GA0NUT_GA0Tgt_woTLL


  Wait until (shortVLT)+3[sec] pasts since receiving 3rd RA

  Check if NUT's address is configured
  ==== Action #12: SOL NS =========>
        name: SOLNS_from_TN_GA0Tgt

  X<== Judgement #14: SOL NA ======
        name: 
	      NA_from_NUT_GA0Tgt, 
	      NA_from_NUT_GA0Tgt_woTLL, 
	      NA_from_GA0NUT_GA0Tgt, 
	      NA_from_GA0NUT_GA0Tgt_woTLL


=back 1

=head1 JUDGEMENT

=over 1

=item Test for Unicast address autoconfiguration

B<Test for all NODE>

B<NUT performs Stateless Address Autoconfiguration(Global) on its interface>

   Judgement #1. NUT MUST transmit DAD NS for its autoconfigured Link-local address.
        name: DADNS_from_NUT
	src: ::0
	dst: solnode[NUT's tentative Link-local]
        TargetAddress: NUT's tentative Link-local

   Judgement #2. NUT SHOULD transmit RS.
        name: RS_from_NUT
        src: NUT's Link-local
        dst: allrouter

   Action #1. TN transmits RA which contains Global Prefix.
        name: RA_GA0_VLT90
	src: TN's Link-local
	dst: allnode
	PXOPT: Global0
		VLT=90
		PLT=45

   Judgement #3. NUT MUST transmit DAD NS for its autoconfigured Global address.
		 (* If the address is consisits of EUI64, as same as Link-local
		 address, This DAD MAY be omitted.)
        name: DADNS_from_NUT_GA0Tgt
        src: ::0
	dst: solnode[NUT's tentative Global0]
        TargetAddress: NUT's tentative Global0

   Action #2. TN transmits SOL NS to check if NUT's address is configured.
        name: SOLNS_from_TN_GA0Tgt
        src: TN's Link-local
	dst: solnode[NUT's Global0]
        TargetAddress: NUT's Global0

   Judgement #4. NUT MUST transmit SOL NA for its autoconfigured  Global address.
        name: 
	      NA_from_NUT_GA0Tgt, 
	      NA_from_NUT_GA0Tgt_woTLL, 
	      NA_from_GA0NUT_GA0Tgt, 
	      NA_from_GA0NUT_GA0Tgt_woTLL
	src: NUT's any Unicast Address
	dst: TN's Link-local
        TargetAddress: NUT's Global0
        RFlag: 0
        SFlag: 1
        OFlag: 1
	TLLOPT: NUT's MAC address
	(* TLLOPT may be omitted)

   Action #3. TN transmits RA which contains Global Prefix.
        name: RA_GA0_VLT20
	src: TN's Link-local
	dst: allnode
	PXOPT: Global0
		VLT=20
		PLT=10


   Judgement #5. NUT MUST NOT transmit DAD NS for its autoconfigured Global address.
		 (* If the address is consisits of EUI64, as same as Link-local
		 address, This DAD MAY be omitted.)
        name: DADNS_from_NUT_GA0Tgt,DADNS_any, DADNS_any_wSLL
        src: ::0
	dst: solnode[NUT's tentative Global0]
        TargetAddress: NUT's tentative Global0


   Action #4. TN transmits SOL NS to check if NUT's address is configured.
        name: SOLNS_from_TN_GA0Tgt
        src: TN's Link-local
	dst: solnode[NUT's Global0]
        TargetAddress: NUT's Global0

   Judgement #6. NUT MUST transmit SOL NA for its autoconfigured  Global address.
        name: 
	      NA_from_NUT_GA0Tgt, 
	      NA_from_NUT_GA0Tgt_woTLL, 
	      NA_from_GA0NUT_GA0Tgt, 
	      NA_from_GA0NUT_GA0Tgt_woTLL
	src: NUT's any Unicast Address
	dst: TN's Link-local
        TargetAddress: NUT's Global0
        RFlag: 0
        SFlag: 1
        OFlag: 1
	TLLOPT: NUT's MAC address
	(* TLLOPT may be omitted)

   Action #5. TN transmits SOL NS to check if NUT's address is configured.
        name: SOLNS_from_TN_GA0Tgt
        src: TN's Link-local
	dst: solnode[NUT's Global0]
        TargetAddress: NUT's Global0

   Judgement #7. NUT MUST transmit SOL NA for its autoconfigured  Global address.
        name: 
	      NA_from_NUT_GA0Tgt, 
	      NA_from_NUT_GA0Tgt_woTLL, 
	      NA_from_GA0NUT_GA0Tgt, 
	      NA_from_GA0NUT_GA0Tgt_woTLL
	src: NUT's any Unicast Address
	dst: TN's Link-local
        TargetAddress: NUT's Global0
        RFlag: 0
        SFlag: 1
        OFlag: 1
	TLLOPT: NUT's MAC address
	(* TLLOPT may be omitted)

   Action #6. TN transmits SOL NS to check if NUT's address is configured.
        name: SOLNS_from_TN_GA0Tgt
        src: TN's Link-local
	dst: solnode[NUT's Global0]
        TargetAddress: NUT's Global0

   Judgement #8. NUT MUST transmit SOL NA for its autoconfigured  Global address.
        name: 
	      NA_from_NUT_GA0Tgt, 
	      NA_from_NUT_GA0Tgt_woTLL, 
	      NA_from_GA0NUT_GA0Tgt, 
	      NA_from_GA0NUT_GA0Tgt_woTLL
	src: NUT's any Unicast Address
	dst: TN's Link-local
        TargetAddress: NUT's Global0
        RFlag: 0
        SFlag: 1
        OFlag: 1
	TLLOPT: NUT's MAC address
	(* TLLOPT may be omitted)


   Action #7. TN transmits RA which contains Global Prefix.
        name: RA_GA0_VLT20
	src: TN's Link-local
	dst: allnode
	PXOPT: Global0
		VLT=20
		PLT=10


   Judgement #9. NUT MUST NOT transmit DAD NS for its autoconfigured Global address.
		 (* If the address is consisits of EUI64, as same as Link-local
		 address, This DAD MAY be omitted.)
        name: DADNS_from_NUT_GA0Tgt,DADNS_any, DADNS_any_wSLL
        src: ::0
	dst: solnode[NUT's tentative Global0]
        TargetAddress: NUT's tentative Global0

   Action #8. TN transmits SOL NS to check if NUT's address is configured.
        name: SOLNS_from_TN_GA0Tgt
        src: TN's Link-local
	dst: solnode[NUT's Global0]
        TargetAddress: NUT's Global0

   Judgement #10. NUT MUST transmit SOL NA for its autoconfigured  Global address.
        name: 
	      NA_from_NUT_GA0Tgt, 
	      NA_from_NUT_GA0Tgt_woTLL, 
	      NA_from_GA0NUT_GA0Tgt, 
	      NA_from_GA0NUT_GA0Tgt_woTLL
	src: NUT's any Unicast Address
	dst: TN's Link-local
        TargetAddress: NUT's Global0
        RFlag: 0
        SFlag: 1
        OFlag: 1
	TLLOPT: NUT's MAC address
	(* TLLOPT may be omitted)


   Action #9. TN transmits SOL NS to check if NUT's address is configured.
        name: SOLNS_from_TN_GA0Tgt
        src: TN's Link-local
	dst: solnode[NUT's Global0]
        TargetAddress: NUT's Global0

   Judgement #11. NUT MUST transmit SOL NA for its autoconfigured  Global address.
        name: 
	      NA_from_NUT_GA0Tgt, 
	      NA_from_NUT_GA0Tgt_woTLL, 
	      NA_from_GA0NUT_GA0Tgt, 
	      NA_from_GA0NUT_GA0Tgt_woTLL
	src: NUT's any Unicast Address
	dst: TN's Link-local
        TargetAddress: NUT's Global0
        RFlag: 0
        SFlag: 1
        OFlag: 1
	TLLOPT: NUT's MAC address
	(* TLLOPT may be omitted)


   Action #10. TN transmits SOL NS to check if NUT's address is configured.
        name: SOLNS_from_TN_GA0Tgt
        src: TN's Link-local
	dst: solnode[NUT's Global0]
        TargetAddress: NUT's Global0

   Judgement #12. NUT MUST transmit SOL NA for its autoconfigured  Global address.
        name: 
	      NA_from_NUT_GA0Tgt, 
	      NA_from_NUT_GA0Tgt_woTLL, 
	      NA_from_GA0NUT_GA0Tgt, 
	      NA_from_GA0NUT_GA0Tgt_woTLL
	src: NUT's any Unicast Address
	dst: TN's Link-local
        TargetAddress: NUT's Global0
        RFlag: 0
        SFlag: 1
        OFlag: 1
	TLLOPT: NUT's MAC address
	(* TLLOPT may be omitted)


   Action #11. TN transmits SOL NS to check if NUT's address is configured.
        name: SOLNS_from_TN_GA0Tgt
        src: TN's Link-local
	dst: solnode[NUT's Global0]
        TargetAddress: NUT's Global0

   Judgement #13. NUT MUST transmit SOL NA for its autoconfigured  Global address.
        name: 
	      NA_from_NUT_GA0Tgt, 
	      NA_from_NUT_GA0Tgt_woTLL, 
	      NA_from_GA0NUT_GA0Tgt, 
	      NA_from_GA0NUT_GA0Tgt_woTLL
	src: NUT's any Unicast Address
	dst: TN's Link-local
        TargetAddress: NUT's Global0
        RFlag: 0
        SFlag: 1
        OFlag: 1
	TLLOPT: NUT's MAC address
	(* TLLOPT may be omitted)


   Action #12. TN transmits SOL NS to check if NUT's address is configured.
        name: SOLNS_from_TN_GA0Tgt
        src: TN's Link-local
	dst: solnode[NUT's Global0]
        TargetAddress: NUT's Global0

   Judgement #14. NUT MUST NOT transmit SOL NA for its autoconfigured  Global address.
        name: 
	      NA_from_NUT_GA0Tgt, 
	      NA_from_NUT_GA0Tgt_woTLL, 
	      NA_from_GA0NUT_GA0Tgt, 
	      NA_from_GA0NUT_GA0Tgt_woTLL
	src: NUT's any Unicast Address
	dst: TN's LIink-local
        TargetAddress: NUT's Global0
        RFlag: 0
        SFlag: 1
        OFlag: 1
	TLLOPT: NUT's MAC address
	(* TLLOPT may be omitted)

=back 1

=head1 REFERENCE

=begin html
<PRE>
RFC2462
<HR>
   (omit)
<BR>
5.5.3.  Router Advertisement Processing
<BR>
   (omit)
<BR>
    e) If the advertised prefix matches the prefix of an autoconfigured
       address (i.e., one obtained via stateless or stateful address
       autoconfiguration) in the list of addresses associated with the
       interface, the specific action to perform depends on the Valid
       Lifetime in the received advertisement and the Lifetime
       associated with the previously autoconfigured address (which we
       call StoredLifetime in the discussion that follows):
<BR>
       1) <B>If the received Lifetime is</B> greater than 2 hours or <B>greater
          than StoredLifetime, update the stored Lifetime of the
          corresponding address.</B>
<BR>
       2) <B>If the StoredLifetime is less than or equal to 2 hours and the
          received Lifetime is less than or equal to StoredLifetime,
          ignore the prefix</B>, unless the Router Advertisement from which
          this Prefix Information option was obtained has been
          authenticated (e.g., via IPSec [RFC2402]). If the Router
          Advertisment was authenticated, the StoredLifetime should be
          set to the Lifetime in the received option.
<BR>
       3) Otherwise, reset the stored Lifetime in the corresponding
          address to two hours.
<BR>
       The above rules address a specific denial of service attack in
       which a bogus advertisement could contain prefixes with very
       small Valid Lifetimes. Without the above rules, a single
       unauthenticated advertisement containing bogus Prefix Information
       options with short Lifetimes could cause all of a node's
       addresses to expire prematurely. The above rules insure that
       legitimate advertisements (which are sent periodically) will
       "cancel" the short lifetimes before they actually take effect.
<BR>
5.5.4.  Address Lifetime Expiry
<BR>
   A preferred address becomes deprecated when its preferred lifetime
   expires.  <B>A deprecated address SHOULD continue to be used as a source
   address in existing communications, but SHOULD NOT be used in new
   communications if an alternate (non-deprecated) address is available
   and has sufficient scope.  IP and higher layers (e.g., TCP, UDP) MUST
   continue to accept datagrams destined to a deprecated address since a
   deprecated address is still a valid address for the interface.</B> An
   implementation MAY prevent any new communication from using a
   deprecated address, but system management MUST have the ability to
   disable such a facility, and the facility MUST be disabled by
   default.
<BR>
   <B>An address (and its association with an interface) becomes invalid
   when its valid lifetime expires.  An invalid address MUST NOT be used
   as a source address in outgoing communications and MUST NOT be
   recognized as a destination on a receiving interface.</B>
<BR>
   (omit)
</PRE>

=end html

=head1 SEE ALSO

=begin html
<PRE>
 detail of v6eval tool option: see perldoc V6evalTool.pm, perldoc V6evalRemote.pm
</PRE>

=end html

=cut

