Commit 52f7ca8b authored by Yann Garcia's avatar Yann Garcia
Browse files

Create a temporary TC_NGAP_GNB_PDU_00 and review TC_NGAP_GNB_PDU_01

parent 45c19e09
Loading
Loading
Loading
Loading
+6 −6
Changes for etc/AtsNGAP/AtsNGAP_AMF_p_net.cfg_: 6 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -20,9 +20,9 @@ LibNGAP_Pics.PICS_OFFLINE_MODE := false # true for offline mode with pcap files,
LibNGAP_Pics.PICS_USE_OPEN5GS  := false # true to start open5gs, false to not start them

LibNGAP_Pixits.PX_NAS_MCC          := '999'H
LibNGAP_Pixits.PX_NAS_MNC          := '39'H
LibNGAP_Pixits.PX_NAS_MNC          := '38'H # Lab PLMN 999/38 (since 2026-10-16)
LibNGAP_Pixits.PX_UT_PLMN_MCC      := '999'H;
LibNGAP_Pixits.PX_UT_PLMN_MNC      := '39'H;
LibNGAP_Pixits.PX_UT_PLMN_MNC      := '38'H;

LibNGAP_Pixits.PX_RAN_NODE_NAME    := "gnb0012345"
LibNGAP_Pixits.PX_GNB_ID           := '00000000000000000000000000000001'B
@@ -46,19 +46,19 @@ Lib_NG_NAS_Pixits.PX_CHECK_SECURITY := false
Lib_NG_NAS_Pixits.PX_SUPI_FORMAT                     := '0000'B # IMSI format
Lib_NG_NAS_Pixits.PX_TYPE_OF_ID                      := '001'B # SUCI type
Lib_NG_NAS_Pixits.PX_SUPI_DIGITS                     := '00f110214300014444330302'O
Lib_NG_NAS_Pixits.PX_MSIN                            := '0000000010'O;
Lib_NG_NAS_Pixits.PX_MSIN                            := '0000307412'O # MSIN 0000034721 (BCD, swapped nibbles)
Lib_NG_NAS_Pixits.PX_NETWORK_NAME                    := "Open5GS"

# OP
Lib_NG_NAS_Pixits.PX_OPERATOR_KEY                    := '00000000000000000000000000000000'O
# OPc
Lib_NG_NAS_Pixits.PX_OPERATOR_SECRET_KEY             := 'E8ED289DEBA952E4283B54E88E6183CA'O
Lib_NG_NAS_Pixits.PX_OPERATOR_SECRET_KEY             := 'CFF10199EE49179F7D6F5EFEEDDA8727'O
Lib_NG_NAS_Pixits.PX_FORCE_USING_OPERATOR_SECRET_KEY := true

Lib_NG_NAS_Pixits.PX_SUBSCRIPTION_KEY                := '01000110010110110101110011101000101100011001100110110100100111111010101001011111000010100010111011100010001110001010011010111100'B
Lib_NG_NAS_Pixits.PX_SUBSCRIPTION_KEY                := '11111111011100011100101001011001000010011000000100111010101111101111110010111110101011011001101100001011111010010111001001101100'B # FF71CA5909813ABEFCBEAD9B0BE9726C
Lib_NG_NAS_Pixits.PX_BEARER_ID                       := '00001'B

Parameters.px_IMSI_Def                               := '393939373030303030303030303031'H # 999700000000001
Parameters.px_IMSI_Def                               := '393939333830303030303334373231'H # 999380000034721
Parameters.px_IMEISV_Def                             := '7380612185615101'H
NAS_5GC_Parameters.px_NAS_5GC_XRES_Length            := 8 # In ETSI TS 135 206 V16.0.0 (2020-08) Table Table 5. f2 output, RES length is 8 octets (64 bits)

+7 −7
Changes for etc/AtsNGAP/AtsNGAP_GNB.cfg_: 7 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -14,8 +14,8 @@ LibNGAP_Pixits.PX_TIMER_T3560 := 500
NGAP_Pics.PICS_NGAP_AMF_IUT    := false
NGAP_Pics.PICS_NGAP_GNB_IUT    := true

