Skip to content

Commit

Permalink
[MME] UEContextReleaseCommand cause (open5gs#3280)
Browse files Browse the repository at this point in the history
On 4G only... when UE sent an inactivity UEContextReleaseRequest,
Open5GS sent back UEContextReleaseCommand **with cause=normal-release.
This, in turn, does not allow the Samsung UE to return to the low power state
in our testing of the scenario.

Comparing the behavior of open5gs to other cores that we have tested
the other cores are sending a ** cause=“Radio Network Layer Cause”:
User inactivity ** when the UE sends inactivity. And this is what allows
other cores to transition the UE to the low power state whereas
with open5gs the UE is not entering the low power state.

We've fixed to allow open5gs to come to the same level of compliance
in this area as to the other cores.
  • Loading branch information
acetcom committed Jul 6, 2024
1 parent d6cc83b commit c920f53
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/mme/emm-sm.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,8 +674,11 @@ static void common_register_state(ogs_fsm_t *s, mme_event_t *e,
ogs_fatal("Invalid Procedure Code[%d]", (int)e->s1ap_code);
}

if (!mme_ue->nas_eps.update.active_flag)
if (!mme_ue->nas_eps.update.active_flag) {
enb_ue->relcause.group = S1AP_Cause_PR_nas;
enb_ue->relcause.cause = S1AP_CauseNas_normal_release;
mme_send_release_access_bearer_or_ue_context_release(enb_ue);
}

if (mme_ue->next.m_tmsi) {
ogs_fatal("MME does not create new GUTI");
Expand Down Expand Up @@ -743,6 +746,8 @@ static void common_register_state(ogs_fsm_t *s, mme_event_t *e,
OGS_NAS_EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
enb_ue->relcause.group = S1AP_Cause_PR_nas;
enb_ue->relcause.cause = S1AP_CauseNas_normal_release;
mme_send_release_access_bearer_or_ue_context_release(
enb_ue);
break;
Expand Down
6 changes: 6 additions & 0 deletions src/mme/mme-context.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@ struct enb_ue_s {
/* S1 Holding timer for removing this context */
ogs_timer_t *t_s1_holding;

/* UEContextReleaseRequest or InitialContextSetupFailure */
struct {
S1AP_Cause_PR group;
long cause;
} relcause;

/* Store by UE Context Release Command
* Retrieve by UE Context Release Complete */
#define S1AP_UE_CTX_REL_INVALID_ACTION 0
Expand Down
2 changes: 1 addition & 1 deletion src/mme/mme-path.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void mme_send_release_access_bearer_or_ue_context_release(enb_ue_t *enb_ue)
} else {
ogs_debug("No UE Context");
r = s1ap_send_ue_context_release_command(enb_ue,
S1AP_Cause_PR_nas, S1AP_CauseNas_normal_release,
enb_ue->relcause.group, enb_ue->relcause.cause,
S1AP_UE_CTX_REL_S1_CONTEXT_REMOVE, 0);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
Expand Down
2 changes: 1 addition & 1 deletion src/mme/mme-s11-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ void mme_s11_handle_release_access_bearers_response(
enb_ue = enb_ue_find_by_id(mme_ue->enb_ue_id);
if (enb_ue) {
r = s1ap_send_ue_context_release_command(enb_ue,
S1AP_Cause_PR_nas, S1AP_CauseNas_normal_release,
enb_ue->relcause.group, enb_ue->relcause.cause,
S1AP_UE_CTX_REL_S1_REMOVE_AND_UNLINK, 0);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
Expand Down
5 changes: 5 additions & 0 deletions src/mme/s1ap-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,9 @@ void s1ap_handle_initial_context_setup_failure(
CLEAR_MME_UE_ALL_TIMERS(mme_ue);
}

enb_ue->relcause.group = S1AP_Cause_PR_nas;
enb_ue->relcause.cause = S1AP_CauseNas_normal_release;

/*
* 19.2.2.3 in Spec 36.300
*
Expand Down Expand Up @@ -1759,6 +1762,8 @@ void s1ap_handle_ue_context_release_request(
break;
}

enb_ue->relcause.group = Cause->present;
enb_ue->relcause.cause = (int)Cause->choice.radioNetwork;
mme_send_release_access_bearer_or_ue_context_release(enb_ue);
}

Expand Down

0 comments on commit c920f53

Please sign in to comment.