feat(smf): add Nsmf event exposure create/delete support#225
Draft
haha39 wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft / Stacked Dependency
This is a Draft stacked PR blocked by free5gc/openapi#77.
It depends on free5gc/openapi#77 for the Nsmf and Nupf Event Exposure models,
the Nupf Create/Delete client, and the configurable redirect policy used to
reject Nupf
307/308responses without replay.Local development and review used free5gc/openapi commit
d357875through anexternal temporary
go.work. This PR does not include a committedgo.work,go.work.sum, localreplace, fork-only module wiring, duplicate Nupf wiremodels, or duplicate Nupf client code.
At the time this draft was opened, free5gc/openapi#77 did not yet provide a
canonical upstream dependency revision. Final upstream-ready validation with
GOWORK=offhas not completed. This PR is therefore not yet claiming finalupstream readiness.
Summary
This PR adds the initial SMF-side Nsmf Event Exposure Create/Delete path for
UPF user data usage subscriptions.
The SMF accepts a focused Nsmf Event Exposure profile, resolves the selected
active PDU session and UPF, creates the corresponding Nupf Event Exposure
subscription on that UPF, stores local linkage state, and deletes the downstream
UPF subscription when the Nsmf subscription is deleted.
Supported Profile
The initial profile supports:
POST /nsmf-event-exposure/v1/subscriptionsDELETE /nsmf-event-exposure/v1/subscriptions/{subId}UPF_EVENTUSER_DATA_USAGE_MEASURESVOLUME_MEASUREMENTandTHROUGHPUT_MEASUREMENTPER_SESSIONPERIODICUnsupported operations such as GET and replace return
501 ProblemDetails.Changes
/nsmf-event-exposure/v1route whennsmf-event-exposureis present inserviceNameList.profile.
supi,notifId,notifUri,bundledEventNotifyUri, oneeventSubsentry, oneupfEventsentry, supported measurement types,PER_SESSION, and positiverepPeriod.pduSeId: 0.bundlingAllowedorbundleIdwith
400 ProblemDetails.supi -> active SM context -> UE IP -> selected UPF -> nupfEeApiRoot.nupfEeApiRootconfiguration, valid only on UPF nodes.semantics and atomic Delete claim.
feat: extend Nsmf_EventExposure models and add Nupf_EventExposure client openapi#77.
openapi.RejectRedirectsso Create/Delete307/308responses are not replayed.Locationheader against the actual Create request URI and configured UPFservice base URL.
502 Bad Gatewayresponse.does not rerun SUPI/session resolution or treat stored Location as a URL to
call.
Nsmf to Nupf Mapping
notifIdnotifyCorrelationIdbundledEventNotifyUrieventNotifyUriueIpAddresseventList[].measurementTypesPER_SESSIONeventList[].granularityOfMeasurementrepPeriodeventReportingMode.repPeriodnfIdThe Nupf Create request uses the required outer
subscriptionwrapper.Lifecycle and Error Behavior
Create commits no local state before Nupf Create succeeds.
If Nupf Create succeeds but local Store fails, the SMF returns
500and logs abounded orphan warning. It does not attempt an automatic compensating Delete.
Delete atomically claims and removes local state first, then attempts downstream
Nupf Delete using the stored target snapshot and UPF subscription ID. Downstream
Delete failure, redirect, or token acquisition failure is logged as a bounded
warning and the Nsmf Delete still returns
204.Unknown local Delete returns
404before any token acquisition or Nupf request.Intentional Limitations
The initial PR does not implement:
The implementation reuses existing free5GC OAuth, generated-client, shared HTTP
client, and metrics conventions.
Validation
Local validation used Go
1.26.2, free5gc/openapi commitd357875, and anexternal temporary
go.work.Passed:
The Docker lint run reported:
Repository-wide
go test -count=1 ./...was also run. Event Exposure relatedpackages passed, but the full run is not green because of existing unrelated
internal/pfcp/handlerlog extraction panics at:Final upstream-ready validation with
GOWORK=offremains blocked untilfree5gc/openapi#77 has a canonical dependency revision.
Related PRs
Depends on free5gc/openapi#77.