2.2 Rule Templates

All Rule Templates are listed on the Diameter, and then Mediation, and then Rule Templates page with check boxes by each row. To automatically check all the rule templates, check the box by the rule template Name.

Rule templates are created by:
  • Formulating the Conditions against which to match incoming requests or responses.
  • Defining the Actions that are applied to the message when the conditions match.

A Rule template is created by configuring Settings, Conditions, and Actions sections.

Settings

  • The Rule Template Name is placeholder for meaningful text to describe the purpose of the rule template and rule set.
  • The Message Type Support is automatically determined depending upon the configured conditions and actions for the Rule Template.

Conditions

One or more (up to 5) matching conditions can be defined in the rule template. The expressions are combined into one logical expression using ANDed, ORed, or Complex Expression operators.

Each matching expression consists of a left-hand value or operand, an operator, and a right-hand value or operand.
  • The Left-hand value or operand allows accessing any part of a message, any information stored by the previous rule template, and any information the application resolves runtime.
  • The Operator allows comparison of the Left-hand and Right-hand values.
  • The Right-hand value or operand allows performing the syntax check for the entered data on the generated Rule Sets page.
  • The Condition Set is used to form one logical expression by combining all the Conditions of that Rule Template.

Conditions can be configured to cause Mediation to use fast database look-ups of the rule data. For information on fast search see Fast Search.

Actions

One or more (up to 5) actions indicate what to do when the conditions match (such as modify the part of a message, forward a message, send a reply, insert or remove AVP headers, or set attributes for further processing). Actions implement the mediation of a message.

When the message processing reaches a selected triggering point, the conditions of the rule template are examined for the message. If the conditions match, actions are applied to the message. The actions allow manipulation of some particular part of the message, adding or deleting information in the message, forwarding the message to a specific destination, or triggering of diameter message copy to send a copy of the message to a Diameter Application Server (DAS).

The rule template defines the actions to take when a Mediation operation is triggered and its condition set is matched that form an action set. A list of actions available are in the Rule Template elements.

On the Diameter, and then Mediation, and then Rule Templates page, you can perform the following actions:
  • Filter the list of rule template Names to display only the desired rule templates.
  • Add a new rule template and its values on the Diameter, and then Mediation, and then Rule Templates [Insert] page. For information on adding a rule template see Adding a Rule Template. If the maximum number of rule templates (100) already exists in the system, the Rule Templates [Insert] page does not open, and an error message displays.
  • Import a rule template from a location outside the Diameter system, to which the rule template was previously exported from Mediation on the Diameter, and then Mediation, and then Rule Templates [Import] page. For information on importing a rule template see Importing a Rule Template. If the maximum number of rule templates (100) already exists in the system, the Rule Templates [Import] page does not open, and an error message displays.
  • Copy a rule template to create a new rule template on the Diameter, and then Mediation, and then Rule Templates [Copy] page. For information on copying a rule template see Copying a Rule Template. If the maximum number of rule templates (100) already exists in the system, the Rule Templates [Copy] page does not open, and an error message displays.
  • Edit the selected rule template on the Diameter, and then Mediation, and then Rule Templates [Edit] page. For information on changing a rule template see Changing a Rule Template.

  • Delete a selected rule template. For information on deleting a rule template see Deleting a Rule Template.
  • Export one or more rule template(s) to a location outside of the Diameter system on the Diameter, and then Mediation, and then Rule Templates [Export] page. For information on exporting a rules template see Exporting a Rule Template.
  • Set Help creates online help for the selected rule template on the Diameter, and then Mediation, and then Rule Templates [Set Help] page. For information on adding online help to a rule template see Adding online help to a Rule Template.

Fast Search versus slow search

The mediation templates can be fast search or slow search. The fast-search templates include only the conditions that can be looked up using the fast search algorithm. This algorithm is more efficient and allows having more templates in the system and more provisioned rules. The slow search template is a template that includes at least one slow search condition. It is allowed to have up to 2000 rules for the fast-search template and 250 only for the slow search template. Even if the template is a slow search template, there are still some recommendations to improve the performance:
  • Optimize the template when it is possible. Try to make the template conditions to be fast search when possible.
  • Move fast search conditions to the top when possible.
  • Try to avoid usage of regular expressions when possible.
Fast search or slow search depends on the content of the condition, the condition evaluation order, and the condition grouping method in the following order:
  1. Fast search dependency on the operator, right value type and the default value:
    • "yes" sign if one of the operators "==", "=^^", "=^", "is within", "exists", "does not exist", "is true", "is false" is selected and the right hand operand type is not "xl-value".
    • "yes sign" if the default value is fixed regardless of the selected operator and the right value type.
    • "no" sign for other cases
  2. Fast search dependency on the condition evaluation order and condition grouping method:
    • Conditions that are ANDed:
      • "yes" sign if the condition is the first on the condition set layout or all the conditions above also have "yes" sign under the fast search label.
      • "no" sign for other case.
    • Conditions that are ORed:
      • "no" sign for all conditions
    • Conditions that form a complex expression that use a mix of AND and OR operations:
      • "yes" sign if the condition is the first condition evaluated in the expression or all the conditions before the expression also have the "yes" sign under the fast search label + the condition is simply ANDed to the rest of expression
      • "no" sign if the condition is ORed
      • "no" sign for other cases
For example assume, that A, B, C and D are fast-search based on 1.
  • The specified complex expression is (C OR D) AND A AND B:
    • First (C OR D) is evaluated. Since C, D are ORed conditions, they are non fast-search. A, B conditions are evaluated after the non-fast search conditions; hence they are also non fast-search.
    • This expression can be optimized by changing the order to A AND B AND (C OR D). Where A, B conditions are evaluated first and they are fast search.
Another example assume that A,B,C are fast-search based on 1.
  • The specified complex expression is (A AND B) OR (C AND A):
    • None of the conditions is simply ANDed to the rest of expression hence none of the conditions has fast-search.
    • This expression can be optimized by changing the order to A AND (B OR C). Where A is evaluated first and it is simply ANDed to the rest of expression hence it has the fast search.

Performance

Table 2-1 describes the performance impact of the DSR in specific scenarios. The Simple, Medium, and Complex categories define the maximum percentage of degradation while meeting the existing message latency and reliability and currently measured CPU utilization.

Table 2-1 Mediation Task Classifications

Percentage of Degradation Number of Conditions Types of Operators used in Conditions Number of Rules in the Rule Set
Simple <= 1% 1-2

exist,

does not exist,

equals ("=="),

begins with ("=^")

1-50
Medium <=5% 3-4

Greater than (">"),

Greater than or Equal to (">=")

Less than ("<"),

Less than or Equal to("<="),

Hash Value hash(<string>,<range>)

51-150
Complex <=10% 5

Pattern matches

151-250