I can't debug your problem but from what I understand by looking the
source code
and using ns attach-agent is used to bind an Agent object to source generators
or sinks. For example:
set tcp [new Agent/TCP]
$ns attach-agent $somenode %tcp
(I think this is valid too: $somenode attach-agent $tcp)
and the same applies to Applications too:
set ftp [new Application/FTP]
$ftp attach-agent $tcp
Whereas connect is used to create a "virtual" connection between two agents so
they can communicate:
(Continuing from above)
set sink [new Agent/TCPSink]
$ns connect $tcp $sink
I hope I was helpful.
ggeorgak
Quoting Renata Vidal <[EMAIL PROTECTED]>:
>
> What's the difference among atttach-agent and connect?
>
> It's look like the connect is about 2 agents, and the attach-agent is about
> node and agent. It's correct!?
>
> I'm experiencing the message above, it always implies with all lines with
> "connect", so I'm doing something wrong. Any tip will be appreciated
>
> can't read "agent_addr_": no such variable
> while executing
> "subst $[subst $var]"
> (procedure "_o19" line 5)
> (SplitObject set line 5)
> invoked from within
> "$dst set agent_addr_"
> (procedure "_o3" line 2)
> (Simulator simplex-connect line 2)
> invoked from within
> "$self simplex-connect $src $dst"
> (procedure "_o3" line 9)
> (Simulator connect line 9)
> invoked from within
> "$ns connect $udp($i) $s($i)"
> ("for" body line 10)
> invoked from within
> "for {set i 0} {$i < $numeroNodos} {incr i} {
> set udp($i) [new Agent/UDP]
> $udp($i) set packetSize_ 512
> $udp($i) set fid_ ($i)
> set cbr($i) [new Appl..."
> (file "renata.tcl" line 89)
>
> Thanks, Renata
> --
> Renata Vidal
> "Triste é o destino de quem tenta vencer as batalhas e ter sucesso nos
> ataques sem cultivar o espírito da iniciativa (A Arte da Guerra – SUN TSU –
> pg 102)"
>