Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ and the project aims to follow [Semantic Versioning](https://semver.org/spec/v2.

## [Unreleased]

### Upgrade notes
- **Upgrade udmd before nefd** (#2154). nefd refreshes its UDM Nudm_EE legs with
`add /reportingOptions/expiry` (#2133), which a udmd from before #2133 answers 400. nefd falls
back once to the whole-object form, which keeps legs alive across a rolling upgrade but replaces
the UDM's other `reportingOptions` members, so upgrade udmd first.

### Added
- udmd's durable state file (#1836) gets a volume on Kubernetes (#1885). The Helm chart's
`udm.durableState` (off by default) mounts a ReadWriteOnce claim, or an emptyDir, at
Expand Down
4 changes: 2 additions & 2 deletions docs-book/src/configuration/nef.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The NEF (Network Exposure Function, `nextgcore-nefd`, TS 23.501 §6.2.5) exposes

- **Monitoring Event** (TS 29.122 §5.3): `POST /3gpp-monitoring-event/v1/{scsAsId}/subscriptions` and `DELETE .../subscriptions/{subscriptionId}`. A create becomes a southbound subscription toward the AMF (`Namf_EventExposure`, TS 29.518) or the UDM (`Nudm_EE`, TS 29.503).
- **Device Triggering** (TS 29.122 §5.10): `POST /3gpp-device-triggering/v1/{scsAsId}/transactions`.
- **`Nnef_EventExposure`** (TS 29.591): `POST /nnef-eventexposure/v1/subscriptions`, `DELETE .../subscriptions/{subId}`, and the producer notification sink `POST /nnef-eventexposure/v1/notify/{subId}`, which forwards AMF/UDM notifications to the AF's `notificationDestination` as a TS 29.122 MonitoringNotification.
- **`Nnef_EventExposure`** (TS 29.591): `POST /nnef-eventexposure/v1/subscriptions`, `DELETE .../subscriptions/{subId}`, and the producer notification sink `POST /nnef-eventexposure/v1/notify/{subId}`, which forwards AMF/UDM notifications to the subscriber's notification URI in the shape of the API it subscribed on (#2154): a TS 29.122 MonitoringNotification for a T8 subscription, a TS 29.591 `NefEventExposureNotif` (`notifId`, and one `eventNotifs` entry per report with the subscribed `event` and its `timeStamp`) for a Nnef_EventExposure one. **Ceiling:** TS 29.591 defines no member for a location, reachability or loss-of-connectivity report, so a Nnef_EventExposure notification says which event occurred and when, and no more; the T8 API carries the report itself.

It registers with the NRF as `nfType: NEF` advertising `nnef-eventexposure`. PFD management, traffic influence and parameter provision are out of scope (`src/bins/nextgcore-nefd/src/main.rs` module docs).

Expand Down Expand Up @@ -61,5 +61,5 @@ Everything else is configured by flags.
- **Southbound is best-effort.** With no producer URI, or an unreachable producer, the northbound subscription is still created and the southbound leg is retried by the reconciler until `NEF_PENDING_LEG_DEADLINE_SECS`.
- **Cancellation-safe create and delete (#1877).** A monitoring-subscription create runs on its own task, so an AF that goes away while the producer's subscribe is out cannot leave a producer subscription recorded nowhere. A 201 the AF never read is removed together with its producer leg. A delete removes the record first, then sends the producer DELETE on its own task.
- **Producer unsubscribes are retried (#1877).** A southbound DELETE that fails (no answer, a non-2xx other than 404) is parked and retried every 30 s at the producer the subscription was made at (the URI configured at the time, for a subscription recorded before #1877), until the producer answers 2xx or 404. Within a pass, a producer that fails once is not tried again, and a tried unsubscribe goes to the back of the queue, so a blackholed producer cannot starve the others. Across passes, a failing producer backs off: 30 s after its first failure, doubled after each further one up to 10 min, and cleared by a delivery. A producer with nothing left parked is forgotten, so one that never comes back does not stay tracked (#1994). So a dead producer costs one request timeout per backoff period rather than one per pass. One parked for 24 h is given up and counted `expired`. At most 4096 are kept, and the oldest by park time, wherever rotation has put it, is evicted and counted `abandoned`. With a state file (#2086), the unsubscribes still owed are written to the same snapshot as the subscriptions. One is recorded before the removal of its subscription is persisted and before its DELETE is sent, and it leaves the snapshot once delivered. So a restart retries every unsubscribe the NEF owes, and its 24 h counts from the restart. Without a state file, nothing is kept across a restart. Metrics `nef_southbound_unsubscribes_pending`, `nef_southbound_unsubscribes_parked_total{producer}` and `nef_southbound_unsubscribes_reconciled_total{result}` are served on `/metrics` in a demo build, and are otherwise read in-process.
- **Southbound subscriptions expire unless refreshed (#2102).** Every AMF Namf_EventExposure or UDM Nudm_EE subscribe asks for an expiry `NEF_SOUTHBOUND_LIFETIME_SECS` ahead: `subscription.options.expiry`, or `reportingOptions.expiry` for the UDM. The NEF records the expiry the producer confirms. On every reconcile tick, on a task of its own, it refreshes a leg once half its lifetime or less is left. Legs are refreshed per producer, up to 8 producers at once. A producer that fails a refresh is not tried again that pass, so a dead producer costs one request timeout per tick and other producers' legs are still refreshed (#2128). The modifications are `replace /options/expiry` at the AMF, and `add /reportingOptions/expiry` at the UDM: the member, so the UDM's other `reportingOptions` members are kept (RFC 6902 `add` on `/reportingOptions` replaces the object). A leg made before #2102 has no `reportingOptions` and gets the whole object (#2133). If a refresh is answered 404, or the expiry passes before a refresh gets through, the subscription is removed. In the second case its DELETE is also sent. **The AF is told (#2133):** whenever the NEF removes a subscription on its own initiative (here, or a deferred leg past `NEF_PENDING_LEG_DEADLINE_SECS`), it sends the AF a MonitoringNotification naming the subscription with `cancelInd: true` and no reports (TS 29.122). Best effort, like every AF notification. A DELETE the AF asked for is not notified. So a subscription the NEF holds no record of, because its create timed out after the producer took it, is never refreshed and lapses at the producer. nextgcore's `udmd` enforces the EE expiry and grants a refresh (#2125).
- **Southbound subscriptions expire unless refreshed (#2102).** Every AMF Namf_EventExposure or UDM Nudm_EE subscribe asks for an expiry `NEF_SOUTHBOUND_LIFETIME_SECS` ahead: `subscription.options.expiry`, or `reportingOptions.expiry` for the UDM. The NEF records the expiry the producer confirms. On every reconcile tick, on a task of its own, it refreshes a leg once half its lifetime or less is left. Legs are refreshed per producer, up to 8 producers at once. A producer that fails a refresh is not tried again that pass, so a dead producer costs one request timeout per tick and other producers' legs are still refreshed (#2128). The modifications are `replace /options/expiry` at the AMF, and `add /reportingOptions/expiry` at the UDM: the member, so the UDM's other `reportingOptions` members are kept (RFC 6902 `add` on `/reportingOptions` replaces the object). A leg made before #2102 has no `reportingOptions` and gets the whole object (#2133). If a refresh is answered 404, or the expiry passes before a refresh gets through, the subscription is removed. In the second case its DELETE is also sent. **The AF is told (#2133):** whenever the NEF removes a subscription on its own initiative (here, or a deferred leg past `NEF_PENDING_LEG_DEADLINE_SECS`), it sends the AF a MonitoringNotification naming the subscription with `cancelInd: true` and no reports (TS 29.122). Best effort, like every AF notification. A DELETE the AF asked for is not notified. TS 29.591 defines no such indication for a Nnef_EventExposure consumer, so one is sent nothing (#2154). **Upgrade order (#2154): upgrade udmd before nefd.** A udmd from before #2133 accepts only top-level patch paths and answers `add /reportingOptions/expiry` 400. nefd then retries that refresh once with the whole `reportingOptions` object, so legs are still refreshed during a rolling upgrade, but that form replaces the UDM's other `reportingOptions` members. So a subscription the NEF holds no record of, because its create timed out after the producer took it, is never refreshed and lapses at the producer. nextgcore's `udmd` enforces the EE expiry and grants a refresh (#2125).
- **GPSI resolution needs the UDM.** nextgcore's own `udmd` serves `id-translation-result`, which resolves a GPSI through the UDR's `identity-data`.
12 changes: 12 additions & 0 deletions src/bins/nextgcore-nefd/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ pub struct NefMonitoringSubscription {
/// first refresh sweep bounds.
#[serde(default)]
pub southbound_expiry: Option<u64>,
/// #2154: the northbound API the subscription was made on, which decides
/// the shape of what its consumer is sent (TS 29.122 MonitoringNotification
/// or TS 29.591 NefEventExposureNotif). T8 for a record from before #2154.
#[serde(default)]
pub northbound_api: crate::NorthboundApi,
}

impl NefMonitoringSubscription {
Expand Down Expand Up @@ -232,9 +237,16 @@ impl NefMonitoringSubscription {
raw: raw.into(),
notify_token: Some(nextgcore_sbi::callback_auth::CallbackToken::mint()),
southbound_expiry: None,
northbound_api: crate::NorthboundApi::default(),
}
}

/// Record the northbound API it was made on (#2154).
pub fn with_northbound_api(mut self, api: crate::NorthboundApi) -> Self {
self.northbound_api = api;
self
}

/// Record the external identity the AF used (issue #110).
pub fn with_af_target(mut self, target: Option<AfTarget>) -> Self {
self.af_target = target;
Expand Down
Loading
Loading