When a prepaid subscriber opens a video app, the network can't let the traffic through and sort out the bill later. Someone has to check the balance first. In a 4G/LTE core network, that job belongs to the Diameter Gy interface and the Online Charging System (OCS).

The basics
Gy sits between the PCEF, which lives inside the PGW, and the OCS. It uses the Diameter Credit Control application from RFC 4006, with message details in 3GPP TS 32.299. The OCS keeps the balance, the tariff, and any usage caps. The PGW simply enforces whatever the OCS decides.
How a session plays out
When the bearer comes up, the PGW sends a Credit-Control-Request (CCR-Initial). It includes the subscriber identity and a rating group, which tells the OCS what kind of traffic this is. The OCS looks up the account, sets aside a chunk of credit, say 5 MB, and answers with a CCA carrying the granted quota.
Once the user burns through most of that chunk, the PGW sends a CCR-Update with the usage so far and asks for more. When the session closes, a CCR-Terminate goes out and the OCS gives back anything unused. If the credit runs dry, the OCS includes a Final-Unit-Indication. The PGW then cuts the session, throttles it, or redirects the user to a recharge page.
A2P messaging
A2P messaging (OTPs, bank alerts, delivery notices) needs charging too, only the payer is usually a business rather than a person. Message centers can call the OCS over Gy or Ro to charge the sender before delivery. Volumes are heavy, so a slow or misconfigured OCS shows up quickly as delayed OTPs, and customers notice that fast.
Practical Considerations
Engineers working with Gy should watch a few points:
Timers: Tx and Tcc timeouts affect how the PGW behaves if the OCS is slow.
Failover: Configure a secondary OCS and set Credit-Control-Failure-Handling to continue, retry, or terminate.
Quota size: Small grants increase signaling load, while large grants risk overuse.
Rating groups: Correct mapping ensures the right tariff applies to each service.
Testing with real traces in Wireshark and monitoring CCR/CCA success rates helps catch problems early.
Conclusion
Diameter Gy & OCS give operators live control over charging in 4G LTE core networks. Getting the request flow, quota handling, and failure rules right is what keeps billing accurate and customers connected, whether the traffic is mobile data or A2P messaging. At Comcode Tech, we work with these charging flows closely, and we've seen that most billing problems trace back to small configuration gaps rather than major faults. Operators who test their Gy setup early and watch CCR/CCA success rates tend to avoid the costly surprises later.
Top comments (0)