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
79998d48
Commit
79998d48
authored
Nov 08, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First version for Implicit De-registration Timer
parent
de37a02e
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
107 additions
and
6 deletions
+107
-6
src/amf-app/amf_app.hpp
src/amf-app/amf_app.hpp
+1
-0
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+94
-4
src/amf-app/amf_n1.hpp
src/amf-app/amf_n1.hpp
+5
-0
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+1
-1
src/common/3gpp_24.501.h
src/common/3gpp_24.501.h
+1
-0
src/contexts/nas_context.cpp
src/contexts/nas_context.cpp
+1
-0
src/contexts/nas_context.hpp
src/contexts/nas_context.hpp
+1
-0
src/itti/msgs/itti_msg_n11.hpp
src/itti/msgs/itti_msg_n11.hpp
+3
-1
No files found.
src/amf-app/amf_app.hpp
View file @
79998d48
...
...
@@ -56,6 +56,7 @@ namespace amf_application {
#define TASK_AMF_APP_PERIODIC_STATISTICS (0)
#define TASK_AMF_MOBILE_REACHABLE_TIMER_EXPIRE (1)
#define TASK_AMF_IMPLICIT_DEREGISTRATION_TIMER_EXPIRE (2)
class
amf_app
{
private:
...
...
src/amf-app/amf_n1.cpp
View file @
79998d48
...
...
@@ -119,6 +119,10 @@ void amf_n1_task(void*) {
amf_n1_inst
->
mobile_reachable_timer_timeout
(
to
->
timer_id
,
to
->
arg2_user
);
break
;
case
TASK_AMF_IMPLICIT_DEREGISTRATION_TIMER_EXPIRE
:
amf_n1_inst
->
implicit_deregistration_timer_timeout
(
to
->
timer_id
,
to
->
arg2_user
);
break
;
default:
Logger
::
amf_n1
().
info
(
"No handler for timer(%d) with arg1_user(%d) "
,
to
->
timer_id
,
...
...
@@ -489,8 +493,9 @@ void amf_n1::nas_signalling_establishment_request_handle(
nc
.
get
()
->
amf_ue_ngap_id
=
amf_ue_ngap_id
;
nc
.
get
()
->
ran_ue_ngap_id
=
ran_ue_ngap_id
;
nc
.
get
()
->
serving_network
=
snn
;
//
stop Mobile Reachable
Timer
//
Stop Mobile Reachable Timer/Implicit Deregistration
Timer
itti_inst
->
timer_remove
(
nc
.
get
()
->
mobile_reachable_timer
);
itti_inst
->
timer_remove
(
nc
.
get
()
->
implicit_deregistration_timer
);
// stacs.UE_connected += 1;
// Trigger UE Reachability Status Notify
...
...
@@ -677,8 +682,10 @@ void amf_n1::identity_response_handle(
nc
.
get
()
->
imsi
=
supi
;
supi2amfId
[(
"imsi-"
+
nc
.
get
()
->
imsi
)]
=
amf_ue_ngap_id
;
supi2ranId
[(
"imsi-"
+
nc
.
get
()
->
imsi
)]
=
ran_ue_ngap_id
;
//
stop Mobile Reachable
Timer
//
Stop Mobile Reachable Timer/Implicit Deregistration
Timer
itti_inst
->
timer_remove
(
nc
.
get
()
->
mobile_reachable_timer
);
itti_inst
->
timer_remove
(
nc
.
get
()
->
implicit_deregistration_timer
);
if
(
nc
.
get
()
->
to_be_register_by_new_suci
)
{
run_registration_procedure
(
nc
);
}
...
...
@@ -932,8 +939,9 @@ void amf_n1::registration_request_handle(
nc
.
get
()
->
amf_ue_ngap_id
=
amf_ue_ngap_id
;
nc
.
get
()
->
ran_ue_ngap_id
=
ran_ue_ngap_id
;
nc
.
get
()
->
serving_network
=
snn
;
//
stop Mobile Reachable
Timer
//
Stop Mobile Reachable Timer/Implicit Deregistration
Timer
itti_inst
->
timer_remove
(
nc
.
get
()
->
mobile_reachable_timer
);
itti_inst
->
timer_remove
(
nc
.
get
()
->
implicit_deregistration_timer
);
}
nc
.
get
()
->
is_imsi_present
=
true
;
nc
.
get
()
->
imsi
=
imsi
.
mcc
+
imsi
.
mnc
+
imsi
.
msin
;
...
...
@@ -1019,8 +1027,10 @@ void amf_n1::registration_request_handle(
// nc.get()->imsi =
// supi2amfId[("imsi-"+nc.get()->imsi)] = amf_ue_ngap_id;
// supi2ranId[("imsi-"+nc.get()->imsi)] = ran_ue_ngap_id;
// stop Mobile Reachable Timer
// Stop Mobile Reachable Timer/Implicit Deregistration Timer
itti_inst
->
timer_remove
(
nc
.
get
()
->
mobile_reachable_timer
);
itti_inst
->
timer_remove
(
nc
.
get
()
->
implicit_deregistration_timer
);
}
}
break
;
...
...
@@ -3203,9 +3213,89 @@ void amf_n1::mobile_reachable_timer_timeout(
"No existed nas_context with amf_ue_ngap_id(0x%x)"
,
amf_ue_ngap_id
);
}
set_mobile_reachable_timer_timeout
(
nc
,
true
);
// TODO: Start the implicit de-registration timer
timer_id_t
tid
=
itti_inst
->
timer_setup
(
IMPLICIT_DEREGISTRATION_TIMER_MIN
*
60
,
0
,
TASK_AMF_N1
,
TASK_AMF_IMPLICIT_DEREGISTRATION_TIMER_EXPIRE
,
amf_ue_ngap_id
);
Logger
::
amf_app
().
startup
(
"Started implicit de-registration timer (tid %d)"
,
tid
);
set_implicit_deregistration_timer
(
nc
,
tid
);
}
//------------------------------------------------------------------------------
void
amf_n1
::
implicit_deregistration_timer_timeout
(
timer_id_t
timer_id
,
uint64_t
amf_ue_ngap_id
)
{
std
::
shared_ptr
<
nas_context
>
nc
;
if
(
amf_n1_inst
->
is_amf_ue_id_2_nas_context
(
amf_ue_ngap_id
))
nc
=
amf_n1_inst
->
amf_ue_id_2_nas_context
(
amf_ue_ngap_id
);
else
{
Logger
::
amf_n2
().
warn
(
"No existed nas_context with amf_ue_ngap_id(0x%x)"
,
amf_ue_ngap_id
);
}
// Implicitly de-register UE
// TODO (4.2.2.3.3 Network-initiated Deregistration @3GPP TS 23.502V16.0.0):
// If the UE is in CM-CONNECTED state, the AMF may explicitly deregister the
// UE by sending a Deregistration Request message (Deregistration type, Access
// Type) to the UE
// Send PDU Session Release SM Context Request to SMF for each PDU Session
// Get all the PDU sessions
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
;
}
std
::
vector
<
std
::
shared_ptr
<
pdu_session_context
>>
pdu_sessions
;
if
(
!
uc
.
get
()
->
get_pdu_sessions_context
(
pdu_sessions
))
return
;
for
(
auto
p
:
pdu_sessions
)
{
std
::
shared_ptr
<
itti_nsmf_pdusession_release_sm_context
>
itti_msg
=
std
::
make_shared
<
itti_nsmf_pdusession_release_sm_context
>
(
TASK_AMF_N1
,
TASK_AMF_N11
);
itti_msg
->
supi
=
uc
->
supi
;
itti_msg
->
pdu_session_id
=
p
->
pdu_session_id
;
int
ret
=
itti_inst
->
send_msg
(
itti_msg
);
if
(
0
!=
ret
)
{
Logger
::
amf_n1
().
error
(
"Could not send ITTI message %s to task TASK_AMF_N11"
,
itti_msg
->
get_msg_name
());
}
}
// Send N2 UE Release command to NG-RAN if there is a N2 signalling connection
// to NG-RAN
Logger
::
amf_n1
().
debug
(
"Sending ITTI UE Context Release Command to TASK_AMF_N2"
);
itti_ue_context_release_command
*
itti_msg
=
new
itti_ue_context_release_command
(
TASK_AMF_N1
,
TASK_AMF_N2
);
itti_msg
->
amf_ue_ngap_id
=
nc
.
get
()
->
amf_ue_ngap_id
;
itti_msg
->
ran_ue_ngap_id
=
nc
.
get
()
->
ran_ue_ngap_id
;
itti_msg
->
cause
.
setChoiceOfCause
(
Ngap_Cause_PR_nas
);
itti_msg
->
cause
.
setValue
(
Ngap_CauseNas_deregister
);
std
::
shared_ptr
<
itti_ue_context_release_command
>
i
=
std
::
shared_ptr
<
itti_ue_context_release_command
>
(
itti_msg
);
int
ret
=
itti_inst
->
send_msg
(
i
);
if
(
0
!=
ret
)
{
Logger
::
ngap
().
error
(
"Could not send ITTI message %s to task TASK_AMF_N2"
,
i
->
get_msg_name
());
}
}
//------------------------------------------------------------------------------
void
amf_n1
::
set_implicit_deregistration_timer
(
std
::
shared_ptr
<
nas_context
>&
nc
,
const
timer_id_t
&
t
)
{
std
::
unique_lock
lock
(
m_nas_context
);
nc
.
get
()
->
implicit_deregistration_timer
=
t
;
}
//------------------------------------------------------------------------------
void
amf_n1
::
set_mobile_reachable_timer
(
std
::
shared_ptr
<
nas_context
>&
nc
,
const
timer_id_t
&
t
)
{
...
...
src/amf-app/amf_n1.hpp
View file @
79998d48
...
...
@@ -195,6 +195,11 @@ class amf_n1 {
void
set_mobile_reachable_timer
(
std
::
shared_ptr
<
nas_context
>&
nc
,
const
timer_id_t
&
t
);
void
set_implicit_deregistration_timer
(
std
::
shared_ptr
<
nas_context
>&
nc
,
const
timer_id_t
&
t
);
void
implicit_deregistration_timer_timeout
(
timer_id_t
timer_id
,
uint64_t
amf_ue_ngap_id
);
private:
void
ue_initiate_de_registration_handle
(
uint32_t
ran_ue_ngap_id
,
long
amf_ue_ngap_id
,
bstring
nas
);
...
...
src/amf-app/amf_n2.cpp
View file @
79998d48
...
...
@@ -1295,7 +1295,7 @@ void amf_n2::handle_itti_message(itti_ue_context_release_complete& itti_msg) {
timer_id_t
tid
=
itti_inst
->
timer_setup
(
MOBILE_REACHABLE_TIMER_NO_EMERGENCY_SERVICES_MIN
*
60
,
0
,
TASK_AMF_N1
,
TASK_AMF_MOBILE_REACHABLE_TIMER_EXPIRE
,
amf_ue_ngap_id
);
Logger
::
amf_app
().
startup
(
"Started mobile reachable timer (
tid %d)"
,
tid
);
Logger
::
amf_app
().
startup
(
"Started mobile reachable timer (tid %d)"
,
tid
);
amf_n1_inst
->
set_mobile_reachable_timer
(
nc
,
tid
);
amf_n1_inst
->
set_mobile_reachable_timer_timeout
(
nc
,
false
);
...
...
src/common/3gpp_24.501.h
View file @
79998d48
...
...
@@ -27,4 +27,5 @@
#define T3512_TIMER_VALUE_MIN 54 // 54 minutes
#define MOBILE_REACHABLE_TIMER_NO_EMERGENCY_SERVICES_MIN \
(T3512_TIMER_VALUE_MIN + 4) // T3512 + 4, not for emergency services
#define IMPLICIT_DEREGISTRATION_TIMER_MIN (T3512_TIMER_VALUE_MIN + 4)
#endif
src/contexts/nas_context.cpp
View file @
79998d48
...
...
@@ -67,6 +67,7 @@ nas_context::nas_context() : _vector(), _5g_he_av(), _5g_av(), kamf() {
nas_status
=
CM_IDLE
;
is_mobile_reachable_timer_timeout
=
false
;
mobile_reachable_timer
=
ITTI_INVALID_TIMER_ID
;
implicit_deregistration_timer
=
ITTI_INVALID_TIMER_ID
;
}
//------------------------------------------------------------------------------
...
...
src/contexts/nas_context.hpp
View file @
79998d48
...
...
@@ -74,6 +74,7 @@ class nas_context {
_5gmm_state_t
_5gmm_state
;
bool
is_mobile_reachable_timer_timeout
;
timer_id_t
mobile_reachable_timer
;
timer_id_t
implicit_deregistration_timer
;
// parameters from Registration request
uint8_t
registration_type
:
3
;
...
...
src/itti/msgs/itti_msg_n11.hpp
View file @
79998d48
...
...
@@ -117,10 +117,12 @@ class itti_nsmf_pdusession_release_sm_context : public itti_msg_n11 {
const
itti_nsmf_pdusession_release_sm_context
&
i
)
:
itti_msg_n11
(
i
)
{
supi
=
i
.
supi
;
pdu_session_id
=
i
.
pdu_session_id
;
}
public:
std
::
string
supi
;
uint8_t
pdu_session_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