PCC Rules Configuration
Overview
Policy and Charging Control (PCC) rules define how traffic flows are identified, controlled, and measured. Rules combine:
- Flow identification - Which packets the rule applies to
- QoS parameters - Quality of Service requirements
- Charging parameters - How usage is measured and charged
- Traffic control - Redirection, steering, or blocking
SMC uses PCC rules defined in the Gx AVP (Attribute-Value Pair) format from 3GPP TS 29.212. Rules are pre-configured in the SMC helm chart and can be referenced by both Diameter Gx and Npcf interfaces.
References:
- 3GPP TS 23.203 - Policy and charging control architecture
- 3GPP TS 29.212 - Gx reference point
- 3GPP TS 29.512 - Npcf_SMPolicyControl Service
Rule Configuration
Rules are defined under aaa.applicationDetection.rules in the helm chart:
Each rule is identified by a unique name (for example, premium-video) that can be referenced by policy interfaces.
Rule Types
SMC supports two types of traffic identification:
Classic Rules (Flow-Based)
Classic rules use IP filter descriptions to match traffic flows. The flow descriptions follow RFC 6733Opens in a new tab IPFilterRule format and are mapped to PFCP SDF_Filter.
Flow descriptions specify:
- Action -
permitordeny - Direction -
inorout - Protocol -
tcp,udp,icmp,ip, or protocol number - Source - IP address or
any - Destination - IP address or
assigned(user's IP) - Ports - Specific ports or port ranges (for TCP/UDP)
Common flow description patterns:
Note
Each flow description is mapped to both UPLINK and DOWNLINK directions in PFCP by default.
Application Detection Rules (ADF)
Application detection rules use the TDF-Application-Identifier AVP. The rule name becomes the application identifier that the UPF (User Plane Function) or TDF (Traffic Detection Function) must recognise.
The rule name "facebook" is sent as the TDF-Application-Identifier. The UPF must be configured to detect Facebook traffic and associate it with this identifier.
Important
Application detection rules require UPF support for deep packet inspection (DPI) or application recognition.
Rule Parameters
precedence
The order in which rules are evaluated when multiple rules match the same traffic. Lower values have higher priority.
Type: Unsigned32
Range: 0 to 4294967295
Recommendation: Use multiples of 10 to allow inserting rules between existing ones
meteringMethod
Defines what is measured for charging purposes.
Most common: 1 (VOLUME) for mobile data services
ratingGroup
Identifies the charging category for the traffic. Multiple rules can share the same rating group to aggregate usage.
Type: Unsigned32
Reference: RFC 4006Opens in a new tab, section 5.1.2
onlineEnabled
Enable online charging (immediate billing through Diameter Ro).
Values:
trueor1- Online charging enabledfalseor0- Online charging disabled
When enabled, SMC sends Credit-Control-Request messages to the OCS (Online Charging System) before allowing traffic.
offlineEnabled
Enable offline charging (delayed billing through Diameter Rf or RADIUS accounting).
Values:
trueor1- Offline charging enabledfalseor0- Offline charging disabled
When enabled, SMC generates accounting records (CDRs) that are sent to the charging system.
onlineRatingGroup
Override the ratingGroup for online charging specifically.
Use case: When online and offline charging need to be reported with different rating groups.
offlineRatingGroup
Override the ratingGroup for offline charging specifically.
permittedIPs
Automatically generate flow descriptions for specific IPv4 addresses. This creates rules matching traffic from those addresses to the user's assigned IP.
This is equivalent to:
Rule Bases
A rule base is a named collection of rules that can be activated together. Configure the rule base name:
The rule base "default-rules" contains both "rule-1" and "rule-2". Policy interfaces can activate the entire base with a single reference.
Use case: Group related rules for common activation (for example, all rules for a specific service tier).
QoS enforcement
QoS enforcement applies bandwidth limits to individual charging rules at the UPF. Two types of limit are supported:
- Maximum Bit Rate (MBR) — caps the peak bit rate for the matched traffic.
- Guaranteed Bit Rate (GBR) — reserves a minimum bit rate for the matched traffic.
When a charging rule includes a qosInformation map, SMC converts the bandwidth AVPs into a PFCP Quality Enforcement Rule (QER) and links it to all Packet Detection Rules (PDRs) for that charging rule. This allows the UPF to enforce per-rule MBR and GBR limits.
Supported AVPs
The following table lists the supported AVPs and their conversion to PFCP fields:
When both extended and non-extended AVPs for the same direction are present, the Extended-* value takes precedence.
The gate status is always OPEN — the QER enforces rate limits but does not block traffic.
Caution
Always supply both UL and DL AVPs together. The PFCP MBR IE (3GPP TS 29.244) encodes uplink and downlink maximum bitrates as two fixed 5-octet fields in a single IE. There is no mechanism to omit one direction.
3GPP TS 29.212 (sections 4b.5.1.3 and 4b.5.12) consistently pairs the two AVPs: "Only the Max-Requested-Bandwidth-UL AVP and the Max-Requested-Bandwidth-DL AVP ... shall be used." The Diameter ABNF grammar marks both as individually optional, but the specification prose makes clear they are expected as a pair. Sending only one direction violates the specification in a way the grammar cannot catch.
When a direction AVP is absent, SMC substitutes 0 kbit/s to satisfy the mandatory dual-field PFCP IE. Zero kbit/s is not a neutral or unlimited value in the PFCP specification. Most UPF implementations treat it as an instruction to suppress all traffic in that direction, causing asymmetric traffic loss.
The following limitations apply to QoS enforcement:
- MBR requires UPF support — the UPF must support PFCP QER enforcement. UPG gained support for MBR enforcement in a recent release; check the UPG release notes for the minimum required version.
- GBR requires UPF support — the UPF must support PFCP GBR enforcement. UPG does not currently support GBR enforcement; do not configure GBR AVPs when using UPG.
- No GTP negotiation — SMC uses QoS values as-is and does not feed them back into GTP Create/Update Bearer responses. The UE does not receive QoS parameters from SMC in GTP signalling.
- Extended AVPs — you can use
Extended-*AVPs without the corresponding non-extended counterpart.
Configuration
The following example configures a rule with MBR limits. SMC enforces the maximum bit rates in both uplink and downlink directions at the UPF:
To also guarantee a minimum bit rate, add GBR AVPs alongside the MBR AVPs:
For rates above 4 Gbit/s, or when interoperating with systems that prefer kbit/s units, use the extended AVPs:
Redirect Information
Rules can include traffic redirection to a captive portal or content server.
Note
Redirect-Information configuration details are pending documentation (marked TBD in current documentation).
Example Configurations
Basic Data Service
This rule:
- Matches all IP traffic
- Measures data volume
- Uses offline charging only
- Has low priority (1000)
Prepaid Video Service
This rule:
- Uses application detection (UPF identifies video traffic)
- Has high priority (50)
- Uses online charging (prepaid)
- No offline charging
Premium Service with Separate Rating Groups
This rule:
- Measures both duration and volume
- Uses both online and offline charging
- Separate rating groups for each charging type
Zero-Rated Service (Partner Traffic)
This rule:
- Has very high priority (10)
- No charging (zero-rated)
- Only applies to traffic from specific partner servers
Multiple Services Rule Base
The rule base "bronze-tier" activates both rules together for bronze-level subscribers.
Rule Activation
Rules are activated through policy interfaces:
- Diameter Gx - PCRF sends Charging-Rule-Install AVP with rule names
- Npcf - PCF sends SmPolicyDecision with pccRuleId references
For detailed activation procedures, see:
Troubleshooting
Rule Not Matched
Symptom: Traffic does not match the expected rule.
Possible causes:
- Flow description syntax error
- Precedence conflict (higher-priority rule matched first)
- Rule not activated by policy interface
Solution:
Verify flow description syntax (RFC 6733Opens in a new tab IPFilterRule format)
Check rule precedence - lower values are evaluated first:
yamlVerify rule is activated by checking PFCP sessions
Test with a very general rule:
yaml
Application Detection Not Working
Symptom: ADF-type rules do not match traffic.
Cause: UPF does not support application detection or does not recognise the application identifier.
Solution:
Verify UPF supports DPI/application detection
Check UPF configuration for application identifier mapping
Use classic flow-based rules as a fallback:
yaml
Charging Not Working
Symptom: Traffic matches rule but charging records are not generated.
Possible causes:
onlineEnabledandofflineEnabledbothfalseratingGroupnot configured- Charging interface (Rf/Ro/RADIUS) not enabled
Solution:
Enable at least one charging method:
yamlConfigure rating group:
yamlVerify charging interfaces are enabled (see Charging Configuration)
Precedence Conflicts
Symptom: Lower-priority rule is never matched.
Cause: Higher-priority rule with broader flow description matches all traffic first.
Solution:
Reorder precedence values - more specific rules should have lower precedence values (higher priority):
yamlUse more specific flow descriptions for higher-priority rules
Review all active rules to identify conflicts