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:

destRealm AVP Alias

 

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:

erc AVP Alias

Experimental-Result-Code AVP

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.

Types of AVP Data

Record TypeCommentExample
VALUE STRING

Used to match data that corresponds to an ASCII string.If the corresponding AVP is a DiameterIdentity then the lookup is case insensitive.

AVP Value “.com” matches AVP bytes 2e 63 6f 6d. If the AVP is a DiameterIdentity then AVP Value “.com” and “.COM” are equivalent and match AVP bytes that are any capitalization of .com.

VALUE INT

Used to match data that corresponds to a 32 or 64 bit signed or unsigned integer (including derived types like “Enumerated”). The expected data length depends on the AVP Definition.

AVP Value “3” matches AVP Bytes 00 00 00 03 if the AVP Type is Integer32, Unsigned32 or Enumerated, and it matches AVP Bytes 00 00 00 00 00 00 00 03 if the AVP Type is Integer64 or Unsigned 64.

VALUE HEX STRING

Used to match variable length data that need not be an ASCII string. If the corresponding AVP is a DiameterIdentity then the lookup is case insensitive. When using a VALUE HEX STRING to match an AVP of integer type, the length of the HEX STRING must match the length of the integer (4 or 8 bytes).

AVP Value “2e 63 6f” matches AVP bytes 2e 63 6f regardless of the AVP Type. If the AVP is a DiameterIdentity then all bytes are converted to lower case before the comparison.

VALUE ADN

Enter the name of an ADN as a shorthand for using a VALUE STRING record that contains the DiameterId of the ADN. The match against AVP Data is case insensitive.

If an ADN has name dt1 and DiameterId dt1.example.com then an AVP Value “dt1” matches AVP Bytes 64 74 31 2e 65 78 61 6d  70 6c 65 2e 63 6f 6d (the ASCII encoding of “dt1.example.com”.

VALUE REALM

Enter the Alias of a Realm Definition as a shorthand for using a VALUE STRING record that contains the Realm of that Realm Definition. The match against AVP Data is case insensitive.

If there is a Realm Definition that has Realm “example.com” and Alias “ex” then a VALUE REALM record with AVP VALUE “ex” matches AVP Data 65 78 61 6d 70 6c 65 2e  63 6f 6d (“example.com”).

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.

Note

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).

Longest Match from the Right (Example)

Record TypeValue
VALUE_STRING.example.com
VALUE_STRINGbadnetwork.example.com
VALUE_STRING.badnetwork.example.com
DEFAULT 
RESULTS
Incoming AVP ValueMatching Record
test_table.example.com.example.com
network.example.com.example.com
badnetwork.example.combadnetwork.example.com
test_table.badnetwork.example.com.badnetwork.example.com
notabadnetwork.example.combadnetwork.example.com

For additional examples, see Configuring AVP Alias Definitions and Routing Tables

To create an AVP Routing Table

Click to read more... 

To view an AVP Routing Table

Click to read more... 

To create an AVP Routing Record

Click to read more... 

To configure an AVP Routing Record

Click to read more... 

 

  • No labels