Ro (Gy) Online Charging Configuration
Overview
Ro is the Diameter Credit-Control Application running over the 3GPP Gy reference point for online charging in 3GPP networks. It is specified in 3GPP TS 32.299. SMC sends Credit-Control-Request (CCR) messages to the Online Charging System (OCS), which grants quota based on subscriber credit availability.
Online charging verifies credit before allowing service delivery, making it suitable for prepaid and budget-controlled accounts.
Note
While technically named "Ro" (the Diameter application), this interface is commonly referred to as "Gy" in 3GPP terminology, which is the reference point name users typically search for.
References:
- 3GPP TS 32.299 - Diameter charging applications
- RFC 4006Opens in a new tab - Diameter Credit-Control Application
- Diameter Configuration - Diameter transport configuration
- Charging Overview - Charging concepts
Basic Configuration
Enable Ro and configure whether to use common Diameter settings:
When standalone is false, Ro uses Diameter transport settings from aaa.oss (see Diameter Configuration).
When standalone is true, configure Ro-specific settings:
Network Configuration
Ro can use common network settings or dedicated network configuration.
Using Common Network Settings
Using Separate Network Settings
Configure dedicated network settings for Ro:
Credit-Control Procedures
Ro implements three credit-control procedures:
CCR-Initial / CCA-Initial
Sent when a user session requiring online charging is established.
Purpose:
- Request initial quota from OCS
- Provide session context (IMSI, MSISDN, service details)
- Receive granted quota (volume, time, or both)
OCS response (CCA-Initial):
- Granted-Service-Unit (volume and/or time)
- Validity-Time (quota expiration)
- Result-Code (success or failure)
If the OCS denies credit (for example, insufficient balance), the session is not established or the service is restricted.
CCR-Update / CCA-Update
Sent when granted quota is nearly exhausted or when session parameters change.
Triggers:
- Quota threshold reached (for example, 80% consumed)
- Quota expiration approaching
- Service-level changes
- Location or RAT type changes
Purpose:
- Report consumed quota
- Request additional quota
- Update session information
OCS response (CCA-Update):
- Additional granted quota
- Quota refill
- Service termination instruction
CCR-Terminate / CCA-Terminate
Sent when the user session terminates.
Purpose:
- Report final consumed quota
- Close charging context
- Final balance update
OCS response (CCA-Terminate):
- Acknowledgement
- Final cost (informational)
PCC Rule Integration
Online charging is enabled per PCC rule. Configure rules with onlineEnabled: true:
Multiple rules can use the same rating group, or use separate rating groups for different services:
OCS Free Feature
OCS Free allows user sessions to continue with predefined quota when the OCS is unavailable or unresponsive. This prevents service disruption during OCS outages.
Enabling OCS Free
When enabled, SMC uses predefined responses in these conditions:
- OCS is unreachable (connection down)
- Request times out
- Rate limit is exceeded
OCS Free Behaviour
When OCS Free activates, SMC generates a synthetic CCA response:
Key characteristics:
- One entry per rule with
onlineEnabled: true - Granted time is randomised between
ccTimeMinandccTimeMax - Rating group comes from rule configuration (
onlineRatingGrouporratingGroup) - No volume quota is granted (time-based only)
- When granted quota expires, the session terminates without further OCS communication
Caution
OCS Free grants quota without real credit checks. Use only for temporary OCS outages. Sessions may exceed subscriber credit limits during OCS Free operation.
OCS Free Configuration Parameters
Recommended values:
ccTimeMin: 3600- 1 hour minimumccTimeMax: 7200- 2 hours maximum
Randomisation prevents all sessions from expiring simultaneously when OCS recovers.
Example Configurations
Basic Ro with Common Settings
Ro with OCS Free
Ro with Separate Network
Multiple Online Services
Hybrid Charging (Online + Offline)
Troubleshooting
Sessions Rejected by OCS
Symptom: Sessions fail to establish with insufficient credit errors.
Cause: OCS reports subscriber has insufficient balance.
Solution:
Verify subscriber balance in OCS
Check OCS policies for the subscriber
Review CCA result code in SMC logs:
- 4xxx = Client error (for example, invalid request)
- 5xxx = Server error (for example, OCS internal error)
Check OCS logs for rejection reason
OCS Not Reachable
Symptom: All sessions fail with connection errors.
Possible causes:
- OCS server down
- Network connectivity issues
- Firewall blocking port 3868
Solution:
Verify OCS connectivity (see Diameter Configuration)
Check if OCS Free is enabled and activating:
yamlReview SMC logs for Ro connection errors
Verify OCS service status
OCS Free Not Activating
Symptom: Sessions fail when OCS is down despite OCS Free being enabled.
Possible causes:
- OCS Free not enabled
- Configuration error in
ocsFreesection - No rules have
onlineEnabled: true
Solution:
Verify OCS Free is enabled:
yamlVerify at least one rule has online charging enabled:
yamlCheck SMC logs for OCS Free activation messages
Test OCS connectivity issues (stop OCS temporarily)
Quota Exhausted Too Quickly
Symptom: Sessions terminate frequently due to quota exhaustion.
Possible causes:
- OCS grants small quota
- High data usage
- Quota threshold too high (causing frequent re-authorisation)
Solution:
Check OCS quota grant policies
Review typical usage patterns for the service
Consider increasing quota threshold in OCS configuration
Check for traffic loops or unusual traffic patterns
Wrong Rating Group in Ro Messages
Symptom: CCR messages contain unexpected rating group values.
Possible causes:
- Multiple rules match the same traffic
- Wrong rule has higher precedence
onlineRatingGroupoverridesratingGroup
Solution:
Review rule precedence:
yamlCheck for
onlineRatingGroupoverrides:yamlVerify flow descriptions match intended traffic
Check SMC logs for rule activation details
OCS Free Quota Too Short
Symptom: Sessions terminate quickly during OCS Free operation.
Cause: ccTimeMin and ccTimeMax values are too small.
Solution:
Increase OCS Free time grants:
Tip
Balance OCS Free quota with business risk. Longer quotas provide better service continuity but increase revenue risk during OCS outages.
Sessions Not Using OCS Free
Symptom: Sessions fail when OCS is unavailable despite OCS Free configuration.
Possible causes:
- Connection to OCS not detected as down (slow timeout)
- Rate limiting not configured correctly
- OCS responding with errors instead of timing out
Solution:
Verify connection monitoring detects OCS failures
Configure rate limiting to trigger OCS Free faster:
yamlCheck OCS response codes - 5xxx errors should trigger OCS Free
Review timeout settings (fixed at 5000 milliseconds)
Note
OCS Free activates when OCS is unreachable, times out, or rate limit is exceeded. It does not activate for OCS rejections (insufficient credit).