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
littleBu
OpenXG-RAN
Commits
b7ceb1a9
Commit
b7ceb1a9
authored
Sep 02, 2022
by
General ABS
Committed by
abs
Sep 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get C-RNTI and new UE context at gNB-CU, and new F1AP UE context at gNB-DU
parent
35b7a205
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
98 additions
and
16 deletions
+98
-16
openair2/COMMON/f1ap_messages_types.h
openair2/COMMON/f1ap_messages_types.h
+1
-0
openair2/F1AP/f1ap_cu_ue_context_management.c
openair2/F1AP/f1ap_cu_ue_context_management.c
+13
-0
openair2/F1AP/f1ap_du_ue_context_management.c
openair2/F1AP/f1ap_du_ue_context_management.c
+3
-5
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c
+1
-1
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c
+14
-4
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+63
-3
openair2/RRC/NR/rrc_gNB_UE_context.c
openair2/RRC/NR/rrc_gNB_UE_context.c
+3
-3
No files found.
openair2/COMMON/f1ap_messages_types.h
View file @
b7ceb1a9
...
@@ -413,6 +413,7 @@ typedef struct f1ap_ue_context_setup_s {
...
@@ -413,6 +413,7 @@ typedef struct f1ap_ue_context_setup_s {
//uint8_t *du_to_cu_rrc_information;
//uint8_t *du_to_cu_rrc_information;
du_to_cu_rrc_information_t
*
du_to_cu_rrc_information
;
du_to_cu_rrc_information_t
*
du_to_cu_rrc_information
;
uint32_t
du_to_cu_rrc_information_length
;
uint32_t
du_to_cu_rrc_information_length
;
uint16_t
*
crnti
;
f1ap_drb_to_be_setup_t
*
drbs_to_be_setup
;
f1ap_drb_to_be_setup_t
*
drbs_to_be_setup
;
uint8_t
drbs_to_be_setup_length
;
uint8_t
drbs_to_be_setup_length
;
f1ap_drb_to_be_setup_t
*
drbs_to_be_modified
;
f1ap_drb_to_be_setup_t
*
drbs_to_be_modified
;
...
...
openair2/F1AP/f1ap_cu_ue_context_management.c
View file @
b7ceb1a9
...
@@ -669,6 +669,19 @@ int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance,
...
@@ -669,6 +669,19 @@ int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID
,
true
);
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID
,
true
);
f1ap_ue_context_setup_resp
->
gNB_DU_ue_id
=
ie
->
value
.
choice
.
GNB_DU_UE_F1AP_ID
;
f1ap_ue_context_setup_resp
->
gNB_DU_ue_id
=
ie
->
value
.
choice
.
GNB_DU_UE_F1AP_ID
;
LOG_D
(
F1AP
,
"f1ap_ue_context_setup_resp->gNB_DU_ue_id is: %d
\n
"
,
f1ap_ue_context_setup_resp
->
gNB_DU_ue_id
);
LOG_D
(
F1AP
,
"f1ap_ue_context_setup_resp->gNB_DU_ue_id is: %d
\n
"
,
f1ap_ue_context_setup_resp
->
gNB_DU_ue_id
);
f1ap_cudu_inst_t
*
f1_inst
=
getCxt
(
CUtype
,
instance
);
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupResponseIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_C_RNTI
,
false
);
if
(
ie
==
NULL
)
{
LOG_E
(
F1AP
,
"%s %d: RNTI was not found!
\n
"
,
__FILE__
,
__LINE__
);
return
-
1
;
}
else
{
f1ap_ue_context_setup_resp
->
gNB_DU_ue_id
=
ie
->
value
.
choice
.
C_RNTI
;
f1_inst
->
rnti_update
.
new_rnti
=
f1ap_ue_context_setup_resp
->
gNB_DU_ue_id
;
f1ap_ue_context_setup_resp
->
crnti
=
calloc
(
1
,
sizeof
(
uint16_t
));
*
f1ap_ue_context_setup_resp
->
crnti
=
f1ap_ue_context_setup_resp
->
gNB_DU_ue_id
;
}
// DUtoCURRCInformation
// DUtoCURRCInformation
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupResponseIEs_t
,
ie
,
container
,
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupResponseIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_DUtoCURRCInformation
,
true
);
F1AP_ProtocolIE_ID_id_DUtoCURRCInformation
,
true
);
...
...
openair2/F1AP/f1ap_du_ue_context_management.c
View file @
b7ceb1a9
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
#include <openair3/ocp-gtpu/gtp_itf.h>
#include <openair3/ocp-gtpu/gtp_itf.h>
#include <SIMULATION/TOOLS/sim.h>
bool
DURecvCb
(
protocol_ctxt_t
*
ctxt_pP
,
bool
DURecvCb
(
protocol_ctxt_t
*
ctxt_pP
,
const
srb_flag_t
srb_flagP
,
const
srb_flag_t
srb_flagP
,
...
@@ -291,15 +292,12 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
...
@@ -291,15 +292,12 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
/* optional */
/* optional */
/* c4. C_RNTI */
/* c4. C_RNTI */
if
(
0
)
{
if
(
resp
->
crnti
!=
NULL
)
{
asn1cSequenceAdd
(
out
->
protocolIEs
.
list
,
F1AP_UEContextSetupResponseIEs_t
,
ie4
);
asn1cSequenceAdd
(
out
->
protocolIEs
.
list
,
F1AP_UEContextSetupResponseIEs_t
,
ie4
);
ie4
->
id
=
F1AP_ProtocolIE_ID_id_C_RNTI
;
ie4
->
id
=
F1AP_ProtocolIE_ID_id_C_RNTI
;
ie4
->
criticality
=
F1AP_Criticality_ignore
;
ie4
->
criticality
=
F1AP_Criticality_ignore
;
ie4
->
value
.
present
=
F1AP_UEContextSetupResponseIEs__value_PR_C_RNTI
;
ie4
->
value
.
present
=
F1AP_UEContextSetupResponseIEs__value_PR_C_RNTI
;
//C_RNTI_TO_BIT_STRING(rntiP, &ie->value.choice.C_RNTI);
ie4
->
value
.
choice
.
C_RNTI
=
*
resp
->
crnti
;
ie4
->
value
.
choice
.
C_RNTI
=
0
;
AssertFatal
(
false
,
"not implemented
\n
"
);
LOG_E
(
F1AP
,
"RNTI to code!
\n
"
);
}
}
/* optional */
/* optional */
...
...
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c
View file @
b7ceb1a9
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
#include "mac_rrc_ul.h"
#include "mac_rrc_ul.h"
static
void
ue_context_setup_response_direct
(
const
f1ap_ue_context_setup_t
*
req
,
const
f1ap_ue_context_setup_t
*
resp
)
static
void
ue_context_setup_response_direct
(
instance_t
instance
,
const
f1ap_ue_context_setup_t
*
req
,
const
f1ap_ue_context_setup_t
*
resp
)
{
{
DevAssert
(
req
->
drbs_to_be_setup_length
==
resp
->
drbs_to_be_setup_length
);
DevAssert
(
req
->
drbs_to_be_setup_length
==
resp
->
drbs_to_be_setup_length
);
AssertFatal
(
req
->
drbs_to_be_setup_length
==
0
,
"not implemented
\n
"
);
AssertFatal
(
req
->
drbs_to_be_setup_length
==
0
,
"not implemented
\n
"
);
...
...
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c
View file @
b7ceb1a9
...
@@ -29,12 +29,13 @@
...
@@ -29,12 +29,13 @@
#include "mac_rrc_ul.h"
#include "mac_rrc_ul.h"
static
void
ue_context_setup_response_f1ap
(
const
f1ap_ue_context_setup_t
*
req
,
const
f1ap_ue_context_setup_t
*
resp
)
static
void
ue_context_setup_response_f1ap
(
instance_t
instance
,
const
f1ap_ue_context_setup_t
*
req
,
const
f1ap_ue_context_setup_t
*
resp
)
{
{
DevAssert
(
req
->
drbs_to_be_setup_length
==
resp
->
drbs_to_be_setup_length
);
DevAssert
(
req
->
drbs_to_be_setup_length
==
resp
->
drbs_to_be_setup_length
);
AssertFatal
(
req
->
drbs_to_be_setup_length
==
0
,
"not implmented
\n
"
);
DevAssert
(
req
->
srbs_to_be_setup_length
==
resp
->
srbs_to_be_setup_length
);
DevAssert
(
req
->
srbs_to_be_setup_length
==
resp
->
srbs_to_be_setup_length
);
MessageDef
*
msg
=
itti_alloc_new_message
(
TASK_MAC_GNB
,
0
,
F1AP_UE_CONTEXT_SETUP_RESP
);
MessageDef
*
msg
=
itti_alloc_new_message
(
TASK_MAC_GNB
,
0
,
F1AP_UE_CONTEXT_SETUP_RESP
);
f1ap_ue_context_setup_t
*
f1ap_msg
=
&
F1AP_UE_CONTEXT_SETUP_RESP
(
msg
);
f1ap_ue_context_setup_t
*
f1ap_msg
=
&
F1AP_UE_CONTEXT_SETUP_RESP
(
msg
);
/* copy all fields, but reallocate rrc_containers! */
/* copy all fields, but reallocate rrc_containers! */
...
@@ -48,6 +49,15 @@ static void ue_context_setup_response_f1ap(const f1ap_ue_context_setup_t *req, c
...
@@ -48,6 +49,15 @@ static void ue_context_setup_response_f1ap(const f1ap_ue_context_setup_t *req, c
f1ap_msg
->
srbs_to_be_setup
[
i
]
=
resp
->
srbs_to_be_setup
[
i
];
f1ap_msg
->
srbs_to_be_setup
[
i
]
=
resp
->
srbs_to_be_setup
[
i
];
}
}
if
(
resp
->
drbs_to_be_setup_length
>
0
)
{
DevAssert
(
resp
->
drbs_to_be_setup
!=
NULL
);
f1ap_msg
->
drbs_to_be_setup_length
=
resp
->
drbs_to_be_setup_length
;
f1ap_msg
->
drbs_to_be_setup
=
calloc
(
f1ap_msg
->
drbs_to_be_setup_length
,
sizeof
(
*
f1ap_msg
->
drbs_to_be_setup
));
for
(
int
i
=
0
;
i
<
f1ap_msg
->
drbs_to_be_setup_length
;
++
i
)
{
f1ap_msg
->
drbs_to_be_setup
[
i
]
=
resp
->
drbs_to_be_setup
[
i
];
}
}
f1ap_msg
->
du_to_cu_rrc_information
=
malloc
(
sizeof
(
*
resp
->
du_to_cu_rrc_information
));
f1ap_msg
->
du_to_cu_rrc_information
=
malloc
(
sizeof
(
*
resp
->
du_to_cu_rrc_information
));
AssertFatal
(
f1ap_msg
->
du_to_cu_rrc_information
!=
NULL
,
"out of memory
\n
"
);
AssertFatal
(
f1ap_msg
->
du_to_cu_rrc_information
!=
NULL
,
"out of memory
\n
"
);
f1ap_msg
->
du_to_cu_rrc_information_length
=
resp
->
du_to_cu_rrc_information_length
;
f1ap_msg
->
du_to_cu_rrc_information_length
=
resp
->
du_to_cu_rrc_information_length
;
...
@@ -57,7 +67,7 @@ static void ue_context_setup_response_f1ap(const f1ap_ue_context_setup_t *req, c
...
@@ -57,7 +67,7 @@ static void ue_context_setup_response_f1ap(const f1ap_ue_context_setup_t *req, c
AssertFatal
(
du2cu
->
cellGroupConfig
!=
NULL
,
"out of memory
\n
"
);
AssertFatal
(
du2cu
->
cellGroupConfig
!=
NULL
,
"out of memory
\n
"
);
memcpy
(
du2cu
->
cellGroupConfig
,
resp
->
du_to_cu_rrc_information
->
cellGroupConfig
,
du2cu
->
cellGroupConfig_length
);
memcpy
(
du2cu
->
cellGroupConfig
,
resp
->
du_to_cu_rrc_information
->
cellGroupConfig
,
du2cu
->
cellGroupConfig_length
);
itti_send_msg_to_task
(
TASK_DU_F1
,
0
,
msg
);
itti_send_msg_to_task
(
TASK_DU_F1
,
instance
,
msg
);
}
}
static
void
ue_context_modification_response_f1ap
(
const
f1ap_ue_context_modif_req_t
*
req
,
const
f1ap_ue_context_modif_resp_t
*
resp
)
static
void
ue_context_modification_response_f1ap
(
const
f1ap_ue_context_modif_req_t
*
req
,
const
f1ap_ue_context_modif_resp_t
*
resp
)
...
...
openair2/RRC/NR/rrc_gNB.c
View file @
b7ceb1a9
...
@@ -2253,15 +2253,42 @@ void rrc_gNB_process_dc_overall_timeout(const module_id_t gnb_mod_idP, x2ap_ENDC
...
@@ -2253,15 +2253,42 @@ void rrc_gNB_process_dc_overall_timeout(const module_id_t gnb_mod_idP, x2ap_ENDC
rrc_remove_nsa_user
(
rrc
,
m
->
rnti
);
rrc_remove_nsa_user
(
rrc
,
m
->
rnti
);
}
}
struct
rrc_gNB_ue_context_s
*
find_ho_ue_context_in_source
(
uint8_t
modid_t
,
uint8_t
*
modid_s
,
uint8_t
*
ho_idx
)
{
for
(
int
ho_id
=
0
;
ho_id
<
NUMBER_OF_DU_PER_CU_MAX
;
ho_id
++
)
{
if
(
ho_rnti_map
[
ho_id
][
3
]
==
modid_t
)
{
if
(
modid_s
!=
NULL
)
{
*
modid_s
=
ho_rnti_map
[
ho_id
][
1
];
}
if
(
ho_idx
!=
NULL
)
{
*
ho_idx
=
ho_id
;
}
return
rrc_gNB_get_ue_context_by_rnti
(
RC
.
nrrrc
[
ho_rnti_map
[
ho_id
][
1
]],
ho_rnti_map
[
ho_id
][
0
]);
}
}
return
NULL
;
}
static
void
rrc_CU_process_ue_context_setup_response
(
MessageDef
*
msg_p
,
instance_t
instance
)
static
void
rrc_CU_process_ue_context_setup_response
(
MessageDef
*
msg_p
,
instance_t
instance
)
{
{
f1ap_ue_context_setup_t
*
resp
=
&
F1AP_UE_CONTEXT_SETUP_RESP
(
msg_p
);
f1ap_ue_context_setup_t
*
resp
=
&
F1AP_UE_CONTEXT_SETUP_RESP
(
msg_p
);
gNB_RRC_INST
*
rrc
=
RC
.
nrrrc
[
instance
];
gNB_RRC_INST
*
rrc
=
RC
.
nrrrc
[
instance
];
uint8_t
modid_s
;
uint8_t
ho_idx
;
rrc_gNB_ue_context_t
*
ho_ue_context_in_source
=
NULL
;
rrc_gNB_ue_context_t
*
ue_context_p
=
rrc_gNB_get_ue_context
(
rrc
,
resp
->
gNB_CU_ue_id
);
rrc_gNB_ue_context_t
*
ue_context_p
=
rrc_gNB_get_ue_context
(
rrc
,
resp
->
gNB_CU_ue_id
);
if
(
!
ue_context_p
)
{
rrc_gNB_ue_context_t
*
ue_context_old
=
NULL
;
LOG_E
(
RRC
,
"could not find UE context for CU UE ID %u, aborting transaction
\n
"
,
resp
->
gNB_CU_ue_id
);
if
(
ue_context_p
==
NULL
&&
resp
->
crnti
!=
NULL
)
{
return
;
uint64_t
random_value
;
fill_random
(
&
random_value
,
sizeof
(
random_value
));
random_value
=
random_value
&
0x7fffffffff
;
ue_context_p
=
rrc_gNB_create_ue_context
(
*
resp
->
crnti
,
rrc
,
random_value
,
resp
->
gNB_DU_ue_id
);
ho_ue_context_in_source
=
find_ho_ue_context_in_source
(
instance
,
&
modid_s
,
&
ho_idx
);
ho_rnti_map
[
ho_idx
][
2
]
=
resp
->
gNB_DU_ue_id
;
ue_context_old
=
rrc_gNB_get_ue_context_by_rnti
(
RC
.
nrrrc
[
modid_s
],
ho_rnti_map
[
ho_idx
][
0
]);
ue_context_p
->
ue_context
.
handover_info
=
ue_context_old
->
ue_context
.
handover_info
;
}
}
gNB_RRC_UE_t
*
UE
=
&
ue_context_p
->
ue_context
;
gNB_RRC_UE_t
*
UE
=
&
ue_context_p
->
ue_context
;
NR_CellGroupConfig_t
*
cellGroupConfig
=
NULL
;
NR_CellGroupConfig_t
*
cellGroupConfig
=
NULL
;
...
@@ -2283,6 +2310,39 @@ static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, instance
...
@@ -2283,6 +2310,39 @@ static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, instance
/* at this point, we don't have to do anything: the UE context setup request
/* at this point, we don't have to do anything: the UE context setup request
* includes the Security Command, whose response will trigger the following
* includes the Security Command, whose response will trigger the following
* messages (UE capability, to be specific) */
* messages (UE capability, to be specific) */
if
(
ho_ue_context_in_source
!=
NULL
)
{
MessageDef
*
message_p
;
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB
,
0
,
F1AP_UE_CONTEXT_MODIFICATION_REQ
);
f1ap_ue_context_setup_t
*
req
=
&
F1AP_UE_CONTEXT_MODIFICATION_REQ
(
message_p
);
req
->
gNB_CU_ue_id
=
UE
->
rrc_ue_id
;
req
->
gNB_DU_ue_id
=
ho_ue_context_in_source
->
ue_context
.
rnti
;
req
->
mcc
=
RC
.
nrrrc
[
modid_s
]
->
configuration
.
mcc
[
0
];
req
->
mnc
=
RC
.
nrrrc
[
modid_s
]
->
configuration
.
mnc
[
0
];
req
->
mnc_digit_length
=
RC
.
nrrrc
[
modid_s
]
->
configuration
.
mnc_digit_length
[
0
];
req
->
nr_cellid
=
RC
.
nrrrc
[
modid_s
]
->
nr_cellid
;
protocol_ctxt_t
ctxt
=
{.
rntiMaybeUEid
=
ho_rnti_map
[
ho_idx
][
0
],
.
module_id
=
instance
,
.
instance
=
RC
.
nrrrc
[
instance
]
->
f1_instance
,
.
enb_flag
=
1
,
.
eNB_index
=
instance
};
req
->
rrc_container
=
calloc
(
1
,
RRC_BUF_SIZE
*
sizeof
(
uint8_t
));
req
->
rrc_container_length
=
rrc_gNB_generate_HO_RRCReconfiguration
(
&
ctxt
,
modid_s
,
instance
,
ue_context_p
,
ue_context_old
,
req
->
rrc_container
,
RRC_BUF_SIZE
,
cellGroupConfig
);
// To DU send the Downlink Data Delivery Status
req
->
ReconfigComplOutcome
=
RRCreconf_success
;
// To stop the data transmission
req
->
transmission_action_indicator
=
calloc
(
1
,
sizeof
(
uint8_t
));
*
req
->
transmission_action_indicator
=
0
;
itti_send_msg_to_task
(
TASK_CU_F1
,
RC
.
nrrrc
[
modid_s
]
->
f1_instance
,
message_p
);
}
}
}
static
void
rrc_CU_process_ue_context_release_request
(
MessageDef
*
msg_p
)
static
void
rrc_CU_process_ue_context_release_request
(
MessageDef
*
msg_p
)
...
...
openair2/RRC/NR/rrc_gNB_UE_context.c
View file @
b7ceb1a9
...
@@ -171,9 +171,9 @@ rrc_gNB_ue_context_t *rrc_gNB_create_ue_context(rnti_t rnti,
...
@@ -171,9 +171,9 @@ rrc_gNB_ue_context_t *rrc_gNB_create_ue_context(rnti_t rnti,
ue
->
rnti
=
rnti
;
ue
->
rnti
=
rnti
;
ue
->
random_ue_identity
=
ue_identityP
;
ue
->
random_ue_identity
=
ue_identityP
;
f1_ue_data_t
ue_data
=
{.
secondary_ue
=
du_ue_id
};
f1_ue_data_t
ue_data
=
{.
secondary_ue
=
du_ue_id
};
AssertFatal
(
!
cu_exists_f1_ue_data
(
ue
->
rrc_ue_id
),
//
AssertFatal(!cu_exists_f1_ue_data(ue->rrc_ue_id),
"UE F1 Context for ID %d already exists, logic bug
\n
"
,
//
"UE F1 Context for ID %d already exists, logic bug\n",
ue
->
rrc_ue_id
);
//
ue->rrc_ue_id);
cu_add_f1_ue_data
(
ue
->
rrc_ue_id
,
&
ue_data
);
cu_add_f1_ue_data
(
ue
->
rrc_ue_id
,
&
ue_data
);
RB_INSERT
(
rrc_nr_ue_tree_s
,
&
rrc_instance_pP
->
rrc_ue_head
,
ue_context_p
);
RB_INSERT
(
rrc_nr_ue_tree_s
,
&
rrc_instance_pP
->
rrc_ue_head
,
ue_context_p
);
...
...
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