Skip to content

Commit

Permalink
Update main
Browse files Browse the repository at this point in the history
# Conflicts:
#	tests/unittests/phy/upper/channel_processors/pucch_detector_test_data.tar.gz
#	tests/unittests/phy/upper/signal_processors/srs/srs_estimator_test_data.tar.gz
  • Loading branch information
codebot committed Apr 24, 2024
2 parents 1483bda + 2c979f5 commit a159503
Show file tree
Hide file tree
Showing 193 changed files with 5,998 additions and 2,233 deletions.
2 changes: 1 addition & 1 deletion apps/CMakeLists.txt
Expand Up @@ -20,5 +20,5 @@

add_subdirectory(examples)
add_subdirectory(gnb)
add_subdirectory(modules)
add_subdirectory(units)
add_subdirectory(services)
1 change: 1 addition & 0 deletions apps/gnb/CMakeLists.txt
Expand Up @@ -48,6 +48,7 @@ target_link_libraries(gnb
srsran_version
srsran_build_info
srsran_flexible_du_ru_dynamic
srsran_cu_cp_app_unit
)

if (DPDK_FOUND)
Expand Down
25 changes: 15 additions & 10 deletions apps/gnb/gnb.cpp
Expand Up @@ -56,7 +56,7 @@
#include "apps/services/metrics_hub.h"
#include "apps/services/rlc_metrics_plotter_json.h"

#include "apps/modules/flexible_du/split_ru_dynamic/dynamic_du_factory.h"
#include "apps/units/flexible_du/split_ru_dynamic/dynamic_du_factory.h"
#include "srsran/phy/upper/upper_phy_timing_notifier.h"

#include "srsran/ru/ru_adapters.h"
Expand All @@ -67,16 +67,18 @@

#include "apps/gnb/adapters/e2_gateway_remote_connector.h"
#include "apps/services/e2_metric_connector_manager.h"
#include "apps/units/cu_cp/cu_cp_logger_registrator.h"
#include "apps/units/cu_cp/cu_cp_unit_config_cli11_schema.h"
#include "apps/units/cu_cp/cu_cp_unit_config_validator.h"
#include "srsran/support/sysinfo.h"

#include <atomic>

#include "../modules/cu_cp/logger_registrator.h"
#include "../modules/cu_cp/pcap_factory.h"
#include "../modules/cu_up/logger_registrator.h"
#include "../modules/cu_up/pcap_factory.h"
#include "../modules/flexible_du/du_high/pcap_factory.h"
#include "../modules/flexible_du/split_ru_dynamic/logger_registrator.h"
#include "../units/cu_cp/pcap_factory.h"
#include "../units/cu_up/logger_registrator.h"
#include "../units/cu_up/pcap_factory.h"
#include "../units/flexible_du/du_high/pcap_factory.h"
#include "../units/flexible_du/split_ru_dynamic/logger_registrator.h"

#ifdef DPDK_FOUND
#include "srsran/hal/dpdk/dpdk_eal_factory.h"
Expand Down Expand Up @@ -202,7 +204,6 @@ static void register_app_logs(const log_appconfig& log_cfg)
e2ap_logger.set_hex_dump_max_size(log_cfg.hex_max_size);

// Register the loggers of the modules.
modules::cu_cp::register_logs(log_cfg);
modules::cu_up::register_logs(log_cfg);
modules::flexible_du::split_ru_dynamic::register_logs(log_cfg);
}
Expand All @@ -226,6 +227,9 @@ int main(int argc, char** argv)
// Configure CLI11 with the gNB application configuration schema.
configure_cli11_with_gnb_appconfig_schema(app, gnb_parsed_cfg);

cu_cp_unit_config cu_cp_config;
configure_cli11_with_cu_cp_unit_config_schema(app, cu_cp_config);

// Parse arguments.
CLI11_PARSE(app, argc, argv);

Expand All @@ -235,13 +239,14 @@ int main(int argc, char** argv)
derive_auto_params(gnb_cfg);

