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
c271cfc0
Commit
c271cfc0
authored
Feb 04, 2022
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check Requested NSSAIs from RegistrationRequest
parent
e11c85c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
10 deletions
+64
-10
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+62
-9
src/amf-app/amf_n1.hpp
src/amf-app/amf_n1.hpp
+2
-1
No files found.
src/amf-app/amf_n1.cpp
View file @
c271cfc0
...
...
@@ -1439,12 +1439,6 @@ void amf_n1::run_registration_procedure(std::shared_ptr<nas_context>& nc) {
nc
.
get
()
->
ngKsi
=
ngksi
;
}
// If current AMF can't handle this UE, reroute the Registration Request to
// a target AMF
if
(
reroute_registration_request
(
nc
))
{
return
;
}
handle_auth_vector_successful_result
(
nc
);
}
else
if
(
nc
.
get
()
->
is_5g_guti_present
)
{
...
...
@@ -2320,6 +2314,12 @@ void amf_n1::security_mode_complete_handle(
}
}
// If current AMF can't handle this UE, reroute the Registration Request to
// a target AMF
if
(
reroute_registration_request
(
nc
))
{
return
;
}
// Encoding REGISTRATION ACCEPT
auto
registration_accept
=
std
::
make_unique
<
RegistrationAccept
>
();
initialize_registration_accept
(
registration_accept
,
nc
);
...
...
@@ -3702,6 +3702,14 @@ bool amf_n1::reroute_registration_request(std::shared_ptr<nas_context>& nc) {
"Registration with AMF re-allocation, Reroute Registration Request to "
"the target AMF"
);
// Check if the AMF can serve all the requested S-NSSAIs
if
(
check_requested_nssai
(
nc
))
{
Logger
::
amf_n1
().
debug
(
"Current AMF can handle all the requested NSSAIs, do not need to "
"perform AMF Re-allocation procedure"
);
return
false
;
}
// Get NSSAI from UDM
oai
::
amf
::
model
::
Nssai
nssai
=
{};
if
(
!
get_slice_selection_subscription_data
(
nc
,
nssai
))
{
...
...
@@ -3713,9 +3721,10 @@ bool amf_n1::reroute_registration_request(std::shared_ptr<nas_context>& nc) {
// TODO: Update subscribed NSSAIs
// Check that AMF can process the Requested NSSAIs or not
if
(
check_
request
ed_nssai
(
nc
,
nssai
))
{
if
(
check_
subscrib
ed_nssai
(
nc
,
nssai
))
{
Logger
::
amf_n1
().
debug
(
"Current AMF can handle all the Subscribed NSSAIs, do not need to "
"Current AMF can handle the Requested/Subscribed NSSAIs, do not need "
"to "
"perform AMF Re-allocation procedure"
);
return
false
;
}
...
...
@@ -3761,7 +3770,51 @@ bool amf_n1::reroute_registration_request(std::shared_ptr<nas_context>& nc) {
}
//------------------------------------------------------------------------------
bool
amf_n1
::
check_requested_nssai
(
bool
amf_n1
::
check_requested_nssai
(
const
std
::
shared_ptr
<
nas_context
>&
nc
)
{
std
::
shared_ptr
<
ue_context
>
uc
=
{};
if
(
!
find_ue_context
(
nc
.
get
()
->
ran_ue_ngap_id
,
nc
.
get
()
->
amf_ue_ngap_id
,
uc
))
{
Logger
::
amf_n1
().
warn
(
"Cannot find the UE context"
);
return
false
;
}
// If there no requested NSSAIs
if
(
nc
->
requestedNssai
.
size
()
==
0
)
{
return
false
;
}
bool
result
=
false
;
for
(
auto
p
:
amf_cfg
.
plmn_list
)
{
// Check PLMN/TAC
if
((
uc
.
get
()
->
tai
.
mcc
.
compare
(
p
.
mcc
)
!=
0
)
or
(
uc
.
get
()
->
tai
.
mnc
.
compare
(
p
.
mnc
)
!=
0
)
or
(
uc
.
get
()
->
tai
.
tac
!=
p
.
tac
))
{
continue
;
}
result
=
true
;
// check if AMF can serve all the common NSSAIs
for
(
auto
n
:
nc
->
requestedNssai
)
{
bool
found_nssai
=
false
;
for
(
auto
s
:
p
.
slice_list
)
{
std
::
string
sd
=
std
::
to_string
(
s
.
sd
);
if
((
s
.
sst
==
n
.
sst
)
and
(
s
.
sd
==
n
.
sd
))
{
found_nssai
=
true
;
Logger
::
amf_n1
().
debug
(
"Found S-NSSAI (SST %d, SD %d)"
,
s
.
sst
,
n
.
sd
);
break
;
}
}
if
(
!
found_nssai
)
{
result
=
false
;
break
;
}
}
}
return
result
;
}
//------------------------------------------------------------------------------
bool
amf_n1
::
check_subscribed_nssai
(
const
std
::
shared_ptr
<
nas_context
>&
nc
,
oai
::
amf
::
model
::
Nssai
&
nssai
)
{
// Check if the AMF can serve all the subscribed S-NSSAIs
...
...
src/amf-app/amf_n1.hpp
View file @
c271cfc0
...
...
@@ -226,8 +226,9 @@ class amf_n1 {
const
std
::
shared_ptr
<
nas_context
>&
nc
,
oai
::
amf
::
model
::
Nssai
&
nssai
);
bool
get_slice_selection_subscription_data_from_conf_file
(
const
std
::
shared_ptr
<
nas_context
>&
nc
,
oai
::
amf
::
model
::
Nssai
&
nssai
);
bool
check_
request
ed_nssai
(
bool
check_
subscrib
ed_nssai
(
const
std
::
shared_ptr
<
nas_context
>&
nc
,
oai
::
amf
::
model
::
Nssai
&
nssai
);
bool
check_requested_nssai
(
const
std
::
shared_ptr
<
nas_context
>&
nc
);
bool
get_network_slice_selection
(
const
std
::
shared_ptr
<
nas_context
>&
nc
,
const
std
::
string
&
nf_instance_id
,
const
oai
::
amf
::
model
::
SliceInfoForRegistration
&
slice_info
,
...
...
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