# Offline replay of a passing run of TC_NGAP_GNB_PDU_01 with the real gNB and UE (TODO.md item 20): both directions of N2
# and N3 are read from captures/TC_NGAP_GNB_PDU_01.offline.pcap (system.NGAP_gNB_1, system.N3_gNB_1); the upper tester is
# Offline replay of a passing run of TC_NGAP_GNB_PDU_00 with the real gNB and UE (TODO.md item 20): both directions of N2
# and N3 are read from captures/TC_NGAP_GNB_PDU_00.offline.pcap (system.NGAP_gNB_1, system.N3_gNB_1); the upper tester is
# not used. The other parameters are those of the run (AtsNGAP_GNB_p_net.cfg_), which the replayed messages depend on
# (NAS keys, PLMN, addresses, TEIDs)
LibNGAP_Pics.PICS_OFFLINE_MODE      := true # true for offline mode with pcap files, false for online mode with SCTP server
@@ -49,7 +49,7 @@ LibNGAP_Pixits.PX_AMF_UE_NGAP_ID := 1

LibNGAP_Pixits.PX_TIME_ZONE        := '80'O # 0x40 for GMT+1, 0x80 for GMT+2

# User plane probe (TC_NGAP_GNB_PDU_01): the UPF tunnel endpoint given to the gNB is this host on N3, and the UE pings it
# User plane probe (TC_NGAP_GNB_PDU_00): the UPF tunnel endpoint given to the gNB is this host on N3, and the UE pings it
LibNGAP_Pixits.PX_TRANSPORT_LAYER_ADDRESS := '00001010101011100001001100001110'B # 10.174.19.14
LibNGAP_Pixits.PX_UT_PING_HOST := "10.174.19.14"
LibNGAP_Pics.PICS_USE_GTPU := true # The test system plays the UPF on N3 and checks the uplink G-PDUs (system.N3_gNB_1)
@@ -102,10 +102,10 @@ LogEventTypes:= Yes
# In this section you can specify parameters that are passed to Test Ports.

# Act as AMF, listen for incoming connections from gNB
# Offline replay (PICS_OFFLINE_MODE): N2 (SCTP) and N3 (GTP-U, UDP port 2152) of captures/TC_NGAP_GNB_PDU_01.offline.pcap,
# Offline replay (PICS_OFFLINE_MODE): N2 (SCTP) and N3 (GTP-U, UDP port 2152) of captures/TC_NGAP_GNB_PDU_00.offline.pcap,
# a copy of the capture of a passing run (Ethernet link type), both directions
system.NGAP_gNB_1.params := "NGAP/SCTP_FILE/IP_OFFLINE/ETH(mac_src=000000000000,mac_dst=000000000000)/PCAP_FILE(file=../captures/TC_NGAP_GNB_PDU_01.offline.pcap,filter=sctp)"
system.N3_gNB_1.params := "GTPU(auto_echo_reply=0)/UDP_FILE(port=2152)/IP_OFFLINE/ETH(mac_src=000000000000,mac_dst=000000000000)/PCAP_FILE(file=../captures/TC_NGAP_GNB_PDU_01.offline.pcap,filter=udp port 2152)"
system.NGAP_gNB_1.params := "NGAP/SCTP_FILE/IP_OFFLINE/ETH(mac_src=000000000000,mac_dst=000000000000)/PCAP_FILE(file=../captures/TC_NGAP_GNB_PDU_00.offline.pcap,filter=sctp)"
system.N3_gNB_1.params := "GTPU(auto_echo_reply=0)/UDP_FILE(port=2152)/IP_OFFLINE/ETH(mac_src=000000000000,mac_dst=000000000000)/PCAP_FILE(file=../captures/TC_NGAP_GNB_PDU_00.offline.pcap,filter=udp port 2152)"

# Online, with the gNB under test (see AtsNGAP_GNB_p_net.cfg_): act as AMF, listen for incoming connections from the gNB
#system.NGAP_gNB_1.params := "NGAP/SCTP(local_server=10.174.19.14,server_mode=1,local_port=38412,debug=1)"
@@ -144,7 +144,7 @@ system.N3_gNB_1.params := "GTPU(auto_echo_reply=0)/UDP_FILE(port=2152)/IP_OFFLIN
#AtsImsIot_TestControl.control

# Verify that the GNB successfully processes a PDU_SESSION_RESOURCE_SETUP_REQUEST and answers with PDU_SESSION_RESOURCE_SETUP_RESPONSE for successfully established PDU session.
NGAP_TestCases.TC_NGAP_GNB_PDU_01
NGAP_TestCases.TC_NGAP_GNB_PDU_00
## Verify that the NG-RAN node reports the establishment of the corresponding PDU session as failed if a PDU SESSION RESOURCE SETUP REQUEST contains several PDU Session ID IEs set to the same value.
##NGAP_TestCases.TC_NGAP_GNB_PDU_02
## Verify that the NG-RAN node reports the establishment of the new PDU session as failed if a PDU SESSION RESOURCE SETUP REQUEST contains a PDU Session ID IE set to value that identifies an active PDU Session. NOTE: Run TP_NGAP_GNB_PDU_01 before this TP.
+11 −10
Changes for etc/AtsNGAP/AtsNGAP_GNB_p_net.cfg_: 11 added lines, 10 removed lines.
Original line number Diff line number Diff line
@@ -23,14 +23,12 @@ LibNGAP_Pics.PICS_NO_RAN_NODE_NAME := true # true
LibNGAP_Pics.PICS_REGISTRATION_REQUEST_WITH_NO_UE_CONTEXT_REQUEST := true # true to send RegistrationRequest with no UE Context Request IE, false to send it with UE Context Request IE

LibNGAP_Pixits.PX_NAS_MCC          := '999'H
LibNGAP_Pixits.PX_NAS_MNC          := '40'H
LibNGAP_Pixits.PX_UT_PLMN_MCC      := '999'H;
LibNGAP_Pixits.PX_UT_PLMN_MNC      := '40'H;
LibNGAP_Pixits.PX_NAS_MNC          := '38'H
LibNGAP_Pixits.PX_UT_PLMN_MCC      := '999'H
LibNGAP_Pixits.PX_UT_PLMN_MNC      := '38'H

# After its restart, the real UE (modem) is forced onto this PLMN: AT+CFUN=1, then AT+COPS=1
LibNGAP_Pixits.PX_UT_PLMN_MANUAL_SELECT := true
LibNGAP_Pixits.PX_UT_PLMN_MCC      := '999'H
LibNGAP_Pixits.PX_UT_PLMN_MNC      := '40'H
LibNGAP_Pixits.PX_RAN_NODE_NAME    := "gnb0012345"
LibNGAP_Pixits.PX_GNB_ID           := '0000011000010010111001'B
LibNGAP_Pixits.PX_RAN_NODE_NAME    := "UERANSIM-gnb-999-70-1"
@@ -63,22 +61,22 @@ Lib_NG_NAS_Pixits.PX_CHECK_SECURITY := true
Lib_NG_NAS_Pixits.PX_SUPI_FORMAT                     := '0000'B # IMSI format
Lib_NG_NAS_Pixits.PX_TYPE_OF_ID                      := '001'B # SUCI type
Lib_NG_NAS_Pixits.PX_SUPI_DIGITS                     := '00f110214300014444330302'O
Lib_NG_NAS_Pixits.PX_MSIN                            := '0000000010'O;
Lib_NG_NAS_Pixits.PX_MSIN                            := '0000307412'O # MSIN 0000034721 (BCD, swapped nibbles)
Lib_NG_NAS_Pixits.PX_NETWORK_NAME                    := "Open5GS"

