NAME

  CookieEchoExpired.seq - COOKIE-ECHO chunk is received with life time expired


PURPOSE

  To check that if a COOKIE-ECHO chunk is sent with life time expired
  then the endpoind should response it with an ERROR message and error
  cause is set to Stale Cookie Error.


SYNOPSIS

  ./CookieEchoExpired.seq [-tooloption ...] -pkt ./CookieEchoExpired.def
    -tooloption : v6eval tool option
  See Also: ../common/STD_PKT_COMMON.def
            ../common/SCTP_COMMON.def


PRE-TEST CONDITION

  Association is not established between endpoint A and B. Arrange data
  in endpoint A such that COOKIE-ECHO chunk with life time expired is
  sent to endpoint B.


TEST PROCEDURE

  Endpoint A                           Endpoint B                ULP
  (CLOSED)                             (CLOSED)
  INIT          ----------------->
  (with Cookie Preservative Parameter)
                <-----------------      INIT-ACK
  COOKIE-ECHO   ----------------->
  (life time expired)
                <-----------------      ERROR
                                        (Stale Cookie Error)
  TEST DESCRIPTION:
  1. Send COOKIE-ECHO chunk from endpoint A to B with life time
     expired.
  2. Check A: ERROR should be received at endpoint A.
  3. Check B: Error cause in ERROR is set to "Stale Cookie Error".


NOTE

  None


REFERENCE

  RFC 4960
  5.1.5.  State Cookie Authentication
    When an endpoint receives a COOKIE ECHO chunk from another endpoint
    with which it has no association, it shall take the following
    actions:
    1)  Compute a MAC using the TCB data carried in the State Cookie and
        the secret key (note the timestamp in the State Cookie MAY be
        used to determine which secret key to use).  [RFC2104] can be
        used as a guideline for generating the MAC,
    2)  Authenticate the State Cookie as one that it previously generated
        by comparing the computed MAC against the one carried in the
        State Cookie.  If this comparison fails, the SCTP packet,
        including the COOKIE ECHO and any DATA chunks, should be silently
        discarded,
    3)  Compare the port numbers and the Verification Tag contained
        within the COOKIE ECHO chunk to the actual port numbers and the
        Verification Tag within the SCTP common header of the received
        packet.  If these values do not match, the packet MUST be
        silently discarded.
    4)  Compare the creation timestamp in the State Cookie to the current
        local time.  If the elapsed time is longer than the lifespan
        carried in the State Cookie, then the packet, including the
        COOKIE ECHO and any attached DATA chunks, SHOULD be discarded,
        and the endpoint MUST transmit an ERROR chunk with a "Stale
        Cookie" error cause to the peer endpoint.
    5)  If the State Cookie is valid, create an association to the sender
        of the COOKIE ECHO chunk with the information in the TCB data
        carried in the COOKIE ECHO and enter the ESTABLISHED state.
    6)  Send a COOKIE ACK chunk to the peer acknowledging receipt of the
        COOKIE ECHO.  The COOKIE ACK MAY be bundled with an outbound DATA
        chunk or SACK chunk; however, the COOKIE ACK MUST be the first
        chunk in the SCTP packet.
    7)  Immediately acknowledge any DATA chunk bundled with the COOKIE
        ECHO with a SACK (subsequent DATA chunk acknowledgement should
        follow the rules defined in Section 6.2).  As mentioned in step
        6, if the SACK is bundled with the COOKIE ACK, the COOKIE ACK
        MUST appear first in the SCTP packet.
    If a COOKIE ECHO is received from an endpoint with which the receiver
    of the COOKIE ECHO has an existing association, the procedures in
    Section 5.2 should be followed.