Skip to content

Session & QoS Deep Dive

All Callflows / Session and QoS sequence diagrams from Level ∞

Scope of the diagrams

These sequence diagrams and their surrounding explanations and caveats are reproduced from the existing lessons. They include simplified and conditional examples, not every specification branch. Read the original explanations for applicability, omitted steps, implementation-dependent details, TS and clause references, and any qualifications marked as requiring verification.

pdu-session-n1n2.en

Diagram 1 — How — End-to-End Call Flow

Original explanation, assumptions and specification references

The following simplifies the main parts of TS 23.502 Clause 4.3.2.2.1 (UE-requested PDU Session Establishment, non-roaming / Local Breakout). Steps for UDM and PCF interaction, secondary authentication, Charging, etc. are omitted (step numbering varies by release, so to be confirmed).

sequenceDiagram
    participant UE
    participant gNB
    participant AMF
    participant SMF
    participant UPF
    UE->>gNB: ULInformationTransfer (NAS: UL NAS Transport [PDU Session Establishment Request], step 1)
    gNB->>AMF: Uplink NAS Transport (NAS-PDU: UL NAS Transport)
    Note over AMF: (2) SMF Selection (S-NSSAI / DNN, etc.#59; NRF may also be involved)
    AMF->>SMF: Nsmf_PDUSession_CreateSMContext<br/>POST /nsmf-pdusession/v1/sm-contexts [N1 SM container, step 3]
    Note over SMF: (4) UDM interaction (omitted)
    SMF-->>AMF: Nsmf_PDUSession_CreateSMContext response<br/>HTTP 201 Created (step 5)
    Note over SMF: PCF interaction / secondary authentication (omitted) / (8) UPF Selection / UE IP address assignment
    SMF->>UPF: PFCP Session Establishment Request (Create PDR/FAR/QER/URR, step 10)
    UPF-->>SMF: PFCP Session Establishment Response (UPF-side F-TEID, etc.)
    SMF->>AMF: Namf_Communication_N1N2MessageTransfer<br/>POST /namf-comm/v1/ue-contexts/{ueContextId}/n1-n2-messages [N1 SM: Accept, N2 SM: UPF N3 F-TEID / QoS, step 11]
    AMF-->>SMF: Namf_Communication_N1N2MessageTransfer response<br/>HTTP 200 OK
    AMF->>gNB: PDU Session Resource Setup Request (NAS-PDU: DL NAS Transport [PDU Session Establishment Accept], N2 SM information, step 12)
    gNB->>UE: RRCReconfiguration (NAS: DL NAS Transport [PDU Session Establishment Accept], step 13)
    UE-->>gNB: RRCReconfigurationComplete
    gNB->>AMF: PDU Session Resource Setup Response (N2 SM: gNB N3 F-TEID, step 14)
    Note over UE,UPF: First Uplink Data (UE → gNB → UPF#59; position in diagram after step 14, to be confirmed)
    AMF->>SMF: Nsmf_PDUSession_UpdateSMContext<br/>POST /nsmf-pdusession/v1/sm-contexts/{smContextRef}/modify [N2 SM information, step 15]
    SMF->>UPF: PFCP Session Modification Request (gNB F-TEID in DL FAR, step 16)
    UPF-->>SMF: PFCP Session Modification Response
    Note over UE,UPF: DL Data also flows from this point (UPF → gNB → UE)
    SMF-->>AMF: Nsmf_PDUSession_UpdateSMContext response<br/>HTTP 204 No Content (step 17)

This example assumes the UE is already RRC connected. For NAS relay on Uu and N2 see TS 38.331 Clause 5.7.1 / Clause 5.7.2 / Clause 5.3.5 and TS 38.413 Clause 8.6.2 / Clause 8.6.3 / Clause 8.2.1.

The Accept may reach the UE before PFCP Modification (TS 23.502 Clause 4.3.2.2.1 steps 13 → 16; step numbering to be confirmed)

PDU Session Establishment Accept (N1 SM) is passed to the AMF together with N2 SM information in step 11's N1N2MessageTransfer, and reaches the UE via the gNB in steps 12–13. The PFCP Session Modification that applies the gNB's TEID to the UPF is after that, in step 16. "The UE received Accept" does not necessarily mean "the DL path is complete."

Key points by step

Step What happens Interface / specification
1 UE wraps the 5GSM Request in UL NAS TRANSPORT and sends it N1 / TS 24.501 Clause 6.4.1.2 / Clause 8.2.10 / Clause 8.3.1
2 AMF selects the SMF (S-NSSAI, DNN, subscription information, UE location, NRF Discovery, etc.) TS 23.501 Clause 6.3.2
3 AMF → SMF creates an SM context and relays the N1 SM container N11 / TS 29.502 Clause 5.2.2.2 (to be confirmed)
8–10 SMF selects the UPF (DNN, S-NSSAI, UE location, UPF capabilities / load, Policy, etc.) and creates the N4 Session TS 23.501 Clause 6.3.3 / N4 / TS 29.244 Clause 7.5.2 / Clause 7.5.3
11 SMF → AMF passes N1 SM (Accept) and N2 SM (UPF's N3 F-TEID, QoS Flow, etc.) together N11 / TS 29.518 Clause 5.2.2.3.1 (to be confirmed)
12–14 AMF → gNB performs PDU Session Resource Setup. The gNB prepares radio resources and returns its own N3 F-TEID N2 / TS 38.413 Clause 8.2.1
15–17 N2 SM information from the gNB is returned to the SMF, which updates the UPF's DL forwarding destination N11 / TS 29.502 Clause 5.2.2.3 (to be confirmed) / N4 / TS 29.244 Clause 7.5.4 / Clause 7.5.5

The specific criteria and weighting used in AMF SMF Selection and SMF UPF Selection are operator-configuration and vendor-implementation dependent (e.g. static configuration, or use of NRF Discovery).

This chapter assumes a minimal single-UPF configuration

This chapter assumes that one UPF both terminates N3 and acts as the PDU Session Anchor (PSA, terminating N6). In configurations where multiple UPFs are inserted into one PDU Session (UL CL / Branching Point with multiple PSAs, I-UPF, etc.), the SMF creates an N4 Session per UPF, and the N3 F-TEID given to the gNB is that of the UPF terminating N3 (TS 23.501 Clause 5.6.4 / TS 23.502 Clause 4.23, to be confirmed). This is the configuration where UPF Selection inputs (UE location, topology, UPF capabilities, etc.) matter especially.


PFCP and PDR / FAR / QER / URR — How Does the UPF Classify and Forward Packets?

Diagram 1 — How — The connection between BUFF / NOCP and Paging

Original explanation, assumptions and specification references

When the N3 tunnel is released by AN Release (TS 23.502 Clause 4.2.6, to be confirmed) or by deactivation of the UP connection, the UPF has no DL destination (gNB F-TEID). In this case, the SMF can set the DL FAR to BUFF + NOCP (when buffering at the UPF; TS 23.501 Clause 5.8.3, to be confirmed).

sequenceDiagram
    participant DN
    participant UPF
    participant SMF
    participant AMF
    participant gNB
    participant UE
    Note over DN,UPF: DL packet arrives
    Note over UPF: DL PDR match → FAR: BUFF + NOCP
    UPF->>SMF: PFCP Session Report Request (Downlink Data Report)
    SMF-->>UPF: PFCP Session Report Response
    SMF->>AMF: Namf_Communication_N1N2MessageTransfer<br/>POST /namf-comm/v1/ue-contexts/{ueContextId}/n1-n2-messages
    AMF-->>SMF: Namf_Communication_N1N2MessageTransfer response<br/>HTTP 202 Accepted (ATTEMPTING_TO_REACH_UE)
    AMF->>gNB: Paging (NGAP)
    gNB->>UE: Paging (RRC)
    UE->>gNB: RRCSetupRequest
    gNB-->>UE: RRCSetup
    UE->>gNB: RRCSetupComplete (NAS: Service Request)
    gNB->>AMF: Initial UE Message (NAS-PDU: Service Request)
    AMF->>SMF: Nsmf_PDUSession_UpdateSMContext<br/>POST /nsmf-pdusession/v1/sm-contexts/{smContextRef}/modify (ACTIVATING)
    SMF-->>AMF: Nsmf_PDUSession_UpdateSMContext response<br/>HTTP 200 OK (N2 SM information)
    AMF->>gNB: Initial Context Setup Request (N2 SM information)
    gNB->>UE: RRCReconfiguration
    UE-->>gNB: RRCReconfigurationComplete
    gNB-->>AMF: Initial Context Setup Response (gNB F-TEID)
    AMF->>SMF: Nsmf_PDUSession_UpdateSMContext<br/>POST /nsmf-pdusession/v1/sm-contexts/{smContextRef}/modify (N2 SM information)
    SMF->>UPF: PFCP Session Modification Request (FAR: FORW + new Outer Header Creation)
    UPF-->>SMF: PFCP Session Modification Response
    SMF-->>AMF: Nsmf_PDUSession_UpdateSMContext response<br/>HTTP 200 OK
    UPF->>gNB: G-PDU (buffered DL packet)

Figure: A Network Triggered Service Request (TS 23.502 Clause 4.2.3.3) with UPF buffering and resources set up through Initial Context Setup. Security procedures and other details are omitted. See TS 29.244 Clause 7.5.4–Clause 7.5.5 / Clause 7.5.8–Clause 7.5.9 for PFCP and TS 29.518 Clause 5.2.2.3.1 / TS 29.502 Clause 5.2.2.3 for SBI. For buffering at the SMF, the DL FAR destination becomes the CP-function, and the DL Packets themselves are sent to the SMF over GTP-U on N4 (TS 23.501 Clause 5.8.3, to be confirmed).

  • There are two buffering approaches: at the UPF and at the SMF. The SMF decides which to use (TS 23.501 Clause 5.8.3, to be confirmed).
  • The overall procedure from DL Data arrival to Paging is TS 23.502 Clause 4.2.3.3 (Network Triggered Service Request).
  • In a Service Request (reactivation of the UP connection) or Handover, a new DL F-TEID is notified by the gNB (TS 23.502 Clause 4.2.3.2 / Clause 4.9.1, to be confirmed), so the SMF updates the FAR's Outer Header Creation using PFCP Session Modification.

In other words, at the start of Paging there is a DL PDR → FAR (BUFF + NOCP) inside the UPF.


PFCP Association / Heartbeat — Session-control Prerequisites and Liveness

Diagram 1 — Procedure — PFCP Association Setup

Original explanation, assumptions and specification references

This example precedes the SMF's first PFCP Session. Node ID and IP address are not synonymous; destination discovery or configuration is a separate prerequisite (TS 29.244 Clause 5.8.1 / Clause 6.2.6.2).

sequenceDiagram
    participant SMF
    participant UPF
    Note over SMF: Obtain UPF destination via configuration / DNS / NRF, etc.
    SMF->>UPF: PFCP Association Setup Request<br/>(Node ID, Recovery Time Stamp, CP Function Features, etc.)
    alt UPF accepts
        UPF-->>SMF: PFCP Association Setup Response<br/>(Cause=success, Node ID, Recovery Time Stamp, UP Function Features, etc.)
        Note over SMF,UPF: Association established
        opt Subsequent PDU Session processing
            SMF->>UPF: PFCP Session Establishment Request
            UPF-->>SMF: PFCP Session Establishment Response
        end
    else UPF rejects the request
        UPF-->>SMF: PFCP Association Setup Response (error cause)
        Note over SMF: Do not start session-related procedures without a successful response
    end

Step-by-step explanation

  1. Obtain the destination: Obtain the UPF address through configuration or discovery. NRF use is not mandatory in every case (TS 29.244 Clause 5.8.1).
  2. Request Association: The SMF sends Node ID and other applicable information. Recovery Time Stamp is a message IE; CP/UP Function Features are conditional IEs related to supported functionality (TS 29.244 Clause 7.4.4.1 / Clause 7.4.4.2).
  3. Check Cause: Session-related control starts after a successful response. The rejection branch shows a normal error cause; separate responses such as unsupported PFCP version handling are omitted (TS 29.244 Clause 6.2.6.2).
  4. Create sessions separately: Establishing an Association does not automatically create forwarding rules for individual PDU Sessions.

Re-association is not session restoration

Re-association for an existing Node ID includes handling of PFCP Session Retention Information and the retention outcome. Existing sessions are not always retained (TS 29.244 Clause 6.2.6.2.2). For 5GC restart detection, use Heartbeat rather than the Recovery Timestamp in Association Setup (TS 23.527 Clause 4.2).

Diagram 2 — Procedure — PFCP Heartbeat

Original explanation, assumptions and specification references

This example is initiated by the SMF. Heartbeat can also be initiated in the opposite direction, and a PFCP entity receiving a Heartbeat Request responds (TS 29.244 Clause 6.2.2).

sequenceDiagram
    participant SMF
    participant UPF
    SMF->>UPF: PFCP Heartbeat Request<br/>(SMF Recovery Time Stamp)
    alt Response received
        UPF-->>SMF: PFCP Heartbeat Response<br/>(UPF Recovery Time Stamp)
        Note over SMF: Check response availability and known Recovery Time Stamp
        opt Restart detected
            Note over SMF,UPF: Check Association re-establishment and restoration conditions
        end
    else No response
        Note over SMF: Detect failure according to retransmission and monitoring conditions
        Note over SMF,UPF: No response alone does not prove a restart
    end

Step-by-step explanation

  1. Probe the peer PFCP entity: Heartbeat checks the PFCP entity's liveness, not connectivity for each UE.
  2. Read the response and Recovery Time Stamp: Receiving a response and confirming that the peer has not restarted are separate observations. Restart detection follows TS 23.527 Clause 4.2.
  3. Investigate missing responses: Examine packet loss, the N4 path and peer state. Operational monitoring intervals and retransmission settings are implementation-dependent; no fixed values are assumed here.
  4. Follow restoration separately: Heartbeat does not restore sessions. Continue with UPF Recovery.

A Heartbeat response does not establish an Association

The specification requires a PFCP entity to be prepared to respond to Heartbeat Requests from unknown peers as well. A Heartbeat Response alone is not evidence of successful Association Setup (TS 29.244 Clause 6.2.2.2).

UPF Restart / Recovery — Restart Detection and Session Restoration

Diagram 1 — Procedure — PSA UPF Recovery

Original explanation, assumptions and specification references

This example shows the SMF performing restoration. It does not guarantee restoration of every session. Restart detection uses the Recovery Time Stamp in Heartbeat, not the timestamp in Association Setup (TS 23.527 Clause 4.2 / Clause 4.3.2).

sequenceDiagram
    participant SMF
    participant PSA as PSA UPF
    Note over PSA: UPF restarts
    SMF->>PSA: PFCP Heartbeat Request
    PSA-->>SMF: PFCP Heartbeat Response (Recovery Time Stamp)
    Note over SMF: Detect peer restart
    SMF->>PSA: PFCP Association Setup Request
    PSA-->>SMF: PFCP Association Setup Response
    opt Association re-established and SMF performs session restoration
        SMF->>PSA: PFCP Session Establishment Request<br/>(original session information, restoration indication when applicable)
        alt Requested resources can be accepted
            PSA-->>SMF: PFCP Session Establishment Response (success)
            Note over SMF,PSA: Check restoration outcome for this PFCP Session
        else Requested addresses or other resources are unavailable
            PSA-->>SMF: PFCP Session Establishment Response<br/>(restoration failure cause)
            Note over SMF: Do not treat this as success#59; check subsequent processing
        end
    end

Step-by-step explanation

  1. Detect the restart: Compare the Heartbeat Recovery Time Stamp with known information. A response timeout alone does not prove a restart.
  2. Re-establish the Association: Restore the control relationship with the peer. A successful response alone does not confirm each session's PDRs/FARs and other rules.
  3. Restore sessions individually: Where the PSA UPF allocates F-TEIDs or UE IP addresses, the SMF includes a restoration indication identifying restoration of an existing session (TS 23.527 Clause 4.3.2).
  4. Check resource acceptance: The UPF accepts SMF-specified values when possible. If requested addresses or other resources are unavailable, it returns a restoration-failure cause. Preservation of the original IP address is not unconditional.
  5. Check the extent of success: Restoration priorities follow operator policy, while restoration load control is implementation-dependent. Check actual user-plane connectivity as well as control-plane success.

Post-restart resources and Error Indication

When the PSA UPF allocates F-TEIDs or UE IP addresses, it needs a mechanism to avoid immediately reusing pre-restart values. That mechanism is implementation-dependent. The specification also suppresses GTP-U Error Indications for G-PDUs that match no PDR during a configurable period. This chapter does not assume a fixed duration (TS 23.527 Clause 4.3.2).

Diagram 2 — Procedure — Intermediate UPF Recovery

Original explanation, assumptions and specification references

This example covers an Intermediate UPF when the SMF supports reactive restoration. Rather than just renaming the node in the PSA diagram, it shows the path in which an unmatched packet triggers restoration (TS 23.527 Clause 4.3.4).

sequenceDiagram
    participant Peer as GTP-U peer (e.g. NG-RAN)
    participant IUPF as Intermediate UPF
    participant SMF
    Note over IUPF,SMF: Restart detected and Association already re-established
    SMF->>IUPF: PFCP Session Establishment Request<br/>(wildcarded PDR forwarding G-PDUs unmatched by other PDRs to SMF)
    IUPF-->>SMF: PFCP Session Establishment Response
    Peer->>IUPF: G-PDU
    IUPF->>SMF: G-PDU (unmatched packet over PFCP-u tunnel)
    Note over SMF: Check for a corresponding active session
    alt SMF has an active session
        SMF->>IUPF: PFCP Session Establishment Request<br/>(restore target session)
        IUPF-->>SMF: PFCP Session Establishment Response
    else No active session
        SMF->>IUPF: GTP-U Error Indication<br/>(addressed to the original G-PDU source)
        IUPF-->>Peer: GTP-U Error Indication (transparent forwarding)
    end
    Note over SMF: Discard the inspected G-PDU

Step-by-step explanation

  1. Check restoration-mode support: Proactive restoration is also possible. This diagram is limited to the reactive mode.
  2. Prepare forwarding for unmatched packets: The SMF configures a PFCP Session with a wildcarded PDR to forward G-PDUs unmatched by other PDRs to a unique F-TEID at the SMF.
  3. Look up the session when data arrives: The PFCP-u tunnel carries a user packet. Do not confuse it with a PFCP Heartbeat message.
  4. Restore if the session exists: If the SMF has an active session, it recreates that session's PFCP configuration. Otherwise, the path returns a GTP-U Error Indication to the original sender.
  5. Check the first packet's treatment: The SMF discards the G-PDU after the lookup. The diagram does not guarantee buffering and redelivery of that packet (TS 23.527 Clause 4.3.4).

Restoration conditions also apply to I-UPF

Where the I-UPF allocates F-TEIDs, a restoration indication is also required when requesting restoration of an existing PFCP Session. An operator-configurable period suppresses Error Indications for unmatched G-PDUs immediately after restart. Reactive restoration must account for the time needed for restart detection, Association establishment and wildcarded PDR configuration. Check the configuration rather than assuming a fixed duration (TS 23.527 Clause 4.3.4).

PDR / PDI / F-TEID / SDF Filter / Precedence — How Does the UPF Classify Packets?

Diagram 1 — The CHOOSE (CH) flag — letting the UPF allocate it

Original explanation, assumptions and specification references

Both methods are specified for the CN-side (UPF-side) tunnel information: allocation by the SMF and allocation by the UPF (TS 23.501 Clause 5.8.2.3, to be confirmed). When the UPF allocates it, the SMF sets CH=1 in the Local F-TEID of the Create PDR and sends it without the TEID or IP address (TS 29.244 Clause 8.2.3). Whether the UPF supports this method is indicated by FTUP in the UP Function Features (TS 29.244 Clause 8.2.25, to be confirmed).

sequenceDiagram
    participant SMF
    participant UPF
    participant AMF
    participant gNB
    SMF->>UPF: PFCP Session Establishment Request<br/>Create PDR (PDR ID 1, UL, QFI=1): Local F-TEID CH=1, CHID=1<br/>Create PDR (PDR ID 3, UL, QFI=2): Local F-TEID CH=1, CHID=1
    Note over UPF: Allocates TEID and IP<br/>same F-TEID for the same CHOOSE ID
    UPF-->>SMF: PFCP Session Establishment Response<br/>Created PDR (PDR ID 1): F-TEID 198.51.100.20 / 0x00000101<br/>Created PDR (PDR ID 3): F-TEID 198.51.100.20 / 0x00000101
    SMF->>AMF: Namf_Communication_N1N2MessageTransfer<br/>POST /namf-comm/v1/ue-contexts/{ueContextId}/n1-n2-messages<br/>(N2 SM: UL NG-U UP TNL Information = 198.51.100.20 / 0x00000101)
    AMF-->>SMF: Namf_Communication_N1N2MessageTransfer response<br/>HTTP 200 OK
    AMF->>gNB: NGAP PDU Session Resource Setup Request
    gNB-->>AMF: PDU Session Resource Setup Response<br/>(DL QoS Flow per TNL Information = 192.0.2.10 / 0x12345678)
    AMF->>SMF: Nsmf_PDUSession_UpdateSMContext<br/>POST /nsmf-pdusession/v1/sm-contexts/{smContextRef}/modify (N2 SM information)
    SMF->>UPF: PFCP Session Modification Request (DL FAR Outer Header Creation)
    UPF-->>SMF: PFCP Session Modification Response
    SMF-->>AMF: Nsmf_PDUSession_UpdateSMContext response<br/>HTTP 200 OK

This example shows the successful path for a UE already connected to the AMF (TS 23.502 Clause 4.3.2.2.1, TS 29.518 Clause 5.2.2.3.1, TS 29.502 Clause 5.2.2.3, TS 29.244 Clause 7.5.4–Clause 7.5.5).

  • When CH=1, the Request does not carry the TEID. The actual value is in the Created PDR of the Session Establishment Response (TS 29.244 Clause 7.5.3.2, to be confirmed).
  • Using a CHOOSE ID (CHID) lets you have the same F-TEID allocated to multiple PDRs (e.g., per-QFI UL PDRs). This matters in 5GC because multiple QoS Flows are carried over one N3 tunnel (TS 29.244 Clause 8.2.3, to be confirmed).
  • The UPF-side F-TEID reaches the gNB as the UL NG-U UP TNL Information inside the N2 SM information (PDU Session Resource Setup Request Transfer, TS 38.413 Clause 9.3.4.1, to be confirmed), and the gNB-side F-TEID comes back as the DL QoS Flow per TNL Information inside the PDU Session Resource Setup Response Transfer (TS 38.413 Clause 9.3.4.2, to be confirmed). See PDU Session Establishment Deep Dive for the whole flow.
  • From which range and with which algorithm the UPF hands out TEIDs is implementation dependent.

QoS Flow / QFI / 5QI — What Is 5G QoS Actually Bound To?

Diagram 1 — Call Flow (the part embedded in PDU Session Establishment)

Original explanation, assumptions and specification references

A QoS Flow is not created by a standalone procedure; it is established, added or modified within PDU Session Establishment (TS 23.502 Clause 4.3.2.2.1) or PDU Session Modification (TS 23.502 Clause 4.3.3.2).

sequenceDiagram
    participant UE
    participant gNB
    participant AMF
    participant SMF
    participant PCF
    participant UPF
    UE->>gNB: ULInformationTransfer (NAS: UL NAS Transport [PDU Session Establishment Request])
    gNB->>AMF: Uplink NAS Transport (NAS-PDU: UL NAS Transport)
    AMF->>SMF: Nsmf_PDUSession_CreateSMContext<br/>POST /nsmf-pdusession/v1/sm-contexts
    SMF-->>AMF: Nsmf_PDUSession_CreateSMContext response<br/>HTTP 201 Created
    opt Dynamic PCC
        SMF->>PCF: Npcf_SMPolicyControl_Create<br/>POST /npcf-smpolicycontrol/v1/sm-policies
        PCF-->>SMF: Npcf_SMPolicyControl_Create response<br/>HTTP 201 Created (PCC Rules, Session Rules)
    end
    Note over SMF: Bind PCC Rules to QoS Flows (QoS Flow binding)<br/>assign QFIs, build QoS rules / QoS profiles / QERs
    SMF->>UPF: PFCP Session Establishment Request (Create PDR / QER)
    UPF-->>SMF: PFCP Session Establishment Response
    SMF->>AMF: Namf_Communication_N1N2MessageTransfer<br/>POST /namf-comm/v1/ue-contexts/{ueContextId}/n1-n2-messages<br/>(N1: Accept + QoS rules / N2: QoS Flow Setup Request List)
    AMF-->>SMF: Namf_Communication_N1N2MessageTransfer response<br/>HTTP 200 OK
    AMF->>gNB: NGAP PDU Session Resource Setup Request
    Note over gNB: Decide QoS Flow → DRB (RAN implementation)
    gNB->>UE: RRCReconfiguration (SDAP config + NAS: DL NAS Transport [PDU Session Establishment Accept])
    UE-->>gNB: RRCReconfigurationComplete
    gNB-->>AMF: PDU Session Resource Setup Response<br/>(DL QoS Flow per TNL Information / QoS Flow Failed to Setup List)
    AMF->>SMF: Nsmf_PDUSession_UpdateSMContext<br/>POST /nsmf-pdusession/v1/sm-contexts/{smContextRef}/modify
    SMF->>UPF: PFCP Session Modification Request (gNB F-TEID into DL FAR)
    UPF-->>SMF: PFCP Session Modification Response
    SMF-->>AMF: Nsmf_PDUSession_UpdateSMContext response<br/>HTTP 204 No Content
    Note over UE,UPF: From now on, UL is classified by the UE with QoS rules, and DL gets the QER QFI from the UPF

This successful example assumes the UE is already RRC connected (TS 38.331 Clause 5.7.1 / Clause 5.7.2 / Clause 5.3.5, TS 38.413 Clause 8.6.2 / Clause 8.6.3 / Clause 8.2.1, TS 29.502 Clause 5.2.2.2–Clause 5.2.2.3, TS 29.512 Clause 4.2.2, TS 29.518 Clause 5.2.2.3.1, TS 29.244 Clause 7.5.2–Clause 7.5.5).

Signal Flow — what carries QoS Flow information

# Segment Message Main QoS Flow-related contents Defined in
1 PCF → SMF (N7) SM Policy Decision PCC Rule (QoS data: 5QI, ARP, GBR-type values, etc.), Session Rule (authorized Session-AMBR, authorized default QoS) TS 29.512 Clause 4.2.2 / Clause 5.6.2 (to be confirmed)
2 Inside the SMF — QoS Flow binding: PCC Rules with the same binding parameters (5QI, ARP, etc.) are bound to the same QoS Flow, and the QFI is decided TS 23.501 Clause 5.7.1.5 / TS 23.503 Clause 6.1.3.2.4 (to be confirmed)
3 SMF → UPF (N4) PFCP Session Establishment / Modification QFI in the PDI of the UL PDR; in the QER, Gate Status / MBR / GBR and the QFI to set in DL TS 29.244 Clause 7.5.2.2 / Clause 7.5.2.5 (to be confirmed)
4 SMF → gNB (N2, via AMF) PDU Session Resource Setup Request Transfer QoS Flow Setup Request List: QoS Flow Identifier + QoS Flow Level QoS Parameters (QoS Characteristics / ARP / GBR QoS Flow Information, etc.), PDU Session Aggregate Maximum Bit Rate TS 38.413 Clause 9.3.4.1 / Clause 9.3.1.12 (to be confirmed)
5 SMF → UE (N1, via AMF and gNB) PDU SESSION ESTABLISHMENT ACCEPT Authorized QoS rules (QFI, DQR, packet filters), Authorized QoS flow descriptions (5QI etc. per QFI), Session-AMBR TS 24.501 Clause 8.3.2 / Clause 9.11.4.12 / Clause 9.11.4.13
6 gNB → SMF (N2, via AMF) PDU Session Resource Setup Response Transfer DL QoS Flow per TNL Information (gNB F-TEID and the list of QFIs carried in that tunnel), QoS Flow Failed to Setup List (per-flow rejection with Cause) TS 38.413 Clause 9.3.4.2 (to be confirmed)

When QoS Flows are added to or modified in an existing PDU Session, N2 uses the QoS Flow Add or Modify Request List of PDU Session Resource Modify Request (TS 38.413 Clause 8.2.3), and N1 uses PDU SESSION MODIFICATION COMMAND (TS 24.501 Clause 8.3.9, to be confirmed).

The gNB can reject individual QoS Flows

Even if PDU Session Resource Setup "succeeds," if some QFIs appear in the QoS Flow Failed to Setup List of the Response Transfer, those QoS Flows were not established on the radio side. When "the PDU Session is up but only voice quality is bad," look here first. Because the UE has already received the QoS rules for those QFIs in the NAS Accept, the SMF follows up by removing the affected QoS rules / QoS Flows (TS 23.502 Clause 4.3.2.2.1, to be confirmed).

GFBR / MFBR / Session-AMBR / UE-AMBR / ARP — Bandwidth, Priority and the "Which Priority?" Problem

Diagram 1 — Call Flow (QoS decision and distribution during PDU Session Establishment)

Original explanation, assumptions and specification references

sequenceDiagram
    participant UDM
    participant AMF
    participant SMF
    participant PCF
    participant UPF
    participant gNB
    participant UE
    Note over AMF,UDM: At Registration: the AMF obtains the subscribed UE-AMBR (N8)
    SMF->>UDM: Nudm_SDM_Get<br/>GET /nudm-sdm/v2/{supi}/sm-data (SM subscription data)
    UDM-->>SMF: Nudm_SDM_Get response<br/>HTTP 200 OK (subscribed Session-AMBR, default 5QI / ARP)
    opt Dynamic PCC
        SMF->>PCF: Npcf_SMPolicyControl_Create<br/>POST /npcf-smpolicycontrol/v1/sm-policies
        PCF-->>SMF: Npcf_SMPolicyControl_Create response<br/>HTTP 201 Created (authorized Session-AMBR, default QoS, PCC Rules, QoS data)
    end
    Note over SMF: Decide 5QI / ARP / GFBR / MFBR per QoS Flow<br/>Decide the Session-AMBR
    SMF->>UPF: PFCP Session Establishment Request<br/>Create QER (Session-AMBR / MFBR / GFBR / QFI)
    UPF-->>SMF: PFCP Session Establishment Response
    SMF->>AMF: Namf_Communication_N1N2MessageTransfer<br/>POST /namf-comm/v1/ue-contexts/{ueContextId}/n1-n2-messages<br/>N2 SM (PDU Session AMBR, QoS Flow Level QoS Parameters)<br/>N1 SM (Session-AMBR, QoS rules, QoS flow descriptions)
    AMF-->>SMF: Namf_Communication_N1N2MessageTransfer response<br/>HTTP 200 OK
    AMF->>gNB: PDU Session Resource Setup Request<br/>(UE Aggregate Maximum Bit Rate if needed)
    Note over gNB: Admission decision using ARP<br/>Calculate the UE-AMBR
    gNB->>UE: RRCReconfiguration (DRB setup, NAS: DL NAS Transport [PDU Session Establishment Accept])
    UE-->>gNB: RRCReconfigurationComplete
    gNB-->>AMF: PDU Session Resource Setup Response

This successful example assumes the UE is already connected (TS 29.503 Clause 5.2.2.2.5, TS 29.512 Clause 4.2.2, TS 29.518 Clause 5.2.2.3.1, TS 29.244 Clause 7.5.2–Clause 7.5.3, TS 38.331 Clause 5.3.5).

The whole procedure is TS 23.502 Clause 4.3.2.2.1 (UE-requested PDU Session Establishment, non-roaming). For how N1 / N2 / N4 connect, see PDU Session Establishment Deep Dive. GBR Flows are often added after PDU Session establishment by PDU Session Modification (TS 23.502 Clause 4.3.3.2) (e.g. the voice Flow in VoNR). What the PCF decides and how is covered in the next chapter, PCF / SM Policy Association / PCC Rule.

Signal Flow — which IE on which segment carries each parameter

Parameter N7 (PCF→SMF, TS 29.512) N4 (SMF→UPF, TS 29.244) N2 (SMF→AMF→gNB, TS 38.413) N1 (SMF→UE, TS 24.501)
5QI 5QI in the QoS data / default QoS — (not in the QER; only the QFI) 5QI Descriptor in the QoS Flow Level QoS Parameters 5QI in the QoS flow description
ARP ARP in the QoS data / default QoS — Allocation and Retention Priority in the QoS Flow Level QoS Parameters — (not sent)
GFBR GBR (UL / DL) in the QoS data GBR in the QER Guaranteed Flow Bit Rate in the GBR QoS Flow Information GFBR in the QoS flow description
MFBR MBR (UL / DL) in the QoS data MBR in the QER Maximum Flow Bit Rate in the GBR QoS Flow Information MFBR in the QoS flow description
Session-AMBR Authorized Session-AMBR in the Session Rule MBR in the per-Session QER PDU Session Aggregate Maximum Bit Rate Session-AMBR IE
UE-AMBR — (not on N7. PCF → AMF is N15 / Npcf_AMPolicyControl, TS 29.507, to be confirmed) — UE Aggregate Maximum Bit Rate (set by the AMF) —

IE and attribute names are conceptual correspondences; exact names and structures are to be confirmed per TS version. The N7 QoS data types are defined under TS 29.512 Clause 5.6.2, and the common data types (ARP, BitRate, etc.) under TS 29.571 Clause 5 (sub-clause numbers to be confirmed).