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="http://www.jdiameter.org/jdiameter-server">
 ...
 <Network>
  <Peers>
   ...
   <-- For SCTP we have to add portRange, a port range to use for establishing connections -->
   <Peer name="aaa://127.0.0.1:1218" portRange="25000-35000" attempt_connect="false" rating="1" />
   ...
  </Peers>
  ...
 </Network>

 ...

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

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!