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 94474b86bfda20ebe5bf9104033eda1c405e69a1..919c1d219f9835d0b6c2f3b866bf96b68db87c3a 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 105530c0baaad6b07a08ad4ed8f95b2c918a2ad1..75d2beed6d09b08511925eb82041869f9ac1a53c 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 f7891902dbe0889349f74f315be2b9a7b11ad651..f773b2dd33104f8eb6f05070cb5cd6658c21fdcb 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 e2c6d7ed0d9a026d062d4a3738a9723355ee9eec..1e3b820fa22f3f96584d8f4bf190ebfb15a56bc5 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 5d73b00e8bb9f1f8c3479a0a4b98a643a758b00b..24b2e639b8b9fe73a8b38650c73a3f81ddb5a36f 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;j<RC.nb_nr_macrlc_inst;j++) - uint64_t id; + uint64_t gnb_du_id = 0; + uint32_t gnb_id = 0; char *name = NULL; f1ap_served_cell_info_t info; - read_du_cell_info(cfg, &id, &name, &info, 1); + read_du_cell_info(cfg, macrlc_has_f1, &gnb_id, &gnb_du_id, &name, &info, 1); if (get_softmodem_params()->sa) 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 dac12ce70e07646ed5e46e19a39c696a0296b06a..faac41fbee619bcb1c5995d9e6166ba6f66f2eef 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 b205abafd0914154a6ea822bed8b0872c6a3b080..26a24c203e060d26a7a1c3168c4b0d6a6e2f4c9d 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 67fa7726dc42225d8d1ef12db1b90e22bba7461a..f3c95f1bc76b47cf804b266d1a05161047c1a204 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";