SCTP Support in Mobicents Diameter 1.5.0.FINAL!

Tuesday, February 5, 2013 em 10:33
Mobicents Diameter 1.5.0.FINAL has been released last week (announcement) and as it's main highlight is the addition of Stream Control Transmission Protocol (SCTP, RFC 2960).

SCTP was designed to transport PSTN signaling messages over IP Networks, but become a general purpose protocol. It brings features from both UDP and TCP protocols with important additions. The two main improvements over traditional transport protocols are:
  • Multi-homing: instead of a single IP:port connection, an SCTP connection can make use of several IP addresses, if available at the endpoint, providing physical interface fault tolerance and higher availability.
  • Multi-streaming: While in TCP if there's a loss at the head of line, all subsequent packets must be delayed until a re-transmission (Head-of-Line Blocking), SCTP supports multiple streams (up to 64K) each one with it's own ordering, not causing a delay in other streams when there are losses.
It also provides many other interesting improvements (SYN-flood protection, preserved message boundaries, built-in heartbeat, etc.) that make SCTP a great transport protocol!

The integration of SCTP in Mobicents Diameter Stack was a contribution from Smilecoms with the Mobicents team support and by using the Mobicents SCTP Library. The requirements for using it are an operating system which supports SCTP (either natively or through third-party libraries) and JDK7.  

You can enable it in Mobicents Diameter by adding the following to your jdiameter-config.xml:
<?xml version="1.0"?>
<Configuration xmlns="">
   <-- For SCTP we have to add portRange, a port range to use for establishing connections -->
   <Peer name="aaa://" portRange="25000-35000" attempt_connect="false" rating="1" />


  <-- Set SCTP classes as extension points for Connection and Network Guard -->
  <Connection value="org.jdiameter.client.impl.transport.sctp.SCTPClientConnection" />
  <NetworkGuard value="" />

So, as you see in line 8, there's a new parameter that has to be added to the peer definition, which is the portRange. Such parameter is also available for TCP but it's usage is optional, while for SCTP it is mandatory as there's no wildcard value for picking any available port.

At lines 18 and 19, it's the extension point definition, so the stack uses SCTP connection client and Network Guard instead of the default TCP.

This is it.. as simple as it gets! Hope to get some feedback on this first version of Mobicents Diameter SCTP support. Feel free to leave comments on this post or at the feature issue.

Also, make sure to check all the other enhancements in Mobicents Diameter 1.5.0.FINAL!

9 comentários

  1. Can you please add a sample code on how to achieve the same at run-time using EmptyConfiguration class?
    Thank you!

  2. It can be achieved with:

    // Add Peer (with port range)
    add(PeerRating, 1).
    add(PeerName, "aaa://").
    add(PeerLocalPortRange, "25000-35000"));

    // Set SCTP Connection and Network Guard classes
    AppConfiguration internalExtensions = (AppConfiguration) getChildren(Parameters.Extensions.ordinal())[];
    add(ExtensionPoint.InternalConnectionClass, "org.jdiameter.client.impl.transport.sctp.SCTPClientConnection").
    add(ExtensionPoint.InternalNetworkGuard, "");


  3. relics Says:


    I had followed the steps as mentioned in the below link for SCTP support.

    I had come across below exception when i start the stack as a client, On debug i had come across an observation where the ordinal values assigned to QueueSize and InternalConnectionClass seems to be same i.e 7, So when the QueueSize was retrieved it gives the SCTP connection class configured in the jdiameter-client-config due to which it gives the below exception.

    Can you please do the needful, let me know if i need to configure anything further to avoid this issue.

    java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
    at org.jdiameter.client.impl.helpers.EmptyConfiguration.getIntValue(
    at org.jdiameter.client.impl.fsm.PeerFSMImpl.(
    at org.jdiameter.client.impl.fsm.FsmFactoryImpl.createInstanceFsm(
    at org.jdiameter.client.impl.controller.PeerImpl.(

    Vinay . R M

  4. relics Says:


    Below is the issue which we identified.

    In the client XMLConfiguration add, in the addExtension method i had to replace add method with addInternalExtensions method.

    ------------omitting other codes -------------------
    changed from ---> if (nodeName.equals("MetaData")) { add(ExtensionPoint.InternalMetaData,getValue(c.item(i))); }
    changed to -----> if (nodeName.equals("MetaData")) { addInternalExtension(ExtensionPoint.InternalMetaData,getValue(c.item(i))); }

    The addInternalExtension method i was able to get it from the server package.

    Vinay R M.

  5. Vinay, thanks for the correction. I'll make sure to apply it.

  6. relics Says:

    You are welcome Alexandre.

  7. Is it possible to connect to both SCTP and TCP nodes at the same time? I removed the portRange attribute and tried.
    Doesn't seem to work though.

  8. Anonymous Says:

    Could you please provide an example of a multi-homed SCTP peer?

  9. Himank Sao Says:

    Hi Alexandre Mendonça, i have to use SCTP for diameter cx/dx interfcae to get Multimedia related parameter from the HSS. Please let me know which version of JBOSS is required as well as diameter stack to support SCTP.

Post a Comment