-
-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added intelligent AMF selection at gNB #731
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,11 +11,18 @@ | |
namespace nr::gnb | ||
{ | ||
|
||
NgapAmfContext *NgapTask::selectAmf(int ueId) | ||
NgapAmfContext *NgapTask::selectAmf(int ueId, const int32_t &requestedSliceType) | ||
{ | ||
// todo: | ||
for (auto &amf : m_amfCtx) | ||
return amf.second; // return the first one | ||
for (auto &amf : m_amfCtx) { | ||
for (const auto &PlmnSupport : amf.second->plmnSupportList) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use lower-case for SingleSlice and SingleSlice. Because they are loop variables. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. Will do that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please rename and
And please replace |
||
for (const auto &SingleSlice : PlmnSupport->sliceSupportList.slices) { | ||
int32_t supportedSliceType = static_cast<int32_t>(SingleSlice.sst.getValue()); | ||
if (supportedSliceType == requestedSliceType) { | ||
return amf.second; | ||
} | ||
} | ||
} | ||
} | ||
return nullptr; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,7 @@ class NgapTask : public NtsTask | |
/* Utility functions */ | ||
void createAmfContext(const GnbAmfConfig &config); | ||
NgapAmfContext *findAmfContext(int ctxId); | ||
void createUeContext(int ueId); | ||
void createUeContext(int ueId, const int32_t &requestedSliceType); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also make just |
||
NgapUeContext *findUeContext(int ctxId); | ||
NgapUeContext *findUeByRanId(int64_t ranUeNgapId); | ||
NgapUeContext *findUeByAmfId(int64_t amfUeNgapId); | ||
|
@@ -98,7 +98,7 @@ class NgapTask : public NtsTask | |
bool handleSctpStreamId(int amfId, int stream, const ASN_NGAP_NGAP_PDU &pdu); | ||
|
||
/* NAS transport */ | ||
void handleInitialNasTransport(int ueId, const OctetString &nasPdu, int64_t rrcEstablishmentCause, | ||
void handleInitialNasTransport(int ueId, OctetString &nasPdu, int64_t rrcEstablishmentCause, | ||
const std::optional<GutiMobileIdentity> &sTmsi); | ||
void handleUplinkNasTransport(int ueId, const OctetString &nasPdu); | ||
void receiveDownlinkNasTransport(int amfId, ASN_NGAP_DownlinkNASTransport *msg); | ||
|
@@ -118,7 +118,7 @@ class NgapTask : public NtsTask | |
void sendContextRelease(int ueId, NgapCause cause); | ||
|
||
/* NAS Node Selection */ | ||
NgapAmfContext *selectAmf(int ueId); | ||
NgapAmfContext *selectAmf(int ueId, const int32_t &requestedSliceType); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same thing please |
||
NgapAmfContext *selectNewAmfForReAllocation(int ueId, int initiatedAmfId, int amfSetId); | ||
|
||
/* Radio resource control */ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,7 +73,6 @@ static void RemoveCleartextIEs(nas::PlainMmMessage &msg, OctetString &&nasMsgCon | |
regReq.micoIndication = std::nullopt; | ||
regReq.networkSlicingIndication = std::nullopt; | ||
regReq.mmCapability = std::nullopt; | ||
regReq.requestedNSSAI = std::nullopt; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you explain this remove? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is to prevent the UE from removing |
||
regReq.requestedDrxParameters = std::nullopt; | ||
regReq.uesUsageSetting = std::nullopt; | ||
regReq.updateType = std::nullopt; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,11 @@ struct octet | |
{ | ||
} | ||
|
||
inline uint8_t getValue() const | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove this function. You can directly cast to uint8_t in order to convert octet to uint8_t uint8_t aaa = (uint8_t)bbb; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have used the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Example:
|
||
{ | ||
return value; | ||
} | ||
|
||
/* no explicit */ octet(int32_t value) noexcept : value(static_cast<uint8_t>(value & 0xFF)) | ||
{ | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,11 @@ class OctetString | |
{ | ||
} | ||
|
||
const std::vector<uint8_t>& getData() const | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. data is already present. Please remove this method. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe I used this getter() as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes |
||
{ | ||
return m_data; | ||
} | ||
|
||
explicit OctetString(std::vector<uint8_t> &&data) : m_data(std::move(data)) | ||
{ | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain why the modification is needed for the original PDU
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes sure. In the current implementation, the UE is removing the information elements (including slice information), before sending the NAS PDU to gNB [
RemoveCleartextIEs()
]. gNB then selects one AMF blindly and forwards the request to the selected AMF.Now, to support intelligent AMF selection based on slice type, I have prevented removal of slice info from the PDU, when the UE sends it. Now, at the gNB end, the gNB uses this slice info., to select an appropriate AMF. Before forwarding the PDU to AMF, I had to remove the slice information from the PDU at gNB, else it leads to a
"Unsupported Message Type received"
error on AMF end.