Introduce additional option to bind on separate IFs for F1-C/U in DU

After the last commit, it is not possible to bind on separate interfaces
for F1-C and F1-U. In other words, it is for instance not possible to
have the F1-C on one subnet on one physical interface, and F1-U on
another subnet on another physical interface. This commit introduces a
second option MACRLCs.[0].local_n_address_f1u to allow to bind F1-U on
an alternative address; if it is not specified, the interface of F1-C is
reused.

The above only works for the DU; no corresponding option exists for the
CU. For the CU, use separate CU-CP and CU-UP.

Use it in the CI.
This commit is contained in:
Robert Schmidt
2024-04-13 05:14:55 +02:00
parent a193518579
commit e65cb0cf42
9 changed files with 50 additions and 29 deletions
+2 -1
View File
@@ -78,7 +78,8 @@ typedef net_ip_address_t f1ap_net_ip_address_t;
typedef struct f1ap_net_config_t {
f1ap_net_ip_address_t CU_f1_ip_address;
f1ap_net_ip_address_t DU_f1_ip_address;
f1ap_net_ip_address_t DU_f1c_ip_address;
char *DU_f1u_ip_address;
uint16_t CUport;
uint16_t DUport;
} f1ap_net_config_t;
+2 -2
View File
@@ -43,7 +43,7 @@ instance_t DUuniqInstance=0;
static instance_t du_create_gtpu_instance_to_cu(const f1ap_net_config_t *nc)
{
openAddr_t tmp = {0};
strncpy(tmp.originHost, nc->DU_f1_ip_address.ipv4_address, sizeof(tmp.originHost) - 1);
strncpy(tmp.originHost, nc->DU_f1u_ip_address, sizeof(tmp.originHost) - 1);
strncpy(tmp.destinationHost, nc->CU_f1_ip_address.ipv4_address, sizeof(tmp.destinationHost) - 1);
sprintf(tmp.originService, "%d", nc->DUport);
sprintf(tmp.destinationService, "%d", nc->CUport);
@@ -65,7 +65,7 @@ void du_task_send_sctp_association_req(instance_t instance, f1ap_net_config_t *n
// remote
memcpy(&sctp_new_association_req_p->remote_address, &nc->CU_f1_ip_address, sizeof(nc->CU_f1_ip_address));
// local
memcpy(&sctp_new_association_req_p->local_address, &nc->DU_f1_ip_address, sizeof(nc->DU_f1_ip_address));
memcpy(&sctp_new_association_req_p->local_address, &nc->DU_f1c_ip_address, sizeof(nc->DU_f1c_ip_address));
// du_f1ap_register_to_sctp
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
}
@@ -1189,7 +1189,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(sctp_assoc_t assoc_id, f1ap_ue_cont
asn1cCalloc(dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel, gTPTunnel);
/* transportLayerAddress */
struct sockaddr_in addr= {0};
inet_pton(AF_INET, getCxt(0)->net_config.DU_f1_ip_address.ipv4_address, &addr.sin_addr.s_addr);
inet_pton(AF_INET, getCxt(0)->net_config.DU_f1u_ip_address, &addr.sin_addr.s_addr);
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(addr.sin_addr.s_addr, &gTPTunnel->transportLayerAddress);
/* gTP_TEID */
INT32_TO_OCTET_STRING(resp->drbs_to_be_modified[i].up_dl_tnl[j].teid, &gTPTunnel->gTP_TEID);
+4
View File
@@ -41,6 +41,7 @@
#define CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE "tr_n_preference"
#define CONFIG_STRING_MACRLC_LOCAL_N_IF_NAME "local_n_if_name"
#define CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS "local_n_address"
#define CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS_F1U "local_n_address_f1u"
#define CONFIG_STRING_MACRLC_REMOTE_N_ADDRESS "remote_n_address"
#define CONFIG_STRING_MACRLC_LOCAL_N_PORTC "local_n_portc"
#define CONFIG_STRING_MACRLC_REMOTE_N_PORTC "remote_n_portc"
@@ -125,6 +126,7 @@
{CONFIG_STRING_MACRLC_MIN_GRANT_PRB, HLP_MACRLC_MIN_GRANT_PRB, 0, .u8ptr=NULL, .defintval=5, TYPE_UINT8, 0}, \
{CONFIG_STRING_MACRLC_MIN_GRANT_MCS, HLP_MACRLC_MIN_GRANT_MCS, 0, .u8ptr=NULL, .defintval=9, TYPE_UINT8, 0}, \
{CONFIG_STRING_MACRLC_IDENTITY_PM, HLP_MACRLC_IDENTITY_PM, PARAMFLAG_BOOL, .u8ptr=NULL, .defintval=0, TYPE_UINT8, 0}, \
{CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS_F1U, NULL, 0, .strptr=NULL, .defstrval=NULL, TYPE_STRING, 0}, \
}
// clang-format off
@@ -162,6 +164,7 @@
#define MACRLC_MIN_GRANT_PRB_IDX 31
#define MACRLC_MIN_GRANT_MCS_IDX 32
#define MACRLC_IDENTITY_PM_IDX 33
#define MACRLC_LOCAL_N_ADDRESS_F1U_IDX 34
#define MACRLCPARAMS_CHECK { \
{ .s5 = { NULL } }, \
@@ -198,6 +201,7 @@
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s2 = { NULL } }, \
{ .s5 = { NULL } }, \
}
/*---------------------------------------------------------------------------------------------------------------------------------------------------------*/
+4 -1
View File
@@ -1279,7 +1279,10 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg)
|| strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "cudu") == 0) {
printf("Configuring F1 interfaces for MACRLC\n");
RC.nrmac[j]->eth_params_n.local_if_name = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_IF_NAME_IDX].strptr));
RC.nrmac[j]->eth_params_n.my_addr = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_ADDRESS_IDX].strptr));
char **f1caddr = MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_ADDRESS_IDX].strptr;
RC.nrmac[j]->eth_params_n.my_addr = strdup(*f1caddr);
char **f1uaddr = MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_ADDRESS_F1U_IDX].strptr;
RC.nrmac[j]->f1u_addr = f1uaddr != NULL ? strdup(*f1uaddr) : strdup(*f1caddr);
RC.nrmac[j]->eth_params_n.remote_addr = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_ADDRESS_IDX].strptr));
RC.nrmac[j]->eth_params_n.my_portc = *(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_PORTC_IDX].iptr);
RC.nrmac[j]->eth_params_n.remote_portc = *(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_PORTC_IDX].iptr);
+11 -13
View File
@@ -29,7 +29,7 @@
#include "mac_rrc_ul.h"
static f1ap_net_config_t read_DU_IP_config(const eth_params_t* f1_params)
static f1ap_net_config_t read_DU_IP_config(const eth_params_t* f1_params, const char *f1u_ip_addr)
{
f1ap_net_config_t nc = {0};
@@ -37,19 +37,17 @@ static f1ap_net_config_t read_DU_IP_config(const eth_params_t* f1_params)
nc.CU_f1_ip_address.ipv4 = 1;
strcpy(nc.CU_f1_ip_address.ipv4_address, f1_params->remote_addr);
nc.CUport = f1_params->remote_portd;
LOG_I(GNB_APP,
"FIAP: CU_ip4_address in DU %p, strlen %d\n",
nc.CU_f1_ip_address.ipv4_address,
(int)strlen(f1_params->remote_addr));
nc.DU_f1_ip_address.ipv6 = 0;
nc.DU_f1_ip_address.ipv4 = 1;
strcpy(nc.DU_f1_ip_address.ipv4_address, f1_params->my_addr);
nc.DU_f1c_ip_address.ipv6 = 0;
nc.DU_f1c_ip_address.ipv4 = 1;
strcpy(nc.DU_f1c_ip_address.ipv4_address, f1_params->my_addr);
nc.DU_f1u_ip_address = strdup(f1u_ip_addr);
nc.DUport = f1_params->my_portd;
LOG_I(GNB_APP,
"FIAP: DU_ip4_address in DU %p, strlen %ld\n",
nc.DU_f1_ip_address.ipv4_address,
strlen(f1_params->my_addr));
LOG_I(F1AP,
"F1-C DU IPaddr %s, connect to F1-C CU %s, binding GTP to %s\n",
nc.DU_f1c_ip_address.ipv4_address,
nc.CU_f1_ip_address.ipv4_address,
nc.DU_f1u_ip_address);
// sctp_in_streams/sctp_out_streams are given by SCTP layer
return nc;
@@ -95,7 +93,7 @@ static void f1_setup_request_f1ap(const f1ap_setup_req_t *req)
}
memcpy(f1ap_setup->rrc_ver, req->rrc_ver, sizeof(req->rrc_ver));
F1AP_DU_REGISTER_REQ(msg).net_config = read_DU_IP_config(&RC.nrmac[0]->eth_params_n);
F1AP_DU_REGISTER_REQ(msg).net_config = read_DU_IP_config(&RC.nrmac[0]->eth_params_n, RC.nrmac[0]->f1u_addr);
itti_send_msg_to_task(TASK_DU_F1, 0, msg);
}
+2
View File
@@ -723,6 +723,8 @@ typedef struct f1_config_t {
typedef struct gNB_MAC_INST_s {
/// Ethernet parameters for northbound midhaul interface
eth_params_t eth_params_n;
/// address for F1U to bind, ports in eth_params_n
char *f1u_addr;
/// Ethernet parameters for fronthaul interface
eth_params_t eth_params_s;
/// Module