Free DU at CU on lost connection, store assoc ID

- store the assoc ID of a UE at the RRC
- if F1 receives an SCTP shutdown, it removes the endpoint
- F1 will also send an "F1 Lost Connection" message to the RRC
- it is not yet possible to reconnect a DU after it had already been
  connected at the CU, since the CU F1AP task will try to rebind GTP,
  which fails
This commit is contained in:
Robert Schmidt
2023-09-22 08:22:15 +02:00
parent 62fd56f904
commit f5c90ead7e
8 changed files with 57 additions and 3 deletions
+10
View File
@@ -63,3 +63,13 @@ void createF1inst(instance_t instanceP, f1ap_setup_req_t *req, f1ap_net_config_t
f1_inst[0]->net_config = *nc;
pthread_mutex_unlock(&f1_inst_mtx);
}
void destroyF1inst(instance_t instance)
{
DevAssert(instance == 0);
pthread_mutex_lock(&f1_inst_mtx);
AssertFatal(f1_inst[0] != NULL, "Attempted to free uninitialized F1 instances\n");
free(f1_inst[instance]);
f1_inst[instance] = NULL;
pthread_mutex_unlock(&f1_inst_mtx);
}
+1
View File
@@ -418,6 +418,7 @@ uint8_t F1AP_get_next_transaction_identifier(instance_t mod_idP, instance_t cu_m
f1ap_cudu_inst_t *getCxt(instance_t instanceP);
void createF1inst(instance_t instanceP, f1ap_setup_req_t *req, f1ap_net_config_t *nc);
void destroyF1inst(instance_t instance);
//lts: C struct type is not homogeneous, so we need macros instead of functions
#define addnRCGI(nRCGi, servedCelL) \
@@ -94,6 +94,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
}
MessageDef *message_p = itti_alloc_new_message(TASK_CU_F1, 0, F1AP_SETUP_REQ);
message_p->ittiMsgHeader.originInstance = assoc_id;
f1ap_setup_req_t *req = &F1AP_SETUP_REQ(message_p);
/* gNB_DU_id */
// this function exits if the ie is mandatory
+12
View File
@@ -71,6 +71,18 @@ static void cu_task_handle_sctp_association_ind(instance_t instance,
static void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp) {
DevAssert(sctp_new_association_resp != NULL);
if (sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN) {
f1ap_cudu_inst_t *f1ap_cu_data = getCxt(instance);
AssertFatal(f1ap_cu_data != NULL, "illegal state: SCTP shutdown for non-existing F1AP endpoint\n");
LOG_I(F1AP, "Received SCTP shutdown for assoc_id %d, removing endpoint\n", sctp_new_association_resp->assoc_id);
destroyF1inst(instance);
/* inform RRC that the DU is gone */
MessageDef *message_p = itti_alloc_new_message(TASK_CU_F1, 0, F1AP_LOST_CONNECTION);
message_p->ittiMsgHeader.originInstance = sctp_new_association_resp->assoc_id;
itti_send_msg_to_task(TASK_RRC_GNB, instance, message_p);
return;
}
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
LOG_W(F1AP, "Received unsuccessful result for SCTP association (%u), instance %ld, cnx_id %u\n",
sctp_new_association_resp->sctp_state,