Skip to content

Commit 41329fa

Browse files
AlaiaLcodebot
authored andcommitted
units: added basic CU-CP unit implementation
1 parent 79f67d7 commit 41329fa

11 files changed

+650
-0
lines changed

apps/units/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
# the distribution.
77
#
88

9+
add_subdirectory(cu_cp)
910
add_subdirectory(flexible_du)

apps/units/cu_cp/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#
2+
# Copyright 2021-2024 Software Radio Systems Limited
3+
#
4+
# By using this file, you agree to the terms and conditions set
5+
# forth in the LICENSE file which can be found at the top level of
6+
# the distribution.
7+
#
8+
9+
set(SOURCES
10+
cu_cp_application_unit_impl.cpp
11+
cu_cp_unit_config_validator.cpp
12+
cu_cp_unit_config_cli11_schema.cpp)
13+
14+
add_library(srsran_cu_cp_app_unit STATIC ${SOURCES})
15+
target_include_directories(srsran_cu_cp_app_unit PRIVATE ${CMAKE_SOURCE_DIR})
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
*
3+
* Copyright 2021-2024 Software Radio Systems Limited
4+
*
5+
* By using this file, you agree to the terms and conditions set
6+
* forth in the LICENSE file which can be found at the top level of
7+
* the distribution.
8+
*
9+
*/
10+
11+
#include "cu_cp_application_unit_impl.h"
12+
#include "cu_cp_logger_registrator.h"
13+
#include "cu_cp_unit_config_cli11_schema.h"
14+
#include "cu_cp_unit_config_validator.h"
15+
16+
using namespace srsran;
17+
18+
void cu_cp_application_unit_impl::on_parsing_configuration_registration(CLI::App& app)
19+
{
20+
configure_cli11_with_cu_cp_unit_config_schema(app, unit_cfg);
21+
}
22+
23+
bool cu_cp_application_unit_impl::on_configuration_validation() const
24+
{
25+
return validate_cu_cp_unit_config(unit_cfg);
26+
}
27+
28+
void cu_cp_application_unit_impl::on_loggers_registration()
29+
{
30+
register_logs(unit_cfg.loggers);
31+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
*
3+
* Copyright 2021-2024 Software Radio Systems Limited
4+
*
5+
* By using this file, you agree to the terms and conditions set
6+
* forth in the LICENSE file which can be found at the top level of
7+
* the distribution.
8+
*
9+
*/
10+
11+
#pragma once
12+
13+
#include "../application_unit.h"
14+
#include "cu_cp_unit_config.h"
15+
16+
namespace srsran {
17+
18+
/// CU-CP application unit implementation.
19+
class cu_cp_application_unit_impl : public application_unit
20+
{
21+
public:
22+
// See interface for documentation.
23+
void on_parsing_configuration_registration(CLI::App& app) override;
24+
25+
// See interface for documentation.
26+
bool on_configuration_validation() const override;
27+
28+
// See interface for documentation.
29+
void on_loggers_registration() override;
30+
31+
private:
32+
cu_cp_unit_config unit_cfg;
33+
};
34+
35+
} // namespace srsran
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
*
3+
* Copyright 2021-2024 Software Radio Systems Limited
4+
*
5+
* By using this file, you agree to the terms and conditions set
6+
* forth in the LICENSE file which can be found at the top level of
7+
* the distribution.
8+
*
9+
*/
10+
11+
#pragma once
12+
13+
#include <string>
14+
15+
namespace srsran {
16+
17+
/// Configuration of logging functionalities.
18+
struct cu_cp_log_unit_config {
19+
std::string cu_level = "warning";
20+
std::string f1ap_level = "warning";
21+
std::string pdcp_level = "warning";
22+
std::string rrc_level = "warning";
23+
std::string ngap_level = "warning";
24+
std::string sec_level = "warning";
25+
/// Maximum number of bytes to write when dumping hex arrays.
26+
int hex_max_size = 0;
27+
/// Enable JSON generation for the F1AP Tx and Rx PDUs.
28+
bool f1ap_json_enabled = false;
29+
};
30+
31+
} // namespace srsran
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
*
3+
* Copyright 2021-2024 Software Radio Systems Limited
4+
*
5+
* By using this file, you agree to the terms and conditions set
6+
* forth in the LICENSE file which can be found at the top level of
7+
* the distribution.
8+
*
9+
*/
10+
11+
#pragma once
12+
13+
#include "cu_cp_log_unit_config.h"
14+
#include "srsran/srslog/srslog.h"
15+
16+
namespace srsran {
17+
18+
/// Registers the CU-CP loggers in the logger service.
19+
inline void register_logs(const cu_cp_log_unit_config& log_cfg)
20+
{
21+
for (const auto& id : {"CU-CP", "CU-UEMNG", "CU-CP-E1"}) {
22+
auto& cu_cp_logger = srslog::fetch_basic_logger(id, false);
23+
cu_cp_logger.set_level(srslog::str_to_basic_level(log_cfg.cu_level));
24+
cu_cp_logger.set_hex_dump_max_size(log_cfg.hex_max_size);
25+
}
26+
27+
auto& pdcp_logger = srslog::fetch_basic_logger("PDCP", false);
28+
pdcp_logger.set_level(srslog::str_to_basic_level(log_cfg.pdcp_level));
29+
pdcp_logger.set_hex_dump_max_size(log_cfg.hex_max_size);
30+
31+
auto& rrc_logger = srslog::fetch_basic_logger("RRC", false);
32+
rrc_logger.set_level(srslog::str_to_basic_level(log_cfg.rrc_level));
33+
rrc_logger.set_hex_dump_max_size(log_cfg.hex_max_size);
34+
35+
auto& cu_f1ap_logger = srslog::fetch_basic_logger("CU-CP-F1", false);
36+
cu_f1ap_logger.set_level(srslog::str_to_basic_level(log_cfg.f1ap_level));
37+
cu_f1ap_logger.set_hex_dump_max_size(log_cfg.hex_max_size);
38+
39+
auto& ngap_logger = srslog::fetch_basic_logger("NGAP", false);
40+
ngap_logger.set_level(srslog::str_to_basic_level(log_cfg.ngap_level));
41+
ngap_logger.set_hex_dump_max_size(log_cfg.hex_max_size);
42+
43+
auto& sec_logger = srslog::fetch_basic_logger("SEC", false);
44+
sec_logger.set_level(srslog::str_to_basic_level(log_cfg.sec_level));
45+
sec_logger.set_hex_dump_max_size(log_cfg.hex_max_size);
46+
}
47+
48+
} // namespace srsran
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
/*
2+
*
3+
* Copyright 2021-2024 Software Radio Systems Limited
4+
*
5+
* By using this file, you agree to the terms and conditions set
6+
* forth in the LICENSE file which can be found at the top level of
7+
* the distribution.
8+
*
9+
*/
10+
11+
#pragma once
12+
13+
#include "cu_cp_log_unit_config.h"
14+
#include "srsran/adt/optional.h"
15+
#include "srsran/ran/gnb_id.h"
16+
#include "srsran/ran/nr_band.h"
17+
#include "srsran/ran/pci.h"
18+
#include <vector>
19+
20+
namespace srsran {
21+
22+
/// Report configuration, for now only supporting the A3 event.
23+
struct cu_cp_report_unit_config {
24+
unsigned report_cfg_id;
25+
std::string report_type;
26+
optional<unsigned> report_interval_ms;
27+
std::string a3_report_type;
28+
optional<int> a3_offset_db; ///< [-30..30] Note the actual value is field value * 0.5 dB. E.g. putting a value of -6
29+
///< here results in -3dB offset.
30+
optional<unsigned> a3_hysteresis_db;
31+
optional<unsigned> a3_time_to_trigger_ms;
32+
};
33+
34+
struct cu_cp_neighbor_cell_unit_config_item {
35+
uint64_t nr_cell_id; ///< Cell id.
36+
std::vector<uint64_t> report_cfg_ids; ///< Report config ids
37+
};
38+
39+
/// Each item describes the relationship between one cell to all other cells.
40+
struct cu_cp_cell_unit_config_item {
41+
uint64_t nr_cell_id; ///< Cell id.
42+
optional<unsigned> periodic_report_cfg_id;
43+
44+
// These parameters must only be set for external cells
45+
// TODO: Add optional SSB parameters.
46+
optional<unsigned> gnb_id_bit_length; ///< gNodeB identifier bit length.
47+
optional<pci_t> pci; ///< PCI.
48+
optional<nr_band> band; ///< NR band.
49+
optional<unsigned> ssb_arfcn; ///< SSB ARFCN.
50+
optional<unsigned> ssb_scs; ///< SSB subcarrier spacing.
51+
optional<unsigned> ssb_period; ///< SSB period.
52+
optional<unsigned> ssb_offset; ///< SSB offset.
53+
optional<unsigned> ssb_duration; ///< SSB duration.
54+
55+
std::vector<cu_cp_neighbor_cell_unit_config_item> ncells; ///< Vector of cells that are a neighbor of this cell.
56+
};
57+
58+
/// All mobility related configuration parameters.
59+
struct mobility_unit_config {
60+
std::vector<cu_cp_cell_unit_config_item> cells; ///< List of all cells known to the CU-CP.
61+
std::vector<cu_cp_report_unit_config> report_configs; ///< Report config.
62+
bool trigger_handover_from_measurements = false; ///< Whether to start HO if neighbor cell measurements arrive.
63+
};
64+
65+
/// RRC specific configuration parameters.
66+
struct rrc_appconfig {
67+
bool force_reestablishment_fallback = false;
68+
unsigned rrc_procedure_timeout_ms = 720; ///< Timeout for RRC procedures (2 * default SRB maxRetxThreshold *
69+
///< t-PollRetransmit = 2 * 8 * 45ms = 720ms, see TS 38.331 Sec 9.2.1).
70+
};
71+
72+
/// Security configuration parameters.
73+
struct security_unit_config {
74+
std::string integrity_protection = "not_needed";
75+
std::string confidentiality_protection = "required";
76+
std::string nea_preference_list = "nea0,nea2,nea1,nea3";
77+
std::string nia_preference_list = "nia2,nia1,nia3";
78+
};
79+
80+
/// F1AP-CU configuration parameters.
81+
struct f1ap_cu_unit_config {
82+
/// Timeout for the UE context setup procedure in milliseconds.
83+
unsigned ue_context_setup_timeout = 1000;
84+
};
85+
86+
/// CU-CP application configuration.
87+
struct cu_cp_unit_config {
88+
// :TODO: not sure if gNB id should be here.
89+
gnb_id_t gnb_id = {411, 22};
90+
// :TODO: AMF should be here too?
91+
uint16_t max_nof_dus = 6;
92+
uint16_t max_nof_cu_ups = 6;
93+
int inactivity_timer = 5; // in seconds
94+
unsigned pdu_session_setup_timeout = 3; // in seconds (must be larger than T310)
95+
mobility_unit_config mobility_config;
96+
rrc_appconfig rrc_config;
97+
security_unit_config security_config;
98+
f1ap_cu_unit_config f1ap_config;
99+
cu_cp_log_unit_config loggers;
100+
};
101+
102+
} // namespace srsran

0 commit comments

Comments
 (0)