Version

Mobius Diameter How To Launch Guide

This guide is designed to provide developers with an overview of how to set up and work with the Mobius Diameter Stack.
By following this guide, you will be able to integrate and utilize the Diameter protocol in your products easily and effectively.

1. List of main Core Components

Core Component

Description

DiameterStack

The main entry point for the Diameter stack. It manages overall operations. Allows access to DiameterProvider component based on application IDs. And/or allows to control the network

DiameterProvider

An application-specific provider that supplies all necessary components required for handling Diameter messages and sessions for a particular application.

MessageFactory 

Application specific factory dedicated to creating application-specific request and response messages.

AvpFactory

Application specific factory responsible for generating grouped Attribute-Value Pairs (AVPs) used in all request and response messages for a specified application.

SessionFactory

Application specific factory that creates sessions (client or server) for a selected application.
This should be used exclusively in stateful mode.

DiameterSession

Represents a session that can be of the following types: Authentication (Auth), Stateless Authentication (Auth Stateless), Accounting (Acc), or Credit Control. A session can function either as a client or server.

NetworkListener 

An interface designed to handle ALL incoming Diameter messages, regardless of type. This listener is stateless.

SessionListener

An interface focused on handling messages specific to application. This listener is stateful and can be configured as either a client or server.

2. Working with the Commercial Stack

2.1 Starting the Diameter Stack

To start the Diameter stack, execute the following code:

com.mobius.software.protocols.diameter.web.DiameterRunner runner=new com.mobius.software.protocols.diameter.web.DiameterRunner();
 com.mobius.software.protocols.diameter.entities.DiameterServerInterface serverInterface = runner.startServer();
 DiameterStack stack = serverInterface.getStack();

2.2 Configuring Management Interface

Once the server is started, it should be accessible via the User Interface (UI). 
Navigate to the UI using 127.0.0.1:28080 or the server's IP address with port 28080. 
From there, proceed with configuring the management module.

For detailed installation instructions, please refer to the documentation:
[Mobius Management Platform Installation]

Note: Ensure that MongoDB database is installed before using the stack. During the final configuration step, you will be requested to enter a license, which must be provided by us.

Important: The license is bound to a specific server/host. If you need to move the license, change the machine's network configuration, or make similar changes, you must first revoke the license from the current machine. Only then can you reuse the license on a different node.

2.3 Accessing the Diameter Stack UI

After configuring the management interface, you can access the Diameter Stack UI. 
You will need to configure parameters: (destinations/ servers/ links) for your peers to establish communication.

2.4 Selecting the Appropriate Provider

The next step is to select the appropriate provider for your needs. The server supports link-based application binding, meaning different servers or links can support different applications or variations of an application. 
For instance, in Credit Control, one server link might support the Ro interface, another the Gy interface, and a third link could support CreditControl Huawei. Ensure you select the correct applications when configuring your servers.

2.5 Configuring Providers for Peers

After configuring your peers, you will need to retrieve the providers you intend to use.
Example for Ro:

//classes area needed to allow proper loading of packages, otherwise compiler may not see them
Application.loadAllPackages();
                
@SuppressWarnings("unchecked")
DiameterProvider<ClientListener, ServerListener, AvpFactory, MessageFactory, SessionFactory> roProvider = (DiameterProvider<ClientListener, ServerListener, AvpFactory, MessageFactory, SessionFactory>)stack .getProvider(Long.valueOf(ApplicationID.CC.getValue()),Package.getPackage("com.mobius.software.telco.protocols.diameter.commands.ro"));

Note: The first line is necessary to load all Diameter-related classes into the ClassLoader. Without this, Java may not locate the required classes.

2.6 Connecting Listeners

The next step is to connect the appropriate listener(s). Depending on your mode of operation, you may need a server listener, a client listener, or both.
To connect a listener, use the following code:

ClusteredID<?> listenerID = stack.getIDGenerator().generateID();
RoServerListener serverListener = new RoServerListener(roProvider);
roProvider.setServerListener(listenerID, serverListener);
ClusteredID<?> listenerID = stack.getIDGenerator().generateID();
RoClientListener clientListener = new RoClientListener(roProvider);
roProvider.setClientListener(listenerID, clientListener);

Note: listenerID is necessary for removing the listener later, if needed.

Defining Listeners:

RoClientListener should be defined as following: 

public class RoClientListener implements com.mobius.software.telco.protocols.diameter.app.ro.ClientListener

RoServerListener should be defined as following: 

public class RoServerListener implements com.mobius.software.telco.protocols.diameter.app.ro.ServerListener

From this point onward, all incoming messages for the Ro interface will be received by the appropriate listener methods, including timeouts.

2.7 Initiating Traffic (Client-Side)

String sessionID = stack.generateNewSessionID();
try
{
    CreditControlRequest request = roProvider.getMessageFactory().createCreditControlRequest(originHost, originRealm, destinationHost, destinationRealm, serviceContextId, CcRequestTypeEnum.INITIAL_REQUEST, 1);
    request.setSessionId(sessionID);
    RoClientSession clientSession = roProvider.getSessionFactory().createClientSession(request);
    clientSession.sendInitialRequest(request, new AsyncCallback() 
    {                
        @Override
        public void onSuccess() 
        {
        }
                
        @Override
        public void onError(DiameterException ex) 
        {
            //handle send error here                
        }
    });
}
catch(Exception ex)
{
    //handle processing error here
}

Note: You do not need to create the session ID separately; the message factory (MessageFactory) will automatically generate a new session ID for you.

All processing in the Diameter Stack is asynchronous. The status of message sending (success or error) is delivered via callbacks, rather than as a direct return result.

Sending Subsequent Requests:
When sending second and further requests, whether within a client/server listener or elsewhere, you should repeat the procedure but you should reuse the existing session. The appropriate session is provided for all listener methods.

Start innovating with Mobius

What's next? Let's talk!

Mobius Software

As a company you'll get:

  • Get started quickly

  • Support any business model

  • Join millions of businesses

Questions? websupport@mobius.com