Commit 4e393ef9 authored by Sakthivel Velumani's avatar Sakthivel Velumani

GTP init with only local address

IP traffic works both directions in Mono, F1 and E1
parent ec3bde2c
......@@ -198,10 +198,10 @@ gNBs =
(
{
type = "cp";
ipv4_cucp = "127.0.0.100";
port_cucp = 25;
ipv4_cuup = "127.0.0.101";
port_cuup = 25;
ipv4_cucp = "127.0.0.4";
port_cucp = 2152;
ipv4_cuup = "127.0.0.5";
port_cuup = 2152;
}
)
......
......@@ -197,10 +197,10 @@ gNBs =
(
{
type = "up";
ipv4_cucp = "127.0.0.100";
port_cucp = 25;
ipv4_cuup = "127.0.0.101";
port_cuup = 25;
ipv4_cucp = "127.0.0.4";
port_cucp = 2152;
ipv4_cuup = "127.0.0.5";
port_cuup = 2152;
}
)
......
......@@ -511,20 +511,6 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
/* 12.1.3 uLUPTNLInformation_ToBeSetup_List */
for (int j = 0; j < f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_ul_tnl_length; j++) {
/*Use a dummy teid for the outgoing GTP-U tunnel (DU) which will be updated once we get the UE context setup response from the DU*/
transport_layer_addr_t addr;
int sz=sizeof(f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_dl_tnl[0].tl_address);
memcpy(addr.buffer,&f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_dl_tnl[0].tl_address, sz);
addr.length = sz*8;
f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_ul_tnl[j].teid = newGtpuCreateTunnel(getCxt(CUtype, instance)->gtpInst,
f1ap_ue_context_setup_req->rnti,
f1ap_ue_context_setup_req->drbs_to_be_setup[i].drb_id,
f1ap_ue_context_setup_req->drbs_to_be_setup[i].drb_id,
0xFFFF, // We will set the right value from DU answer
-1, // no qfi
addr,
f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_dl_tnl[0].port,
cu_f1u_data_req,
NULL);
/* 12.3.1 ULTunnels_ToBeSetup_Item */
asn1cSequenceAdd(drbs_toBeSetup_item->uLUPTNLInformation_ToBeSetup_List.list,
F1AP_ULUPTNLInformation_ToBeSetup_Item_t, uLUPTNLInformation_ToBeSetup_Item);
......@@ -700,15 +686,6 @@ int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance,
F1AP_GTPTunnel_t *dl_up_tnl0 = dl_up_tnl_info_p->dLUPTNLInformation.choice.gTPTunnel;
BIT_STRING_TO_TRANSPORT_LAYER_ADDRESS_IPv4(&dl_up_tnl0->transportLayerAddress, drb_p->up_dl_tnl[0].tl_address);
OCTET_STRING_TO_INT32(&dl_up_tnl0->gTP_TEID, drb_p->up_dl_tnl[0].teid);
transport_layer_addr_t addr;
int sz=sizeof(drb_p->up_dl_tnl[0].tl_address);
memcpy(addr.buffer, &drb_p->up_dl_tnl[0].tl_address, sz);
addr.length = sz*8;
GtpuUpdateTunnelOutgoingPair(getCxt(CUtype, instance)->gtpInst,
f1ap_ue_context_setup_resp->rnti,
(ebi_t)drbs_setup_item_p->dRBID,
drb_p->up_dl_tnl[0].teid,
addr);
}
}
......
......@@ -99,9 +99,7 @@ void du_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_dat
static instance_t du_create_gtpu_instance_to_cu(char *CUaddr, uint16_t CUport, char *DUaddr, uint16_t DUport) {
openAddr_t tmp= {0};
strncpy(tmp.originHost, DUaddr, sizeof(tmp.originHost)-1);
strncpy(tmp.destinationHost, CUaddr, sizeof(tmp.destinationHost)-1);
sprintf(tmp.originService, "%d", DUport);
sprintf(tmp.destinationService, "%d", CUport);
return gtpv1Init(tmp);
}
......
......@@ -1250,8 +1250,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
config_security(rrc);
}//End RCconfig_NRRRC function
instance_t RCconfig_nr_gtpu(void) {
static int get_NGU_S1U_addr(char *addr, int *port) {
int num_gnbs = 0;
char* gnb_ipv4_address_for_NGU = NULL;
uint32_t gnb_port_for_NGU = 0;
......@@ -1272,19 +1271,28 @@ instance_t RCconfig_nr_gtpu(void) {
sprintf(gtpupath,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,0,GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
config_get(NETParams,sizeof(NETParams)/sizeof(paramdef_t),gtpupath);
char *cidr=NULL, *address = NULL;
int port;
instance_t ret_inst;
if (NETParams[1].strptr != NULL) {
LOG_I(GTPU, "SA mode \n");
address = strtok_r(gnb_ipv4_address_for_NGU, "/", &cidr);
port=gnb_port_for_NGU;
*port=gnb_port_for_NGU;
} else {
LOG_I(GTPU, "NSA mode \n");
address = strtok_r(gnb_ipv4_address_for_S1U, "/", &cidr);
port=gnb_port_for_S1U;
*port=gnb_port_for_S1U;
}
if (address == NULL) return 1;
else {
strcpy(addr, address);
return 0;
}
}
if (address) {
instance_t RCconfig_nr_gtpu(void) {
char address[160];
int port;
int ret = get_NGU_S1U_addr(address, &port);
instance_t ret_inst;
if (!ret) {
eth_params_t IPaddr;
IPaddr.my_addr = address;
IPaddr.my_portd = port;
......@@ -1840,14 +1848,14 @@ int RCconfig_NR_CU_E1(MessageDef *msg_p, uint32_t i) {
strcpy(e1Setup->CUUP_e1_ip_address.ipv4_address, *(GNBE1ParamList.paramarray[0][GNB_CONFIG_E1_IPV4_ADDRESS_CUUP].strptr));
e1Setup->CUUP_e1_ip_address.ipv4 = 1;
e1Setup->port_cuup = *GNBE1ParamList.paramarray[0][GNB_CONFIG_E1_PORT_CUUP].uptr;
if (!strcmp(*(GNBE1ParamList.paramarray[0][GNB_CONFIG_E1_CU_TYPE_IDX].strptr),
"up")) {
char N3Addr[160];
int N3Port;
if (!get_NGU_S1U_addr(N3Addr, &N3Port)) {;
inet_pton(AF_INET,
*(GNBE1ParamList.paramarray[0][GNB_CONFIG_E1_IPV4_ADDRESS_N3].strptr),
N3Addr,
&e1Setup->IPv4AddressN3);
e1Setup->portN3 = *GNBE1ParamList.paramarray[0][GNB_CONFIG_E1_PORT_N3].uptr;
e1Setup->portN3 = N3Port;
}
e1Setup->cn_support = *GNBE1ParamList.paramarray[0][GNB_CONFIG_E1_CN_SUPPORT].uptr;
}
......
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