2.2 Rule Templates
All Rule Templates are listed on the
page with check boxes by each row. To automatically check all the rule templates, check the box by the rule template Name.- 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.
- 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.
- Filter the list of rule template Names to display only the desired rule templates.
- Add a new rule template and its values on the 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. page. For information on adding a rule template see
- Import a rule template from a location outside the Diameter system, to which the rule template was previously exported from Mediation on the 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. page. For information on importing a rule template see
- Copy a rule template to create a new rule template on the 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. page. For information on copying a rule template see
-
Edit the selected rule template on the Changing a Rule Template.
page. For information on changing a rule template see - 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 Exporting a Rule Template. page. For information on exporting a rules template see
- Set Help creates online help for the selected rule template on the Adding online help to a Rule Template. page. For information on adding online help to a rule template see
Fast Search versus slow search
- 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 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
- 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
- Conditions that are ANDed:
- 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.
- 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 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 |