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
c18a6bfc
Commit
c18a6bfc
authored
Nov 04, 2022
by
Stefan Spettel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(smf): Added PDU session deletion for all UPFs in graph
Signed-off-by:
Stefan Spettel
<
stefan.spettel@eurecom.fr
>
parent
35961b90
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
39 deletions
+57
-39
src/smf_app/smf_procedure.cpp
src/smf_app/smf_procedure.cpp
+54
-39
src/smf_app/smf_procedure.hpp
src/smf_app/smf_procedure.hpp
+3
-0
No files found.
src/smf_app/smf_procedure.cpp
View file @
c18a6bfc
...
...
@@ -1446,6 +1446,37 @@ smf_procedure_code session_update_sm_context_procedure::handle_itti_msg(
return
smf_procedure_code
::
OK
;
}
//------------------------------------------------------------------------------
smf_procedure_code
session_release_sm_context_procedure
::
send_n4_session_deletion_request
()
{
std
::
vector
<
edge
>
dl_edges
;
std
::
vector
<
edge
>
ul_edges
;
std
::
shared_ptr
<
pfcp_association
>
current_upf
;
if
(
get_current_upf
(
dl_edges
,
ul_edges
,
current_upf
)
==
smf_procedure_code
::
ERROR
)
{
return
smf_procedure_code
::
ERROR
;
}
n4_triggered
=
std
::
make_shared
<
itti_n4_session_deletion_request
>
(
TASK_SMF_APP
,
TASK_SMF_N4
);
n4_triggered
->
seid
=
sps
->
up_fseid
.
seid
;
n4_triggered
->
trxn_id
=
this
->
trxn_id
;
n4_triggered
->
r_endpoint
=
endpoint
(
current_upf
->
node_id
.
u1
.
ipv4_address
,
pfcp
::
default_port
);
Logger
::
smf_app
().
info
(
"Sending ITTI message %s to task TASK_SMF_N4"
,
n4_triggered
->
get_msg_name
());
int
ret
=
itti_inst
->
send_msg
(
n4_triggered
);
if
(
RETURNok
!=
ret
)
{
Logger
::
smf_app
().
error
(
"Could not send ITTI message %s to task TASK_SMF_N4"
,
n4_triggered
->
get_msg_name
());
return
smf_procedure_code
::
ERROR
;
}
return
smf_procedure_code
::
CONTINUE
;
}
//------------------------------------------------------------------------------
smf_procedure_code
session_release_sm_context_procedure
::
run
(
std
::
shared_ptr
<
itti_n11_release_sm_context_request
>
sm_context_req
,
...
...
@@ -1486,47 +1517,24 @@ smf_procedure_code session_release_sm_context_procedure::run(
Logger
::
smf_app
().
warn
(
"PDU session does not have a UPF association"
);
return
smf_procedure_code
::
ERROR
;
}
// we start from the access nodes, because we have only ULCLs we don't have
// the situation that one UPF is returned more than once
smf_qos_flow
empty_flow
;
graph
->
start_asynch_dfs_procedure
(
tru
e
,
empty_flow
);
graph
->
start_asynch_dfs_procedure
(
fals
e
,
empty_flow
);
std
::
vector
<
edge
>
dl_edges
;
std
::
vector
<
edge
>
ul_edges
;
std
::
shared_ptr
<
pfcp_association
>
current_upf
;
graph
->
dfs_next_upf
(
dl_edges
,
ul_edges
,
current_upf
);
if
(
get_next_upf
(
dl_edges
,
ul_edges
,
current_upf
)
==
smf_procedure_code
::
ERROR
)
{
return
smf_procedure_code
::
ERROR
;
}
/* 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_triggered_pending
=
sm_context_res
;
uint64_t
seid
=
smf_app_inst
->
generate_seid
();
sps
->
set_seid
(
seid
);
n4_triggered
=
std
::
make_shared
<
itti_n4_session_deletion_request
>
(
TASK_SMF_APP
,
TASK_SMF_N4
);
n4_triggered
->
seid
=
sps
->
up_fseid
.
seid
;
n4_triggered
->
trxn_id
=
this
->
trxn_id
;
n4_triggered
->
r_endpoint
=
endpoint
(
current_upf
->
node_id
.
u1
.
ipv4_address
,
pfcp
::
default_port
);
Logger
::
smf_app
().
info
(
"Sending ITTI message %s to task TASK_SMF_N4"
,
n4_triggered
->
get_msg_name
());
int
ret
=
itti_inst
->
send_msg
(
n4_triggered
);
if
(
RETURNok
!=
ret
)
{
Logger
::
smf_app
().
error
(
"Could not send ITTI message %s to task TASK_SMF_N4"
,
n4_triggered
->
get_msg_name
());
return
smf_procedure_code
::
ERROR
;
}
return
smf_procedure_code
::
OK
;
return
send_n4_session_deletion_request
();
}
//------------------------------------------------------------------------------
...
...
@@ -1540,10 +1548,23 @@ smf_procedure_code session_release_sm_context_procedure::handle_itti_msg(
pfcp
::
cause_t
cause
=
{};
resp
.
pfcp_ies
.
get
(
cause
);
std
::
vector
<
edge
>
dl_edges
;
std
::
vector
<
edge
>
ul_edges
;
std
::
shared_ptr
<
pfcp_association
>
current_upf
;
bool
continue_n4
=
false
;
if
(
get_next_upf
(
dl_edges
,
ul_edges
,
current_upf
)
==
smf_procedure_code
::
CONTINUE
)
{
// If we have to continue, we ignore the PFCP error code, because we should
// at least remove other UPF sessions
return
send_n4_session_deletion_request
();
continue_n4
=
false
;
}
if
(
cause
.
cause_value
==
CAUSE_VALUE_REQUEST_ACCEPTED
)
{
n11_triggered_pending
->
res
.
set_cause
(
static_cast
<
uint8_t
>
(
cause_value_5gsm_e
::
CAUSE_255_REQUEST_ACCEPTED
));
Logger
::
smf_app
().
info
(
"PDU Session Release SM Context accepted by UPF"
);
Logger
::
smf_app
().
info
(
"PDU Session Release SM Context accepted by UPF
s
"
);
// clear the resources including addresses allocated to this Session and
// associated QoS flows
sps
->
deallocate_ressources
(
...
...
@@ -1554,14 +1575,8 @@ smf_procedure_code session_release_sm_context_procedure::handle_itti_msg(
}
else
{
n11_triggered_pending
->
res
.
set_cause
(
static_cast
<
uint8_t
>
(
cause_value_5gsm_e
::
CAUSE_31_REQUEST_REJECTED_UNSPECIFIED
));
// We cannot return an error here, because we need to delete all the UPFs
return
smf_procedure_code
::
ERROR
;
// trigger to send reply to AMF
/*
smf_app_inst->trigger_http_response(
http_status_code_e::HTTP_STATUS_CODE_406_NOT_ACCEPTABLE,
n11_triggered_pending->pid, N11_SESSION_RELEASE_SM_CONTEXT_RESPONSE);
*/
}
// TODO:
...
...
src/smf_app/smf_procedure.hpp
View file @
c18a6bfc
...
...
@@ -279,6 +279,9 @@ class session_release_sm_context_procedure : public smf_session_procedure {
std
::
shared_ptr
<
itti_n11_release_sm_context_request
>
n11_trigger
;
std
::
shared_ptr
<
itti_n11_release_sm_context_response
>
n11_triggered_pending
;
private:
smf_procedure_code
send_n4_session_deletion_request
();
};
}
// namespace smf
...
...
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