Skip to content

delete all network slices do not remove PLMN IDs and NSSAIs from the NSSF config #183

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

Open
patriciareinoso opened this issue Apr 3, 2025 · 1 comment

Comments

@patriciareinoso
Copy link
Contributor

patriciareinoso commented Apr 3, 2025

Description

When receiving the network configuration from webconsole's via the gRPC service. The NSSF stores the PLMN ID (MCC + MNC) in NssfConfig.Configuration.SupportedPlmnList and the NSSAI (SST + SD) NssfConfig.Configuration.SupportedNssaiInPlmnList. The PLMN ID is used in the NF's profile when registering to the NRF.

025-04-03T09:58:08.532Z [nssf] 2025-04-03T09:58:08.530Z        INFO    factory/config.go:124   Received updateConfig in the nssf app :  RestartCounter:1520406125 NetworkSlice:{Name:"default" Nssai:{Sst:"1" Sd:"102030"} Site:{SiteName:"demo" Gnb:{Name:"ran-gnbsim-gnbsim" Tac:1} Plmn:{mcc:"001" mnc:"01"} Upf:{UpfName:"upf-external.sdcore.svc.cluster.local"}} AppFilters:{PccRuleBase:{FlowInfos:{FlowDesc:"permit out ip from any to assigned" TosTrafficClass:"IPV4" FlowDir:BIDIRECTIONAL} RuleId:"DefaultRule" Qos:{Var5qi:9 Arp:{PL:1 PC:MAY_PREEMPT PV:PREEMPTABLE}} Priority:255}}} ConfigUpdated:1    {"component": "NSSF", "category": "GRPC"}
2025-04-03T09:58:08.532Z [nssf] 2025-04-03T09:58:08.530Z        INFO    factory/config.go:126   Network Slice Name  default     {"component": "NSSF", "category": "GRPC"}
2025-04-03T09:58:08.532Z [nssf] 2025-04-03T09:58:08.530Z        INFO    factory/config.go:128   Network Slice has site name present     {"component": "NSSF", "category": "GRPC"}
2025-04-03T09:58:08.532Z [nssf] 2025-04-03T09:58:08.530Z        INFO    factory/config.go:130   Site name  demo {"component": "NSSF", "category": "GRPC"}
2025-04-03T09:58:08.532Z [nssf] 2025-04-03T09:58:08.530Z        INFO    factory/config.go:132   Plmn mcc  001   {"component": "NSSF", "category": "GRPC"}
2025-04-03T09:58:08.532Z [nssf] 2025-04-03T09:58:08.530Z        INFO    factory/config.go:133   Plmn mnc  01    {"component": "NSSF", "category": "GRPC"}
2025-04-03T09:58:08.532Z [nssf] 2025-04-03T09:58:08.530Z        INFO    factory/config.go:146   Slice Sst  1    {"component": "NSSF", "category": "GRPC"}
2025-04-03T09:58:08.532Z [nssf] 2025-04-03T09:58:08.530Z        INFO    factory/config.go:147   Slice Sd  102030        {"component": "NSSF", "category": "GRPC"}
2025-04-03T09:58:08.532Z [nssf] 2025-04-03T09:58:08.530Z        INFO    factory/config.go:171   Send config trigger to main routine     {"component": "NSSF", "category": "GRPC"}
2025-04-03T09:58:08.532Z [nssf] 2025-04-03T09:58:08.530Z        INFO    service/init.go:382     minimum configuration from config pod available true    {"component": "NSSF", "category": "Init"}
2025-04-03T09:58:08.600Z [nssf] 2025-04-03T09:58:08.597Z        INFO    service/init.go:315     stopped KeepAlive Timer {"component": "NSSF", "category": "Init"}
2025-04-03T09:58:08.600Z [nssf] 2025-04-03T09:58:08.597Z        INFO    service/init.go:308     started KeepAlive Timer: 60 sec {"component": "NSSF", "category": "Init"}
2025-04-03T09:58:08.600Z [nssf] 2025-04-03T09:58:08.597Z        INFO    service/init.go:395     sent register NFInstance with updated profile   {"component": "NSSF", "category": "CFG"}

However, if we delete all the network slices from the webconsole, the AUSF will receive an empty configuration message, and still considers it has valid PLMN and NSSAI to register to the NRF

