Skip to content

title: N7 SBI Analysis — Isolating URI / HTTP/2 / ProblemDetails Issues in Four Layers description: A deep-dive chapter on reading N7 (Npcf_SMPolicyControl) between the SMF and the PCF at the packet level. Covers Service Consumer / Producer, the 3GPP API URI structure (apiRoot / apiName / apiVersion / resource), Create / Update / Delete on sm-policies, HTTP status codes, SmPolicyContextData / SmPolicyDecision, HTTP/2 Stream IDs and HPACK, TLS decryption and ProblemDetails, and isolates an "N7 failure" in four layers: IP/TCP/TLS → HTTP/2 → 3GPP API → Policy Logic. keywords: - N7 - SBI - Npcf_SMPolicyControl - sm-policies - HTTP/2 - Stream ID - HPACK - TLS - ProblemDetails - SmPolicyContextData - SmPolicyDecision - NRF - PCF - SMF - 5GC tags: - Level ∞ - Policy - SBI - Troubleshooting category: Deep Dive


N7 SBI Analysis — Isolating URI / HTTP/2 / ProblemDetails Issues in Four Layers

Difficulty: Advanced (deep dive) / Estimated study time: 35 min / Prerequisites: PCF / SM Policy Association / PCC Rule, N7 / Main actors: SMF, PCF (NRF) / Main interface: N7 (SBI)

Learning objectives

After reading this chapter, you will be able to:

  • Explain the Service Consumer (SMF) / Service Producer (PCF) relationship on N7 and the direction of HTTP client / server
  • Read from the 3GPP API URI structure ({apiRoot}/{apiName}/{apiVersion}/{resource}) which NF and which service a request targets
  • Explain which method, URI and status code the Create / Update / Delete operations of Npcf_SMPolicyControl use
  • Match requests and responses using the HTTP/2 Stream ID, and distinguish "invisible" content caused by HPACK from that caused by TLS
  • Read status / cause / invalidParams in ProblemDetails, and break down an "N7 failure" into the four layers plus the stages before and after them
  • Correlate N7 → N4 → N2 by SUPI, PDU Session ID and time, and identify where a policy value changed

Prerequisites

The focus of this chapter (Level ∞ Deep Dive)

The N7 page introduces N7 as "an SBI realized by Npcf_SMPolicyControl." This chapter goes one level lower and covers how to identify N7 transactions in a real capture and how to isolate the layer in which they fail. For the meaning of the policy itself (PCC rules, QoS), see the previous chapter.


Why — "It's an N7 failure" tells you nothing

When a fault report only says "N7 failure," the candidate causes are very different:

  • The SMF does not know where the PCF is (an NRF discovery problem)
  • TCP / TLS cannot be established (a transport problem)
  • An HTTP/2 stream was reset (an HTTP/2 problem)
  • The PCF returned 4xx (a 3GPP API problem)
  • 201 Created came back, but the 5QI is not what was expected (a policy logic problem)

N7 is not a dedicated protocol like N2 (NGAP over SCTP) or N4 (PFCP over UDP); it is an SBI that stacks web technologies (TCP / TLS / HTTP/2 / JSON) (N7). Because there are many layers, unless you can say in which layer the failure happened, you cannot decide who should fix it.

Analogy: N7 is like "a field officer (SMF) asking the rules department (PCF) through the company's internal web system." When no answer comes back, the cause is one of: "cannot reach the internal network," "the system returned an error page," "the request form was filled in wrongly," or "an answer came back but not the expected one." If you are only told "the inquiry failed," you do not know whether to talk to IT, the rules department or the requester.


What — Service Consumer and Service Producer

The SMF is the consumer, the PCF is the producer

In the SBA, the NF that provides a service is called the NF Service Producer and the NF that uses it the NF Service Consumer (TS 23.501 §7.1, to be confirmed). For Npcf_SMPolicyControl the relationship is as follows (TS 23.502 §5.2.5.4, to be confirmed).

Role NF HTTP role Main operations
NF Service Consumer SMF HTTP client Requests Create / Update / Delete
NF Service Producer PCF HTTP server Manages the SM Policy Association and returns SmPolicyDecision

For notifications (UpdateNotify) the direction is reversed

When the PCF changes a policy on its own (for example, on a request from an AF or a change in subscription data), the PCF sends Npcf_SMPolicyControl_UpdateNotify to the SMF. In HTTP terms the PCF is the client and the SMF is the server. The target is the notificationUri (callback URI) that the SMF supplied at Create time.

flowchart LR
    SMF["SMF
Consumer"] -- "Create / Update / Delete
SMF = HTTP Client" --> PCF["PCF
Producer"] PCF -- "UpdateNotify / Terminate notification
PCF = HTTP Client" --> SMF

If the direction is reversed, the TCP connection is normally different too

In HTTP/2 only the client that opened the connection sends requests (RFC 9113 §8). Notifications from the PCF to the SMF therefore usually flow on a separate TCP / TLS connection from the SMF → PCF one. If you "cannot find the notification" in a capture, look for the connection in the opposite direction.


What — The URI structure of 3GPP APIs

{apiRoot}/{apiName}/{apiVersion}/{resource}

3GPP SBI APIs share a common resource URI structure (TS 29.501 §4.4.1, to be confirmed).

{apiRoot}/{apiName}/{apiVersion}/{apiSpecificResourceUriPart}

Example (conceptual):
https://pcf1.example.net:443/npcf-smpolicycontrol/v1/sm-policies/abc123
└────────── apiRoot ────────┘└──── apiName ──────┘└v1┘└── resource ──────┘
Part Meaning Where it is determined
apiRoot scheme://authority + an optional deployment-specific prefix FQDN / IP endpoint / apiPrefix in the PCF's NF profile (registered in the NRF) (TS 29.510 §6.1.6.2.3 NFService, to be confirmed)
apiName The service name in lower case with hyphens. For N7, npcf-smpolicycontrol TS 29.512 §5.1 (to be confirmed)
apiVersion The major version of the API (e.g. v1) TS 29.512 §5.1 / TS 29.501 §4.4 (to be confirmed)
resource sm-policies (collection), sm-policies/{smPolicyId} (individual) TS 29.512 §5.3 (to be confirmed)

In a capture these appear split into the HTTP/2 :authority (the authority part of apiRoot) and :path (including the apiPrefix if there is one, then apiName onwards) (RFC 9113 §8.3.1). If :path contains npcf-smpolicycontrol, you can conclude it is a request to the PCF's SM Policy Control service.

Resources and operations of Npcf_SMPolicyControl

TS 29.512 represents an SM Policy Association as an individual resource under the sm-policies collection, and defines Update / Delete as custom operations (verb-like URIs invoked with POST) under the individual resource (TS 29.512 §5.3, sub-clauses to be confirmed).

Service operation Method URI (after apiRoot) Main request body Success response
Create (SMF→PCF) POST /npcf-smpolicycontrol/v1/sm-policies SmPolicyContextData 201 Created + Location + SmPolicyDecision
Update (SMF→PCF) POST /.../sm-policies/{smPolicyId}/update SmPolicyUpdateContextData 200 OK + SmPolicyDecision (to be confirmed)
Delete (SMF→PCF) POST /.../sm-policies/{smPolicyId}/delete SmPolicyDeleteData 204 No Content (to be confirmed)
Read (SMF→PCF) GET /.../sm-policies/{smPolicyId} — 200 OK + SmPolicyControl (to be confirmed)
UpdateNotify (PCF→SMF) POST {notificationUri}/update SmPolicyNotification 200 OK / 204 No Content (to be confirmed)
Termination request notification (PCF→SMF) POST {notificationUri}/terminate TerminationNotification 204 No Content (to be confirmed)

Delete is not HTTP DELETE

Npcf_SMPolicyControl_Delete is not the DELETE method but the custom operation POST .../sm-policies/{smPolicyId}/delete (TS 29.512 §4.2.5 / §5.3.3, to be confirmed). It can be understood as taking the form of a custom operation because it carries SmPolicyDeleteData (usage reports, etc.) in the body (this design intent is this chapter's explanation, not something stated in the specification). That is why "filtering on the DELETE method does not find the Delete."

Create returns the smPolicyId in Location

SMF → PCF   POST /npcf-smpolicycontrol/v1/sm-policies
            Body: SmPolicyContextData (supi, pduSessionId, dnn, sliceInfo, notificationUri, ...)

PCF → SMF   201 Created
            location: https://pcf1.example.net/npcf-smpolicycontrol/v1/sm-policies/abc123
            Body: SmPolicyDecision (sessRules, pccRules, qosDecs, ...)

Subsequent Update / Delete URIs only contain the smPolicyId (e.g. abc123). SUPI and PDU Session ID are not necessarily in every body, so to link later transactions to a subscriber it is important to note the Location header of the Create. The format of smPolicyId is chosen by the PCF and is implementation-dependent.


What — The meaning of methods and status codes

Do not infer the operation from the method alone

In Npcf_SMPolicyControl, Create / Update / Delete are all POST. "It's a POST, so it's a Create" does not hold; look at method + :path + body together. PATCH is used in other SBI APIs (for example NF profile update in Nnrf_NFManagement, TS 29.510 §5.2.2.3, to be confirmed), but does not appear in the main operations of Npcf_SMPolicyControl (to be confirmed).

Reading status codes

The general rules for status codes used in the SBI are in TS 29.500 §5.2.7 (to be confirmed).

Status Meaning (typical in the SBI) What to suspect first
201 Created The resource (SM Policy Association) was created Location and the contents of SmPolicyDecision
200 OK / 204 No Content Processing succeeded (with / without body) Whether the policy after Update is as expected
307 / 308 Redirect to another PCF instance (TS 29.500 §6.10.9, to be confirmed) The Location target and whether the request was resent
400 Bad Request Invalid JSON, missing mandatory attribute, invalid value cause / invalidParams in ProblemDetails
401 Unauthorized OAuth 2.0 access token invalid (RFC 6750 §3.1) Token acquisition (NRF) and expiry
403 Forbidden Insufficient authorization, or the PCF rejected on policy grounds cause in ProblemDetails, token scope
404 Not Found The URI does not exist, or the smPolicyId is unknown :path, apiVersion, smPolicyId, URI obtained from the NRF
411 / 413 / 415 Length / size / content-type problems content-type (is it application/json?)
429 Too Many Requests Overload control PCF load, retry interval
500 / 503 Server-side processing failure / temporarily unavailable PCF internals, cause (e.g. NF_CONGESTION)
504 Gateway Timeout An intermediary such as an SCP cannot reach beyond itself (to be confirmed) Whether the PCF or the SCP responded

HTTP 2xx does not mean the policy is correct

201 Created only indicates that "the API transaction succeeded." Whether the 5QI or bit rates in the returned SmPolicyDecision are as expected is a matter of another layer (policy logic). Conversely, even if the PCF is configured with the right policy, if the context the SMF sent (DNN, S-NSSAI, etc.) is wrong, the PCF will "correctly" return an unexpected policy.


What — Main attributes of the JSON body

Attribute names are checked in TS 29.512 §5.6 (data model, sub-clauses to be confirmed) and in the OpenAPI definition published by 3GPP (TS29512_Npcf_SMPolicyControl.yaml). The following is an excerpt of the main attributes and is not exhaustive. Whether an attribute is mandatory or optional may differ by release, so this page does not assert it (to be confirmed).

SmPolicyContextData (Create request: SMF → PCF)

Attribute Meaning Use in troubleshooting
supi Subscriber ID Correlation key with other interfaces
pduSessionId PDU Session ID Distinguishes multiple sessions of the same UE
dnn Target DNN Input for policy selection. An error directly leads to a wrong policy
sliceInfo S-NSSAI (sst / sd) Same as above
pduSessionType IPv4 / IPv6 / IPv4v6 / Ethernet, etc. —
accessType / ratType 3GPP access, etc. / NR, etc. Input for RAT-specific policies
servingNetwork Serving PLMN Policies when roaming
ipv4Address / ipv6AddressPrefix Address allocated to the UE Correlation with N4 / N6
subsSessAmbr / subsDefQos Session-AMBR / default QoS from subscription data Compare with the values the PCF returns
notificationUri Destination of UpdateNotify (the SMF's callback URI) What to check when notifications do not arrive
suppFeat Supported features (feature negotiation) When expected attributes are not returned

SmPolicyDecision (Create / Update response: PCF → SMF)

Attribute Meaning Where it goes downstream
sessRules Session rules (authSessAmbr, authDefQos) Session-AMBR / default QoS rule in NAS, session-level QER on N4
pccRules PCC rules (flowInfos, precedence, refQosData, etc.) QoS rules in NAS, PDR (SDF filter) on N4
qosDecs QoS decisions (5qi, maxbrUl/Dl, gbrUl/Dl, arp, etc.) QoS Flow Level QoS Parameters on N2, QER on N4
chgDecs Charging decisions CHF / URR
policyCtrlReqTriggers Events on which the SMF should send an Update to the PCF (PRA change, RAT change, etc.) Why an Update is sent
revalidationTime Time for policy re-evaluation Why periodic Updates occur

A PCC rule refers to QoS data in qosDecs by ID through refQosData. Note that in a capture "the 5QI is not written directly in the PCC rule"; you read it by looking up the referenced QoS data.


How — Call Flow

The SM Policy Association during PDU Session establishment

When dynamic PCC is used, the SMF establishes the SM Policy Association during PDU Session Establishment (TS 23.502 §4.3.2.2.1, §4.16.4).

sequenceDiagram
    participant AMF
    participant SMF
    participant NRF
    participant PCF
    AMF->>SMF: Nsmf_PDUSession_CreateSMContext Request
    opt PCF address unknown
        SMF->>NRF: Nnrf_NFDiscovery Request
target-nf-type=PCF NRF-->>SMF: 200 OK (list of PCF NF profiles) end Note over SMF,PCF: TCP / TLS / HTTP/2 connection (reused if it exists) SMF->>PCF: POST sm-policies
SmPolicyContextData PCF->>PCF: Policy decision using subscriber policy from UDR, etc. PCF-->>SMF: 201 Created + Location
SmPolicyDecision Note over SMF: N4 Session Establishment (SMF⇔UPF) follows but is omitted here Note over SMF: Map the policy to N1 QoS rules / N2 QoS profile / N4 QER SMF->>AMF: Namf_Communication_N1N2MessageTransfer

Signal flow table

# Direction Message / operation Method and URI (after apiRoot) Main contents Reference
1 SMF→NRF NFDiscover GET /nnrf-disc/v1/nf-instances?target-nf-type=PCF&... requester-nf-type, service-names, etc. TS 29.510 §5.3.2.2 (to be confirmed)
2 SMF→PCF Npcf_SMPolicyControl_Create POST /npcf-smpolicycontrol/v1/sm-policies SmPolicyContextData TS 29.512 §4.2.2
3 PCF→SMF Create response 201 Created + Location SmPolicyDecision TS 29.512 §4.2.2
4 SMF→PCF Npcf_SMPolicyControl_Update POST .../sm-policies/{smPolicyId}/update SmPolicyUpdateContextData (triggers that occurred, etc.) TS 29.512 §4.2.4 (to be confirmed)
5 PCF→SMF Npcf_SMPolicyControl_UpdateNotify POST {notificationUri}/update SmPolicyNotification TS 29.512 §4.2.3 (to be confirmed)
6 SMF→PCF Npcf_SMPolicyControl_Delete POST .../sm-policies/{smPolicyId}/delete SmPolicyDeleteData TS 29.512 §4.2.5 (to be confirmed)

As procedures, SM Policy Association Establishment / Modification / Termination are specified in TS 23.502 §4.16.4 / §4.16.5 / §4.16.6 (sub-clauses to be confirmed).

PCF selection and the NRF

Which PCF the SMF uses is determined by PCF information passed from the AMF, NRF discovery, local configuration, and so on (TS 23.501 §6.3.7.1, to be confirmed). Which takes priority is configuration- and implementation-dependent. Because apiRoot is built from the NF profile in the NRF discovery result (FQDN / IP endpoint / apiPrefix / supported API versions), if the information registered in the NRF is stale or wrong, you get 404s or connection failures even though the PCF is healthy.


How — Isolating in four layers

flowchart TD
    L0["⓪ Destination
NRF Discovery / PCF Selection"] --> L1["① IP / TCP / TLS
Reachability, handshake, certificates"] L1 --> L2["② HTTP/2
Connection preface, SETTINGS, streams, GOAWAY"] L2 --> L3["③ 3GPP API
Method, path, status, ProblemDetails"] L3 --> L4["④ Policy Logic
SmPolicyContextData and SmPolicyDecision"] L4 --> L5["⑤ Mapping by the SMF
N1 QoS rules, N2 QoS profile, N4 QER"]

The subject of this chapter is the four layers ① to ④, but in practice adding ⓪ (NRF) before and ⑤ (mapping by the SMF) after leaves no gaps.

Layer 1: IP / TCP / TLS

Check What to look at Reference
Destination resolution DNS (for an FQDN), IP endpoint obtained from the NRF TS 29.510 §6.1.6.2.2 / §6.1.6.2.3 (fqdn / ipEndPoints of NFProfile / NFService, to be confirmed)
TCP SYN / SYN-ACK, RST, retransmissions —
TLS ClientHello / ServerHello, alerts, certificate validation TS 33.501 §13.1 (to be confirmed), TS 33.210 §6.2 (TLS profile, to be confirmed)
ALPN Whether h2 was negotiated over TLS RFC 9113 §3.2

The use of TLS on the SBI is specified in TS 33.501, but the operating conditions within a trusted domain (whether TLS is used, or protection is by NDS/IP, etc.) depend on operator policy (to be confirmed). The listening port is also resolved via NRF registration and is not a fixed value (N7).

Layer 2: HTTP/2

HTTP/2 multiplexes multiple streams over one TCP connection (RFC 9113 §5).

TCP connection (SMF → PCF)
├─ Stream 1   POST sm-policies             (Create for UE-A)
├─ Stream 3   POST sm-policies/aaa/update  (Update for UE-B)
├─ Stream 5   POST sm-policies             (Create for UE-C)
└─ The response on stream 1 may arrive after the one on stream 3
Item Meaning Reference
Stream ID A request and its response are carried on the same Stream ID. Client-initiated streams are odd RFC 9113 §5.1.1
HEADERS / DATA Headers (:method, etc.) and body (JSON) are separate frames RFC 9113 §6.1 / §6.2
RST_STREAM Abort of an individual stream (with an error code) RFC 9113 §6.4
GOAWAY Notification that the whole connection is ending (with the last processed Stream ID) RFC 9113 §6.8
SETTINGS Agreement on parameters such as the number of concurrent streams RFC 9113 §6.5

A Stream ID is only unique within its connection

Stream IDs restart from 1 on each TCP connection. In a capture mixing several SMFs and connections, match requests and responses using the pair TCP connection (Wireshark's tcp.stream) + HTTP/2 Stream ID. "The next packet is the response" does not necessarily hold.

HPACK — invisible headers are not necessarily the network's fault

HTTP/2 headers are compressed with HPACK, and the encoder and decoder keep an independent dynamic table for each direction of the connection (RFC 7541 §2.2 / §2.3.2). If you start capturing in the middle of a connection, headers registered in the dynamic table before that point cannot be referenced, and Wireshark may fail to display :path or :status correctly.

"Unknown header / decoding error" does not necessarily mean the NF sent broken headers. First suspect whether the capture includes the start of the connection (the connection preface and the first SETTINGS).

TLS — you need keys to see the contents

N7 protected by TLS is visible only as tls application data without keys.

  • To decrypt in Wireshark you must obtain the TLS session keys (key log file) from the NF or the TLS termination point and load them. With TLS 1.3 or (EC)DHE, the server's private key alone is not enough to decrypt.
  • Whether keys can be exported and where TLS is terminated (the NF itself, a sidecar, an LB, etc.) are implementation-dependent.
  • In test environments without TLS (cleartext HTTP/2), if the listening port differs from Wireshark's defaults it will not be recognized as HTTP/2, so specify HTTP2 with "Decode As" (a Wireshark operation, version-dependent).

Layer 3: 3GPP API

If HTTP/2 is healthy, check whether the request / response is correct as Npcf_SMPolicyControl.

Check Typical error
:method + :path Wrong apiName / apiVersion, mixed-up smPolicyId
content-type Something other than application/json (415)
Request body JSON syntax error, missing mandatory attribute, value out of range (400)
:status 4xx / 5xx
Error response body ProblemDetails (application/problem+json)
authorization header Missing or expired OAuth 2.0 access token (401 / 403)

ProblemDetails

An SBI error response basically carries ProblemDetails in the body (TS 29.500 §5.2.7.1, to be confirmed). The data type is defined in TS 29.571 §5.2.4.1 (to be confirmed) and is the IETF Problem Details format with 3GPP-specific attributes added.

ProblemDetails (main attributes)
├─ type / title / instance   ← from IETF Problem Details
├─ status                    ← same value as the HTTP status code
├─ detail                    ← human-readable explanation (implementation-dependent wording)
├─ cause                     ← 3GPP application error (used for machine decisions)
├─ invalidParams             ← which attribute is invalid (param / reason)
└─ supportedFeatures, etc.

RFC 7807 and RFC 9457

The IETF Problem Details specification was defined in RFC 7807 and was replaced by RFC 9457 in 2023 (RFC 9457 obsoletes RFC 7807). The media type application/problem+json is unchanged. Whether each 3GPP release references RFC 7807 or RFC 9457 is to be confirmed.

There are two families of cause values.

Family Examples Reference
SBI-common application errors MANDATORY_IE_MISSING (400), MANDATORY_IE_INCORRECT (400), INVALID_MSG_FORMAT (400), RESOURCE_URI_STRUCTURE_NOT_FOUND (404), NF_CONGESTION (503), UNSPECIFIED_NF_FAILURE (500) TS 29.500 §5.2.7.2 (to be confirmed)
Specific to Npcf_SMPolicyControl USER_UNKNOWN, ERROR_INITIAL_PARAMETERS, POLICY_CONTEXT_DENIED, etc. TS 29.512 §5.7.3 (to be confirmed; the mapping of each cause to a status code is also to be confirmed)

The wording of detail is implementation-dependent. Use status and cause for decisions, and invalidParams to locate the cause.

Typical 403 and 404

Status What it implies What to look at next
403 The PCF (or, in indirect communication, possibly the SCP) is alive, interpreted the request and rejected it. It is not "PCF down" cause (policy rejection or an authorization problem?), the access token scope (npcf-smpolicycontrol), the request context (SUPI, DNN, S-NSSAI)
404 The target resource does not exist :path (spelling of apiName / apiVersion), apiPrefix, smPolicyId (lost through a PCF restart or a switch to another instance?), the URI obtained from the NRF

With OAuth 2.0, an invalid token typically gives 401 and insufficient scope 403 (RFC 6750 §3.1; use in the SBI per TS 29.500 §6.7.3 / TS 33.501 §13.4.1, all to be confirmed).

Was it really the PCF that responded?

In indirect communication via an SCP (SBI Communication Model), a 4xx / 5xx / 504 received by the SMF may have been generated by the SCP. Check the capture point (SMF⇔SCP or SCP⇔PCF) and the sender of the response.

Layer 4: Policy Logic

Only when the API succeeded do you finally look at the contents of the policy.

flowchart TD
    W["5QI / bit rate differs from expectation"] --> Q1{"Are DNN, S-NSSAI, RAT etc. in
SmPolicyContextData correct?"} Q1 -- "No" --> S["SMF-side problem
context generation, subscription data"] Q1 -- "Yes" --> Q2{"Are qosDecs and sessRules in
SmPolicyDecision as expected?"} Q2 -- "No" --> P["PCF-side problem
policy configuration, policy data in UDR"] Q2 -- "Yes" --> E["Suspect the SMF mapping onwards
compare with N1, N2, N4"]

Wrong policy does not necessarily mean a PCF bug. The PCF decides based on the context it received, so always look at the request and the response as a pair.

Also, if the SMF could not apply a PCC rule it received, the SMF can report it to the PCF in an Update as a rule report (ruleReports, with the reason for failure) (TS 29.512 §4.2.4, attribute names and values to be confirmed). "The PCF returned it correctly, but the SMF could not apply it" shows up here.


Breaking down an "N7 failure"

In a report, identify at least which of the following it is.

# Category Typical evidence Main owner
① PCF discovery / selection failure Discovery to the NRF fails or returns 0 candidates. Not even a TCP SYN appears on N7 NRF / SMF configuration
② TCP / TLS failure No response to SYN, RST, TLS alert, certificate error Transport / PKI
③ HTTP/2 failure RST_STREAM, GOAWAY, no response (per-stream timeout) NF implementation / LB
④ SBI API error 4xx / 5xx + ProblemDetails Requester or PCF
⑤ Policy rejection 403 etc. with a cause indicating policy rejection (to be confirmed) PCF policy configuration
⑥ Policy decision mismatch 2xx, but the 5QI / bit rate differs from expectation PCF configuration or SMF context
⑦ SMF policy application failure PCF values differ from N1 / N2 / N4 values, failure reported in a rule report SMF

Simply reporting at this granularity greatly speeds up isolation among the teams involved.


Packet Analysis (Wireshark)

Display Filter

Filter Use
http2 All HTTP/2 (after TLS decryption, or cleartext)
http2.headers.path contains "npcf-smpolicycontrol" Narrow to N7 requests
http2.headers.method == "POST" Narrow to POST
http2.headers.status == 201 Responses to a successful Create
http2.headers.status >= 400 Error responses
http2.streamid == 21 && tcp.stream == 3 Follow a specific stream within a specific connection
http2.type == 3 / http2.type == 7 RST_STREAM / GOAWAY (frame type values per RFC 9113 §6)
json JSON body
tls.handshake.type == 1 / tls.alert_message ClientHello / TLS alert
tcp.flags.reset == 1 TCP RST
http2.headers.path contains "nnrf-disc" NRF discovery

Field names may differ between Wireshark versions (to be confirmed). Note also that responses have no :path, so filtering on :path drops the responses (pick them up again by Stream ID).

Decode example (conceptual)

The following is a conceptual representation of the display structure; the values are fictitious examples using the test PLMN (001-01) (capture needed).

Stream 21  HEADERS  (SMF → PCF)
 ├─ :method: POST
 ├─ :scheme: https
 ├─ :authority: pcf1.example.net
 ├─ :path: /npcf-smpolicycontrol/v1/sm-policies
 └─ content-type: application/json
Stream 21  DATA
 └─ JSON: SmPolicyContextData
     ├─ supi: imsi-001010000000001
     ├─ pduSessionId: 1
     ├─ dnn: internet
     ├─ sliceInfo: { sst: 1, sd: 010203 }
     ├─ pduSessionType: IPV4
     ├─ ratType: NR
     └─ notificationUri: https://smf1.example.net/cb/pdu-1

Stream 21  HEADERS  (PCF → SMF)
 ├─ :status: 201
 ├─ location: https://pcf1.example.net/npcf-smpolicycontrol/v1/sm-policies/abc123
 └─ content-type: application/json
Stream 21  DATA
 └─ JSON: SmPolicyDecision
     ├─ sessRules: { sr1: { authSessAmbr: { uplink: 100 Mbps, downlink: 200 Mbps },
     │                      authDefQos: { 5qi: 9, arp: { priorityLevel: 8, ... } } } }
     ├─ pccRules:  { pcc1: { flowInfos: [...], precedence: 100, refQosData: [ qos1 ] } }
     └─ qosDecs:   { qos1: { 5qi: 7, maxbrUl: 10 Mbps, maxbrDl: 10 Mbps } }

Error example (conceptual):

Stream 23  HEADERS  (PCF → SMF)
 ├─ :status: 400
 └─ content-type: application/problem+json
Stream 23  DATA
 └─ JSON: ProblemDetails
     ├─ status: 400
     ├─ cause: MANDATORY_IE_MISSING
     ├─ detail: (implementation-dependent wording)
     └─ invalidParams: [ { param: /sliceInfo, reason: ... } ]

Order of inspection

flowchart LR
    A["① Src / Dst
SMF→PCF?"] --> B["② tcp.stream and
Stream ID"] B --> C["③ :method
④ :path"] C --> D["⑤ :status"] D --> E["⑥ Request JSON
⑦ Response JSON"] E --> F["⑧ ProblemDetails
status, cause"]

Then link to other interfaces using whatever correlation keys are available, such as SUPI, PDU Session ID, DNN and S-NSSAI.

Correlating N7 → N4 → N2

Correlation key N7 (SBI) N11 (SBI) N4 (PFCP) N2 (NGAP)
SUPI supi in the Create body URI of N1N2MessageTransfer (ue-contexts/{ueContextId}, to be confirmed) Normally not included Not included
PDU Session ID pduSessionId in the Create body pduSessionId in the body Normally not included (identified by F-SEID) PDU Session ID IE
Time Time of Create / Update Right after Session Establishment / Modification PDU Session Resource Setup / Modify
Values qosDecs.5qi / maxbrUl/Dl / authSessAmbr (contains N1 / N2 SM information) QFI / MBR / GBR in the QER 5QI / bit rates in QoS Flow Level QoS Parameters

Since the SUPI normally does not appear on N4, it is practical to identify the PFCP session (F-SEID) by time + UE IP address + SMF logs. Subscriber information may be carried in, for example, the PFCP User ID IE, but whether it is used is configuration-dependent (TS 29.244 §8.2.101, to be confirmed).

Bit rates are represented differently on each interface

The same value is expressed differently. The SBI BitRate is a string with a unit such as "100 Mbps" (TS 29.571 §5.5.2, to be confirmed), PFCP MBR / GBR is an integer in kbps (TS 29.244 §8.2.8, to be confirmed), and the NGAP bit rate is an integer in bit/s (TS 38.413 §9.3.1.4, to be confirmed). Values that seem to "differ by orders of magnitude" may match after unit conversion. Build comparison tables with units aligned.

Item N7 (PCF decision) N4 (PFCP QER) N2 (NGAP) Verdict
5QI 7 (mapped to the QFI) 7 OK
MBR DL 10 Mbps 10000 kbps 10000000 bit/s OK (match after unit conversion)
Session-AMBR DL 200 Mbps 200000 kbps (PDU Session Aggregate Maximum Bit Rate) To be confirmed

If the N7 values differ from the N4 / N2 values, you can focus your suspicion after the PCF (on the SMF's policy processing). For reading N4 and N2, see PFCP and PDR / FAR / QER / URR and PDU Session Establishment deep dive.


Trouble Shooting

Symptom Likely cause What to check Logs Packet Resolution
No request reaches the PCF at all NRF discovery failure, wrong PCF selection configuration Discovery to the NRF and its result, the SMF's PCF configuration SMF logs, NRF logs http2.headers.path contains "nnrf-disc" Fix NRF registration / discovery conditions
No response to TCP SYN / RST Routing, FW, listening port IP endpoint / port registered in the NRF SMF / PCF connection logs tcp.flags.reset == 1 Fix routing, FW, registration data
Disconnected by a TLS alert Certificate expiry, trust chain, SAN mismatch Alert type after ServerHello TLS library logs tls.alert_message Fix certificates / CA configuration
Headers are not displayed Missing HPACK context because the capture started mid-connection, TLS not decrypted Whether the capture starts at the connection start, whether a key log exists — http2 Re-capture from the connection start, prepare keys
No response arrives PCF processing delay, stream timeout, RST_STREAM Whether a response exists on the same Stream ID, GOAWAY SMF timeout logs http2.type == 3 Check PCF load and timeout settings (values are implementation-dependent)
400 Missing mandatory attribute, invalid value, invalid JSON cause / invalidParams in ProblemDetails PCF logs http2.headers.status == 400 Fix request generation in the SMF
401 / 403 Invalid access token / insufficient scope, rejection on policy grounds cause, authorization header, token acquisition PCF / NRF logs http2.headers.status == 403 Check token / authorization settings and policy configuration
404 Wrong apiName / apiVersion / apiPrefix, lost smPolicyId :path, NF profile in the NRF, whether the PCF restarted PCF logs http2.headers.status == 404 Fix URI construction / NRF registration
5xx / 504 PCF internal failure, overload, SCP cannot reach beyond itself cause, sender of the response (PCF or SCP) PCF / SCP logs http2.headers.status >= 500 Investigate the PCF / SCP side
2xx but the 5QI is different Wrong context from the SMF, or PCF policy configuration DNN, S-NSSAI in the request and qosDecs in the response PCF policy evaluation logs json Identify the layer with a comparison table and fix it
PCF values are correct but UE / UPF values differ Wrong mapping in the SMF, rule application failure N4 QER, N2 QoS, ruleReports SMF logs pfcp / ngap Investigate the SMF side

How many times and at what interval the SMF retries when the PCF returns HTTP 500, and whether it switches to another PCF, are implementation-dependent (for choosing an alternative PCF and the NF Set concept, see NF Set / Binding Indication).


Boundary between 3GPP specifications and vendor implementations

Defined by 3GPP Decided by the vendor / operator
Npcf_SMPolicyControl operations, resource URIs, data model PCF / SMF pod layout, policy workers, internal caches, DB
Use of HTTP/2, JSON and TLS on the SBI, usage of status codes SBI listening ports, TLS termination point (NF / sidecar / LB)
Structure of ProblemDetails and 3GPP-defined cause values Wording of detail, internal error codes, log format
Registration / discovery via the NRF, the OAuth 2.0 authorization framework Details of the PCF selection algorithm, token caching
SM Policy Association procedures (Establishment / Modification / Termination) Timeout values, retry counts and intervals, failover method, vendor CLI

When a problem occurs on N7, separate a problem in 3GPP API behavior / a transport or platform problem / a vendor implementation problem.


Comparison with EPC (4G)

Item 4G EPC (Gx) 5GC (N7)
Endpoints PCEF (PGW) ⇔ PCRF SMF ⇔ PCF
Protocol Diameter (TS 29.212) HTTP/2 + JSON (TS 29.512)
Establishment CCR-Initial / CCA Create (POST → 201)
Update (initiated by PCEF / SMF) CCR-Update / CCA Update (POST .../update)
Update (initiated by PCRF / PCF) RAR / RAA UpdateNotify (POST {notificationUri}/update)
Termination CCR-Termination / CCA Delete (POST .../delete)
Session identification Session-Id AVP smPolicyId (URI in Location)
Representation of results Result-Code / Experimental-Result AVP HTTP status + cause in ProblemDetails
Choosing the destination Static configuration, DRA (Diameter Routing Agent) NRF discovery, SCP

The mapping of Gx Diameter messages is a conceptual correspondence (procedures in TS 29.212 §4.5 and message definitions in §5.6, both to be confirmed). The biggest differences are that result evaluation now has two levels, "HTTP status" and "3GPP cause", and that the destination is determined dynamically through the NRF.


3GPP Specification

Spec Clause Content
TS 23.501 §7.1 NF Service Consumer / Producer concepts (to be confirmed)
TS 23.501 §6.3.7.1 PCF discovery and selection (to be confirmed)
TS 23.502 §4.3.2.2.1 UE-requested PDU Session Establishment (where the SM Policy Association is established)
TS 23.502 §4.16.4 / §4.16.5 / §4.16.6 SM Policy Association Establishment / Modification / Termination (sub-clauses to be confirmed)
TS 23.502 §5.2.5.4 Definition of the Npcf_SMPolicyControl service (to be confirmed)
TS 29.512 §4.2.2 / §4.2.3 / §4.2.4 / §4.2.5 Create / UpdateNotify / Update / Delete (sub-clauses to be confirmed)
TS 29.512 §5.1 / §5.3 API URI and resource structure (sm-policies, custom operations; to be confirmed)
TS 29.512 §5.5 Notifications (callback URIs {notificationUri}/update and /terminate, to be confirmed)
TS 29.512 §5.6 / §5.7 Data model (SmPolicyContextData / SmPolicyDecision, etc.) / error handling (to be confirmed)
TS 29.500 §5.2 Use of HTTP/2 in the SBI
TS 29.500 §5.2.7 HTTP status codes and ProblemDetails / application errors (to be confirmed)
TS 29.500 §6.7.3 / §6.10.9 OAuth 2.0 authorization / redirection (to be confirmed)
TS 29.501 §4.4 Resource URI structure (apiRoot / apiName / apiVersion, §4.4.1; to be confirmed)
TS 29.571 §5.2.4.1 / §5.5.2 ProblemDetails type / common types such as BitRate (to be confirmed)
TS 29.510 §5.3.2.2 / §6.1.6.2.3 NFDiscover / NFService (apiPrefix, etc.; to be confirmed)
TS 29.518 §5.2.2.3.1 Namf_Communication_N1N2MessageTransfer (to be confirmed)
TS 29.244 §8.2.8 MBR (PFCP, to be confirmed)
TS 38.413 §9.3.1.4 Bit Rate (NGAP, to be confirmed)
TS 33.501 §13.1 / §13.4.1 TLS protection of the SBI / NF service authorization with OAuth 2.0 (to be confirmed)
TS 29.212 §4.5 / §5.6 Gx procedures / message definitions of CCR, CCA, RAR, RAA (for EPC comparison, to be confirmed)
RFC 9113 §5 / §6 / §8 HTTP/2 streams, frames, pseudo-headers (replaces RFC 7540)
RFC 7541 §2.2 / §2.3.2 HPACK dynamic table
RFC 9457 — Problem Details for HTTP APIs (replaces RFC 7807)
RFC 6750 §3.1 Bearer token errors (401 / 403)

Summary

  • N7 is realized by Npcf_SMPolicyControl. SMF = consumer (HTTP client), PCF = producer (HTTP server). For notifications (UpdateNotify) the direction is reversed and the connection is also different
  • The URI is {apiRoot}/npcf-smpolicycontrol/v1/sm-policies.... Create is POST → 201 + Location; Update / Delete are POST custom operations (/update, /delete)
  • Subsequent transactions can only be identified by the smPolicyId, so note the Location of the Create
  • HTTP 2xx ≠ correct policy. Look at the request (SmPolicyContextData) and the response (SmPolicyDecision) as a pair
  • Isolate in the order ⓪ NRF → ① IP/TCP/TLS → ② HTTP/2 → ③ 3GPP API → ④ Policy Logic → ⑤ mapping by the SMF
  • Match requests and responses by TCP connection + Stream ID. When headers are invisible, suspect the HPACK context and the TLS keys
  • Judge errors by status and cause, and locate them with invalidParams. 403 / 404 do not mean "PCF down"
  • Correlate N7 → N4 → N2 by SUPI, PDU Session ID and time, and compare values with units aligned

Check your understanding

Q1. In response to an Npcf_SMPolicyControl request from the SMF, the PCF returned HTTP 201. However, the 5QI applied to the UE differs from the expected value. Which is the most appropriate action? A. Since HTTP succeeded, there is no problem in the PCF / SMF; conclude it is a gNB hardware fault / B. HTTP success only indicates a successful API transaction, so check in order the SMF's request context, the PCF's policy decision, and the SMF's mapping to N1 / N2 / N4 / C. With HTTP 2xx the 5QI is always the 3GPP default value, so no check is needed / D. N7 policy is unrelated to QoS, so check only the N3 TEID

Answer: B. 201 only indicates that the SM Policy Association was created (success at the API layer); it does not guarantee that the policy contents are correct. First check whether the DNN, S-NSSAI etc. in SmPolicyContextData are correct, then whether qosDecs in SmPolicyDecision is as expected, and finally whether the same values were mapped to N1 / N2 / N4. A skips layers without grounds. C and D are wrong (the 5QI can be determined by the PCF's decision).

Q2. To find the deletion of an SM Policy Association in a capture, you filtered on the HTTP DELETE method but found nothing. Why?

Because Npcf_SMPolicyControl_Delete is not HTTP DELETE but the custom operation POST .../sm-policies/{smPolicyId}/delete (TS 29.512 §4.2.5, to be confirmed). The SMF passes SmPolicyDeleteData in the body at deletion. Look for POSTs whose :path contains /delete. Update is likewise a POST to /update.

Q3. You found an HTTP/2 request from the SMF to the PCF, but the next packet was a response about a different UE. How do you find the matching response? And what do you suspect if :path is not displayed?

Look for a HEADERS frame (containing :status) with the same Stream ID within the same TCP connection (RFC 9113 §5.1.1). Because HTTP/2 is multiplexed, the next packet is not necessarily the response. If headers such as :path are not displayed, suspect that the capture started in the middle of the connection and the HPACK dynamic table context is missing, or that TLS has not been decrypted (no key log). It does not necessarily mean the NF sent broken headers.

Q4. A Create from the SMF to the PCF got a 404. May you report 'the PCF is down'?

No. If a 404 could be returned, the PCF (or an intermediate SCP) received the request and was able to return an HTTP response. Check the apiName / apiVersion in :path, the apiPrefix registered in the NRF and the URI obtained through NRF discovery, and look at the cause in ProblemDetails (e.g. RESOURCE_URI_STRUCTURE_NOT_FOUND, to be confirmed). It may be that "the PCF is alive, but the SMF is accessing a wrong service URI."


Next Step