Commit 12e09526 authored by mir's avatar mir

E2AP Version 1,2,3 and KPM version 2, 3

parent 0be397b2
......@@ -289,6 +289,15 @@ add_definitions(-DHAVE_NETINET_IN_H)
set(E2_AGENT "OFF" CACHE STRING "O-RAN-compliant E2 Agent")
set_property(CACHE E2_AGENT PROPERTY STRINGS "ON" "OFF")
set(E2AP_VERSION "E2AP_V2" CACHE STRING "E2AP version")
set_property(CACHE E2AP_VERSION PROPERTY STRINGS "E2AP_V1" "E2AP_V2" "E2AP_V3")
message(STATUS "Selected E2AP_VERSION: ${E2AP_VERSION}")
set(KPM_VERSION "KPM_V2" CACHE STRING "The KPM SM version to use")
set_property(CACHE KPM_VERSION PROPERTY STRINGS "KPM_V2" "KPM_V3")
message(STATUS "Selected KPM Version: ${KPM_VERSION}")
##################################################
# ASN.1 grammar C code generation & dependencies #
##################################################
......@@ -1409,9 +1418,11 @@ add_library(L2
)
target_link_libraries(L2 PRIVATE x2ap s1ap lte_rrc m2ap)
target_link_libraries(L2 PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
if(E2_AGENT)
target_link_libraries(L2 PUBLIC e2_agent e2_ran_func)
target_compile_definitions(L2 PRIVATE E2_AGENT)
target_compile_definitions(L2 PRIVATE ${E2AP_VERSION} ${KPM_VERSION})
endif()
......@@ -1443,6 +1454,7 @@ target_link_libraries(e1_pdcp_if PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
target_link_libraries(L2_NR PRIVATE f1ap x2ap s1ap ngap nr_rrc e1ap nr_rlc)
if(E2_AGENT)
target_link_libraries(L2_NR PUBLIC e2_agent e2_ran_func)
target_compile_definitions(L2_NR PRIVATE ${E2AP_VERSION} ${KPM_VERSION})
target_compile_definitions(L2_NR PRIVATE E2_AGENT)
endif()
......@@ -1965,6 +1977,7 @@ target_link_libraries(lte-softmodem PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
if(E2_AGENT)
target_compile_definitions(lte-softmodem PRIVATE E2_AGENT)
target_compile_definitions(lte-softmodem PRIVATE ${E2AP_VERSION} ${KPM_VERSION})
endif()
add_executable(oairu
......@@ -2061,6 +2074,11 @@ target_link_libraries(nr-softmodem PRIVATE
target_link_libraries(nr-softmodem PRIVATE pthread m CONFIG_LIB rt sctp)
target_link_libraries(nr-softmodem PRIVATE ${T_LIB})
target_link_libraries(nr-softmodem PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
target_link_libraries(nr-softmodem PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
if(E2_AGENT)
target_compile_definitions(nr-softmodem PRIVATE ${E2AP_VERSION} ${KPM_VERSION})
endif()
add_dependencies(nr-softmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc)
......
......@@ -696,10 +696,13 @@ int main( int argc, char **argv ) {
// OAI Wrapper
e2_agent_args_t oai_args = RCconfig_NR_E2agent();
AssertFatal(oai_args.sm_dir != NULL , "Please, specify the directory where the SMs are located in the config file, i.e., e2_agent = {near_ric_ip_addr = \"127.0.0.1\"; sm_dir = \"/usr/local/lib/flexric/\");} ");
AssertFatal(oai_args.sm_dir != NULL , "Please, specify the directory where the SMs are located in the config file, i.e., add in config file the next line: e2_agent = {near_ric_ip_addr = \"127.0.0.1\"; sm_dir = \"/usr/local/lib/flexric/\");} ");
AssertFatal(oai_args.ip != NULL , "Please, specify the IP address of the nearRT-RIC in the config file, i.e., e2_agent = {near_ric_ip_addr = \"127.0.0.1\"; sm_dir = \"/usr/local/lib/flexric/\"");
fr_args_t args = {.ip = oai_args.ip}; // init_fr_args(0, NULL);
printf("After RCconfig_NR_E2agent %s %s \n",oai_args.sm_dir, oai_args.ip );
fr_args_t args = { .ip = oai_args.ip }; // init_fr_args(0, NULL);
memcpy(args.libs_dir, oai_args.sm_dir, 128);
sleep(1);
......@@ -726,6 +729,7 @@ int main( int argc, char **argv ) {
printf("[E2 NODE]: mcc = %d mnc = %d mnc_digit = %d nb_id = %d \n", mcc, mnc, mnc_digit_len, nb_id);
printf("[E2 NODE]: Args %s %s \n", args.ip, args.libs_dir);
init_agent_api(mcc, mnc, mnc_digit_len, nb_id, cu_du_id, node_type, io, &args);
// }
......
......@@ -29,6 +29,9 @@ else()
message(FATAL_ERROR "Unknown building type. Either choose a static or a dynamic library")
endif()
#######
## E2AP encoding and versioning
#######
set(E2AP_ENCODING "ASN" CACHE STRING "The E2AP encoding to use")
set_property(CACHE E2AP_ENCODING PROPERTY STRINGS "ASN" "FLATBUFFERS")
......@@ -76,6 +79,35 @@ set(SM_ENCODING_GTP "PLAIN" CACHE STRING "The GTP SM encoding to use")
set_property(CACHE SM_ENCODING_GTP PROPERTY STRINGS "PLAIN")
message(STATUS "Selected GTP SM_ENCODING: ${SM_ENCODING_GTP}")
if(E2AP_VERSION STREQUAL "E2AP_V1")
add_library(e2ap_ran_func_obj OBJECT
flexric/src/lib/e2ap/v1_01/e2ap_types/common/e2ap_ran_function.c )
add_library(e2ap_plmn_obj OBJECT
flexric/src/lib/e2ap/v1_01/e2ap_types/common/e2ap_plmn.c )
add_library(e2ap_global_node_id_obj OBJECT
flexric/src/lib/e2ap/v1_01/e2ap_types/common/e2ap_global_node_id.c )
elseif(E2AP_VERSION STREQUAL "E2AP_V2")
add_library(e2ap_ran_func_obj OBJECT
flexric/src/lib/e2ap/v2_03/e2ap_types/common/e2ap_ran_function.c )
add_library(e2ap_plmn_obj OBJECT
flexric/src/lib/e2ap/v2_03/e2ap_types/common/e2ap_plmn.c )
add_library(e2ap_global_node_id_obj OBJECT
flexric/src/lib/e2ap/v2_03/e2ap_types/common/e2ap_global_node_id.c )
elseif(E2AP_VERSION STREQUAL "E2AP_V3")
add_library(e2ap_ran_func_obj OBJECT
flexric/src/lib/e2ap/v3_01/e2ap_types/common/e2ap_ran_function.c )
add_library(e2ap_plmn_obj OBJECT
flexric/src/lib/e2ap/v3_01/e2ap_types/common/e2ap_plmn.c )
add_library(e2ap_global_node_id_obj OBJECT
flexric/src/lib/e2ap/v3_01/e2ap_types/common/e2ap_global_node_id.c )
else()
message(FATAL_ERROR "E2AP Unknown version selected")
endif()
########
### Flatbuffer
########
......
......@@ -3,6 +3,8 @@ add_subdirectory(O-RAN)
add_library(e2_ran_func STATIC
init_ran_func.c
read_setup_ran.c
../flexric/test/rnd/fill_rnd_data_e2_setup_req.c
)
target_link_libraries(e2_ran_func
......@@ -10,3 +12,6 @@ target_link_libraries(e2_ran_func
e2_ran_func_cust
e2_ran_func_oran
)
# This dependency sucks! Create pointers and forward declarations!
target_compile_definitions(e2_ran_func PRIVATE ${E2AP_VERSION} ${KPM_VERSION})
......@@ -16,3 +16,5 @@ add_library(e2_ran_func_cust STATIC
)
target_link_libraries(e2_ran_func_cust PUBLIC asn1_nr_rrc nr_rrc asn1_nr_rrc_hdrs)
# This dependency sucks! Create pointers and forward declarations!
target_compile_definitions(e2_ran_func_cust PRIVATE ${E2AP_VERSION} ${KPM_VERSION} )
#include "ran_func_gtp.h"
#include "openair2/E2AP/flexric/test/rnd/fill_rnd_data_gtp.h"
#include <assert.h>
#include "openair2/E2AP/flexric/test/rnd/fill_rnd_data_gtp.h"
#include "common/ran_context.h"
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
#include "openair2/E2AP/flexric/src/util/time_now_us.h"
#include "openair2/RRC/NR/rrc_gNB_UE_context.h"
static
const int mod_id = 0;
......
......@@ -2,10 +2,6 @@
#define RAN_FUNC_SM_GTP_READ_WRITE_AGENT_H
#include "openair2/E2AP/flexric/src/agent/../sm/sm_io.h"
#include "common/ran_context.h"
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
#include "openair2/E2AP/flexric/src/util/time_now_us.h"
#include "openair2/RRC/NR/rrc_gNB_UE_context.h"
void read_gtp_sm(void*);
......
#include "ran_func_pdcp.h"
#include "openair2/E2AP/flexric/test/rnd/fill_rnd_data_pdcp.h"
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include "openair2/E2AP/flexric/test/rnd/fill_rnd_data_pdcp.h"
#include "common/ran_context.h"
#include "openair2/RRC/NR/rrc_gNB_UE_context.h"
#include "openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h"
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
#include "openair2/E2AP/flexric/src/util/time_now_us.h"
static
const int mod_id = 0;
......
......@@ -2,12 +2,6 @@
#define RAN_FUNC_SM_PDCP_READ_WRITE_AGENT_H
#include "openair2/E2AP/flexric/src/agent/../sm/sm_io.h"
#include "common/ran_context.h"
#include "openair2/RRC/NR/rrc_gNB_UE_context.h"
#include "openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h"
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
#include "openair2/E2AP/flexric/src/util/time_now_us.h"
void read_pdcp_sm(void*);
......
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include "ran_func_rlc.h"
#include "common/ran_context.h"
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
#include "openair2/E2AP/flexric/src/util/time_now_us.h"
#include "openair2/E2AP/flexric/test/rnd/fill_rnd_data_rlc.h"
static
......
......@@ -2,11 +2,6 @@
#define RAN_FUNC_SM_RLC_READ_WRITE_AGENT_H
#include "openair2/E2AP/flexric/src/agent/../sm/sm_io.h"
#include "common/ran_context.h"
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
#include "openair2/E2AP/flexric/src/util/time_now_us.h"
void read_rlc_sm(void*);
......
......@@ -7,3 +7,4 @@ add_library(e2_ran_func_oran STATIC
)
target_link_libraries(e2_ran_func_oran PUBLIC asn1_nr_rrc nr_rrc asn1_nr_rrc_hdrs)
target_compile_definitions(e2_ran_func_oran PRIVATE ${E2AP_VERSION} ${KPM_VERSION})
......@@ -20,7 +20,7 @@ typedef struct {
static
matched_ues_mac_t filter_ues_by_s_nssai_in_du_or_monolithic(test_cond_e const * condition, int64_t const value)
matched_ues_mac_t filter_ues_by_s_nssai_in_du_or_monolithic(test_cond_e const condition, int64_t const value)
{
matched_ues_mac_t matched_ues = {.num_ues = 0, .ue_list = calloc(MAX_MOBILES_PER_GNB, sizeof(NR_UE_info_t)) };
assert(matched_ues.ue_list != NULL && "Memory exhausted");
......@@ -37,7 +37,7 @@ matched_ues_mac_t filter_ues_by_s_nssai_in_du_or_monolithic(test_cond_e const *
// Filter connected UEs by S-NSSAI test condition to get list of matched UEs
// note: not possible to filter
switch (*condition)
switch (condition)
{
case EQUAL_TEST_COND:
{
......@@ -73,7 +73,7 @@ typedef struct {
} matched_ues_rrc_t;
static
matched_ues_rrc_t filter_ues_by_s_nssai_in_cu(test_cond_e const * condition, int64_t const value)
matched_ues_rrc_t filter_ues_by_s_nssai_in_cu(test_cond_e const condition, int64_t const value)
{
matched_ues_rrc_t matched_ues = {.num_ues = 0, .rrc_ue_id_list = calloc(MAX_MOBILES_PER_GNB, sizeof(f1_ue_data_t)) };
assert(matched_ues.rrc_ue_id_list != NULL && "Memory exhausted");
......@@ -85,7 +85,7 @@ matched_ues_rrc_t filter_ues_by_s_nssai_in_cu(test_cond_e const * condition, int
ngap_gNB_ue_context_t *ngap_ue_context_list = ngap_get_ue_context(ue_context_p1->ue_context.rrc_ue_id);
// Filter connected UEs by S-NSSAI test condition to get list of matched UEs
switch (*condition)
switch (condition)
{
case EQUAL_TEST_COND:
assert(ngap_ue_context_list->gNB_instance[0].s_nssai[0][0].sST == value && "Please, check the condition for S-NSSAI. At the moment, OAI supports eMBB");
......@@ -104,7 +104,7 @@ matched_ues_rrc_t filter_ues_by_s_nssai_in_cu(test_cond_e const * condition, int
}
static
nr_rlc_statistics_t get_rlc_stats_per_drb(NR_UE_info_t * const UE)
nr_rlc_statistics_t get_rlc_stats_per_drb(NR_UE_info_t const * UE)
{
assert(UE != NULL);
......@@ -195,13 +195,14 @@ gnb_du_e2sm_t fill_gnb_du_data(const f1_ue_data_t * rrc_ue_id)
return gnb_du;
}
uint32_t last_dl_rlc_pdu_total_bytes[MAX_MOBILES_PER_GNB] = {0};
uint32_t last_ul_rlc_pdu_total_bytes[MAX_MOBILES_PER_GNB] = {0};
uint32_t last_dl_total_prbs[MAX_MOBILES_PER_GNB] = {0};
uint32_t last_ul_total_prbs[MAX_MOBILES_PER_GNB] = {0};
uint32_t last_dl_pdcp_sdu_total_bytes[MAX_MOBILES_PER_GNB] = {0};
uint32_t last_ul_pdcp_sdu_total_bytes[MAX_MOBILES_PER_GNB] = {0};
// Bad bad bad. Create a proper exponential moving average filter or at least, only read statistics
// Avoid coupling among sublayers
static uint32_t last_dl_rlc_pdu_total_bytes[MAX_MOBILES_PER_GNB] = {0};
static uint32_t last_ul_rlc_pdu_total_bytes[MAX_MOBILES_PER_GNB] = {0};
static uint32_t last_dl_total_prbs[MAX_MOBILES_PER_GNB] = {0};
static uint32_t last_ul_total_prbs[MAX_MOBILES_PER_GNB] = {0};
static uint32_t last_dl_pdcp_sdu_total_bytes[MAX_MOBILES_PER_GNB] = {0};
static uint32_t last_ul_pdcp_sdu_total_bytes[MAX_MOBILES_PER_GNB] = {0};
static
......@@ -596,18 +597,23 @@ kpm_ind_msg_format_3_t fill_kpm_ind_msg_frm_3_in_monolithic(const matched_ues_ma
msg_frm_3.meas_report_per_ue[i].ind_msg_format_1 = fill_kpm_ind_msg_frm_1_in_monolithic(&matched_ues.ue_list[i], i, rrc_ue_context_list->ue_context.rrc_ue_id, act_def_fr_1);
}
return msg_frm_3;
}
static
kpm_ric_ind_hdr_format_1_t fill_kpm_ind_hdr_frm_1(void)
static
kpm_ric_ind_hdr_format_1_t kpm_ind_hdr_frm_1(void)
{
kpm_ric_ind_hdr_format_1_t hdr_frm_1 = {0};
hdr_frm_1.collectStartTime = time_now_us();
int64_t const t = time_now_us();
#if defined KPM_V2
hdr_frm_1.collectStartTime = t/1000000; // seconds
#elif defined KPM_V3
hdr_frm_1.collectStartTime = t; // microseconds
#else
static_assert(0!=0, "Undefined KPM SM Version");
#endif
hdr_frm_1.fileformat_version = NULL;
// Check E2 Node NG-RAN Type
......@@ -617,7 +623,7 @@ kpm_ric_ind_hdr_format_1_t fill_kpm_ind_hdr_frm_1(void)
hdr_frm_1.sender_name->buf = calloc(strlen("My OAI-DU") + 1, sizeof(char));
memcpy(hdr_frm_1.sender_name->buf, "My OAI-DU", strlen("My OAI-DU"));
hdr_frm_1.sender_name->len = strlen("My OAI-DU");
hdr_frm_1.sender_type = calloc(1, sizeof(byte_array_t));
hdr_frm_1.sender_type->buf = calloc(strlen("DU") + 1, sizeof(char));
memcpy(hdr_frm_1.sender_type->buf, "DU", strlen("DU"));
......@@ -629,7 +635,7 @@ kpm_ric_ind_hdr_format_1_t fill_kpm_ind_hdr_frm_1(void)
hdr_frm_1.sender_name->buf = calloc(strlen("My OAI-CU") + 1, sizeof(char));
memcpy(hdr_frm_1.sender_name->buf, "My OAI-CU", strlen("My OAI-CU"));
hdr_frm_1.sender_name->len = strlen("My OAI-CU");
hdr_frm_1.sender_type = calloc(1, sizeof(byte_array_t));
hdr_frm_1.sender_type->buf = calloc(strlen("CU") + 1, sizeof(char));
memcpy(hdr_frm_1.sender_type->buf, "CU", strlen("CU"));
......@@ -641,14 +647,15 @@ kpm_ric_ind_hdr_format_1_t fill_kpm_ind_hdr_frm_1(void)
hdr_frm_1.sender_name->buf = calloc(strlen("My OAI-MONO") + 1, sizeof(char));
memcpy(hdr_frm_1.sender_name->buf, "My OAI-MONO", strlen("My OAI-MONO"));
hdr_frm_1.sender_name->len = strlen("My OAI-MONO");
hdr_frm_1.sender_type = calloc(1, sizeof(byte_array_t));
hdr_frm_1.sender_type->buf = calloc(strlen("MONO") + 1, sizeof(char));
memcpy(hdr_frm_1.sender_type->buf, "MONO", strlen("MONO"));
hdr_frm_1.sender_type->len = strlen("MONO");
} else {
assert(0!=0 && "Unknown node type");
}
hdr_frm_1.vendor_name = calloc(1, sizeof(byte_array_t));
hdr_frm_1.vendor_name->buf = calloc(strlen("OAI") + 1, sizeof(char));
memcpy(hdr_frm_1.vendor_name->buf, "OAI", strlen("OAI"));
......@@ -657,87 +664,125 @@ kpm_ric_ind_hdr_format_1_t fill_kpm_ind_hdr_frm_1(void)
return hdr_frm_1;
}
static
kpm_ind_hdr_t fill_kpm_ind_hdr(void)
kpm_ind_hdr_t kpm_ind_hdr(void)
{
kpm_ind_hdr_t hdr = {0};
hdr.type = FORMAT_1_INDICATION_HEADER;
hdr.kpm_ric_ind_hdr_format_1 = fill_kpm_ind_hdr_frm_1();
hdr.kpm_ric_ind_hdr_format_1 = kpm_ind_hdr_frm_1();
return hdr;
}
void read_kpm_sm(void* data)
{
assert(data != NULL);
//assert(data->type == KPM_STATS_V3_0);
// assert(data->type == KPM_STATS_V3_0);
kpm_rd_ind_data_t* const kpm = (kpm_rd_ind_data_t*)data;
assert(kpm->act_def!= NULL && "Cannot be NULL");
assert(kpm->act_def != NULL && "Cannot be NULL");
// 7.8 Supported RIC Styles and E2SM IE Formats
// Action Definition Format 4 corresponds to Indication Message Format 3
switch (kpm->act_def->type)
{
case FORMAT_4_ACTION_DEFINITION:
{
kpm->ind.hdr = fill_kpm_ind_hdr();
kpm->ind.msg.type = FORMAT_3_INDICATION_MESSAGE;
// Filter the UE by the test condition criteria
for (size_t i = 0; i<kpm->act_def->frm_4.matching_cond_lst_len; i++)
{
switch (kpm->act_def->frm_4.matching_cond_lst[i].test_info_lst.test_cond_type)
{
case S_NSSAI_TEST_COND_TYPE:
assert(kpm->act_def->frm_4.matching_cond_lst[i].test_info_lst.S_NSSAI == TRUE_TEST_COND_TYPE && "Must be true");
// Check E2 Node NG-RAN Type
if (NODE_IS_DU(RC.nrrrc[0]->node_type))
{
matched_ues_mac_t matched_ues = filter_ues_by_s_nssai_in_du_or_monolithic(kpm->act_def->frm_4.matching_cond_lst[i].test_info_lst.test_cond, *kpm->act_def->frm_4.matching_cond_lst[i].test_info_lst.int_value);
kpm->ind.msg.frm_3 = fill_kpm_ind_msg_frm_3_in_du(matched_ues, &kpm->act_def->frm_4.action_def_format_1);
}
else if (NODE_IS_CU(RC.nrrrc[0]->node_type))
{
matched_ues_rrc_t matched_ues = filter_ues_by_s_nssai_in_cu(kpm->act_def->frm_4.matching_cond_lst[i].test_info_lst.test_cond, *kpm->act_def->frm_4.matching_cond_lst[i].test_info_lst.int_value);
kpm->ind.msg.frm_3 = fill_kpm_ind_msg_frm_3_in_cu(matched_ues, &kpm->act_def->frm_4.action_def_format_1);
}
else if (NODE_IS_MONOLITHIC(RC.nrrrc[0]->node_type))
{
matched_ues_mac_t matched_ues = filter_ues_by_s_nssai_in_du_or_monolithic(kpm->act_def->frm_4.matching_cond_lst[i].test_info_lst.test_cond, *kpm->act_def->frm_4.matching_cond_lst[i].test_info_lst.int_value);
kpm->ind.msg.frm_3 = fill_kpm_ind_msg_frm_3_in_monolithic(matched_ues, &kpm->act_def->frm_4.action_def_format_1);
}
else
{
assert(false && "NG-RAN Type not yet implemented");
switch (kpm->act_def->type) {
case FORMAT_4_ACTION_DEFINITION: {
kpm->ind.hdr = kpm_ind_hdr();
kpm->ind.msg.type = FORMAT_3_INDICATION_MESSAGE;
// Filter the UE by the test condition criteria
kpm_act_def_format_4_t const* frm_4 = &kpm->act_def->frm_4; // 8.2.1.2.4
for (size_t i = 0; i < frm_4->matching_cond_lst_len; i++) {
switch (frm_4->matching_cond_lst[i].test_info_lst.test_cond_type) {
case GBR_TEST_COND_TYPE: {
assert(0 != 0 && "Not implemented");
break;
}
case AMBR_TEST_COND_TYPE: {
assert(0 != 0 && "Not implemented");
break;
}
case IsStat_TEST_COND_TYPE: {
assert(0 != 0 && "Not implemented");
break;
}
case IsCatM_TEST_COND_TYPE: {
assert(0 != 0 && "Not implemented");
break;
}
case DL_RSRP_TEST_COND_TYPE: {
assert(0 != 0 && "Not implemented");
break;
}
case DL_RSRQ_TEST_COND_TYPE: {
assert(0 != 0 && "Not implemented");
break;
}
case UL_RSRP_TEST_COND_TYPE: {
assert(0 != 0 && "Not implemented");
break;
}
case CQI_TEST_COND_TYPE: {
// This is a bad idea. Done only to check FlexRIC xAPP
printf("CQI not implemented!. Randomly filling the data \n");
goto rnd_data_label;
break;
}
case fiveQI_TEST_COND_TYPE: {
assert(0 != 0 && "Not implemented");
break;
}
case QCI_TEST_COND_TYPE: {
;
assert(0 != 0 && "Not implemented");
break;
}
case S_NSSAI_TEST_COND_TYPE: {
assert(frm_4->matching_cond_lst[i].test_info_lst.S_NSSAI == TRUE_TEST_COND_TYPE && "Must be true");
assert(frm_4->matching_cond_lst[i].test_info_lst.test_cond != NULL && "Even though is optional..");
assert(frm_4->matching_cond_lst[i].test_info_lst.int_value != NULL && "Even though is optional..");
test_cond_e const test_cond = *frm_4->matching_cond_lst[i].test_info_lst.test_cond;
int64_t const value = *frm_4->matching_cond_lst[i].test_info_lst.int_value;
// Check E2 Node NG-RAN Type
if (NODE_IS_DU(RC.nrrrc[0]->node_type)) {
matched_ues_mac_t matched_ues = filter_ues_by_s_nssai_in_du_or_monolithic(test_cond, value);
kpm->ind.msg.frm_3 = fill_kpm_ind_msg_frm_3_in_du(matched_ues, &frm_4->action_def_format_1);
} else if (NODE_IS_CU(RC.nrrrc[0]->node_type)) {
matched_ues_rrc_t matched_ues = filter_ues_by_s_nssai_in_cu(test_cond, value);
kpm->ind.msg.frm_3 = fill_kpm_ind_msg_frm_3_in_cu(matched_ues, &frm_4->action_def_format_1);
} else if (NODE_IS_MONOLITHIC(RC.nrrrc[0]->node_type)) {
matched_ues_mac_t matched_ues = filter_ues_by_s_nssai_in_du_or_monolithic(test_cond, value);
kpm->ind.msg.frm_3 = fill_kpm_ind_msg_frm_3_in_monolithic(matched_ues, &frm_4->action_def_format_1);
} else {
assert(false && "NG-RAN Type not implemented");
}
break;
}
default:
assert(false && "Unknown Test condition");
}
break;
default:
assert(false && "Test condition type not yet implemented");
}
break;
}
break;
}
default:
{
kpm->ind.hdr = fill_rnd_kpm_ind_hdr();
kpm->ind.msg = fill_rnd_kpm_ind_msg();
break;
}
default: {
rnd_data_label:
kpm->ind.hdr = fill_rnd_kpm_ind_hdr();
kpm->ind.msg = fill_rnd_kpm_ind_msg();
break;
}
}
}
void read_kpm_setup_sm(void* e2ap)
......
......@@ -2,6 +2,8 @@
#include "../../flexric/test/rnd/fill_rnd_data_rc.h"
#include "../../flexric/src/sm/rc_sm/ie/ir/lst_ran_param.h"
#include "../../flexric/src/sm/rc_sm/ie/ir/ran_param_list.h"
#include "../../flexric/src/agent/e2_agent_api.h"
#include <assert.h>
#include <stdio.h>
#include <pthread.h>
......
#include "init_ran_func.h"
#include "read_setup_ran.h"
#include "../flexric/src/agent/e2_agent_api.h"
#include "CUSTOMIZED/ran_func_mac.h"
#include "CUSTOMIZED/ran_func_rlc.h"
#include "CUSTOMIZED/ran_func_pdcp.h"
......@@ -67,6 +69,10 @@ sm_io_ag_ran_t init_ran_func_ag(void)
init_write_ctrl(&io.write_ctrl_tbl);
init_write_subs(&io.write_subs_tbl);
#if defined(E2AP_V2) || defined(E2AP_V3)
io.read_setup_ran = read_setup_ran;
#endif
return io;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "read_setup_ran.h"
#include "../../E2AP/flexric/src/lib/e2ap/e2ap_node_component_config_add_wrapper.h"
#include "../../E2AP/flexric/test/rnd/fill_rnd_data_e2_setup_req.h"
#include <assert.h>
#include <stdlib.h>
void read_setup_ran(void* data)
{
assert(data != NULL);
#ifdef E2AP_V1
#elif defined(E2AP_V2) || defined(E2AP_V3)
*((e2ap_node_component_config_add_t*)data) = fill_e2ap_node_component_config_add();
#else
static_assert(0!=0, "Unknown E2AP version");
#endif
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef READ_SETUP_RAN_E2_AGENT_H
#define READ_SETUP_RAN_E2_AGENT_H
void read_setup_ran(void* data);
#endif
......@@ -11,7 +11,7 @@ Please see [NOTICE](NOTICE.md) file for third party software that is included in
# Overview
This tutorial describes the steps of deployment 5G OAI RAN, with integrated E2 agent, and FlexRIC, O-RAN compliant nearRT-RIC.
This tutorial describes the steps of deployment 5G OAI RAN, with integrated E2 agent and a nearRT-RIC using O-RAN compliant FlexRIC.
# 1. Installation
......@@ -29,9 +29,10 @@ This tutorial describes the steps of deployment 5G OAI RAN, with integrated E2 a
```bash
git clone https://github.com/swig/swig.git
cd swig
git checkout release-4.1
./autogen.sh
./configure --prefix=/usr/
make
make -j8
make install
```
......@@ -57,12 +58,15 @@ git clone https://gitlab.eurecom.fr/oai/openairinterface5g oai
cd oai/
```
### 2.1.2 Build OAI
### 2.1.2 Build OAI with E2 Agent
- By default, OAI will build the E2 Agent with E2AP v2 and KPM v2. If you want a different version, edit the variable E2AP\_VERSION and KPM\_VERSION at OAI's CMakeLists.txt file.
```bash
cd cmake_targets/
./build_oai -I -w SIMU --gNB --nrUE --build-e2 --ninja
```
If the flexric folder is empty, try manually the following commands
If the openair2/E2AP/flexric folder is empty, try manually the following commands
```bash
git submodule init
......@@ -74,15 +78,18 @@ git submodule update
* `--gNB` is to build the `nr-softmodem` and `nr-cuup` executables and all required shared libraries
* `--nrUE` is to build the `nr-uesoftmodem` executable and all required shared libraries
* `--ninja` is to use the ninja build tool, which speeds up compilation
* `--build-e2` option is to use the E2 agent, integrated within gNB.
* `--build-e2` option is to use the E2 agent, integrated within RAN.
## 2.2 FlexRIC
- By default, FlexRIC will build the nearRT-RIC with E2AP v2 and KPM v2. If you want a different version, edit the variable E2AP\_VERSION and KPM\_VERSION at FlexRIC's CMakeLists.txt file. Note that OAI's and FlexRIC's E2AP\_VERSION and KPM\_VERSION need to match due to O-RAN incompatibilities among versions.
### 2.2.1 Clone the FlexRIC repository
```bash
git clone https://gitlab.eurecom.fr/mosaic5g/flexric flexric
cd flexric/
git checkout 8ee3aca107a9da8ccf425e623bed18cd40a31fa1
git checkout 7a55f02efaa81fe143280ad49b92cfbfc0cd3320
```
### 2.2.2 Build FlexRIC
......@@ -98,7 +105,8 @@ sudo make install
By default the service model libraries will be installed in the path `/usr/local/lib/flexric` while the configuration file in `/usr/local/etc/flexric`.
Available SMs in this version are:
* KPM v03.00 (xapp_kpm_moni)
* KPM v02.03 and KPM v03.00 (xapp_kpm_moni)
* RC v01.03 (xapp_kpm_rc)
* GTP (xapp_gtp_moni)
* MAC + RLC + PDCP (xapp_mac_rlc_pdcp_moni)
......@@ -106,7 +114,7 @@ If you are interested in TC and SLICE SMs, please follow the instructions at htt
# 3. Start the process
In order to configure E2 agent, please, add the following block in the configuration file:
In order to configure E2 agent, please, add the following block in OAI's configuration file:
```bash
e2_agent = {
near_ric_ip_addr = "127.0.0.1";
......
flexric @ 89b28867
Subproject commit 8ee3aca107a9da8ccf425e623bed18cd40a31fa1
Subproject commit 89b2886706d08957749836e590af73bd45184e55
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment