[erlang-questions] : : sctp_peeloff() support in OTP

'Raimo Niskanen' raimo+erlang-questions@REDACTED
Tue Apr 21 09:38:12 CEST 2009


On Tue, Apr 21, 2009 at 01:15:03AM +0200, Valentin Micic wrote:
> One thing puzzles me: is there support for {active, once} in gen_sctp, as it
> would assume head-of-line blocking? Or maybe I should ask a different
> question: if {active, once} is to be supported, how one could go about
> implementing it without defeating the purpose behind SCTP?

Could you elaborate...?
I guess {active, once} today would simply be flow control
of all streams towards the port owner. You can not choose
which streams to control.

> 
> I am thinking:
> 
> (1) {active, [once, StreamNo, TargetPID]} 
>     {active, [once, default, TargetPID]}
> 
> As well as:
> 
> (2)  {active, [true, StreamNo, TargetPID]}
>      {active, [true, default, TargetPID]}
> 
> Where:
>  - StreamNo represents a stream of interest;
>  - TargetPID, a PID to which traffic received over StreamNo should be
> forwarded to.
>  - default specify what to do with streams that are not explicitly
> referenced.
> 
> Wouldn't this imply SCTP peel-off functionality?

Yes it would, sort of. With this solution one Port would
deliver messages to several PIDs, so it would have to
remember those relations.

Many PIDs would use the same Port for sending,
so the normal port lock would probably be inadequate, 
the SCTP driver (which is the same as the TCP/UDP driver
aka inet_drv) would have to do its own locking and since
the code is shared between SCTP/TCP/UDP the question is
how it would complicate the driver or how it will affect
TCP/UDP.

Many PIDs would receive messages from the Port, but one
PId would be the owner and the only one notified if
the Port is killed.

Those are the first reasons I remember why I think
an sctp_peeloff() that creates a new Port that uses
the new file descriptor optained from sctp_peeloff()
(if i remember correctly it works that way) would
be a more fitting model. But I have not had time
to think it through thoroughly - trying to implement
it and see how it goes would probably be the best way.


> 
> V.
> 
> PS
> In a case you're already doing this -- my apologies for reinventing a hot
> water.
> 
> 
> -----Original Message-----
> From: erlang-questions-bounces@REDACTED
> [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Raimo Niskanen
> Sent: 20 April 2009 02:39 PM
> To: Maxim Treskin; erlang-questions@REDACTED
> Subject: Re: [erlang-questions] : sctp_peeloff() support in OTP
> 
> On Mon, Apr 20, 2009 at 07:07:03PM +0700, Maxim Treskin wrote:
> > What is active mode? If socket port sends messages to process without
> > gen_sctp:recv is active mode, then it works now. May be it is something
> > another?
> 
> Well, what do you know, I had already fixed it but forgot
> all about it. But our test suites really could test it
> much more...
> 
> What about you open source users. Is active mode working
> fine for you? Under heavy load?
> 
> In that case Peeloff is a possible next large feature to implement,
> if not the only missing large feature...? Anybody missing
> something other important?
> 
> > 
> > -- 
> > Maxim Treskin
> 
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://www.erlang.org/mailman/listinfo/erlang-questions
> 
> -- 
> 
> / Raimo Niskanen, Erlang/OTP, Ericsson AB
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list