SCTP Discussions

Text archives Help


RE: [SCTP-Discussion] Sctplib on Android


Chronological Thread 
  • From: Dag Ove <daggy2k AT hotmail.com>
  • To: Michael Tuexen <michael.tuexen AT micmac.franken.de>
  • Cc: Thomas Dreibholz <dreibh AT simula.no>, "sctp-discussion AT sctp.de" <sctp-discussion AT sctp.de>
  • Subject: RE: [SCTP-Discussion] Sctplib on Android
  • Date: Thu, 27 Feb 2014 14:12:41 +0100
  • Importance: Normal
  • List-archive: <http://lists.franken.de/pipermail/sctp-discussion>
  • List-id: SCTP Discussions <sctp-discussion.sctp.de>

In the SCTP-API of sctplib: 
6.4 ULP-to-SCTP
6.4.1. sctp_initLibrary()
"This function will open raw sockets for capturing SCTP packets (IPv4 and if possible, IPv6 too) from the network and initialize the timer list. It needs to be called before any other functions of the libsctp-library are called"

I interpret the above line that function sctp_library() needs to be called regardless if using SCTP/IP or SCTP/UDP. Is it possible that if I only intend to use SCTP/UDP I dont need to call sctp_initLibrary() ?

The context I want to use SCTP/UDP is as an example protocol for comparing it to HTTP/TCP and plain UDP when exchanging SOAP messages/XML data with a Web service server, so I simply want to use in a peer-to-peer system between Android and a java server.

It had a look at usrsctp, but I had more trouble compiling the native C for Android, some classes/headers were missing (ifaddrs.h, umem.h, pthread.h). I am not very familiar with freeBSD.

SCTPLIB was easier to compile and install on Android, but the problem arised when" sctp_initLibrary()" calls "adl_init_adaptation_layer()", which in turn calls "adl_open_sctp_socket()". I don't understand why the function "adl_open_sctp_socket()" in adaptation.c tries to open a raw socket even if SCTP_OVER_UDP is set 
(ref lines 571-585 in https://github.com/dreibh/sctplib/blob/master/sctplib/sctp/adaptation.c)

I this is not an implementation error, I would be very interrested in what functions to use to enable SCTP_over_UDP.

Best Regards,
Dag Ove,
Norway


> Subject: Re: [SCTP-Discussion] Sctplib on Android
> From: Michael.Tuexen AT micmac.franken.de
> Date: Wed, 26 Feb 2014 14:22:08 +0100
> CC: sctp-discussion AT sctp.de; dreibh AT simula.no
> To: daggy2k AT hotmail.com
>
> On Feb 26, 2014, at 1:37 PM, Dag Ove <daggy2k AT hotmail.com> wrote:
>
> > Thank you for quick response!
> >
> > In "Documentation of the SCTP-Implementation - Release: sctplib-1.0"
> > under "2 General Concepts" it says:
> >
> > "All of these functions may be made use of by simply linking the static libsctp-library to an application,
> > and including the file sctp.h. As SCTP operates on top of IP, we chose to open a raw socket to catch
> > all incoming packets with the IP protocol id byte set to 132 (=SCTP). For this, it is necessary that an
> > application using the library functions have privileges to do so. On most Unix machines that means this
> > application has to be run by root (i.e. be made setuid 0)."
> And this is true for running SCTP/IP.
> >
> > After examining the adaption.c file I believe that this is the case also when the macro SCTP_OVER_UDP is set.
> > Since Android does not allow opening of raw socket, i don't think sctplib can be used on Android
> Then this is not implemented in an optimal way. Please note that I moved from developing sctplib
> to the FreeBSD kernel implementation and its port to userland, the usrsctp library.
>
> From my perspective, the sctplib only get bug fixes. Not sure if someone will change the above code.
> Thomas: Do you have any intention to do so?
> > without rooting the Android device.
> >
> > I haven't heard about usrsctp before, but will take a look at it!
> It is the port of the FreeBSD kernel implementation to userland and is
> used for RTCWeb by Firefox, Chrome and Opera.
> > Does it provide the same functionality as sctplib?
> It supports much more features and is actively maintained and used in a couple
> of browsers for RTCWeb. What is the context you want to use SCTP for?
> > Do you know if it has been tested on Android before?
> I think so, since some of the browsers run on Android...
>
> Best regards
> Michael
> >
> > Best Regards,
> > Dag Ove,
> > Norway
> >
> >> Subject: Re: [SCTP-Discussion] Sctplib on Android
> >> From: Michael.Tuexen AT micmac.franken.de
> >> Date: Wed, 26 Feb 2014 12:40:53 +0100
> >> CC: sctp-discussion AT sctp.de
> >> To: daggy2k AT hotmail.com
> >>
> >> On Feb 26, 2014, at 11:25 AM, Dag Ove <daggy2k AT hotmail.com> wrote:
> >>
> >>> Hello,
> >>>
> >>> I am trying to enable SCTP over UDP using the sctplib-1.0.15 as a native library in an Android app, using Androids Native Development Kit (NDK). The installation works since the Android kernel is Linux, but when I call the function "sctp_initLibrary();" I get in return " 1 - adaptation error ". The reason for this is that the function "adl_open_sctp_socket" fails and returns -1 when trying to create a raw socket "sfd = socket(af, SOCK_RAW, IPPROTO_UDP"
> >>> Opening raw sockets in Android is not permitted unless having root access/superuser, and I don't want to root.
> >>>
> >>> My question is: Is it possible to use the sctplib-1.0.15 to send SCTP-over-UDP without having root or superuser?
> >> Im not sure why a raw socket is used. For SCTP/UDP you only need UDP sockets.
> >> You can have a look at usrsctp, which is the FreeBSD stack running in userland,
> >> which does it like that. See
> >> http://code.google.com/p/sctp-refimpl/source/browse/#svn%2Ftrunk%2FKERN%2Fusrsctp
> >>
> >> Best regards
> >> Michael
> >>>
> >>> Best Regards,
> >>> Dag Ove,
> >>> Norway
> >>> _______________________________________________
> >>> sctp-discussion mailing list
> >>> sctp-discussion AT sctp.de
> >>> http://www.sctp.de/mailman/listinfo/sctp-discussion
> >>
>



Archive powered by MHonArc 2.6.19+.

Top of page