Discussion:
[asio-users] SCTP support
Mike Haben
2012-06-08 16:32:26 UTC
Permalink
There was some discussion on this list a couple of years ago (see
http://comments.gmane.org/gmane.comp.lib.boost.asio.user/3964) about
adding SCTP support to the ASIO library. I've had another look at this
and, I must admit, not got much further than coming to understand the
magnitude of the problem, but for what it's worth I've modified Hal
Finkel's code (thanks Hal) to match the current Asio scheme of .hpp
"interface" and .ipp "implementation" files and added a couple of socket
options that I needed - repository at
https://github.com/CompleteAndUtterGit/boost_asio_sctp
contains this code, plus a very simple server application that
illustrates what already works and what remains to sort out. As Hal
noted before, the first stumbling block seems to be how to create a
variant of async_read that passes back two metadata items from the SCTP
packet header (stream number and payload protocol ID) as well as the
number of bytes in the packet and the error code.

On a slight tangent, I've also had a go at getting the simple-server
code going on Windows, using Bruce Cran's SctpDrv library. Even less
success so far - I've established that it needs to be built with
win_iocp disabled in order to avoid an immediate run-time error in
async_accept, but now I'm finding that async_accept does not respond to
incoming connections (OnAccept never gets called). Something for
another day...

So, is anyone else interested in SCTP?

Mike Haben
OvermindDL1
2012-06-08 16:46:20 UTC
Permalink
Post by Mike Haben
There was some discussion on this list a couple of years ago (see
http://comments.gmane.org/gmane.comp.lib.boost.asio.user/3964) about
adding SCTP support to the ASIO library. I've had another look at this
and, I must admit, not got much further than coming to understand the
magnitude of the problem, but for what it's worth I've modified Hal
Finkel's code (thanks Hal) to match the current Asio scheme of .hpp
"interface" and .ipp "implementation" files and added a couple of socket
options that I needed - repository at
https://github.com/CompleteAndUtterGit/boost_asio_sctp
contains this code, plus a very simple server application that
illustrates what already works and what remains to sort out. As Hal
noted before, the first stumbling block seems to be how to create a
variant of async_read that passes back two metadata items from the SCTP
packet header (stream number and payload protocol ID) as well as the
number of bytes in the packet and the error code.
On a slight tangent, I've also had a go at getting the simple-server
code going on Windows, using Bruce Cran's SctpDrv library. Even less
success so far - I've established that it needs to be built with
win_iocp disabled in order to avoid an immediate run-time error in
async_accept, but now I'm finding that async_accept does not respond to
incoming connections (OnAccept never gets called). Something for
another day...
So, is anyone else interested in SCTP?
Always. I use ASIO for many things but I am still unable to use it for
that.
Lothar May
2012-07-28 08:04:33 UTC
Permalink
Hi,
Post by Mike Haben
There was some discussion on this list a couple of years ago (see
http://comments.gmane.org/gmane.comp.lib.boost.asio.user/3964) about
adding SCTP support to the ASIO library. I've had another look at this
and, I must admit, not got much further than coming to understand the
magnitude of the problem, but for what it's worth I've modified Hal
Finkel's code (thanks Hal) to match the current Asio scheme of .hpp
"interface" and .ipp "implementation" files and added a couple of socket
options that I needed - repository at
https://github.com/CompleteAndUtterGit/boost_asio_sctp
contains this code, plus a very simple server application that
illustrates what already works and what remains to sort out. As Hal
noted before, the first stumbling block seems to be how to create a
variant of async_read that passes back two metadata items from the SCTP
packet header (stream number and payload protocol ID) as well as the
number of bytes in the packet and the error code.
On a slight tangent, I've also had a go at getting the simple-server
code going on Windows, using Bruce Cran's SctpDrv library. Even less
success so far - I've established that it needs to be built with
win_iocp disabled in order to avoid an immediate run-time error in
async_accept, but now I'm finding that async_accept does not respond to
incoming connections (OnAccept never gets called). Something for
another day...
So, is anyone else interested in SCTP?
Sorry for the late reply.
I've been one of the persons in the discussion about SCTP some time
ago, which you mentioned above. But I did not even get as far as to
test it on Windows using Bruce Cran's driver. It is quite senseless to
provide SCTP headers for asio if you need to release your software for
different Linux distributions. There are so many different boost
versions around and there are always problems.

I still think that, by design, asio is not suitable for different
layer 4 protocols. I have also written basic sctp support which I
tested using boost 1.42, which proves that supporting protocol
families like "streaming" and "datagram" does not require polymorphism
in asio.

The author of asio has completely ignored this discussion, and looking
at the paper
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2054.pdf
section 4.2 you can see what is meant by protocol independance in
asio. There is a working group for the next C++ standard
http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2012/n3374.htm
at least they have more generic concepts as items, so there is hope.
But this will take several years.

For the time being, the only concept that worked out for me is: If you
need SCTP support, don't use asio.

Regards,
Lothar
Post by Mike Haben
Mike Haben
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
asio-users mailing list
https://lists.sourceforge.net/lists/listinfo/asio-users
_______________________________________________
Using Asio? List your project at
http://think-async.com/Asio/WhoIsUsingAsio
Loading...