For AI agents: this documentation is indexed for you in llms.txt, and all of it in /llms.txt. Every page is also available as markdown: append .md to its address.

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:

yaml

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.

yaml

Flow descriptions specify:

  • Action - permit or deny
  • Direction - in or out
  • 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:

yaml

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.

yaml

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.

yaml

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.

yaml

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.

yaml

Type: Unsigned32
Reference: RFC 4006Opens in a new tab, section 5.1.2

onlineEnabled

Enable online charging (immediate billing through Diameter Ro).

yaml

Values:

  • true or 1 - Online charging enabled
  • false or 0 - 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).

yaml

Values:

  • true or 1 - Offline charging enabled
  • false or 0 - 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.

yaml

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.

yaml

This is equivalent to:

yaml

Rule Bases

A rule base is a named collection of rules that can be activated together. Configure the rule base name:

yaml

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:

yaml

To also guarantee a minimum bit rate, add GBR AVPs alongside the MBR AVPs:

yaml

For rates above 4 Gbit/s, or when interoperating with systems that prefer kbit/s units, use the extended AVPs:

yaml

Redirect Information

Rules can include traffic redirection to a captive portal or content server.

yaml

Note

Redirect-Information configuration details are pending documentation (marked TBD in current documentation).

Example Configurations

Basic Data Service

yaml

This rule:

  • Matches all IP traffic
  • Measures data volume
  • Uses offline charging only
  • Has low priority (1000)

Prepaid Video Service

yaml

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

yaml

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)

yaml

This rule:

  • Has very high priority (10)
  • No charging (zero-rated)
  • Only applies to traffic from specific partner servers

Multiple Services Rule Base

yaml

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:

  1. Verify flow description syntax (RFC 6733Opens in a new tab IPFilterRule format)

  2. Check rule precedence - lower values are evaluated first:

    yaml
  3. Verify rule is activated by checking PFCP sessions

  4. 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:

  1. Verify UPF supports DPI/application detection

  2. Check UPF configuration for application identifier mapping

  3. Use classic flow-based rules as a fallback:

    yaml

Charging Not Working

Symptom: Traffic matches rule but charging records are not generated.

Possible causes:

  • onlineEnabled and offlineEnabled both false
  • ratingGroup not configured
  • Charging interface (Rf/Ro/RADIUS) not enabled

Solution:

  1. Enable at least one charging method:

    yaml
  2. Configure rating group:

    yaml
  3. Verify 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:

  1. Reorder precedence values - more specific rules should have lower precedence values (higher priority):

    yaml
  2. Use more specific flow descriptions for higher-priority rules

  3. Review all active rules to identify conflicts