Policy Table Case Study

The following case study is derived and simplified from actual carrier policies and illustrates how a large set of policies can be consolidated using a policy table.

A wireless carrier named Example Inc. offers three monthly data usage plans for its subscribers. The monthly quota levels are 100 MB, 2 GB, and 150 GB. Seven policies are used to capture the business logic for each usage plan, as follows:

The rules for each usage plan are collected in a policy group: to support the three plans, there are three policy groups. Finally, triggering policies determine which policy group to execute based on the entitlement of the subscriber.

The names the carrier uses for the groups, and the names of the policies each contains, are as follows. The groups are named for the data plans (100_MB, 2_GB, and 100_GB), and the policies are named for the data plans and the actions each policy performs.
Quotas and Policy Names
Group Name Policy Name
Quota_100_MB Quota_100_MB_send_70_percent_SMS
Quota_100_MB_send_100_percent_SMS
Quota_100_MB_additional_quota_send_100_percent_SMS
Quota_100_MB_set_70_percent_volume_threshold
Quota_100_MB_set_100_percent_volume_threshold
Quota_100_MB_additional_quota_set_100_percent_volume_threshold
Throttle_64_kbps_100_MB
Quota_2_GB Quota_2_GB_send_90_percent_SMS
Quota_2_GB_send_100_percent_SMS
Quota_2_GB_additional_quota_send_100_percent_SMS
Quota_2_GB_set_90_percent_volume_threshold
Quota_2_GB_set_100_percent_volume_threshold
Quota_2_GB_additional_quota_set_100_percent_volume_threshold
Throttle_64_kbps_2_GB
Quota_100_GB Quota_100_GB_send_90_percent_SMS
Quota_100_GB_send_100_percent_SMS
Quota_100_GB_additional_quota_send_100_percent_SMS
Quota_100_GB_set_90_percent_volume_threshold
Quota_100_GB_set_100_percent_volume_threshold
Quota_100_GB_additional_quota_set_100_percent_volume_threshold
Throttle_64_kbps_100_GB
Comparing the triggering policies shows that they differ only in the name of the entitlement to match and the policy group to execute:
Similarly, comparing the corresponding policies in different groups shows that they are mostly the same, with only a few isolated differences:
where the user is using greater than or equal to 100 percent of total volume for DP_QUOTA.100GB quota
And where the user is using less than 100 percent of total volume for DP_QUOTA_ADDL.5GB quota
remove PCC rule types all for all
install 16Mbps_DL_5.76Mbps_UL PCC rules for flow
grant total volume to 100 percent used for DP_QUOTA_ADDL.5GB
Advanced: set values for QoS and Charging parameters to 
Diameter Enforcement Session Event Triggers  REVALIDATION_TIMEOUT, USAGE_THRESHOLD_REACHED
Diameter IP-CAN Session Usage Monitoring  USAGE_MONITORING_ENABLED

accept message
All the differences in the seven policies for the three groups can be tabulated using only six columns and three rows, as follows. Because of the similarities from group to group, these policies are good candidates for using a policy table. These three groups can be replaced by one set of policies using variables for differences and one policy table with three rows. The table's key column, representing the scenarios, is a policy context property. The table column headings become the names of the other variables used in the policies.
Differences Between Quotas
Policy Variable Scenario Base Quota Additional Quota Percent Limit Additional Limit Grant Quota
100 MB DP_QUOTA.100MB DP_QUOTA_ADDL.​3GB 70 3 GB DP_QUOTA_ADDL.3GB
2 GB DP_QUOTA.2GB DP_QUOTA_ADDL.​4GB 90 4 GB DP_QUOTA_ADDL.4GB
100 GB DP_QUOTA.100GB DP_QUOTA_ADDL.​5GB 90 5 GB DP_QUOTA_ADDL.5GB
The triggering policies are now rewritten to use the policy table and a single policy group, which in this case study is named QUOTA. A policy context property is used as the key to locate the row in the table to use.
The policies in the QUOTA group are now rewritten to use the policy table, which in this case study is named Quota_table, and variables. The sample policies shown previously are rewritten as follows:
use table Quota_table called table
where the user is using greater than or equal to table.PctLmt percent and less than 100 percent of volume for table.BaseQuota quota
And where the event trigger is one of USAGE_THRESHOLD_REACHED
send SMS `You have consumed table.PctLmt % of your total quota allotted on Example Inc.` to user. Request delivery receipt `default`.
send notification to syslog with `SMS table.PctLmt%;{User.E164};{User.Custom5};{User.Custom6};GOLD;{User.Entitlement};You have consumed table.PctLmt % of your total quota allotted on Example Inc.` and severity `Info`
Advanced: set values for QoS and Charging parameters to 
Diameter IP-CAN Session Usage Monitoring  USAGE_MONITORING_ENABLED

continue processing message

Group: QUOTA; Policy: Quota additional quota set 100 percent volume threshold

use table Quota_table called table
where the user is using greater than or equal to 100 percent of total volume for table.BaseQuota quota
And where the user is using less than 100 percent of total volume for table.AddlLmt quota
remove PCC rule types all for all
install 16Mbps_DL_5.76Mbps_UL PCC rules for flow
grant total volume to 100 percent used for table.AddlQuota
Advanced: set values for QoS and Charging parameters to 
Diameter Enforcement Session Event Triggers  REVALIDATION_TIMEOUT, USAGE_THRESHOLD_REACHED
Diameter IP-CAN Session Usage Monitoring  USAGE_MONITORING_ENABLED

accept message