Receiving Reply Messages and validation test
');
#-------------------------------------------------------------------
#--------------------------------------------------------------#
# Initialize DHCPv6 Client
#--------------------------------------------------------------#
my $ret = vRemote("dhcp6c.rmt", "start", "authentication=delayed", "auth_realm=$auth_realm", "auth_keyid=$auth_key_id", "auth_sharedsecretkey=$enc_auth_sharedsecretkey", "link0=$IF0_NUT");
if($ret != 0){
vLogHTML('Cannot Initialize DHCPv6 Client program.
');
dhcpExitFail;
};
vCapture($IF0);
my $cpp = undef;
#--------------------------------------------------------------#
#1. Wait until Solicit arrives
#--------------------------------------------------------------#
# This is requried when Authentication option is used, otherwise not required.
$AUTH_OPTION_REQUIRED = $TRUE;
my ($retsol,%sol) = wait_for_solicit($IF0,30) ;
if($retsol != 0){
dhcpExitFail("Can't receive correct DHCPv6 Solicit message");
}
vClear($IF0);
# check options in Solicit Message
if (0 != options_exist(\%sol, ($CMP_CID|$CMP_AUTH))){
dhcpExitError("Do not include necessary options!");
}
if ($sol{'Recv_ReplayDetection'} ne '0000000000000000') {
dhcpExitError("Must include 0 in Replay Detection field");
}
#--------------------------------------------------------------#
# 2. send Advertise message
#--------------------------------------------------------------#
# Increment replay detection field (64bit)
my $auth_counter = undef;
$auth_counter = '0000000000000001';
#$CID_OPTION = "opt_CID_LLT_nut";
$SID_OPTION = "opt_SID_LLT_server1";
$IA_NA_OPTION = "opt_IA_NA_Addr_woStatus";
$Authentication_OPTION = "opt_Auth";
$cpp = "-DAUTH_COUNTER=hexstr\\\(\\\"$auth_counter\\\",8\\\) ";
$cpp .= "-DAUTH_REALM=hexstr\\\(\\\"$hex_auth_realm\\\"\\\) ";
$cpp .= "-DAUTH_KEY_ID=$auth_key_id ";
$cpp .= "-DAUTH_KEY_VALUE=\\\"$auth_sharedsecretkey\\\" ";
my ($retadv, %adv) = send_advertise($IF0, "advertise_server1_to_nut", \%sol, $cpp);
if($retadv != 0){
dhcpExitFail;
}
#--------------------------------------------------------------#
#3. Wait until Request arrives
#--------------------------------------------------------------#
my ($retreq,%req) = wait_for_request($IF0,30);
if($retreq != 0){
dhcpExitFail("Can't receive correct DHCPv6 Request message");
}
vClear($IF0);
# check options in Request Message
#if (0 != options_exist(\%req, ($CMP_IA_NA|$CMP_CID|$CMP_SID|$CMP_AUTH))){
if (0 != options_exist(\%req, ($CMP_CID|$CMP_SID|$CMP_AUTH))){
dhcpExitError("Do not include necessary options!");
}
if (0 != compare_options(\%adv, \%req, ( $CMP_SID|$CMP_CID))){
dhcpExitError("The server ID option in Request Msg is error!");
}
#--------------------------------------------------------------#
#4. send Invalid Reply message
#--------------------------------------------------------------#
my $invalid_auth_key_id = "2";
$auth_counter = '0000000000000002';
$StatusCode_OPTION = "opt_StatusCode";
$Authentication_OPTION = "opt_Auth";
$cpp = "-DAUTH_COUNTER=hexstr\\\(\\\"$auth_counter\\\",8\\\) ";
$cpp .= "-DAUTH_REALM=hexstr\\\(\\\"$hex_auth_realm\\\"\\\) ";
$cpp .= "-DAUTH_KEY_ID=$invalid_auth_key_id ";
$cpp .= "-DAUTH_KEY_VALUE=\\\"$auth_sharedsecretkey\\\" ";
my ($retrep, %rep) = send_reply($IF0, "reply_server1_to_nut", \%req, $cpp);
if($retrep !=0){
dhcpExitFail;
}
#--------------------------------------------------------------#
#5. Wait until Solicit arrives
#--------------------------------------------------------------#
my ($retsol,%sol) = wait_for_solicit($IF0,30) ;
if($retsol != 0){
dhcpExitFail("Can't receive correct DHCPv6 Solicit message");
}
vClear($IF0);
# check options in Solicit Message
if (0 != options_exist(\%sol, ($CMP_CID|$CMP_AUTH))){
dhcpExitError("Do not include necessary options!");
}
if ($sol{'Recv_ReplayDetection'} ne '0000000000000000') {
dhcpExitError("Must include 0 in Replay Detection field");
}
#-------------------------------------------------------------------
vLogHTML('Receiving Reply Messages and validation test is correct
');
#-------------------------------------------------------------------
dhcpExitPass;
###############################################################################
__END__
=head1 NAME
C_RFC3315_21.4.4.5_RecvReplyInvalid.seq - Receiving Reply Messages and validation test is failed
=head1 TARGET
Client
=head1 SYNOPSIS
=begin html
C_RFC3315_21.4.4.5_RecvReplyInvalid.seq [-tooloption...]
-pkt C_RFC3315_21.4.4.5_RecvReplyInvalid.def
-tooloption : v6eval tool option
See Also DHCPv6.def
=end html
=head1 INITIALIZATION
=begin html
NUT(Client)
|
|
Link0 --+--------+------------------------ 3ffe:501:ffff:100::/64
|
|
TN(Server)
If the client authenticated the Advertise it accepted, the client
MUST validate the associated Reply message from the server. The
client MUST discard the Reply if the message fails to pass the
validation test and MAY log the validation failure. If the Reply
fails to pass the validation test, the client MUST restart the DHCP
configuration process by sending a Solicit message.
- Configurations
Enable Delayed Authenticaion Protocol Service
Authenticaion parameter
- DHCP realm: DHCPv6.TEST.EXAMPLE.COM
- Client DUID: ANY
- Key id: 1
- Shared secret key: TAHITEST_VALID12
| Device Name |
Device Type |
Interface |
Address |
Link Local Addr |
MAC Addr |
| Client |
NUT |
Link0 |
|
NUT's Linklocal address |
NUT's MAC address |
| Server |
TN |
Link0 |
3ffe:501:ffff:100:200:ff:fe00:a1a1 |
fe80::200:ff:fe00:a1a1 |
00:00:00:00:a1:a1 |
=end html
=head1 TEST PROCEDURE
=begin html
NUT TN
| |
| |Initialize NUT (as a DHCPv6 client)
| |
| ----> |Solicit w/ Authentication Option
| <---- |Advertise w/ Authentication Option
| ----> |Request w/ Authentication Option
| <---- |Reply w/ invalid Authentication Option (Key id =2)
| |
| ----> |Solicit w/ Authentication Option (5*)
| |
| |
=end html
=head1 JUDGEMENT
=begin html
(5*)PASS: TN receives Solicit w/ Authentication Option from NUT.
=end html
=head1 TERMINATION
=begin html
N/A
=end html
=head1 REFERENCE
=begin html
see also RFC3315
21.4.4 Client Considerations for Delayed Authentication protocol
21.4.4.5. Receiving Reply Messages
22.11 Authentication Option
=end html
=head1 SEE ALSO
=begin html
perldoc V6evalTool
=end html