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

Validate TC_5GNAS_AMF_AUT_REQ_01..03 with free5gc

parent 6a4be4dc
Loading
Loading
Loading
Loading
+3 −2
Changes for etc/AtsNGAP/AtsNGAP_AMF_free5gc.cfg_: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ LibNGAP_Pixits.PX_TACode := '000001'O
LibNGAP_Pixits.PX_SST              := '01'O
LibNGAP_Pixits.PX_SD               := '010203'O
LibNGAP_Pixits.PX_SD_PRESENT       := true # free5GC amfcfg.yaml plmnSupportList: slice SST 1 with SD 010203
LibNGAP_Pixits.PX_POSTAMBLE_DEREGISTRATION := true # free5GC keeps a UE registered (and its PDU sessions) after a UE context release: de-register it in the postamble
# The new slice of TC_NGAP_AMF_IMP_05: the second slice of the free5GC AMF (amfcfg.yaml plmnSupportList: SST 1, SD 112233)
LibNGAP_Pixits.PX_SST_NEW          := '01'O
LibNGAP_Pixits.PX_SD_NEW           := '112233'O
@@ -178,9 +179,9 @@ system.utHttpPort.params := "HTTP/TCP(server=127.0.0.1,port=12200,use_ssl=0,debu
# Verify that the IUT can send a  PDU_SESSION_RESOURCE_RELEASE_COMMAND to release PDU session.
#NGAP_TestCases.TC_NGAP_AMF_PDU_02
# Verify that the IUT successfully receives and processes the PDU_SESSION_RESOURCE_RELEASE_RESPONSE message and completes the PDU Session Resource Release procedure for a single PDU_Session_Resource.
NGAP_TestCases.TC_NGAP_AMF_PDU_02_2
#NGAP_TestCases.TC_NGAP_AMF_PDU_02_2
# Verify that the IUT can send a  PDU_SESSION_RESOURCE_MODIFY_REQUEST to modify PDU session.
#NGAP_TestCases.TC_NGAP_AMF_PDU_03
NGAP_TestCases.TC_NGAP_AMF_PDU_03
# Verify that the AMF node successfully processes a  PDU_SESSION_RESOURCE_MODIFY_INDICATION contains mandatory IEs and answers with PDU_SESSION_RESOURCE_MODIFY_CONFIRM for successfully modified PDU session.
#NGAP_TestCases.TC_NGAP_AMF_PDU_04
# Verify that the AMF node processes a  PDU_SESSION_RESOURCE_MODIFY_INDICATION contains mandatory IEs and answers with PDU_SESSION_RESOURCE_MODIFY_CONFIRM for not successfully modified PDU session.
+72 −7
Changes for etc/Ats_NG_NAS/Ats_NG_NAS_AMF_free5gc.cfg_: 72 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -8,16 +8,22 @@ LibCommon_Time.PX_TDONE := 30.0;
LibCommon_Time.PX_TAC                   := 30.0;
LibCommon_Time.PX_TNOAC                 := 10.0;
LibCommon_Time.PX_TWAIT                 := 30.0;
LibCommon_Sync.PX_TSYNC_TIME_LIMIT      := 10.0;
LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 10.0;
LibCommon_Sync.PX_TSYNC_TIME_LIMIT      := 40.0;
LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 40.0;

NGAP_Pics.PICS_NGAP_AMF_IUT    := true
NGAP_Pics.PICS_NGAP_GNB_IUT    := false

NG_NAS_Pics.PICS_NGNAS         := true
NG_NAS_Pics.PICS_NAS_A4_1_2     := true  # 5G AKA based primary authentication and key agreement (TC_5GNAS_AMF_AUT_REQ_xx)
NG_NAS_Pics.PICS_NAS_A4_1_2_2_1 := false # free5gc: AUTHENTICATION REJECT on #20 MAC failure, no identification (TC_5GNAS_AMF_AUT_REQ_04)
NG_NAS_Pics.PICS_NAS_A4_1_2_3_1 := false # free5gc: AUTHENTICATION REJECT on #26 non-5G authentication unacceptable, no identification (TC_5GNAS_AMF_AUT_ABN_01)
NG_NAS_Pics.PICS_NAS_A4_1_2_4   := true  # free5gc re-authenticates on #71 ngKSI already in use (TC_5GNAS_AMF_AUT_REQ_05)
NG_NAS_Pics.PICS_NAS_A4_2_1     := true  # security mode control (TC_5GNAS_AMF_SEC_COM_01)
NG_NAS_Pics.PICS_NAS_A4_2       := true  # security mode control procedure (TC_5GNAS_AMF_SEC_ACC_01)

