Charging interfaces of YateUCN
Contents
Pre-requisites for using Gy/Ro
Enable the module implementing Gy/Ro
Edit /etc/yate/ucn/js-custom.conf (create it if missing).
Add the following:
[scripts] ucn_diam_charging=ucn_diam_charging.jsc
Create Diameter connection to OCS
Edit /etc/yate/ucn/acct-custom.conf (create it if missing).
Add the diameter connection:
[ocs] enabled=yes protocol=diameter local_node=epc.mnc001.mcc001.3gppnetwork.org/ucn-ocs.epc.mnc001.mcc001.3gppnetwork.org remote_host=HOST_NAME_OF_PEER apps=4 extra_vendors=10415 transport=sctp address=IP_TO_CONNECT_TO default_priority=0 default_realm_priority=0 default_route=1
NOTES:
- Remember local_node value: you'll need to set it up when configuring charging in specific module (PGW/EAP/SCF PPS)
- See https://docs.yate.ro/wiki/Ydiameter#Outgoing_connections for more information about Diameter connection parameters
- If you connect to OCS through a DRA you'll need to:
- Build a connection from DRA to OCS or from OCS to DRA
- Route requests between UCN node(s) and OCS.
YateDRA routing description can be found at https://wiki.yatebts.com/index.php/YateDRA_Routing.
PGW: Enabling pre-defined PCC rules
PCC rules are used by PGW when returned in first session user.auth message in pcc_rules parameter (comma separated list).
PCRF enabled: Predefined PCC rules are installed on PCRF request only. There is no support for pre-defined PCC rules to be installed automatically (unknown by PCRF).
PCRF not enabled: Predefined PCC rules are installed from start.
PCC rule parameters are documented in yate-ucn/conf/policies.conf.sample
regexroute.conf example:
[extra] user.auth=10 [user.auth] ${component}PGW=if ${called}internet={ ${imsi}^00101=return true;pcc_rules=dns,http,everything-else }
${called} = APN name, condition to enable charging functions on a certain APN (any regular expression can be used. Ex: if ${called}^internet$={ )
policies.conf example:
- The DNS service is not charged
- HTTP/non HTTP traffic is charged separately
- low_qos will be used as a pre-defined PCC rule activated by PCRF when subscriber's balance depletes. Service is allowed at a very low speed
[dns] flow.1.filter=permit out udp from any 53 to any flow.2.filter=permit in udp from any to any 53 flow.3.filter=permit out tcp from any 53 to any flow.4.filter=permit in tcp from any to any 53 [http] ocs=true cdr_service_id=1001 cdr_rating_group=1001 flow.1.filter=permit out tcp from any 80 to any flow.2.filter=permit in tcp from any to any 80 flow.3.filter=permit out tcp from any 443 to any flow.4.filter=permit in tcp from any to any 443 [everything-else] ocs=true cdr_service_id=2000 cdr_rating_group=2000 flow.1.filter=permit out ip from any to any flow.2.filter=permit in ip from any to any [low_qos] flow.1.filter=permit out ip from any to any flow.2.filter=permit in ip from any to any kbps_ul=100 kbps_dl=200
PGW: Enabling PCRF/OCS
PCRF or OCS may be enabled from AP config.
There is no support for PCRF and OCS usage at the same time (for the same data session). This would require dynamic credit key management: add/remove credit key(s) as PCC rules are added or removed. The Diameter OCS implementation expects all known keys to be given when session starts.
PCRF: Enabling Diameter Gx
Example of config used during a-billing-company interconnect tests:
ap.conf
[00101:internet] pcrf=yes pcrf_diam_node=epc.mnc001.mcc001.3gppnetwork.org/ucn1.epc.mnc001.mcc001.3gppnetwork.org pcrf_diam_realm=a-billing-company.com ; If a-billing-company has issues with session level monitoring removal. Force replace when receiving a new one pcrf_monitoring_session_replace=yes
OCS: Data charging using Diameter Gy/Ro
Example of config used during a-billing-company interconnect tests:
ap.conf
[00101:internet] ocs=yes ocs_service_context=32251@3gpp.org ocs_diam_node=epc.mnc001.mcc001.3gppnetwork.org/ucn-ocs.epc.mnc001.mcc001.3gppnetwork.org ocs_diam_realm=a-billing-company.com session_ocs_key=session session_ocs_cdr_service_id=1 session_ocs_cdr_rating_group=1
UCN SCF PPS: Voice charging using Diameter Ro
yateucn.conf example:
[scf_pps] camel_key=1 camel_int=30 authorize=yes charging=ocs authorize_cdrwrite_ocs=true authorize_diam_node=epc.mnc099.mcc460.3gppnetwork.org/ucn1.epc.mnc099.mcc460.3gppnetwork.org authorize_diam_realm=epc.mnc099.mcc460.3gppnetwork.org cdr_cdrwrite_ocs=true
UCN EAP: Data charging using Diameter Gy/Ro
Enable OCS in netinfo.
netinfo.conf example:
[00101] ocs=true
yradius.conf example:
[client 192.168.168.50] secret=test add:Acct-Session-Id=${billid} add:NAS-IP-Address=${nas_addr} add:NAS-Identifier=${nas_id} add:NAS-Port=${nas_port} ret-fail:Error-Cause=error [listener eap] addr=192.168.168.172 port=1812 rad_auth=true put:$wlan=route_type put:EAP-Message=rad_eap put:State=rad_state put:Message-Authenticator=rad_auth add-fail:EAP-Message=${orad_eap} add-fail:State=${orad_state} add-fail:Message-Authenticator=${rad_auth} add-fail:Reply-Message=${orad_text} add:EAP-Message=${orad_eap} add:Message-Authenticator=${rad_auth} add:MS-MPPE-Recv-Key=${orad_msk1} add:MS-MPPE-Send-Key=${orad_msk2} ;add:Session-Timeout=${expires} add:Acct-Interim-Interval=${interim} [listener cdr] addr=192.168.168.172 port=1813 rad_acct=true put:$wlan=route_type put:$WLAN=component put:NAS-Port-Type=nas_type put:NAS-Port=nas_port put:NAS-IP-Address=nas_addr put:NAS-Identifier=nas_id put:Connect-Info=conn_info put:Acct-Authentic=authenticator put:Acct-Input-Packets=inp_pkt put:Acct-Output-Packets=out_pkt put:Acct-Input-Octets=inp_oct put:Acct-Output-Octets=out_oct put:Acct-Input-Gigawords=inp_hi32 put:Acct-Output-Gigawords=out_hi32 cisco_format=true quintum_format=false
Diameter sessions
Diameter:
- transaction_ttl must be set in ydiameter.conf. This will enable incoming transaction tracking to detect retransmissions
Parameters handled in session start message:
- diam_node: Local node to use when sending the request
- diam_realm: Destination realm. If not set the Diameter module will try to select it from local node's realm
- diam_host: Destination host
- diam_proxy: Peer of local node to use
- diam_sess_params.session_flags: Session flags. See Ydiameter for description
NOTES:
- Destination-Realm AVP is required by Diameter. The module MUST be able to detect one. Session start will fail otherwise
Some setups may require to not put Destination-Host AVP in any session request.
The Diameter module will automatically put it from received answer's origin if not instructed to do otherwise:
diam_sess_params.session_flags=nodesthost