Skip to content

Commit 54b4ba4

Browse files
authored
feat: implement new configuration system (#438)
* feat: implement new configuration system * chore: add nf type to subscription * feat: implement polling for NF configuration * chore: define ue routing manager not to store dynamic data in a static global map * chore: add unit tests * refactor: updateSMFContext method * chore: improve HTTPNfSubscriptionStatusNotify function * fix: static error while marshalling BP Manager * chore: update BPManager MarshalJSON method * fix: static errors and enable static checks * fix: validation function * chore: compare old and new session config before triggering registration * fix: do not cancel registration if lastconfigs and newconfigs are same * fix: update UPF port in smcontext * chore: add AN nodes to User plane * fix: missing user plane information and links * chore: move userplane logic to userplane information file * chore: create AN node before linking to UPF * chore: create UPF-to-GNB link immediately for each GNB * chore: filter non-upf nodes while generation data path * chore: trigger pfcp association when userplane is set to context * fix: do not accept 0 pfcp port --------- Signed-off-by: gatici <[email protected]>
1 parent a90b92d commit 54b4ba4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3250
-2830
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
with:
2121
branch_name: ${{ github.ref }}
2222

23-
#static-analysis:
24-
# uses: omec-project/.github/.github/workflows/static-analysis.yml@main
25-
# with:
26-
# branch_name: ${{ github.ref }}
23+
static-analysis:
24+
uses: omec-project/.github/.github/workflows/static-analysis.yml@main
25+
with:
26+
branch_name: ${{ github.ref }}
2727

2828
lint:
2929
uses: omec-project/.github/.github/workflows/lint.yml@main

.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ linters:
2727
- unconvert
2828
- unparam
2929
- whitespace
30-
disable:
3130
- staticcheck
3231
settings:
3332
errcheck:

README.md

Lines changed: 51 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<!--
2+
SPDX-FileCopyrightText: 2025 Canonical Ltd
23
SPDX-FileCopyrightText: 2022-present Intel Corporation
34
SPDX-FileCopyrightText: 2021 Open Networking Foundation <[email protected]>
45
Copyright 2019 free5GC.org
@@ -14,12 +15,35 @@ point to communicate with UPF (User Plane Function). SD-Core SMF supports
1415
interaction with multiple UPFs. SMF supports handling dynamic slice
1516
configuration, removal and modification.
1617

18+
Compliance of the 5G Network functions can be found at [5G Compliance](https://docs.sd-core.opennetworking.org/main/overview/3gpp-compliance-5g.html)
19+
1720
## SMF Block diagram
1821

1922
![SMF Architecture](/docs/images/README-SMF.png)
2023

21-
SMF has configuration interface to handle slice configuration. Config service is
22-
realised using the project - Config Service. SMF exports metrics to prometheus.
24+
## Dynamic Network configuration (via webconsole)
25+
26+
SMF polls the webconsole every 5 seconds to fetch the latest SNssaiInfo and UserPlaneInformation configuration.
27+
28+
### Setting Up Polling
29+
30+
Include the `webuiUri` of the webconsole in the configuration file
31+
```
32+
configuration:
33+
...
34+
webuiUri: https://webui:5001 # or http://webui:5001
35+
...
36+
```
37+
The scheme (http:// or https://) must be explicitly specified. If no parameter is specified,
38+
SMF will use `http://webui:5001` by default.
39+
40+
### HTTPS Support
41+
42+
If the webconsole is served over HTTPS and uses a custom or self-signed certificate,
43+
you must install the root CA certificate into the trust store of the SMF environment.
44+
45+
Check the official guide for installing root CA certificates on Ubuntu:
46+
[Install a Root CA Certificate in the Trust Store](https://documentation.ubuntu.com/server/how-to/security/install-a-root-ca-certificate-in-the-trust-store/index.html)
2347

2448
## Supported Features
2549
1. Supports PDU Session Establishment, Modification, Release
@@ -31,42 +55,40 @@ realised using the project - Config Service. SMF exports metrics to prometheus.
3155
7. UE address pool per Slice
3256
8. PFCP heartbeat towards UPF
3357
9. UE IP-Address allocation via UPF
34-
10. QoS call flows in SMF to handle PCC rules in Create Session Policy Response
35-
and installing those rules in UPF & UE
36-
11. High Availibilty and Cloud Native support(scale up/down number of instances
37-
and subscriber store in Database)
38-
12. UPF-Adapter for PFCP registration of multiple SMF instances with same
39-
node-id to any UPF
58+
10. QoS call flows in SMF to handle PCC rules in Create Session Policy Response and installing those rules in UPF & UE
59+
11. High Availability and Cloud Native support (scale up/down number of instances and subscriber store in Database)
60+
12. UPF-Adapter for PFCP registration of multiple SMF instances with the same node id to any UPF
4061
13. Keep-alive support with respect to NRF
4162
14. Transaction queueing for the same PDU session
4263
15. SMF metrics available via metric-func to 5g Grafana dashboard
4364
16. Static IP-address provision via configuration
4465

45-
46-
## SMF supports wide range of error handling,
47-
This includes some of the handling as listed below
48-
1. UPF Reconnect if UPF restarts
49-
2. PFCP Heartbeat handling towards UPF
50-
3. PFCP Transaction timeout and not to wait forever
51-
4. SBI message timeout handling and handling timeouts
52-
5. Registration towards NRF with updated configuration
53-
6. Retrying NRF registration if NRF is not available
54-
55-
## Upcoming features in SMF
56-
57-
1. Policy Notify from PCF for QoS update
58-
59-
Compliance of the 5G Network functions can be found at [5G Compliance](https://docs.sd-core.opennetworking.org/main/overview/3gpp-compliance-5g.html)
60-
61-
Design section for SMF is available at [SMF Design](https://docs.sd-core.opennetworking.org/main/design/design-smf.html)
66+
## SMF supports wide range of error handling
67+
68+
This includes some of the handling as listed below:
69+
1. UPF Connection Management:
70+
- Implements automatic UPF reconnection mechanism when UPF restarts
71+
- Maintains PFCP heartbeat monitoring towards UPF for connection health checks
72+
2. PFCP Protocol Handling:
73+
- Implements transaction timeout controls to prevent indefinite wait states
74+
- Manages PFCP session lifecycle and termination
75+
3. Service-Based Interface (SBI) Management:
76+
- Handles SBI message timeouts with proper error recovery
77+
- Implements retry mechanisms for failed operations
78+
4. NRF Integration:
79+
- Supports dynamic registration updates with NRF
80+
- Implements automatic retry logic for NRF registration when service is unavailable
81+
- Maintains NRF connection through heartbeat service
82+
5. Configuration Management:
83+
- Implements resilient configuration polling for Webconsole config server
84+
- Includes automatic retry mechanism for configuration service availability
6285

6386
## How to use SMF
6487

6588
Refer to the [SD-Core documentation](https://docs.sd-core.opennetworking.org/main/index.html)
6689

90+
## Reach out to us through
6791

68-
## Reach out to us thorugh
69-
70-
1. #sdcore-dev channel in [ONF Community Slack](https://onf-community.slack.com/)
71-
2. Raise Github issues
92+
1. #sdcore-dev channel in [Aether Community Slack](https://aether5g-project.slack.com)
93+
2. Raise Github [issues](https://github.com/omec-project/smf/issues/new)
7294

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.6-dev
1+
3.0.0

callback/api_nf_subscribe_notify.go

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"github.com/omec-project/openapi"
1414
"github.com/omec-project/openapi/models"
1515
"github.com/omec-project/smf/consumer"
16+
smfContext "github.com/omec-project/smf/context"
1617
"github.com/omec-project/smf/logger"
1718
"github.com/omec-project/smf/producer"
1819
"github.com/omec-project/util/httpwrapper"
@@ -62,6 +63,25 @@ func HTTPNfSubscriptionStatusNotify(c *gin.Context) {
6263
c.JSON(http.StatusInternalServerError, problemDetails)
6364
} else {
6465
c.Data(rsp.Status, "application/json", responseBody)
65-
consumer.SendRemoveSubscriptionProcedure(nfSubscriptionStatusNotification)
66+
if nfSubscriptionStatusNotification.Event != models.NotificationEventType_DEREGISTERED {
67+
return
68+
}
69+
nfID := nfSubscriptionStatusNotification.NfProfile.NfInstanceId
70+
value, found := smfContext.SMF_Self().NfStatusSubscriptions.Load(nfID)
71+
if !found {
72+
logger.ConsumerLog.Warnf("no subscriptionId found for NF instance %s", nfID)
73+
return
74+
}
75+
subID := value.(string)
76+
problem, err := consumer.SendRemoveSubscription(subID)
77+
if err != nil {
78+
logger.ConsumerLog.Errorf("failed to remove NRF subscription %s: %+v", subID, err)
79+
return
80+
}
81+
if problem != nil {
82+
logger.ConsumerLog.Warnf("NRF responded with problem while removing %s: %+v", subID, problem)
83+
return
84+
}
85+
smfContext.SMF_Self().NfStatusSubscriptions.Delete(nfID)
6686
}
6787
}

config/smfcfg.yaml

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -47,57 +47,8 @@ configuration:
4747
- nsmf-pdusession # Nsmf_PDUSession service
4848
- nsmf-event-exposure # Nsmf_EventExposure service
4949
- nsmf-oam # OAM service
50-
snssaiInfos: # the S-NSSAI (Single Network Slice Selection Assistance Information) list supported by this AMF
51-
- sNssai: # S-NSSAI (Single Network Slice Selection Assistance Information)
52-
sst: 1 # Slice/Service Type (uinteger, range: 0~255)
53-
sd: "010203" # Slice Differentiator (3 bytes hex string, range: 000000~FFFFFF)
54-
dnnInfos: # DNN information list
55-
- dnn: internet # Data Network Name
56-
dns: # the IP address of DNS
57-
ipv4: 8.8.8.8
58-
ipv6: 2001:4860:4860::8888
59-
ueSubnet: 60.60.0.0/16 # should be CIDR type
60-
mtu: 1400
61-
plmnId:
62-
mcc: "111"
63-
mnc: "222"
64-
- sNssai: # S-NSSAI (Single Network Slice Selection Assistance Information)
65-
sst: 1 # Slice/Service Type (uinteger, range: 0~255)
66-
sd: "112233" # Slice Differentiator (3 bytes hex string, range: 000000~FFFFFF)
67-
dnnInfos: # DNN information list
68-
- dnn: internet # Data Network Name
69-
dns: # the IP address of DNS
70-
ipv4: 8.8.8.8
71-
ipv6: 2001:4860:4860::8888
72-
ueSubnet: 60.61.0.0/16 # should be CIDR type
73-
mtu: 1400
74-
plmnId:
75-
mcc: "333"
76-
mnc: "444"
7750
pfcp: # the IP address of N4 interface on this SMF (PFCP)
7851
addr: smf
79-
userplane_information: # list of userplane information
80-
up_nodes: # information of userplane node (AN or UPF)
81-
gNB: # the name of the node
82-
type: AN # the type of the node (AN or UPF)
83-
UPF1: # the name of the node
84-
type: UPF # the type of the node (AN or UPF)
85-
node_id: upf # the IP/FQDN of N4 interface on this UPF (PFCP)
86-
sNssaiUpfInfos: # S-NSSAI information list for this UPF
87-
- sNssai: # S-NSSAI (Single Network Slice Selection Assistance Information)
88-
sst: 1 # Slice/Service Type (uinteger, range: 0~255)
89-
sd: "010203" # Slice Differentiator (3 bytes hex string, range: 000000~FFFFFF)
90-
dnnUpfInfoList: # DNN information list for this S-NSSAI
91-
- dnn: internet
92-
interfaces: # Interface list for this UPF
93-
- interfaceType: N3 # the type of the interface (N3 or N9)
94-
endpoints: # the IP address of this N3/N9 interface on this UPF
95-
- upf
96-
networkInstance: internet # Data Network Name (DNN)
97-
98-
links: # the topology graph of userplane, A and B represent the two nodes of each link
99-
- A: gNB
100-
B: UPF1
10152
nrfUri: http://nrf:29510 # a valid URI of NRF
10253

10354
# the kind of log output

config/smfcfg_with_custom_webui_url.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ configuration:
1111
debugProfilePort: 5001
1212
smfName: SMF # the name of this SMF
1313
nrfUri: http://nrf:29510 # a valid URI of NRF
14-
webuiUri: myspecialwebui:9872 # a valid URI of Webui
14+
webuiUri: https://myspecialwebui:5002 # a valid URI of Webui
1515

0 commit comments

Comments
 (0)