Implement PDU Session Release for Home-Routed Roaming and fix N4 step ordering in 4.3.4.2

- Add support for PDU Session Release in 3GPP TS 23.502 section 4.3.4.3
  Note: PCF-initiated release flow for Home-Routed Roaming is not implemented;
- Fix N4 release step ordering in 3GPP TS 23.502 section 4.3.4.2 UE or network requested PDU Session Release for Non-Roaming and Roaming with Local Breakout
This commit is contained in:
Sukchan Lee 2025-05-02 21:28:25 +09:00
parent d66d6f868a
commit ca61a901d5
45 changed files with 2442 additions and 722 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
* Copyright (C) 2019-2025 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
@ -1599,7 +1599,11 @@ bson_t *test_db_new_simple(test_ue_t *test_ue)
"pre_emption_capability", BCON_INT32(1),
"}",
"}",
#if 0
"lbo_roaming_allowed", BCON_BOOL(true),
#else
"lbo_roaming_allowed", BCON_BOOL(false),
#endif
"}", "]",
"}", "]",
"security", "{",
@ -2085,6 +2089,11 @@ bson_t *test_db_new_ims(test_ue_t *test_ue)
"}",
"}",
"]",
#if 1
"lbo_roaming_allowed", BCON_BOOL(true),
#else
"lbo_roaming_allowed", BCON_BOOL(false),
#endif
"}",
"]",
"}", "]",

View file

@ -19,6 +19,8 @@
#include "test-common.h"
#define ENABLE_SMF_INITIATED_SESSION_RELEASE 0
static void test1_func(abts_case *tc, void *data)
{
int rv;
@ -258,6 +260,44 @@ static void test1_func(abts_case *tc, void *data)
ogs_pkbuf_free(recvbuf);
#endif
#if ENABLE_SMF_INITIATED_SESSION_RELEASE
/* Receive PDUSessionResourceReleaseCommand +
* DL NAS transport +
* PDU session release command */
recvbuf = testgnb_ngap_read(ngap);
ABTS_PTR_NOTNULL(tc, recvbuf);
testngap_recv(test_ue, recvbuf);
ABTS_INT_EQUAL(tc,
NGAP_ProcedureCode_id_PDUSessionResourceRelease,
test_ue->ngap_procedure_code);
/* Send PDUSessionResourceReleaseResponse */
sendbuf = testngap_build_pdu_session_resource_release_response(sess);
ABTS_PTR_NOTNULL(tc, sendbuf);
rv = testgnb_ngap_send(ngap, sendbuf);
ABTS_INT_EQUAL(tc, OGS_OK, rv);
/* Send UplinkNASTransport +
* UL NAS trasnport +
* PDU session resource release complete */
sess->ul_nas_transport_param.request_type = 0;
sess->ul_nas_transport_param.dnn = 0;
sess->ul_nas_transport_param.s_nssai = 0;
sess->pdu_session_establishment_param.ssc_mode = 0;
sess->pdu_session_establishment_param.epco = 0;
gsmbuf = testgsm_build_pdu_session_release_complete(sess);
ABTS_PTR_NOTNULL(tc, gsmbuf);
gmmbuf = testgmm_build_ul_nas_transport(sess,
OGS_NAS_PAYLOAD_CONTAINER_N1_SM_INFORMATION, gsmbuf);
ABTS_PTR_NOTNULL(tc, gmmbuf);
sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf);
ABTS_PTR_NOTNULL(tc, sendbuf);
rv = testgnb_ngap_send(ngap, sendbuf);
ABTS_INT_EQUAL(tc, OGS_OK, rv);
#endif
/* Send UEContextReleaseRequest */
sendbuf = testngap_build_ue_context_release_request(test_ue,
NGAP_Cause_PR_radioNetwork, NGAP_CauseRadioNetwork_user_inactivity,

View file

@ -20,6 +20,8 @@
#include "test-common.h"
#include "af/sbi-path.h"
#define ENABLE_PCF_INITIATED_SESSION_RELEASE 0
static void test1_func(abts_case *tc, void *data)
{
int rv;
@ -315,6 +317,7 @@ static void test1_func(abts_case *tc, void *data)
af_local_send_to_pcf(af_sess, &af_param,
af_npcf_policyauthorization_build_create);
#if !ENABLE_PCF_INITIATED_SESSION_RELEASE
/* Receive PDUSessionResourceModifyRequest +
* DL NAS transport +
* PDU session modification command */
@ -411,10 +414,48 @@ static void test1_func(abts_case *tc, void *data)
ABTS_PTR_NOTNULL(tc, sendbuf);
rv = testgnb_ngap_send(ngap, sendbuf);
ABTS_INT_EQUAL(tc, OGS_OK, rv);
#else
/* Receive PDUSessionResourceReleaseCommand +
* DL NAS transport +
* PDU session release command */
recvbuf = testgnb_ngap_read(ngap);
ABTS_PTR_NOTNULL(tc, recvbuf);
testngap_recv(test_ue, recvbuf);
ABTS_INT_EQUAL(tc,
NGAP_ProcedureCode_id_PDUSessionResourceRelease,
test_ue->ngap_procedure_code);
/* Send PDUSessionResourceReleaseResponse */
sendbuf = testngap_build_pdu_session_resource_release_response(sess);
ABTS_PTR_NOTNULL(tc, sendbuf);
rv = testgnb_ngap_send(ngap, sendbuf);
ABTS_INT_EQUAL(tc, OGS_OK, rv);
/* Send UplinkNASTransport +
* UL NAS trasnport +
* PDU session resource release complete */
sess->ul_nas_transport_param.request_type = 0;
sess->ul_nas_transport_param.dnn = 0;
sess->ul_nas_transport_param.s_nssai = 0;
sess->pdu_session_establishment_param.ssc_mode = 0;
sess->pdu_session_establishment_param.epco = 0;
gsmbuf = testgsm_build_pdu_session_release_complete(sess);
ABTS_PTR_NOTNULL(tc, gsmbuf);
gmmbuf = testgmm_build_ul_nas_transport(sess,
OGS_NAS_PAYLOAD_CONTAINER_N1_SM_INFORMATION, gsmbuf);
ABTS_PTR_NOTNULL(tc, gmmbuf);
sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf);
ABTS_PTR_NOTNULL(tc, sendbuf);
rv = testgnb_ngap_send(ngap, sendbuf);
ABTS_INT_EQUAL(tc, OGS_OK, rv);
#endif
/* Wait for PDU session resource modify complete */
ogs_msleep(100);
#if !ENABLE_PCF_INITIATED_SESSION_RELEASE
/* Test Bearer Remove */
test_bearer_remove(qos_flow);
@ -431,6 +472,7 @@ static void test1_func(abts_case *tc, void *data)
/* Wait for PDU session resource modify complete */
ogs_msleep(100);
#endif
/* Send UEContextReleaseRequest */
sendbuf = testngap_build_ue_context_release_request(test_ue,