#!/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); sctpStartClient($IF0); vListen($IF0); vLogHTML('================ Main Test ================='); %ret = vWarpRecv($IF0, 10, 0, 0, sctp_chunk_cookie_echo_rcv); if($ret{status} != 0 || $ret{recvFrame} ne sctp_chunk_cookie_echo_rcv) { vLogHTML('Cannot receive SCTP CHUNK_COOKIE_ECHO
'); vLogHTML('NG'); exit $V6evalTool::exitFail; } vSend($IF0, sctp_chunk_init_snd); %ret = vWarpRecv($IF0, 10, 0, 0, sctp_chunk_init_ack_rcv); if($ret{status} != 0 || $ret{recvFrame} ne sctp_chunk_init_ack_rcv) { vLogHTML('Cannot receive SCTP CHUNK_INIT_ACK
'); vLogHTML('NG'); exit $V6evalTool::exitFail; } %ret = vWarpRecv($IF0, 10, 0, 0, sctp_chunk_cookie_echo_rcv); if($ret{status} != 0 || $ret{recvFrame} ne sctp_chunk_cookie_echo_rcv) { vLogHTML('Cannot receive SCTP CHUNK_COOKIE_ECHO
'); vLogHTML('NG'); exit $V6evalTool::exitFail; } vSend($IF0, sctp_chunk_cookie_ack_snd); vRecvMsg($IF0); vShutdown($IF0); vLogHTML(OK); exit $V6evalTool::exitPass; ###################################################################### __END__ =head1 NAME DupInitInCookieEchoed2.seq - Duplicate INIT chunk is received in COOKIE-ECHOED state (MUST NOT change state) =head1 PURPOSE To check that if INIT chunk is received in COOKIE-ECHOED state then the endpoint should respond with an INIT-ACK using the same parameters it sent in its original INIT chunk. After that, the endpoint MUST NOT change its state, the T1-cookie timer shall be left running. =head1 SYNOPSIS =begin html
  ./DupInitInCookieEchoed2.seq [-tooloption ...] -pkt ./DupInitInCookieEchoed2.def
    -tooloption : v6eval tool option
  See Also: ../common/STD_PKT_COMMON.def
            ../common/SCTP_COMMON.def
=end html =head1 PRE-TEST CONDITION Association not established between endpoint A and B. Also arrange the data in endpoint B such that upper layers send Associate primitive to startup an association with endpoint A. =head1 TEST PROCEDURE Endpoint A Endpoint B ULP (CLOSED) (CLOSED) <----- Associate <----------------- INIT INIT-ACK -----------------> <----------------- COOKIE-ECHO INIT -----------------> <----------------- INIT-ACK COOKIE-ACK -----------------> <----- Send <----------------- DATA SACK -----------------> TEST DESCRIPTION: 1. Start normal association procedure by sending associate primitive from ULP in endpoint B and from ULP in endpoint A at the same time. Record the message sequence using a signal emulator. 2. Check A: After send INIT ACK, the endpoint B MUST NOT change its state. 3. Check B: Association is established. =head1 NOTE None =head1 REFERENCE RFC 4960 5.2.1. INIT Received in COOKIE-WAIT or COOKIE-ECHOED State (Item B) This usually indicates an initialization collision, i.e., each endpoint is attempting, at about the same time, to establish an association with the other endpoint. Upon receipt of an INIT in the COOKIE-WAIT state, an endpoint MUST respond with an INIT ACK using the same parameters it sent in its original INIT chunk (including its Initiate Tag, unchanged). When responding, the endpoint MUST send the INIT ACK back to the same address that the original INIT (sent by this endpoint) was sent. Upon receipt of an INIT in the COOKIE-ECHOED state, an endpoint MUST respond with an INIT ACK using the same parameters it sent in its original INIT chunk (including its Initiate Tag, unchanged), provided that no NEW address has been added to the forming association. If the INIT message indicates that a new address has been added to the association, then the entire INIT MUST be discarded, and NO changes should be made to the existing association. An ABORT SHOULD be sent in response that MAY include the error 'Restart of an association with new addresses'. The error SHOULD list the addresses that were added to the restarting association. When responding in either state (COOKIE-WAIT or COOKIE-ECHOED) with an INIT ACK, the original parameters are combined with those from the newly received INIT chunk. The endpoint shall also generate a State Cookie with the INIT ACK. The endpoint uses the parameters sent in its INIT to calculate the State Cookie. =begin html
    After that, the endpoint MUST NOT change its state, the T1-init timer
    shall be left running, and the corresponding TCB MUST NOT be
    destroyed.  The normal procedures for handling State Cookies when a
    TCB exists will resolve the duplicate INITs to a single association.
=end html For an endpoint that is in the COOKIE-ECHOED state, it MUST populate its Tie-Tags within both the association TCB and inside the State Cookie (see Section 5.2.2 for a description of the Tie-Tags).