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
747640d2
Commit
747640d2
authored
Feb 28, 2022
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reroute NAS to the target AMF via AN tunnel
parent
6be0c2f9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
76 additions
and
0 deletions
+76
-0
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+14
-0
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+47
-0
src/amf-app/amf_n2.hpp
src/amf-app/amf_n2.hpp
+1
-0
src/contexts/ue_ngap_context.hpp
src/contexts/ue_ngap_context.hpp
+2
-0
src/itti/itti_msg.hpp
src/itti/itti_msg.hpp
+1
-0
src/itti/msgs/itti_msg_n2.hpp
src/itti/msgs/itti_msg_n2.hpp
+11
-0
No files found.
src/amf-app/amf_n1.cpp
View file @
747640d2
...
@@ -4340,5 +4340,19 @@ bool amf_n1::reroute_nas_via_an(
...
@@ -4340,5 +4340,19 @@ bool amf_n1::reroute_nas_via_an(
Logger
::
amf_n1
().
debug
(
Logger
::
amf_n1
().
debug
(
"Send a request to Reroute NAS message to the target AMF via AN"
);
"Send a request to Reroute NAS message to the target AMF via AN"
);
std
::
shared_ptr
<
itti_rereoute_nas
>
itti_msg
=
std
::
make_shared
<
itti_rereoute_nas
>
(
TASK_AMF_N1
,
TASK_AMF_N2
);
itti_msg
->
ran_ue_ngap_id
=
nc
->
ran_ue_ngap_id
;
itti_msg
->
amf_ue_ngap_id
=
nc
->
amf_ue_ngap_id
;
itti_msg
->
amf_set_id
=
target_amf_set
;
int
ret
=
itti_inst
->
send_msg
(
itti_msg
);
if
(
0
!=
ret
)
{
Logger
::
ngap
().
error
(
"Could not send ITTI message %s to task TASK_AMF_N2"
,
itti_msg
->
get_msg_name
());
}
return
true
;
return
true
;
}
}
src/amf-app/amf_n2.cpp
View file @
747640d2
...
@@ -44,6 +44,7 @@
...
@@ -44,6 +44,7 @@
#include "UEContextReleaseCommand.hpp"
#include "UEContextReleaseCommand.hpp"
#include "HandoverPreparationFailure.hpp"
#include "HandoverPreparationFailure.hpp"
#include "Paging.hpp"
#include "Paging.hpp"
#include "RerouteNASRequest.hpp"
#include "amf_app.hpp"
#include "amf_app.hpp"
#include "amf_config.hpp"
#include "amf_config.hpp"
#include "amf_n1.hpp"
#include "amf_n1.hpp"
...
@@ -211,6 +212,11 @@ void amf_n2_task(void* args_p) {
...
@@ -211,6 +212,11 @@ void amf_n2_task(void* args_p) {
itti_paging
*
m
=
dynamic_cast
<
itti_paging
*>
(
msg
);
itti_paging
*
m
=
dynamic_cast
<
itti_paging
*>
(
msg
);
amf_n2_inst
->
handle_itti_message
(
ref
(
*
m
));
amf_n2_inst
->
handle_itti_message
(
ref
(
*
m
));
}
break
;
}
break
;
case
REROUTE_NAS_REQ
:
{
Logger
::
amf_n2
().
info
(
"Received Reroute NAS Req message, handling"
);
itti_rereoute_nas
*
m
=
dynamic_cast
<
itti_rereoute_nas
*>
(
msg
);
amf_n2_inst
->
handle_itti_message
(
ref
(
*
m
));
}
break
;
case
TERMINATE
:
{
case
TERMINATE
:
{
if
(
itti_msg_terminate
*
terminate
=
if
(
itti_msg_terminate
*
terminate
=
dynamic_cast
<
itti_msg_terminate
*>
(
msg
))
{
dynamic_cast
<
itti_msg_terminate
*>
(
msg
))
{
...
@@ -676,6 +682,10 @@ void amf_n2::handle_itti_message(itti_initial_ue_message& init_ue_msg) {
...
@@ -676,6 +682,10 @@ void amf_n2::handle_itti_message(itti_initial_ue_message& init_ue_msg) {
}
}
}
}
// Store InitialUEMessage for Rereoute NAS later
unc
.
get
()
->
initialUEMsg
.
size
=
init_ue_msg
.
initUeMsg
->
encode2buffer
(
unc
.
get
()
->
initialUEMsg
.
buf
,
BUFFER_SIZE_1024
);
itti_msg
->
ran_ue_ngap_id
=
ran_ue_ngap_id
;
itti_msg
->
ran_ue_ngap_id
=
ran_ue_ngap_id
;
itti_msg
->
amf_ue_ngap_id
=
-
1
;
itti_msg
->
amf_ue_ngap_id
=
-
1
;
std
::
shared_ptr
<
itti_nas_signalling_establishment_request
>
i
=
std
::
shared_ptr
<
itti_nas_signalling_establishment_request
>
i
=
...
@@ -2020,6 +2030,43 @@ void amf_n2::handle_itti_message(itti_uplink_ran_status_transfer& itti_msg) {
...
@@ -2020,6 +2030,43 @@ void amf_n2::handle_itti_message(itti_uplink_ran_status_transfer& itti_msg) {
sctp_s_38412
.
sctp_send_msg
(
unc
.
get
()
->
target_gnb_assoc_id
,
0
,
&
b
);
sctp_s_38412
.
sctp_send_msg
(
unc
.
get
()
->
target_gnb_assoc_id
,
0
,
&
b
);
}
}
//------------------------------------------------------------------------------
void
amf_n2
::
handle_itti_message
(
itti_rereoute_nas
&
itti_msg
)
{
Logger
::
amf_n2
().
debug
(
"Handle Reroute NAS Request message..."
);
std
::
shared_ptr
<
ue_ngap_context
>
unc
=
{};
if
(
!
is_ran_ue_id_2_ue_ngap_context
(
itti_msg
.
ran_ue_ngap_id
))
{
Logger
::
amf_n2
().
error
(
"No UE NGAP context with ran_ue_ngap_id (%d)"
,
itti_msg
.
ran_ue_ngap_id
);
return
;
}
unc
=
ran_ue_id_2_ue_ngap_context
(
itti_msg
.
ran_ue_ngap_id
);
if
(
unc
.
get
()
->
amf_ue_ngap_id
!=
itti_msg
.
amf_ue_ngap_id
)
{
Logger
::
amf_n2
().
error
(
"The requested UE (amf_ue_ngap_id: 0x%x) is not valid, existed UE "
"which's amf_ue_ngap_id (0x%x)"
,
itti_msg
.
amf_ue_ngap_id
,
unc
.
get
()
->
amf_ue_ngap_id
);
}
RerouteNASRequest
rerouteNASRequest
=
{};
rerouteNASRequest
.
setMessageType
();
rerouteNASRequest
.
setRanUeNgapId
(
itti_msg
.
ran_ue_ngap_id
);
rerouteNASRequest
.
setAmfUeNgapId
(
itti_msg
.
amf_ue_ngap_id
);
rerouteNASRequest
.
setAMFSetID
(
itti_msg
.
amf_set_id
);
rerouteNASRequest
.
setNgapMessage
(
unc
->
initialUEMsg
);
// Include InitialUEMessage
// TODO: AllowedNSSAI (Optional)
uint8_t
buffer
[
BUFFER_SIZE_1024
];
int
encoded_size
=
rerouteNASRequest
.
encode2buffer
(
buffer
,
BUFFER_SIZE_1024
);
bstring
b
=
blk2bstr
(
buffer
,
encoded_size
);
amf_n2_inst
->
sctp_s_38412
.
sctp_send_msg
(
unc
.
get
()
->
gnb_assoc_id
,
unc
.
get
()
->
sctp_stream_send
,
&
b
);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
amf_n2
::
send_handover_preparation_failure
(
void
amf_n2
::
send_handover_preparation_failure
(
const
unsigned
long
amf_ue_ngap_id
,
const
uint32_t
ran_ue_ngap_id
,
const
unsigned
long
amf_ue_ngap_id
,
const
uint32_t
ran_ue_ngap_id
,
...
...
src/amf-app/amf_n2.hpp
View file @
747640d2
...
@@ -62,6 +62,7 @@ class amf_n2 : public ngap::ngap_app {
...
@@ -62,6 +62,7 @@ class amf_n2 : public ngap::ngap_app {
void
handle_itti_message
(
itti_handover_request_Ack
&
itti_msg
);
void
handle_itti_message
(
itti_handover_request_Ack
&
itti_msg
);
void
handle_itti_message
(
itti_handover_notify
&
itti_msg
);
void
handle_itti_message
(
itti_handover_notify
&
itti_msg
);
void
handle_itti_message
(
itti_uplink_ran_status_transfer
&
itti_msg
);
void
handle_itti_message
(
itti_uplink_ran_status_transfer
&
itti_msg
);
void
handle_itti_message
(
itti_rereoute_nas
&
itti_msg
);
void
send_handover_preparation_failure
(
void
send_handover_preparation_failure
(
const
unsigned
long
amf_ue_ngap_id
,
const
uint32_t
ran_ue_ngap_id
,
const
unsigned
long
amf_ue_ngap_id
,
const
uint32_t
ran_ue_ngap_id
,
const
sctp_assoc_id_t
&
gnb_assoc_id
);
const
sctp_assoc_id_t
&
gnb_assoc_id
);
...
...
src/contexts/ue_ngap_context.hpp
View file @
747640d2
...
@@ -68,6 +68,8 @@ class ue_ngap_context {
...
@@ -68,6 +68,8 @@ class ue_ngap_context {
// state management, ue status over the air
// state management, ue status over the air
ng_ue_state_t
ng_ue_state
;
ng_ue_state_t
ng_ue_state
;
uint8_t
ncc
;
// Next Hop Chaining Counter
uint8_t
ncc
;
// Next Hop Chaining Counter
OCTET_STRING_t
initialUEMsg
;
};
};
#endif
#endif
src/itti/itti_msg.hpp
View file @
747640d2
...
@@ -79,6 +79,7 @@ typedef enum {
...
@@ -79,6 +79,7 @@ typedef enum {
DOWNLINK_NAS_TRANSFER
,
DOWNLINK_NAS_TRANSFER
,
NAS_SIG_ESTAB_REQ
,
// task amf_app
NAS_SIG_ESTAB_REQ
,
// task amf_app
N1N2_MESSAGE_TRANSFER_REQ
,
N1N2_MESSAGE_TRANSFER_REQ
,
REROUTE_NAS_REQ
,
NSMF_PDU_SESSION_CREATE_SM_CTX
,
NSMF_PDU_SESSION_CREATE_SM_CTX
,
NSMF_PDU_SESSION_UPDATE_SM_CTX
,
NSMF_PDU_SESSION_UPDATE_SM_CTX
,
N11_REGISTER_NF_INSTANCE_REQUEST
,
N11_REGISTER_NF_INSTANCE_REQUEST
,
...
...
src/itti/msgs/itti_msg_n2.hpp
View file @
747640d2
...
@@ -297,4 +297,15 @@ class itti_uplink_ran_status_transfer : public itti_msg_n2 {
...
@@ -297,4 +297,15 @@ class itti_uplink_ran_status_transfer : public itti_msg_n2 {
UplinkRANStatusTransfer
*
uplinkrantransfer
;
UplinkRANStatusTransfer
*
uplinkrantransfer
;
};
};
class
itti_rereoute_nas
:
public
itti_msg_n2
{
public:
itti_rereoute_nas
(
const
task_id_t
origin
,
const
task_id_t
destination
)
:
itti_msg_n2
(
REROUTE_NAS_REQ
,
origin
,
destination
)
{}
itti_rereoute_nas
(
const
itti_rereoute_nas
&
i
)
:
itti_msg_n2
(
i
)
{}
uint32_t
ran_ue_ngap_id
;
long
amf_ue_ngap_id
;
std
::
string
amf_set_id
;
};
#endif
#endif
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