A subscriber uses up the data included in a plan. The connection does not drop. Pages still load, only slowly, or only the operator's top-up page opens. Behind that behavior is a fair usage policy (FUP) and three network functions that share the job of deciding what "out of quota" means.
The term is used in different ways, so here is the meaning used below: a rule in the service terms that lowers speed or priority once a volume threshold is used up, while the session stays up. One operator's published terms (an edition from 2017) say that for plans with capped speed, after the monthly limit the speed is reduced to not less than 128 kbps until the first day of the next bill cycle. Another operator's page for one family package does not use the term FUP but follows the same pattern: after the package is used the speed drops to 64 kbps (the operator's own services and messengers stay unlimited), and the package renews every 30 days. The first resets on the calendar of the bill cycle, the second on the package's own 30-day clock.
Two things matter to an engineer here: what happens to the session at the limit, and what brings the speed back.
Who counts, who decides, who enforces
The Policy and Charging Enforcement Function (PCEF) handles the user traffic, applies rules to it and measures usage. The Policy and Charging Rules Function (PCRF) makes the policy decision. The Online Charging System (OCS) keeps subscriber balances and service volumes. Four interfaces tie them together, and one of them leads to the Offline Charging System (OFCS):
| Interface | Between | What it carries |
|---|---|---|
| Gx | PCEF and PCRF | Policy and charging control (PCC) rules and quality of service (QoS) settings from the PCRF; events and usage reports from the PCEF. Diameter |
| Gy | PCEF and OCS | Online credit control: quota grants and usage reports. Diameter |
| Sy | PCRF and OCS | Policy counter statuses, from the OCS to the PCRF. Diameter |
| Gz | PCEF and OFCS | Offline charging over Gz |
Gz belongs to offline charging and stays out of the rest of this article.
How the quota is handed out
Online charging works on credit, in portions. The OCS grants the PCEF a quota, and the PCEF counts traffic against it. When the granted units are spent or the Validity-Time (the time the grant stays valid) expires, the PCEF must send a new Credit-Control-Request to the OCS. That request reports how much was used, and the server deducts it and may reserve the next portion. RFC 4006 expects the client to ask well in advance of the end of the grant, to avoid an interruption of the service. 3GPP adds an optional threshold: the OCS sends it with the grant, and the client asks for a new quota when what is left falls below it, while traffic keeps flowing until the original quota is consumed.
"Credit" does not have to mean money: TS 23.203 calls it an abstract measure of resources available to the user. Credit is managed per charging key, so a service that gets a key of its own gets a quota of its own.
Gx and Gy follow the Diameter protocol. Gy uses the Diameter Credit-Control application: RFC 4006, since updated by RFC 8506.
The quota is used up
The OCS can see this moment coming. With the last portion it can send a Final-Unit-Indication (FUI): this is the final grant, and here is what to do when it is gone. RFC 4006 defines three actions. TERMINATE ends the service session. REDIRECT sends the subscriber to a given address, for example a top-up portal. RESTRICT_ACCESS lets through only traffic that matches given filters and drops the rest. The 3GPP online charging specifications list TERMINATE and REDIRECT. TS 23.203 also lists pass-through, drop, a default action that the operator preconfigures on the PCEF, and redirect. So reaching the limit does not have to mean a block.
In our PCEF deployments, what follows depends on whether the operator has the Sy interface between the OCS and the PCRF.
With Sy. The PCRF subscribes to policy counter reports from the OCS while it has an active session of the subscriber. When the status of a counter changes, the OCS reports it in a Spending-Status-Notification-Request. The status is a label whose values the standard does not define; the OCS and the PCRF agree on them. The PCRF takes the status as input to its policy decision, for example to downgrade the QoS or to modify PCC rules. The standard fixes the channel and the input, and leaves the action to the operator. To change the speed at the PCEF, the PCRF has the Gx tools. A Re-Auth-Request can carry rules and QoS information. The QoS information holds a maximum bit rate for a rule or a bearer, or an APN aggregate maximum bit rate (APN-AMBR) for the non-GBR traffic of the access point. The standard does not say that a Sy notification is always followed by such a request.
Without Sy. In our PCEF, part of Stingray Service Gateway, the PCRF gets no counter statuses from the OCS, and the PCEF acts on what the OCS sends over Gy. A grant that carries a FUI, or a Result-Code 4012 (DIAMETER_CREDIT_LIMIT_REACHED), is final: once it is used up, the PCEF requests no more quota for that rating group. If the FUI action is TERMINATE, or there is no FUI, the PCEF has the DPI stop serving the traffic. For the other actions it rebuilds the subscriber’s service profiles on the DPI without asking for new credit, for example to redirect the subscriber to a top-up portal or to let through only the allowed destinations.
In the standard, without Sy the PCRF can still find out. If it set the Out of credit event trigger over Gx, the PCEF reports which rules ran out of credit and which termination action it applied.
When the quota comes back
Two common triggers restore it: a top-up and a reset at the end of the period. The way back depends on how the limit was set.
A limit set through Gy (FUI). RFC 4006 describes this for REDIRECT and RESTRICT_ACCESS. After a successful top-up the server can send a Re-Auth-Request on Gy. The PCEF answers with an update request that has no used units in it. When new units arrive, all the restrictions set for the final-unit action must be removed. Support for this request is optional for the server. Without it the PCEF learns about the new quota at its next check: when the final units are consumed, the client does an intermediate interrogation, gets no units back, and repeats it when the Validity-Time of the restricted state expires. If a quota is available by then, for example after a top-up, the service continues as usual. If not, the outcome is the operator's policy: disconnect the subscriber or leave access to services that the credit-control server does not control. Our PCEF supports both paths. On a Re-Auth-Request over Gy it answers at once: it takes the usage report from the DPI and sends a CCR-U with the reason FORCED_REAUTHORISATION. When the Validity-Time expires it does the same on its own, with the reason VALIDITY_TIME. New grants apply to the session that is already open: the DPI updates the thresholds or the set of services. After a final grant the PCEF does not request new quota itself, so with a FUI the main path is the Re-Auth-Request.
A limit set through Sy and Gx. The way back uses the same channel. By the Sy rules any change of a counter status is reported to the PCRF. A top-up or a reset that changes the status falls under the same rule. The PCRF then applies the action the operator has configured for the new status, for example lifting the speed limit.
The reset itself. The standards say least about this part. The counter lives inside the OCS: TS 29.219 points to TS 32.296 for the internal OCS functions and leaves the provisioning of counters out of scope. TS 32.296 describes OCS operations such as setting a counter to a given value, which can be used to reset counters. TS 29.219 describes no procedure for the reset itself. What it does describe is the notification, and a way to announce a change in advance: the OCS can send pending statuses with an activation time. The specification's own example is a billing period that will expire at midnight, and a pending status becomes the current status at the PCRF when that time is reached.
Put together, the standards define the pieces: the status notification, the pending status with an activation time, the new grant over Gy that lifts the final-unit restrictions, and the rules and QoS over Gx. The reset itself and the action of the PCRF are left to the OCS and the operator. The sequence described above is a reading of these pieces, not one procedure from the specifications. Our PCEF keeps no period counter of its own: it learns about a reset the same way as about a top-up, from a new grant over Gy, and applies it to the session that is already open.
Different tariffs for different traffic
The credit-control side works per charging key, and that is how different traffic gets different tariff treatment. A PCC rule has a service data flow template, which is either a list of filters or an application identifier, and a charging key. The charging key is the reference to the tariff for the flow, and several rules can share one key. On Gx and Gy the key travels as the Rating-Group AVP.
The standard puts application detection in a Traffic Detection Function (TDF) or in a PCEF enhanced with application detection and control. It does not define how applications are detected; this is left to the vendor's implementation. Our PCEF is built on our own deep packet inspection (DPI) engine, which identifies applications by more than port numbers.
In real time the chain looks like this: the PCEF detects the application, matches the flow to a PCC rule, and the charging key of the rule tells the OCS which quota to debit and which tariff to rate the traffic by. The PCRF provisions the rules over Gx and can change them in a running session with a Re-Auth-Request.
Zero-rating shows how this fits with a quota. Our PCEF recognizes a service such as a messenger or a video platform by the type of traffic. It counts that traffic in its own bucket (a rating group) and reports the bucket to billing separately, so zero-rated traffic does not reduce the main quota. The quota that runs out is the one tied to its own charging key; traffic under another key has credit of its own.
What to check on your own network
- Which counter drives the FUP, and which services or charging keys does it cover?
- Is Sy part of the design? If not, which node enforces the limit when the OCS sends a FUI?
- Which termination action is set per charging key, and what is the default action on the PCEF?
- If you redirect or restrict, do the top-up portal and the operator's own services stay reachable? The filters of REDIRECT and RESTRICT_ACCESS exist for this.
- Does the OCS send the re-authorization request after a top-up, or does the PCEF wait for Validity-Time?
- Does a session that was already open at the moment of the reset get its speed back, or only new sessions?
We build the PCEF function in Stingray Service Gateway at VAS Experts. Product details: vasexperts.com/products/pcef.
Specifications used: 3GPP TS 23.203 (V20.1.0), TS 29.212 (V20.0.0), TS 29.219 (V19.0.0), TS 32.251 (V19.0.0), TS 32.296 (V19.0.0), TS 32.299 (V19.0.0); IETF RFC 4006 and RFC 8506.
Top comments (0)