Skip to content

Commit

Permalink
[AMF/MME] Remove code that doesn't work (open5gs#2013)
Browse files Browse the repository at this point in the history
Based on the standard document below, when the UE is in the IDLE state,
we checked the implicit timer and tried to send a message to the UE,
but it doesn't work properly.

So, first of all, I deleted the related code.

- TS 24.301 Ch 5.3.7
If ISR is not activated, the network behaviour upon expiry of
the mobile reachable timer is network dependent, but typically
the network stops sending paging messages to the UE on the
first expiry, and may take other appropriate actions

- TS 24.501 Ch 5.3.7
The network behaviour upon expiry of the mobile reachable timer is network dependent,
but typically the network stops sending paging messages to the UE on the first expiry,
and may take other appropriate actions.
  • Loading branch information
acetcom committed Jul 23, 2023
1 parent 04d402d commit b08b2ad
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 201 deletions.
6 changes: 0 additions & 6 deletions lib/core/ogs-timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,6 @@ void ogs_timer_stop_debug(ogs_timer_t *timer, const char *file_line)
ogs_rbtree_delete(&manager->tree, timer);
}

bool ogs_timer_running(ogs_timer_t *timer)
{
ogs_assert(timer);
return timer->running;
}

ogs_time_t ogs_timer_mgr_next(ogs_timer_mgr_t *manager)
{
ogs_time_t current;
Expand Down
2 changes: 0 additions & 2 deletions lib/core/ogs-timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ void ogs_timer_start_debug(
ogs_timer_stop_debug(timer, OGS_FILE_LINE)
void ogs_timer_stop_debug(ogs_timer_t *timer, const char *file_line);

bool ogs_timer_running(ogs_timer_t *timer);

ogs_time_t ogs_timer_mgr_next(ogs_timer_mgr_t *manager);
void ogs_timer_mgr_expire(ogs_timer_mgr_t *manager);

Expand Down
50 changes: 20 additions & 30 deletions src/amf/namf-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,23 +274,18 @@ int amf_namf_comm_handle_n1_n2_message_transfer(

sendmsg.http.location = ogs_sbi_server_uri(server, &header);

if (ogs_timer_running(
amf_ue->implicit_deregistration.timer) == true) {
ogs_warn("[%s] Paging failed. Stop", amf_ue->supi);
} else {
/* Store Paging Info */
AMF_SESS_STORE_PAGING_INFO(
sess, sendmsg.http.location,
N1N2MessageTransferReqData->n1n2_failure_txf_notif_uri);
/* Store Paging Info */
AMF_SESS_STORE_PAGING_INFO(
sess, sendmsg.http.location,
N1N2MessageTransferReqData->n1n2_failure_txf_notif_uri);

/* Store N2 Transfer message */
AMF_SESS_STORE_N2_TRANSFER(
sess, pdu_session_resource_setup_request, n2buf);
/* Store N2 Transfer message */
AMF_SESS_STORE_N2_TRANSFER(
sess, pdu_session_resource_setup_request, n2buf);

r = ngap_send_paging(amf_ue);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
}
r = ngap_send_paging(amf_ue);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);

} else if (CM_CONNECTED(amf_ue)) {
r = nas_send_pdu_session_setup_request(sess, NULL, n2buf);
Expand Down Expand Up @@ -341,23 +336,18 @@ int amf_namf_comm_handle_n1_n2_message_transfer(

sendmsg.http.location = ogs_sbi_server_uri(server, &header);

if (ogs_timer_running(
amf_ue->implicit_deregistration.timer) == true) {
ogs_warn("[%s] Paging failed. Stop", amf_ue->supi);
} else {
/* Store Paging Info */
AMF_SESS_STORE_PAGING_INFO(
sess, sendmsg.http.location, NULL);
/* Store Paging Info */
AMF_SESS_STORE_PAGING_INFO(
sess, sendmsg.http.location, NULL);

/* Store 5GSM Message */
AMF_SESS_STORE_5GSM_MESSAGE(sess,
OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND,
n1buf, n2buf);
/* Store 5GSM Message */
AMF_SESS_STORE_5GSM_MESSAGE(sess,
OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND,
n1buf, n2buf);

r = ngap_send_paging(amf_ue);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
}
r = ngap_send_paging(amf_ue);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);

} else if (CM_CONNECTED(amf_ue)) {
r = nas_send_pdu_session_modification_command(sess, n1buf, n2buf);
Expand Down
3 changes: 0 additions & 3 deletions src/amf/ngap-path.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,6 @@ int ngap_send_paging(amf_ue_t *amf_ue)
return OGS_NOTFOUND;
}

ogs_assert(ogs_timer_running(
amf_ue->implicit_deregistration.timer) == false);

ogs_list_for_each(&amf_self()->gnb_list, gnb) {
for (i = 0; i < gnb->num_of_supported_ta_list; i++) {
for (j = 0; j < gnb->supported_ta_list[i].num_of_bplmn_list; j++) {
Expand Down
107 changes: 20 additions & 87 deletions src/mme/mme-s11-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,28 +919,11 @@ void mme_s11_handle_create_bearer_request(

if (OGS_FSM_CHECK(&default_bearer->sm, esm_state_active)) {
if (ECM_IDLE(mme_ue)) {
if (ogs_timer_running(mme_ue->t_implicit_detach.timer)) {
/*
* TS 24.301 5.3.7
* If ISR is not activated, the network behaviour upon expiry of
* the mobile reachable timer is network dependent, but typically
* the network stops sending paging messages to the UE on the
* first expiry, and may take other appropriate actions
*/
ogs_debug("[%s] Paging stopped: Mobile Reachable timer expiry",
mme_ue->imsi_bcd);

ogs_assert(OGS_OK ==
mme_gtp_send_create_bearer_response(
bearer, OGS_GTP2_CAUSE_UNABLE_TO_PAGE_UE));
MME_CLEAR_PAGING_INFO(mme_ue);
} else {
MME_STORE_PAGING_INFO(mme_ue,
MME_PAGING_TYPE_CREATE_BEARER, bearer);
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
}
MME_STORE_PAGING_INFO(mme_ue,
MME_PAGING_TYPE_CREATE_BEARER, bearer);
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
} else {
MME_CLEAR_PAGING_INFO(mme_ue);
r = nas_eps_send_activate_dedicated_bearer_context_request(bearer);
Expand Down Expand Up @@ -1070,28 +1053,11 @@ void mme_s11_handle_update_bearer_request(
if (req->bearer_contexts.bearer_level_qos.presence == 1 ||
req->bearer_contexts.tft.presence == 1) {
if (ECM_IDLE(mme_ue)) {
if (ogs_timer_running(mme_ue->t_implicit_detach.timer)) {
/*
* TS 24.301 5.3.7
* If ISR is not activated, the network behaviour upon expiry of
* the mobile reachable timer is network dependent, but typically
* the network stops sending paging messages to the UE on the
* first expiry, and may take other appropriate actions
*/
ogs_debug("[%s] Paging stopped: Mobile Reachable timer expiry",
mme_ue->imsi_bcd);

ogs_assert(OGS_OK ==
mme_gtp_send_update_bearer_response(
bearer, OGS_GTP2_CAUSE_UNABLE_TO_PAGE_UE));
MME_CLEAR_PAGING_INFO(mme_ue);
} else {
MME_STORE_PAGING_INFO(mme_ue,
MME_PAGING_TYPE_UPDATE_BEARER, bearer);
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
}
MME_STORE_PAGING_INFO(mme_ue,
MME_PAGING_TYPE_UPDATE_BEARER, bearer);
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
} else {
MME_CLEAR_PAGING_INFO(mme_ue);
r = nas_eps_send_modify_bearer_context_request(bearer,
Expand Down Expand Up @@ -1228,28 +1194,11 @@ void mme_s11_handle_delete_bearer_request(
bearer->delete.xact = xact;

if (ECM_IDLE(mme_ue)) {
if (ogs_timer_running(mme_ue->t_implicit_detach.timer)) {
/*
* TS 24.301 5.3.7
* If ISR is not activated, the network behaviour upon expiry of
* the mobile reachable timer is network dependent, but typically
* the network stops sending paging messages to the UE on the
* first expiry, and may take other appropriate actions
*/
ogs_debug("[%s] Paging stopped: Mobile Reachable timer expiry",
mme_ue->imsi_bcd);

ogs_assert(OGS_OK ==
mme_gtp_send_delete_bearer_response(
bearer, OGS_GTP2_CAUSE_UNABLE_TO_PAGE_UE));
MME_CLEAR_PAGING_INFO(mme_ue);
} else {
MME_STORE_PAGING_INFO(mme_ue,
MME_PAGING_TYPE_DELETE_BEARER, bearer);
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
}
MME_STORE_PAGING_INFO(mme_ue,
MME_PAGING_TYPE_DELETE_BEARER, bearer);
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
} else {
MME_CLEAR_PAGING_INFO(mme_ue);
r = nas_eps_send_deactivate_bearer_context_request(bearer);
Expand Down Expand Up @@ -1511,27 +1460,11 @@ void mme_s11_handle_downlink_data_notification(
* before step 9, the MME shall not send S1 interface paging messages
*/
if (ECM_IDLE(mme_ue)) {
if (ogs_timer_running(mme_ue->t_implicit_detach.timer)) {
/*
* TS 24.301 5.3.7
* If ISR is not activated, the network behaviour upon expiry of
* the mobile reachable timer is network dependent, but typically
* the network stops sending paging messages to the UE on the
* first expiry, and may take other appropriate actions
*/
ogs_debug("[%s] Paging stopped: Mobile Reachable timer expiry",
mme_ue->imsi_bcd);
ogs_assert(OGS_OK ==
mme_gtp_send_downlink_data_notification_ack(
bearer, OGS_GTP2_CAUSE_UNABLE_TO_PAGE_UE));
MME_CLEAR_PAGING_INFO(mme_ue);
} else {
MME_STORE_PAGING_INFO(mme_ue,
MME_PAGING_TYPE_DOWNLINK_DATA_NOTIFICATION, bearer);
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
}
MME_STORE_PAGING_INFO(mme_ue,
MME_PAGING_TYPE_DOWNLINK_DATA_NOTIFICATION, bearer);
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
} else if (ECM_CONNECTED(mme_ue)) {
MME_CLEAR_PAGING_INFO(mme_ue);
if (cause_value == OGS_GTP2_CAUSE_ERROR_INDICATION_RECEIVED) {
Expand Down
28 changes: 5 additions & 23 deletions src/mme/mme-s6a-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,29 +261,11 @@ void mme_s6a_handle_clr(mme_ue_t *mme_ue, ogs_diam_s6a_message_t *s6a_message)
* we need to check whether UE is IDLE or not.
*/
if (ECM_IDLE(mme_ue)) {
if (ogs_timer_running(mme_ue->t_implicit_detach.timer)) {
/*
* TS 24.301 5.3.7
* If ISR is not activated, the network behaviour upon expiry of
* the mobile reachable timer is network dependent, but typically
* the network stops sending paging messages to the UE on the
* first expiry, and may take other appropriate actions
*/
ogs_debug("[%s] Paging stopped: Mobile Reachable timer expiry",
mme_ue->imsi_bcd);
if (MME_P_TMSI_IS_AVAILABLE(mme_ue)) {
ogs_assert(OGS_OK == sgsap_send_detach_indication(mme_ue));
} else {
mme_send_delete_session_or_detach(mme_ue);
}
MME_CLEAR_PAGING_INFO(mme_ue);
} else {
MME_STORE_PAGING_INFO(mme_ue,
MME_PAGING_TYPE_DETACH_TO_UE, NULL);
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
}
MME_STORE_PAGING_INFO(mme_ue,
MME_PAGING_TYPE_DETACH_TO_UE, NULL);
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
} else {
MME_CLEAR_PAGING_INFO(mme_ue);
r = nas_eps_send_detach_request(mme_ue);
Expand Down
2 changes: 0 additions & 2 deletions src/mme/s1ap-path.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,6 @@ int s1ap_send_paging(mme_ue_t *mme_ue, S1AP_CNDomain_t cn_domain)
return OGS_NOTFOUND;
}

ogs_assert(ogs_timer_running(mme_ue->t_implicit_detach.timer) == false);

/* Find enB with matched TAI */
ogs_list_for_each(&mme_self()->enb_list, enb) {
for (i = 0; i < enb->num_of_supported_ta_list; i++) {
Expand Down
60 changes: 12 additions & 48 deletions src/mme/sgsap-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,55 +387,19 @@ void sgsap_handle_paging_request(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)

if (ECM_IDLE(mme_ue)) {
if (CS_CALL_SERVICE_INDICATOR(mme_ue)) {
if (ogs_timer_running(mme_ue->t_implicit_detach.timer)) {
/*
* TS 24.301 5.3.7
* If ISR is not activated, the network behaviour upon
* expiry of the mobile reachable timer is network dependent,
* but typically the network stops sending paging messages to
* the UE on the first expiry, and may take other appropriate
* actions
*/
ogs_debug("[%s] Paging stopped: Mobile Reachable timeout",
mme_ue->imsi_bcd);

ogs_assert(OGS_OK ==
sgsap_send_paging_reject(
mme_ue, SGSAP_SGS_CAUSE_UE_UNREACHABLE));
MME_CLEAR_PAGING_INFO(mme_ue);
} else {
/* UE will respond Extended Service Request in PS CNDomain*/
MME_STORE_PAGING_INFO(mme_ue,
MME_PAGING_TYPE_CS_CALL_SERVICE, NULL);
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_cs);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
}
/* UE will respond Extended Service Request in PS CNDomain*/
MME_STORE_PAGING_INFO(mme_ue,
MME_PAGING_TYPE_CS_CALL_SERVICE, NULL);
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_cs);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
} else if (SMS_SERVICE_INDICATOR(mme_ue)) {
if (ogs_timer_running(mme_ue->t_implicit_detach.timer)) {
/*
* TS 24.301 5.3.7
* If ISR is not activated, the network behaviour upon
* expiry of the mobile reachable timer is network dependent,
* but typically the network stops sending paging messages to
* the UE on the first expiry, and may take other appropriate
* actions
*/
ogs_debug("[%s] Paging stopped: Mobile Reachable timer expiry",
mme_ue->imsi_bcd);

ogs_assert(OGS_OK ==
sgsap_send_paging_reject(
mme_ue, SGSAP_SGS_CAUSE_UE_UNREACHABLE));
MME_CLEAR_PAGING_INFO(mme_ue);
} else {
/* UE will respond Service Request in PS CNDomain*/
MME_STORE_PAGING_INFO(mme_ue,
MME_PAGING_TYPE_SMS_SERVICE, NULL);
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
}
/* UE will respond Service Request in PS CNDomain*/
MME_STORE_PAGING_INFO(mme_ue,
MME_PAGING_TYPE_SMS_SERVICE, NULL);
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
} else
goto paging_reject;

Expand Down

0 comments on commit b08b2ad

Please sign in to comment.