#!/usr/bin/perl
#
#$Copyright$
#
#$Id: C_RFC3315_18_1_8_RecvReplyUpdatedAddr.seq,v 1.10 2006/01/24 07:05:23 zhang Exp $
###############################################################################
BEGIN{
$V6evalTool::TestVersion = '$Name: $';
}
use V6evalTool;
use DHCPv6_common;
use Client_pktdesc;
#--------------------------------------------------------------#
# Initialization variables
#--------------------------------------------------------------#
$IF0_NUT = $V6evalTool::NutDef{Link0_device};
$IF0 = Link0;
$plifetime = 100 ;
$vlifetime = 200 ;
$time1 = $plifetime * 0.5;
$time2 = $plifetime * 0.8;
#--------------------------------------------------------------#
# Initialize DHCPv6 Client
#--------------------------------------------------------------#
my $ret = vRemote("dhcp6c.rmt", "start", "link0=$IF0_NUT");
if($ret != 0){
vLogHTML('Cannot Initialize DHCPv6 Client program.
');
dhcpExitFail;
};
vCapture($IF0);
#--------------------------------------------------------------#
#1. Wait until Solicit arrives
#--------------------------------------------------------------#
my ($retsol,%sol) = wait_for_solicit($IF0,30) ;
if($retsol != 0){
dhcpExitFail;
}
vClear($IF0);
#--------------------------------------------------------------#
# 2. send Advertise message
#--------------------------------------------------------------#
$SID_OPTION = "opt_SID_LLT_server1";
$IA_NA_OPTION = "opt_IA_NA_Addr_woStatus";
my ($retadv, %adv) = send_advertise($IF0, "advertise_server1_to_nut", \%sol, "");
if($retadv != 0){
dhcpExitFail;
}
#--------------------------------------------------------------#
#3. Wait until Request arrives
#--------------------------------------------------------------#
my ($retreq,%req) = wait_for_request($IF0,30);
if($retreq != 0){
dhcpExitFail;
}
vClear($IF0);
#--------------------------------------------------------------#
#4. send Reply message
#--------------------------------------------------------------#
$IA_NA_OPTION = "opt_IA_NA_Addr";
$StatusCode_OPTION = "opt_StatusCode";
my $cppstr = "-DIA_NA_TIME1=$time1 -DIA_NA_TIME2=$time2 -DIA_ADDR_PLTIME=$plifetime -DIA_ADDR_VLTIME=$vlifetime ";
my ($retrep, %rep) = send_reply($IF0, "reply_server1_to_nut", \%req,$cppstr);
# receive DAD message and test the IP address
vRecv($IF0, 3, 0, 0, dadns_nutga);
vSleep(3);
$ret = ping_test($IF0);
if($ret != 0){
dhcpExitFail;
}
vClear($IF0);
#--------------------------------------------------------------#
#5. wait for Renew message
#--------------------------------------------------------------#
my ($retren, %ren) = wait_for_renew($IF0, ($time1 + 5));
if($retren != 0){
dhcpExitFail;
}
vClear($IF0);
#--------------------------------------------------------------#
#6. send Reply message
#--------------------------------------------------------------#
$IA_NA_OPTION = "opt_IA_NA_Addr";
$StatusCode_OPTION = "opt_StatusCode";
$vlifetime = 100;
$plifetime = 50;
$time1 = 0.5 * $plifetime;
$time2 = 0.8 * $vlifetime;
$cppstr = "-DIA_NA_TIME1=$time1 -DIA_NA_TIME2=$time2 -DIA_ADDR_PLTIME=$plifetime -DIA_ADDR_VLTIME=$vlifetime ";
my ($retrep, %rep) = send_reply($IF0, "reply_server1_to_nut", \%ren,$cppstr);
# receive DAD message and test the IP address
vRecv($IF0, 3, 0, 0, dadns_nutga);
vSleep(3);
$ret = ping_test($IF0);
if($ret != 0){
dhcpExitFail;
}
vClear($IF0);
vSleep($vlifetime + 5);
#--------------------------------------------------------------#
#7. wait until new valid time timeouts
#--------------------------------------------------------------#
$ret = ping_test($IF0);
if($ret == 0){
dhcpExitFail;
}
dhcpExitPass;
#Specification need to be modified.
###NEEDCHANGE
###############################################################################
__END__
=head1 NAME
C_RFC3315_18_1_8_RecvReplyUpdatedAddr.seq - Test for usage of updated lifetime for orignally-assigned address within recent Reply
=head1 TARGET
Client
=head1 SYNOPSIS
=begin html
C_RFC3315_18_1_8_RecvReplyUpdatedAddr.seq [-tooloption...] -pkt C_RFC3315_18_1_8_RecvReplyUpdatedAddr.def -tooloption : v6eval tool option=end html =head1 INITIALIZATION =begin html
See Also DHCPv6.def
NUT(Client)
|
|
Link0 --+--------+------------------------ 3ffe:501:ffff:101::/64
|
|
TN(Server)
| Device Name | Device Type | Interface | Assigned Prefix | Link Local Addr | MAC Addr |
| Client | NUT | Link0 | 3ffe:501:ffff:101::/64 | NUT's Linklocal address | NUT's MAC address |
| Server | TN | Link0 | 3ffe:501:ffff:101::/64 | fe80::200:ff:fe00:a1a1 | 00:00:00:00:a1:a1 |
=end html =head1 JUDGEMENT =begin html
NUT TN | | | |Initialize NUT(as a DHCPv6 client) | ----> |Solicit (1*) | <---- |Adverstise (2*) | ----> |Request (3*) | <---- |Reply (4*) | |Waiting until DHCPv6 message arrives | ----> |Renew (5*) | <---- |Reply(W/IA_NA option/IAAddress option/new valid-lifetime) (6*) | |Waiting until valid-lifetime expires | <---- |Echo Request (7*) | ----> |Echo Reply (8*) | |
(1*)TN receives Solicit from NUT. (2*)As a DHCPv6 Server, TN sends Advertise to NUT. (3*)TN receives Request from NUT. (4*)As a DHCPv6 Server, TN sends Reply with IA_NA option/T1/T2 to NUT. Record the time to variable Tbegin. (5*)TN receives Renew from NUT. Record the time to variable Trenew. (6*)As a DHCPv6 Server, TN sends Reply to NUT. (7*)TN sends Echo Requst to address. (8*)NUT should not send Echo Reply to TN.
=end html =head1 TERMINATION =begin html
If (8*) are successful , test will PASS. Or else, FAIL.
N/A=end html =head1 REFERENCE =begin html
Also see RFC3315=end html =head1 SEE ALSO =begin html
18.1.8. Receipt of Reply Messages
From line 2602 to line 2603.
=end html
perldoc V6evalTool