QoS & Bearer Management
Overview
The PGW-C implements a policy-driven bearer and QoS management system that coordinates three key interfaces:
- Gx (Diameter) - Receives policy decisions and QoS parameters from PCRF
- S5/S8 (GTP-C) - Manages bearer contexts with SGW-C
- Sxb (PFCP) - Programs QoS enforcement rules into PGW-U
Architecture Flow
Key Concepts
- Session: Contains UE information, bearer map, PDR/FAR/QER/BAR maps, and AMBR
- Bearer Context: Links EBI (EPS Bearer ID) to specific PDRs, FARs, and QERs
- QER (QoS Enforcement Rule): Enforces MBR/GBR limits and gate status in the user plane
- Default Bearer: Always created with PDN session, provides basic connectivity
- Dedicated Bearer: Created dynamically based on PCRF policy, provides specific QoS guarantees
Configuration
Important: Dynamic QoS Policy
All QoS parameters are dynamically received from the PCRF via Diameter Gx interface and defined in the PCRF (See OmniHSS for more info).
Operators configure the PCRF connection in config/runtime.exs:
config :pgw_c,
diameter: %{
listen_ip: "0.0.0.0",
host: "omni-pgw_c.epc.mnc999.mcc999.3gppnetwork.org",
realm: "epc.mnc999.mcc999.3gppnetwork.org",
peer_list: [
%{
host: "pcrf.epc.mnc999.mcc999.3gppnetwork.org",
realm: "epc.mnc999.mcc999.3gppnetwork.org",
ip: "192.168.1.100",
initiate_connection: true
}
]
}
QoS policies, charging rules, and bandwidth limits are configured on the PCRF, not in PGW-C configuration files.
Bearer Lifecycle
Default Bearer Creation
The default bearer is created during PDN session establishment:
Workflow:
- SGW-C sends Create Session Request
- PGW-C allocates UE IP address from configured pool
- PGW-C sends CCR-Initial to PCRF with IMSI, APN, IP address
- PCRF responds with CCA-Initial containing QoS parameters:
- Default-EPS-Bearer-QoS (QCI, ARP)
- QoS-Information (AMBR adjustments)
- PGW-C creates bearer context with:
- Fixed IDs: Downlink PDR=1, Uplink PDR=2, Downlink FAR=1, Uplink FAR=2, QER=1, BAR=1
- QER programmed with MBR from bearer QoS
- PGW-C sends PFCP Session Establishment Request to PGW-U
- PGW-C sends Create Session Response to SGW-C
Default bearer characteristics:
- Always exists for the lifetime of the PDN session
- Typically uses QCI 5 or QCI 9 (non-GBR)
- EBI tracked in session state
- Cannot be deleted independently (deleting it terminates the session)
Dedicated Bearer Creation
Dedicated bearers are created dynamically based on PCRF policy:
Trigger: Re-Auth Request (RAR) from PCRF with Charging-Rule-Install
Workflow:
- PCRF sends RAR with Charging-Rule-Definition containing:
- Charging-Rule-Name (policy rule identifier)
- Flow-Information (packet filters)
- QoS-Information (QCI, MBR, GBR, ARP)
- Precedence (rule matching priority)
- PGW-C translates dynamic rule to PFCP entities:
- Each Flow-Information entry → new PDR with SDF Filter
- QoS-Information → new QER with MBR/GBR enforcement
- Flow-Description → IP 5-tuple matching rules
- PGW-C sends PFCP Session Modification Request to add PDRs/FARs/QERs
- PGW-C initiates Create Bearer Request to SGW-C
- SGW-C responds with Create Bearer Response confirming establishment
Example Charging-Rule-Definition:
Charging-Rule-Name: "video_streaming"
Flow-Information:
- Flow-Description: "permit in ip from any to 10.0.0.1 5000-6000"
Flow-Direction: 1 (downlink)
QoS-Information:
QoS-Class-Identifier: 7
Max-Requested-Bandwidth-UL: 5000000 (5 Mbps)
Max-Requested-Bandwidth-DL: 10000000 (10 Mbps)
Guaranteed-Bitrate-UL: 1000000 (1 Mbps)
Guaranteed-Bitrate-DL: 2000000 (2 Mbps)
Precedence: 100
Flow-Status: 2 (ENABLED)
Bearer Modification
Bearer QoS can be modified via:
- Gx RAR with updated Charging-Rule-Definition
- PFCP Session Modification to update existing QERs (change bitrates), FARs (change forwarding), or PDRs (change packet filters)
Bearer Deletion
Triggers:
- Delete Session Request (SGW-initiated) - Deletes default bearer and terminates session
- Re-Auth Request with Charging-Rule-Remove (PCRF-initiated) - Deletes dedicated bearer
Workflow:
- Remove bearer from session state
- Remove associated PDRs/FARs/QERs
- Send Delete Bearer Request to SGW-C (if PCRF-initiated)
- Send PFCP Session Modification (remove rules) or Session Deletion (if default bearer)
QoS Parameters
QCI (QoS Class Identifier)
Source: PCRF via Gx QoS-Class-Identifier AVP
Standard Values:
- QCI 1: Conversational Voice (GBR, 100ms delay budget)
- QCI 2: Conversational Video (GBR, 150ms delay budget)
- QCI 3: Real Time Gaming (GBR, 50ms delay budget)
- QCI 4: Non-Conversational Video (GBR, 300ms delay budget)
- QCI 5: IMS Signaling (non-GBR, 100ms delay budget) - Default for default bearer
- QCI 6: Video (TCP-based), Live Streaming (non-GBR, 300ms delay budget)
- QCI 7: Voice, Interactive Gaming (non-GBR, 100ms delay budget)
- QCI 8: Video (TCP-based), e.g., YouTube (non-GBR, 300ms delay budget)
- QCI 9: Default Internet (non-GBR, 300ms delay budget)
Operator Note:
- QCI is received from PCRF and signaled to SGW-C in Bearer-Level-QoS IE
- PGW-C does not directly enforce QCI behavior - actual enforcement is via MBR/GBR in QERs
- Lower QCI values typically indicate higher priority
- QCI determines packet forwarding treatment and scheduling priority
ARP (Allocation and Retention Priority)
Source: PCRF via Allocation-Retention-Priority grouped AVP
Components:
- Priority-Level: 1 (highest priority) to 15 (lowest priority)
- Pre-emption-Capability: Can this bearer pre-empt lower-priority bearers?
- 0 = ENABLED (can pre-empt others)
- 1 = DISABLED (cannot pre-empt)
- Pre-emption-Vulnerability: Can this bearer be pre-empted by higher-priority bearers?
- 0 = ENABLED (can be pre-empted)
- 1 = DISABLED (cannot be pre-empted)
Default Values:
- Priority-Level: 1
- Pre-emption-Capability: ENABLED (0)
- Pre-emption-Vulnerability: DISABLED (1)
Operator Note:
- ARP is signaled to SGW-C and ultimately to eNodeB
- Not enforced by PGW-C - enforcement is typically at eNodeB during radio admission control
- Used during network congestion to determine which bearers to admit or drop
- Critical for emergency services (priority-level 1) and high-value services
MBR (Maximum Bit Rate)
Source: PCRF via Max-Requested-Bandwidth-UL and Max-Requested-Bandwidth-DL AVPs
Format: Bytes per second (converted to kbps internally: bytes / 1000)
Applied to: All bearers (default and dedicated)
How it works:
- PGW-C creates QER with
mbr: %Bitrate{ul: kbps_ul, dl: kbps_dl} - QER sent to PGW-U via PFCP
- PGW-U enforces rate limiting (traffic policing)
- Excess traffic above MBR is dropped
Example:
Max-Requested-Bandwidth-UL: 5000000 (5 Mbps)
Max-Requested-Bandwidth-DL: 10000000 (10 Mbps)
→ QER created with mbr: {ul: 5000, dl: 10000} kbps
→ PGW-U drops uplink packets exceeding 5 Mbps
→ PGW-U drops downlink packets exceeding 10 Mbps
GBR (Guaranteed Bit Rate)
Source: PCRF via Guaranteed-Bitrate-UL and Guaranteed-Bitrate-DL AVPs
Format: Bytes per second (converted to kbps)
Applied to: Dedicated bearers only (GBR bearers)
How it works:
- If GBR is specified in Charging-Rule-Definition, bearer is GBR type
- PGW-U enforces minimum bitrate guarantee via QER
- Requires proper scheduling at eNodeB to reserve radio resources
- GBR bearers have admission control - can be rejected if resources unavailable
Example:
Guaranteed-Bitrate-UL: 1000000 (1 Mbps)
Guaranteed-Bitrate-DL: 2000000 (2 Mbps)
→ QER created with gbr: {ul: 1000, dl: 2000} kbps
→ Network guarantees at least 1 Mbps uplink and 2 Mbps downlink
→ Used for VoIP, video calls, live streaming
Operator Note:
- GBR requires sufficient network capacity planning
- Oversubscribing GBR resources leads to admission failures
- Monitor GBR usage via session counts and bearer metrics
AMBR (Aggregate Maximum Bit Rate)
Source: PCRF via APN-Aggregate-Max-Bitrate-UL and APN-Aggregate-Max-Bitrate-DL AVPs
Scope: Applies to all non-GBR bearers for the APN (not per-bearer)
How it works:
- AMBR is an aggregate limit across all non-GBR bearers in a session
- Sent to SGW-C in Create Session Response
- Enforcement typically at eNodeB/SGW
- PGW-C stores AMBR in session state and signals it to SGW-C
Example:
APN-Aggregate-Max-Bitrate-UL: 50000000 (50 Mbps)
APN-Aggregate-Max-Bitrate-DL: 100000000 (100 Mbps)
→ All non-GBR bearers combined cannot exceed 50 Mbps uplink / 100 Mbps downlink
→ Individual bearers limited by their own MBR
→ AMBR provides additional overall cap per UE/APN
Operator Note:
- Set via subscriber profile in HSS/PCRF
- Used to enforce subscription tiers (e.g., 10 Mbps plan vs 100 Mbps plan)
- Does not affect GBR bearers
Flow Status and Gating
Flow Status (Gx) to Gate Status (PFCP) Mapping
The PCRF controls whether traffic is allowed via the Flow-Status AVP in Charging-Rule-Definition:
| Flow-Status (Gx) | Gate-Status (PFCP QER) | Meaning |
|---|---|---|
| 0 = ENABLED-UPLINK | ul: OPEN, dl: CLOSED | Only uplink traffic allowed |
| 1 = ENABLED-DOWNLINK | ul: CLOSED, dl: OPEN | Only downlink traffic allowed |
| 2 = ENABLED | ul: OPEN, dl: OPEN | Both directions allowed |
| 3 = DISABLED | ul: CLOSED, dl: CLOSED | No traffic allowed |
| 4 = REMOVED | ul: CLOSED, dl: CLOSED | Bearer being deleted |
Use cases:
- DISABLED: Used for parked services or credit exhaustion (packets dropped but bearer retained)
- ENABLED-UPLINK: Unusual, but could be used for upload-only services
- ENABLED-DOWNLINK: Download-only services or credit-limited scenarios
- ENABLED: Normal operation
Monitoring & Observability
Prometheus Metrics
Session-level metrics:
session_registry_count # Active bearers (IMSI, EBI pairs)
address_registry_count # Allocated UE IPs
charging_id_registry_count # Active charging sessions
Gx interface metrics:
gx_inbound_messages_total{message_type="gx_RAR"} # Policy updates from PCRF
gx_outbound_messages_total{message_type="gx_CCR"} # Policy requests to PCRF
gx_outbound_transaction_duration_bucket # Latency to PCRF
PFCP interface metrics:
sxb_outbound_messages_total{message_type="pfcp_session_establishment_request"}
sxb_outbound_messages_total{message_type="pfcp_session_modification_request"}
sxb_outbound_transaction_duration_bucket
Bearer creation metrics:
s5s8_inbound_messages_total{message_type="create_session_request"} # Default bearers
s5s8_outbound_messages_total{message_type="create_bearer_request"} # Dedicated bearers
Web UI Monitoring
PGW Sessions Page (/pgw_sessions):
- Search by IMSI, IP address, MSISDN, or APN
- View active bearers per session
- Inspect bearer QoS parameters (QCI, MBR, GBR, AMBR)
- Real-time auto-refresh (2 seconds)
Diameter Page (/diameter):
- PCRF peer connectivity status
- Gx session count
- Peer state (connected/disconnected)
Logs Page (/logs):
- Real-time log streaming
- Filter by "Credit Control" for CCR/CCA exchanges
- Filter by "Re-Auth" for RAR events (policy changes)
- Filter by "PFCP" for user plane programming events
Key Log Messages
[debug] Sending Credit Control Request: ... # CCR to PCRF
[debug] Handling Credit Control Answer: ... # CCA from PCRF (contains QoS)
[debug] Handling Re-Auth Request # RAR from PCRF (policy change)
[debug] Sending Session Establishment Request # PFCP to PGW-U (program QERs)
[debug] Sending Session Modification Request # PFCP to PGW-U (update QERs)
Operational Tasks
Verify QoS Applied to Session
- Access Web UI → PGW Sessions page
- Search for IMSI (e.g.,
999000123456789) - Expand session details
- Check qer_map section:
qer_id: 1
gate_status: {ul: OPEN, dl: OPEN}
mbr: {ul: 50000, dl: 100000} # kbps
gbr: {ul: 10000, dl: 20000} # kbps (or nil for non-GBR) - Verify values match expected PCRF policy
Troubleshoot Missing QoS
Symptom: Session created but QoS not applied
Steps:
-
Check PCRF connectivity:
- Access Web UI → Diameter page
- Verify PCRF peer status = "connected"
- If disconnected, check network connectivity and Diameter configuration
-
Verify CCR/CCA exchange:
- Access Web UI → Logs page
- Search for "Credit Control Answer"
- Verify
QoS-InformationAVP present in CCA log - Check for errors in CCA (Result-Code should be 2001 = SUCCESS)
-
Verify PFCP programming:
- Search logs for "PFCP Session Establishment Request"
- Verify QER included in message
- Check PGW-U logs for PFCP processing errors
-
Check PCRF policy configuration:
- Verify subscriber profile in PCRF
- Confirm APN-specific policy rules exist
- Check PCRF logs for policy evaluation errors
Monitor Bearer Creation Rate
Prometheus queries:
# Default bearer creation rate (sessions/second)
rate(s5s8_inbound_messages_total{message_type="create_session_request"}[5m])
# Dedicated bearer creation rate
rate(s5s8_outbound_messages_total{message_type="create_bearer_request"}[5m])
# Policy update rate from PCRF
rate(gx_inbound_messages_total{message_type="gx_RAR"}[5m])
Capacity Planning
Key metrics to monitor:
# UE IP address utilization (percentage)
(address_registry_count / <configured_pool_size>) * 100
# Active bearer count
session_registry_count
# PCRF query latency (P95)
histogram_quantile(0.95, gx_outbound_transaction_duration_bucket)
Capacity limits:
- Address pool size: configured in
config/runtime.exsunderue.subnet_map - TEID space: 32-bit (4 billion unique identifiers, auto-managed)
- Concurrent sessions: typically limited by address pool size
Planning guidelines:
- Monitor IP address utilization - scale pool before exceeding 80%
- Monitor PCRF latency - high latency impacts session setup time
- Monitor dedicated bearer creation rate - indicates policy complexity
Related Documentation
- Session Management - PDN session lifecycle
- Diameter Gx Interface - PCRF policy protocol details
- PFCP Interface - User plane programming
- Configuration Guide - System configuration
- Monitoring Guide - Metrics and observability