// Check the modified configuration.
if (!validate_appconfig(gnb_cfg)) {
if (!validate_appconfig(gnb_cfg) || !validate_cu_cp_unit_config(cu_cp_config)) {
report_error("Invalid configuration detected.\n");
}

// Set up logging.
initialize_log(gnb_cfg.log_cfg.filename);
register_app_logs(gnb_cfg.log_cfg);
register_loggers(cu_cp_config.loggers);

srslog::basic_logger& gnb_logger = srslog::fetch_basic_logger("GNB");
if (not gnb_cfg.log_cfg.tracing_filename.empty()) {
Expand Down Expand Up @@ -357,7 +362,7 @@ int main(int argc, char** argv)
e2_gateway_remote_connector e2_gw{*epoll_broker, e2_du_nw_config, *e2ap_p};

// Create CU-CP config.
srs_cu_cp::cu_cp_configuration cu_cp_cfg = generate_cu_cp_config(gnb_cfg);
srs_cu_cp::cu_cp_configuration cu_cp_cfg = generate_cu_cp_config(gnb_cfg, cu_cp_config);
cu_cp_cfg.cu_cp_executor = workers.cu_cp_exec;
cu_cp_cfg.cu_cp_e2_exec = workers.cu_cp_e2_exec;
cu_cp_cfg.ngap_notifier = ngap_adapter.get();
Expand Down
103 changes: 15 additions & 88 deletions apps/gnb/gnb_appconfig.h
Expand Up @@ -41,7 +41,6 @@
#include "srsran/ran/pucch/pucch_configuration.h"
#include "srsran/ran/pusch/pusch_mcs.h"
#include "srsran/ran/rnti.h"
#include "srsran/ran/s_nssai.h"
#include "srsran/ran/sib/system_info_config.h"
#include "srsran/ran/slot_pdu_capacity_constants.h"
#include "srsran/ran/subcarrier_spacing.h"
Expand Down Expand Up @@ -185,10 +184,14 @@ struct pdsch_appconfig {
std::vector<unsigned> rv_sequence = {0, 2, 3, 1};
/// MCS table to use for PDSCH
pdsch_mcs_table mcs_table = pdsch_mcs_table::qam64;
/// Minimum number of RBs for Resource Allocation of UE PDSCHs.
/// Minimum number of RBs for resource allocation of UE PDSCHs.
unsigned min_rb_size = 1;
/// Maximum number of RBs for Resource Allocation of UE PDSCHs.
/// Maximum number of RBs for resource allocation of UE PDSCHs.
unsigned max_rb_size = MAX_NOF_PRBS;
/// Start RB for resource allocation of UE PDSCHs.
unsigned start_rb = 0;
/// End RB for resource allocation of UE PDSCHs.
unsigned end_rb = MAX_NOF_PRBS;
/// Maximum number of PDSCH grants per slot.
unsigned max_pdschs_per_slot = MAX_PDSCH_PDUS_PER_SLOT;
/// Maximum number of DL or UL PDCCH allocation attempts per slot.
Expand Down Expand Up @@ -271,6 +274,14 @@ struct pusch_appconfig {
float olla_max_snr_offset{5.0};
/// Position for additional DM-RS in UL (see TS 38.211, clause 6.4.1.1.3).
unsigned dmrs_add_pos{2};
/// Minimum number of RBs for resource allocation of UE PUSCHs.
unsigned min_rb_size = 1;
/// Maximum number of RBs for resource allocation of UE PUSCHs.
unsigned max_rb_size = MAX_NOF_PRBS;
/// Start RB for resource allocation of UE PUSCHs.
unsigned start_rb = 0;
/// End RB for resource allocation of UE PUSCHs.
unsigned end_rb = MAX_NOF_PRBS;
};

struct pucch_appconfig {
Expand Down Expand Up @@ -650,6 +661,7 @@ struct amf_appconfig {
std::string n2_bind_interface = "auto";
std::string n3_bind_addr = "auto";
std::string n3_bind_interface = "auto";
std::string n3_ext_addr = "auto";
int sctp_rto_initial = 120;
int sctp_rto_min = 120;
int sctp_rto_max = 500;
Expand All @@ -675,81 +687,6 @@ struct e2_appconfig {
bool e2sm_rc_enabled = false; ///< Whether to enable RC service module
};

struct cu_cp_neighbor_cell_appconfig_item {
uint64_t nr_cell_id; ///< Cell id.
std::vector<uint64_t> report_cfg_ids; ///< Report config ids
};

/// \brief Each item describes the relationship between one cell to all other cells.
struct cu_cp_cell_appconfig_item {
uint64_t nr_cell_id; ///< Cell id.
optional<unsigned> periodic_report_cfg_id;

// These parameters must only be set for external cells
// TODO: Add optional SSB parameters.
optional<unsigned> gnb_id_bit_length; ///< gNodeB identifier bit length.
optional<pci_t> pci; ///< PCI.
optional<nr_band> band; ///< NR band.
optional<unsigned> ssb_arfcn; ///< SSB ARFCN.
optional<unsigned> ssb_scs; ///< SSB subcarrier spacing.
optional<unsigned> ssb_period; ///< SSB period.
optional<unsigned> ssb_offset; ///< SSB offset.
optional<unsigned> ssb_duration; ///< SSB duration.

std::vector<cu_cp_neighbor_cell_appconfig_item> ncells; ///< Vector of cells that are a neighbor of this cell.
};

/// \brief Report configuration, for now only supporting the A3 event.
struct cu_cp_report_appconfig {
unsigned report_cfg_id;
std::string report_type;
optional<unsigned> report_interval_ms;
std::string a3_report_type;
optional<int> a3_offset_db; ///< [-30..30] Note the actual value is field value * 0.5 dB. E.g. putting a value of -6
///< here results in -3dB offset.
optional<unsigned> a3_hysteresis_db;
optional<unsigned> a3_time_to_trigger_ms;
};

/// \brief All mobility related configuration parameters.
struct mobility_appconfig {
std::vector<cu_cp_cell_appconfig_item> cells; ///< List of all cells known to the CU-CP.
std::vector<cu_cp_report_appconfig> report_configs; ///< Report config.
bool trigger_handover_from_measurements = false; ///< Whether to start HO if neighbor cell measurements arrive.
};

/// \brief RRC specific configuration parameters.
struct rrc_appconfig {
bool force_reestablishment_fallback = false;
unsigned rrc_procedure_timeout_ms = 720; ///< Timeout for RRC procedures (2 * default SRB maxRetxThreshold *
///< t-PollRetransmit = 2 * 8 * 45ms = 720ms, see TS 38.331 Sec 9.2.1).
};

/// \brief Security configuration parameters.
struct security_appconfig {
std::string integrity_protection = "not_needed";
std::string confidentiality_protection = "required";
std::string nea_preference_list = "nea0,nea2,nea1,nea3";
std::string nia_preference_list = "nia2,nia1,nia3";
};

/// \brief F1AP-CU configuration parameters.
struct f1ap_cu_appconfig {
/// Timeout for the UE context setup procedure in milliseconds.
unsigned ue_context_setup_timeout = 1000;
};

struct cu_cp_appconfig {
uint16_t max_nof_dus = 6;
uint16_t max_nof_cu_ups = 6;
int inactivity_timer = 120; // in seconds
unsigned pdu_session_setup_timeout = 3; // in seconds (must be larger than T310)
mobility_appconfig mobility_config;
rrc_appconfig rrc_config;
security_appconfig security_config;
f1ap_cu_appconfig f1ap_config;
};

struct cu_up_appconfig {
unsigned gtpu_queue_size = 2048;
unsigned gtpu_reordering_timer_ms = 0;
Expand Down Expand Up @@ -777,11 +714,9 @@ struct log_appconfig {
std::string f1ap_level = "warning";
std::string f1u_level = "warning";
std::string pdcp_level = "warning";
std::string rrc_level = "warning";
std::string ngap_level = "warning";
std::string sdap_level = "warning";
std::string gtpu_level = "warning";
std::string sec_level = "warning";
std::string fapi_level = "warning";
std::string ofh_level = "warning";
std::string e2ap_level = "warning";
Expand Down Expand Up @@ -843,7 +778,6 @@ struct metrics_appconfig {
struct pdcp_metrics {
unsigned report_period = 0; // PDCP report period in ms
} pdcp;
unsigned cu_cp_statistics_report_period = 1; // Statistics report period in seconds
unsigned cu_up_statistics_report_period = 1; // Statistics report period in seconds
/// JSON metrics reporting.
bool enable_json_metrics = false;
Expand Down Expand Up @@ -1258,14 +1192,10 @@ struct gnb_appconfig {
std::string ran_node_name = "srsgnb01";
/// AMF configuration.
amf_appconfig amf_cfg;
/// CU-CP configuration.
cu_cp_appconfig cu_cp_cfg;
/// CU-UP configuration.
cu_up_appconfig cu_up_cfg;
/// DU configuration.
du_appconfig du_cfg;
/// F1AP configuration.
f1ap_cu_appconfig f1ap_cfg;
/// \brief E2 configuration.
e2_appconfig e2_cfg;
/// Radio Unit configuration.
Expand All @@ -1283,9 +1213,6 @@ struct gnb_appconfig {
/// SRB configuration.
std::map<srb_id_t, srb_appconfig> srb_cfg;

/// Network slice configuration.
std::vector<s_nssai_t> slice_cfg = {s_nssai_t{1}};

/// Expert physical layer configuration.
expert_upper_phy_appconfig expert_phy_cfg;

Expand Down

0 comments on commit a159503

Please sign in to comment.