2025-04-03T09:58:21.414Z [nssf] 2025-04-03T09:58:21.412Z        INFO    client/gClient.go:200   stream message received {"component": "Config5g", "category": "GRPC"}
2025-04-03T09:58:21.414Z [nssf] 2025-04-03T09:58:21.413Z        INFO    client/gClient.go:212   complete config deleted {"component": "Config5g", "category": "GRPC"}
2025-04-03T09:58:21.414Z [nssf] 2025-04-03T09:58:21.413Z        INFO    factory/config.go:124   Received updateConfig in the nssf app :  RestartCounter:1520406125 ConfigUpdated:1      {"component": "NSSF", "category": "GRPC"}
2025-04-03T09:58:21.414Z [nssf] 2025-04-03T09:58:21.413Z        INFO    factory/config.go:179   Send config trigger to main routine     {"component": "NSSF", "category": "GRPC"}
2025-04-03T09:58:21.414Z [nssf] 2025-04-03T09:58:21.413Z        INFO    service/init.go:382     minimum configuration from config pod available false   {"component": "NSSF", "category": "Init"}
2025-04-03T09:58:21.501Z [nssf] 2025-04-03T09:58:21.501Z        INFO    service/init.go:315     stopped KeepAlive Timer {"component": "NSSF", "category": "Init"}
2025-04-03T09:58:21.501Z [nssf] 2025-04-03T09:58:21.501Z        INFO    service/init.go:308     started KeepAlive Timer: 60 sec {"component": "NSSF", "category": "Init"}
2025-04-03T09:58:21.501Z [nssf] 2025-04-03T09:58:21.501Z        INFO    service/init.go:395     sent register NFInstance with updated profile   {"component": "NSSF", "category": "CFG"}

Looking at the code in nssf/service/init.go, we always add the PLMNs and NSSAI to the NssfConfig.Configuration, but never delete them

func (c *Config) UpdateConfig(commChannel chan *protos.NetworkSliceResponse) bool {
...
NssfConfig.Configuration.SupportedPlmnList = append(NssfConfig.Configuration.SupportedPlmnList, *plmn)
NssfConfig.Configuration.SupportedNssaiInPlmnList = append(NssfConfig.Configuration.SupportedNssaiInPlmnList, sNssaiInPlmns)
...
}

To Reproduce

  1. Create a network slice in the webconsole
  2. See in the NSSF that the configuration is received, and that the NSSF registers to the NRF
  3. Delete the network slice in the webconsole
  4. See the following logs, which indicates the context.PlmnList is not empty:
factory/config.go:179   Send config trigger to main routine
service/init.go:382     minimum configuration from config pod available false

This is the code that prints the logs:

if !minConfig {
	// first slice Created
	if (len(NssfConfig.Configuration.SupportedPlmnList) > 0) &&
		(len(NssfConfig.Configuration.SupportedNssaiInPlmnList) > 0) {
		minConfig = true
		ConfigPodTrigger <- true
		logger.GrpcLog.Infoln("Send config trigger to main routine")
	}
} else {
	// all slices deleted
	if (len(NssfConfig.Configuration.SupportedPlmnList) > 0) &&
		(len(NssfConfig.Configuration.SupportedNssaiInPlmnList) > 0) {
		minConfig = false
		ConfigPodTrigger <- false
		logger.GrpcLog.Infoln("Send config trigger to main routine") // line 179 -> we are passing trough this line
	} else {
		ConfigPodTrigger <- true
		logger.GrpcLog.Infoln("Send config trigger to main routine")
	}
}

The code seems inconsistent with the comment. If all the slices were deleted the condition should be

len(NssfConfig.Configuration.SupportedPlmnList) == 0) && (len(NssfConfig.Configuration.SupportedNssaiInPlmnList) == 0

Expected behavior

  1. The PLMNs and NSSAIs are removed
  2. Should the NSSF deregisters from the NRF if there are no PLMN IDs as it's done by the AUSF ? (the deregistration code is not implement)

The Fix

In nssf/service/init.go -> UpdateConfig I would overwrite NssfConfig.Configuration.SupportedPlmnList and NssfConfig.Configuration.SupportedNssaiInPlmnList with what ever is received on the gRPC message, instead of trying to identify the diff

@patriciareinoso patriciareinoso changed the title delete all network slices do not remove PLMN IDs from the NSSF context delete all network slices do not remove PLMN IDs and NSSAIs from the NSSF config Apr 3, 2025
@patriciareinoso
Copy link
Contributor Author

Related to omec-project/ausf#173

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant