Relay Agent Message Flows

Introduction

The JSLEE Diameter service, acting as a Diameter Agent will act as a Diameter relay and/or Diameter proxy between peers and in doing so can perform a variety of actions related to message manipulation and redirection.

This section of the overall Diameter Gateway documentation covers the most frequently seen Diameter relay and proxy scenarios that may be encountered and how the JSLEE Diameter service handles these.

Basic Diameter Relay

As the simplest form of an Agent, the service may be tasked with relaying Diameter requests between two peers. However, even such a straightforward Agent deployment requires careful consideration.

  1. The JSLEE must accept incoming authentication requests from Diameter Peer(s) over which Diameter requests will be received.
  2. The JSLEE must initiate and maintain authenticated connections with Diameter Peer(s) over which the relayed Diameter requests will be sent.

The most basic Diameter relay will perform no logic beyond routing to the correct endpoint, and onward to the correct host:

Simple Diameter Relay - Sequence Diagram

Deployment of a Diameter relay of this configuration requires JSLEE services for both inbound and outbound Diameter. The same service can be used for both - however for clarity it is preferred to use separate service definitions:

{
  "applications": {
    "diam-in-1": {
      "handler": "nz.co.nsquared.slee.diameter.DiameterVerticle",
      "configuration": {
        "endpoints": [
          {
            "interface": "127.0.0.1",
            "port": 3868,
            "origin-host": "slee-01-in.jslee.nsquared.io",
            "origin-realm": "jslee.nsquared.io",
            "is-server": true,
            "applications": [
              {
                "class-path": "nz.co.nsquared.slee.diameter.application.agent.Agent"
                // additional config to be documented
    }]}]}},
    "diam-out-1": {
      "handler": "nz.co.nsquared.slee.diameter.DiameterVerticle",
      "configuration": {
        "endpoints": [
          {
            "port": 3868,
            "name": "alpha",
            "interface": "10.9.8.90",
            "remote-server": "10.42.2.172",
            "origin-realm": "jslee.nsquared.io",
            "origin-host": "slee-01-out.jslee.nsquared.io",
            "is-server": false,
            "applications": [
              {
                "class-path": "nz.co.nsquared.slee.diameter.application.agent.Agent"
          }]},
          {
            "port": 3868,
            "name": "beta",
            "interface": "10.9.8.90",
            "remote-server": "10.42.2.48",
            "origin-realm": "jslee.nsquared.io",
            "origin-host": "slee-01-out.jslee.nsquared.io",
            "is-server": false,
            "applications": [
              {
                "class-path": "nz.co.nsquared.slee.diameter.application.agent.Agent"
}]}]}}}}

This configuration will start two JSLEE services, diam-in-1 and diam-out-1:

Additionally:

Diameter Relay by Realm

Extending the basic Diameter relay configuration, the Agent can relay to the appropriate Destination-Host based on the Destination-Realm in incoming messages. This is the most likely relay configuration required, and allows the JSLEE to determine the available Diameter Peer within each Diameter realm it maintains a connection to:

Diameter Relay by Realm - Sequence Diagram

Deployment of a Diameter relay of this configuration requires also JSLEE services for both inbound and outbound Diameter, and the configuration is only slightly changed to the basic relay case:


In addition to the features of the simple relay configuration, with Realm-based relay the solution enables:

Diameter Routing

By default, the Agent will perform relay functionality based on the Diameter-Host or Diameter-Realm provided by incoming Diameter requests. However, in many scenarios the final Diameter realm should be selected by the JSLEE agent based on AVP information. The most frequently seen example of this is Realm selection based on Subscription-ID (or User-Identifier).

To achieve this, the AVP-replacement feature of the Agent can be used to replace the Destination-Realm and Destination-Host with the value provided by a lookup:

Diameter Relay by Realm with Lookup - Sequence Diagram

The configuration for this setup is the same as for Diameter relay by Destination-Realm, with the addition of configuration for AVP replacement:

{
  "avps": {
    "Destination-Realm": {
      "lookup-avp": "Subscription-Id[0].Subscription-Id-Data",
      "cache": "ported_numbers"
    },
    "Destination-Host": null
  }
}

For lookup of the realm, a cache is expected to be configured within the agent application itself.

Note: