DiameterApp

Diameter Application Configuration

The N2SVCD Diameter Application is a protocol gateway application which can perform client requests using the Diameter protocol. The N-Squared Tester Application requires a Diameter Application instance to be installed in order to execute Diameter tests.

The following configuration is used to create a Diameter Application instance to act as a protocol gateway to a Diameter server. A single Diameter Application instance will maintain a single connection to a single Diameter Server Address. If you need to connect to more than one remote Diameter Server Address, you must configure multiple Diameter Application instances (each with unique names).

<?xml version="1.0" encoding="utf-8"?>
<n2svcd>
  ...
  <applications>
    ...
    <application name="DIAMETER-S1" module="DiameterApp">
      <include><lib>../apps/diameter/lib</lib></include>
      <parameters>
        <parameter name="remote_host" value="10.42.2.154"/>
        <parameter name="remote_port" value="4999"/>
        <parameter name="origin_host" value="IN Tester"/>
        <parameter name="vendor_id" value="10415"/>
        <parameter name="reconnect_interval" value="30"/>
      </parameters>
      <config>
        <avps>
          <avp code="9043" vendor_id="20901" name="Extension-Int-3" mandatory="1" type="Unsigned64"/>
        </avps>
        <handlers>
          <handler app_id="4" application="ChargingServer"/>
        </handlers>
      </config>
    </application>
    ...
  </application>
  ...
</n2svcd>

Configuration Details

The application element attributes for a Diameter Application instance may include the below.

For details of the various parameter types used, refer to Common Configuration.

Parameter Name Type XML Type Description
See: Common Application configuration
See: TCP Application configuration
module String Attribute [Required] DiameterApp
include.lib String Element [Required] ../apps/diameter/lib
parameters Array Element [Required] As per Common Configuration Application parameters.
"edr_enabled" - - This value is ignored; the Diameter Application does not support writing EDRs.
"local_port" Positive Integer Attribute As per common TCP configuration for local_port.
(Default = 3868)
"remote_port" Positive Integer Attribute As per common TCP configuration for remote_port.
(Default = 3868)
"origin_host" String Attribute Value for the Diameter Origin-Host AVP to provide in all requests.
(Default = the FQDN of the host)
"origin_realm" String Attribute Value for the Diameter Origin-Realm AVP to provide in all requests.
(Default = <our-domain>).
"destination_host" String Attribute Value for the Diameter Destination-Host AVP to provide in all requests.
If configured here as empty string "" we will not send any Destination-Host.
(Default = <Copy Origin-Host from inbound CER>).
"destination_realm" String Attribute Value for the Diameter Destination-Realm AVP to provide in all requests.
If configured here as empty string "" we will not send any Destination-Realm.
(Default = <Copy Origin-Realm from inbound CER>).
"vendor_id" Integer Attribute Value for the Diameter Vendor-Id AVP to provide in all requests by default.
(Default = 0)
"auth_application_id" Integer Attribute Value for the Diameter Auth-Application-Id AVP to provide in connection requests.
(Default = 4)
"require_matching_aaid" Boolean Attribute Whether to validate that the returned Auth-Application-Id AVP in connection responses matches the Auth-Application-Id AVP sent by N2SVCD. If true, the connection will be dropped if the response value differs.
(Default = true)
"force_destination_host" Boolean Attribute Whether to always send the Destination-Host AVP in requests after connection. If true, this AVP will always be sent as the value received from the Diameter entity during CER/CEA. Otherwise, no Destination-Host will be sent unless the outbound Diameter request explicitly includes it as an AVP.
(Default = true)
"vendor_specific_application_ids" Array Element Additional handshake AVPs to send in CER / CEA messages to advertise additional application support.
(Default = none)
"supported_vendor_ids" Array Element Additional handshake AVPs to send in CER / CEA messages to advertise additional vendor support.
(Default = none)
config Object Element Container for extended configuration for this Application instance.
.avps Array Element Array of avp elements defining custom Diameter AVP name/code mappings.
.handlers Array Element Array of handler elements, rules for selecting the owning Application for inbound Diameter requests.

Note: Typical Diameter Servers will allow multiple outstanding requests per client connection.

Handshake Additional AVPs

Additional AVPs may be sent as part of the CER / CEA handshake between the Diameter application and its connected client or server. These AVPs may specify Diameter Vendor-Specific-Application-Id or Vendor-Id values. Each AVP is specified as a grouped name = value inside a named parameter list, e.g.

      <parameters>
        ...        
        <parameter name="vendor_specific_application_ids">
          <item group="diameter_sy" name="vendor_id" value="10415"/>
          <item group="diameter_sy" name="auth_application_id" value="16777302"/>
          <item group="diameter_sh" name="vendor_id" value="10415"/>
          <item group="diameter_sh" name="auth_application_id" value="16777217"/>
        </parameter>
        <parameter name="supported_vendor_ids">
          <item group="3gpp" name="vendor_id" value="10415"/>
          <item group="oracle" name="vendor_id" value="3512"/>
        </parameter>
        ...        
      </parameters>

The example configuration above would result in the following additional Diameter AVPs sent:

Note that the group parameter is a freeform identifier and is not validated or sent.

Diameter Custom AVPs

The avps section of the config block allows the definition of custom AVP codes for use in both inbound and outbound Diameter messages.

For outbound messages, custom AVPs allow for the encoding of non-string types, and also allow you to reference AVPs by name instead of by code.

For inbound messages, the Diameter standard says that an inbound message must be rejected if it contains an unknown AVP code with the mandatory flag set. Use this avps configuration section to define any custom AVPs. This also allows inbound custom AVPs to be referenced by names instead of codes, and allows for the decoding of non-string types.

Parameter Name Type XML Type Description
code Positive Integer Attribute [Required] A unique code for this AVP.
name String Attribute An optional name for this AVP.
type String Attribute The type of AVP content. Possible values are:
  • OctetString
  • TF8String
  • Integer32
  • Integer64
  • Unsigned32
  • Unsigned64
  • Enumerated
  • Time
  • Address
  • Grouped
(Default = OctetString)
vendor_id Integer Attribute Specify this value if this custom AVP includes a Vendor-Id.
mandatory Integer Attribute Set this to 1 if this custom AVP is mandatory, i.e. if the far end must recognise this AVP.
encryption Integer Attribute Set this to 1 if this custom AVP is encrypted. N2SVCD does not contain any built-in support for encrypted AVPs.

Diameter Handlers

Handler rules define which Application is used to process inbound Diameter Requests. Each handler Object in the config.handlers Array is configured as follows.

Parameter Name Type XML Type Description
app_id Integer Attribute The Diameter Application-ID for the message from the message header, e.g. 4 for Diameter Credit Control.
(Default = Handle all Application-ID values)
code Integer Attribute The Diameter Command Code for the message from the message header, e.g. 272 for Diameter Credit Control Credit-Control-Request.
(Default = Handle all Command Code values)
application String Attribute [Required] The name of the application which should process matching messages. This will normally refer to a LogicApp instance.

The handlers will be checked in order, and the first matching handler will be used.

Message Handling

In addition to the common Application management messages, the DiameterApp uses the following messages: