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>
    ...
  </applications>
  ...
</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/UDP 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 as empty string "" Destination-Host will not be sent.
(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 as empty string "" Destination-Realm will not be sent.
(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)
ignore_mandatory Boolean Attribute Determines the behaviour for received unrecognised mandatory AVPs in Diameter responses. By default, such AVPs cause the message to be discarded, as specified by the Diameter base standard. If true, this parameter ignores the mandatory flag when processing received unrecognised AVPs.
Note that unrecognised AVPs are still decoded as far as possible and passed onto applications when true, but will not have a name and will have a raw value.
This has no impact on sent AVPs.
(Default = true, ignore the mandatory flag in received unrecognised AVPs)
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)
ignore_disconnect_cause Boolean Element Whether to ignore the Disconnect-Cause AVP in received Disconnect-Peer-Request messages.
If false and the received Disconnect-Cause is not 0 (REBOOTING), the connection will require manual re-enablement via the API or Management GUI.
Otherwise, the connection will be reestablished on the usual retry schedule.
Only applicable when socket_mode is connect.
(Default = true, ignore reconnection control)
result_code_busy_dpa Boolean Element The Diameter Result-Code to send in a Disconnect-Peer-Answer message to indicate that the connection should not be terminated due to the DiameterApp still having outstanding requests or responses.
(Default = 5012, DIAMETER_UNABLE_TO_COMPLY)
close_send_dpr Boolean Element Whether to send a Disconnect-Peer-Request message when N2SVCD is shut down or a connection is manually disconnected.
If true, the connected peer (if any) will be notified that the Diameter connection will be closed imminently. The Disconnect-Cause AVP will be set to 0 (REBOOTING) in this case.
Otherwise, no message will be sent.
(Default = true, notify of imminent connection closure)
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: