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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
spbro
OpenXG-RAN
Commits
1d8e8965
Commit
1d8e8965
authored
Aug 29, 2024
by
Guido Casati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use F1AP lib for F1 Setup Request in stack
parent
c433f4de
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
339 deletions
+38
-339
openair2/F1AP/f1ap_cu_interface_management.c
openair2/F1AP/f1ap_cu_interface_management.c
+13
-158
openair2/F1AP/f1ap_du_interface_management.c
openair2/F1AP/f1ap_du_interface_management.c
+12
-95
openair2/F1AP/f1ap_du_task.c
openair2/F1AP/f1ap_du_task.c
+2
-0
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c
+3
-41
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c
+3
-43
openair2/RRC/NR/rrc_gNB_du.c
openair2/RRC/NR/rrc_gNB_du.c
+5
-2
No files found.
openair2/F1AP/f1ap_cu_interface_management.c
View file @
1d8e8965
This diff is collapsed.
Click to expand it.
openair2/F1AP/f1ap_du_interface_management.c
View file @
1d8e8965
...
...
@@ -34,6 +34,8 @@
#include "f1ap_encoder.h"
#include "f1ap_itti_messaging.h"
#include "f1ap_du_interface_management.h"
#include "lib/f1ap_interface_management.h"
#include "lib/f1ap_lib_common.h"
#include "openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.h"
#include "assertions.h"
...
...
@@ -297,110 +299,25 @@ static F1AP_GNB_DU_System_Information_t *encode_system_info(const f1ap_gnb_du_sy
return
enc_sys_info
;
}
// SETUP REQUEST
/**
* @brief F1AP Setup Request
*/
int
DU_send_F1_SETUP_REQUEST
(
sctp_assoc_t
assoc_id
,
const
f1ap_setup_req_t
*
setup_req
)
{
LOG_D
(
F1AP
,
"DU_send_F1_SETUP_REQUEST
\n
"
);
F1AP_F1AP_PDU_t
pdu
=
{
0
};
F1AP_F1AP_PDU_t
*
pdu
=
encode_f1ap_setup_request
(
setup_req
);
uint8_t
*
buffer
;
uint32_t
len
;
/* Create */
/* 0. pdu Type */
pdu
.
present
=
F1AP_F1AP_PDU_PR_initiatingMessage
;
asn1cCalloc
(
pdu
.
choice
.
initiatingMessage
,
initMsg
);
initMsg
->
procedureCode
=
F1AP_ProcedureCode_id_F1Setup
;
initMsg
->
criticality
=
F1AP_Criticality_reject
;
initMsg
->
value
.
present
=
F1AP_InitiatingMessage__value_PR_F1SetupRequest
;
F1AP_F1SetupRequest_t
*
f1Setup
=
&
initMsg
->
value
.
choice
.
F1SetupRequest
;
/* mandatory */
/* c1. Transaction ID (integer value) */
asn1cSequenceAdd
(
f1Setup
->
protocolIEs
.
list
,
F1AP_F1SetupRequestIEs_t
,
ieC1
);
ieC1
->
id
=
F1AP_ProtocolIE_ID_id_TransactionID
;
ieC1
->
criticality
=
F1AP_Criticality_reject
;
ieC1
->
value
.
present
=
F1AP_F1SetupRequestIEs__value_PR_TransactionID
;
ieC1
->
value
.
choice
.
TransactionID
=
F1AP_get_next_transaction_identifier
(
0
,
0
);
/* mandatory */
/* c2. GNB_DU_ID (integer value) */
asn1cSequenceAdd
(
f1Setup
->
protocolIEs
.
list
,
F1AP_F1SetupRequestIEs_t
,
ieC2
);
ieC2
->
id
=
F1AP_ProtocolIE_ID_id_gNB_DU_ID
;
ieC2
->
criticality
=
F1AP_Criticality_reject
;
ieC2
->
value
.
present
=
F1AP_F1SetupRequestIEs__value_PR_GNB_DU_ID
;
asn_int642INTEGER
(
&
ieC2
->
value
.
choice
.
GNB_DU_ID
,
setup_req
->
gNB_DU_id
);
/* optional */
/* c3. GNB_DU_Name */
if
(
setup_req
->
gNB_DU_name
!=
NULL
)
{
asn1cSequenceAdd
(
f1Setup
->
protocolIEs
.
list
,
F1AP_F1SetupRequestIEs_t
,
ieC3
);
ieC3
->
id
=
F1AP_ProtocolIE_ID_id_gNB_DU_Name
;
ieC3
->
criticality
=
F1AP_Criticality_ignore
;
ieC3
->
value
.
present
=
F1AP_F1SetupRequestIEs__value_PR_GNB_DU_Name
;
char
*
gNB_DU_name
=
setup_req
->
gNB_DU_name
;
OCTET_STRING_fromBuf
(
&
ieC3
->
value
.
choice
.
GNB_DU_Name
,
gNB_DU_name
,
strlen
(
gNB_DU_name
));
}
/* mandatory */
/* c4. served cells list */
asn1cSequenceAdd
(
f1Setup
->
protocolIEs
.
list
,
F1AP_F1SetupRequestIEs_t
,
ieCells
);
ieCells
->
id
=
F1AP_ProtocolIE_ID_id_gNB_DU_Served_Cells_List
;
ieCells
->
criticality
=
F1AP_Criticality_reject
;
ieCells
->
value
.
present
=
F1AP_F1SetupRequestIEs__value_PR_GNB_DU_Served_Cells_List
;
int
num_cells_available
=
setup_req
->
num_cells_available
;
LOG_D
(
F1AP
,
"num_cells_available = %d
\n
"
,
num_cells_available
);
for
(
int
i
=
0
;
i
<
num_cells_available
;
i
++
)
{
/* mandatory */
/* 4.1 served cells item */
const
f1ap_served_cell_info_t
*
cell
=
&
setup_req
->
cell
[
i
].
info
;
const
f1ap_gnb_du_system_info_t
*
sys_info
=
setup_req
->
cell
[
i
].
sys_info
;
asn1cSequenceAdd
(
ieCells
->
value
.
choice
.
GNB_DU_Served_Cells_List
.
list
,
F1AP_GNB_DU_Served_Cells_ItemIEs_t
,
duServedCell
);
duServedCell
->
id
=
F1AP_ProtocolIE_ID_id_GNB_DU_Served_Cells_Item
;
duServedCell
->
criticality
=
F1AP_Criticality_reject
;
duServedCell
->
value
.
present
=
F1AP_GNB_DU_Served_Cells_ItemIEs__value_PR_GNB_DU_Served_Cells_Item
;
F1AP_GNB_DU_Served_Cells_Item_t
*
scell_item
=
&
duServedCell
->
value
.
choice
.
GNB_DU_Served_Cells_Item
;
scell_item
->
served_Cell_Information
=
encode_served_cell_info
(
cell
);
scell_item
->
gNB_DU_System_Information
=
encode_system_info
(
sys_info
);
}
/* mandatory */
/* c5. RRC VERSION */
asn1cSequenceAdd
(
f1Setup
->
protocolIEs
.
list
,
F1AP_F1SetupRequestIEs_t
,
ie2
);
ie2
->
id
=
F1AP_ProtocolIE_ID_id_GNB_DU_RRC_Version
;
ie2
->
criticality
=
F1AP_Criticality_reject
;
ie2
->
value
.
present
=
F1AP_F1SetupRequestIEs__value_PR_RRC_Version
;
// RRC Version: "This IE is not used in this release."
// we put one bit for each byte in rrc_ver that is != 0
uint8_t
bits
=
0
;
for
(
int
i
=
0
;
i
<
3
;
++
i
)
bits
|=
(
setup_req
->
rrc_ver
[
i
]
!=
0
)
<<
i
;
BIT_STRING_t
*
bs
=
&
ie2
->
value
.
choice
.
RRC_Version
.
latest_RRC_Version
;
bs
->
buf
=
calloc
(
1
,
sizeof
(
char
));
AssertFatal
(
bs
->
buf
!=
NULL
,
"out of memory
\n
"
);
bs
->
buf
[
0
]
=
bits
;
bs
->
size
=
1
;
bs
->
bits_unused
=
5
;
F1AP_ProtocolExtensionContainer_10696P228_t
*
p
=
calloc
(
1
,
sizeof
(
F1AP_ProtocolExtensionContainer_10696P228_t
));
asn1cSequenceAdd
(
p
->
list
,
F1AP_RRC_Version_ExtIEs_t
,
rrcv_ext
);
rrcv_ext
->
id
=
F1AP_ProtocolIE_ID_id_latest_RRC_Version_Enhanced
;
rrcv_ext
->
criticality
=
F1AP_Criticality_ignore
;
rrcv_ext
->
extensionValue
.
present
=
F1AP_RRC_Version_ExtIEs__extensionValue_PR_OCTET_STRING_SIZE_3_
;
OCTET_STRING_t
*
os
=
&
rrcv_ext
->
extensionValue
.
choice
.
OCTET_STRING_SIZE_3_
;
os
->
size
=
3
;
os
->
buf
=
malloc
(
3
*
sizeof
(
*
os
->
buf
));
AssertFatal
(
os
->
buf
!=
NULL
,
"out of memory
\n
"
);
for
(
int
i
=
0
;
i
<
3
;
++
i
)
os
->
buf
[
i
]
=
setup_req
->
rrc_ver
[
i
];
ie2
->
value
.
choice
.
RRC_Version
.
iE_Extensions
=
(
struct
F1AP_ProtocolExtensionContainer
*
)
p
;
/* encode */
if
(
f1ap_encode_pdu
(
&
pdu
,
&
buffer
,
&
len
)
<
0
)
{
if
(
f1ap_encode_pdu
(
pdu
,
&
buffer
,
&
len
)
<
0
)
{
LOG_E
(
F1AP
,
"Failed to encode F1 setup request
\n
"
);
/* free PDU */
ASN_STRUCT_FREE
(
asn_DEF_F1AP_F1AP_PDU
,
pdu
);
return
-
1
;
}
ASN_STRUCT_RESET
(
asn_DEF_F1AP_F1AP_PDU
,
&
pdu
);
/* free PDU */
ASN_STRUCT_FREE
(
asn_DEF_F1AP_F1AP_PDU
,
pdu
);
/* Send to ITTI */
f1ap_itti_send_sctp_data_req
(
assoc_id
,
buffer
,
len
);
return
0
;
}
...
...
openair2/F1AP/f1ap_du_task.c
View file @
1d8e8965
...
...
@@ -100,6 +100,8 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
f1ap_du_data
->
du
.
assoc_id
=
sctp_new_association_resp
->
assoc_id
;
f1ap_du_data
->
sctp_in_streams
=
sctp_new_association_resp
->
in_streams
;
f1ap_du_data
->
sctp_out_streams
=
sctp_new_association_resp
->
out_streams
;
/* next transaction ID */
f1ap_du_data
->
setupReq
.
transaction_id
=
F1AP_get_next_transaction_identifier
(
0
,
0
);
/* setup parameters for F1U and start the server */
DU_send_F1_SETUP_REQUEST
(
f1ap_du_data
->
du
.
assoc_id
,
&
f1ap_du_data
->
setupReq
);
}
...
...
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c
View file @
1d8e8965
...
...
@@ -24,6 +24,7 @@
#include "mac_rrc_ul.h"
#include "f1ap_lib_extern.h"
#include "lib/f1ap_interface_management.h"
static
void
f1_reset_du_initiated_direct
(
const
f1ap_reset_t
*
reset
)
{
...
...
@@ -41,47 +42,8 @@ static void f1_setup_request_direct(const f1ap_setup_req_t *req)
{
MessageDef
*
msg
=
itti_alloc_new_message
(
TASK_MAC_GNB
,
0
,
F1AP_SETUP_REQ
);
msg
->
ittiMsgHeader
.
originInstance
=
-
1
;
// means monolithic
f1ap_setup_req_t
*
f1ap_msg
=
&
F1AP_SETUP_REQ
(
msg
);
f1ap_msg
->
gNB_DU_id
=
req
->
gNB_DU_id
;
f1ap_msg
->
gNB_DU_name
=
strdup
(
req
->
gNB_DU_name
);
f1ap_msg
->
num_cells_available
=
req
->
num_cells_available
;
for
(
int
n
=
0
;
n
<
req
->
num_cells_available
;
++
n
)
{
f1ap_msg
->
cell
[
n
].
info
=
req
->
cell
[
n
].
info
;
// copy most fields
if
(
req
->
cell
[
n
].
info
.
tac
)
{
f1ap_msg
->
cell
[
n
].
info
.
tac
=
malloc
(
sizeof
(
*
f1ap_msg
->
cell
[
n
].
info
.
tac
));
AssertFatal
(
f1ap_msg
->
cell
[
n
].
info
.
tac
!=
NULL
,
"out of memory
\n
"
);
*
f1ap_msg
->
cell
[
n
].
info
.
tac
=
*
req
->
cell
[
n
].
info
.
tac
;
}
if
(
req
->
cell
[
n
].
info
.
measurement_timing_config_len
>
0
)
{
f1ap_msg
->
cell
[
n
].
info
.
measurement_timing_config
=
calloc
(
req
->
cell
[
n
].
info
.
measurement_timing_config_len
,
sizeof
(
uint8_t
));
AssertFatal
(
f1ap_msg
->
cell
[
n
].
info
.
measurement_timing_config
!=
NULL
,
"out of memory
\n
"
);
memcpy
(
f1ap_msg
->
cell
[
n
].
info
.
measurement_timing_config
,
req
->
cell
[
n
].
info
.
measurement_timing_config
,
req
->
cell
[
n
].
info
.
measurement_timing_config_len
);
f1ap_msg
->
cell
[
n
].
info
.
measurement_timing_config_len
=
req
->
cell
[
n
].
info
.
measurement_timing_config_len
;
}
if
(
req
->
cell
[
n
].
sys_info
)
{
f1ap_gnb_du_system_info_t
*
orig_sys_info
=
req
->
cell
[
n
].
sys_info
;
f1ap_gnb_du_system_info_t
*
copy_sys_info
=
calloc
(
1
,
sizeof
(
*
copy_sys_info
));
AssertFatal
(
copy_sys_info
,
"out of memory
\n
"
);
f1ap_msg
->
cell
[
n
].
sys_info
=
copy_sys_info
;
copy_sys_info
->
mib
=
calloc
(
orig_sys_info
->
mib_length
,
sizeof
(
uint8_t
));
AssertFatal
(
copy_sys_info
->
mib
,
"out of memory
\n
"
);
memcpy
(
copy_sys_info
->
mib
,
orig_sys_info
->
mib
,
orig_sys_info
->
mib_length
);
copy_sys_info
->
mib_length
=
orig_sys_info
->
mib_length
;
if
(
orig_sys_info
->
sib1_length
>
0
)
{
copy_sys_info
->
sib1
=
calloc
(
orig_sys_info
->
sib1_length
,
sizeof
(
uint8_t
));
AssertFatal
(
copy_sys_info
->
sib1
,
"out of memory
\n
"
);
memcpy
(
copy_sys_info
->
sib1
,
orig_sys_info
->
sib1
,
orig_sys_info
->
sib1_length
);
copy_sys_info
->
sib1_length
=
orig_sys_info
->
sib1_length
;
}
}
}
memcpy
(
f1ap_msg
->
rrc_ver
,
req
->
rrc_ver
,
sizeof
(
req
->
rrc_ver
));
f1ap_setup_req_t
cp
=
cp_f1ap_setup_request
(
req
);
F1AP_SETUP_REQ
(
msg
)
=
cp
;
itti_send_msg_to_task
(
TASK_RRC_GNB
,
0
,
msg
);
}
...
...
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c
View file @
1d8e8965
...
...
@@ -30,6 +30,7 @@
#include "mac_rrc_ul.h"
#include "f1ap_lib_extern.h"
#include "lib/f1ap_interface_management.h"
static
f1ap_net_config_t
read_DU_IP_config
(
const
eth_params_t
*
f1_params
,
const
char
*
f1u_ip_addr
)
{
...
...
@@ -68,50 +69,9 @@ static void f1_reset_acknowledge_cu_initiated_f1ap(const f1ap_reset_ack_t *ack)
static
void
f1_setup_request_f1ap
(
const
f1ap_setup_req_t
*
req
)
{
MessageDef
*
msg
=
itti_alloc_new_message
(
TASK_MAC_GNB
,
0
,
F1AP_DU_REGISTER_REQ
);
f1ap_setup_req_t
*
f1ap_setup
=
&
F1AP_DU_REGISTER_REQ
(
msg
).
setup_req
;
f1ap_setup
->
gNB_DU_id
=
req
->
gNB_DU_id
;
f1ap_setup
->
gNB_DU_name
=
strdup
(
req
->
gNB_DU_name
);
f1ap_setup
->
num_cells_available
=
req
->
num_cells_available
;
for
(
int
n
=
0
;
n
<
req
->
num_cells_available
;
++
n
)
{
f1ap_setup
->
cell
[
n
].
info
=
req
->
cell
[
n
].
info
;
// copy most fields
if
(
req
->
cell
[
n
].
info
.
tac
)
{
f1ap_setup
->
cell
[
n
].
info
.
tac
=
malloc
(
sizeof
(
*
f1ap_setup
->
cell
[
n
].
info
.
tac
));
AssertFatal
(
f1ap_setup
->
cell
[
n
].
info
.
tac
!=
NULL
,
"out of memory
\n
"
);
*
f1ap_setup
->
cell
[
n
].
info
.
tac
=
*
req
->
cell
[
n
].
info
.
tac
;
}
if
(
req
->
cell
[
n
].
info
.
measurement_timing_config_len
>
0
)
{
f1ap_setup
->
cell
[
n
].
info
.
measurement_timing_config
=
calloc
(
req
->
cell
[
n
].
info
.
measurement_timing_config_len
,
sizeof
(
uint8_t
));
AssertFatal
(
f1ap_setup
->
cell
[
n
].
info
.
measurement_timing_config
!=
NULL
,
"out of memory
\n
"
);
memcpy
(
f1ap_setup
->
cell
[
n
].
info
.
measurement_timing_config
,
req
->
cell
[
n
].
info
.
measurement_timing_config
,
req
->
cell
[
n
].
info
.
measurement_timing_config_len
);
f1ap_setup
->
cell
[
n
].
info
.
measurement_timing_config_len
=
req
->
cell
[
n
].
info
.
measurement_timing_config_len
;
}
if
(
req
->
cell
[
n
].
sys_info
)
{
f1ap_gnb_du_system_info_t
*
orig_sys_info
=
req
->
cell
[
n
].
sys_info
;
f1ap_gnb_du_system_info_t
*
copy_sys_info
=
calloc
(
1
,
sizeof
(
*
copy_sys_info
));
AssertFatal
(
copy_sys_info
,
"out of memory
\n
"
);
f1ap_setup
->
cell
[
n
].
sys_info
=
copy_sys_info
;
copy_sys_info
->
mib
=
calloc
(
orig_sys_info
->
mib_length
,
sizeof
(
uint8_t
));
AssertFatal
(
copy_sys_info
->
mib
,
"out of memory
\n
"
);
memcpy
(
copy_sys_info
->
mib
,
orig_sys_info
->
mib
,
orig_sys_info
->
mib_length
);
copy_sys_info
->
mib_length
=
orig_sys_info
->
mib_length
;
if
(
orig_sys_info
->
sib1_length
>
0
)
{
copy_sys_info
->
sib1
=
calloc
(
orig_sys_info
->
sib1_length
,
sizeof
(
uint8_t
));
AssertFatal
(
copy_sys_info
->
sib1
,
"out of memory
\n
"
);
memcpy
(
copy_sys_info
->
sib1
,
orig_sys_info
->
sib1
,
orig_sys_info
->
sib1_length
);
copy_sys_info
->
sib1_length
=
orig_sys_info
->
sib1_length
;
}
}
}
memcpy
(
f1ap_setup
->
rrc_ver
,
req
->
rrc_ver
,
sizeof
(
req
->
rrc_ver
));
f1ap_setup_req_t
f1ap_setup
=
cp_f1ap_setup_request
(
req
);
F1AP_DU_REGISTER_REQ
(
msg
).
setup_req
=
f1ap_setup
;
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
);
}
...
...
openair2/RRC/NR/rrc_gNB_du.c
View file @
1d8e8965
...
...
@@ -29,6 +29,7 @@
#include "executables/softmodem-common.h"
#include "common/utils/ds/seq_arr.h"
#include "common/utils/alg/foreach.h"
#include "lib/f1ap_interface_management.h"
int
get_dl_band
(
const
struct
f1ap_served_cell_info_t
*
cell_info
)
{
...
...
@@ -261,7 +262,6 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *req, sctp_assoc_t assoc_id)
DevAssert
(
rrc
);
LOG_I
(
NR_RRC
,
"Received F1 Setup Request from gNB_DU %lu (%s) on assoc_id %d
\n
"
,
req
->
gNB_DU_id
,
req
->
gNB_DU_name
,
assoc_id
);
// check:
// - it is one cell
// - PLMN and Cell ID matches
...
...
@@ -358,7 +358,8 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *req, sctp_assoc_t assoc_id)
* allocate memory and copy it in */
du
->
setup_req
=
calloc
(
1
,
sizeof
(
*
du
->
setup_req
));
AssertFatal
(
du
->
setup_req
,
"out of memory
\n
"
);
*
du
->
setup_req
=
*
req
;
// Copy F1AP message
*
du
->
setup_req
=
cp_f1ap_setup_request
(
req
);
// MIB can be null and configured later via DU Configuration Update
du
->
mib
=
mib
;
du
->
sib1
=
sib1
;
...
...
@@ -379,6 +380,8 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *req, sctp_assoc_t assoc_id)
f1ap_setup_resp_t
resp
=
{.
transaction_id
=
req
->
transaction_id
,
.
num_cells_to_activate
=
1
,
.
cells_to_activate
[
0
]
=
cell
};
// free F1AP message after use
free_f1ap_setup_request
(
req
);
int
num
=
read_version
(
TO_STRING
(
NR_RRC_VERSION
),
&
resp
.
rrc_ver
[
0
],
&
resp
.
rrc_ver
[
1
],
&
resp
.
rrc_ver
[
2
]);
AssertFatal
(
num
==
3
,
"could not read RRC version string %s
\n
"
,
TO_STRING
(
NR_RRC_VERSION
));
if
(
rrc
->
node_name
!=
NULL
)
...
...
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