mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 20:50:28 +00:00
Compare commits
2 Commits
simple-sta
...
IISC_XN_Co
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
00dd7aacec | ||
|
|
719d3988bf |
@@ -1332,7 +1332,7 @@ add_library(e1_if
|
||||
|
||||
target_link_libraries(e1_if PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs asn1_f1ap SECURITY ${OPENSSL_LIBRARIES} e1ap GTPV1U)
|
||||
|
||||
target_link_libraries(L2_NR PRIVATE f1ap x2ap s1ap ngap nr_rrc e1ap nr_rlc nr_common)
|
||||
target_link_libraries(L2_NR PRIVATE f1ap x2ap s1ap ngap nr_rrc e1ap nr_rlc nr_common xnap)
|
||||
if(OAI_AERIAL)
|
||||
target_compile_definitions(L2_NR PRIVATE ENABLE_AERIAL)
|
||||
endif()
|
||||
|
||||
@@ -170,6 +170,7 @@ static const char *const flag_name[] = {FOREACH_FLAG(FLAG_TEXT) ""};
|
||||
COMP_DEF(M2AP, ) \
|
||||
COMP_DEF(M3AP, ) \
|
||||
COMP_DEF(NGAP, ) \
|
||||
COMP_DEF(XNAP, ) \
|
||||
COMP_DEF(GNB_APP, log) \
|
||||
COMP_DEF(NR_RRC, log) \
|
||||
COMP_DEF(NR_MAC, log) \
|
||||
|
||||
@@ -1270,6 +1270,27 @@ ID = LEGACY_E1AP_ERROR
|
||||
GROUP = ALL:LEGACY_E1AP:LEGACY_GROUP_ERROR:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
ID = LEGACY_XNAP_TRACE
|
||||
DESC = XNAP TRACE LEVEL
|
||||
GROUP = ALL:LEGACY_XNAP:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_XNAP_DEBUG
|
||||
DESC = XNAP DEBUG LEVEL
|
||||
GROUP = ALL:LEGACY_XNAP:LEGACY_GROUP_DEBUG:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_XNAP_INFO
|
||||
DESC = XNAP INFO LEVEL
|
||||
GROUP = ALL:LEGACY_XNAP:LEGACY_GROUP_INFO:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_XNAP_WARNING
|
||||
DESC = XNAP WARNING LEVEL
|
||||
GROUP = ALL:LEGACY_XNAP:LEGACY_GROUP_WARNING:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_XNAP_ERROR
|
||||
DESC = XNAP ERROR LEVEL
|
||||
GROUP = ALL:LEGACY_XNAP:LEGACY_GROUP_ERROR:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
#################
|
||||
#### UE LOGS ####
|
||||
#################
|
||||
|
||||
@@ -321,6 +321,7 @@ typedef struct {
|
||||
TASK_DEF(TASK_DU_F1, 200) \
|
||||
TASK_DEF(TASK_CUCP_E1, 200) \
|
||||
TASK_DEF(TASK_CUUP_E1, 200) \
|
||||
TASK_DEF(TASK_XNAP, 200) \
|
||||
TASK_DEF(TASK_RRC_NSA_UE, 200) \
|
||||
TASK_DEF(TASK_RRC_NSA_NRUE, 200) \
|
||||
TASK_DEF(TASK_NAS_NRUE, 200) \
|
||||
|
||||
120
openair2/COMMON/xnap_messages_types.h
Normal file
120
openair2/COMMON/xnap_messages_types.h
Normal file
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*! \file xnap_messages_types.h
|
||||
* \author Sreeshma Shiv <sreeshmau@iisc.ac.in>
|
||||
* \date August 2023
|
||||
* \version 1.0
|
||||
*/
|
||||
#ifndef XNAP_MESSAGES_TYPES_H_
|
||||
#define XNAP_MESSAGES_TYPES_H_
|
||||
|
||||
#define XNAP_MAX_NB_GNB_IP_ADDRESS 4
|
||||
#define XNAP_MAX_NB_CELLS 4 //can be changed
|
||||
|
||||
typedef struct xnap_sctp_s {
|
||||
uint16_t sctp_in_streams;
|
||||
uint16_t sctp_out_streams;
|
||||
} xnap_sctp_t;
|
||||
|
||||
typedef struct xnap_net_config_t {
|
||||
uint8_t nb_xn;
|
||||
char* gnb_xn_interface_ip_address;
|
||||
char* target_gnb_xn_ip_address[XNAP_MAX_NB_GNB_IP_ADDRESS];
|
||||
uint32_t gnb_port_for_XNC;
|
||||
xnap_sctp_t sctp_streams;
|
||||
} xnap_net_config_t;
|
||||
|
||||
typedef struct xnap_plmn_t {
|
||||
uint16_t mcc;
|
||||
uint16_t mnc;
|
||||
uint8_t mnc_digit_length;
|
||||
} xnap_plmn_t;
|
||||
|
||||
typedef struct xnap_amf_regioninfo_s {
|
||||
xnap_plmn_t plmn;
|
||||
uint8_t amf_region_id;
|
||||
} xnap_amf_regioninfo_t;
|
||||
|
||||
typedef enum xnap_mode_t { XNAP_MODE_TDD = 0, XNAP_MODE_FDD = 1 } xnap_mode_t;
|
||||
|
||||
typedef struct xnap_nr_frequency_info_t {
|
||||
uint32_t arfcn;
|
||||
int band;
|
||||
} xnap_nr_frequency_info_t;
|
||||
|
||||
typedef struct xnap_transmission_bandwidth_t {
|
||||
uint8_t scs;
|
||||
uint16_t nrb;
|
||||
} xnap_transmission_bandwidth_t;
|
||||
|
||||
typedef struct xnap_fdd_info_t {
|
||||
xnap_nr_frequency_info_t ul_freqinfo;
|
||||
xnap_nr_frequency_info_t dl_freqinfo;
|
||||
xnap_transmission_bandwidth_t ul_tbw;
|
||||
xnap_transmission_bandwidth_t dl_tbw;
|
||||
} xnap_fdd_info_t;
|
||||
|
||||
typedef struct xnap_tdd_info_t {
|
||||
xnap_nr_frequency_info_t freqinfo;
|
||||
xnap_transmission_bandwidth_t tbw;
|
||||
} xnap_tdd_info_t;
|
||||
|
||||
typedef struct xnap_snssai_s {
|
||||
uint8_t sst;
|
||||
uint8_t sd;
|
||||
} xnap_snssai_t;
|
||||
|
||||
typedef struct xnap_served_cell_info_t {
|
||||
// NR CGI
|
||||
xnap_plmn_t plmn;
|
||||
uint64_t nr_cellid; // NR Global Cell Id
|
||||
uint16_t nr_pci;// NR Physical Cell Ids
|
||||
|
||||
/* Tracking area code */
|
||||
uint32_t tac;
|
||||
|
||||
xnap_mode_t mode;
|
||||
union {
|
||||
xnap_fdd_info_t fdd;
|
||||
xnap_tdd_info_t tdd;
|
||||
};
|
||||
|
||||
uint8_t *measurement_timing_information;
|
||||
} xnap_served_cell_info_t;
|
||||
|
||||
typedef struct xnap_setup_req_s {
|
||||
uint64_t gNB_id;
|
||||
/* Tracking area code */
|
||||
uint16_t num_tai;
|
||||
uint32_t tai_support;
|
||||
xnap_plmn_t plmn_support;
|
||||
// Number of slide support items
|
||||
uint16_t num_snssai;
|
||||
xnap_snssai_t snssai[2];
|
||||
xnap_amf_regioninfo_t amf_region_info;
|
||||
uint8_t num_cells_available;
|
||||
struct {
|
||||
xnap_served_cell_info_t info;
|
||||
} cell[XNAP_MAX_NB_CELLS];
|
||||
} xnap_setup_req_t;
|
||||
|
||||
#endif /* XNAP_MESSAGES_TYPES_H_ */
|
||||
@@ -53,6 +53,8 @@
|
||||
#include "openair2/E1AP/e1ap.h"
|
||||
#include "gnb_config.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "openair2/XNAP/xnap_gNB_task.h"
|
||||
#include "openair2/XNAP/xnap_gNB_management_procedures.h"
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
@@ -144,6 +146,19 @@ void *gNB_app_task(void *args_p)
|
||||
itti_send_msg_to_task(TASK_CUCP_E1, 0, msg);
|
||||
}
|
||||
|
||||
if (node_type == ngran_gNB_CUCP || node_type == ngran_gNB_CU || node_type == ngran_gNB) {
|
||||
if (is_xnap_enabled()) {
|
||||
if (itti_create_task(TASK_XNAP, xnap_task, NULL) < 0) {
|
||||
LOG_E(XNAP, "Create task for XNAP failed\n");
|
||||
}
|
||||
xnap_net_config_t xn_net_config = Read_IPconfig_Xn();
|
||||
createXninst(0, NULL, &xn_net_config);
|
||||
|
||||
} else {
|
||||
LOG_I(XNAP, "XNAP is disabled.\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (node_type == ngran_gNB_CUUP) {
|
||||
AssertFatal(false, "To run CU-UP use executable nr-cuup\n");
|
||||
}
|
||||
|
||||
@@ -2527,6 +2527,44 @@ int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_up
|
||||
return(ret);
|
||||
}
|
||||
|
||||
xnap_net_config_t Read_IPconfig_Xn(void)
|
||||
{
|
||||
xnap_net_config_t nc = {0};
|
||||
paramdef_t XnParamsneighbour[] = Xn_NEIGHBOUR_PARAMS_DESC;
|
||||
paramlist_def_t XnParamneighbourList = {GNB_CONFIG_STRING_TARGET_GNB_Xn_ADDRESS, NULL, 0};
|
||||
paramdef_t SCTPParams[] = GNBSCTPPARAMS_DESC;
|
||||
char aprefix[MAX_OPTNAME_SIZE * 2 + 8];
|
||||
sprintf(aprefix, "%s.[%i].%s", GNB_CONFIG_STRING_GNB_LIST, 0, GNB_CONFIG_STRING_XNAP);
|
||||
config_getlist(config_get_if(), &XnParamneighbourList, XnParamsneighbour, sizeofArray(XnParamsneighbour), aprefix);
|
||||
AssertFatal(XnParamneighbourList.numelt <= XNAP_MAX_NB_GNB_IP_ADDRESS,
|
||||
"value of XnParamList.numelt %d must be lower than XnAP_MAX_NB_GNB_IP_ADDRESS %d value: reconsider to increase "
|
||||
"XNAP_MAX_NB_GNB_IP_ADDRESS\n",
|
||||
XnParamneighbourList.numelt,
|
||||
XNAP_MAX_NB_GNB_IP_ADDRESS);
|
||||
LOG_I(XNAP, "Number of Target gNBs configured: %d\n", XnParamneighbourList.numelt);
|
||||
for (int l = 0; l < XnParamneighbourList.numelt; l++) {
|
||||
nc.nb_xn += 1;
|
||||
nc.target_gnb_xn_ip_address[l] =
|
||||
strdup(*(XnParamneighbourList.paramarray[l][GNB_CONFIG_STRING_TARGET_GNB_Xn_IP_ADDRESS_IDX].strptr));
|
||||
LOG_I(XNAP, "Target gNB %d: %s \n", l + 1, nc.target_gnb_xn_ip_address[l]);
|
||||
}
|
||||
// NETWORK_INTERFACES
|
||||
paramdef_t XnParams[] = XnPARAMS_DESC;
|
||||
config_get(config_get_if(), XnParams, sizeofArray(XnParams), aprefix);
|
||||
nc.gnb_port_for_XNC = (uint32_t) * (XnParams[GNB_CONFIG_STRING_GNB_PORT_FOR_XNC_IDX].uptr);
|
||||
AssertFatal(((XnParams[GNB_CONFIG_STRING_GNB_IP_ADDR_FOR_XNC_IDX].strptr != NULL) && (nc.gnb_port_for_XNC != 0)),
|
||||
"gNB Interface IP/Port not added in the CU/gNB configuration file \n");
|
||||
nc.gnb_xn_interface_ip_address = strdup(*(XnParams[GNB_CONFIG_STRING_GNB_IP_ADDR_FOR_XNC_IDX].strptr));
|
||||
// SCTP SETTING
|
||||
nc.sctp_streams.sctp_out_streams = SCTP_OUT_STREAMS;
|
||||
nc.sctp_streams.sctp_in_streams = SCTP_IN_STREAMS;
|
||||
sprintf(aprefix, "%s.[%i].%s", GNB_CONFIG_STRING_GNB_LIST, 0, GNB_CONFIG_STRING_SCTP_CONFIG);
|
||||
config_get(config_get_if(), SCTPParams, sizeofArray(SCTPParams), aprefix);
|
||||
nc.sctp_streams.sctp_in_streams = (uint16_t) * (SCTPParams[GNB_SCTP_INSTREAMS_IDX].uptr);
|
||||
nc.sctp_streams.sctp_out_streams = (uint16_t) * (SCTPParams[GNB_SCTP_OUTSTREAMS_IDX].uptr);
|
||||
return nc;
|
||||
}
|
||||
|
||||
ngran_node_t get_node_type(void)
|
||||
{
|
||||
paramdef_t MacRLC_Params[] = MACRLCPARAMS_DESC;
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "common/ngran_types.h"
|
||||
#include "f1ap_messages_types.h"
|
||||
#include "intertask_interface.h"
|
||||
#include "xnap_messages_types.h"
|
||||
|
||||
#define IPV4_STR_ADDR_TO_INT_NWBO(AdDr_StR,NwBo,MeSsAgE ) do {\
|
||||
struct in_addr inp;\
|
||||
@@ -105,6 +106,7 @@ f1ap_tdd_info_t read_tdd_config(const NR_ServingCellConfigCommon_t *scc);
|
||||
f1ap_gnb_du_system_info_t *get_sys_info(NR_BCCH_BCH_Message_t *mib, const NR_BCCH_DL_SCH_Message_t *sib1);
|
||||
int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_update_t *gnb_cu_cfg_update);
|
||||
MessageDef *RCconfig_NR_CU_E1(const E1_t *entity);
|
||||
xnap_net_config_t Read_IPconfig_Xn(void);
|
||||
ngran_node_t get_node_type(void);
|
||||
|
||||
#ifdef E2_AGENT
|
||||
|
||||
@@ -541,6 +541,36 @@ typedef enum {
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* Xn configuration parameters section name */
|
||||
#define GNB_CONFIG_STRING_XNAP "XNAP"
|
||||
|
||||
#define GNB_CONFIG_XNAP_ENABLE_IDX 0
|
||||
#define GNB_CONFIG_STRING_GNB_IP_ADDR_FOR_XNC_IDX 1
|
||||
#define GNB_CONFIG_STRING_GNB_PORT_FOR_XNC_IDX 2
|
||||
|
||||
#define GNB_CONFIG_STRING_XNAP_ENABLE "ENABLE_XN"
|
||||
#define GNB_CONFIG_STRING_GNB_IP_ADDR_FOR_XNC "GNB_IP_ADDRESS_FOR_XNC"
|
||||
#define GNB_CONFIG_STRING_GNB_PORT_FOR_XNC "GNB_PORT_FOR_XNC"
|
||||
|
||||
#define XnPARAMS_DESC { \
|
||||
{GNB_CONFIG_STRING_XNAP_ENABLE, NULL , PARAMFLAG_BOOL , .iptr=NULL, .defintval=0, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_GNB_IP_ADDR_FOR_XNC, "interface ip for xnc", 0, .strptr=NULL, .defstrval=NULL, TYPE_STRING, 0},\
|
||||
{GNB_CONFIG_STRING_GNB_PORT_FOR_XNC, NULL, 0, .uptr=NULL, .defintval=0L, TYPE_UINT, 0}, \
|
||||
}
|
||||
|
||||
|
||||
#define GNB_CONFIG_STRING_TARGET_GNB_Xn_ADDRESS "Target_gNB_XN_address"
|
||||
#define GNB_CONFIG_STRING_TARGET_GNB_Xn_IP_ADDRESS "ip"
|
||||
|
||||
#define Xn_NEIGHBOUR_PARAMS_DESC \
|
||||
{\
|
||||
{GNB_CONFIG_STRING_TARGET_GNB_Xn_IP_ADDRESS, "target ip address", 0,.uptr=NULL, .defstrval=NULL, TYPE_STRING, 0}, \
|
||||
}
|
||||
|
||||
#define GNB_CONFIG_STRING_TARGET_GNB_Xn_IP_ADDRESS_IDX 0
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* E1 configuration section */
|
||||
#define GNB_CONFIG_STRING_E1_PARAMETERS "E1_INTERFACE"
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
add_subdirectory(MESSAGES)
|
||||
add_library(xnap xnap_common.c)
|
||||
add_library(xnap xnap_common.c
|
||||
xnap_gNB_task.c
|
||||
xnap_gNB_management_procedures.c)
|
||||
target_link_libraries(xnap
|
||||
PUBLIC asn1_xnap
|
||||
PRIVATE nr_rrc)
|
||||
|
||||
64
openair2/XNAP/xnap_gNB_defs.h
Normal file
64
openair2/XNAP/xnap_gNB_defs.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/* 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 <stdint.h>
|
||||
#include "queue.h"
|
||||
#include "tree.h"
|
||||
#include "sctp_eNB_defs.h"
|
||||
#include "xnap_messages_types.h"
|
||||
|
||||
#ifndef XNAP_GNB_DEFS_H_
|
||||
#define XNAP_GNB_DEFS_H_
|
||||
|
||||
/* This structure describes association of gNBs over Xn */
|
||||
typedef struct xnap_gNB_data_t {
|
||||
/* gNB descriptors tree, ordered by sctp assoc id */
|
||||
RB_ENTRY(xnap_gNB_data_t) entry;
|
||||
char *gNB_name;
|
||||
long nci;
|
||||
/* target gNB ID */
|
||||
uint64_t gNB_id;
|
||||
/* Number of input/ouput streams */
|
||||
uint16_t in_streams;
|
||||
uint16_t out_streams;
|
||||
/* SCTP association id */
|
||||
sctp_assoc_t assoc_id;
|
||||
} xnap_gNB_data_t;
|
||||
|
||||
typedef struct xnap_gNB_instance_s {
|
||||
/* Number of target gNBs requested by gNB (tree size) */
|
||||
uint32_t xn_target_gnb_nb;
|
||||
/* Number of target gNBs for which association is pending */
|
||||
uint32_t xn_target_gnb_pending_nb;
|
||||
/* Number of target gNB successfully associated to gNB */
|
||||
uint32_t xn_target_gnb_associated_nb;
|
||||
/* Tree of XNAP gNB associations ordered by association ID */
|
||||
RB_HEAD(xnap_gnb_tree, xnap_gNB_data_t) xnap_gnbs; // gNBs, indexed by assoc_id
|
||||
size_t num_gnbs;
|
||||
instance_t instance;
|
||||
xnap_setup_req_t setup_req;
|
||||
/* The gNB IP address to bind */
|
||||
xnap_net_config_t net_config;
|
||||
/* SCTP information */
|
||||
xnap_sctp_t sctp_streams;
|
||||
char *gNB_name;
|
||||
} xnap_gNB_instance_t;
|
||||
|
||||
#endif /* XNAP_GNB_DEFS_H_ */
|
||||
55
openair2/XNAP/xnap_gNB_management_procedures.c
Normal file
55
openair2/XNAP/xnap_gNB_management_procedures.c
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 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 <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include "intertask_interface.h"
|
||||
#include "assertions.h"
|
||||
#include "conversions.h"
|
||||
#include "xnap_gNB_defs.h"
|
||||
|
||||
static xnap_gNB_instance_t *xn_inst[NUMBER_OF_gNB_MAX] = {0};
|
||||
|
||||
static int xnap_gNB_compare_assoc_id(const xnap_gNB_data_t *p1, const xnap_gNB_data_t *p2)
|
||||
{
|
||||
if (p1->assoc_id > p2->assoc_id)
|
||||
return 1;
|
||||
if (p1->assoc_id == p2->assoc_id)
|
||||
return 0;
|
||||
return -1; /* p1->assoc_id < p1->assoc_id */
|
||||
}
|
||||
|
||||
RB_GENERATE(xnap_gnb_tree, xnap_gNB_data_t, entry, xnap_gNB_compare_assoc_id);
|
||||
|
||||
static pthread_mutex_t xn_inst_mtx = PTHREAD_MUTEX_INITIALIZER;
|
||||
void createXninst(instance_t instanceP, xnap_setup_req_t *req, xnap_net_config_t *nc)
|
||||
{
|
||||
DevAssert(instanceP == 0);
|
||||
pthread_mutex_lock(&xn_inst_mtx);
|
||||
AssertFatal(xn_inst[0] == NULL, "Attempted to initialize multiple Xn instances\n");
|
||||
xn_inst[0] = calloc(1, sizeof(xnap_gNB_instance_t));
|
||||
AssertFatal(xn_inst[0] != NULL, "out of memory\n");
|
||||
if (req)
|
||||
xn_inst[0]->setup_req = *req;
|
||||
if (nc)
|
||||
xn_inst[0]->net_config = *nc;
|
||||
pthread_mutex_unlock(&xn_inst_mtx);
|
||||
}
|
||||
27
openair2/XNAP/xnap_gNB_management_procedures.h
Normal file
27
openair2/XNAP/xnap_gNB_management_procedures.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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 __XNAP_GNB_MANAGEMENT_PROCEDURES__H__
|
||||
#define __XNAP_GNB_MANAGEMENT_PROCEDURES__H__
|
||||
|
||||
void createXninst(instance_t instanceP, xnap_setup_req_t *req, xnap_net_config_t *nc);
|
||||
|
||||
#endif /* __XNAP_GNB_MANAGEMENT_PROCEDURES__H__ */
|
||||
78
openair2/XNAP/xnap_gNB_task.c
Normal file
78
openair2/XNAP/xnap_gNB_task.c
Normal file
@@ -0,0 +1,78 @@
|
||||
/* 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
|
||||
*/
|
||||
|
||||
/*! \file XNAP/xnap_gNB_task.c
|
||||
* \brief XNAP tasks and functions definitions
|
||||
* \author Sreeshma Shiv
|
||||
* \date Aug 2023
|
||||
* \version 1.0
|
||||
* \email: sreeshmau@iisc.ac.in
|
||||
*/
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <arpa/inet.h>
|
||||
#include "intertask_interface.h"
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
#include "xnap_gNB_task.h"
|
||||
#include "gnb_paramdef.h"
|
||||
#include "common/config/config_userapi.h"
|
||||
|
||||
void *xnap_task(void *arg)
|
||||
{
|
||||
LOG_D(XNAP, "Starting XNAP layer\n");
|
||||
itti_mark_task_ready(TASK_XNAP);
|
||||
|
||||
while (1) {
|
||||
MessageDef *received_msg = NULL;
|
||||
itti_receive_msg(TASK_XNAP, &received_msg);
|
||||
LOG_D(XNAP, "Received message %d:%s\n", ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
|
||||
switch (ITTI_MSG_ID(received_msg)) {
|
||||
case TERMINATE_MESSAGE:
|
||||
LOG_W(XNAP, "Exiting XNAP thread\n");
|
||||
itti_exit_task();
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(XNAP, "Received unhandled message: %d:%s\n", ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
|
||||
break;
|
||||
}
|
||||
|
||||
int result = itti_free(ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
|
||||
AssertFatal(result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
received_msg = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int is_xnap_enabled(void)
|
||||
{
|
||||
int xn_enabled;
|
||||
char xn_path[MAX_OPTNAME_SIZE * 2 + 8];
|
||||
sprintf(xn_path, "%s.[%i].%s", GNB_CONFIG_STRING_GNB_LIST, 0, GNB_CONFIG_STRING_XNAP);
|
||||
paramdef_t Xn_Params[] = XnPARAMS_DESC;
|
||||
config_get(config_get_if(), Xn_Params, sizeofArray(Xn_Params), xn_path);
|
||||
xn_enabled = *(Xn_Params[GNB_CONFIG_XNAP_ENABLE_IDX].iptr);
|
||||
if (xn_enabled) {
|
||||
LOG_I(XNAP, "XNAP enabled\n");
|
||||
}
|
||||
return xn_enabled;
|
||||
}
|
||||
30
openair2/XNAP/xnap_gNB_task.h
Normal file
30
openair2/XNAP/xnap_gNB_task.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/* 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 <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef XNAP_H_
|
||||
#define XNAP_H_
|
||||
|
||||
void *xnap_task(void *arg);
|
||||
int is_xnap_enabled(void);
|
||||
|
||||
#endif /* XNAP_H_ */
|
||||
87
targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-cu.sa.f1.xn.conf
Normal file
87
targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-cu.sa.f1.xn.conf
Normal file
@@ -0,0 +1,87 @@
|
||||
Active_gNBs = ( "gNB-CU-Xn");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
Num_Threads_PUSCH = 8;
|
||||
|
||||
gNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
gNB_ID = 0xe00;
|
||||
|
||||
# cell_type = "CELL_MACRO_GNB";
|
||||
|
||||
gNB_name = "gNB-CU-Xn";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = 1;
|
||||
plmn_list = ({ mcc = 001; mnc = 11; mnc_length = 2; snssaiList = ({ sst = 1, sd = 0xffffff }) });
|
||||
|
||||
|
||||
nr_cellid = 12345670L;
|
||||
|
||||
tr_s_preference = "f1";
|
||||
|
||||
local_s_address = "127.0.0.4";
|
||||
remote_s_address = "127.0.0.3";
|
||||
local_s_portc = 501;
|
||||
local_s_portd = 2153;
|
||||
remote_s_portc = 500;
|
||||
remote_s_portd = 2153;
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
|
||||
////////// AMF parameters:
|
||||
amf_ip_address = ({ ipv4 = "192.168.70.132"; });
|
||||
|
||||
////////// XnAP parameters:
|
||||
XNAP :
|
||||
{
|
||||
ENABLE_XN = 1;
|
||||
GNB_PORT_FOR_XNC = 38422;
|
||||
GNB_IP_ADDRESS_FOR_XNC = "10.32.14.188";
|
||||
Target_gNB_XN_address = ({ ip = "10.32.14.189";});
|
||||
};
|
||||
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
GNB_IPV4_ADDRESS_FOR_NG_AMF = "10.32.14.188";
|
||||
GNB_IPV4_ADDRESS_FOR_NGU = "10.32.14.188";
|
||||
GNB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
security = {
|
||||
# preferred ciphering algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nea0, nea1, nea2, nea3
|
||||
ciphering_algorithms = ( "nea0" );
|
||||
|
||||
# preferred integrity algorithms
|
||||
# the first one of the list that an UE supports in chosen
|
||||
# valid values: nia0, nia1, nia2, nia3
|
||||
integrity_algorithms = ( "nia2", "nia0" );
|
||||
|
||||
# setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
|
||||
# what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
|
||||
drb_ciphering = "yes";
|
||||
drb_integrity = "no";
|
||||
};
|
||||
log_config :
|
||||
{
|
||||
global_log_level = "info";
|
||||
pdcp_log_level = "info";
|
||||
rrc_log_level = "info";
|
||||
f1ap_log_level = "info";
|
||||
ngap_log_level = "info";
|
||||
};
|
||||
Reference in New Issue
Block a user