View Antoni Milton's profile on LinkedIn

Wednesday, June 9, 2010

How to write / setup SCTP client server program in RHEL system?


Before run any SCTP application, we need to install SCTP libs from

Using the below command, register the SCTP module into kernel.

#modprobe sctp

SCTP Application writing:-

SCTP client and server system call follow same as TCP. ( like socket,bind,listen and accept )

Creating SCTP socket


Before listen, we need to set the value for the no.of stream for the socket using setsockopt system call.

struct sctp_initmsg startupsctp;

startupsctp.sinit_num_ostreams = 3;

startupsctp.sinit_max_instreams = 3;

startupsctp.sinit_max_attempts = 4;

ret = setsockopt( listen_Socket, IPPROTO_SCTP, SCTP_INITMSG, & startupsctp, sizeof(startupsctp) );

Using sctp_sendmsg() and sctp_recvmsg() system calls , we can send/receive data over the SCTP socket.

Example code:-

Please refer :