Skip to content

NEF / N33 / Event Exposure — How Much of the 5GC to Show an External AF

Difficulty: Advanced (deep dive) / Estimated study time: 35 min / Prerequisites: AF / N5 / Application Session, NEF, N33 / Main actors: AF (external), NEF, PCF, BSF, UDM, AMF / Main interface: N33

Learning objectives

After reading this chapter, you will be able to:

  • Explain, following TS 23.501 §6.2.5, that the NEF is not a "proxy that forwards external requests as-is" but a boundary that performs authorization, information hiding and identifier translation
  • Explain the difference between N33 (AF⇔NEF) and N5 (AF⇔PCF), and what is translated along the path external AF → NEF → PCF
  • Draw the call flows of AF session with required QoS and Event Exposure, and list the correlation keys of each segment (UE IP, AF Identifier, Transaction Reference ID, App Session ID, etc.)
  • Isolate, by splitting into four segments, the cases "the API call returned 2xx but QoS has no effect / no notification arrives"

Prerequisites

The focus of this chapter (Level ∞ Deep Dive)

The NEF and N33 pages introduce the NEF as "the reception desk for external AFs." This chapter digs, from call-flow and trace-analysis perspectives, into what the reception desk checks, what it hides, what it translates into, and which internal NF it hands the request to — and how many processing stages lie between "accepted at the desk" and "actually took effect / was notified." The details of CAPIF are left to NEF & CAPIF.


Why — why the 5GC must not be shown "as-is" to an external AF

External application providers (external AFs) want to ask the 5GC for things like:

  • "Prioritize this video flow of this UE" (QoS request)
  • "Tell me when this IoT device comes back into coverage" (event notification)
  • "I want to tell you the expected movement pattern of this device" (parameter provisioning)

However, opening the SBIs of internal NFs (PCF / UDM / AMF / SMF) directly to the outside causes the following problems.

