[erlang-questions] Thousands of SCTP sockets

Raimo Niskanen <>
Wed May 7 18:13:23 CEST 2008


On Wed, May 07, 2008 at 04:12:28PM +0200, Mikael Lixenstrand wrote:
> I tries write a programme with thousands of sctp sockets with multi homing.
> When I open a socket against an IP i don't have to specify port but when man
> use several addresses I have to specify port. Could this be avoid a do not
> want to keep track of ports that have been used. I know that ports have to
> be the same on all IPs but i feel that i shouldn't matter.

It says in http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13#section-8.1
that "For SCTP, the port given in each socket address must be the same, or
   sctp_bindx() will fail, setting errno to EINVAL.",
which may suggest that if you give a wildcard port for every 
IP address, it may not be the same port, hence EINVAL.

It would be a nice feature if the socket layer would find a port
that is free for all IP addresses but perhaps it is too hard.

I have nevertheless traced a multi-home open a'la:
gen_sctp:open(4711, [{ip,{192,168,0,17}},{ip,{127,0,0,1}}]).
and it is the driver that reports back an error
if I use port 0 instead of 4711 - the error comes
from the code calling bindx() in the SCTP API,
so it is most probably the socket layer that fails
since using port 4711 does not.

> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list