[Ns-developers] ns3 TCP merge candidate

Gustavo Carneiro gjcarneiro at gmail.com
Thu Jan 24 03:46:31 PST 2008


On 23/01/2008, Mathieu Lacage <mathieu.lacage at sophia.inria.fr> wrote:
>
>
> On Wed, 2008-01-23 at 13:36 -0500, Raj Bhattacharjea wrote:
>
>
> > The core of the issue is that different types of sockets have
> > different semantics i.e. stream sockets variously require
> > Connect/Listen/Close while datagram types don't.  As I see it, there
> > are two options
> >
> >      1. Our generic applications try and figure out what type of
> >         socket they are using, and use the appropriate semantics.
>
> The proper way to do this would be to use a different base class for
> stream-based semantics and for packet-based semantics. However, we did
> decide a long time ago that we would not do this and that we would use a
> single base class.
>
> >      1. Applications should assume they are working with the socket
> >         type which is the logical superset of all others, and any
> >         unsupported specific APIs will all be no-ops with error codes.
> > I believe you are advocating #2?  I have no problem with this, but
> > note that if so, the on-off app needs to change to use stream
> > semantics, and I think that essentially all future applications that
> > are supposed to work with multiple transport layers will have to talk
> > in terms of stream sockets regardless of the actual socket type being
> > used.
>
> Yes, we need to fix the applications. It was pretty hard to implement
> the applications correctly without a stream-based socket implementation
> which is why the current code does not do this correctly.


The correct design is IMHO to make applications only handle "fully prepared"
sockets, i.e. it should be the resonsibility of the client code to create
and connect the socket prior to handling it to the Application class.  Then
the Application can just use SendTo (), which works equally well for both
stream and datagram sockets (right?).

-- 
Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert


More information about the Ns-developers mailing list