Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-SMF
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
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-SMF
Commits
7e539e72
Commit
7e539e72
authored
Feb 16, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update UPF selection procedure
parent
d978e85e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
17 deletions
+90
-17
src/smf_app/smf_app.cpp
src/smf_app/smf_app.cpp
+1
-0
src/smf_app/smf_app.hpp
src/smf_app/smf_app.hpp
+2
-0
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+18
-4
src/smf_app/smf_procedure.cpp
src/smf_app/smf_procedure.cpp
+69
-13
No files found.
src/smf_app/smf_app.cpp
View file @
7e539e72
...
@@ -543,6 +543,7 @@ void smf_app::handle_itti_msg(
...
@@ -543,6 +543,7 @@ void smf_app::handle_itti_msg(
Logger
::
smf_app
().
debug
(
"Send failure indication to UPF"
);
Logger
::
smf_app
().
debug
(
"Send failure indication to UPF"
);
// TODO: to be completed
// TODO: to be completed
pfcp
::
node_id_t
up_node_id
=
{};
pfcp
::
node_id_t
up_node_id
=
{};
// TODO: Update select_up_node function
if
(
not
pfcp_associations
::
get_instance
().
select_up_node
(
if
(
not
pfcp_associations
::
get_instance
().
select_up_node
(
up_node_id
,
NODE_SELECTION_CRITERIA_MIN_PFCP_SESSIONS
))
{
up_node_id
,
NODE_SELECTION_CRITERIA_MIN_PFCP_SESSIONS
))
{
Logger
::
smf_app
().
info
(
"REMOTE_PEER_NOT_RESPONDING"
);
Logger
::
smf_app
().
info
(
"REMOTE_PEER_NOT_RESPONDING"
);
...
...
src/smf_app/smf_app.hpp
View file @
7e539e72
...
@@ -89,6 +89,7 @@ class smf_context_ref {
...
@@ -89,6 +89,7 @@ class smf_context_ref {
pdu_session_id
=
0
;
pdu_session_id
=
0
;
amf_status_uri
=
""
;
amf_status_uri
=
""
;
amf_addr
=
""
;
amf_addr
=
""
;
upf_node_id
=
{};
}
}
supi_t
supi
;
supi_t
supi
;
...
@@ -97,6 +98,7 @@ class smf_context_ref {
...
@@ -97,6 +98,7 @@ class smf_context_ref {
snssai_t
nssai
;
snssai_t
nssai
;
std
::
string
amf_status_uri
;
std
::
string
amf_status_uri
;
std
::
string
amf_addr
;
std
::
string
amf_addr
;
pfcp
::
node_id_t
upf_node_id
;
};
};
class
smf_app
{
class
smf_app
{
...
...
src/smf_app/smf_context.cpp
View file @
7e539e72
...
@@ -735,12 +735,26 @@ void smf_context::handle_itti_msg(
...
@@ -735,12 +735,26 @@ void smf_context::handle_itti_msg(
if
(
find_pdu_session
(
pdr_id
,
qfi
,
sd
,
sp
))
{
if
(
find_pdu_session
(
pdr_id
,
qfi
,
sd
,
sp
))
{
// Step 1. send N4 Data Report Ack to UPF
// Step 1. send N4 Data Report Ack to UPF
pfcp
::
node_id_t
up_node_id
=
{};
pfcp
::
node_id_t
up_node_id
=
{};
if
(
not
pfcp_associations
::
get_instance
().
select_up_node
(
scid_t
scid
=
get_scid
();
up_node_id
,
NODE_SELECTION_CRITERIA_MIN_PFCP_SESSIONS
))
{
// Get UPF node
Logger
::
smf_app
().
info
(
"REMOTE_PEER_NOT_RESPONDING"
);
std
::
shared_ptr
<
smf_context_ref
>
scf
=
{};
if
(
smf_app_inst
->
is_scid_2_smf_context
(
scid
))
{
scf
=
smf_app_inst
->
scid_2_smf_context
(
scid
);
up_node_id
=
scf
.
get
()
->
upf_node_id
;
}
else
{
Logger
::
smf_app
().
warn
(
"SM Context associated with this id "
SCID_FMT
" does not exit!"
,
scid
);
return
;
return
;
}
}
/*
if (not pfcp_associations::get_instance().select_up_node(
up_node_id, NODE_SELECTION_CRITERIA_MIN_PFCP_SESSIONS)) {
Logger::smf_app().info("REMOTE_PEER_NOT_RESPONDING");
return;
}
*/
itti_n4_session_report_response
*
n4_ser
=
itti_n4_session_report_response
*
n4_ser
=
new
itti_n4_session_report_response
(
TASK_SMF_APP
,
TASK_SMF_N4
);
new
itti_n4_session_report_response
(
TASK_SMF_APP
,
TASK_SMF_N4
);
n4_ser
->
seid
=
req
->
seid
;
n4_ser
->
seid
=
req
->
seid
;
...
...
src/smf_app/smf_procedure.cpp
View file @
7e539e72
...
@@ -104,11 +104,28 @@ int session_create_sm_context_procedure::run(
...
@@ -104,11 +104,28 @@ int session_create_sm_context_procedure::run(
Logger
::
smf_app
().
info
(
"Perform a procedure - Create SM Context Request"
);
Logger
::
smf_app
().
info
(
"Perform a procedure - Create SM Context Request"
);
// TODO check if compatible with ongoing procedures if any
// TODO check if compatible with ongoing procedures if any
pfcp
::
node_id_t
up_node_id
=
{};
pfcp
::
node_id_t
up_node_id
=
{};
snssai_t
snssai
=
sm_context_req
->
req
.
get_snssai
();
std
::
string
dnn
=
sm_context_req
->
req
.
get_dnn
();
// if (not pfcp_associations::get_instance().select_up_node(
// up_node_id, NODE_SELECTION_CRITERIA_MIN_PFCP_SESSIONS)) {
if
(
not
pfcp_associations
::
get_instance
().
select_up_node
(
if
(
not
pfcp_associations
::
get_instance
().
select_up_node
(
up_node_id
,
NODE_SELECTION_CRITERIA_MIN_PFCP_SESSIONS
))
{
up_node_id
,
snssai
,
dnn
))
{
sm_context_resp
->
res
.
set_cause
(
sm_context_resp
->
res
.
set_cause
(
PDU_SESSION_APPLICATION_ERROR_PEER_NOT_RESPONDING
);
PDU_SESSION_APPLICATION_ERROR_PEER_NOT_RESPONDING
);
return
RETURNerror
;
return
RETURNerror
;
}
else
{
// Store UPF node
std
::
shared_ptr
<
smf_context_ref
>
scf
=
{};
if
(
smf_app_inst
->
is_scid_2_smf_context
(
sm_context_req
->
scid
))
{
scf
=
smf_app_inst
->
scid_2_smf_context
(
sm_context_req
->
scid
);
scf
.
get
()
->
upf_node_id
=
up_node_id
;
}
else
{
Logger
::
smf_app
().
warn
(
"SM Context associated with this id "
SCID_FMT
" does not exit!"
,
sm_context_req
->
scid
);
// TODO:
}
}
}
//-------------------
//-------------------
...
@@ -498,14 +515,34 @@ int session_update_sm_context_procedure::run(
...
@@ -498,14 +515,34 @@ int session_update_sm_context_procedure::run(
Logger
::
smf_app
().
info
(
"Perform a procedure - Update SM Context Request"
);
Logger
::
smf_app
().
info
(
"Perform a procedure - Update SM Context Request"
);
// TODO check if compatible with ongoing procedures if any
// TODO check if compatible with ongoing procedures if any
pfcp
::
node_id_t
up_node_id
=
{};
pfcp
::
node_id_t
up_node_id
=
{};
if
(
not
pfcp_associations
::
get_instance
().
select_up_node
(
// Get UPF node
up_node_id
,
NODE_SELECTION_CRITERIA_MIN_PFCP_SESSIONS
))
{
std
::
shared_ptr
<
smf_context_ref
>
scf
=
{};
sm_context_resp
->
res
.
set_cause
(
scid_t
scid
=
{};
PDU_SESSION_APPLICATION_ERROR_PEER_NOT_RESPONDING
);
try
{
Logger
::
smf_app
().
info
(
"[SMF Procedure] REMOTE_PEER_NOT_RESPONDING"
);
scid
=
std
::
stoi
(
sm_context_req
->
scid
);
return
RETURNerror
;
}
catch
(
const
std
::
exception
&
err
)
{
Logger
::
smf_app
().
warn
(
"SM Context associated with this id %s does not exit!"
,
sm_context_req
->
scid
);
}
if
(
smf_app_inst
->
is_scid_2_smf_context
(
scid
))
{
scf
=
smf_app_inst
->
scid_2_smf_context
(
scid
);
up_node_id
=
scf
.
get
()
->
upf_node_id
;
}
else
{
Logger
::
smf_app
().
warn
(
"SM Context associated with this id "
SCID_FMT
" does not exit!"
,
scid
);
// TODO:
}
}
/* if (not pfcp_associations::get_instance().select_up_node(
up_node_id, NODE_SELECTION_CRITERIA_MIN_PFCP_SESSIONS)) {
sm_context_resp->res.set_cause(
PDU_SESSION_APPLICATION_ERROR_PEER_NOT_RESPONDING);
Logger::smf_app().info("[SMF Procedure] REMOTE_PEER_NOT_RESPONDING");
return RETURNerror;
}
*/
//-------------------
//-------------------
n11_trigger
=
sm_context_req
;
n11_trigger
=
sm_context_req
;
n11_triggered_pending
=
sm_context_resp
;
n11_triggered_pending
=
sm_context_resp
;
...
@@ -1269,14 +1306,33 @@ int session_release_sm_context_procedure::run(
...
@@ -1269,14 +1306,33 @@ int session_release_sm_context_procedure::run(
Logger
::
smf_app
().
info
(
"Release SM Context Request"
);
Logger
::
smf_app
().
info
(
"Release SM Context Request"
);
// TODO check if compatible with ongoing procedures if any
// TODO check if compatible with ongoing procedures if any
pfcp
::
node_id_t
up_node_id
=
{};
pfcp
::
node_id_t
up_node_id
=
{};
if
(
not
pfcp_associations
::
get_instance
().
select_up_node
(
// Get UPF node
up_node_id
,
NODE_SELECTION_CRITERIA_MIN_PFCP_SESSIONS
))
{
std
::
shared_ptr
<
smf_context_ref
>
scf
=
{};
sm_context_res
->
res
.
set_cause
(
scid_t
scid
=
{};
PDU_SESSION_APPLICATION_ERROR_PEER_NOT_RESPONDING
);
try
{
Logger
::
smf_app
().
info
(
"REMOTE_PEER_NOT_RESPONDING"
);
scid
=
std
::
stoi
(
sm_context_req
->
scid
);
return
RETURNerror
;
}
catch
(
const
std
::
exception
&
err
)
{
Logger
::
smf_app
().
warn
(
"SM Context associated with this id %s does not exit!"
,
sm_context_req
->
scid
);
}
if
(
smf_app_inst
->
is_scid_2_smf_context
(
scid
))
{
scf
=
smf_app_inst
->
scid_2_smf_context
(
scid
);
up_node_id
=
scf
.
get
()
->
upf_node_id
;
}
else
{
Logger
::
smf_app
().
warn
(
"SM Context associated with this id "
SCID_FMT
" does not exit!"
,
scid
);
// TODO:
}
}
/* if (not pfcp_associations::get_instance().select_up_node(
up_node_id, NODE_SELECTION_CRITERIA_MIN_PFCP_SESSIONS)) {
sm_context_res->res.set_cause(
PDU_SESSION_APPLICATION_ERROR_PEER_NOT_RESPONDING);
Logger::smf_app().info("REMOTE_PEER_NOT_RESPONDING");
return RETURNerror;
}
*/
//-------------------
//-------------------
n11_trigger
=
sm_context_req
;
n11_trigger
=
sm_context_req
;
n11_triggered_pending
=
sm_context_res
;
n11_triggered_pending
=
sm_context_res
;
...
...
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