Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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-AMF
Commits
b48bf8bd
Commit
b48bf8bd
authored
Mar 08, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix mapping between RAN UE NGAP ID and UE context
parent
280954f5
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
182 additions
and
55 deletions
+182
-55
src/amf-app/amf_app.cpp
src/amf-app/amf_app.cpp
+14
-8
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+7
-4
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+127
-35
src/amf-app/amf_n2.hpp
src/amf-app/amf_n2.hpp
+27
-7
src/common/amf.hpp
src/common/amf.hpp
+1
-0
src/contexts/gNB_context.hpp
src/contexts/gNB_context.hpp
+1
-1
src/contexts/ue_context.cpp
src/contexts/ue_context.cpp
+1
-0
src/contexts/ue_context.hpp
src/contexts/ue_context.hpp
+1
-0
src/itti/msgs/itti_msg_amf_app.hpp
src/itti/msgs/itti_msg_amf_app.hpp
+3
-0
No files found.
src/amf-app/amf_app.cpp
View file @
b48bf8bd
...
...
@@ -387,11 +387,14 @@ void amf_app::handle_itti_message(
// Update AMF UE NGAP ID
std
::
shared_ptr
<
ue_ngap_context
>
unc
=
{};
if
(
!
amf_n2_inst
->
ran_ue_id_2_ue_ngap_context
(
itti_msg
.
ran_ue_ngap_id
,
unc
))
{
if
(
!
amf_n2_inst
->
ran_ue_id_2_ue_ngap_context
(
itti_msg
.
ran_ue_ngap_id
,
itti_msg
.
gnb_id
,
unc
))
{
Logger
::
amf_n1
().
error
(
"Could not find UE NGAP Context with ran_ue_ngap_id "
"("
GNB_UE_NGAP_ID_FMT
")"
,
itti_msg
.
ran_ue_ngap_id
);
"("
GNB_UE_NGAP_ID_FMT
"), gNB ID "
"("
GNB_ID_FMT
")"
,
itti_msg
.
ran_ue_ngap_id
,
itti_msg
.
gnb_id
);
}
else
{
unc
->
amf_ue_ngap_id
=
amf_ue_ngap_id
;
amf_n2_inst
->
set_amf_ue_ngap_id_2_ue_ngap_context
(
amf_ue_ngap_id
,
unc
);
...
...
@@ -409,6 +412,7 @@ void amf_app::handle_itti_message(
uc
->
ran_ue_ngap_id
=
itti_msg
.
ran_ue_ngap_id
;
uc
->
amf_ue_ngap_id
=
amf_ue_ngap_id
;
uc
->
gnb_id
=
itti_msg
.
gnb_id
;
std
::
string
guti
=
{};
bool
is_guti_valid
=
false
;
...
...
@@ -472,11 +476,10 @@ void amf_app::handle_itti_message(itti_sbi_n1_message_notification& itti_msg) {
registration_context
.
getRanNodeId
();
// RAN UE NGAP ID
uint32_t
ran_ue_ngap_id
=
registration_context
.
getAnN2ApId
();
uint32_t
gnb_id
=
{};
if
(
ran_node_id
.
gNbIdIsSet
())
{
oai
::
amf
::
model
::
GNbId
gnb_id_model
=
ran_node_id
.
getGNbId
();
uint32_t
gnb_id
=
{};
try
{
gnb_id
=
std
::
stoul
(
gnb_id_model
.
getGNBValue
(),
nullptr
,
10
);
}
catch
(
const
std
::
exception
&
e
)
{
...
...
@@ -517,6 +520,7 @@ void amf_app::handle_itti_message(itti_sbi_n1_message_notification& itti_msg) {
uc
=
std
::
shared_ptr
<
ue_context
>
(
new
ue_context
());
uc
->
amf_ue_ngap_id
=
-
1
;
uc
->
supi
=
supi
;
uc
->
gnb_id
=
gnb_id
;
set_supi_2_ue_context
(
supi
,
uc
);
}
}
...
...
@@ -555,6 +559,7 @@ void amf_app::handle_itti_message(itti_sbi_n1_message_notification& itti_msg) {
"Create a new UE Context with UE Context Key"
,
ue_context_key
.
c_str
());
uc
=
std
::
make_shared
<
ue_context
>
();
uc
->
gnb_id
=
gnb_id
;
}
set_ran_amf_id_2_ue_context
(
ue_context_key
,
uc
);
}
...
...
@@ -583,12 +588,13 @@ void amf_app::handle_itti_message(itti_sbi_n1_message_notification& itti_msg) {
// Step 4. Create UE NGAP Context if necessary
// Create/Update UE NGAP Context
std
::
shared_ptr
<
ue_ngap_context
>
unc
=
{};
if
(
!
amf_n2_inst
->
ran_ue_id_2_ue_ngap_context
(
ran_ue_ngap_id
,
unc
))
{
if
(
!
amf_n2_inst
->
ran_ue_id_2_ue_ngap_context
(
ran_ue_ngap_id
,
gnb_id
,
unc
))
{
Logger
::
amf_app
().
debug
(
"Create a new UE NGAP context with ran_ue_ngap_id "
GNB_UE_NGAP_ID_FMT
,
ran_ue_ngap_id
);
unc
=
std
::
shared_ptr
<
ue_ngap_context
>
(
new
ue_ngap_context
());
amf_n2_inst
->
set_ran_ue_ngap_id_2_ue_ngap_context
(
ran_ue_ngap_id
,
unc
);
amf_n2_inst
->
set_ran_ue_ngap_id_2_ue_ngap_context
(
ran_ue_ngap_id
,
gnb_id
,
unc
);
}
// Store related information into UE NGAP context
...
...
src/amf-app/amf_n1.cpp
View file @
b48bf8bd
...
...
@@ -1270,7 +1270,8 @@ void amf_n1::registration_request_handle(
if
(
uc
)
uc
.
reset
();
std
::
shared_ptr
<
ue_ngap_context
>
unc
=
{};
if
(
!
amf_n2_inst
->
ran_ue_id_2_ue_ngap_context
(
ran_ue_ngap_id
,
unc
))
{
if
(
!
amf_n2_inst
->
ran_ue_id_2_ue_ngap_context
(
ran_ue_ngap_id
,
uc
->
gnb_id
,
unc
))
{
Logger
::
amf_n1
().
error
(
"No UE NGAP context with ran_ue_ngap_id ("
GNB_UE_NGAP_ID_FMT
")"
,
ran_ue_ngap_id
);
...
...
@@ -2618,7 +2619,8 @@ void amf_n1::security_mode_complete_handle(
// Find UE context
std
::
shared_ptr
<
ue_ngap_context
>
unc
=
{};
if
(
!
amf_n2_inst
->
ran_ue_id_2_ue_ngap_context
(
ran_ue_ngap_id
,
unc
))
{
if
(
!
amf_n2_inst
->
ran_ue_id_2_ue_ngap_context
(
ran_ue_ngap_id
,
uc
->
gnb_id
,
unc
))
{
Logger
::
amf_n1
().
warn
(
"No UE NGAP context with ran_ue_ngap_id ("
GNB_UE_NGAP_ID_FMT
")"
,
ran_ue_ngap_id
);
...
...
@@ -4122,7 +4124,7 @@ void amf_n1::initialize_registration_accept(
// Allowed/Rejected/Configured NSSAI
// Get the list of common SST, SD between UE and AMF
std
::
vector
<
struct
SNSSAI_s
>
common_nssais
;
amf_n2_inst
->
get_common_NSSAI
(
nc
->
ran_ue_ngap_id
,
common_nssais
);
amf_n2_inst
->
get_common_NSSAI
(
nc
->
ran_ue_ngap_id
,
uc
->
gnb_id
,
common_nssais
);
std
::
vector
<
struct
SNSSAI_s
>
allowed_nssais
;
std
::
vector
<
Rejected_SNSSAI
>
rejected_nssais
;
...
...
@@ -4747,7 +4749,8 @@ bool amf_n1::get_slice_selection_subscription_data_from_conf_file(
// Get UE NGAP Context
std
::
shared_ptr
<
ue_ngap_context
>
unc
=
{};
if
(
!
amf_n2_inst
->
ran_ue_id_2_ue_ngap_context
(
nc
->
ran_ue_ngap_id
,
unc
))
{
if
(
!
amf_n2_inst
->
ran_ue_id_2_ue_ngap_context
(
nc
->
ran_ue_ngap_id
,
uc
->
gnb_id
,
unc
))
{
Logger
::
amf_n1
().
error
(
"No existed UE NGAP context associated with "
"ran_ue_ngap_id "
GNB_UE_NGAP_ID_FMT
,
...
...
src/amf-app/amf_n2.cpp
View file @
b48bf8bd
This diff is collapsed.
Click to expand it.
src/amf-app/amf_n2.hpp
View file @
b48bf8bd
...
...
@@ -222,36 +222,54 @@ class amf_n2 : public ngap::ngap_app {
* @return void
*/
bool
get_common_NSSAI
(
const
uint32_t
&
ran_ue_ngap_id
,
std
::
vector
<
nas
::
SNSSAI_t
>&
common_nssai
);
const
uint32_t
&
ran_ue_ngap_id
,
uint32_t
gnb_id
,
std
::
vector
<
nas
::
SNSSAI_t
>&
common_nssai
);
/*
* Get the UE NGAP context associated with a RAN UE NGAP ID if it exists and
* not null
* @param [const uint32_t&] ran_ue_ngap_id: RAN UE NGAP ID
* @param [const uint32_t&] gnb_id: gNB ID
* @param [std::shared_ptr<ue_ngap_context>&] unc: shared pointer to the
* existing UE NGAP context
* @return true if the context exists and is not null, otherwise return false
*/
bool
ran_ue_id_2_ue_ngap_context
(
const
uint32_t
&
ran_ue_ngap
_id
,
uint32_t
ran_ue_ngap_id
,
uint32_t
gnb
_id
,
std
::
shared_ptr
<
ue_ngap_context
>&
unc
)
const
;
/*
* Get the UE NGAP context associated with a RAN UE NGAP ID if it exists and
* not null
* @param [const uint32_t&] ran_ue_ngap_id: RAN UE NGAP ID
* @param [const std::string&] ue_context_key: UE context key from AMF UE NGAP
* ID and RAN UE NGAP ID
* @param [std::shared_ptr<ue_ngap_context>&] unc: shared pointer to the
* existing UE NGAP context
* @return true if the context exists and is not null, otherwise return false
*/
bool
ran_ue_id_2_ue_ngap_context
(
uint32_t
ran_ue_ngap_id
,
const
std
::
string
&
ue_context_key
,
std
::
shared_ptr
<
ue_ngap_context
>&
unc
)
const
;
/*
* Verify whether a UE NGAP context associated with a RAN UE NGAP ID exists
* @param [const uint32_t&] ran_ue_ngap_id: RAN UE NGAP ID
* @param [const uint32_t&] gnb_id: gNB ID
* @return true if the context exists and is not null, otherwise return false
*/
bool
is_ran_ue_id_2_ue_ngap_context
(
const
uint32_t
&
ran_ue_ngap_id
)
const
;
bool
is_ran_ue_id_2_ue_ngap_context
(
uint32_t
ran_ue_ngap_id
,
uint32_t
gnb_id
)
const
;
/*
* Store UE NGAP context associated with a RAN UE NGAP ID
* @param [const uint32_t&] ran_ue_ngap_id: RAN UE NGAP ID
* @param [const uint32_t&] gnb_id: gNB ID
* @param [const std::shared_ptr<ue_ngap_context>&] unc: pointer to UE NGAP
* context
* @return void
*/
void
set_ran_ue_ngap_id_2_ue_ngap_context
(
const
uint32_t
&
ran_ue_ngap
_id
,
uint32_t
ran_ue_ngap_id
,
uint32_t
gnb
_id
,
const
std
::
shared_ptr
<
ue_ngap_context
>&
unc
);
/*
...
...
@@ -259,14 +277,16 @@ class amf_n2 : public ngap::ngap_app {
* @param [const uint32_t&] ran_ue_ngap_id: RAN UE NGAP ID
* @return void
*/
void
remove_ran_ue_ngap_id_2_ngap_context
(
const
uint32_t
&
ran_ue_ngap_id
);
void
remove_ran_ue_ngap_id_2_ngap_context
(
uint32_t
ran_ue_ngap_id
,
uint32_t
gnb_id
);
/*
* Remove UE Context associated with a RAN UE NGAP ID
* @param [const uint32_t&] ran_ue_ngap_id: RAN UE NGAP ID
* @return void
*/
void
remove_ue_context_with_ran_ue_ngap_id
(
const
uint32_t
&
ran_ue_ngap_id
);
void
remove_ue_context_with_ran_ue_ngap_id
(
uint32_t
ran_ue_ngap_id
,
uint32_t
gnb_id
);
/*
* Verify whether a UE NGAP context associated with a AMF UE NGAP ID exists
...
...
@@ -328,7 +348,7 @@ class amf_n2 : public ngap::ngap_app {
std
::
vector
<
std
::
shared_ptr
<
ue_ngap_context
>>&
ue_contexts
);
private:
std
::
map
<
uint32_t
,
std
::
shared_ptr
<
ue_ngap_context
>>
std
::
map
<
std
::
pair
<
uint32_t
,
uint32_t
>
,
std
::
shared_ptr
<
ue_ngap_context
>>
ranid2uecontext
;
// ran ue ngap id
mutable
std
::
shared_mutex
m_ranid2uecontext
;
...
...
src/common/amf.hpp
View file @
b48bf8bd
...
...
@@ -39,6 +39,7 @@ constexpr auto CURL_MIME_BOUNDARY = "----Boundary";
#define FUTURE_STATUS_TIMEOUT_MS 100
#define GNB_ID_FMT "%" PRIu32
#define GNB_UE_NGAP_ID_FMT "%" PRIu32
#define AMF_UE_NGAP_ID_FMT "%" PRIu64
...
...
src/contexts/gNB_context.hpp
View file @
b48bf8bd
...
...
@@ -54,7 +54,7 @@ class gnb_context {
ng_gnb_state_t
ng_state
;
std
::
string
gnb_name
;
long
globalRanNodeId
;
uint32_t
globalRanNodeId
;
plmn_t
plmn
;
e_Ngap_PagingDRX
default_paging_drx
;
// v32, v64, v128, v256
std
::
vector
<
SupportedTaItem_t
>
s_ta_list
;
...
...
src/contexts/ue_context.cpp
View file @
b48bf8bd
...
...
@@ -25,6 +25,7 @@
ue_context
::
ue_context
()
{
ran_ue_ngap_id
=
0
;
amf_ue_ngap_id
=
-
1
;
gnb_id
=
0
;
rrc_estb_cause
=
{};
isUeContextRequest
=
false
;
cgi
=
{};
...
...
src/contexts/ue_context.hpp
View file @
b48bf8bd
...
...
@@ -57,6 +57,7 @@ class ue_context {
public:
uint32_t
ran_ue_ngap_id
;
// 32bits
long
amf_ue_ngap_id
:
40
;
// 40bits
uint32_t
gnb_id
;
e_Ngap_RRCEstablishmentCause
rrc_estb_cause
;
bool
isUeContextRequest
;
...
...
src/itti/msgs/itti_msg_amf_app.hpp
View file @
b48bf8bd
...
...
@@ -35,15 +35,18 @@ class itti_msg_amf_app : public itti_msg {
const
itti_msg_type_t
msg_type
,
const
task_id_t
origin
,
const
task_id_t
destination
)
:
itti_msg
(
msg_type
,
origin
,
destination
)
{
gnb_id
=
0
;
ran_ue_ngap_id
=
0
;
amf_ue_ngap_id
=
0
;
}
itti_msg_amf_app
(
const
itti_msg_amf_app
&
i
)
:
itti_msg
(
i
)
{
gnb_id
=
i
.
gnb_id
;
ran_ue_ngap_id
=
i
.
ran_ue_ngap_id
;
amf_ue_ngap_id
=
i
.
amf_ue_ngap_id
;
}
uint32_t
gnb_id
;
uint32_t
ran_ue_ngap_id
;
long
amf_ue_ngap_id
;
};
...
...
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