Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-RAN
Commits
8e66c6a4
Commit
8e66c6a4
authored
Sep 09, 2021
by
Laurent Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
F1-U development
parent
21a9ca8c
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
176 additions
and
160 deletions
+176
-160
openair2/COMMON/f1ap_messages_types.h
openair2/COMMON/f1ap_messages_types.h
+3
-0
openair2/F1AP/f1ap_common.h
openair2/F1AP/f1ap_common.h
+1
-0
openair2/F1AP/f1ap_cu_task.c
openair2/F1AP/f1ap_cu_task.c
+15
-14
openair2/F1AP/f1ap_cu_ue_context_management.c
openair2/F1AP/f1ap_cu_ue_context_management.c
+22
-1
openair2/F1AP/f1ap_du_task.c
openair2/F1AP/f1ap_du_task.c
+54
-39
openair2/GNB_APP/gnb_app.c
openair2/GNB_APP/gnb_app.c
+0
-2
openair2/GNB_APP/gnb_config.c
openair2/GNB_APP/gnb_config.c
+71
-68
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+8
-33
openair3/ocp-gtpu/gtp_itf.cpp
openair3/ocp-gtpu/gtp_itf.cpp
+2
-3
No files found.
openair2/COMMON/f1ap_messages_types.h
View file @
8e66c6a4
...
...
@@ -108,6 +108,8 @@ typedef struct f1ap_setup_req_s {
/* The eNB IP address to bind */
f1ap_net_ip_address_t
CU_f1_ip_address
;
f1ap_net_ip_address_t
DU_f1_ip_address
;
uint16_t
CUport
;
uint16_t
DUport
;
/* Number of SCTP streams used for a mme association */
uint16_t
sctp_in_streams
;
...
...
@@ -318,6 +320,7 @@ typedef struct f1ap_ul_rrc_message_s {
typedef
struct
f1ap_up_tnl_s
{
in_addr_t
tl_address
;
// currently only IPv4 supported
teid_t
teid
;
uint16_t
port
;
}
f1ap_up_tnl_t
;
typedef
struct
f1ap_drb_to_be_setup_s
{
...
...
openair2/F1AP/f1ap_common.h
View file @
8e66c6a4
...
...
@@ -431,6 +431,7 @@ typedef struct f1ap_cudu_inst_s {
uint16_t
sctp_in_streams
;
uint16_t
sctp_out_streams
;
uint16_t
default_sctp_stream_id
;
instance_t
gtpInst
;
uint64_t
gNB_DU_id
;
uint16_t
num_ues
;
f1ap_cudu_ue_t
f1ap_ue
[
MAX_MOBILES_PER_ENB
];
...
...
openair2/F1AP/f1ap_cu_task.c
View file @
8e66c6a4
...
...
@@ -38,7 +38,17 @@
#include "proto_agent.h"
#include <openair3/ocp-gtpu/gtp_itf.h>
static
void
cu_task_handle_sctp_association_ind
(
instance_t
instance
,
instance_t
gtpuInstance
,
sctp_new_association_ind_t
*
sctp_new_association_ind
)
{
static
instance_t
cu_task_create_gtpu_instance_to_du
(
eth_params_t
*
IPaddrs
)
{
openAddr_t
tmp
=
{
0
};
strncpy
(
tmp
.
originHost
,
IPaddrs
->
my_addr
,
sizeof
(
tmp
.
originHost
)
-
1
);
strncpy
(
tmp
.
destinationHost
,
IPaddrs
->
remote_addr
,
sizeof
(
tmp
.
destinationHost
)
-
1
);
sprintf
(
tmp
.
originService
,
"%d"
,
GTPV1U_UDP_PORT
);
sprintf
(
tmp
.
destinationService
,
"%d"
,
GTPV1U_UDP_PORT
);
return
ocp_gtpv1Init
(
tmp
);
}
static
void
cu_task_handle_sctp_association_ind
(
instance_t
instance
,
sctp_new_association_ind_t
*
sctp_new_association_ind
,
eth_params_t
*
IPaddrs
)
{
createF1inst
(
true
,
instance
,
NULL
);
// save the assoc id
f1ap_setup_req_t
*
f1ap_cu_data
=
f1ap_req
(
true
,
instance
);
...
...
@@ -46,6 +56,8 @@ static void cu_task_handle_sctp_association_ind(instance_t instance,instance_t g
f1ap_cu_data
->
sctp_in_streams
=
sctp_new_association_ind
->
in_streams
;
f1ap_cu_data
->
sctp_out_streams
=
sctp_new_association_ind
->
out_streams
;
f1ap_cu_data
->
default_sctp_stream_id
=
0
;
getCxt
(
true
,
instance
)
->
gtpInst
=
cu_task_create_gtpu_instance_to_du
(
IPaddrs
);
AssertFatal
(
getCxt
(
true
,
instance
)
->
gtpInst
>
0
,
"Failed to create CU F1-U UDP listener"
);
// Nothing
}
...
...
@@ -96,15 +108,6 @@ static void cu_task_send_sctp_init_req(instance_t instance, char * my_addr) {
itti_send_msg_to_task
(
TASK_SCTP
,
instance
,
message_p
);
}
instance_t
cu_task_create_gtpu_instance_to_du
(
eth_params_t
*
IPaddrs
)
{
openAddr_t
tmp
=
{
0
};
strncpy
(
tmp
.
originHost
,
IPaddrs
->
my_addr
,
sizeof
(
tmp
.
originHost
)
-
1
);
strncpy
(
tmp
.
destinationHost
,
IPaddrs
->
remote_addr
,
sizeof
(
tmp
.
destinationHost
)
-
1
);
sprintf
(
tmp
.
originService
,
"%d"
,
GTPV1U_UDP_PORT
);
sprintf
(
tmp
.
destinationService
,
"%d"
,
GTPV1U_UDP_PORT
);
return
ocp_gtpv1Init
(
tmp
);
}
void
*
F1AP_CU_task
(
void
*
arg
)
{
MessageDef
*
received_msg
=
NULL
;
int
result
;
...
...
@@ -119,8 +122,6 @@ void * F1AP_CU_task(void *arg) {
else
IPaddrs
=&
RC
.
rrc
[
0
]
->
eth_params_s
;
cu_task_send_sctp_init_req
(
0
,
IPaddrs
->
my_addr
);
instance_t
gtpInstance
=
cu_task_create_gtpu_instance_to_du
(
IPaddrs
);
AssertFatal
(
gtpInstance
>
0
,
"Failed to create CU F1-U UDP listener"
);
while
(
1
)
{
itti_receive_msg
(
TASK_CU_F1
,
&
received_msg
);
...
...
@@ -130,8 +131,8 @@ void * F1AP_CU_task(void *arg) {
LOG_I
(
F1AP
,
"CU Task Received SCTP_NEW_ASSOCIATION_IND for instance %ld
\n
"
,
ITTI_MSG_DESTINATION_INSTANCE
(
received_msg
));
cu_task_handle_sctp_association_ind
(
ITTI_MSG_ORIGIN_INSTANCE
(
received_msg
),
gtpInstance
,
&
received_msg
->
ittiMsg
.
sctp_new_association_ind
);
&
received_msg
->
ittiMsg
.
sctp_new_association_ind
,
IPaddrs
);
break
;
case
SCTP_NEW_ASSOCIATION_RESP
:
...
...
openair2/F1AP/f1ap_cu_ue_context_management.c
View file @
8e66c6a4
...
...
@@ -43,6 +43,7 @@
#include "rrc_eNB_S1AP.h"
#include "rrc_eNB_GTPV1U.h"
#include "openair2/RRC/NR/rrc_gNB_NGAP.h"
#include <openair3/ocp-gtpu/gtp_itf.h>
static
void
setQos
(
F1AP_NonDynamic5QIDescriptor_t
*
toFill
)
{
asn1cCalloc
(
toFill
,
F1AP_NonDynamic5QIDescriptor_t
,
tmp
);
...
...
@@ -510,6 +511,23 @@ 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
++
)
{
/* Here the callback function used as input is not the right one. Need to create a new one probably for F1-U, not sure
* if the kind of input parameters to the callback function are convenient though for gtp-u over F1-U.*/
//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
(
true
,
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
addr
,
f1ap_ue_context_setup_req
->
drbs_to_be_setup
[
i
].
up_dl_tnl
[
0
].
port
,
cu_f1u_data_req
);
/* 12.3.1 ULTunnels_ToBeSetup_Item */
asn1cSequenceAdd
(
drbs_toBeSetup_item
->
uLUPTNLInformation_ToBeSetup_List
.
list
,
F1AP_ULUPTNLInformation_ToBeSetup_Item_t
,
uLUPTNLInformation_ToBeSetup_Item
);
...
...
@@ -687,7 +705,10 @@ 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
);
GtpuUpdateTunnelOutgoingTeid
(
getCxt
(
true
,
instance
)
->
gtpInst
,
f1ap_ue_context_setup_resp
->
rnti
,
(
ebi_t
)
drbs_setup_item_p
->
dRBID
,
drb_p
->
up_dl_tnl
[
0
].
teid
);
}
}
// SRBs_FailedToBeSetup_List
...
...
openair2/F1AP/f1ap_du_task.c
View file @
8e66c6a4
...
...
@@ -36,6 +36,7 @@
#include "f1ap_du_rrc_message_transfer.h"
#include "f1ap_du_task.h"
#include "proto_agent.h"
#include <openair3/ocp-gtpu/gtp_itf.h>
void
du_task_send_sctp_association_req
(
instance_t
instance
,
f1ap_setup_req_t
*
f1ap_setup_req
)
{
DevAssert
(
f1ap_setup_req
!=
NULL
);
...
...
@@ -87,7 +88,8 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
.
remote_ipv4_address
=
RC
.
nrmac
[
instance
]
->
eth_params_n
.
remote_addr
,
.
remote_port
=
RC
.
nrmac
[
instance
]
->
eth_params_n
.
remote_portd
};
AssertFatal
(
proto_agent_start
(
instance
,
&
params
)
==
0
,
if
(
!
RC
.
nrrrc
)
AssertFatal
(
proto_agent_start
(
instance
,
&
params
)
==
0
,
"could not start PROTO_AGENT for F1U on instance %ld!
\n
"
,
instance
);
DU_send_F1_SETUP_REQUEST
(
instance
);
}
...
...
@@ -101,67 +103,81 @@ void du_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_dat
AssertFatal
(
result
==
EXIT_SUCCESS
,
"Failed to free memory (%d)!
\n
"
,
result
);
}
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
ocp_gtpv1Init
(
tmp
);
}
void
*
F1AP_DU_task
(
void
*
arg
)
{
//sctp_cu_init();
MessageDef
*
received_msg
=
NULL
;
int
result
;
LOG_I
(
F1AP
,
"Starting F1AP at DU
\n
"
);
//f1ap_eNB_prepare_internal_data();
itti_mark_task_ready
(
TASK_DU_F1
);
// SCTP
while
(
1
)
{
itti_receive_msg
(
TASK_DU_F1
,
&
received_msg
);
switch
(
ITTI_MSG_ID
(
received_msg
))
{
// case TERMINATE_MESSAGE:
// //F1AP_WARN(" *** Exiting F1AP DU thread\n");
// itti_exit_task();
// break;
case
F1AP_SETUP_REQ
:
// this is not a true F1 message, but rather an ITTI message sent by enb_app
MessageDef
*
msg
=
NULL
;
itti_receive_msg
(
TASK_DU_F1
,
&
msg
);
instance_t
myInstance
=
ITTI_MSG_DESTINATION_INSTANCE
(
msg
);
switch
(
ITTI_MSG_ID
(
msg
))
{
case
F1AP_SETUP_REQ
:
// this is not a true F1 message, but rather an ITTI message sent by enb_app
// 1. save the itti msg so that you can use it to sen f1ap_setup_req, fill the f1ap_setup_req message,
// 2. store the message in f1ap context, that is also stored in RC
// 2. send a sctp_association req
createF1inst
(
false
,
ITTI_MSG_DESTINATION_INSTANCE
(
received_msg
),
&
F1AP_SETUP_REQ
(
received_msg
));
LOG_I
(
F1AP
,
"DU Task Received F1AP_SETUP_REQ
\n
"
);
du_task_send_sctp_association_req
(
ITTI_MSG_DESTINATION_INSTANCE
(
received_msg
),
&
F1AP_SETUP_REQ
(
received_msg
));
LOG_I
(
F1AP
,
"DU Task Received F1AP_SETUP_REQ
\n
"
);
f1ap_setup_req_t
*
msgSetup
=&
F1AP_SETUP_REQ
(
msg
);
createF1inst
(
false
,
myInstance
,
msgSetup
);
getCxt
(
false
,
myInstance
)
->
gtpInst
=
du_create_gtpu_instance_to_cu
(
msgSetup
->
CU_f1_ip_address
.
ipv4_address
,
msgSetup
->
CUport
,
msgSetup
->
DU_f1_ip_address
.
ipv4_address
,
msgSetup
->
DUport
);
AssertFatal
(
getCxt
(
false
,
myInstance
)
->
gtpInst
>
0
,
"Failed to create CU F1-U UDP listener"
);
// Fixme: fully inconsistent instances management
// dirty global var is a bad fix
extern
instance_t
legacyInstanceMapping
;
legacyInstanceMapping
=
getCxt
(
false
,
myInstance
)
->
gtpInst
;
du_task_send_sctp_association_req
(
myInstance
,
msgSetup
);
break
;
case
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE
:
DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE
(
ITTI_MSG_ORIGIN_INSTANCE
(
received_
msg
),
&
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE
(
received_
msg
));
DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE
(
ITTI_MSG_ORIGIN_INSTANCE
(
msg
),
&
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE
(
msg
));
break
;
case
F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE
:
DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE
(
ITTI_MSG_DESTINATION_INSTANCE
(
received_msg
)
,
&
F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE
(
received_
msg
));
DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE
(
myInstance
,
&
F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE
(
msg
));
break
;
case
SCTP_NEW_ASSOCIATION_RESP
:
// 1. store the respon
// 2. send the f1setup_req
LOG_I
(
F1AP
,
"DU Task Received SCTP_NEW_ASSOCIATION_RESP
\n
"
);
du_task_handle_sctp_association_resp
(
ITTI_MSG_DESTINATION_INSTANCE
(
received_msg
)
,
&
received_
msg
->
ittiMsg
.
sctp_new_association_resp
);
du_task_handle_sctp_association_resp
(
myInstance
,
&
msg
->
ittiMsg
.
sctp_new_association_resp
);
break
;
case
SCTP_DATA_IND
:
// ex: any F1 incoming message for DU ends here
LOG_I
(
F1AP
,
"DU Task Received SCTP_DATA_IND
\n
"
);
du_task_handle_sctp_data_ind
(
ITTI_MSG_DESTINATION_INSTANCE
(
received_msg
)
,
&
received_
msg
->
ittiMsg
.
sctp_data_ind
);
du_task_handle_sctp_data_ind
(
myInstance
,
&
msg
->
ittiMsg
.
sctp_data_ind
);
break
;
case
F1AP_INITIAL_UL_RRC_MESSAGE
:
// from rrc
LOG_I
(
F1AP
,
"DU Task Received F1AP_INITIAL_UL_RRC_MESSAGE
\n
"
);
f1ap_initial_ul_rrc_message_t
*
msg
=
&
F1AP_INITIAL_UL_RRC_MESSAGE
(
received_
msg
);
DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER
(
0
,
0
,
0
,
msg
->
crnti
,
msg
->
rrc_container
,
msg
->
rrc_container_length
,
msg
->
du2cu_rrc_container
,
msg
->
du2cu_rrc_container_length
f1ap_initial_ul_rrc_message_t
*
msg
Rrc
=
&
F1AP_INITIAL_UL_RRC_MESSAGE
(
msg
);
DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER
(
0
,
0
,
0
,
msg
Rrc
->
crnti
,
msg
Rrc
->
rrc_container
,
msg
Rrc
->
rrc_container_length
,
msg
Rrc
->
du2cu_rrc_container
,
msg
Rrc
->
du2cu_rrc_container_length
);
break
;
...
...
@@ -169,23 +185,23 @@ void *F1AP_DU_task(void *arg) {
LOG_I
(
F1AP
,
"DU Task Received F1AP_UL_RRC_MESSAGE
\n
"
);
if
(
RC
.
nrrrc
&&
RC
.
nrrrc
[
0
]
->
node_type
==
ngran_gNB_DU
)
{
DU_send_UL_NR_RRC_MESSAGE_TRANSFER
(
ITTI_MSG_DESTINATION_INSTANCE
(
received_msg
)
,
&
F1AP_UL_RRC_MESSAGE
(
received_
msg
));
DU_send_UL_NR_RRC_MESSAGE_TRANSFER
(
myInstance
,
&
F1AP_UL_RRC_MESSAGE
(
msg
));
}
else
{
DU_send_UL_RRC_MESSAGE_TRANSFER
(
ITTI_MSG_DESTINATION_INSTANCE
(
received_msg
)
,
&
F1AP_UL_RRC_MESSAGE
(
received_
msg
));
DU_send_UL_RRC_MESSAGE_TRANSFER
(
myInstance
,
&
F1AP_UL_RRC_MESSAGE
(
msg
));
}
break
;
case
F1AP_UE_CONTEXT_SETUP_RESP
:
DU_send_UE_CONTEXT_SETUP_RESPONSE
(
ITTI_MSG_DESTINATION_INSTANCE
(
received_msg
),
&
F1AP_UE_CONTEXT_SETUP_RESP
(
received_
msg
));
DU_send_UE_CONTEXT_SETUP_RESPONSE
(
myInstance
,
&
F1AP_UE_CONTEXT_SETUP_RESP
(
msg
));
break
;
case
F1AP_UE_CONTEXT_RELEASE_REQ
:
// from MAC
LOG_I
(
F1AP
,
"DU Task Received F1AP_UE_CONTEXT_RELEASE_REQ
\n
"
);
DU_send_UE_CONTEXT_RELEASE_REQUEST
(
ITTI_MSG_DESTINATION_INSTANCE
(
received_msg
)
,
&
F1AP_UE_CONTEXT_RELEASE_REQ
(
received_
msg
));
DU_send_UE_CONTEXT_RELEASE_REQUEST
(
myInstance
,
&
F1AP_UE_CONTEXT_RELEASE_REQ
(
msg
));
break
;
case
TERMINATE_MESSAGE
:
...
...
@@ -195,13 +211,12 @@ void *F1AP_DU_task(void *arg) {
default:
LOG_E
(
F1AP
,
"DU Received unhandled message: %d:%s
\n
"
,
ITTI_MSG_ID
(
received_msg
),
ITTI_MSG_NAME
(
received_
msg
));
ITTI_MSG_ID
(
msg
),
ITTI_MSG_NAME
(
msg
));
break
;
}
// switch
result
=
itti_free
(
ITTI_MSG_ORIGIN_ID
(
received_msg
),
received_
msg
);
int
result
=
itti_free
(
ITTI_MSG_ORIGIN_ID
(
msg
),
msg
);
AssertFatal
(
result
==
EXIT_SUCCESS
,
"Failed to free memory (%d)!
\n
"
,
result
);
received_msg
=
NULL
;
}
// while
return
NULL
;
...
...
openair2/GNB_APP/gnb_app.c
View file @
8e66c6a4
...
...
@@ -240,8 +240,6 @@ void *gNB_app_task(void *args_p)
RCconfig_NR_DU_F1
(
msg_p
,
0
);
itti_send_msg_to_task
(
TASK_DU_F1
,
GNB_MODULE_ID_TO_INSTANCE
(
0
),
msg_p
);
//start F1-U
RCconfig_nr_gtpu
();
}
}
do
{
...
...
openair2/GNB_APP/gnb_config.c
View file @
8e66c6a4
This diff is collapsed.
Click to expand it.
openair2/RRC/NR/rrc_gNB.c
View file @
8e66c6a4
...
...
@@ -1375,33 +1375,15 @@ rrc_gNB_process_RRCReconfigurationComplete(
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB
,
0
,
F1AP_UE_CONTEXT_SETUP_REQ
);
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
drbs_to_be_setup
=
malloc
(
DRB_configList
->
list
.
count
*
sizeof
(
f1ap_drb_to_be_setup_t
));
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
drbs_to_be_setup_length
=
DRB_configList
->
list
.
count
;
f1ap_drb_to_be_setup_t
*
DRBs
=
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
drbs_to_be_setup
;
LOG_I
(
RRC
,
"Length of DRB list:%d, %d
\n
"
,
DRB_configList
->
list
.
count
,
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
drbs_to_be_setup_length
);
for
(
int
i
=
0
;
i
<
DRB_configList
->
list
.
count
;
i
++
){
//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
//create_tunnel_req.outgoing_teid[i] = 0xFFFF;
create_tunnel_req
.
outgoing_teid
[
i
]
=
0xFFFF
;
create_tunnel_req
.
rnti
=
ue_context_pP
->
ue_context
.
rnti
;
in_addr_t
tmp_addr
=
inet_addr
(
rrc
->
eth_params_s
.
remote_addr
);
memcpy
(
create_tunnel_req
.
dst_addr
[
i
].
buffer
,
&
tmp_addr
,
sizeof
(
tmp_addr
));
LOG_D
(
NR_RRC
,
"The remote tunnel IP address of the DU is: %u.%u.%u.%u
\n
"
,
create_tunnel_req
.
dst_addr
[
i
].
buffer
[
0
],
create_tunnel_req
.
dst_addr
[
i
].
buffer
[
1
],
create_tunnel_req
.
dst_addr
[
i
].
buffer
[
2
],
create_tunnel_req
.
dst_addr
[
i
].
buffer
[
3
]);
create_tunnel_req
.
dst_addr
[
i
].
length
=
sizeof
(
tmp_addr
)
*
8
;
create_tunnel_req
.
incoming_rb_id
[
i
]
=
DRB_configList
->
list
.
array
[
i
]
->
drb_Identity
;
/* Here the callback function used as input is not the right one. Need to create a new one probably for F1-U, not sure
* if the kind of input parameters to the callback function are convenient though for gtp-u over F1-U.*/
uint32_t
incoming_teid
;
incoming_teid
=
newGtpuCreateTunnel
(
INSTANCE_DEFAULT
,
create_tunnel_req
.
rnti
,
create_tunnel_req
.
incoming_rb_id
[
i
],
create_tunnel_req
.
incoming_rb_id
[
i
],
create_tunnel_req
.
outgoing_teid
[
i
],
create_tunnel_req
.
dst_addr
[
i
],
2152
,
cu_f1u_data_req
);
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
drbs_to_be_setup
[
i
].
drb_id
=
DRB_configList
->
list
.
array
[
i
]
->
drb_Identity
;
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
drbs_to_be_setup
[
i
].
rlc_mode
=
RLC_MODE_AM
;
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
drbs_to_be_setup
[
i
].
up_ul_tnl
[
0
].
teid
=
incoming_teid
;
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
drbs_to_be_setup
[
i
].
up_ul_tnl
[
0
].
tl_address
=
inet_addr
(
rrc
->
eth_params_s
.
my_addr
);
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
drbs_to_be_setup
[
i
].
up_ul_tnl_length
=
1
;
DRBs
[
i
].
drb_id
=
DRB_configList
->
list
.
array
[
i
]
->
drb_Identity
;
DRBs
[
i
].
rlc_mode
=
RLC_MODE_AM
;
DRBs
[
i
].
up_ul_tnl
[
0
].
tl_address
=
inet_addr
(
rrc
->
eth_params_s
.
my_addr
);
DRBs
[
i
].
up_ul_tnl_length
=
1
;
DRBs
[
i
].
up_dl_tnl
[
0
].
tl_address
=
inet_addr
(
rrc
->
eth_params_s
.
remote_addr
);
DRBs
[
i
].
up_dl_tnl_length
=
1
;
}
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
gNB_CU_ue_id
=
0
;
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
gNB_DU_ue_id
=
0
;
...
...
@@ -3258,8 +3240,6 @@ static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, const ch
gNB_RRC_INST
*
rrc
=
RC
.
nrrrc
[
ctxt
.
module_id
];
struct
rrc_gNB_ue_context_s
*
ue_context_p
=
rrc_gNB_get_ue_context
(
rrc
,
ctxt
.
rnti
);
NR_CellGroupConfig_t
*
cellGroupConfig
=
NULL
;
int
i
;
int
j
;
asn_dec_rval_t
dec_rval
=
uper_decode_complete
(
NULL
,
&
asn_DEF_NR_CellGroupConfig
,
...
...
@@ -3283,17 +3263,12 @@ static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, const ch
LOG_I
(
NR_RRC
,
"rlc_BearerToAddModList not empty before filling it
\n
"
);
free
(
ue_context_p
->
ue_context
.
masterCellGroup
->
rlc_BearerToAddModList
);
}
ue_context_p
->
ue_context
.
masterCellGroup
->
rlc_BearerToAddModList
=
calloc
(
1
,
sizeof
(
cellGroupConfig
->
rlc_BearerToAddModList
));
ue_context_p
->
ue_context
.
masterCellGroup
->
rlc_BearerToAddModList
=
calloc
(
1
,
sizeof
(
*
cellGroupConfig
->
rlc_BearerToAddModList
));
memcpy
(
ue_context_p
->
ue_context
.
masterCellGroup
->
rlc_BearerToAddModList
,
cellGroupConfig
->
rlc_BearerToAddModList
,
sizeof
(
struct
NR_CellGroupConfig__rlc_BearerToAddModList
));
}
xer_fprint
(
stdout
,
&
asn_DEF_NR_CellGroupConfig
,
ue_context_p
->
ue_context
.
masterCellGroup
);
for
(
i
=
0
;
i
<
resp
->
drbs_to_be_setup_length
;
i
++
){
for
(
j
=
0
;
j
<
resp
->
drbs_to_be_setup
[
i
].
up_dl_tnl_length
;
j
++
){
GtpuUpdateTunnelOutgoingTeid
(
INSTANCE_DEFAULT
,
ue_context_p
->
ue_context
.
rnti
,
(
ebi_t
)
resp
->
drbs_to_be_setup
[
i
].
drb_id
,
resp
->
drbs_to_be_setup
[
i
].
up_dl_tnl
[
j
].
teid
);
}
}
free
(
cellGroupConfig
->
rlc_BearerToAddModList
);
free
(
cellGroupConfig
);
...
...
openair3/ocp-gtpu/gtp_itf.cpp
View file @
8e66c6a4
...
...
@@ -95,7 +95,7 @@ static teid_t gtpv1uNewTeid(void) {
#endif
}
int
legacyInstanceMapping
=
0
;
in
stance_
t
legacyInstanceMapping
=
0
;
#define compatInst(a) ((a)==0 || (a)==INSTANCE_DEFAULT?legacyInstanceMapping:a)
#define GTPV1U_HEADER_SIZE (8)
...
...
@@ -141,8 +141,7 @@ static int gtpv1uCreateAndSendMsg(int h, uint32_t peerIp, uint16_t peerPort, te
int
ret
;
if
((
ret
=
sendto
(
h
,
(
void
*
)
buffer
,
(
size_t
)
fullSize
,
0
,(
struct
sockaddr
*
)
&
to
,
sizeof
(
to
)
))
!=
fullSize
)
{
LOG_E
(
GTPU
,
"[SD %d] Failed to send data to "
IPV4_ADDR
" on port %d, buffer size %u, ret: %d, errno: %d
\n
"
,
LOG_E
(
GTPU
,
"[SD %d] Failed to send data to "
IPV4_ADDR
" on port %d, buffer size %u, ret: %d, errno: %d
\n
"
,
h
,
IPV4_ADDR_FORMAT
(
peerIp
),
peerPort
,
fullSize
,
ret
,
errno
);
free
(
buffer
);
return
GTPNOK
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment