AF / N5 / Application Session — How an Application Request Becomes a QoS Flow¶
Learning objectives¶
After reading this chapter, you will be able to:
- Explain that N5 = Npcf_PolicyAuthorization (TS 29.514), with the AF as Service Consumer and the PCF as Service Producer
- Explain the Application Session Context (
app-sessionsresource) and how Create / Update / Delete / Subscribe / Unsubscribe / Notify look on HTTP - Explain how the PCF associates an Application Session with an SM Policy Association (Session Binding), and why a BSF is needed in multi-PCF deployments
- Draw how a Media Component / Media Sub-Component / Flow Description becomes, via the SDF template of a PCC Rule, a QoS Rule (N1), QoS Flow (N2) and PDR / QER (N4)
- Isolate, segment by segment, the cases "the AF request does not reach the PCF", "the PCF succeeds but no QoS Flow is created" and "traffic does not match the PDR"
Prerequisites¶
- PCF / SM Policy Association / PCC Rule — structure of a PCC Rule and how the SMF translates it to N1 / N2 / N4
- N7 SBI Analysis — reading SBI HTTP/2, JSON and ProblemDetails
- N5 / AF / PCF — overview of the reference point and NFs
- Supporting: PDR / PDI / SDF Filter / QoS Flow / QFI / 5QI / GFBR / MFBR / AMBR / ARP / VoNR / Policy
The focus of this chapter (Level ∞ Deep Dive)
The N5 page introduced N5 as "the window through which a trusted AF requests QoS and more from the PCF", and Policy gave an overview of AF-initiated flows. This chapter digs into what the AF passes and in what form (JSON), how the PCF ties it to a PDU Session, what PCC Rule it is converted into, and which UPF PDR it finally becomes, from the perspectives of the Application Session data model and trace analysis. The case where an external AF makes the request via the NEF is covered in the next chapter, NEF / N33.
Why — an application cannot create a QoS Flow directly¶
Applications such as VoNR calls, cloud gaming and live video have requirements like "this media needs this bandwidth and this latency". However, the party that knows those requirements is the application side (AF), while the parties that actually apply QoS are the UE, gNB and UPF.
- The AF knows neither the PDU Session ID, nor the QFI, nor the SEID. What it usually knows is the UE's IP address and the media destination, ports, codecs and bandwidth.
- Only the SMF can configure the UE, gNB and UPF, and it is the PCF that gives the SMF the QoS policy (PCC Rule) (PCF / PCC).
So we need an entry point where the PCF receives the application's language (media, flows, bandwidth) and translates it into the 5GC's language (PCC Rules). That is N5 / Npcf_PolicyAuthorization (TS 23.501 §6.2.10, TS 29.514 §4.1 (to be confirmed)).
Analogy: The AF is an "event organizer", the PCF is the "road authority", and the SMF is the "on-site traffic controller". The organizer applies, saying "from 7 p.m., about this many cars will travel between this venue and this parking lot" (Application Session). The authority reviews the application and issues a permit saying "make this section a priority lane under these conditions" (PCC Rule). The one who actually places the cones and creates the lane (QoS Flow / PDR / QER) is the on-site controller. The organizer cannot place the cones itself.
What — N5 and Npcf_PolicyAuthorization¶
Reference point and service¶
| Aspect | Content | Specification |
|---|---|---|
| Reference point | N5: AF ⇔ PCF | TS 23.501 §4.2.7 (to be confirmed) |
| Service | Npcf_PolicyAuthorization (provided by the PCF) | TS 23.502 §5.2.5.3 (to be confirmed), TS 29.514 |
| Consumer / Producer | AF = Service Consumer, PCF = Service Producer | TS 29.514 §4.1 (to be confirmed) |
| Protocol | HTTP/2 + JSON (common to SBI) | TS 29.500 / TS 29.501 |
| API root | {apiRoot}/npcf-policyauthorization/v1 |
TS 29.514 §5.1 (to be confirmed) |
For notifications (Notify) the direction is reversed: the PCF POSTs to the AF's callback URI (notifUri). Only in this case are the HTTP client and server swapped.
Trusted AF and untrusted AF¶
TS 23.501 §6.2.10 specifies that an AF trusted by the operator can interact directly with the relevant NFs, while an AF that is not allowed direct access uses the external exposure framework via the NEF.
flowchart LR
TAF["Trusted AF
e.g. IMS P-CSCF"] == "N5
Npcf_PolicyAuthorization" ==> PCF["PCF"]
XAF["Untrusted AF
external application provider"] -- "N33
AsSessionWithQoS etc." --> NEF["NEF"]
NEF -- "Npcf_PolicyAuthorization
(NEF acts as the AF)" --> PCF
PCF == "N7
Npcf_SMPolicyControl" ==> SMF["SMF"]
| Aspect | Trusted AF (direct N5) | Untrusted AF (via NEF) |
|---|---|---|
| API received by the PCF | Npcf_PolicyAuthorization | The same Npcf_PolicyAuthorization (the NEF is the consumer) |
| How the UE is specified | Specifies the UE IP address etc. directly | The external AF specifies UE IP / GPSI etc.; the NEF authorizes and translates |
| How QoS is specified | Can pass detailed media information (bandwidth, codecs, etc.) | Mostly specified by a QoS Reference (pre-agreed QoS) |
| Typical example | P-CSCF (VoNR / VoLTE) | External video or gaming providers |
From the PCF's point of view, both are the same Application Session. The difference lies in the authorization and identifier translation in front of it, which is covered in NEF / N33.
What — Application Session Context¶
Resource structure¶
The core of N5 is the Application Session Context (also called an "App Session") that the AF creates on the PCF (TS 29.514 §5.3, to be confirmed).
{apiRoot}/npcf-policyauthorization/v1
└─ /app-sessions ← Application Sessions (collection)
└─ /{appSessionId} ← Individual Application Session Context
├─ /delete ← custom operation for deletion (POST)
└─ /events-subscription ← Events Subscription (individual resource)
{notifUri} (callback specified by the AF)
├─ /notify ← event notification (PCF → AF)
└─ /terminate ← termination request (PCF → AF)
Service operations¶
| Operation | Direction | HTTP | Main responses | Specification |
|---|---|---|---|---|
| Create | AF → PCF | POST /app-sessions (AppSessionContext) |
201 Created + Location: .../app-sessions/{appSessionId} |
TS 29.514 §4.2.2 |
| Update | AF → PCF | PATCH /app-sessions/{appSessionId} (merge-patch) |
200 OK / 204 No Content |
TS 29.514 §4.2.3 |
| Delete | AF → PCF | POST /app-sessions/{appSessionId}/delete |
204 No Content (200 OK when a final report is returned) |
TS 29.514 §4.2.4 |
| Notify | PCF → AF | POST {notifUri}/notify (event) / POST {notifUri}/terminate (termination request) |
204 No Content |
TS 29.514 §4.2.5 |
| Subscribe | AF → PCF | PUT /app-sessions/{appSessionId}/events-subscription |
201 Created (new) / 200 OK・204 (modified) |
TS 29.514 §4.2.6 |
| Unsubscribe | AF → PCF | DELETE /app-sessions/{appSessionId}/events-subscription |
204 No Content |
TS 29.514 §4.2.7 |
(The clause numbers of the operations, how each status code is used, and why /delete is defined as a custom operation (POST) rather than the DELETE method are to be confirmed in TS 29.514 §4.2 / §5.3 of the target Release. Stage 2 is TS 23.502 §5.2.5.3, to be confirmed.)
Why Delete is not the DELETE method
When deleting an App Session, the AF can put subscription information such as "I want a final usage report" in the body. Because a body is involved, deletion is defined not as DELETE but as the custom operation POST .../{appSessionId}/delete (the reasoning is this chapter's interpretation; the definition is in TS 29.514 §5.3, to be confirmed). This is why searching a trace for DELETE finds nothing.
A terminate from the PCF is not a deletion
When the PCF sends POST {notifUri}/terminate, it is a request to the AF saying "please terminate this App Session" (e.g. the corresponding PDU Session has been released). The App Session resource itself is removed when the AF subsequently sends Delete (TS 29.514 §4.2.5, to be confirmed). With an implementation in which the AF does not send Delete in response to terminate, the App Session may remain on the PCF.
Main attributes of AppSessionContextReqData¶
The body of Create is an AppSessionContext, and the request is carried in its ascReqData (AppSessionContextReqData) (TS 29.514 §5.6.2.2 / §5.6.2.3, to be confirmed).
| Category | Attribute (conceptual name) | Meaning |
|---|---|---|
| Mandatory | notifUri |
AF callback URI that receives Notify from the PCF |
suppFeat |
Supported Features (negotiation of optional features) | |
| Which PDU Session | ueIpv4 / ueIpv6 / ueMac |
UE address. The primary key for Session Binding |
dnn / sliceInfo / ipDomain |
DNN, S-NSSAI, distinction of IPv4 address space | |
supi / gpsi |
UE identifiers (optional) | |
| What is wanted | medComponents |
Map of Media Components (flows and bandwidth per media) |
afAppId |
AF Application Identifier (per-application request, combined with application detection) | |
afRoutReq |
AF influence on traffic routing (steering to the edge) | |
(qosReference etc. within medComponents) |
Reference to a pre-agreed QoS, specified as an attribute of the MediaComponent (mainly used for requests via the NEF; MediaComponent type in TS 29.514 §5.6.2, to be confirmed) | |
| Notification subscription | evSubsc |
Events subscribed at the same time as Create (EventsSubscReqData) |
| Other | aspId / sponId / sponStatus |
Sponsored Data Connectivity |
resPrio / mpsId / mcsId |
Indication of priority services (MPS / MCS) |
This is an excerpt of the main attributes, not an exhaustive list. Check TS 29.514 §5.6 for the mandatory / optional / conditional classification and attributes added per Release (to be confirmed).
Media Component / Media Sub-Component / Flow Description¶
The unit in which the AF requests QoS is the Media Component (one media stream, e.g. audio), which contains per-flow Media Sub-Components.
medComponents (map)
└─ "1": MediaComponent ← e.g. the 1st m= line of the SDP (audio)
├─ medCompN: 1 ← Media Component Number (mandatory)
├─ medType: AUDIO ← AUDIO / VIDEO / DATA / CONTROL etc.
├─ codecs: [...] ← SDP codec information (built by the AF from the SDP)
├─ marBwUl / marBwDl: "41 Kbps" ← Maximum Requested Bandwidth (UL / DL)
├─ mirBwUl / mirBwDl ← Minimum Requested Bandwidth (optional)
├─ fStatus: ENABLED ← Flow Status (gate)
└─ medSubComps (map)
├─ "1": MediaSubComponent ← e.g. RTP
│ ├─ fNum: 1 ← Flow Number (mandatory)
│ ├─ fDescs: [ for UL, for DL ] ← Flow Description (up to 2)
│ └─ flowUsage: NO_INFO
└─ "2": MediaSubComponent ← e.g. RTCP
├─ fNum: 2
├─ fDescs: [ ... ]
└─ flowUsage: RTCP ← RTCP / AF_SIGNALLING / NO_INFO
| Attribute | Meaning | How the PCF uses it |
|---|---|---|
medType / codecs |
Media type and codecs | Input for deriving the QoS class such as 5QI (TS 29.513 §7.3, to be confirmed) |
marBwUl / marBwDl |
Maximum requested bandwidth | Input for deriving MBR / GBR (derivation rules in TS 29.513 §7.3, to be confirmed) |
fDescs |
Description of IP flows (string in IPFilterRule format) | The PCC Rule's SDF template (flowInfos) |
fStatus |
ENABLED / ENABLED-UPLINK / ENABLED-DOWNLINK / DISABLED / REMOVED | The PCC Rule's gate status |
flowUsage |
RTCP, AF_SIGNALLING, etc. | Purpose of the flow. AF_SIGNALLING is used to indicate an IMS signalling flow |
The Flow Description format is the IPFilterRule format inherited from the Rx Flow-Description AVP (TS 29.514 §5.6.3; the encoding is the Flow-Description AVP of TS 29.212 §5.4.2, originally defined in Rx TS 29.214 §5.3.8; all to be confirmed; the same references as PDR / PDI / SDF Filter).
permit out 17 from 198.51.100.20 40000 to 10.45.0.2 50000 ← DL (peer → UE)
permit out 17 from 10.45.0.2 50000 to 198.51.100.20 40000 ← UL (UE → peer)
│ │ └ source address port └ destination address port
│ └ protocol number (17 = UDP)
└ direction keyword
Under the convention inherited from Rx, the direction keyword is fixed to out, and UL and DL are distinguished by whether the source or the destination address is the UE (TS 29.212 §5.4.2 / TS 29.214 §5.3.8, to be confirmed). Because this "way of writing direction" is interpreted again at every conversion, N5 → N7 (flowDirection of flowInfos) → N4 (SDF Filter), inconsistencies between implementations can cause PDR mismatches (see Trouble Shooting below).
What — the relationship between N5 and N7 (Session Binding)¶
How does the PCF know "which PDU Session"?¶
Creating an App Session alone does not determine which PDU Session of which UE it should apply to. The PCF ties the App Session to one of the SM Policy Associations (N7) it holds. This is called Session Binding (TS 23.503 §6.1.3.2, to be confirmed).
flowchart LR
AF["AF
App Session
ueIpv4=10.45.0.2
dnn=ims"] -- "N5" --> PCF["PCF"]
SMF["SMF
PDU Session
UE IP=10.45.0.2
DNN=ims, S-NSSAI"] -- "N7
SM Policy Association" --> PCF
PCF --> B{"Session Binding
UE address + DNN etc. match?"}
B -- "match" --> R["Create PCC Rule and
UpdateNotify that SM Policy"]
B -- "no match" --> X["Reject App Session
e.g. PDU_SESSION_NOT_AVAILABLE"]
The binding mechanism in TS 23.503 §6.1.3.2 can be organized roughly into the following three stages (sub-clause numbers to be confirmed).
| Stage | Content | Responsible |
|---|---|---|
| Session binding | Associates AF session information with one PDU Session. Keys are the UE IPv4 address / IPv6 prefix (MAC for Ethernet), UE identity (if available), DNN, S-NSSAI, etc. | PCF (§6.1.3.2.2, to be confirmed) |
| PCC rule authorization | Authorizes the QoS of the PCC Rule from the AF request plus subscriber and operator policy | PCF (§6.1.3.2.3, to be confirmed) |
| QoS Flow binding | Associates the PCC Rule with an existing or new QoS Flow (binding parameters: 5QI / ARP etc.) | SMF (§6.1.3.2.4, to be confirmed) |
The key point is that the last stage, QoS Flow binding, is the SMF's job. The PCF does not order "create a new QoS Flow"; the PCF passes the PCC Rule, and the SMF decides whether to create a new QoS Flow by looking at the binding parameters (PCF / PCC).
Multi-PCF deployments and the BSF¶
In a network with multiple PCFs, the AF must create the App Session on the PCF that holds the SM Policy Association of that PDU Session. If it reaches a different PCF, Session Binding fails.
SMF ──N7── PCF-B ← holds the SM Policy Association for UE IP 10.45.0.2
AF ──N5── PCF-A ✗ ← does not know the target session → reject
AF ──N5── PCF-B ✓ ← binding succeeds
The ways in which the AF finds the serving PCF include Nbsf_Management_Discovery to the BSF (searching for the serving PCF keyed by UE IP, DNN and S-NSSAI), Delegated Discovery via an SCP, the BSF acting as a Diameter proxy / redirect for an AF that uses Rx, and local configuration; which one is used is deployment-dependent (TS 23.503 §6.1.1.2, to be confirmed). For details see BSF / PCF Binding and SBI Communication Model.
How — from AF request to QoS Flow (end-to-end)¶
Call Flow¶
A representative example combining TS 23.502 §4.16.5.2 (PCF-initiated SM Policy Association Modification) and §4.3.3.2 (network-requested PDU Session Modification) (step numbers and order differ between versions, so to be confirmed).
sequenceDiagram
participant AF
participant BSF
participant PCF
participant SMF
participant AMF
participant gNB
participant UPF
AF->>BSF: Nbsf_Management_Discovery
(UE IP, DNN, S-NSSAI)
BSF-->>AF: 200 OK (serving PCF)
AF->>PCF: Npcf_PolicyAuthorization_Create
POST app-sessions (medComponents, notifUri, evSubsc)
PCF->>PCF: Session Binding
PCC Rule authorization and generation
PCF-->>AF: 201 Created (Location: app-sessions/ID)
PCF->>SMF: Npcf_SMPolicyControl_UpdateNotify
(add PCC Rule)
SMF-->>PCF: 200 OK / 204 No Content
Note over SMF: QoS Flow binding
new QFI or existing QoS Flow
SMF->>AMF: Namf_Communication_N1N2MessageTransfer
(N1: PDU Session Modification Command
N2: PDU Session Resource Modify Request Transfer)
AMF->>gNB: NGAP PDU Session Resource Modify Request
gNB-->>AMF: PDU Session Resource Modify Response
AMF->>SMF: Nsmf_PDUSession_UpdateSMContext (N2 SM information)
SMF->>UPF: PFCP Session Modification Request
(Create PDR / QER)
UPF-->>SMF: PFCP Session Modification Response
Note over SMF: After receiving the UE Modification Complete
report the PCC Rule outcome
SMF->>PCF: Npcf_SMPolicyControl_Update
(rule outcome report)
PCF->>AF: Npcf_PolicyAuthorization_Notify
POST notifUri/notify (SUCCESSFUL_RESOURCES_ALLOCATION etc.)
201 Created does not mean the QoS Flow has been created
The 201 Created that the PCF returns to the AF only shows that the App Session has been created and the request authorized. Application at the SMF, gNB, UE and UPF happens afterwards and can fail. To learn the outcome, the AF needs to subscribe to events such as SUCCESSFUL_RESOURCES_ALLOCATION / FAILED_RESOURCES_ALLOCATION (event names and the details of the Policy Control Request Triggers used for the SMF → PCF report are in TS 29.514 §5.6.3 / TS 29.512 §4.2.4, to be confirmed).
- In TS 23.502 §4.3.3.2, N4 Session Modification appears conditionally in several steps (after the N2 response, after the UE's Complete, etc.; step numbers to be confirmed), so there are options for when N4 is updated. Which timing is actually used is implementation-dependent. If the UE is CM-IDLE, paging is needed before N1/N2 can be delivered (TS 23.502 §4.2.3.3).
- Whether the PCF returns its response to the AF before or after UpdateNotify should be checked against both the specified order and the implementation (to be confirmed).
Signal Flow¶
| # | Message | Segment | Meaning | Specification |
|---|---|---|---|---|
| 1 | Nbsf_Management_Discovery | AF → BSF | Searching for the serving PCF (deployment-dependent; omitted in some configurations) | TS 29.521 §4.2.4 |
| 2 | Npcf_PolicyAuthorization_Create | AF → PCF | Creating the App Session. Media information, callback, subscribed events | TS 29.514 §4.2.2 |
| 3 | 201 Created | PCF → AF | Returns the App Session ID (Location) | TS 29.514 §4.2.2 (to be confirmed) |
| 4 | Npcf_SMPolicyControl_UpdateNotify | PCF → SMF | Applies the added / changed PCC Rule to the SM Policy Association | TS 23.502 §4.16.5.2 / TS 29.512 §4.2.3 (to be confirmed) |
| 5 | N1N2MessageTransfer → NGAP Modify / NAS Modification Command | SMF → AMF → gNB / UE | New QoS Flow (QFI, 5QI, GFBR/MFBR) and QoS Rule | TS 23.502 §4.3.3.2 / TS 38.413 §8.2.3 / TS 24.501 §6.3.2 (to be confirmed) |
| 6 | PFCP Session Modification | SMF → UPF | PDR with SDF Filter; QER with QFI, GBR/MBR and gate | TS 29.244 §7.5.4 / §7.5.5 |
| 7 | Npcf_SMPolicyControl_Update | SMF → PCF | Outcome of applying the PCC Rule (ruleReports on failure) | TS 29.512 §4.2.4 (to be confirmed) |
| 8 | Npcf_PolicyAuthorization_Notify | PCF → AF | Event notification such as success or failure of resource allocation | TS 29.514 §4.2.5 |
The conversion chain — from Flow Description to PDR¶
[N5] AF: MediaComponent
├─ medType=AUDIO, codecs, marBwUl/Dl ─────┐
├─ fStatus=ENABLED ──────────────┐ │ PCF: QoS mapping (TS 29.513 §7.3)
└─ medSubComp.fDescs ──┐ │ │ + subscriber / operator policy
▼ ▼ ▼
[N7] PCF: PccRule ── flowInfos(SDF template) / precedence
├─ refTcData → TrafficControlData.flowStatus (gate)
└─ refQosData → QosData (5qi, arp, maxbrUl/Dl, gbrUl/Dl)
│
▼ SMF: QoS Flow binding (5QI / ARP etc.) → QFI assignment
┌───────────────────┼─────────────────────────┐
▼ ▼ ▼
[N1] QoS Rule [N2] QoS Flow Level [N4] PDR (PDI: SDF Filter, QFI etc.)
(UL Packet Filter, QoS Parameters + QER (QFI, MBR/GBR, Gate Status)
Precedence, QFI) (QFI, 5QI, ARP, GFBR/MFBR)
| What the AF passes (N5) | PCC Rule (N7, TS 29.512) | UE (N1) | gNB (N2) | UPF (N4) |
|---|---|---|---|---|
fDescs (Flow Description) |
flowInfos (flowDescription + flowDirection) |
Packet filter of the QoS Rule (UL) | — (the gNB does not know the SDF) | SDF Filter of the PDR |
| — (decided by the PCF) | precedence |
QoS Rule precedence | — | PDR Precedence |
medType / codecs / marBw* |
QosData (5QI, ARP, MBR / GBR) | QoS Flow Description (5QI, GFBR / MFBR) | QoS Flow Level QoS Parameters | QER (MBR / GBR, QFI) |
fStatus |
flowStatus of TrafficControlData | — | — | Gate Status of the QER |
(Attribute names are conceptual. TS 29.512 §5.6.2, TS 24.501 §9.11.4.12 / §9.11.4.13, TS 38.413 §9.3.1.12, TS 29.244 §8.2.5 (SDF Filter). All clause numbers to be confirmed.)
- Whether PCC Rules are created per Media Component or per Media Sub-Component (flow) is PCF implementation-dependent.
- Mappings such as AUDIO → 5QI=1 are determined by the TS 29.513 §7.3 mapping and operator policy; the AF does not specify the 5QI directly (exceptions such as the QoS Reference from Rel-16 onwards are to be confirmed).
How — seen through the VoNR P-CSCF¶
In VoNR, the IMS P-CSCF uses N5 as a trusted AF. Building Media Components from the SIP SDP is the P-CSCF's job.
sequenceDiagram
participant UE
participant PCSCF as P-CSCF (AF)
participant PCF
participant SMF
UE->>PCSCF: SIP INVITE (SDP offer)
Note over PCSCF: Receives the SDP answer from the far end
(e.g. 183 Session Progress)
PCSCF->>PCF: Npcf_PolicyAuthorization_Create
(ueIpv4, dnn=ims, AUDIO, fDescs RTP/RTCP)
PCF-->>PCSCF: 201 Created
PCF->>SMF: UpdateNotify (PCC Rule with 5QI=1 GBR)
Note over SMF: Adds a new QoS Flow (5QI=1)
updates N1 / N2 / N4
PCF->>PCSCF: Notify (SUCCESSFUL_RESOURCES_ALLOCATION)
PCSCF->>UE: Call proceeds with SIP 183 / UPDATE etc.
Note over UE,PCSCF: Call ends (BYE)
PCSCF->>PCF: POST app-sessions/ID/delete
PCF->>SMF: UpdateNotify (remove PCC Rule)
Note over SMF: Releases the 5QI=1 QoS Flow
| SDP information | Mapping to the Media Component (conceptual) |
|---|---|
m=audio 50000 RTP/AVP ... (which m= line it is) |
medCompN (order of the m= line), medType=AUDIO |
Address in c= and port in m= |
UE-side / peer-side addresses and ports in fDescs |
| RTP port + 1 (RTCP) | A separate Media Sub-Component (flowUsage=RTCP) |
b=AS: / codecs |
marBwUl / marBwDl, codecs |
a=sendrecv / a=sendonly etc. |
fStatus (ENABLED / ENABLED-UPLINK etc.) |
(The rules for converting SDP to Media Components are in TS 29.513 §7.2 etc.; the timing at which the P-CSCF issues the N5 request (on the SDP offer or the answer) depends on TS 29.513 / TS 23.228 and the P-CSCF configuration. All to be confirmed.)
The IMS signalling QoS Flow (5QI=5) exists even without N5
The 5QI=5 QoS Flow is normally the default QoS Flow of the IMS PDU Session (the flow associated with the default QoS rule). It is created at PDU Session establishment with the subscribed default QoS from the UDM subscription data, as authorized or modified by the PCF (authorized default QoS) (TS 23.501 §5.7.2.7 / TS 23.503 §6.4, sub-clauses to be confirmed). Separately, there is also a method in which the P-CSCF explicitly requests a flow for SIP signalling over N5 with flowUsage=AF_SIGNALLING (sub-clause on provisioning of signalling flow information in TS 29.514 §4.2.2, to be confirmed; whether it is used is configuration-dependent). Where N5 takes the lead role is the 5QI=1 voice QoS Flow created and removed per call.
Packet Analysis (Wireshark)¶
N5 / N7 are SBI, so they are HTTP/2. In SBI, TLS support is mandatory, but whether it is actually applied within the PLMN is the operator's decision (TS 33.501 §13.1, to be confirmed). If TLS is applied, decryption keys (key log etc.) are needed. Lab setups such as Open5GS / free5GC are sometimes configured with plaintext HTTP/2 (h2c) (configuration-dependent). Note that N33 (Northbound API) used by external AFs may use either HTTP/1.1 or HTTP/2 (TS 29.122 §5.2.2, to be confirmed; see NEF / N33).
Display filters¶
Field names may differ between Wireshark versions (to be confirmed).
| Filter | Purpose |
|---|---|
http2.headers.path contains "npcf-policyauthorization" |
N5 (App Session Create / Update / Delete / Subscribe) |
http2.headers.path contains "app-sessions" |
Narrow down to the App Session resource |
http2.headers.method == "PATCH" |
Narrow down to Update |
http2.headers.path contains "/notify" / "/terminate" |
PCF → AF notifications (note that the callback URI structure is decided by the AF implementation) |
http2.headers.path contains "npcf-smpolicycontrol" |
N7 (SMF → PCF Create / Update). PCF → SMF UpdateNotify is addressed to the SMF's callback URI, so this filter may not catch it |
http2.headers.status |
Response status (201 / 4xx / 5xx) |
json |
JSON body (medComponents, pccRules, etc.) |
ngap / nas-5gs |
N2 PDU Session Resource Modify / N1 PDU Session Modification Command (watch out for NAS ciphering) |
pfcp |
N4 Session Modification (Create PDR / QER) |
gtp |
QFI on N3 (PDU Session Container) |
Decode example (conceptual)¶
The following is a conceptual representation following the TS 29.514 / TS 29.512 OpenAPI; attribute names are to be confirmed and values are fictitious (capture required).
[N5] POST /npcf-policyauthorization/v1/app-sessions
AppSessionContext
└─ ascReqData
├─ ueIpv4: 10.45.0.2
├─ dnn: ims
├─ notifUri: https://pcscf.example/n5cb/abc123
├─ suppFeat: "..."
├─ evSubsc
│ └─ events: [ SUCCESSFUL_RESOURCES_ALLOCATION, FAILED_RESOURCES_ALLOCATION ]
└─ medComponents
└─ "1"
├─ medCompN: 1, medType: AUDIO
├─ marBwUl: "41 Kbps", marBwDl: "41 Kbps"
├─ fStatus: ENABLED
└─ medSubComps
├─ "1": fNum 1
│ fDescs: [ "permit out 17 from 198.51.100.20 40000 to 10.45.0.2 50000",
│ "permit out 17 from 10.45.0.2 50000 to 198.51.100.20 40000" ]
└─ "2": fNum 2, flowUsage: RTCP, fDescs: [ ...40001 / 50001... ]
→ 201 Created
Location: https://pcf-b.example/npcf-policyauthorization/v1/app-sessions/7f3c...
[N7] POST {SMF notificationUri}/update ← UpdateNotify
SmPolicyNotification
└─ smPolicyDecision
├─ pccRules
│ └─ "voice-1": flowInfos [ {flowDescription, flowDirection: DOWNLINK}, {..., UPLINK} ]
│ precedence: 50, refQosData: ["qos-voice"], refTcData: ["tc-voice"]
├─ qosDecs
│ └─ "qos-voice": 5qi 1, gbrUl/gbrDl, maxbrUl/maxbrDl, arp {priorityLevel, preemptCap, preemptVuln}
└─ traffContDecs
└─ "tc-voice": flowStatus ENABLED
[N4] PFCP Session Modification Request
├─ Create PDR (UL): PDI { Source Interface: Access, Local F-TEID, QFI 2, SDF Filter } → QER 2
├─ Create PDR (DL): PDI { Source Interface: Core, UE IP 10.45.0.2, SDF Filter } → QER 2
└─ Create QER 2: QFI 2, Gate Status OPEN, MBR / GBR
Order of checks¶
flowchart LR
A["1. N5
Create response
201 / 4xx / 5xx"] --> B["2. N7
Is there an UpdateNotify
PCC Rule contents"]
B --> C["3. N2 / N1
Modify Request / Response
Modification Command"]
C --> D["4. N4
Create PDR / QER
SDF Filter and Precedence"]
D --> E["5. N3
5-tuple and QFI
of actual traffic"]
E --> F["6. N5 Notify
success / failure event"]
Note that the correlation key changes from segment to segment.
| Segment | Correlation key |
|---|---|
| AF ⇔ PCF | App Session ID (Location), notifUri, UE IP |
| PCF ⇔ SMF | SM Policy ID, PCC Rule ID |
| SMF ⇔ gNB / UE | PDU Session ID, QFI, QoS Rule ID |
| SMF ⇔ UPF | SEID, PDR ID / QER ID |
| N3 | TEID, QFI, inner IP 5-tuple |
Trouble Shooting¶
| Symptom | Likely cause | Check point | Log | Packet | Resolution |
|---|---|---|---|---|---|
| AF request does not reach the PCF | AF cannot find the serving PCF (BSF 204, NRF / SCP configuration), name resolution / TLS / HTTP/2 failure | AF destination PCF, BSF Discovery result, TLS handshake | AF / BSF / SCP logs | http2, tls.alert_message |
Check the destination resolution path (BSF / SCP / local configuration) |
| Create returns 400 | Missing mandatory JSON attributes (notifUri, suppFeat, etc.), invalid format (Flow Description, bitrate format) |
invalidParams in ProblemDetails |
PCF log | http2, json |
Fix the JSON generated by the AF |
| Create returns 403 | Requested service not authorized (subscriber / operator policy) | cause in ProblemDetails (e.g. REQUESTED_SERVICE_NOT_AUTHORIZED, to be confirmed) |
PCF log | http2 |
Check the PCF policy configuration |
| Create returns 5xx (binding failure) | AF sent to a PCF that is not serving the session, UE IP / DNN mismatch, PDU Session not established or already released | cause (e.g. PDU_SESSION_NOT_AVAILABLE, to be confirmed), BSF binding |
PCF / BSF logs | http2 |
Check registration and discovery in BSF / PCF Binding |
| 201 but no N7 UpdateNotify | PCF bound the request to the session but judged no change necessary, PCF internal error | PCF decision log | PCF log | http2 |
Check the PCF policy and decision contents (implementation-dependent) |
| UpdateNotify sent but no new QFI | Binding parameters (5QI / ARP etc.) are the same as an existing flow, so it was bound to the existing QoS Flow (may be normal behaviour) | 5QI / ARP of the PCC Rule versus the existing flow | SMF log | json, pfcp |
Judge whether this is expected. If a separate flow is needed, revisit the PCF QoS decision |
| QoS Flow addition fails midway | Rejected by gNB admission control, UE rejects the Modification Command, UE unreachable | Failed list and Cause in the NGAP Modify Response, 5GSM Cause | gNB / AMF / SMF logs | ngap, nas-5gs |
Check radio resources and UE capability. The AF should subscribe to FAILED_RESOURCES_ALLOCATION |
| Traffic does not match the PDR | Mismatch between the SDP addresses / ports and actual traffic (NAT, media relay, port change), RTCP not described, different interpretations of direction, precedence weaker than the default PDR | SDF Filter of the PDR versus the N3 5-tuple, precedence | SMF / UPF logs | pfcp, gtp |
Compare the SDF Filter with actual traffic side by side (below) |
| QoS Flow remains after the call ends | AF does not send Delete, Delete missed after terminate | Presence of N5 delete | AF / PCF logs | http2 |
Check the AF's session termination handling |
AF request does not reach the PCF — from the bottom up¶
1. Is the AF sending the request? (AF log, capture on the sending side)
2. Is the destination PCF correct? (BSF Discovery 200 / 204, SCP routing, local configuration)
3. Are TCP / TLS established? (TLS alert, certificates)
4. Does it arrive as HTTP/2? (is :path /npcf-policyauthorization/v1/app-sessions, API version)
5. What does the PCF respond? (201 / 400 / 403 / 404 / 5xx and ProblemDetails)
The PCF succeeds but no QoS Flow is created¶
What to look at after 201 Created is the N7 UpdateNotify.
AF ──201──► success ← do not relax here
PCF ──UpdateNotify──► SMF ← was it sent? are the PCC Rule's 5QI, ARP and flowInfos as expected?
SMF ──► N2 / N1 / N4 ← was a new QFI assigned, or was it bound to an existing flow?
SMF ──Update(ruleReports)──► PCF ← has a failure report arrived?
PCF ──Notify──► AF ← has FAILED_RESOURCES_ALLOCATION arrived?
Traffic does not match the PDR — build a comparison table¶
| Item | AF Flow Description | PDR SDF Filter (N4) | Actual traffic on N3 | Verdict |
|---|---|---|---|---|
| UE address / port | 10.45.0.2 : 50000 | 10.45.0.2 : 50000 | 10.45.0.2 : 50000 | OK |
| Peer address / port | 198.51.100.20 : 40000 | 198.51.100.20 : 40000 | 198.51.100.30 : 40000 | NG (actual address of the media relay differs) |
| Protocol | 17 | 17 | UDP | OK |
| RTCP | described | PDR exists | 40001 / 50001 | OK |
| Precedence | — | 50 | default PDR is 255 | OK (lower value wins) |
| UL QFI | — | expects QFI 2 | arrives with QFI 1 | NG (UE QoS Rule not applied, or classification mismatch on the UE side) |
(Values are fictitious. Capture required.) In UL, the UE marks the QFI according to the packet filters of the QoS Rule. If the UL PDR also uses the QFI as a condition, a misclassification on the UE side means the packet will not match the UPF's PDR. For details of PDR matching rules see PDR / PDI / SDF Filter.
Boundary between 3GPP specifications and vendor implementations¶
| Defined by 3GPP | Decided by the vendor / operations |
|---|---|
| Resources, operations and data types of Npcf_PolicyAuthorization (TS 29.514) | PCF policy engine, how rules are written, DB / cache structure |
| The concepts of session binding, PCC rule authorization and QoS Flow binding (TS 23.503) | Whether PCC Rules are created per Media Component or per Sub-Component |
| Standard mapping from media information to QoS (TS 29.513) | Final operator policy for 5QI / ARP / bitrates |
| BSF binding and discovery (TS 29.521) | Which method the AF uses to find the PCF (BSF / SCP / local configuration) |
| Procedures for applying changes to N1 / N2 / N4 (TS 23.502 §4.3.3.2) | Update order of N4 and N2, pod / microservice structure, CLI |
| Trusted AFs directly, others via the NEF (TS 23.501 §6.2.10) | Which AFs are regarded as trusted (operator decision) |
Comparison with EPC (4G)¶
N5 is the SBI version of 4G Rx (AF ⇔ PCRF, Diameter, TS 29.214).
| 4G Rx (Diameter) | 5G N5 (Npcf_PolicyAuthorization) |
|---|---|
| AAR / AAA (initial) | Create: POST /app-sessions → 201 |
| AAR / AAA (modification) | Update: PATCH /app-sessions/{appSessionId} |
| STR / STA | Delete: POST /app-sessions/{appSessionId}/delete |
| RAR / RAA (PCRF → AF notification) | Notify: POST {notifUri}/notify |
| ASR / ASA (PCRF → AF termination request) | Notify (termination request): POST {notifUri}/terminate → AF sends Delete |
| Specific-Action AVP (in AAR) | Subscribe (evSubsc / events-subscription) |
| Media-Component-Description / Media-Sub-Component AVP | medComponents / medSubComps |
| Flow-Description AVP | fDescs (the same IPFilterRule format) |
| Gx (PCRF → PCEF) | N7 (PCF → SMF) |
| Dedicated bearer (TFT) | Dedicated QoS Flow (QoS Rule / QFI) |
| PCRF binding by the DRA | PCF binding by the BSF |
(The mapping is this chapter's own organization. Rx AVP definitions are in TS 29.214 §5.3 and Diameter commands in §5.6 (to be confirmed).)
Configurations that use Rx even in the 5GC
In early VoNR deployments and elsewhere, there are configurations in which the P-CSCF connects to the 5GC PCF while still using Diameter Rx. Rx support on the PCF has related provisions in TS 23.503 / TS 29.214 / TS 29.513 (clause numbers to be confirmed). In this case, the BSF in front of the PCF may resolve the serving PCF as a Diameter proxy / redirect (BSF / PCF Binding). If you cannot find HTTP/2 N5 in a trace, also check Diameter (diameter).
3GPP Specification¶
| Specification | Clause | Content |
|---|---|---|
| TS 23.501 | §6.2.10 | AF (trusted AFs directly, others via the NEF) |
| TS 23.501 | §4.2.7 | Reference points (N5 etc., to be confirmed) |
| TS 23.502 | §5.2.5.3 | Npcf_PolicyAuthorization service (Stage 2, to be confirmed) |
| TS 23.502 | §4.16.5.2 | PCF-initiated SM Policy Association Modification (to be confirmed) |
| TS 23.502 | §4.3.3.2 | UE or network requested PDU Session Modification (step numbers to be confirmed) |
| TS 23.502 | §4.2.3.3 | Network Triggered Service Request |
| TS 23.503 | §6.1.3.2 | Binding mechanism (session binding / PCC rule authorization / QoS Flow binding; sub-clause numbers to be confirmed) |
| TS 23.503 | §6.1.1.2 | PCF discovery using the BSF (to be confirmed) |
| TS 29.514 | §4.2.2–§4.2.7 | Create / Update / Delete / Notify / Subscribe / Unsubscribe (sub-clause numbers to be confirmed) |
| TS 29.514 | §5.3 / §5.6 | Resource definitions / data model (AppSessionContext, MediaComponent, etc., to be confirmed) |
| TS 29.513 | §7.2 / §7.3 | QoS parameter mapping (AF side / PCF side, to be confirmed) |
| TS 29.512 | §4.2.3 / §4.2.4 / §5.6.2 | UpdateNotify / Update / data types such as SmPolicyDecision (to be confirmed) |
| TS 29.521 | §4.2.4 | Nbsf_Management_Discovery |
| TS 29.212 | §5.4.2 | Flow-Description AVP (encoding reference for the N5 Flow Description, to be confirmed) |
| TS 29.214 | §5.3.8 | Rx Flow-Description AVP (original definition, to be confirmed) |
| TS 24.501 | §6.3.2 / §9.11.4.13 | Network-requested PDU session modification / QoS rules (to be confirmed) |
| TS 38.413 | §8.2.3 / §9.3.1.12 | PDU Session Resource Modify / QoS Flow Level QoS Parameters (to be confirmed) |
| TS 29.244 | §7.5.4 / §8.2.5 | PFCP Session Modification / SDF Filter (to be confirmed) |
| TS 33.501 | §13.1 | TLS for SBI (to be confirmed) |
Summary¶
- N5 = Npcf_PolicyAuthorization (TS 29.514). The AF is the consumer and the PCF the producer. Only Notify is a PCF → AF callback
- The AF creates an Application Session Context (
app-sessions/{appSessionId}) on the PCF and manages it with Update (PATCH), Delete (POST.../delete) and Subscribe (PUTevents-subscription) - What the AF passes is the application's language: Media Component / Flow Description / bandwidth. The PCF ties it to a PDU Session by Session Binding, translates it into a PCC Rule, and passes it to the SMF with an N7 UpdateNotify
- Whether to create a new QoS Flow is decided by the SMF's QoS Flow binding. The SMF expands it into N1 (QoS Rule), N2 (QoS Flow) and N4 (PDR / QER)
- In multi-PCF deployments, the AF must reach the serving PCF → BSF. External AFs go via the NEF
201 Createddoes not mean QoS has been applied. Follow it through UpdateNotify → N2 / N1 / N4 → actual traffic on N3 → Notify
Comprehension check¶
Q1. An AF requested a specific QoS for an application's traffic. Which flow is correct? A. The AF creates a QER directly on the UPF via PFCP / B. Policy is passed AF → PCF → SMF, and the SMF configures the necessary PDR / QER etc. on the UPF over N4 / C. The AF sends NGAP directly to the gNB, and the gNB notifies the UPF of the QER / D. The AF directly rewrites the QFI in the N3 GTP-U header
Answer: B. The AF only makes a request to the PCF over N5 (Npcf_PolicyAuthorization) and cannot configure the UE, gNB or UPF directly. The PCF creates a PCC Rule and passes it to the SMF over N7, and the SMF expands it into N4 (PDR / QER), N2 (QoS Flow) and N1 (QoS Rule) (TS 23.502 §4.16.5.2 / §4.3.3.2). The controlling side of PFCP is the SMF (A is wrong), the NGAP peer is the AMF (C is wrong), and the QFI is marked by the UPF in DL and by the UE / gNB side in UL (D is wrong).
Q2. The PCF returned 201 Created to the P-CSCF's Create, and an N7 UpdateNotify was also sent. However, no new QFI has been assigned. The PCC Rule's 5QI and ARP were the same as those of the existing default QoS Flow. What is happening?
Through the SMF's QoS Flow binding, the PCC Rule, whose binding parameters (5QI / ARP etc.) are the same, is likely to have been bound to the existing QoS Flow (TS 23.503 §6.1.3.2.4, to be confirmed). It is the SMF, not the PCF, that decides whether to create a new QoS Flow. If a dedicated QoS Flow is needed for voice, check whether the PCF's QoS decision (e.g. 5QI=1, GBR) is as expected.
Q3. In a network with three PCFs, the AF's Create was rejected with 5xx (cause: PDU_SESSION_NOT_AVAILABLE). What are the likely causes and where should you check?
The AF may have tried to create the App Session on a PCF that does not hold the SM Policy Association for that UE. The PCF cannot perform Session Binding using the UE IP, DNN etc. and rejects it (cause name and status code to be confirmed in TS 29.514). Check the path by which the AF finds the serving PCF (Nbsf_Management_Discovery to the BSF, SCP, local configuration) and whether the serving PCF has registered its binding with the BSF (BSF / PCF Binding). Also suspect a UE IP mismatch or an already released PDU Session.
Q4. Which N5 operations correspond to the 4G Rx AAR (initial), STR and RAR respectively?
AAR (initial) → Create (POST /app-sessions), STR → Delete (POST /app-sessions/{appSessionId}/delete), RAR → Notify (PCF → AF POST {notifUri}/notify). A modification by AAR corresponds to Update (PATCH), and ASR corresponds to a terminate notification, after which the AF sends Delete.
Next Step¶
- How an external AF creates the same App Session via the NEF → NEF / N33 / Event Exposure
- How the AF finds the serving PCF → BSF / PCF Binding / SBI Communication Model
- Details of how a PCC Rule is translated into N1 / N2 / N4 → PCF / SM Policy Association / PCC Rule / N7 SBI Analysis
- SDF Filter and PDR matching → PDR / PDI / SDF Filter / QoS Flow / QFI / 5QI
- A representative example with the P-CSCF as the AF → VoNR / PDU Session Modification
- Overview pages → AF / N5 / Policy