LibNGAP_Pics.PICS_OFFLINE_MODE := false # true to use offline mode with pcap files, false to use online mode with real network functions
LibNGAP_Pics.PICS_USE_OPEN5GS  := false # true to start open5gs, false to not start them
LibNGAP_Pics.PICS_USE_OPEN5GS  := false # true to start free5gc, false to not start them

LibNGAP_Pixits.PX_NAS_MCC       := '208'H
LibNGAP_Pixits.PX_NAS_MNC       := '93'H
@@ -45,7 +51,9 @@ LibNGAP_Pixits.PX_AMF_SET_ID := '1111111000'B # set 3F8
LibNGAP_Pixits.PX_AMF_POINTER      := '000000'B     # pointer 0
LibNGAP_Pixits.PX_RAN_UE_NGAP_ID   := 1
LibNGAP_Pixits.PX_AMF_UE_NGAP_ID   := 2

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

LibNGAP_Pixits.PX_PDU_SESSION_ID   := 1

# The additional QoS flow of TC_NGAP_AMF_PDU_03: AUDIO gives 5QI 1 with the PCC rule of 5QI 1 of the subscriber (MongoDB)
@@ -61,8 +69,8 @@ Lib_NG_NAS_Pixits.PX_MSIN := '0000000010'O # MSIN 0000000001
Lib_NG_NAS_Pixits.PX_NETWORK_NAME             := "free5GC"
Lib_NG_NAS_Pixits.PX_SUCI_PROTECTION_SCHEME   := 0
Lib_NG_NAS_Pixits.PX_HOME_NETWORK_PKI         := 0
#Lib_NG_NAS_Pixits.PX_HOME_NETWORK_PUBLIC_KEY := 'e421686f6fb2d70e3fa28d940494095686c3179fef53514667a6ed106b8a7d3d'O; // Profile A / open5gs
#Lib_NG_NAS_Pixits.PX_HOME_NETWORK_PUBLIC_KEY := '03adefcd1317d1ce8562ec25b91b4800120e1236d6e2661ea4235a84e3c85da244'O; // Profile B / open5gs
#Lib_NG_NAS_Pixits.PX_HOME_NETWORK_PUBLIC_KEY := 'e421686f6fb2d70e3fa28d940494095686c3179fef53514667a6ed106b8a7d3d'O; // Profile A / free5gc
#Lib_NG_NAS_Pixits.PX_HOME_NETWORK_PUBLIC_KEY := '03adefcd1317d1ce8562ec25b91b4800120e1236d6e2661ea4235a84e3c85da244'O; // Profile B / free5gc

# OP
Lib_NG_NAS_Pixits.PX_OPERATOR_KEY := '00000000000000000000000000000000'O
@@ -77,8 +85,63 @@ Parameters.px_IMSI_Def := '323038393330303030303030303031'H # 208930000000001 (A
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)

# Upper tester parameters for UERANSIM integration
LibNGAP_Pixits.PX_OPEN5GS_BINARY_FILE := "/home/yann/dev/open5gs/build/tests/app/5gc"
# free5gc AMF: T3522 is 3 s (TS 24.501 default 6 s), TC_5GNAS_AMF_DRG_REQ_02
Lib_NG_NAS_Pixits.PX_T3522                           := 3.0
Lib_NG_NAS_Pixits.PX_T3560                           := 6.0 # free5gc AMF: T3560 is 6 s, 4 retransmissions (TC_5GNAS_AMF_AUT_REQ_03)
# free5gc amf.security: integrity_order [NIA2, NIA1, NIA0], ciphering_order [NEA0, NEA1, NEA2], UE capabilities 'f0'O (TC_5GNAS_AMF_SEC_COM_01)
Lib_NG_NAS_Pixits.PX_SELECTED_NAS_CIPHERING_ALGORITHM := '0000'B # 5G-EA0
Lib_NG_NAS_Pixits.PX_SELECTED_NAS_INTEGRITY_ALGORITHM := '0010'B # 128-5G-IA2
# HTTP upper tester (upper_tester_http, config/free5gc.toml): python3.13 -m upper_tester_http --config upper_tester_http/config/free5gc.toml
# The network-initiated de-registrations of TC_5GNAS_AMF_DRG_REQ_01/02/03 (the UDM notifies the AMF)
LibUpperTesterHttp_Pics.PICS_USE_UT_HTTP             := true
LibUpperTesterHttp_Pixits.PX_UT_HTTP_HOST            := "127.0.0.1:12200" # server:port of system.utHttpPort below