# OP
Lib_NG_NAS_Pixits.PX_OPERATOR_KEY                    := '00000000000000000000000000000000'O
# OPc
Lib_NG_NAS_Pixits.PX_OPERATOR_SECRET_KEY             := 'B4FCB931721D7BF412E4FB7AAF42E676'O
Lib_NG_NAS_Pixits.PX_OPERATOR_SECRET_KEY             := 'CFF10199EE49179F7D6F5EFEEDDA8727'O
Lib_NG_NAS_Pixits.PX_FORCE_USING_OPERATOR_SECRET_KEY := true
Lib_NG_NAS_Pixits.PX_SUBSCRIPTION_KEY                := '11010010100110100101110000010100011110010011111101001000000101010101101100001101000111101000111110111001100011011110000111001001'B # D29A5C14793F48155B0D1E8FB98DE1C9
Lib_NG_NAS_Pixits.PX_SUBSCRIPTION_KEY                := '11111111011100011100101001011001000010011000000100111010101111101111110010111110101011011001101100001011111010010111001001101100'B # FF71CA5909813ABEFCBEAD9B0BE9726C
Lib_NG_NAS_Pixits.PX_BEARER_ID                       := '00001'B
Lib_NG_NAS_Pixits.PX_SQN                             := '000000000000000000000000000000000000001000000000'B
#Lib_NG_NAS_Pixits.PX_AMF                             := oct2bit('8000'O)
#Lib_NG_NAS_Pixits.PX_RAND_VALUE                      := oct2bit('23553cbe9637a89d218ae64dae47bf35'O)
#Lib_NG_NAS_Pixits.PX_RAND_VALUE_REFRESH              := oct2bit('9f7c8d021accf4db213ccff0c7f71a6a'O)

Parameters.px_IMSI_Def                               := '393939343030303030303435363433'H # 999400000045643
Parameters.px_IMSI_Def                               := '393939333830303030303334373231'H # 999380000034721
Parameters.px_IMEISV_Def                             := '73806121856151f1'H
NAS_5GC_Parameters.px_NAS_5GC_XRES_Length            := 8 # In ETSI TS 135 206 V16.0.0 (2020-08) Table Table 5. f2 output, RES length is 8 octets (64 bits)

@@ -136,8 +134,11 @@ system.utPort.params := "UT/TCP(server=10.59.0.7,port=12100,debug=1)"
# In this section you can specify what parts of your test suite you want to execute.
#AtsImsIot_TestControl.control

# Complete end to end registration/deregistration procedure
NGAP_TestCases.TC_NGAP_GNB_PDU_00

# Verify that the GNB successfully processes a PDU_SESSION_RESOURCE_SETUP_REQUEST and answers with PDU_SESSION_RESOURCE_SETUP_RESPONSE for successfully established PDU session.
NGAP_TestCases.TC_NGAP_GNB_PDU_01
#NGAP_TestCases.TC_NGAP_GNB_PDU_01
## Verify that the NG-RAN node reports the establishment of the corresponding PDU session as failed if a PDU SESSION RESOURCE SETUP REQUEST contains several PDU Session ID IEs set to the same value.
##NGAP_TestCases.TC_NGAP_GNB_PDU_02
## Verify that the NG-RAN node reports the establishment of the new PDU session as failed if a PDU SESSION RESOURCE SETUP REQUEST contains a PDU Session ID IE set to value that identifies an active PDU Session. NOTE: Run TP_NGAP_GNB_PDU_01 before this TP.
+76 −13
Changes for ttcn/AtsNGAP/NGAP_Steps.ttcn: 76 added lines, 13 removed lines.
Original line number Diff line number Diff line
@@ -1046,18 +1046,20 @@ module NGAP_Steps { // TODO FSCOM f_xxx_UE_SecurityMode to be mmoved into NAG_NG
        } // End of function fl_ping_replies_received

        /**
         * @brief  Get the downlink tunnel endpoint of the gNB for a PDU session from the PDU SESSION RESOURCE SETUP
         *         RESPONSE just received (vc_recvNGAP_PDU), and keep it in vc_dlGtpTunnel.
         * @details The PDU Session Resource Setup Response Transfer of the item for p_pduSessionId is decoded (aligned
         *          PER, TS 38.413 clause 9.3.4.2): its DL QoS Flow per TNL Information gives the GTP tunnel.
         * @brief  Decode the PDU Session Resource Setup Response Transfer of a PDU session, from the PDU SESSION RESOURCE
         *         SETUP RESPONSE just received (vc_recvNGAP_PDU).
         * @details The transfer of the item for p_pduSessionId in the PDU Session Resource Setup Response List is decoded
         *          (aligned PER, TS 38.413 clause 9.3.4.2).
         * @param  p_pduSessionId The PDU session.
         * @return false if the response has no such item, or the tunnel cannot be decoded.
         * @param  p_transfer The decoded transfer.
         * @return false if the response has no item for p_pduSessionId, or its transfer cannot be decoded.
         */
        function f_NGAP_gnb_get_dl_gtp_tunnel(in PDUSessionID p_pduSessionId) runs on gNBNGAPComponent return boolean {
            var PDUSessionResourceSetupResponseTransfer v_transfer;
        function f_NGAP_gnb_get_setup_response_transfer(
                                                        in PDUSessionID p_pduSessionId,
                                                        out PDUSessionResourceSetupResponseTransfer p_transfer
                                                        ) runs on gNBNGAPComponent return boolean {
            var bitstring v_bs;

            vc_dlGtpTunnelKnown := false;
            if (not ischosen(vc_recvNGAP_PDU.successfulOutcome)) {
                return false;
            }
@@ -1067,8 +1069,33 @@ module NGAP_Steps { // TODO FSCOM f_xxx_UE_SecurityMode to be mmoved into NAG_NG
                    for (var integer j := 0; j < lengthof(v_list); j := j + 1) {
                        if (v_list[j].pDUSessionID == p_pduSessionId) {
                            v_bs := oct2bit(v_list[j].pDUSessionResourceSetupResponseTransfer);
                            if (fx_dec_PDUSessionResourceSetupResponseTransfer(v_bs, v_transfer) != 0) {
                                log("f_NGAP_gnb_get_dl_gtp_tunnel: decoding failure: ", v_list[j].pDUSessionResourceSetupResponseTransfer);
                            if (fx_dec_PDUSessionResourceSetupResponseTransfer(v_bs, p_transfer) != 0) {
                                log("f_NGAP_gnb_get_setup_response_transfer: decoding failure: ", v_list[j].pDUSessionResourceSetupResponseTransfer);
                                return false;
                            }
                            log("f_NGAP_gnb_get_setup_response_transfer: ", p_transfer);
                            return true;
                        }
                    }
                }
            }
            log("f_NGAP_gnb_get_setup_response_transfer: no setup item for PDU session ", p_pduSessionId);
            return false;
        } // End of function f_NGAP_gnb_get_setup_response_transfer

        /**
         * @brief  Get the downlink tunnel endpoint of the gNB for a PDU session from the PDU SESSION RESOURCE SETUP
         *         RESPONSE just received (vc_recvNGAP_PDU), and keep it in vc_dlGtpTunnel.
         * @details The DL QoS Flow per TNL Information of the PDU Session Resource Setup Response Transfer
         *          (f_NGAP_gnb_get_setup_response_transfer) gives the GTP tunnel.
         * @param  p_pduSessionId The PDU session.
         * @return false if the response has no such item, or the tunnel cannot be decoded.
         */
        function f_NGAP_gnb_get_dl_gtp_tunnel(in PDUSessionID p_pduSessionId) runs on gNBNGAPComponent return boolean {
            var PDUSessionResourceSetupResponseTransfer v_transfer;

            vc_dlGtpTunnelKnown := false;
            if (not f_NGAP_gnb_get_setup_response_transfer(p_pduSessionId, v_transfer)) {
                return false;
            }
            if (not ischosen(v_transfer.dLQosFlowPerTNLInformation.uPTransportLayerInformation.gTPTunnel)) {
@@ -1081,13 +1108,49 @@ module NGAP_Steps { // TODO FSCOM f_xxx_UE_SecurityMode to be mmoved into NAG_NG
                f_ipv4_toString(bit2oct(vc_dlGtpTunnel.transportLayerAddress)), ", TEID ", vc_dlGtpTunnel.gTP_TEID,
                " (G-PDUs are sent to the dst_ip of system.N3_gNB_1)");
            return true;
        } // End of function f_NGAP_gnb_get_dl_gtp_tunnel

        /**
         * @brief  Check the PDU Session Resource Setup Response Transfer of a PDU session, as TP_NGAP_GNB_PDU_01 expects.
         * @details In the PDU SESSION RESOURCE SETUP RESPONSE just received (vc_recvNGAP_PDU), the transfer of the item for
         *          p_pduSessionId (TS 38.413 clause 9.3.4.2) must carry a DL QoS Flow per TNL Information with a GTP tunnel
         *          (any address and TEID: values of the gNB) and an Associated QoS Flow List holding the QoS flow p_qfi.
         *          The verdict is set to fail otherwise.
         * @param  p_pduSessionId The PDU session.
         * @param  p_qfi The QoS flow requested in the PDU SESSION RESOURCE SETUP REQUEST.
         * @return true if the transfer conforms.
         */
        function f_NGAP_gnb_check_setup_response_transfer(
                                                          in PDUSessionID p_pduSessionId,
                                                          in QosFlowIdentifier p_qfi
                                                          ) runs on gNBNGAPComponent return boolean {
            var PDUSessionResourceSetupResponseTransfer v_transfer;
            var GTPTunnel v_tunnel;

            if (not f_NGAP_gnb_get_setup_response_transfer(p_pduSessionId, v_transfer)) {
                log("*** " & __SCOPE__ & ": FAIL: no decodable PDU Session Resource Setup Response Transfer for PDU session ", p_pduSessionId, " ***");
                setverdict(fail, "PDU Session Resource Setup Response Transfer missing or not decodable");
                return false;
            }
            if (not ischosen(v_transfer.dLQosFlowPerTNLInformation.uPTransportLayerInformation.gTPTunnel)) {
                log("*** " & __SCOPE__ & ": FAIL: DL QoS Flow per TNL Information without GTP tunnel: ",
                    v_transfer.dLQosFlowPerTNLInformation, " ***");
                setverdict(fail, "DL QoS Flow per TNL Information without GTP tunnel");
                return false;
            }
            v_tunnel := v_transfer.dLQosFlowPerTNLInformation.uPTransportLayerInformation.gTPTunnel;
            for (var integer i := 0; i < lengthof(v_transfer.dLQosFlowPerTNLInformation.associatedQosFlowList); i := i + 1) {
                if (v_transfer.dLQosFlowPerTNLInformation.associatedQosFlowList[i].qosFlowIdentifier == p_qfi) {
                    log("*** " & __SCOPE__ & ": PASS: downlink tunnel ", f_ipv4_toString(bit2oct(v_tunnel.transportLayerAddress)),
                        ", TEID ", v_tunnel.gTP_TEID, ", associated QoS flow ", p_qfi, " ***");
                    return true;
                }
            }
            log("f_NGAP_gnb_get_dl_gtp_tunnel: no setup item for PDU session ", p_pduSessionId);
            log("*** " & __SCOPE__ & ": FAIL: QoS flow ", p_qfi, " not in the Associated QoS Flow List: ",
                v_transfer.dLQosFlowPerTNLInformation.associatedQosFlowList, " ***");
            setverdict(fail, "requested QoS flow not associated");
            return false;
        } // End of function f_NGAP_gnb_get_dl_gtp_tunnel
        } // End of function f_NGAP_gnb_check_setup_response_transfer

        /**
         * @brief  Offline replay (PICS_OFFLINE_MODE) of the user plane of f_NGAP_gnb_UE_ping: check the G-PDUs of the capture.
@@ -1245,7 +1308,7 @@ module NGAP_Steps { // TODO FSCOM f_xxx_UE_SecurityMode to be mmoved into NAG_NG

        /**
         * @brief  Default altstep catching the uplink NAS messages of a real UE once its PDU session is being set up.
         * @details Activated by TC_NGAP_GNB_PDU_01 from the PDU SESSION RESOURCE SETUP REQUEST (carrying the PDU
         * @details Activated by TC_NGAP_GNB_PDU_xx from the PDU SESSION RESOURCE SETUP REQUEST (carrying the PDU
         *          SESSION ESTABLISHMENT ACCEPT) until the end of the test body. Any UPLINK NAS TRANSPORT received
         *          meanwhile, which a_defaultNGAP would silently discard, is reported by
         *          f_NGAP_gnb_report_ue_nas_message; the interrupted alt then goes on (repeat). It is activated
+171 −8

File changed.

Preview size limit exceeded, changes collapsed.

Loading