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
lizhongxiao
OpenXG-RAN
Commits
0ca262dd
Commit
0ca262dd
authored
Oct 11, 2023
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement PDU session setup during NGAP Initial Setup
parent
38aab8d0
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
152 additions
and
107 deletions
+152
-107
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c
+7
-0
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c
+7
-0
openair2/RRC/NR/nr_rrc_proto.h
openair2/RRC/NR/nr_rrc_proto.h
+3
-1
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+44
-5
openair2/RRC/NR/rrc_gNB_NGAP.c
openair2/RRC/NR/rrc_gNB_NGAP.c
+91
-101
No files found.
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c
View file @
0ca262dd
...
...
@@ -82,6 +82,13 @@ static void ue_context_setup_response_direct(const f1ap_ue_context_setup_t *req,
for
(
int
i
=
0
;
i
<
f1ap_msg
->
srbs_to_be_setup_length
;
++
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
));
AssertFatal
(
f1ap_msg
->
du_to_cu_rrc_information
!=
NULL
,
"out of memory
\n
"
);
...
...
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c
View file @
0ca262dd
...
...
@@ -117,6 +117,13 @@ static void ue_context_setup_response_f1ap(const f1ap_ue_context_setup_t *req, c
for
(
int
i
=
0
;
i
<
f1ap_msg
->
srbs_to_be_setup_length
;
++
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
));
AssertFatal
(
f1ap_msg
->
du_to_cu_rrc_information
!=
NULL
,
"out of memory
\n
"
);
...
...
openair2/RRC/NR/nr_rrc_proto.h
View file @
0ca262dd
...
...
@@ -81,7 +81,9 @@ int parse_CG_ConfigInfo(gNB_RRC_INST *rrc, NR_CG_ConfigInfo_t *CG_ConfigInfo, x2
void
rrc_gNB_generate_SecurityModeCommand
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
rrc_gNB_ue_context_t
*
const
ue_context_pP
rrc_gNB_ue_context_t
*
const
ue_context_pP
,
int
n_drbs
,
const
f1ap_drb_to_be_setup_t
*
drbs
);
unsigned
int
rrc_gNB_get_next_transaction_identifier
(
module_id_t
gnb_mod_idP
);
...
...
openair2/RRC/NR/rrc_gNB.c
View file @
0ca262dd
...
...
@@ -1992,6 +1992,29 @@ static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, instance
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
))
xer_fprint
(
stdout
,
&
asn_DEF_NR_CellGroupConfig
,
UE
->
masterCellGroup
);
if
(
resp
->
drbs_to_be_setup_length
>
0
)
{
AssertFatal
(
resp
->
srbs_to_be_setup_length
>
1
,
"logic bug: we set up DRBs, so need to have both SRB1&SRB2
\n
"
);
e1ap_bearer_setup_req_t
req
=
{
0
};
req
.
numPDUSessionsMod
=
UE
->
nb_of_pdusessions
;
req
.
gNB_cu_cp_ue_id
=
UE
->
rrc_ue_id
;
req
.
gNB_cu_up_ue_id
=
UE
->
rrc_ue_id
;
for
(
int
i
=
0
;
i
<
req
.
numPDUSessionsMod
;
i
++
)
{
req
.
pduSessionMod
[
i
].
numDRB2Modify
=
resp
->
drbs_to_be_setup_length
;
for
(
int
j
=
0
;
j
<
resp
->
drbs_to_be_setup_length
;
j
++
)
{
f1ap_drb_to_be_setup_t
*
drb_f1
=
resp
->
drbs_to_be_setup
+
j
;
DRB_nGRAN_to_setup_t
*
drb_e1
=
req
.
pduSessionMod
[
i
].
DRBnGRanModList
+
j
;
drb_e1
->
id
=
drb_f1
->
drb_id
;
drb_e1
->
numDlUpParam
=
drb_f1
->
up_dl_tnl_length
;
drb_e1
->
DlUpParamList
[
0
].
tlAddress
=
drb_f1
->
up_dl_tnl
[
0
].
tl_address
;
drb_e1
->
DlUpParamList
[
0
].
teId
=
drb_f1
->
up_dl_tnl
[
0
].
teid
;
}
}
// send the F1 response message up to update F1-U tunnel info
rrc
->
cucp_cuup
.
bearer_context_mod
(
&
req
,
instance
);
}
/* 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
* messages (UE capability, to be specific) */
...
...
@@ -2363,13 +2386,14 @@ void prepare_and_send_ue_context_modification_f1(rrc_gNB_ue_context_t *ue_contex
if
(
!
UE
->
as_security_active
)
{
/* no AS security active, need to send UE context setup req with security
* command (and the bearers) */
AssertFatal
(
false
,
"not implemented yet
\n
"
);
protocol_ctxt_t
ctxt
=
{.
rntiMaybeUEid
=
UE
->
rrc_ue_id
};
rrc_gNB_generate_SecurityModeCommand
(
&
ctxt
,
ue_context_p
,
nb_drb
,
drbs
);
return
;
}
/* Instruction towards the DU for SRB2 configuration */
int
nb_srb
=
0
;
f1ap_srb_to_be_setup_t
srbs
[
1
];
f1ap_srb_to_be_setup_t
srbs
[
1
]
=
{
0
}
;
if
(
UE
->
Srb
[
2
].
Active
==
0
)
{
UE
->
Srb
[
2
].
Active
=
1
;
nb_srb
=
1
;
...
...
@@ -2745,7 +2769,9 @@ static void rrc_deliver_ue_ctxt_setup_req(void *deliver_pdu_data, ue_id_t ue_id,
void
rrc_gNB_generate_SecurityModeCommand
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
rrc_gNB_ue_context_t
*
const
ue_context_pP
rrc_gNB_ue_context_t
*
const
ue_context_pP
,
int
n_drbs
,
const
f1ap_drb_to_be_setup_t
*
drbs
)
//-----------------------------------------------------------------------------
{
...
...
@@ -2771,6 +2797,17 @@ rrc_gNB_generate_SecurityModeCommand(
cu2du
.
uE_CapabilityRAT_ContainerList_length
=
ue_p
->
ue_cap_buffer
.
len
;
}
int
nb_srb
=
0
;
f1ap_srb_to_be_setup_t
srbs
[
1
]
=
{
0
};
if
(
n_drbs
>
0
)
{
AssertFatal
(
drbs
!=
NULL
,
"logic bug: n_drbs %d drbs %p
\n
"
,
n_drbs
,
drbs
);
AssertFatal
(
ue_p
->
Srb
[
2
].
Active
==
0
,
"logic bug: security command, but SRB2 already active
\n
"
);
ue_p
->
Srb
[
2
].
Active
=
1
;
nb_srb
=
1
;
srbs
[
0
].
srb_id
=
2
;
srbs
[
0
].
lcid
=
2
;
}
const
nr_rrc_du_container_t
*
du
=
rrc
->
du
;
DevAssert
(
du
!=
NULL
);
...
...
@@ -2784,8 +2821,10 @@ rrc_gNB_generate_SecurityModeCommand(
.
plmn
.
mnc_digit_length
=
rrc
->
configuration
.
mnc_digit_length
[
0
],
.
nr_cellid
=
rrc
->
nr_cellid
,
.
servCellId
=
0
,
/* TODO: correct value? */
.
srbs_to_be_setup
=
0
,
/* no new SRBs */
.
drbs_to_be_setup
=
0
,
/* no new DRBs */
.
srbs_to_be_setup_length
=
nb_srb
,
.
srbs_to_be_setup
=
srbs
,
.
drbs_to_be_setup_length
=
n_drbs
,
.
drbs_to_be_setup
=
drbs
,
.
cu_to_du_rrc_information
=
cu2du_p
,
};
deliver_ue_ctxt_setup_data_t
data
=
{.
rrc
=
rrc
,
.
setup_req
=
&
ue_context_setup_req
};
...
...
openair2/RRC/NR/rrc_gNB_NGAP.c
View file @
0ca262dd
This diff is collapsed.
Click to expand it.
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