[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] Getting the sink of TCP connection



Thank you for your answer,

actually I had done this and it worked, but what I needed is to write a done() procedure for the TCP Agent, which will reset
the Agent and its sink.

So I would like to be able to get the particular sink of each TCP agent, so that I don't have to write a done() procedure for
every TCP Agent I create in my simulation. If that is not possible, then I guess I have to do it this way.

Bye

Nick

Xuan Chen wrote:

> Try this:
>
> set tcp [new Agent/TCP]
> $tcp set class_ 2
> set sink [new Agent/TCPSink]
> $ns attach-agent $n0 $tcp
> $ns attach-agent $n2 $sink
> $ns connect $tcp $sink
>
> Thanks.
> -chen xuan
>
> On Wed, 6 Jun 2001, Nikolaos Katsarakis Austauschstud. (M. Schweigel) wrote:
>
> > If I use the command:
> >
> > set tcp0 [$ns create-connection TCP $n0 TCPSink $n2 1]
> >
> > I only get the handle to the source agent.
> >
> > How can I afterwards get the handle to the sink agent?
> >
> > I tried set sink0 [$tpc0 target] but it didn't work.
> >
> > I tried to do $sink0 reset and got  the following error message:
> >
> > --- Classfier::no-slot{} default handler (tcl/lib/ns-lib.tcl) ---
> >         _o12: no target for slot -1
> >         _o12 type: Classifier/Hash/Dest
> > content dump:
> > classifier _o12
> >         0 offset
> >         0 shift
> >         2147483647 mask
> >         3 slots
> >                 slot 0: _o61
> >                 slot 1: _o22
> >                 slot 2: _o22
> >         -1 default
> > ---------- Finished standard no-slot{} default handler ----------
> >
> > If anybody knows the right way to use the target command (or any other command to get the handle to the target of a given
> > agent), please let me know.
> >
> > Thank you
> >
> > Nikos
> >
> >
>
> --
> Xuan Chen
> USC/ISI