Commit a7292571 authored by Yann Garcia's avatar Yann Garcia
Browse files

Enhance templates; Issues with encvalue &...

Enhance templates; Issues with encvalue & fx_enc_PDUSessionResourceSetupRequestTransfer, UPER instead of APER
parent f541acbe
Loading
Loading
Loading
Loading
+10 −4
Changes for ttcn/AtsNGAP/NGAP_TCFunctions.ttcn: 10 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -71,13 +71,19 @@ module NGAP_TCFunctions {
                    // A real UE only gets a PDU session it asked for: wait for its PDU SESSION ESTABLISHMENT
                    // REQUEST (triggered by the data call requested from the upper tester in the preamble),
                    // then send the PDU SESSION RESOURCE SETUP REQUEST carrying the acceptance for the UE.
                    // The UE registered without "follow-on request pending", so it holds that request back
                    // until the network has released the N1 NAS signalling connection, and then sends it
                    // through the service request procedure: release the UE context and serve that first
                    // A UE that registered without "follow-on request pending" (TS 24.501 clause 9.11.3.7) holds that
                    // request back until the network has released the N1 NAS signalling connection, and then sends
                    // it through the service request procedure: release the UE context and serve that first. With
                    // the bit set, the UE sends it on the current connection, which is kept
                    var O1_Type v_psi;
                    var O1_Type v_pti;

                    if (isbound(vc_registration_request) and (vc_registration_request.registrationType.fOR == '1'B)) {
                        log("*** " & __SCOPE__ & ": INFO: follow-on request pending, the UE context is kept ***");
                    } else {
                        log("*** " & __SCOPE__ & ": INFO: no follow-on request pending, the PDU SESSION ESTABLISHMENT REQUEST comes with a SERVICE REQUEST ***");
                        f_send_ue_context_release_command_await_service_request_send_service_accept();
                    }
                    f_NGAP_gnb_UE_PDU_SessionEstablishmentRequest();
                    if (not f_get_pdu_session_establishment_request_ids(v_psi, v_pti)) {
                        log("*** " & __SCOPE__ & ": INCONC: No PDU SESSION ESTABLISHMENT REQUEST received from the UE. ***");
@@ -113,7 +119,7 @@ module NGAP_TCFunctions {
                                                             ))));
                    log("v_pdu_session_resource_setup_request_transfer: ", v_pdu_session_resource_setup_request_transfer);
                    var octetstring v_os := bit2oct(
                                                    fx_enc_PDUSessionResourceSetupRequestTransfer( // FIXME FSCOM Check why encvalue does not work
                                                    fx_enc_PDUSessionResourceSetupRequestTransfer( // FIXME FSCOM TITAN issue with encvalue() giving unaligned PER, fx_enc_PDUSessionResourceSetupRequestTransfer gives aligned PER
                                                                                                  v_pdu_session_resource_setup_request_transfer
                                                    ));
                    log("v_os: ", v_os);
+31 −29
Changes for ttcn/LibNGAP/lib_system/LibNGAP_Functions.ttcn: 31 added lines, 29 removed lines.
Original line number Diff line number Diff line
@@ -580,10 +580,9 @@ module LibNGAP_Functions {
     * @brief  Await the AUTHENTICATION REQUEST, then the AUTHENTICATION REJECT.
     * @details The AUTHENTICATION REQUEST is checked with f_Check_5GAKA_NAS_DL_Message (RAND and AUTN
     *          present); vc_ngKSI, vc_AMF_UE_ID and vc_RAN_UE_ID are taken from it.
     *          The reject is awaited in an UPLINK NAS TRANSPORT and checked with
     *          f_Check_5GAKA_NAS_UL_Message against mw_NG_AUTHENTICATION_REJECT.
     * @note   AUTHENTICATION REJECT is a downlink message: awaiting it in an UPLINK NAS TRANSPORT looks
     *         wrong.
     *          The AUTHENTICATION REJECT, a downlink message (TS 24.501 clause 8.2.5), is awaited in a
     *          DOWNLINK NAS TRANSPORT and checked with f_Check_5GAKA_NAS_DL_Message against
     *          mw_NG_AUTHENTICATION_REJECT.
     */
    function f_await_authentication_request_await_authentication_reject() runs on NGNASComponent {
        log(">>> f_await_authentication_request_await_authentication_reject");
@@ -629,27 +628,29 @@ module LibNGAP_Functions {
        log("vc_RAN_UE_ID: ", vc_RAN_UE_ID);
        setverdict(pass, "Received AUTHENTICATION_REQUEST NAS message");

        // Await response for AUTHENTICATION_REJECT
        // Await the AUTHENTICATION_REJECT, sent by the AMF in a DOWNLINK NAS TRANSPORT
        f_recv_NGAP_PDU(
                        mw_ngap_initMsg(
                                        mw_n2_UplinkNASTransport(
                                        mw_n2_DownlinkNASTransport(
                                                                   vc_AMF_UE_ID,
                                                                 vc_RAN_UE_ID
                                                                   vc_RAN_UE_ID,
                                                                   ?
                        )));
        f_NASPDU_Get(vc_recvNGAP_PDU);
        if (f_Check_5GAKA_NAS_UL_Message(
        if (f_Check_5GAKA_NAS_DL_Message(
                                         vc_recvNAS_PDU,
                                         mw_NG_AUTHENTICATION_REJECT,
                                         vc_ng_nas_security_params_type,
                                         vc_previous_nas_count_ul,
                                         vc_previous_nas_count_dl,
                                         v_message,
                                         vc_inner_message
                                         ) == false) {
            log("*** " & __SCOPE__ & ": FAIL: Unexpected NG_AUTHENTICATION_REJECT");
            log("*** " & __SCOPE__ & ": FAIL: Unexpected NG_AUTHENTICATION_REJECT: ", v_message);
            setverdict(fail, "*** " & __SCOPE__ & ": FAIL: Unexpected NG_AUTHENTICATION_REJECT");
            return;
        }
        setverdict(pass, "Received AUTHENTICATION_REJECT NAS message");
    }


        setverdict(pass, "Received AUTHENTICATION_RESPONSE NAS message");    }

    /**
     * @brief  Offline mode: await the AUTHENTICATION REQUEST and the AUTHENTICATION RESPONSE.
@@ -2370,9 +2371,7 @@ module LibNGAP_Functions {
     *          maximum bit rate, which was not sent in the INITIAL CONTEXT SETUP REQUEST, and the slice
     *          PX_SST/PX_SD. Its transfer carries the PDU session aggregate maximum bit rate (required for
     *          a non-GBR QoS flow), the UL tunnel PX_TRANSPORT_LAYER_ADDRESS/PX_GTP_TEID, the session
     *          type IPv4 and the QoS flow (5QI 9), in the order of the specification
     *          (f_order_pdu_session_resource_setup_request_transfer_ies), encoded in aligned PER with
     *          fx_enc_PDUSessionResourceSetupRequestTransfer (encvalue() gives unaligned PER).
     *          type IPv4 and the QoS flow (5QI 9), in the order of the specification.
     * @param  p_psi The PDU session identity chosen by the UE.
     * @param  p_pti The procedure transaction identity chosen by the UE.
     */
@@ -2425,7 +2424,7 @@ module LibNGAP_Functions {
                                   ))))
        };
        log("f_send_pdu_session_resource_setup_request_with_accept: v_transfer: ", v_transfer);
        var octetstring v_os := bit2oct(fx_enc_PDUSessionResourceSetupRequestTransfer(v_transfer));
        var octetstring v_os := bit2oct(fx_enc_PDUSessionResourceSetupRequestTransfer(v_transfer)); // FIXME FSCOM TITAN issue with encvalue() giving unaligned PER, fx_enc_PDUSessionResourceSetupRequestTransfer gives aligned PER
        log("f_send_pdu_session_resource_setup_request_with_accept: v_os: ", v_os);

        // 3. PDU SESSION RESOURCE SETUP REQUEST
@@ -2508,8 +2507,7 @@ module LibNGAP_Functions {
     * @brief  Send a PDU SESSION RESOURCE SETUP REQUEST without NAS PDU (test system = AMF).
     * @details PDU session PX_PDU_SESSION_ID, slice SST 0/SD 0, IPv4, one QoS flow
     *          PX_QOS_FLOW_IDENTIFIER with a dynamic 5QI, UL tunnel m_gTPTunnel.
     * @note   The transfer is encoded with encvalue(), i.e. in unaligned PER, which a real gNB cannot
     *         decode; see f_send_pdu_session_resource_setup_request_with_accept.
     * @see    f_send_pdu_session_resource_setup_request_with_accept
     */
    function f_send_pdu_session_resource_setup_request() runs on NGNASComponent {
        log(">>> f_send_pdu_session_resource_setup_request");
@@ -2526,7 +2524,7 @@ module LibNGAP_Functions {
                             -,
                             m_s_NSSAI('00'O, '000000'O),
                             bit2oct(
                               encvalue(
                               fx_enc_PDUSessionResourceSetupRequestTransfer(valueof( // FIXME FSCOM TITAN issue with encvalue() giving unaligned PER, fx_enc_PDUSessionResourceSetupRequestTransfer gives aligned PER
                                 m_pDUSessionResourceSetupRequestTransfer(
                                   m_pDUSessionResourceSetupRequestTransfer_mandatories(
                                     m_pDUSessionType(ipv4),
@@ -2550,7 +2548,7 @@ module LibNGAP_Functions {
                                     },
                                     m_uPTransportLayerInformation_gTPTunnel(
                                       m_gTPTunnel
                           ))))))
                           )))))))
                         }
                   )));
    }
