From 6f14b11847057fe0e5206ddad448891160a33879 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 22 Nov 2023 10:43:25 +0100 Subject: [PATCH] Introduce separate gNB-DU ID in configuration 3GPP has the concept of a gNB-DU ID and a (separate) gNB ID (for gNB, CU). This commit introduces the gNB-DU as a separate ID that has to be set in the configuration file. It is necessary, as some entities, e.g., the e2 agent, need to signal both IDs, e.g., to reconcile a CU and (multiple) DU(s) belonging together. --- .../gnb-du.band78.106prb.rfsim.conf | 1 + .../gnb-du.sa.band78.106prb.rfsim.conf | 1 + .../gnb-du.sa.band78.106prb.usrpb200.conf | 1 + .../5g_f1_rfsimulator/docker-compose.yaml | 4 +-- openair2/GNB_APP/gnb_config.c | 30 +++++++++++++++---- openair2/GNB_APP/gnb_paramdef.h | 10 ++++++- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 1 + .../PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 1 + 8 files changed, 40 insertions(+), 9 deletions(-) diff --git a/ci-scripts/conf_files/gnb-du.band78.106prb.rfsim.conf b/ci-scripts/conf_files/gnb-du.band78.106prb.rfsim.conf index 94474b86bf..919c1d219f 100644 --- a/ci-scripts/conf_files/gnb-du.band78.106prb.rfsim.conf +++ b/ci-scripts/conf_files/gnb-du.band78.106prb.rfsim.conf @@ -7,6 +7,7 @@ gNBs = { ////////// Identification parameters: gNB_ID = 0xe00; + gNB_DU_ID = 0xe00; # cell_type = "CELL_MACRO_GNB"; diff --git a/ci-scripts/conf_files/gnb-du.sa.band78.106prb.rfsim.conf b/ci-scripts/conf_files/gnb-du.sa.band78.106prb.rfsim.conf index 105530c0ba..75d2beed6d 100644 --- a/ci-scripts/conf_files/gnb-du.sa.band78.106prb.rfsim.conf +++ b/ci-scripts/conf_files/gnb-du.sa.band78.106prb.rfsim.conf @@ -7,6 +7,7 @@ gNBs = { ////////// Identification parameters: gNB_ID = 0xe00; + gNB_DU_ID = 0xe00; # cell_type = "CELL_MACRO_GNB"; diff --git a/ci-scripts/conf_files/gnb-du.sa.band78.106prb.usrpb200.conf b/ci-scripts/conf_files/gnb-du.sa.band78.106prb.usrpb200.conf index f7891902db..f773b2dd33 100644 --- a/ci-scripts/conf_files/gnb-du.sa.band78.106prb.usrpb200.conf +++ b/ci-scripts/conf_files/gnb-du.sa.band78.106prb.usrpb200.conf @@ -7,6 +7,7 @@ gNBs = { ////////// Identification parameters: gNB_ID = 0xe00; + gNB_DU_ID = 0xe00; # cell_type = "CELL_MACRO_GNB"; diff --git a/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml index e2c6d7ed0d..1e3b820fa2 100644 --- a/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml @@ -203,7 +203,7 @@ services: privileged: true container_name: rfsim5g-oai-du2 environment: - USE_ADDITIONAL_OPTIONS: --sa --rfsim --gNBs.[0].gNB_ID 0xe01 --gNBs.[0].nr_cellid 87654321 --gNBs.[0].servingCellConfigCommon.[0].physCellId 1 --MACRLCs.[0].local_n_address 192.168.71.143 --log_config.global_log_options level,nocolor,time + USE_ADDITIONAL_OPTIONS: --sa --rfsim --gNBs.[0].gNB_DU_ID 0xe01 --gNBs.[0].nr_cellid 87654321 --gNBs.[0].servingCellConfigCommon.[0].physCellId 1 --MACRLCs.[0].local_n_address 192.168.71.143 --log_config.global_log_options level,nocolor,time depends_on: - oai-cu networks: @@ -221,7 +221,7 @@ services: privileged: true container_name: rfsim5g-oai-du3 environment: - USE_ADDITIONAL_OPTIONS: --sa --rfsim --gNBs.[0].gNB_ID 0xe02 --gNBs.[0].nr_cellid 11111111 --gNBs.[0].servingCellConfigCommon.[0].physCellId 2 --MACRLCs.[0].local_n_address 192.168.71.144 --log_config.global_log_options level,nocolor,time + USE_ADDITIONAL_OPTIONS: --sa --rfsim --gNBs.[0].gNB_DU_ID 0xe02 --gNBs.[0].nr_cellid 11111111 --gNBs.[0].servingCellConfigCommon.[0].physCellId 2 --MACRLCs.[0].local_n_address 192.168.71.144 --log_config.global_log_options level,nocolor,time depends_on: - oai-cu networks: diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 5d73b00e8b..24b2e639b8 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -1034,7 +1034,9 @@ static NR_ServingCellConfig_t *get_scd_config(configmodule_interface_t *cfg) } static int read_du_cell_info(configmodule_interface_t *cfg, - uint64_t *id, + bool separate_du, + uint32_t *gnb_id, + uint64_t *gnb_du_id, char **name, f1ap_served_cell_info_t *info, int max_cell_info) @@ -1051,7 +1053,11 @@ static int read_du_cell_info(configmodule_interface_t *cfg, // Output a list of all eNBs. config_getlist(cfg, &GNBParamList, GNBParams, sizeof(GNBParams) / sizeof(paramdef_t), NULL); - AssertFatal(GNBParamList.paramarray[0][GNB_GNB_ID_IDX].uptr != NULL, "gNB id %u is not defined in configuration file\n", 0); + + // read the gNB-ID. The DU itself only needs the gNB-DU ID, but some (e.g., + // E2 agent) need the gNB-ID as well if it is running in a separate process + AssertFatal(config_isparamset(GNBParamList.paramarray[0], GNB_GNB_ID_IDX), "%s is not defined in configuration file\n", GNB_CONFIG_STRING_GNB_ID); + *gnb_id = *GNBParamList.paramarray[0][GNB_GNB_ID_IDX].uptr; AssertFatal(strcmp(GNBSParams[GNB_ACTIVE_GNBS_IDX].strlistptr[0], *GNBParamList.paramarray[0][GNB_GNB_NAME_IDX].strptr) == 0, "no active gNB found/mismatch of gNBs: %s vs %s\n", @@ -1068,7 +1074,17 @@ static int read_du_cell_info(configmodule_interface_t *cfg, paramlist_def_t PLMNParamList = {GNB_CONFIG_STRING_PLMN_LIST, NULL, 0}; config_getlist(cfg, &PLMNParamList, PLMNParams, sizeof(PLMNParams) / sizeof(paramdef_t), aprefix); - *id = *(GNBParamList.paramarray[0][GNB_GNB_ID_IDX].uptr); + // if fronthaul is F1, require gNB_DU_ID, else use gNB_ID + if (separate_du) { + AssertFatal(config_isparamset(GNBParamList.paramarray[0], GNB_GNB_DU_ID_IDX), "%s is not defined in configuration file\n", GNB_CONFIG_STRING_GNB_DU_ID); + *gnb_du_id = *GNBParamList.paramarray[0][GNB_GNB_DU_ID_IDX].u64ptr; + } else { + AssertFatal(!config_isparamset(GNBParamList.paramarray[0], GNB_GNB_DU_ID_IDX), + "%s should not be defined in configuration file for monolithic gNB\n", + GNB_CONFIG_STRING_GNB_DU_ID); + *gnb_du_id = *gnb_id; // the gNB-DU ID is equal to the gNB ID, since the config has no gNB-DU ID + } + *name = strdup(*(GNBParamList.paramarray[0][GNB_GNB_NAME_IDX].strptr)); info->tac = malloc(sizeof(*info->tac)); AssertFatal(info->tac != NULL, "out of memory\n"); @@ -1305,10 +1321,11 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg) memcpy(RC.nrmac[j]->ulprbbl, prbbl, 275 * sizeof(prbbl[0])); } // for (j=0;jsa) nr_mac_configure_sib1(RC.nrmac[0], &info.plmn, info.nr_cellid, *info.tac); @@ -1317,9 +1334,10 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg) // and store it at MAC for sending later NR_BCCH_BCH_Message_t *mib = RC.nrmac[0]->common_channels[0].mib; const NR_BCCH_DL_SCH_Message_t *sib1 = RC.nrmac[0]->common_channels[0].sib1; - f1ap_setup_req_t *req = RC_read_F1Setup(id, name, &info, scc, mib, sib1); + f1ap_setup_req_t *req = RC_read_F1Setup(gnb_du_id, name, &info, scc, mib, sib1); AssertFatal(req != NULL, "could not read F1 Setup information\n"); RC.nrmac[0]->f1_config.setup_req = req; + RC.nrmac[0]->f1_config.gnb_id = gnb_id; free(name); /* read_du_cell_info() allocated memory */ diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index dac12ce70e..faac41fbee 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -127,15 +127,19 @@ typedef enum { #define GNB_CONFIG_STRING_UMONDEFAULTDRB "um_on_default_drb" #define GNB_CONFIG_STRING_FORCE256QAMOFF "force_256qam_off" #define GNB_CONFIG_STRING_ENABLE_SDAP "enable_sdap" +#define GNB_CONFIG_STRING_DRBS "drbs" +#define GNB_CONFIG_STRING_GNB_DU_ID "gNB_DU_ID" + #define GNB_CONFIG_HLP_STRING_ENABLE_SDAP "enable the SDAP layer\n" #define GNB_CONFIG_HLP_FORCE256QAMOFF "suppress activation of 256 QAM despite UE support" -#define GNB_CONFIG_STRING_DRBS "drbs" #define GNB_CONFIG_HLP_STRING_DRBS "Number of total DRBs to establish, including the mandatory for PDU SEssion (default=1)\n" +#define GNB_CONFIG_HLP_GNB_DU_ID "defines the gNB-DU ID (only applicable for DU)" /*-----------------------------------------------------------------------------------------------------------------------------------------*/ /* cell configuration parameters */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ /*-----------------------------------------------------------------------------------------------------------------------------------------*/ +// clang-format off #define GNBPARAMS_DESC {\ {GNB_CONFIG_STRING_GNB_ID, NULL, 0, .uptr=NULL, .defintval=0, TYPE_UINT, 0}, \ {GNB_CONFIG_STRING_CELL_TYPE, NULL, 0, .strptr=NULL, .defstrval="CELL_MACRO_GNB", TYPE_STRING, 0}, \ @@ -165,7 +169,10 @@ typedef enum { {GNB_CONFIG_STRING_FORCE256QAMOFF, GNB_CONFIG_HLP_FORCE256QAMOFF, PARAMFLAG_BOOL, .iptr=NULL, .defintval=0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_ENABLE_SDAP, GNB_CONFIG_HLP_STRING_ENABLE_SDAP, PARAMFLAG_BOOL,.iptr=NULL, .defintval=0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_DRBS, GNB_CONFIG_HLP_STRING_DRBS, 0, .iptr=NULL, .defintval=1, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_GNB_DU_ID, GNB_CONFIG_HLP_GNB_DU_ID, 0, .u64ptr=NULL, .defint64val=1, TYPE_UINT64, 0}, \ } +// clang-format on + #define GNB_GNB_ID_IDX 0 #define GNB_CELL_TYPE_IDX 1 @@ -195,6 +202,7 @@ typedef enum { #define GNB_FORCE256QAMOFF_IDX 25 #define GNB_ENABLE_SDAP_IDX 26 #define GNB_DRBS 27 +#define GNB_GNB_DU_ID_IDX 28 #define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD} #define GNBPARAMS_CHECK { \ diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index b205abafd0..26a24c203e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -730,6 +730,7 @@ typedef bool (*nr_pp_impl_ul)(module_id_t mod_id, typedef struct f1_config_t { f1ap_setup_req_t *setup_req; f1ap_setup_resp_t *setup_resp; + uint32_t gnb_id; // associated gNB's ID, not used in DU itself } f1_config_t; /*! \brief top level eNB MAC structure */ diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index 67fa7726dc..f3c95f1bc7 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -7,6 +7,7 @@ gNBs = { ////////// Identification parameters: gNB_ID = 0xe00; + gNB_DU_ID = 0xe00; # cell_type = "CELL_MACRO_GNB";