# ---- PICS and PIXITs of the free5gc AMF, from etc/AtsNGAP/AtsNGAP_AMF_open5gs.cfg_ (shared NGAP and NAS libraries) ----
# Procedures supported by the IUT (PICS proforma), for the test cases of this configuration and the control part
NGAP_Pics.PICS_A3_3_8            := true  # gnB - UE Mobility Management Procedures - HANDOVER SUCCESS
NGAP_Pics.PICS_A4_1_1            := true  # AMF - PDU session management procedure - PDU SESSION RESOURCE SETUP REQUEST
NGAP_Pics.PICS_A4_1_2            := true  # AMF - PDU session management procedure - PDU SESSION RESOURCE RELEASE COMMAND
NGAP_Pics.PICS_A4_1_3            := true  # AMF - PDU session management procedure - PDU SESSION RESOURCE MODIFY REQUEST
NGAP_Pics.PICS_A4_1_5            := true  # AMF - PDU session management procedure - PDU SESSION RESOURCE MODIFY INDICATION
NGAP_Pics.PICS_A4_2_1            := true  # AMF - UE Context Management Procedures - INITIAL CONTEXT SETUP REQUEST
NGAP_Pics.PICS_A4_2_3            := true  # AMF - UE Context Management Procedures - UE CONTEXT RELEASE COMMAND
NGAP_Pics.PICS_A4_3_1            := true  # AMF - UE Mobility Management Procedures - HANDOVER REQUIRED
NGAP_Pics.PICS_A4_3_2            := true  # AMF - UE Mobility Management Procedures - HANDOVER REQUEST
NGAP_Pics.PICS_A4_3_4            := true  # AMF - UE Mobility Management Procedures - PATH SWITCH REQUESTS
NGAP_Pics.PICS_A4_3_5            := true  # AMF - UE Mobility Management Procedures - HANDOVER CANCEL
NGAP_Pics.PICS_A4_3_6            := true  # AMF - UE Mobility Management Procedures - UPLINK RAN STATUS TRANSFER
NGAP_Pics.PICS_A4_3_9            := true  # AMF - UE Mobility Management Procedures - UPLINK RAN EARLY STATUS TRANSFER
NGAP_Pics.PICS_A4_4_1            := true  # AMF - Paging procedures - Paging
NGAP_Pics.PICS_A4_5_2            := true  # AMF - Transport of NAS Messages Procedures - DOWNLINK NAS TRANSPORT
NGAP_Pics.PICS_A4_6_1            := true  # AMF - Interface Management Procedures - NG SETUP REQUEST
NGAP_Pics.PICS_A4_6_1_2          := false # AMF - IAB: not supported by free5gc (no IAB Supported in its NG SETUP RESPONSE)
NGAP_Pics.PICS_A4_6_2            := true  # AMF - Interface Management Procedures - RAN CONFIGURATION UPDATE
NGAP_Pics.PICS_A4_6_3            := true  # AMF - Interface Management Procedures - AMF CONFIGURATION UPDATE
NGAP_Pics.PICS_A4_6_4            := true  # AMF - Interface Management Procedures - NG RESET
NGAP_Pics.PICS_A4_6_5            := true  # AMF - Interface Management Procedures - ERROR INDICATION
NGAP_Pics.PICS_A4_6_6            := true  # AMF - Interface Management Procedures - AMF STATUS INDICATION
NGAP_Pics.PICS_A4_6_7            := true  # AMF - Interface Management Procedures - OVERLOAD START
NGAP_Pics.PICS_A4_6_8            := true  # AMF - Interface Management Procedures - OVERLOAD STOP
NGAP_Pics.PICS_A4_8_1            := true  # AMF - Warning Message Transmission procedure - WRITE-REPLACE WARNING REQUEST
NGAP_Pics.PICS_A4_8_2            := true  # AMF - Warning Message Transmission procedure - PWS CANCEL REQUEST
NGAP_Pics.PICS_A4_9_1            := true  # AMF - NRPPa Transport procedure - DOWNLINK UE ASSOCIATED NRPPA TRANSPORT messages
NGAP_Pics.PICS_A4_9_3            := true  # AMF - NRPPa Transport procedure - DOWNLINK NON UE ASSOCIATED NRPPA TRANSPORT messages
NGAP_Pics.PICS_A4_11_1           := true  # AMF - Location Reporting Procedures - LOCATION REPORTING CONTROL
LibNGAP_Pixits.PX_SD_PRESENT       := false # free5gc sample.yaml: slice SST 1 without SD
# The new slice of TC_NGAP_AMF_IMP_05: the second slice of the free5gc AMF (build/configs/sample.yaml amf.plmn_support)
LibNGAP_Pixits.PX_SST_NEW          := '01'O
LibNGAP_Pixits.PX_SD_NEW           := '000001'O
LibNGAP_Pixits.PX_SD_NEW_PRESENT   := true
# N3 user plane: the test system (gNB) at 127.0.0.1:2152 (PX_TRANSPORT_LAYER_ADDRESS, DL tunnel), the UPF at 127.0.0.7:2152
LibNGAP_Pics.PICS_USE_GTPU          := true
LibNGAP_Pixits.PX_DN_PING_HOST      := "10.45.0.1" # ogstun of the free5gc host, reached through the UPF
# DL tunnel address announced to the UPF: must always match the src_ip of system.N3_gNB_1 below (here 127.0.0.1)
LibNGAP_Pixits.PX_TRANSPORT_LAYER_ADDRESS := '01111111000000000000000000000001'B # 127.0.0.1
LibNGAP_Pixits.PX_FIVE_QI          := 9     # 5QI of the default QoS flow (free5gc subscriber)
LibNGAP_Pixits.PX_2nd_5QI          := 1
LibUpperTesterHttp_Pixits.PX_UT_HTTP_MEDIA_TYPE := AUDIO
Lib_NG_NAS_Pixits.PX_SUCI_PROTECTION_SCHEME   := 0
Lib_NG_NAS_Pixits.PX_HOME_NETWORK_PKI         := 0

[LOGGING]
# In this section you can specify the name of the log file and the classes of events
@@ -99,6 +162,8 @@ LogEventTypes:= Yes

# free5GC AMF IP and port as listener (free5gc container on n2, free5gc-lab compose.ats.yaml)
system.NGAP_AMF.params := "NGAP/SCTP(ppid=60,server=10.100.1.10,port=38412,debug=1,local_server=10.100.1.1,local_port=38413,debug=1)"
# HTTP upper tester (PICS_USE_UT_HTTP): REST API over HTTP/1.1, see upper_tester_http/server.py (config/free5gc-lab.toml)
system.utHttpPort.params := "HTTP/TCP(server=127.0.0.1,port=12200,use_ssl=0,debug=1)"

# Open5GS pcap files
# Do not forget to set LibNGAP_Pics.PICS_OFFLINE_MODE to true
+31 −2
Changes for ttcn/Ats_NG_NAS/NG_NAS_Steps.ttcn: 31 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -346,11 +346,15 @@ module NG_NAS_Steps {
        /**
         * @desc   Postamble: release of the UE context. If the IUT already sent the UE CONTEXT RELEASE COMMAND (p_released),
         *         the UE CONTEXT RELEASE COMPLETE is sent (offline: read); otherwise UE CONTEXT RELEASE REQUEST, COMMAND and
         *         COMPLETE with the cause nas normal-release (no PDU session).
         *         COMPLETE with the cause nas normal-release (no PDU session). Online, an AMF that already dropped the UE
         *         context without releasing it (e.g. free5GC once T3560 expired for the last time) does not answer the
         *         UE CONTEXT RELEASE REQUEST: after PX_TNOAC this is logged and the verdict left unchanged.
         */
        function f_NG_NAS_amf_UE_ReleaseContext(
                                                in boolean p_released
                                                ) runs on aMF_NGNAS_NGAPComponent {
            timer t_release := PX_TNOAC;

            if (p_released) {
                if (PICS_OFFLINE_MODE) {
                    f_recv_NGAP_PDU(mw_ngap_succMsg_anyProcedure(id_UEContextRelease));
@@ -365,7 +369,32 @@ module NG_NAS_Steps {
            } else if (PICS_OFFLINE_MODE) {
                f_await_ue_context_release_request_await_ue_context_release_response(m_cause_nas(normal_release));
            } else {
                f_send_ue_context_release_request_await_ue_context_release_response(m_cause_nas(normal_release));
                f_send_NGAP_PDU(
                                m_ngap_initMsg(
                                               m_n2_UEContextReleaseRequest(
                                                                            vc_AMF_UE_ID,
                                                                            vc_RAN_UE_ID,
                                                                            m_cause_nas(normal_release)
                                )));
                t_release.start;
                alt {
                    [] N2_gNBaMF_P.receive(mw_ngap_initMsg(mw_n2_UEContextReleaseCommand())) -> value vc_recvNGAP_PDU {
                        t_release.stop;
                        f_send_NGAP_PDU(
                                        m_ngap_succMsg(
                                                       f_m_n2_UEContextReleaseComplete(
                                                                                       vc_AMF_UE_ID,
                                                                                       vc_RAN_UE_ID
                                        )));
                    }
                    [] N2_gNBaMF_P.receive(mw_ngap_initMsg_anyProcedure(id_ErrorIndication)) -> value vc_recvNGAP_PDU {
                        t_release.stop;
                        log("f_NG_NAS_amf_UE_ReleaseContext: ERROR INDICATION, the AMF has no UE context left: ", vc_recvNGAP_PDU);
                    }
                    [] t_release.timeout {
                        log("f_NG_NAS_amf_UE_ReleaseContext: no UE CONTEXT RELEASE COMMAND within ", PX_TNOAC, " s, the AMF has no UE context left");
                    }
                }
            }
        } // End of function f_NG_NAS_amf_UE_ReleaseContext

+2 −17
Changes for ttcn/Ats_NG_NAS/NG_NAS_TCFunctions.ttcn: 2 added lines, 17 removed lines.
Original line number Diff line number Diff line
@@ -269,23 +269,8 @@ module NG_NAS_TCFunctions {
                    f_selfOrClientSyncAndVerdict(c_tbDone, f_getVerdict());
                    log("*** " & __SCOPE__ & ": INFO: Testbody done. ***");

                    // Postamble: release of the UE context
                    if (v_released) {
                        if (PICS_OFFLINE_MODE) {
                            f_recv_NGAP_PDU(mw_ngap_succMsg_anyProcedure(id_UEContextRelease));
                        } else {
                            f_send_NGAP_PDU(
                                            m_ngap_succMsg(
                                                           f_m_n2_UEContextReleaseComplete(
                                                                                           vc_AMF_UE_ID,
                                                                                           vc_RAN_UE_ID
                                            )));
                        }
                    } else if (PICS_OFFLINE_MODE) {
                        f_await_ue_context_release_request_await_ue_context_release_response(m_cause_nas(normal_release));
                    } else {
                        f_send_ue_context_release_request_await_ue_context_release_response(m_cause_nas(normal_release));
                    }
                    // Postamble: release of the UE context (the IUT may already have dropped it after the fifth expiry of T3560)
                    f_NG_NAS_amf_UE_ReleaseContext(v_released);
                    f_postamble_NGAP_AMF();
                    f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict());
                    log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
+10 −5
Changes for ttcn/LibNGAP/lib_system/LibNGAP_Functions.ttcn: 10 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -3951,8 +3951,9 @@ module LibNGAP_Functions {
    /**
     * @brief  UE context release requested by the gNB (test system = gNB).
     * @details Sends a UE CONTEXT RELEASE REQUEST, awaits the UE CONTEXT RELEASE COMMAND and answers with
     *          the UE CONTEXT RELEASE COMPLETE.
     * @param  p_Cause The cause of the release, also expected in the command.
     *          the UE CONTEXT RELEASE COMPLETE. Used in postambles: the command is accepted with any cause (TS 38.413
     *          clause 8.3.2 leaves it to the AMF), a cause other than p_Cause is only logged.
     * @param  p_Cause The cause of the release.
     */
    function f_send_ue_context_release_request_await_ue_context_release_response(
                                                                                 in template (value) Cause p_Cause
@@ -3969,14 +3970,18 @@ module LibNGAP_Functions {
                        )));
        setverdict(pass, "Sent UE CONTEXT RELEASE REQUEST NGAP message with cause");

        // Await UEContextReleaseCommand
        // Await UEContextReleaseCommand, any cause
        f_recv_NGAP_PDU(
                        mw_ngap_initMsg(
                                        mw_n2_UEContextReleaseCommand(
                                                                      -,
                                                                      p_Cause
                                                                      ?
                        )));
        setverdict(pass, "Received UE CONTEXT RELEASE COMMAND NGAP message with cause");
        if (not match(vc_recvNGAP_PDU, mw_ngap_initMsg(mw_n2_UEContextReleaseCommand(-, p_Cause)))) {
            log("f_send_ue_context_release_request_await_ue_context_release_response: UE CONTEXT RELEASE COMMAND with a cause other than ",
                p_Cause, ": ", vc_recvNGAP_PDU);
        }
        setverdict(pass, "Received UE CONTEXT RELEASE COMMAND NGAP message");

        // Send UEContextReleaseComplete
        f_send_NGAP_PDU(