In this section:
The AVP Routing Table routes a message based on the message alias AVP (refer to Configuring an AVP Alias Definitions).
Matching AVP Alias of an AVP Routing Table to an AVP in a Message
A Diameter message contains a header followed by Attribute Value Pairs (AVPs). AVPs contain a header followed by data. Some AVPs are Grouped AVPs and their data consists of AVPs.
An AVP Routing Table uses an AVP Alias to describe which AVP data should be compared against the routing table data (see Configuring AVP Alias Definitions).
For example, the following destRealm AVP Alias indicates that the data from the top level Destination-Realm AVP should be compared with table data:
The following erc AVP Alias indicates that the Diameter message should be examined for a top-level Experimental-Result AVP (this is a Grouped AVP), then search the Experimental-Result AVP data for an Experimental-Result-Code AVP. The data from the second level Experimental-Result-Code AVP is compared against routing table data:
When attempting to match the AVP Alias of an AVP Routing Table to an AVP of a message, the following scenarios may occur:
- In some cases, an AVP may not be present in the message, in which case the NO AVP record is followed.
- In some cases, the AVP Alias may reference a single AVP, in which that AVP is compared against the provisioned records for a match. If a match is found, the matching record is followed, otherwise, the DEFAULT record is followed.
- In some cases, the AVP Alias may reference multiple AVPs, in which case each matching AVP is compared against the provisioned records for a match; if a match is found the matching record is followed. If no match is found, then the DEFAULT record is followed.
AVP Types and Record Types
AVP Data in a Diameter Message is a sequence of octets. The interpretation of AVP Data depends on the type of the AVP as defined in the corresponding Diameter Application. For example, the sequence 2e 63 6f 6d (four octets in hexadecimal representation) could represent the ASCII string “.com” or could represent the decimal integer 778268525 (hexadecimal 2e636f6d), depending on the definition of the AVP in its Diameter Application.
The type of record you use to match AVP Data indicates what sequence of AVP data octets will be matched, so the type of record you use usually depends on the type of the AVP.
Longest Match Searches
Routing Records are stored as vectors of octets that may be compared against the binary AVP data of received AVPs.
The following three search types may be performed:
The EXACT MATCH search type must be the exact match. The record and the AVP must have the same data and the same data length.
The LONGEST FROM LEFT search type compares the received AVP data against every record in the table. The best match is the record whose value is a prefix of the AVP data and is longer than any other match.
The LONGEST FROM RIGHT search type is similar to the preceding search type, but this search compares the received AVP data and attempts a match from the right of the binary AVP.
If a record contains more data than a received AVP then it does not match that AVP.
AVP Routing Tables where the associated AVP has an integer type must use EXACT MATCH searches.
The following table provides an example of search type LONGEST FROM RIGHT, where string values have been used to simplify the example. When comparing Diameter IDs with a LONGEST FROM RIGHT search, it is important to include the leading “.” (see the difference between the effect of rules badnetwork.example.com and .badnetwork.example.com).
For additional examples, see Configuring AVP Alias Definitions and Routing Tables
To create an AVP Routing Table
To view an AVP Routing Table
To create an AVP Routing Record
To configure an AVP Routing Record