#!/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_0 $'; } use lib "../common"; use V6evalTool; use SCTP; %pktdesc = (); $IF0 = Link0; vCapture($IF0); sctpCheckEnv($IF0); $RTO = $SCTP::CONF{"RTO_INITIAL"}; $RTO_MAX = $SCTP::CONF{"RTO_MAX"}; $ASSOC_MAX_RETRANS = $SCTP::CONF{"ASSOCIATION_MAX_RETRANS"}; sctpStartClient($IF0); vListen($IF0); vAccept($IF0); vRecvMsg($IF0); vLogHTML('================ Main Test ================='); %ret = vWarpRecv($IF0, 10, 0, 0, sctp_chunk_shutdown_rcv); if($ret{status} != 0 || $ret{recvFrame} ne 'sctp_chunk_shutdown_rcv') { vLogHTML('Cannot receive SCTP CHUNK_SHUTDOWN
'); vLogHTML('NG'); exit $V6evalTool::exitFail; } $stime = $ret{"recvTime".$ret{"recvCount"}}; $count = 0; $RTO = 0; while ($count < $ASSOC_MAX_RETRANS) { # SHUTDOWN message is transmitted again if T2-shutdown timer expires %ret = vWarpRecv($IF0, ($RTO == 0) ? 10 : (int($RTO) + 5), 0, 0, sctp_chunk_shutdown_rcv); if($ret{status} != 0 || $ret{recvFrame} ne 'sctp_chunk_shutdown_rcv') { vLogHTML('Cannot receive SCTP CHUNK_SHUTDOWN
'); vLogHTML('NG'); exit $V6evalTool::exitFail; } $etime = $ret{"recvTime".$ret{"recvCount"}}; $gap = $etime - $stime; if ($RTO != 0 && !sctpTimeFuzzyEqual($gap, $RTO, $SCTP::CONF{"TIME_PREC"})) { # We got a bad time vSend($IF0, sctp_chunk_abort_snd); vLogHTML("ERROR: The retransmit T2-shutdown timer received:$gap, but expected: $RTO
"); vLogHTML('NG'); exit $V6evalTool::exitFail; } elsif ($RTO == 0) { vLogHTML("OK: The retransmit T2-shutdown timer RTO is:$gap
"); } else { vLogHTML("OK: The retransmit T2-shutdown timer received:$gap, expected: $RTO
"); } last if ($RTO == $RTO_MAX); $stime = $etime; $RTO = $gap * 2; # back off the timer $RTO = $RTO_MAX if ($RTO > $RTO_MAX); $count++; } vSend($IF0, sctp_chunk_abort_snd) if ($count < $ASSOC_MAX_RETRANS); vLogHTML(OK); exit $V6evalTool::exitPass; ###################################################################### __END__ =head1 NAME T2ShutdownExpires1.seq - RTO is updated correctly if T2-shutdown timer expires for a SHUTDOWN message =head1 PURPOSE To check that if T2-Shutdown expires on a destination address then value of RTO is updated correctly for that address. =head1 SYNOPSIS =begin html
  ./T2ShutdownExpires1.seq [-tooloption ...] -pkt ./T2ShutdownExpires1.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 no SHUTDOWN-ACK is sent in response to SHUTDOWN. =head1 TEST PROCEDURE Endpoint A Endpoint B ULP (ESTABLISHED) (ESTABLISHED) <----- Terminate <---------------- SHUTDOWN | | T2-Shutdown | Timer expired | <---------------- SHUTDOWN | | T2-Shutdown | Timer expired | <---------------- SHUTDOWN . . Retransmit x . times TEST DESCRIPTION: 1. Try to terminate an association between endpoint A and endpoint B by sending SHUTDOWN message from endpoint A. SHUTDOWN will be sent from the endpoint A. Don't send SHUTDOWN COMPLETE message from endpoint A. 2. Check A: After expiry of T2-Shutdown timer, SHUTDOWN message is received again at endpoint A. 3. Check B: Value of the T2-Shutdown is updated correctly. =head1 NOTE None =head1 REFERENCE RFC 4960 6.3.3. Handle T3-rtx Expiration Whenever the retransmission timer T3-rtx expires for a destination address, do the following: E1) For the destination address for which the timer expires, adjust its ssthresh with rules defined in Section 7.2.3 and set the cwnd <- MTU. =begin html
    E2)  For the destination address for which the timer expires, set RTO
         <- RTO * 2 ("back off the timer").  The maximum value discussed
         in rule C7 above (RTO.max) may be used to provide an upper bound
         to this doubling operation.
=end html E3) Determine how many of the earliest (i.e., lowest TSN) outstanding DATA chunks for the address for which the T3-rtx has expired will fit into a single packet, subject to the MTU constraint for the path corresponding to the destination transport address to which the retransmission is being sent (this may be different from the address for which the timer expires; see Section 6.4). Call this value K. Bundle and retransmit those K DATA chunks in a single packet to the destination endpoint. E4) Start the retransmission timer T3-rtx on the destination address to which the retransmission is sent, if rule R1 above indicates to do so. The RTO to be used for starting T3-rtx should be the one for the destination address to which the retransmission is sent, which, when the receiver is multi-homed, may be different from the destination address for which the timer expired (see Section 6.4 below).