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
91226be5
Commit
91226be5
authored
Jul 16, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send PDU Session Update SM context to SMF for N2 handover
parent
977790c3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
30 deletions
+75
-30
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+74
-28
src/common/amf.hpp
src/common/amf.hpp
+1
-0
src/ngap/ngap_app/ngap_message_callback.hpp
src/ngap/ngap_app/ngap_message_callback.hpp
+0
-1
src/sbi/amf_server/impl/N1N2MessageCollectionDocumentApiImpl.cpp
.../amf_server/impl/N1N2MessageCollectionDocumentApiImpl.cpp
+0
-1
No files found.
src/amf-app/amf_n2.cpp
View file @
91226be5
...
...
@@ -1126,22 +1126,14 @@ bool amf_n2::handle_itti_message(itti_handover_required& itti_msg) {
plmn
->
getMcc
(
mccOfselectTAI
);
plmn
->
getMnc
(
mncOfselectTAI
);
Logger
::
amf_n2
().
debug
(
"Handover
required:Target ID selectedTAI PLmn
(mcc %s, mnc %s, tac %x)"
,
"Handover
Required: Target ID selected TAI PLMN
(mcc %s, mnc %s, tac %x)"
,
mccOfselectTAI
.
c_str
(),
mncOfselectTAI
.
c_str
(),
tac
->
getTac
());
std
::
vector
<
PDUSessionResourceItem_t
>
List_HORqd
;
if
(
!
itti_msg
.
handoverReq
->
getPDUSessionResourceList
(
List_HORqd
))
{
Logger
::
ngap
().
error
(
"Decoding HandoverRequiredMsg getPDUSessionResourceList IE error"
);
return
false
;
}
OCTET_STRING_t
sourceTotarget
;
sourceTotarget
=
itti_msg
.
handoverReq
->
getSourceToTarget_TransparentContainer
();
// TODO: T-AMF selection, for now use the same AMF
// TODO: Send PDU Session Update SM Context Request to SMF
// Create HandoverRequest message to be sent to target gNB
std
::
unique_ptr
<
HandoverRequest
>
handover_request
=
...
...
@@ -1206,37 +1198,91 @@ bool amf_n2::handle_itti_message(itti_handover_required& itti_msg) {
Logger
::
amf_n2
().
warn
(
"Error when retrieving the active PDU Sessions!"
);
}
std
::
vector
<
PDUSessionResourceItem_t
>
pdu_session_resource_list
;
if
(
!
itti_msg
.
handoverReq
->
getPDUSessionResourceList
(
pdu_session_resource_list
))
{
Logger
::
ngap
().
warn
(
"Decoding PDU Session Resource List IE error or IE missing"
);
}
std
::
vector
<
PDUSessionResourceSetupRequestItem_t
>
list
;
PDUSessionResourceSetupRequestItem_t
item
=
{};
if
(
pdu_sessions
.
size
()
>
0
)
{
for
(
auto
pdu_session
:
pdu_sessions
)
{
if
(
pdu_session
.
get
()
!=
nullptr
)
{
item
.
pduSessionId
=
pdu_session
.
get
()
->
pdu_session_id
;
item
.
s_nssai
.
sst
=
pdu_session
.
get
()
->
snssai
.
sST
;
item
.
s_nssai
.
sd
=
pdu_session
.
get
()
->
snssai
.
sD
;
item
.
pduSessionNAS_PDU
=
NULL
;
bstring
n2sm
=
pdu_session
.
get
()
->
n2sm
;
if
(
blength
(
pdu_session
.
get
()
->
n2sm
)
!=
0
)
{
item
.
pduSessionResourceSetupRequestTransfer
.
buf
=
(
uint8_t
*
)
bdata
(
pdu_session
.
get
()
->
n2sm
);
item
.
pduSessionResourceSetupRequestTransfer
.
size
=
blength
(
pdu_session
.
get
()
->
n2sm
);
}
else
{
Logger
::
amf_n2
().
error
(
"n2sm empty!"
);
}
list
.
push_back
(
item
);
for
(
auto
pdu_session_resource
:
pdu_session_resource_list
)
{
std
::
shared_ptr
<
pdu_session_context
>
psc
=
{};
if
(
amf_app_inst
->
find_pdu_session_context
(
supi
,
pdu_session_resource
.
pduSessionId
,
psc
))
{
item
.
pduSessionId
=
psc
.
get
()
->
pdu_session_id
;
item
.
s_nssai
.
sst
=
psc
.
get
()
->
snssai
.
sST
;
item
.
s_nssai
.
sd
=
psc
.
get
()
->
snssai
.
sD
;
item
.
pduSessionNAS_PDU
=
nullptr
;
item
.
pduSessionResourceSetupRequestTransfer
.
buf
=
pdu_session_resource
.
HandoverRequiredTransfer
.
buf
;
item
.
pduSessionResourceSetupRequestTransfer
.
size
=
pdu_session_resource
.
HandoverRequiredTransfer
.
size
;
list
.
push_back
(
item
);
// Send PDUSessionUpdateSMContextRequest to SMF for each active PDU
// sessions
Logger
::
amf_n2
().
debug
(
"Sending ITTI to trigger PDUSessionUpdateSMContextRequest to SMF to "
"task TASK_AMF_N11"
);
itti_nsmf_pdusession_update_sm_context
*
itti_msg
=
new
itti_nsmf_pdusession_update_sm_context
(
TASK_NGAP
,
TASK_AMF_N11
);
itti_msg
->
pdu_session_id
=
item
.
pduSessionId
;
itti_msg
->
n2sm
=
blk2bstr
(
pdu_session_resource
.
HandoverRequiredTransfer
.
buf
,
pdu_session_resource
.
HandoverRequiredTransfer
.
size
);
itti_msg
->
is_n2sm_set
=
true
;
itti_msg
->
n2sm_info_type
=
"HANDOVER_REQUIRED"
;
itti_msg
->
amf_ue_ngap_id
=
amf_ue_ngap_id
;
itti_msg
->
ran_ue_ngap_id
=
ran_ue_ngap_id
;
std
::
shared_ptr
<
itti_nsmf_pdusession_update_sm_context
>
i
=
std
::
shared_ptr
<
itti_nsmf_pdusession_update_sm_context
>
(
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_N11"
,
i
->
get_msg_name
());
}
}
}
/*
for (auto pdu_session : pdu_sessions) {
if (pdu_session.get() != nullptr) {
item.pduSessionId = pdu_session.get()->pdu_session_id;
item.s_nssai.sst = pdu_session.get()->snssai.sST;
item.s_nssai.sd = pdu_session.get()->snssai.sD;
item.pduSessionNAS_PDU = NULL;
bstring n2sm = pdu_session.get()->n2sm;
if (blength(pdu_session.get()->n2sm) != 0) {
item.pduSessionResourceSetupRequestTransfer.buf =
(uint8_t*) bdata(pdu_session.get()->n2sm);
item.pduSessionResourceSetupRequestTransfer.size =
blength(pdu_session.get()->n2sm);
} else {
Logger::amf_n2().error("n2sm empty!");
}
list.push_back(item);
}
}
*/
// TODO: Handover Response supervision
// Wait until receiving all responses from SMFs before sending Handover
// Request to Target RAN
handover_request
->
setPduSessionResourceSetupList
(
list
);
handover_request
->
setAllowedNSSAI
(
Allowed_Nssai
);
handover_request
->
setSourceToTarget_TransparentContainer
(
sourceTotarget
);
handover_request
->
setMobilityRestrictionList
(
m_plmnId
);
handover_request
->
setGUAMI
(
m_plmnId
,
m_aMFRegionID
,
m_aMFSetID
,
m_aMFPointer
);
uint8_t
buffer
[
20240
];
int
encoded_size
=
handover_request
->
encode2buffer
(
buffer
,
20240
);
uint8_t
buffer
[
BUFFER_SIZE_2048
];
int
encoded_size
=
handover_request
->
encode2buffer
(
buffer
,
BUFFER_SIZE_2048
);
bstring
b
=
blk2bstr
(
buffer
,
encoded_size
);
std
::
shared_ptr
<
gnb_context
>
gc_target
=
{};
gc_target
=
gnb_id_2_gnb_context
(
gnbid
->
getValue
());
...
...
src/common/amf.hpp
View file @
91226be5
...
...
@@ -103,6 +103,7 @@ constexpr auto CURL_MIME_BOUNDARY = "----Boundary";
#define AUSF_CURL_TIMEOUT_MS 100L
#define CURL_TIMEOUT_MS 100L
#define BUFFER_SIZE_2048 2048
#define BUFFER_SIZE_1024 1024
#define BUFFER_SIZE_512 512
#define BUFFER_SIZE_256 256
...
...
src/ngap/ngap_app/ngap_message_callback.hpp
View file @
91226be5
...
...
@@ -52,7 +52,6 @@ using namespace amf_application;
extern
itti_mw
*
itti_inst
;
extern
amf_n1
*
amf_n1_inst
;
extern
amf_n11
*
amf_n11_inst
;
extern
amf_app
*
amf_app_inst
;
typedef
int
(
*
ngap_message_decoded_callback
)(
...
...
src/sbi/amf_server/impl/N1N2MessageCollectionDocumentApiImpl.cpp
View file @
91226be5
...
...
@@ -22,7 +22,6 @@ using namespace amf_application;
extern
void
msg_str_2_msg_hex
(
std
::
string
msg
,
bstring
&
b
);
extern
void
convert_string_2_hex
(
std
::
string
&
input
,
std
::
string
&
output
);
extern
itti_mw
*
itti_inst
;
extern
amf_n11
*
amf_n11_inst
;
extern
amf_app
*
amf_app_inst
;
extern
void
print_buffer
(
const
std
::
string
app
,
const
std
::
string
commit
,
uint8_t
*
buf
,
int
len
);
...
...
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