Commit 259a1e2b authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Merge branch 'nssai_check_fix' into 'develop'

Fix NSSAI check during UPF selection

See merge request oai/cn5g/oai-cn5g-smf!128
parents 2de278f9 6d0a5f25
......@@ -114,13 +114,13 @@ SMF =
{
SESSION_MANAGEMENT_SUBSCRIPTION_LIST = (
{ NSSAI_SST = @NSSAI_SST0@, NSSAI_SD = "@NSSAI_SD0@", DNN = "@DNN_NI0@", DEFAULT_SESSION_TYPE = "@TYPE0@", DEFAULT_SSC_MODE = 1,
QOS_PROFILE_5QI = 6, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT",
QOS_PROFILE_5QI = @QOS_PROFILE_5QI0@, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT",
QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "@SESSION_AMBR_UL0@", SESSION_AMBR_DL = "@SESSION_AMBR_DL0@"},
{ NSSAI_SST = @NSSAI_SST1@; NSSAI_SD = "@NSSAI_SD1@", DNN = "@DNN_NI1@", DEFAULT_SESSION_TYPE = "@TYPE1@", DEFAULT_SSC_MODE = 1,
QOS_PROFILE_5QI = 7, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT",
QOS_PROFILE_5QI = @QOS_PROFILE_5QI1@, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT",
QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "@SESSION_AMBR_UL1@", SESSION_AMBR_DL = "@SESSION_AMBR_DL1@"},
{ NSSAI_SST = @NSSAI_SST2@; NSSAI_SD = "@NSSAI_SD2@", DNN = "@DNN_NI2@", DEFAULT_SESSION_TYPE = "@TYPE2@", DEFAULT_SSC_MODE = 1,
QOS_PROFILE_5QI = 8, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT",
QOS_PROFILE_5QI = @QOS_PROFILE_5QI2@, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT",
QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "@SESSION_AMBR_UL2@", SESSION_AMBR_DL = "@SESSION_AMBR_DL2@"}
);
};
......
......@@ -17,6 +17,9 @@ NSSAI_SST1=${NSSAI_SST1:-1}
NSSAI_SD1=${NSSAI_SD1:-1}
NSSAI_SST2=${NSSAI_SST2:-1}
NSSAI_SD2=${NSSAI_SD2:-1}
QOS_PROFILE_5QI0=${QOS_PROFILE_5QI0:-6}
QOS_PROFILE_5QI1=${QOS_PROFILE_5QI1:-7}
QOS_PROFILE_5QI2=${QOS_PROFILE_5QI2:-8}
SESSION_AMBR_UL0=${SESSION_AMBR_UL0:-20Mbps}
SESSION_AMBR_DL0=${SESSION_AMBR_DL0:-22Mbps}
SESSION_AMBR_UL1=${SESSION_AMBR_UL1:-20Mbps}
......
......@@ -32,6 +32,8 @@ typedef uint64_t supi64_t;
#define SUPI_DIGITS_MAX 15
const uint8_t SST_MAX_STANDARDIZED_VALUE = 127;
typedef struct {
uint32_t length;
char data[SUPI_DIGITS_MAX + 1];
......
......@@ -467,15 +467,19 @@ bool pfcp_associations::select_up_node(
Logger::smf_app().debug("UPF info: %s", upf_info.to_string().c_str());
for (auto ui : upf_info.snssai_upf_info_list) {
if (ui.snssai == snssai) {
for (auto d : ui.dnn_upf_info_list) {
if (d.dnn.compare(dnn) == 0) {
node_id = it->second->node_id;
Logger::smf_app().info(
"Select the UPF for the corresponding DNN %s, NSSSAI (SD: %s, "
"SST: %d) ",
d.dnn.c_str(), snssai.sD.c_str(), snssai.sST);
return true;
if (ui.snssai.sST == snssai.sST) {
if ((ui.snssai.sST <= SST_MAX_STANDARDIZED_VALUE) or
(snssai.sD.compare(ui.snssai.sD) == 0)) {
for (auto d : ui.dnn_upf_info_list) {
if (d.dnn.compare(dnn) == 0) {
node_id = it->second->node_id;
Logger::smf_app().info(
"Select the UPF for the corresponding DNN %s, NSSSAI (SD: "
"%s, "
"SST: %d) ",
d.dnn.c_str(), snssai.sD.c_str(), snssai.sST);
return true;
}
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment