Understanding Gx-Plus–PCRF Interactions
This topic describes the sequences of Diameter messages exchanged between Gx-Plus and the Policy and Control Charging Function (PCRF) as they interact to perform the following tasks for subscriber access:
- Subscriber login
- Fault tolerance and event notification
- Subscriber audit
- Subscriber logout
Subscriber Login
Gx-Plus provisioning is enabled for subscribers when you include the provisioning-order gx-plus statement at the [edit access profile profile-name] hierarchy level. When an application requests AAA to activate the subscriber's session, Gx-Plus sends a CCR-I message to the PCRF to request provisioning for the subscriber session. The CCR-I message must include the Juniper-Virtual-Router, Framed-IP-Address, and NAS-Port-ID AVPs. If no IPv4 address has been assigned to the subscriber, or if the NAS-Port-ID is unknown, then the request is not generated.
The PCRF returns a CCA-I message that includes the Result-Code AVP (AVP code 268). Gx-Plus ignores any other AVPs that are included in the response. Gx-Plus considers a CCA-I that does not include the Result-Code AVP as a failed response.
If the Result-Code value is DIAMETER_SUCCESS (2001), Gx-Plus communicates to AAA that the requested service is activated. If the Result-Code value is DIAMETER_AUTHORIZATION_REJECTED, Gx-Plus communicates to AAA that the service activation is not permitted. If the Result-Code AVP has any other value, or is missing, the request is retried. A total of three CCR-I messages can be sent.
If the PCRF does not indicate success or failure, then by default Gx-Plus continues to send requests, but the retry requests are CCR-N messages (no-response notifications) that include the Juniper-Provisioning-Source AVP (AVP code 2101). This AVP indicates that the router has local decision-making authority to provision services in the absence of a PCRF response to the CCR-I. This AVP is not present in the CCR-I message.
Fault Tolerance and Event Notification
Although the probability is low, it is possible for the PCRF and the router to have different values for the number of subscribers. This error can arise from the following scenarios:
- CCA-I loss: if no CCA-I is delivered to the router, then the PCRF considers a subscriber as provisioned whereas the router considers it not provisioned.
- CCR-T loss: if no CCR-T is delivered to the PCRF, then the PCRF considers a subscriber as provisioned whereas the router considers it not provisioned.
Loss of messages can be greater during cold boots and high availability events. Unacknowledged requests are retransmitted forever until a satisfactory response is received to reduce the incidence of failure, and significant events are reported to Gx-Plus. By default, the number of outstanding requests is limited to 40 to avoid overloading the PCRF. This limit reduces the possibility of losing requests. You can modify this number by including the max-outstanding-requests statement at the [edit access-gx-plus global] hierarchy level.
Gx-Plus does not rely on the connection state between devices to detect router or PCRF outages, because some events do not affect the connection state and others are not detected when there is a Diameter relay or proxy between the devices. Event notifications (JSER messages) are sent when certain events take place on the router. The Juniper-Event-Type AVP (AVP code 2103) in the message describes the event.
Event notifications are retried until Gx-Plus returns a JSEA message with a Result-Code value of DIAMETER_SUCCESS (2001) to acknowledge receipt of the event notification. When retrying notifications, one notification is sent for each outstanding event. No other request are sent as long as there is any outstanding event other than an application watch dog (AWD).
Table 1 lists router events and the subsequent router and PCRF actions.
Table 1: Router Events, Router Actions, and PCRF Actions
Router event | Router action | PCRF action |
|---|---|---|
The router receives no response from the PCRF or an error response. | Send event notification. | Respond to event notification. |
The configuration changes. Significant changes such as the origin host or realm and the Gx-Plus partition destination host or realm also increment the value of the Origin-State-Id AVP. | Send event notification. | Respond to event notification and perform discovery. |
The router receives an explicit discovery request from the PCRF. | Send event notification. | Respond to event notification. |
The router undergoes a cold boot and all sessions are lost. This can result from a catastrophic failure or power cycle. | Send event notification. | Respond to event notification and clear the database. |
The router undergoes a warm boot. | Send event notification. | Respond to event notification and clear the database. |
Recovery resources that are needed to continuously retry unacknowledged requests (CCR-N and CCR-T messages) are exhausted. The value of the Origin-State-Id AVP is incremented. This event is unlikely to occur. | Send event notification. | Respond to event notification and perform discovery. |
An important aspect of Gx-Plus fault tolerance is that subscriber login and termination requests are retried (replayed) forever until a satisfactory response is received from the PCRF. In rare circumstances, this can result in a stack of pending requests being replayed over and over.
You can issue the clear network-access gx-plus replay command to clear all pending requests. This command causes Gx-Plus to send a JSER message to PCRF that includes the Juniper-Event-Type AVP (AVP code 2103) with a value of 3 indicating a discovery request. The PCRF then returns a JDER message to initiate discovery of all subscribers. When this discovery completes, all pending subscriber requests are cleared.
PCRF-Generated Discovery
The PCRF runs a discovery process in response to data loss, exhaustion of router resources, operator request, or router request. The JSDR message specifies the level of verbosity desired in the reply from Gx-Plus. The message also specifies whether the request is for data about a particular session or information similar to an SNMP Get-Bulk for all sessions. Gx-Plus returns a JSDA message that indicates complete success, limited success, or an error. In the event of success, the requested data is also returned.
Subscriber Audit
The PCRF can send a reauthorization request (RAR message) to Gx-Plus at any time to determine whether a particular subscriber is still logged in. You can also manually trigger the PCRF to do so by issuing the clear network-access aaa gx-plus replay command.
The Session-Id AVP identifies the subscriber session. Gx-Plus returns an RAA message to provide status on the subscriber session. When the session is still up (found in the session database) the Result-Code AVP value in the RAA message is DIAMETER_SUCCESS (2001). When the session is not found, the Result-Code value is DIAMETER_UNKNOWN_SESSION_ID (5002). A Result-Code value of DIAMETER_UNABLE_TO_DELIVER (3002) indicates that Gx-Plus is not configured.
Subscriber Logout
When the client application sends a subscriber logout notice to AAA, Gx-Plus sends a CCR-T message to notify the PCRF that the provisioned subscriber session is being terminated. The PCRF returns a CCA-T message that includes the Result-Code AVP. If the Result-Code value is DIAMETER_SUCCESS, Gx-Plus notifies AAA, and AAA notifies the application that the logout is complete. If Gx-Plus does not receive a CCA-T message, or if the Result-Code AVP has any other value or is missing, then the termination request is retried until the CCA-T message is returned with DIAMETER_SUCCESS.