Separate F1 Setup Request and network configuration
This branch series implements the usage of the F1 Setup Request internally at the gNB, even if CU and DU run in the same process. Until now, the F1 Setup Request contained struct fields to pass IP configuration to the F1AP module; this information is not necessary in monolithic, nor should it be relevant when passing the information in F1 Setup Request. Therefore, this commit moves all IP connection-related information out of the F1 Setup Request and into a separate structure instead. In order to give the F1AP module the necessary connection information, the DU_REGISTER_REQ message is introduced that combines the F1 Setup Request and IP configuration, such that the F1AP module can setup the SCTP connection and then send the F1 Setup Request message. In a later commit, there will be a callback for F1 Setup Request at MAC to simply register the DU at the CU. The monolithic callback will simply forward the F1 Setup Request The F1AP callback will look up the IP configuration and create DU_REGISTER_REQ message containing IP configuration and F1 Setup Request, which is then handled by the F1AP module. To this end, a separate function in gnb_config.c allows to read IP information from configuration.
This commit is contained in:
@@ -40,8 +40,9 @@
|
||||
//Fixme: Uniq dirty DU instance, by global var, datamodel need better management
|
||||
instance_t DUuniqInstance=0;
|
||||
|
||||
void du_task_send_sctp_association_req(instance_t instance, f1ap_setup_req_t *f1ap_setup_req) {
|
||||
DevAssert(f1ap_setup_req != NULL);
|
||||
void du_task_send_sctp_association_req(instance_t instance, f1ap_net_config_t *nc)
|
||||
{
|
||||
DevAssert(nc != NULL);
|
||||
MessageDef *message_p = NULL;
|
||||
sctp_new_association_req_t *sctp_new_association_req_p = NULL;
|
||||
message_p = itti_alloc_new_message(TASK_DU_F1, 0, SCTP_NEW_ASSOCIATION_REQ);
|
||||
@@ -49,19 +50,13 @@ void du_task_send_sctp_association_req(instance_t instance, f1ap_setup_req_t *f1
|
||||
sctp_new_association_req_p->ulp_cnx_id = instance;
|
||||
sctp_new_association_req_p->port = F1AP_PORT_NUMBER;
|
||||
sctp_new_association_req_p->ppid = F1AP_SCTP_PPID;
|
||||
sctp_new_association_req_p->in_streams = f1ap_setup_req->sctp_in_streams;
|
||||
sctp_new_association_req_p->out_streams = f1ap_setup_req->sctp_out_streams;
|
||||
sctp_new_association_req_p->in_streams = 2; //du_inst->sctp_in_streams;
|
||||
sctp_new_association_req_p->out_streams = 2; //du_inst->sctp_out_streams;
|
||||
// remote
|
||||
memcpy(&sctp_new_association_req_p->remote_address,
|
||||
&f1ap_setup_req->CU_f1_ip_address,
|
||||
sizeof(f1ap_setup_req->CU_f1_ip_address));
|
||||
memcpy(&sctp_new_association_req_p->remote_address, &nc->CU_f1_ip_address, sizeof(nc->CU_f1_ip_address));
|
||||
// local
|
||||
memcpy(&sctp_new_association_req_p->local_address,
|
||||
&f1ap_setup_req->DU_f1_ip_address,
|
||||
sizeof(f1ap_setup_req->DU_f1_ip_address));
|
||||
//printf("sib itti message %s\n", f1ap_setup_req_t->sib1[0]);
|
||||
//printf("nr_cellid : %llx (%lld)",f1ap_setup_req->nr_cellid[0],f1ap_setup_req->nr_cellid[0]);
|
||||
//du_f1ap_register_to_sctp
|
||||
memcpy(&sctp_new_association_req_p->local_address, &nc->DU_f1_ip_address, sizeof(nc->DU_f1_ip_address));
|
||||
// du_f1ap_register_to_sctp
|
||||
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
|
||||
}
|
||||
|
||||
@@ -78,12 +73,12 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
|
||||
}
|
||||
|
||||
// save the assoc id
|
||||
f1ap_setup_req_t *f1ap_du_data = &getCxt(instance)->setupReq;
|
||||
f1ap_cudu_inst_t *f1ap_du_data = getCxt(instance);
|
||||
f1ap_du_data->assoc_id = sctp_new_association_resp->assoc_id;
|
||||
f1ap_du_data->sctp_in_streams = sctp_new_association_resp->in_streams;
|
||||
f1ap_du_data->sctp_out_streams = sctp_new_association_resp->out_streams;
|
||||
/* setup parameters for F1U and start the server */
|
||||
DU_send_F1_SETUP_REQUEST(instance, f1ap_du_data);
|
||||
DU_send_F1_SETUP_REQUEST(instance, &f1ap_du_data->setupReq);
|
||||
}
|
||||
|
||||
void du_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind) {
|
||||
@@ -108,14 +103,19 @@ void *F1AP_DU_task(void *arg) {
|
||||
LOG_D(F1AP, "DU Task Received %s for instance %ld\n",
|
||||
ITTI_MSG_NAME(msg),myInstance);
|
||||
switch (ITTI_MSG_ID(msg)) {
|
||||
case F1AP_SETUP_REQ: {
|
||||
case F1AP_SETUP_REQ:
|
||||
AssertFatal(false, "the F1AP_SETUP_REQ should not be received; use the F1AP_DU_REGISTER_REQ instead\n");
|
||||
break;
|
||||
|
||||
case F1AP_DU_REGISTER_REQ: {
|
||||
// this is not a true F1 message, but rather an ITTI message sent by gnb_app
|
||||
// 1. save the itti msg so that you can use it to sen f1ap_setup_req, fill the f1ap_setup_req message,
|
||||
// 2. store the message in f1ap context, that is also stored in RC
|
||||
// 2. send a sctp_association req
|
||||
f1ap_setup_req_t *msgSetup = &F1AP_SETUP_REQ(msg);
|
||||
createF1inst(myInstance, msgSetup);
|
||||
du_task_send_sctp_association_req(myInstance, msgSetup);
|
||||
f1ap_setup_req_t *msgSetup = &F1AP_DU_REGISTER_REQ(msg).setup_req;
|
||||
f1ap_net_config_t *nc = &F1AP_DU_REGISTER_REQ(msg).net_config;
|
||||
createF1inst(myInstance, msgSetup, nc);
|
||||
du_task_send_sctp_association_req(myInstance, nc);
|
||||
} break;
|
||||
|
||||
case F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE:
|
||||
|
||||
Reference in New Issue
Block a user