Commit a1abf90d authored by Guido Casati's avatar Guido Casati

Handle PDU Session Resource to Setup Failure in (PDU Session Resource/Initial...

Handle PDU Session Resource to Setup Failure in (PDU Session Resource/Initial Context) Setup Response

* add function to check whether cu-up is connected
* add functions to send the relevant response messages with the failed list
  e.g. to fill PDU Session Resource Failed to Setup items
* set return value of trigger_bearer_setup to bool and handle the
  failure by sending setup response messages with list of PDU sessions failed to setup
  i.e. send failed list of items when no CU-UP is associated to the CU-CP
  note: it considers all PDU Sessions as failed to setup in the considered failure scenarios
* e.g. send a list of failed PDU session resources in the response message to reject
  PDU Session Resource Setup in rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ
* the Initial Context Setup has a Failure message, but for the considered failure scenario
  when no CU-UP is available the current design is just sending a list of failed to setup
  items in the Response message
* transfer PDU Session Resource/Initial Context Setup Request NAS PDU to UE

closes #878
parent f00a7a01
...@@ -86,6 +86,7 @@ bool ue_associated_to_cuup(const gNB_RRC_INST *rrc, const gNB_RRC_UE_t *ue); ...@@ -86,6 +86,7 @@ bool ue_associated_to_cuup(const gNB_RRC_INST *rrc, const gNB_RRC_UE_t *ue);
sctp_assoc_t get_existing_cuup_for_ue(const gNB_RRC_INST *rrc, const gNB_RRC_UE_t *ue); sctp_assoc_t get_existing_cuup_for_ue(const gNB_RRC_INST *rrc, const gNB_RRC_UE_t *ue);
sctp_assoc_t get_new_cuup_for_ue(const gNB_RRC_INST *rrc, const gNB_RRC_UE_t *ue, int sst, int sd); sctp_assoc_t get_new_cuup_for_ue(const gNB_RRC_INST *rrc, const gNB_RRC_UE_t *ue, int sst, int sd);
int rrc_gNB_process_e1_setup_req(sctp_assoc_t assoc_id, e1ap_setup_req_t *req); int rrc_gNB_process_e1_setup_req(sctp_assoc_t assoc_id, e1ap_setup_req_t *req);
bool is_cuup_associated(gNB_RRC_INST *rrc);
/* Process indication of E1 connection loss on CU-CP */ /* Process indication of E1 connection loss on CU-CP */
void rrc_gNB_process_e1_lost_connection(gNB_RRC_INST *rrc, e1ap_lost_connection_t *lc, sctp_assoc_t assoc_id); void rrc_gNB_process_e1_lost_connection(gNB_RRC_INST *rrc, e1ap_lost_connection_t *lc, sctp_assoc_t assoc_id);
...@@ -104,7 +105,8 @@ void ue_cxt_mod_direct(MessageDef *msg, ...@@ -104,7 +105,8 @@ void ue_cxt_mod_direct(MessageDef *msg,
void prepare_and_send_ue_context_modification_f1(rrc_gNB_ue_context_t *ue_context_p, void prepare_and_send_ue_context_modification_f1(rrc_gNB_ue_context_t *ue_context_p,
e1ap_bearer_setup_resp_t *e1ap_resp); e1ap_bearer_setup_resp_t *e1ap_resp);
void trigger_bearer_setup(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, int n, pdusession_t *sessions, uint64_t ueAggMaxBitRateDownlink); bool trigger_bearer_setup(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, int n, pdusession_t *sessions, uint64_t ueAggMaxBitRateDownlink)
__attribute__((warn_unused_result));
int rrc_gNB_generate_pcch_msg(sctp_assoc_t assoc_id, const NR_SIB1_t *sib, uint32_t tmsi, uint8_t paging_drx); int rrc_gNB_generate_pcch_msg(sctp_assoc_t assoc_id, const NR_SIB1_t *sib, uint32_t tmsi, uint8_t paging_drx);
......
...@@ -1403,6 +1403,14 @@ static int handle_rrcReestablishmentComplete(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE ...@@ -1403,6 +1403,14 @@ static int handle_rrcReestablishmentComplete(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE
return 0; return 0;
} }
/**
* @brief Forward stored NAS PDU to UE (3GPP TS 38.413)
* - 8.2.1.2: If the NAS-PDU IE is included in the PDU SESSION RESOURCE SETUP REQUEST message,
* the NG-RAN node shall pass it to the UE.
* - 8.3.1.2: If the NAS-PDU IE is included in the INITIAL CONTEXT SETUP REQUEST message,
* the NG-RAN node shall pass it transparently towards the UE.
* - 8.6.2: The NAS-PDU IE contains an AMF–UE message that is transferred without interpretation in the NG-RAN node.
*/
void rrc_forward_ue_nas_message(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE) void rrc_forward_ue_nas_message(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE)
{ {
if (UE->nas_pdu.buffer == NULL || UE->nas_pdu.length == 0) if (UE->nas_pdu.buffer == NULL || UE->nas_pdu.length == 0)
...@@ -1523,7 +1531,12 @@ static void handle_ueCapabilityInformation(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, ...@@ -1523,7 +1531,12 @@ static void handle_ueCapabilityInformation(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE,
* up security and request capabilities, so trigger PDU sessions now. The * up security and request capabilities, so trigger PDU sessions now. The
* UE NAS message will be forwarded in the corresponding reconfiguration, * UE NAS message will be forwarded in the corresponding reconfiguration,
* the Initial context setup response after reconfiguration complete. */ * the Initial context setup response after reconfiguration complete. */
trigger_bearer_setup(rrc, UE, UE->n_initial_pdu, UE->initial_pdus, 0); if (!trigger_bearer_setup(rrc, UE, UE->n_initial_pdu, UE->initial_pdus, 0)) {
LOG_W(NR_RRC, "Failed to setup bearers for UE %d: send Initial Context Setup Response\n", UE->rrc_ue_id);
rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_RESP(rrc, UE);
rrc_forward_ue_nas_message(rrc, UE);
return;
}
} else { } else {
rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_RESP(rrc, UE); rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_RESP(rrc, UE);
rrc_forward_ue_nas_message(rrc, UE); rrc_forward_ue_nas_message(rrc, UE);
...@@ -1735,7 +1748,11 @@ static int rrc_gNB_decode_dcch(gNB_RRC_INST *rrc, const f1ap_ul_rrc_message_t *m ...@@ -1735,7 +1748,11 @@ static int rrc_gNB_decode_dcch(gNB_RRC_INST *rrc, const f1ap_ul_rrc_message_t *m
* to set up security, so trigger PDU sessions now. The UE NAS * to set up security, so trigger PDU sessions now. The UE NAS
* message will be forwarded in the corresponding reconfiguration, * message will be forwarded in the corresponding reconfiguration,
* the Initial context setup response after reconfiguration complete. */ * the Initial context setup response after reconfiguration complete. */
trigger_bearer_setup(rrc, UE, UE->n_initial_pdu, UE->initial_pdus, 0); if (!trigger_bearer_setup(rrc, UE, UE->n_initial_pdu, UE->initial_pdus, 0)) {
LOG_W(NR_RRC, "Failed to setup bearers for UE %d: send Initial Context Setup Response\n", UE->rrc_ue_id);
rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_RESP(rrc, UE);
rrc_forward_ue_nas_message(rrc, UE);
}
} else { } else {
/* we already have capabilities, and no PDU sessions to setup, ack /* we already have capabilities, and no PDU sessions to setup, ack
* this UE */ * this UE */
......
This diff is collapsed.
...@@ -90,6 +90,16 @@ static const nr_rrc_cuup_container_t *select_cuup_round_robin(size_t n_t, const ...@@ -90,6 +90,16 @@ static const nr_rrc_cuup_container_t *select_cuup_round_robin(size_t n_t, const
return NULL; return NULL;
} }
bool is_cuup_associated(gNB_RRC_INST *rrc)
{
nr_rrc_cuup_container_t *cuup = NULL;
RB_FOREACH(cuup, rrc_cuup_tree, &rrc->cuups) {
return true;
}
LOG_W(NR_RRC, "no CU-UP associated to CU-CP\n");
return false;
}
bool ue_associated_to_cuup(const gNB_RRC_INST *rrc, const gNB_RRC_UE_t *ue) bool ue_associated_to_cuup(const gNB_RRC_INST *rrc, const gNB_RRC_UE_t *ue)
{ {
f1_ue_data_t ue_data = cu_get_f1_ue_data(ue->rrc_ue_id); f1_ue_data_t ue_data = cu_get_f1_ue_data(ue->rrc_ue_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment