[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ns] Problem with connections
I am a new user of 'ns' and this is what I can figure out.
--> Basically, there is no difference between 'connect' and
'create-connection' except that latter one gives you a higher abstraction
in the sense that you dont't have to create agents and attach them to
nodes. The "create-connectionn' does it for you and moreover after doing
so, it calls 'connect' proc. So, basically there is no difference between
them.
--> Regarding the order of execution problem, I hope you may be detecting
this problem because of the following thing. I think you created only
one traffic agent and attached it to node 1. Then you possibly did
$ns connect { $n1_agent $n2_agent}
$ns connect { $n1_agent $n3_agent}
Now, if you study the code of 'connect' in ns-lib.tcl , you will notice
that it calls 'simplex-connect', which binds the destination adress and
port to agents. So, calling the 'connect' twice with the same agent (in
your case $n1_agent) would try to attach destination port and address
to $n1_agent twice in succession, thus overriding the first call and
only the last call effect would remain.
Hope it helps.
Cheers !
Amit
----------------------------------------------------------------------------
Amit Jain
Senior Undergraduate Work Phone : 91-(0)512-597653
Computer Science Department Home Phone : 91-(0)512-597311
Indian Institute Of Technology,
Kanpur - 208016
INDIA
> On Sat, 27 Jan 2001, Christopher.Holtby wrote:
>
> > Can anyone help me?
> >
> > What is the difference between "$ns_ connect .." and "$ns_
> > create-connection .."?
> >
> > If "connect" is used for two pairs of mobilenodes, why does it matter in
> > what order they are executed?
> >
> > I'm trying to setup a connection from one mobilenode to two others,
> > like this:
> > 1------2
> > \
> > \
> > 3
> >
> > but can't seem to get both 2 & 3 to listen to 1. I'm sure the problem is
> > to do with "connect" but can't work out how to solve it.
> >
> > Thanks,
> >
> > Chris.
> >
>
>