@@ -3281,19 +3279,21 @@ module LibNGAP_Functions {

    /**
     * @brief  Offline mode: await the DEREGISTRATION REQUEST, then the DEREGISTRATION ACCEPT.
     * @note   The accept is awaited in an UPLINK NAS TRANSPORT although it is a downlink message.
     * @details The DEREGISTRATION ACCEPT (UE originating de-registration, TS 24.501 clause 8.2.13) is sent by
     *          the AMF: it is awaited in a DOWNLINK NAS TRANSPORT.
     */
    function f_await_deregistration_request_await_deregistration_accept() runs on NGNASComponent {
        log(">>> f_await_deregistration_request_await_deregistration_accept");

        // Await request for DEREGISTRATION_REQUEST
        f_await_deregistration_request();
        // Await request for DEREGISTRATION_ACCEPT
        // Await the DEREGISTRATION_ACCEPT, sent by the AMF in a DOWNLINK NAS TRANSPORT
        f_recv_NGAP_PDU(
                        mw_ngap_initMsg(
                                        mw_n2_UplinkNASTransport(
                                        mw_n2_DownlinkNASTransport(
                                                                   vc_AMF_UE_ID,
                                                                 vc_RAN_UE_ID
                                                                   vc_RAN_UE_ID,
                                                                   ?
                        )));
        f_NASPDU_Get(vc_recvNGAP_PDU);
        var NG_NAS_DL_Message_Type v_message;
@@ -3316,19 +3316,21 @@ module LibNGAP_Functions {

    /**
     * @brief  Send a DEREGISTRATION REQUEST and await the DEREGISTRATION ACCEPT (test system = UE).
     * @note   The accept is awaited in an UPLINK NAS TRANSPORT although it is a downlink message.
     * @details The DEREGISTRATION ACCEPT (UE originating de-registration, TS 24.501 clause 8.2.13) is sent by
     *          the AMF: it is awaited in a DOWNLINK NAS TRANSPORT.
     */
    function f_send_deregistration_request_await_deregistration_accept() runs on NGNASComponent {
        log(">>> f_send_deregistration_request_await_deregistration_accept");

        // Send request for DEREGISTRATION_REQUEST
        f_send_deregistration_request();
        // Await request for DEREGISTRATION_ACCEPT
        // Await the DEREGISTRATION_ACCEPT, sent by the AMF in a DOWNLINK NAS TRANSPORT
        f_recv_NGAP_PDU(
                        mw_ngap_initMsg(
                                        mw_n2_UplinkNASTransport(
                                        mw_n2_DownlinkNASTransport(
                                                                   vc_AMF_UE_ID,
                                                                 vc_RAN_UE_ID
                                                                   vc_RAN_UE_ID,
                                                                   ?
                        )));
        f_NASPDU_Get(vc_recvNGAP_PDU);
        var NG_NAS_DL_Message_Type v_message;
+12 −3
Changes for ttcn/Lib_NG_NAS/lib/Lib_NG_NAS_Templates.ttcn: 12 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -645,10 +645,19 @@ module Lib_NG_NAS_Templates {
    }
  } // End of template m_NG_DEREGISTRATION_ACCEPT_MO

  template (present) NG_NAS_UL_Message_Type mw_NG_DEREGISTRATION_ACCEPT_MO modifies cr_NG_DEREGISTRATION_ACCEPT :=
  { /* @status    APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */
    /* 24.501 cl. 8.2.13/15 (UL) */
  /**
   * @desc DEREGISTRATION ACCEPT (UE originating de-registration), as sent by the network to the UE (24.501 cl. 8.2.13):
   *       a downlink message. Formerly declared as an uplink template modifying cr_NG_DEREGISTRATION_ACCEPT, i.e. with
   *       the message type of the DEREGISTRATION ACCEPT (UE terminated de-registration) sent by the UE (cl. 8.2.15),
   *       although every user checks it with f_Check_5GAKA_NAS_DL_Message.
   */
  template (present) NG_NAS_DL_Message_Type mw_NG_DEREGISTRATION_ACCEPT_MO :=
  {
    deregistration_Accept := {
      protocolDiscriminator   := tsc_EPD_GMM,                     /* cl. 9.2       M V 1   */
      spareHalfOctet          := ?,                               /* cl. 9.3       M V 1/2 */
      securityHeaderType      := tsc_SHT_NoSecurityProtection,    /* Plain NAS message, once its security protection is removed */
      messageType             := tsc_MT_NG_DeregistrationAccept_MO /* cl. 9.7       M V 1   */
    }
  } // End of template mw_NG_DEREGISTRATION_ACCEPT_MO