Problem Example
Identifier leakage The external AF learns the SUPI (the subscriber's permanent ID) or internal NF endpoints
Lack of authorization There is no way to control which AF may use which UE, which API, and how often
Topology exposure Internal structure, such as which PCF serves which UE, becomes visible from outside
Identifier mismatch What the external AF knows is a phone number, an external ID or the UE's IP address, which do not match the 5GC's internal keys (SUPI, PDU Session)

So a NEF (Network Exposure Function) is placed at the boundary with the outside, and the external AF talks only to the NEF over N33 (TS 23.501 §5.20 / §6.2.5).

Analogy: The NEF is "a bank teller." Customers (external AFs) make requests not with account numbers but with names or membership numbers (GPSI / external ID); the teller verifies identity and authority (authorization), then translates the request into the bank's internal account number (SUPI) and the responsible department (PCF / UDM) before passing it on. The internal account numbers and the staff's extension numbers are never shown to the customer. Even when the teller says "accepted," whether the transfer actually completed must be confirmed through a separate notice.


What — the roles of the NEF (TS 23.501 §6.2.5)

NEF functions

TS 23.501 §6.2.5 (from Rel-16, §6.2.5.0 NEF functionality; sub-clause numbering to be confirmed) defines the NEF's functions roughly as follows.

Function Content Example in this chapter
Exposure of capabilities / events Exposes capabilities and events of internal NFs to AFs, etc. Event Exposure (UE reachability, etc.)
Secure provision of information from outside to inside Accepts information provided by external applications (Expected UE Behaviour, etc.). The NEF authenticates and authorizes the AF and can assist in throttling Parameter Provisioning
Translation between internal and external information Mapping between AF-Service-Identifier and DNN / S-NSSAI etc.; masking of network- and user-sensitive information (according to network policy) QoS request, Traffic Influence
Storing / retrieving structured data in the UDR Stores and retrieves information received from other NFs in the UDR via Nudr Traffic Influence (requests not identified by UE IP)
PFD management / Analytics Exposure, etc. Management of PFDs (Packet Flow Descriptions), exposure of NWDAF analytics to the outside, etc. (the supported scope varies per NEF instance) —

The NEF is not a simple proxy

For each type of external AF API, the internal NF the NEF talks to differs per API and procedure. QoS requests go to the PCF (identified through the BSF), event subscriptions go mainly via the UDM to the AMF/SMF, and Traffic Influence not identified by a UE IP goes to the UDR. Thinking "the NEF forwards everything to the PCF" leads to wrong isolation.

Identifier translation and information hiding

The identifiers known by the external AF do not match the 5GC's internal identifiers. The NEF bridges this gap, but it does not return internal identifiers to the outside.

flowchart LR
    subgraph EXT["What the external AF knows"]
        E1["GPSI
(External Identifier / MSISDN)"] E2["UE IP address
(+ IP Domain)"] E3["AF Identifier
AF-Service-Identifier"] end subgraph NEF["NEF (boundary)"] N1["Authorization
(may this AF use this API and this UE?)"] N2["Identifier translation / masking"] end subgraph INT["Internal 5GC keys"] I1["SUPI
(mapped from GPSI by the UDM)"] I2["Serving PCF / PDU Session
(identified by the BSF binding)"] I3["DNN / S-NSSAI"] end E1 --> N1 --> N2 --> I1 E2 --> N1 N2 --> I2 E3 --> N1 N2 --> I3
External identifier What it corresponds to internally Who maps it
GPSI (External Identifier or MSISDN, TS 23.501 §5.9.8) SUPI The GPSI⇔SUPI mapping is held as subscription data by the UDM/UDR. The NEF either passes the GPSI as-is to the UDM or asks the UDM for translation (differs per procedure, to be confirmed)
UE IP address (+ IP Domain / DNN / S-NSSAI) The PCF serving that PDU Session Identified from the BSF binding information (Nbsf_Management_Discovery). Details in BSF / PCF Binding
AF-Service-Identifier DNN / S-NSSAI, etc. The NEF (based on operator configuration, TS 23.501 §6.2.5)
QoS Reference Pre-agreed QoS parameters The PCF (configuration based on an agreement between the operator and the AF provider; content is implementation/contract dependent)
  • The format of an External Identifier is <Local Identifier>@<Domain Identifier> (TS 23.003 §19.7.2, to be confirmed).
  • According to network policy, the NEF masks network- and user-sensitive information (TS 23.501 §6.2.5). The external-facing UE identifier is the GPSI (TS 23.501 §5.9.8). For example, the BSF response (PCF binding) may contain the SUPI, but the design does not pass it as-is to the external AF. Only information that is allowed to be exposed is returned to the external AF.

N33 / N5 / NEF⇔PCF — the difference between reference points

flowchart LR
    XAF["External AF
(AF the operator does not allow direct access)"] == "N33
Northbound API" ==> NEF["NEF"] TAF["Trusted AF
(e.g. inside the operator network)"] == "N5
Npcf_PolicyAuthorization" ==> PCF["PCF"] NEF -- "NEF⇔PCF
Npcf_PolicyAuthorization
(the NEF acts as an AF)" --> PCF NEF -- "Nbsf_Management" --> BSF["BSF"] NEF -- "Nudm_EventExposure etc." --> UDM["UDM"] UDM -- "Namf_EventExposure" --> AMF["AMF"] PCF -- "N7
Npcf_SMPolicyControl" --> SMF["SMF"]
Aspect N33 N5 NEF⇔PCF
Endpoints External AF ⇔ NEF AF ⇔ PCF NEF ⇔ PCF
API used Northbound API (TS 29.522, including APIs derived from T8) Npcf_PolicyAuthorization (TS 29.514) Npcf_PolicyAuthorization (TS 29.514)
Identifiers GPSI / UE IP / AF Identifier (external-facing) UE IP, AF Application Identifier, etc. Internal-facing information already translated by the NEF
Reference point name N33 (TS 23.501 §4.2.7) N5 (TS 23.501 §4.2.7) N30 (TS 23.501 §4.2.7, to be confirmed)

TS 23.501 §6.2.10 states that AFs trusted by the operator can interact directly with relevant NFs, while AFs not allowed direct access use the external exposure framework via the NEF. The key point is that towards the PCF, the NEF calls Npcf_PolicyAuthorization "as an AF." What the PCF sees is the same Policy Authorization App Session, and from there on (PCF → SMF → gNB / UPF) the flow is the same as you learned in AF / N5 / Application Session.

\"An AF always goes through the NEF\" is wrong

Trusted AFs (e.g., the IMS P-CSCF) access the PCF directly over N5. Also, from Rel-17, there is a branch in which, for QoS requests related to Time Sensitive Communication, the NEF works with the TSCTSF instead of directly with the PCF (TS 23.502 §4.15.6.6, to be confirmed). Which path is used depends on the AF's trust level, the API and the Release.

Northbound APIs — the APIs used on N33

The N33 APIs are specified in TS 29.522 (5G System; Network Exposure Function Northbound APIs). TS 29.522 reuses and extends some of the 4G SCEF's T8 APIs (TS 29.122) and adds new APIs for 5GS (which API is defined in which specification is, in detail, to be confirmed per version). In particular, for AsSessionWithQoS and MonitoringEvent, the main body of the API definition (resources, attributes, OpenAPI) is in TS 29.122 (T8), and TS 29.522 references and reuses it. When matching a trace against the OpenAPI, look at TS 29.122.

Northbound API (example resource name) NEF service in TS 23.502 Main internal NF it goes to Main procedure (TS 23.502)
AsSessionWithQoS (3gpp-as-session-with-qos) Nnef_AFsessionWithQoS BSF → PCF (from Rel-17 possibly the TSCTSF) §4.15.6.6 (to be confirmed)
MonitoringEvent (3gpp-monitoring-event) Nnef_EventExposure UDM → AMF / SMF, etc. §4.15.3 (to be confirmed)
TrafficInfluence (3gpp-traffic-influence) Nnef_TrafficInfluence PCF (when a UE IP is given) or UDR §4.3.6 (to be confirmed)
ParameterProvision (3gpp-parameter-provision, name to be confirmed) Nnef_ParameterProvision UDM §4.15.6.2 (to be confirmed)
AnalyticsExposure (3gpp-analyticsexposure, name to be confirmed) Nnef_AnalyticsExposure NWDAF TS 23.288 (clause to be confirmed)
  • The resource URI basically takes the form {apiRoot}/3gpp-<API name>/v1/{scsAsId}/subscriptions (TS 29.122 / TS 29.522, version to be confirmed). {scsAsId} is the identifier of the requesting AF and is the entry point of the NEF's authorization decision.
  • These are different from the internal-facing APIs that start with nnef-... (TS 29.591 NEF Southbound Services, etc.; the defining specification differs per service, e.g. Nnef_PFDManagement is in TS 29.551). When searching for :path in an N33 trace, look for 3gpp-....
  • When the NEF calls internal NFs, it uses the normal internal 5GC SBIs (npcf-policyauthorization, nbsf-management, nudm-ee, namf-evts, etc.).

Where CAPIF fits

CAPIF (TS 23.222) is the framework that standardizes "how N33 APIs are discovered, how API consumers are onboarded, and how they are authorized." The NEF can act as an AEF (API Exposing Function) in CAPIF (TS 23.501 §6.2.5.1, to be confirmed). When CAPIF is used, the AF first goes through onboarding, API discovery and authorization at the CAPIF Core Function, and then calls the NEF's (AEF's) Northbound API. See NEF & CAPIF for the concepts.

The security of N33 itself (TLS, authorization based on OAuth 2.0) is specified in TS 33.501 §12 (security of the NEF; sub-clause numbering to be confirmed).


How — Call Flow ①: an external AF requests QoS (AF session with required QoS)

This is the procedure in which an external AF requests "apply the pre-agreed QoS to this flow of this UE" (TS 23.502 §4.15.6.6 Setting up an AF session with required QoS, to be confirmed). The following is a conceptual diagram of the case where the NEF identifies the PCF through the BSF and works directly with the PCF.

sequenceDiagram
    participant AF as External AF
    participant NEF
    participant BSF
    participant PCF
    participant SMF
    participant AMF
    participant RAN as gNB / UPF
    AF->>NEF: POST 3gpp-as-session-with-qos
(UE IP, Flow description, QoS Reference, notificationDestination) NEF->>NEF: AF authorization / input check
Assign Transaction Reference ID NEF->>BSF: Nbsf_Management_Discovery
(UE IP, DNN, S-NSSAI, etc.) BSF-->>NEF: PCF binding (address of the serving PCF) NEF->>PCF: Npcf_PolicyAuthorization_Create
(media / flow information, QoS Reference, notification target = NEF) PCF->>PCF: Authorize request / decide PCC Rule PCF-->>NEF: 201 Created (App Session ID) NEF-->>AF: 201 Created (Subscription = Transaction Reference ID) PCF->>SMF: Npcf_SMPolicyControl_UpdateNotify
(add / modify PCC Rules) SMF->>AMF: Namf_Communication_N1N2MessageTransfer
(N2 SM information, N1 SM information) AMF->>RAN: NGAP PDU Session Resource Modify Request (gNB) SMF->>RAN: N4 PFCP Session Modification Request (UPF) Note over SMF,RAN: Add / modify QoS Flow, RAN admission control PCF-->>NEF: Npcf_PolicyAuthorization_Notify
(resource allocation outcome, QoS notification, etc.) NEF-->>AF: Notify (to notificationDestination)

Response ordering and branches differ by Release and implementation

The diagram above is simplified for understanding. Whether the response to the AF is returned before or after the PCF's decision, the steps by which the NEF subscribes to PCF notifications, and the branch via the TSCTSF should be checked against TS 23.502 §4.15.6.6 of the target Release and the implementation (to be confirmed). From PCF → SMF onward, it is the PDU Session Modification procedure.

Signal flow

# Segment Message (SBI) Key points
1 AF → NEF Create AsSessionWithQoS (Nnef_AFsessionWithQoS_Create) UE IP, Flow description or External Application Identifier, QoS Reference (individual QoS parameters depending on the Release), notification URI
2 Inside the NEF Authorization, assignment of Transaction Reference ID Whether the AF may use this API and this UE/DNN (the policy is implementation/contract dependent)
3 NEF → BSF Nbsf_Management_Discovery (TS 29.521) Identifies the serving PCF from the UE IP. It stops here if there is no binding
4 NEF → PCF Npcf_PolicyAuthorization_Create (TS 29.514) The NEF creates an App Session as an AF
5 PCF → SMF Npcf_SMPolicyControl_UpdateNotify (TS 29.512) Reflects PCC Rules into the SM Policy Association (PCF-initiated SM Policy Association modification, TS 23.502 §4.16.5.2, to be confirmed)
6 SMF → AMF → gNB / SMF → UPF Namf_Communication_N1N2MessageTransfer → NGAP PDU Session Resource Modify (N2 goes via the AMF), PFCP Session Modification (N4) Add / modify QoS Flow (QFI / 5QI), PDR / QER
7 PCF → NEF → AF Npcf_PolicyAuthorization_Notify → Nnef_AFsessionWithQoS_Notify Notifications of resource allocation outcome and whether QoS can be guaranteed (only for subscribed events)

Correlation information — correlation keys per segment

Each time you move to the next segment AF → NEF → PCF → SMF → gNB/UPF, the identifiers in use change. Having a table of which key to follow where speeds up cross-trace analysis.

Segment Correlation key Notes
AF ⇔ NEF scsAsId (AF Identifier), URI of the created subscription (equivalent to the Transaction Reference ID, to be confirmed), notificationDestination The AF later uses the subscription URI for Update / Revoke
NEF ⇔ BSF UE IP address (+ IP Domain / DNN / S-NSSAI) IP Domain etc. are needed for overlapping private IP spaces
NEF ⇔ PCF App Session ID (resource URI returned in the Location header), notification URI The NEF maps it internally to the Transaction Reference ID (implementation dependent)
PCF ⇔ SMF SM Policy Association (SM Policy ID), PCC Rule ID PCF / PCC
SMF ⇔ gNB PDU Session ID, QFI QoS Flow / QFI / 5QI
SMF ⇔ UPF SEID, PDR ID / QER ID PDR / PDI

Analogy: It is like a parcel whose tracking number is replaced each time it passes to another carrier. The AF's receipt number (Transaction Reference ID) → the PCF's slip number (App Session ID) → the SMF's control numbers (PCC Rule / QFI). If you do not know which number to look at in which segment, you lose the parcel along the way.

201 Created does not mean \"QoS took effect\"

A 201 Created on AF→NEF only shows that the subscription (AF session) resource was created. Reflection from the PCF to the SMF, admission control in the RAN and PDR matching in the UPF happen separately afterwards. To know the outcome, the AF needs to subscribe to notifications of resource allocation outcome (Successful / Failed resources allocation, etc.; event names to be confirmed) and receive the Notify.


How — Call Flow ②: Event Exposure (event subscription and notification)

This is an example in which an external AF subscribes to "let me know when this UE becomes reachable" (TS 23.502 §4.15.3; the information flow via the NEF is §4.15.3.2.3, to be confirmed).

Representative monitoring events

Event (TS 23.502 §4.15.3.1) NF that mainly detects it Overview
UE Reachability AMF The UE has become able to receive data / SMS
Loss of Connectivity AMF Connectivity with the UE is judged to have been lost
Location Reporting AMF The UE's current / last known location (exposure granularity may be restricted by policy)
Change of SUPI-PEI association UDM A change of the subscriber-device (PEI) combination
Roaming Status UDM A change in roaming status
PDU Session Status / Downlink Data Delivery Status SMF PDU Session status, downlink data delivery status

The list of events and the detecting NF are added to or changed by Release (to be confirmed). The enumerated values in the API (e.g., UE_REACHABILITY, LOSS_OF_CONNECTIVITY, LOCATION_REPORTING) are defined in TS 29.122 / TS 29.522.

Call flow

sequenceDiagram
    participant AF as External AF
    participant NEF
    participant UDM
    participant AMF
    AF->>NEF: POST 3gpp-monitoring-event
(External ID or MSISDN, monitoringType=UE_REACHABILITY,
notificationDestination, max number of reports, expiry) NEF->>NEF: AF authorization / input check NEF->>UDM: Nudm_EventExposure_Subscribe
(GPSI, event, notification target = NEF) UDM->>UDM: GPSI to SUPI translation / check it is allowed for the subscriber UDM->>AMF: Namf_EventExposure_Subscribe
(SUPI, event, notification target = NEF) AMF-->>UDM: 201 Created UDM-->>NEF: 201 Created NEF-->>AF: 201 Created (Subscription URI) Note over AMF: The UE becomes reachable via Registration / Service Request, etc. AMF->>NEF: Namf_EventExposure_Notify (not via the UDM) NEF->>NEF: Map internal subscription to the AF subscription
Translate to external-facing identifier NEF->>AF: Notify (to notificationDestination)

Signal flow

# Segment Message Key points
1 AF → NEF Create MonitoringEvent (Nnef_EventExposure_Subscribe) The UE is specified by GPSI (External ID / MSISDN) or External Group ID
2 NEF → UDM Nudm_EventExposure_Subscribe (TS 29.503) Passes the NEF's URI as the notification target
3 UDM → AMF Namf_EventExposure_Subscribe (TS 29.518) The UDM translates the GPSI into the SUPI and creates a subscription at the serving AMF
4 Responses 201 Created returns AMF → UDM → NEF → AF Depending on the event, the state at subscription time may be returned as an immediate report (to be confirmed)
5 AMF → NEF Namf_EventExposure_Notify Because the notification target is the NEF, it reaches the NEF directly without going via the UDM (TS 23.502 §4.15.3.2.3, to be confirmed)
6 NEF → AF MonitoringEvent notification (Nnef_EventExposure_Notify) The NEF reports with an external-facing identifier, not the SUPI

The path changes with the type of event

Events detected by the UDM itself (such as Roaming Status) are notified from the UDM to the NEF, and events detected by the SMF involve a subscription on the SMF side. The AMF notifying the NEF directly is also a result of "the UDM specifying the NEF as the notification target at subscription time." The diagram above is a simplified diagram for UE Reachability (detected by the AMF).

A successful Subscribe and a successfully received Notify are different things

Even if the subscription is created with 201, notifications do not arrive when (1) the event condition has not yet been met, (2) the subscription has ended because it expired or reached the maximum number of reports, (3) the internal (UDM→AMF) subscription was later removed, or its transfer failed on an AMF change (on an AMF change, Event Subscriptions are transferred to the new AMF as part of the UE Context transfer: TS 23.502 §4.2.2.2.2 at registration, §4.9.1.3 etc. for N2 handover with AMF change, to be confirmed), or (4) the AF's callback (notificationDestination) cannot be reached.


Packet Analysis (Wireshark)

  • How N33 (Northbound API) uses HTTP follows "Usage of HTTP" in TS 29.122 / TS 29.522 (§5.2.2, to be confirmed). Because it faces external AFs, both HTTP/1.1 and HTTP/2 are possible (which is mandatory and which is optional is to be confirmed per version). Filtering only on http2.* misses N33 carried over HTTP/1.1.
  • N33 with an AF outside the network is protected by TLS (TS 33.501 §12, sub-clause numbering to be confirmed).
  • Internal SBIs (NEF⇔BSF / PCF / UDM, PCF⇔SMF, etc.) use HTTP/2 (TS 29.500). TLS support is mandatory, but whether it is actually used is up to the operator (TS 33.501 §13.1, to be confirmed).

To see the content of segments protected by TLS, TLS decryption keys (key log, etc.) are needed.

Display filters

Field names may differ depending on the Wireshark version (to be confirmed).

Filter Purpose
http2 All internal SBIs, and N33 carried over HTTP/2
http.request.uri contains "3gpp-" N33 (Northbound API) carried over HTTP/1.1
http2.headers.path contains "3gpp-as-session-with-qos" N33: QoS request (AsSessionWithQoS)
http2.headers.path contains "3gpp-monitoring-event" N33: event subscription (MonitoringEvent)
http2.headers.path contains "nbsf-management" NEF⇔BSF: PCF binding lookup
http2.headers.path contains "npcf-policyauthorization" NEF⇔PCF: App Session
http2.headers.path contains "npcf-smpolicycontrol" PCF⇔SMF: SM Policy update (note that the Notify goes to the SMF-side callback URI)
http2.headers.path contains "nudm-ee" / "namf-evts" NEF⇔UDM / UDM⇔AMF: Event Exposure
http2.headers.status Response status code (201 / 4xx / 5xx)
tls.handshake.type == 1 TLS ClientHello on N33 (to check that a TLS connection starts)
tls.alert_message TLS Alert (to check handshake failures such as certificate mismatch)

Notifies go to the callback URI

Notify requests are sent to the callback URI passed at subscription time (notificationDestination, notifUri, etc.). Because that path is decided by the subscriber (the AF or the NEF), it may not contain 3gpp-... or npcf-.... When looking for a Notify, search by the callback URI that was in the body of the subscription request.

Decode example (conceptual)

The following is a conceptual representation of the display structure; all values are fictitious (IPs are documentation / private addresses; attribute names and mandatory/optional status are to be confirmed per version; capture needed). The N33 parts show the case where HTTP/2 is used. With HTTP/1.1, instead of :method / :path there is a request line (POST /3gpp-... HTTP/1.1) and a Host header.

[N33] AF -> NEF
HEADERS  :method: POST
         :path: /3gpp-as-session-with-qos/v1/af-video-01/subscriptions
DATA (JSON)
{
  "notificationDestination": "https://af.example.com/qos-notify/123",
  "ueIpv4Addr": "10.45.0.23",
  "flowInfo": [
    { "flowId": 1,
      "flowDescriptions": [ "permit out 17 from 198.51.100.10 to 10.45.0.23" ] }
  ],
  "qosReference": "video-premium",
  "events": [ "SUCCESSFUL_RESOURCES_ALLOCATION", "FAILED_RESOURCES_ALLOCATION" ]
}

[N33] NEF -> AF
HEADERS  :status: 201
         location: https://nef.example.net/3gpp-as-session-with-qos/v1/af-video-01/subscriptions/sub-0001

[NEF -> BSF]
HEADERS  :method: GET
         :path: /nbsf-management/v1/pcfBindings?ipv4Addr=10.45.0.23
  -> 200 OK  { "dnn": "internet", "pcfFqdn": "pcf-2.example.net", "supi": "... (not returned to the outside)" }

[NEF -> PCF]
HEADERS  :method: POST
         :path: /npcf-policyauthorization/v1/app-sessions
  -> 201 Created  location: .../app-sessions/as-77
[N33] AF -> NEF
HEADERS  :method: POST
         :path: /3gpp-monitoring-event/v1/af-iot-02/subscriptions
DATA (JSON)
{
  "externalId": "[email protected]",
  "monitoringType": "UE_REACHABILITY",
  "reachabilityType": "DATA",
  "notificationDestination": "https://af.example.com/mon-notify/9",
  "maximumNumberOfReports": 1,
  "monitorExpireTime": "2026-10-19T00:00:00Z"
}

Order of checks

flowchart LR
    A["① AF⇔NEF
TLS / authorization
Request → 201 or 4xx"] --> B["② Inside the NEF
identifier translation, authorization
(check in logs)"] B --> C["③ NEF⇔internal NF
BSF / PCF or UDM / AMF
Request / Response"] C --> D["④ After the internal NF
PCF→SMF→N2/N4
or event detection→Notify→callback"]

Trouble Shooting

Split failures into four segments

flowchart LR
    S1["Segment 1
AF ⇔ NEF
(N33)"] --> S2["Segment 2
Inside the NEF
(authorization, translation)"] S2 --> S3["Segment 3
NEF ⇔ internal NF
(BSF / PCF / UDM / AMF)"] S3 --> S4["Segment 4
After the internal NF
(PCF→SMF→gNB/UPF,
event detection→Notify)"]
Segment What to check Typical causes
1. AF ⇔ NEF TLS, OAuth 2.0 token, scsAsId, request body Certificate / token problems, the AF lacks API permission, missing or malformed mandatory attributes
2. Inside the NEF Authorization policy, identifier translation, handling of QoS Reference, management of Transaction Reference ID The AF and UE / DNN combination is not allowed, missing translation rule configuration (implementation dependent)
3. NEF ⇔ internal NF Responses of Nbsf_Management_Discovery, Npcf_PolicyAuthorization, Nudm_EventExposure No binding found, the PCF does not authorize the request, the UDM rejects the subscription
4. After the internal NF Policy update PCF→SMF, N2 / N4 configuration results, event detection, Notify, callback RAN admission failure, flow description does not match actual traffic, event did not occur, callback unreachable

Symptoms and isolation

Symptom Likely cause Check point Logs Packets Resolution
The AF cannot connect to the NEF (no HTTP response) Problems with TLS mutual authentication (revoked certificate, trust chain mismatch), TLS version / cipher suite mismatch Certificate, TLS settings TLS logs of the NEF / LB tls.alert_message, tls.handshake Fix the certificate and trust chain. This does not become an HTTP 401 / 403 (it ends at the handshake stage)
The AF's POST returns 401 / 403 401: problem with the OAuth 2.0 token (missing, expired, invalid signature). 403: the AF lacks permission for the API or the target UE, or the token scope is insufficient (insufficient_scope). The distinction follows RFC 6750 §3.1; 3GPP-side error handling is TS 29.122 §5.2.6 (to be confirmed) 401: validity of the token itself / 403: token scope, permissions of scsAsId NEF access log http2.headers.status / http.response.code Check AF registration and permission settings (also onboarding status when CAPIF is used)
The AF's POST returns 400 Missing mandatory attribute, malformed flow description, wrong way of specifying the UE identifier Compare the request body with the OpenAPI definition NEF log http2 (DATA) Fix according to the API definition (TS 29.122 / TS 29.522)
The NEF→BSF lookup does not find a serving PCF PDU Session not established, the AF sends the address after NAT on N6, IP Domain / DNN mismatch, the PCF has not registered with the BSF Whether the UE IP sent by the AF matches the UE IP allocated by the SMF NEF / BSF logs nbsf-management Operate so that the UE IP allocated by the 5GC is passed (configuration dependent), check BSF registration → BSF / PCF Binding
The NEF→PCF Create returns 4xx The PCF does not authorize the request (QoS Reference undefined, not allowed by subscriber policy, no target PDU Session) cause in ProblemDetails (values in TS 29.514, to be confirmed) PCF log npcf-policyauthorization Check QoS Reference definitions and subscriber policy on the PCF
201 but QoS has no effect Not reflected PCF→SMF, RAN admission failure, flow description does not match actual traffic (direction, ports, addresses) Npcf_SMPolicyControl_UpdateNotify, N2 PDU Session Resource Modify Response, SDF filter of the PDR PCF / SMF / gNB logs npcf-smpolicycontrol, ngap, pfcp Check in the order of "Example A" below
Subscribe succeeded but no notification arrives Event did not occur, internal subscription failed or was removed, expiry / maximum number of reports reached, callback unreachable Internal subscription responses, subscription parameters, presence of Notify and callback response NEF / UDM / AMF logs nudm-ee, namf-evts, callback URI Check in the order of "Example B" below
Notifications are duplicated / unexpectedly many Duplicate subscriptions with the same conditions, retransmission, re-subscription after a failure Subscription list, correlation ID of notifications NEF log http2 Delete unnecessary subscriptions. Retransmission and de-duplication behavior is implementation dependent

Example A: the QoS request returned 2xx but QoS has no effect

Is the AF→NEF request 201 Created? (segment 1)
   ↓
Did the NEF's authorization and translation succeed? (segment 2: NEF log)
   ↓
Was the serving PCF identified via NEF→BSF? Is NEF→PCF Create 201? (segment 3)
   ↓
Was Npcf_SMPolicyControl_UpdateNotify sent PCF→SMF? What is in the PCC Rule? (segment 4)
   ↓
Did SMF→gNB PDU Session Resource Modify succeed? (RAN admission)
Were PDR / QER created by SMF→UPF PFCP Session Modification?
   ↓
Does the actual traffic match the PDR's SDF filter? (direction, ports, addresses)
   ↓
Check QFI on N3, QER in the UPF, QoS in the RAN

Do not judge that QoS is guaranteed or that packet forwarding works from HTTP success alone. If the AF has subscribed to notifications of resource allocation outcome, a failure in segment 4 also shows up as a Notify to the AF.

Example B: the event subscription succeeded but no notification arrives

Is the AF→NEF Subscribe 201? (segment 1)
   ↓
Did the internal NEF→UDM and UDM→AMF Subscribes succeed? (segment 3)
   ↓
Did the target event actually occur? (e.g. did the UE really become reachable? AMF logs, NGAP/NAS)
   ↓
Are the expiry, maximum number of reports and target UE (External ID / MSISDN) correct?
   ↓
Was a Notify sent AMF→NEF? Was a Notify sent NEF→AF?
   ↓
Is the TLS / HTTP response at the callback URI normal? (does the AF return 2xx?)

In captures, correlate the Subscribe request / response, the internal Subscribes, the event Notify and the callback, keyed on the subscription URI and the callback URI.


Boundary between 3GPP specifications and vendor implementations

Defined by 3GPP Decided by vendors / operations
The NEF's roles (exposure, authentication and authorization, assisting throttling, information translation and masking) NEF pod structure, internal structure of the API gateway, cache / DB design
Resources, attributes and notifications of the Northbound APIs (TS 29.122 / TS 29.522) Concrete rate limit values, how per-AF permission policies are held
The AF session with required QoS / Event Exposure procedures (TS 23.502) The concrete content of a QoS Reference (agreement between the operator and the AF provider)
Security requirements of N33 (TLS, authorization based on OAuth 2.0, TS 33.501 §12) Operation of certificates and tokens, whether to use CAPIF
PCF identification via the BSF, the Policy Authorization procedure Handling of UE IPs behind NAT, IP Domain design
Meaning of the notification target, expiry and maximum number of reports in Event Exposure Retry implementation, de-duplication, CLI / log names, HA / scaling approach

Authentication, authorization and rate control themselves are functions that 3GPP anticipates. "The algorithms and concrete values are implementation dependent" does not mean "authorization and throttling are out of the specification's scope."


Comparison with EPC (4G)

Item 4G EPC 5GC
Exposure function SCEF (Service Capability Exposure Function) NEF
External consumer SCS / AS AF (external)
External-facing API T8 (TS 29.122) N33 Northbound API (TS 29.522; reuses and extends T8 APIs)
Subscription information / event subscription SCEF ⇔ HSS (S6t, Diameter) NEF ⇔ UDM (Nudm, SBI)
Mobility-related events Configured in the MME via the HSS (S6a); notified from the MME to the SCEF (T6a, Diameter) Subscribed at the AMF via the UDM; notified from the AMF to the NEF (Namf, SBI)
QoS request The SCEF acts as an AF towards the PCRF over Rx (TS 23.682 §5.11, to be confirmed) The NEF acts as an AF towards the PCF with Npcf_PolicyAuthorization
Event monitoring procedure Monitoring Events (TS 23.682 §5.6, to be confirmed) Event Exposure (TS 23.502 §4.15.3)
Interworking — Common exposure for EPC/5GC by a combined SCEF+NEF node (TS 23.501 §4.3.5, to be confirmed)

The skeleton is the same as the 4G SCEF: "show only a gateway to the outside and translate into internal protocols." In the 5GC, the internal side has also been unified into SBI (HTTP/2), and PCF identification via the BSF and combination with CAPIF have been added.


3GPP Specification

Spec Clause Content
TS 23.501 §4.2.7 Reference points (N5 / N33 / NEF⇔PCF, etc.; includes to be confirmed)
TS 23.501 §5.20 External Exposure of Network Capability
TS 23.501 §5.9.8 GPSI
TS 23.501 §6.2.5 (§6.2.5.0 / §6.2.5.1) NEF functions / support for CAPIF (sub-clause numbering to be confirmed)
TS 23.501 §6.2.10 AF (distinction between direct access by trusted AFs and access via the NEF)
TS 23.501 §4.3.5 Interworking of service exposure with SCEF+NEF (to be confirmed)
TS 23.502 §4.15.3 Event Exposure using NEF (§4.15.3.1 Monitoring Events / §4.15.3.2.3 information flow via the NEF; sub-clause numbering to be confirmed)
TS 23.502 §4.15.6.6 Setting up an AF session with required QoS (to be confirmed)
TS 23.502 §4.15.6.2 / §4.3.6 Parameter Provisioning / AF influence on traffic routing (to be confirmed)
TS 23.502 §5.2.6 NEF services (Nnef_EventExposure, Nnef_AFsessionWithQoS, etc.; sub-clause numbering to be confirmed)
TS 23.003 §19.7.2 Format of the External Identifier (to be confirmed)
TS 23.222 — CAPIF (Common API Framework)
TS 29.522 — NEF Northbound APIs (N33)
TS 29.122 — T8 Reference Point for Northbound APIs (MonitoringEvent, AsSessionWithQoS, etc.)
TS 29.591 — NEF Southbound Services (internal-facing nnef-...; some services are in other specifications such as TS 29.551)
TS 29.514 / TS 29.512 / TS 29.521 — Npcf_PolicyAuthorization / Npcf_SMPolicyControl / Nbsf_Management
TS 29.503 / TS 29.518 — Nudm (including EventExposure) / Namf (including EventExposure)
TS 33.501 §12 Security of the NEF (TLS and authorization on N33; sub-clause numbering to be confirmed)
TS 33.501 §13.1 Transport security inside the SBA (TLS support mandatory, use up to the operator, to be confirmed)
TS 29.500 — Technical realization of 5GC SBIs (HTTP/2)
TS 23.682 §5.6 / §5.11 Monitoring Events / AS session with required QoS of the 4G SCEF (for EPC comparison, to be confirmed)

Granularity of clause numbers

The sub-clause numbers under TS 23.502 §4.15, the reference point names in TS 23.501 §4.2.7 (NEF⇔PCF, etc.) and the clause numbers of TS 23.682 may differ in numbering and structure between versions. When citing precisely, check the original text of the target Release.


Summary

  • The NEF is the boundary that exposes 5GC capabilities to external AFs and performs authorization, information hiding (masking) and identifier translation. It is not a simple proxy; where it hands requests to differs per API (TS 23.501 §6.2.5)
  • N33 is external AF⇔NEF (Northbound API, TS 29.522 / TS 29.122); N5 is AF⇔PCF (Npcf_PolicyAuthorization). Towards the PCF, the NEF calls Npcf_PolicyAuthorization as an AF
  • What the external AF knows is GPSI (External ID / MSISDN) and UE IP. The SUPI and the serving PCF are internal information, resolved by the UDM (GPSI⇔SUPI) and the BSF (UE IP⇔PCF), and are not returned to the outside
  • QoS requests (AF session with required QoS) and Event Exposure are different procedures with different internal destinations (BSF / PCF vs UDM / AMF)
  • API 2xx ≠ successful QoS application ≠ successful notification reception. Split failures into the four segments AF⇔NEF / inside the NEF / NEF⇔internal NF / after the internal NF and follow them with each segment's correlation keys
  • In 4G, SCEF + T8 played the same role. In the 5GC, the internal side has also been made SBI-based and can be combined with CAPIF

Comprehension check

Q1. An external AF subscribed via the NEF to the reachability event of a UE. The Subscribe succeeded, but the expected notification does not arrive. Which first action is most appropriate? A. If the NEF Subscribe succeeded, the AMF must have sent a Notify, so investigate only the AF side / B. Check whether the NEF created a PFCP QER in the UPF / C. Check, in order, the subscriptions from the NEF to internal NFs, whether the target event occurred, the notification path and the HTTP / TLS response of the callback / D. Conclude that a GTP-U TEID mismatch is the cause

Answer: C. Event Exposure consists of multiple stages: internal subscriptions NEF→UDM→AMF, event detection, and notification AMF→NEF→AF (TS 23.502 §4.15.3, to be confirmed). A confuses "Subscribe succeeded" with "notification succeeded." B and D concern N4 / N3 (user plane) and are not involved in event subscription.

Q2. Creation of an AsSessionWithQoS returned 201 Created. Can you say \"the QoS for this flow is now guaranteed\"?

No. 201 only shows that the AF session resource was created at the NEF. After that, policy reflection from the PCF to the SMF (Npcf_SMPolicyControl_UpdateNotify), admission control in the gNB (PDU Session Resource Modify), PDR / QER configuration in the UPF and matching of actual traffic to the SDF filter happen separately. To know the outcome, subscribe to notifications of resource allocation outcome and check the Notify, and if necessary check the segment-4 traces.

Q3. A trusted AF can make requests directly to the PCF over N5. When an external AF makes a request via the NEF, what differs and what is the same from the PCF's point of view?

From the PCF's point of view, the NEF calls Npcf_PolicyAuthorization as an AF, so its handling as an App Session (PCC Rule decision, reflection to the SMF) is the same. What differs is that before that, the NEF performs authorization of the AF, identifier translation (handling of the AF Identifier and QoS Reference, identification of the serving PCF via the BSF) and masking of internal information. The external AF does not know the internal PCF's address or the SUPI.

Q4. An external AF specified a UE IP in AsSessionWithQoS, but the NEF→BSF lookup does not find a serving PCF. The IP the AF specified was the UE's address as seen from the Internet side. What is likely happening?

When NAT (address translation) is performed on the N6 side, the address seen by the AF is the post-NAT address, which differs from the UE IP the SMF allocated to the PDU Session (the IP registered in the BSF binding). Therefore the BSF cannot find the binding. The configuration and operation must be such that the UE IP allocated by the 5GC (and the IP Domain if necessary) is passed to the AF (the concrete method is configuration dependent). An unestablished PDU Session or a PCF not registered with the BSF produce the same symptom, so check them as well (BSF / PCF Binding).


Next Step