Tuesday 12 March 2013

Set Up SCTP in Linux From SCTP Module

Fedora has SCTP kernel as the kernel module, kernel recompile is not needed for our case. Instead, the SCTP kernel module is simply needed to be loaded into the RAM memory on the Fedora with the command ‘modprobe’. The command ‘modprobe SCTP’ plays a role on loading SCTP module into the RAM; see Figure 1


Figure 1 Load SCTP module into the kernel

The SCTP module should be loaded on both the server and the client. After that, it can be assumed that both the server and client have already configured the Linux platform so that they are capable of supporting the SCTP protocol. The next step is to activate the DAR extension of SCTP, to ensure that mSCTP is supported by Linux. The parameter ‘addip_enable’ is the indicator whether DAR extension is active or not. When ‘addipenable’ is 0, Add-IP extension is inactive while it is active when ‘addip-enable’ is 1.
Command ‘echo 1>/proc/sys/net/sctp/addip_enable’ is used to make Linux support mSCTP. Command ‘more /proc/sys/net/sctp/addip_enable’ approves the information.





Figure 2 Active Add-IP extension of SCTP

One problem with the SCTP protocol in Linux is that it does not support SCTP APIs itself, while SCTP APIs are required to be used for coding the mSCTP handover. At this point, we downloaded an additional tool from http://sourceforge.net/projects/lksctp/files/ called LKSCTP, which is able to provide SCTP API functions. There are many versions of the LKSCTP tool, the latest one is 1.0.11. The one used in our testbed is version 1.0.10. The following steps have been taken to build LKSCTP in Linux:
  • Become root user to install LKSCTP by command: su –
  • Enter the LKSCTP directory containing the download RPM files of LKSCTP by command cd /root/sctpfolder (directory).
  • Install the RPM flies by command: rpm *.lksctp-tools-1.0.10-1.rpm
  • Other way is from source Untar the LKSCTP tools directory from the gzipped tarball by command: tar –xzvf lksctp-tools-1.0.10.tar
  • Enter the LKSCTP tool directory by command: cd /lksctp-tools-1.0.10
  • configure LKSCTP by command: ./configure
  • make LKSCTP by command: make
After the success of “make” operation, the LKSCTP tools has been loaded into the Linux
kernel. The following Figure shows how to check whether LKSCTP is supported by
Linux or not.

Figure 3 LKSCTP tools for Linux


In Figure 3, the command ‘checksctp’ indicates whether the server and the client support LKSCTP or not. The result shows that both of them support LKSCTP


Share This!



3 comments:

  1. thanks for the post! it was pleasure and easy to follow.
    Keep up the gud work. :)

    ReplyDelete
  2. Hello There,


    Such vivid info on the Solutions to Different Linux Problems ! Flabbergasted! Thank you for making the read a smooth sail!

    so there is the Linux kernel , being updated regularly (so far so good).
    On top of it every Linux distribution is built, being updated to the most recent kernel, too.
    But, when someone wants to port a specific linux distro, what does he do?
    He cross-compiles the kernel (that ends in .tar.bz2) after he implements any patch?
    Then what?

    Very useful post !everyone should learn and use it during their learning path.


    Many Thanks,
    Radhey

    ReplyDelete
  3. Under this sctp tool I want to add some functionality . Actually I have a client Java application that generates traffic on the Server host on port 3868 but it throws the error 'Address already in use' because an already existing process preoccupies the 3868 port via TCP. I have tried to kill that TCP process and invoke SCTP on port 3868 but it wont work. I want to use SO_REUSEADDR so that the connection can use same port 3868 for more than one process and the error 'Address already in Use' can be fixed.

    ReplyDelete

Here We Write The Problems we face at different situations and Solutions to those problems.