<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>petanode (Posts about linux_sctp_api)</title><link>https://petanode.com/</link><description></description><atom:link href="https://petanode.com/categories/linux_sctp_api.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2026 &lt;a href="mailto:tsv.dimitrov@gmail.com"&gt;Tsvetomir Dimitrov&lt;/a&gt; </copyright><lastBuildDate>Tue, 28 Apr 2026 07:09:52 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>SCTP Multi-homing in Linux</title><link>https://petanode.com/posts/sctp-multi-homing-in-linux/</link><dc:creator>Tsvetomir Dimitrov</dc:creator><description>&lt;section id="introduction"&gt;
&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;After exploring how &lt;a class="reference external" href="https://petanode.com/posts/multi-homing-in-sctp/"&gt;SCTP multi-homing works&lt;/a&gt;, it's time to see how to use this feature in Linux. This post will show how to implement multi-homing for the client-server application, used up to now. Baseline code for the development will be the 'one-to-many_advanced' branch, used in &lt;a class="reference external" href="https://petanode.com/posts/sctp-specific-socket-functions-in-linux/"&gt;SCTP specific socket functions in Linux&lt;/a&gt; post. It already uses SCTP's advanced interface so only a few modifications are required to get the job done.&lt;/p&gt;
&lt;p&gt;Implementing multi-homing means that the server should bind to more than one IP address and the client - to connect to more than one destination IP address. Both applications can also operate on single IP address. Mixed scenario is also possible, e.g. multi-homed server can communicate with non multi-homed client.&lt;/p&gt;
&lt;p&gt;The code in this post uses one-to-many styles sockets, however the approach is the same for one-to-one sockets. I am pretty sure that you will be able to handle the latter case by yourself, so I will not discuss it. Anyway do not hesitate to leave a comment, in case you have got any questions.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://petanode.com/posts/sctp-multi-homing-in-linux/"&gt;Read more…&lt;/a&gt; (6 min remaining to read)&lt;/p&gt;&lt;/section&gt;</description><category>linux</category><category>linux_sctp_api</category><category>sctp</category><guid>https://petanode.com/posts/sctp-multi-homing-in-linux/</guid><pubDate>Sun, 10 Apr 2016 17:12:09 GMT</pubDate></item><item><title>SCTP specific socket functions in Linux</title><link>https://petanode.com/posts/sctp-specific-socket-functions-in-linux/</link><dc:creator>Tsvetomir Dimitrov</dc:creator><description>&lt;section id="preface"&gt;
&lt;h2&gt;Preface&lt;/h2&gt;
&lt;p&gt;In the previous posts we have used socket related functions common for protocols other than SCTP. For example with &lt;a class="reference external" href="http://linux.die.net/man/2/connect"&gt;connect()&lt;/a&gt; you can connect to a remote peer with either TCP or SCTP socket. &lt;a class="reference external" href="http://linux.die.net/man/2/recvmsg"&gt;recvmsg()&lt;/a&gt; and &lt;a class="reference external" href="http://linux.die.net/man/2/sendmsg"&gt;sendmsg()&lt;/a&gt; can also be used with UDP and SCTP. This is normal, because SCTP has features similar to TCP (connection oriented) and UDP (message based). However SCTP's unique features deserve specific API. In this post we will review some SCTP only functions for sending and receiving messages, establishing associations and extracting local and peer IP addresses from the association.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://petanode.com/posts/sctp-specific-socket-functions-in-linux/"&gt;Read more…&lt;/a&gt; (12 min remaining to read)&lt;/p&gt;&lt;/section&gt;</description><category>linux</category><category>linux_sctp_api</category><category>sctp</category><guid>https://petanode.com/posts/sctp-specific-socket-functions-in-linux/</guid><pubDate>Sat, 07 Nov 2015 16:53:57 GMT</pubDate></item><item><title>Working with SCTP ancillary data in FreeBSD</title><link>https://petanode.com/posts/sctp-freebsd-ancillary-data/</link><dc:creator>Tsvetomir Dimitrov</dc:creator><description>&lt;section id="introduction"&gt;
&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;The socket interface provides good generalized interface for the underlying networking protocol, which is exactly what one programmer needs in most of the time. However for some more specific use cases someone might want to exploit specific protocol features, which can't present in the generalized interface. Ancillary data allows the socket interface to handle such specific protocol parameters/features, otherwise unaccessible from the socket API. Today we will add some ancillary data support to the one-to-many style application from the &lt;a class="reference external" href="https://petanode.com/posts/sctp-linux-api-one-to-many-style-interface/"&gt;previous post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Before digging right into the ancillary data I believe I owe you an explanation. My initial intention was to demonstrate the SCTP interface in Linux and as you have probably noticed, up to now I wrote only for Linux. However it turned out that not all ancillary data control messages are supported out of the box in the Linux distribution I currently use (Ubuntu 14.04.2 LTS with kernel version 3.16.0-36). Because the SCTP stack in Linux was ported from FreeBSD I decided to see what is supported there. Luckily all control messages described in &lt;a class="reference external" href="https://tools.ietf.org/html/rfc6458#section-5.3"&gt;Section 5.3&lt;/a&gt; from &lt;a class="reference external" href="https://tools.ietf.org/html/rfc6458"&gt;RFC 6458&lt;/a&gt; were supported in FreeBSD. That's why for this post I will use this operating system.&lt;/p&gt;
&lt;p&gt;If you need to use some SCTP specific features in your Linux powered project I suggest you to use sctp_sendmsg, sctp_connectx, etc.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://petanode.com/posts/sctp-freebsd-ancillary-data/"&gt;Read more…&lt;/a&gt; (13 min remaining to read)&lt;/p&gt;&lt;/section&gt;</description><category>freebsd</category><category>linux_sctp_api</category><category>sctp</category><guid>https://petanode.com/posts/sctp-freebsd-ancillary-data/</guid><pubDate>Tue, 19 May 2015 09:57:37 GMT</pubDate></item><item><title>SCTP Linux API: One-to-many style interface</title><link>https://petanode.com/posts/sctp-linux-api-one-to-many-style-interface/</link><dc:creator>Tsvetomir Dimitrov</dc:creator><description>&lt;section id="introduction"&gt;
&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In the &lt;a class="reference external" href="https://petanode.com/posts/introduction-to-the-sctp-socket-api-in-linux/"&gt;previous post&lt;/a&gt; we saw one very simple example of SCTP client-server application with the one-to-one style API. Here I will reimplement it with the one-to-many interface and we will see different approach to the same application. Again all the code used in this post is available for you on &lt;a class="reference external" href="https://github.com/tdimitrov/sctp-sandbox"&gt;this GitHub project&lt;/a&gt;. Switch to 'one-to-many_basic' branch before you continue. This and the following posts will heavily use information from &lt;a class="reference external" href="https://tools.ietf.org/html/rfc6458"&gt;RFC 6458&lt;/a&gt; Sockets API Extensions for the Stream Control Transmission Protocol (SCTP). As usual I will provide links to the relative sections for your convenience. If you are serious about using Linux's SCTP socket API I highly recommend you to read the entire specification. You will find tons of interesting information there.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://petanode.com/posts/sctp-linux-api-one-to-many-style-interface/"&gt;Read more…&lt;/a&gt; (7 min remaining to read)&lt;/p&gt;&lt;/section&gt;</description><category>linux</category><category>linux_sctp_api</category><category>sctp</category><guid>https://petanode.com/posts/sctp-linux-api-one-to-many-style-interface/</guid><pubDate>Sat, 18 Apr 2015 16:28:58 GMT</pubDate></item><item><title>Introduction to the SCTP socket API in Linux</title><link>https://petanode.com/posts/introduction-to-the-sctp-socket-api-in-linux/</link><dc:creator>Tsvetomir Dimitrov</dc:creator><description>&lt;div&gt;&lt;section id="sockets-introduction"&gt;
&lt;h2&gt;Sockets introduction&lt;/h2&gt;
&lt;p&gt;In Linux, you deal with the network stack via sockets. I assume you are familiar how they work and you have got some basic network programming knowledge in C. What I mean is that you know what functions like socket(), bind(), listen() do, how you should call them and how to implement a simple client-server application. For the purposes of this and the following posts I have created a &lt;a class="reference external" href="https://github.com/tdimitrov/sctp-sandbox"&gt;project in GitHub&lt;/a&gt;. You will find there all the code mentioned here. Please check the &lt;a class="reference external" href="https://github.com/tdimitrov/sctp-sandbox/tree/one-to-one_basic"&gt;one-to-one_basic&lt;/a&gt; branch now and make sure you understand the code there. It is nothing fancy - client and server application exchanging few messages over SCTP. Anyway if you need a refreshment or you are new to Linux socket programing check some other tutorial on this topic. There are a lot of good ones out there so just pick one you like. My personal best is &lt;a class="reference external" href="http://beej.us/guide/bgnet/"&gt;Beej's Guide to Network Programming&lt;/a&gt;.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="disclaimer-about-the-code"&gt;
&lt;h2&gt;Disclaimer about the code&lt;/h2&gt;
&lt;p&gt;Please note that the code is not at all intended to be used on production systems. It is created as a demonstration for the interfaces that I shall write about. It has got some basic checks, but it is far from production ready. If you plan to use it in your project please take some time and add proper error handling. You have been warned.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://petanode.com/posts/introduction-to-the-sctp-socket-api-in-linux/"&gt;Read more…&lt;/a&gt; (5 min remaining to read)&lt;/p&gt;&lt;/section&gt;&lt;/div&gt;</description><category>linux</category><category>linux_sctp_api</category><category>sctp</category><guid>https://petanode.com/posts/introduction-to-the-sctp-socket-api-in-linux/</guid><pubDate>Sun, 29 Mar 2015 18:45:28 GMT</pubDate></item></channel></rss>