#!/usr/bin/perl # # SCTP Conformance Test Suite Implementation # (C) Copyright Fujitsu Ltd. 2008, 2009 # # This file is part of the SCTP Conformance Test Suite implementation. # # The SCTP Conformance Test Suite implementation is free software; # you can redistribute it and/or modify it under the terms of # the GNU General Public License version 2 as published by # the Free Software Foundation. # # The SCTP Conformance Test Suite implementation is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY; without even # the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR # PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU CC; see the file COPYING. If not, write to # the Free Software Foundation, 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # # Please send any bug reports or fixes you make to the # email address(es): # networktest sctp # # Or submit a bug report through the following website: # http://networktest.sourceforge.net/ # # Written or modified by: # Hiroaki Kago # Wei Yongjun # # Any bugs reported given to us we will try to fix... any fixes shared will # be incorporated into the next SCTP release. # ############################################################################## BEGIN { $V6evalTool::TestVersion = '$Name: REL_1_0_1 $'; } use lib "../common"; use V6evalTool; use SCTP; %pktdesc = ( sctp_chunk_asconf_add_addr => "Recv SCTP CHUNK_ASCONF (Add IP Address)", ); $IF0 = Link0; vCapture($IF0); sctpCheckEnv($IF0); $ASSOC_MAX_RETRANS = $SCTP::CONF{"ASSOCIATION_MAX_RETRANS"}; $TIMEOUT = $SCTP::CONF{"RTO_MAX"} + 5; sctpStartInteractiveServer($IF0, "recv", "add=$SCTP::CONF{'SCTP_NUT_NET1_ADDR'}", "recv"); vConnect($IF0); vLogHTML('================ Main Test ================='); %ret = vWarpRecv($IF0, 10, 0, 0, sctp_chunk_asconf_add_addr); if ($ret{status} != 0 || $ret{recvFrame} ne sctp_chunk_asconf_add_addr) { vLogHTML('Cannot receive SCTP CHUNK_ASCONF
'); vSend($IF0, sctp_chunk_abort_snd); vLogHTML('NG'); exit $V6evalTool::exitFail; } $retrans = 0; while($ret{status} == 0) { %ret = vWarpRecv($IF0, $TIMEOUT, 0, 0, sctp_chunk_asconf_add_addr); if($ret{status} == 0 && $ret{recvFrame} eq 'sctp_chunk_asconf_add_addr') { $retrans++; } } if($ASSOC_MAX_RETRANS != $retrans) { vLogHTML("Received SCTP CHUNK_ASCONF $retrans times, but expect $ASSOC_MAX_RETRANS times
"); vSend($IF0, sctp_chunk_abort_snd); vLogHTML('NG'); exit $V6evalTool::exitFail; } vLogHTML('=== Check Whether Association is removed ==='); vSend($IF0, sctp_chunk_data_snd); %ret = vWarpRecv($IF0, 10, 0, 0, sctp_chunk_abort_rcv); if ($ret{status} != 0 || $ret{recvFrame} ne sctp_chunk_abort_rcv) { vLogHTML('Cannot receive SCTP CHUNK_ABORT
'); vSend($IF0, sctp_chunk_abort_snd); vLogHTML('NG'); exit $V6evalTool::exitFail; } vLogHTML(OK); exit $V6evalTool::exitPass; ###################################################################### __END__ =head1 NAME T4RtoTimeout.seq - Failure to receive ASCONF-ACK after retransmit times to 'Association.Max.Retrans' =head1 PURPOSE To check that if ASCONF is retransmitted for 'Association.Max.Retrans' times then the endpoint MUST abort the association and report the error to the SCTP user. =head1 SYNOPSIS =begin html
  ./T4RtoTimeout.seq [-tooloption ...] -pkt ./T4RtoTimeout.def
    -tooloption : v6eval tool option
  See Also: ../common/STD_PKT_COMMON.def
            ../common/SCTP_COMMON.def
=end html =head1 PRE-TEST CONDITION Association is established between endpoint A and B. Arrange the data in Endpoint A such that ASCONF-ACK is not sent in response to ASCONF message. =head1 TEST PROCEDURE Endpoint A Endpoint B ULP (ESTABLISHED) (ESTABLISHED) <----- Asconf <----------------- ASCONF Don't send (Start T4-RTO timer) ASCONF-ACK message | | T4-RTO timer expires | <---------------- ASCONF | | T4-RTO timer expires | <---------------- ASCONF . . Retransmit x . times TEST DESCRIPTION: 1. Attempt to send ASCONF from endpoint B to A. Don't send ASCONF-ACK from A. Let the timer T4-rto expire. ASCONF will be retransmitted. Note the timer. Don't send ASCONF-ACK for the retransmitted ASCONF. T4-rto will be expired again and ASCONF will be retransmitted again. Record the messages using a signal emulator. 2. Check A: If ASCONF message is transmitted for ASSOCIATION.MAX.RETRANS times without getting an ASCONF-ACK, Association is aborted and upper layers are reported of this. =head1 NOTE None =head1 REFERENCE RFC 5061 5.1. ASCONF Chunk Procedures If the T-4 RTO timer expires the endpoint MUST do the following: B1) Increment the error counters and perform path failure detection on the appropriate destination address as defined in [RFC4960], Sections 8.1 and 8.2. =begin html
    B2)  Increment the association error counters and perform endpoint
         failure detection on the association as defined in [RFC4960],
         Sections 8.1 and 8.2.
=end html B3) Backoff the destination address RTO value to which the ASCONF chunk was sent by doubling the RTO timer value. Note: The RTO value is used in the setting of all timer types for SCTP. Each destination address has a single RTO estimate. B4) Re-transmit the ASCONF Chunk last sent and if possible choose an alternate destination address (please refer to [RFC4960], Section 6.4.1). An endpoint MUST NOT add new parameters to this chunk; it MUST be the same (including its Sequence Number) as the last ASCONF sent. An endpoint MAY, however, bundle an additional ASCONF with new ASCONF parameters with the next Sequence Number. For details, see Section 5.5. B5) Restart the T-4 RTO timer. Note that if a different destination is selected, then the RTO used will be that of the new destination address. Note: The total number of retransmissions is limited by B2 above. If the maximum is reached, the association will fail and enter into the CLOSED state (see [RFC4960], Section 6.4.1 for details).