Charging
AAA Transports
Since all mentioned applications are delivered on Diameter interfaces, their configuration shares those properties that apply to the Diameter protocol. There is a configuration element that holds common Diameter properties that all of these applications can share if necessary.
The first step when provisioning charging is to configure the network used for the different protocols, Rf and Ro. Ro can use a common interface, IPv4 address and MTU, or use specific per-protocol settings. The common settings are networking.oss.{interface,ipv4.addr,mtu}, whereas Ro uses networking.ro.{interface,ipv4.addr,mtu}.
Now the specific charging protocol settings can be configured. They are found under aaa.rf and aaa.ro. For both charging protocols, the following settings can be configured:
enabled: whether signalling will be sent on this interfacestandalone: whether the common settings for OSS will be used, or rather the separate settings will be used
A value of standalone: false will mean the protocol will use the values under aaa.oss for destinations,destinationRealm, originFqdn and originRealm. Otherwise the values under aaa.rf or aaa.ro will be used.
Then the specific transport protocol (TCP or SCTP) and socket options options need to be configured, both under aaa.rf or aaa.ro:
transportType: eithersctportcptransportOpts: specificreuseaddr: whether an existing socket inTIME_WAITstate is ignored when setting up the socketrecbuf: the buffer for incoming packets, in KBsndbuf: the buffer for ougoing packets, in KBunordered: (only usable for SCTP) whether messages can be sent unordered in the SCTP socket. Its recommended value istrue.nodelay: disables Nagle's algorithmOpens in a new tab; this may improve overhead in connections, but may cause latency for specific data to increase as they are not sent immediately
Configure sender identity in the Session-Id AVP
In the Diameter interfaces (Gx, Gy, NASREQ), the Session-Id AVP starts with the sender's identity. You can configure this identity through the aaa.originHost parameter. If not set, the SMC identity is retrieved from the operating system.
You can also modify sender identity directly in the ergw-config.json file under the entry "aaa"."apps"[0]."Origin-Host": "some.fqdn.name".
Retry a request across peers
The SMC Diameter client sends Diameter requests to one peer from those listed under the diameter.rateLimits.peers property. SMC selects the peer with the lowest load based on outstanding requests and request tokens. The SMC Diameter client retries a request to a different peer if:
- Connection to the initial peer is down
- Request times out after a fixed timeout of 5000ms
- Request is dropped because the rate limit for that peer is reached (see the Diameter rate control section below for more details)
Only a single request attempt is performed for each peer.
The retransmitted request messages are sent to a peer that wasn't used yet. These messages keep the ID of the original request and have the retransmit flag set.
OCS Free
OCS Free is a feature that allows user sessions to continue with a predefined granted time or volume quota in case the Online Charging System (OCS) is unavailable or OCS requests fail due to temporary issues, such as transport interruptions. You can enable this feature on the Ro interface through the aaa.ro.ocsFree.enabled property.
If this feature is enabled, a predefined AAA response is used for the user data session in the following cases:
- OCS is down
- Request times out
- Rate limit is exceeded
For every {RULE_NAME} item under the aaa.applicationDetection.rules property, one entry is added to the Multiple-Services-Credit-Control AVP response. See the example:
When this predefined granted quota is exhausted, the user data session is stopped without any communication with the OCS.
Diameter rate control
To avoid overloading a Diameter peer, you can apply a rate limit on a per-peer basis. Requests exceeding the rate are dropped and may be redirected to a different peer.
The rate limit uses a token bucket algorithm. You can configure a request rate per second through the diameter.rateLimits.peers.[].rate property. The token refill interval is 1000/rate milliseconds. When the rate limit is reached, the outgoing request rate is constant. You can configure a per-peer limit for outstanding (not yet answered) requests through the diameter.rateLimits.peers.[].outstanding_requests property.
RADIUS charging
The aaa.radius.* parameters specify how RADIUS charging will be performed. RADIUS needs to enabled with aaa.radius.enabled set to true. The different phases of RADIUS accounting can be separately enabled with the aaa.radius.start.enabled, aaa.radius.interim.enabled and aaa.radius.stop.enabled parameters. Additionally, specific AVPs can be filtered out using aaa.radius.avp_filters if needed.
Sample configuration:
Separate servers for authorization and accounting can be used by setting aaa.radius.server.acct.standalone to true, and using aaa.radius.server.{acct,auth}.addr and aaa.radius.server.{acct,auth}.type:
Example:
RADIUS Accounting without Authentication
To enable RADIUS with only Accounting, without Authentication, and use start, stop and interim, use following configuration:
NASREQ settings
By default, interim accounting is enabled and NASREQ requests are sent at the default rate of 1 request per 1800 seconds. This creates additional traffic on the PFCP interface. To disable this option, it is possible to set the aaa.acctInterimInterval to null as in the following example:
Note
A null value cannot be used for aaa.acctInterimInterval if RADIUS stop or interim accounting are enabled.
Charging parameters
The triggers enabled for charging in the SMC vary depending on its role:
- SMC as SMF:
- charging containers updated at
cgi-sai-change,ecgi-change,qos-change,rai-change,tai-change,tariff-switch-changeanduser-location-info-change - CDRs sent at
ms-time-zone-change,rat-change,sgsn-sgw-changeandsgsn-sgw-plmn-id-change
- charging containers updated at
- SMC as TDF:
- charging containers updated at
sgsn-sgw-plmn-id-changeandtariff-switch-change - CDRs sent at
ms-time-zone-change
- charging containers updated at
The location-dependent triggers (cgi-sai-change, ecgi-change, rai-change, tai-change, and user-location-info-change) enable sending a Change Reporting Action (CRA) IE in the Create Session Response messages sent through the GTPv2 interface. Whether the CRA IE is sent and what value is included in it depend on the values of the CRSI and ENBCRSI indications in the Indication Flags IE, the access network type in the RAT Type IE, and the configured triggers. These IEs are taken from the original Create Session Request message. The following table describes the CRA IE value sent depending on different combinations of the indications and triggers:
More information about charging triggers can be found in TS 3GPP 32.251Opens in a new tab, sections 5.2.3.4 "Triggers for PGW-CDR charging information collection", 5.2.3.9 "Triggers for TDF-CDR charging information collection" and 5.2.3.10 "Triggers for PGW-CDR charging information collection when IP-CAN session charging is active".
Each rules definition under the applicationDetection section can include the corresponding policy items; any reference to AVP definitions can be checked in TS 3GPP 29.212, section 5.3 "Gx specific AVPs" (except as noted):
-
precedence
The order in which this rule will be applied if the flow definitions in several rules match the same flow. Corresponds to thePrecedenceAVP. -
permittedIPs
Sets the IPv4 addresses for which flows with the specificationpermit out ipv4 from <address> to assignedwill be added. -
type
Whether flow descriptions (classic) or an application name (adf) will be used to identify flows. -
additionalSDF(only applicable toclassictype)
The flow specification corresponding to theFlow-DescriptionAVP. The format for the flow description is described in RFC6733 (IPFilterRule). It is mapped to thePDI.SDF_Filter.Flow_Descriptionfield in PFCP. BothUPLINKandDOWNLINKdirections are set up. -
adftype
The name of the rule is used as the value for theTDF-Application-IdentifierAVP. -
meteringMethod
Describes what will be measured and reported in the flow specified in the element above. Each integer represents a different concept. In the packet switching domain, volume reporting is the usual setting. -
offlineEnabled
Set to 1 if offline charging is enabled. -
onlineEnabled
Set to 1 if online charging is enabled. -
ratingGroup
Rating Group applied to the flow. A description on the grouping of service usage can be found in RFC4006, section 5.1.2. -
offlineRatingGroup
The Rating Group defined for offline charging. Overrides the generalratingGroupsetting. -
onlineRatingGroup
The Rating Group defined for offline charging. Overrides the generalratingGroupsetting. -
Redirect-Information
When several rules are sent to the UPG, the rule to apply depends on a combination of flow specification and precedence, so the UPG will activate the highest-precedence rule that applies to the current flow. A rulebase selects several such rules to be sent to the UPG.