[ns] Attaching problem

otcl otcl at azet.sk
Tue Nov 14 13:31:39 PST 2006




-----Povodna sprava-----
Od: otcl <otcl at azet.sk>
Prijata: 13.11.2006 23:26
Pre: ns-users at isi.edu <ns-users at isi.edu>
Predmet: Attaching problem

  Hello, I'm Patrick. Can someone help with TCP problem? I'm trying to run following tcl code:   or {set i 1} {$i<=$NetNb1} { incr i } {         for {set j 1} {$j<=$NumFlows} { incr j } {                 set tcpsrc($i,$j) [new Agent/TCP/Newreno]                                 set tcp_snk($i,$j) [new Agent/TCPSink/DelAck]                 $tcpsrc($i,$j) set packetsize_ 1000                 $ns attach-agent $N1($i) tcpsrc($i,$j)                 $ns attach-agent $Server tcp_snk($i,$j)                 $ns connect $tcpsrc($i,$j) $tcp_snk($i,$j)                 set ftp($i,$j) [$tcpsrc($i,$j) attach-source FTP] } }    ....a so on, nothing difficult. But instead proper function I get the error output like this:   invalid command name "tcpsrc(1,1)"     while executing "$agent set node_ $self"     (procedure "_o58" line 4)     (Node attach line 4)     invoked from within "$node attach $agent"     (procedure "_o3" line 2)     (Simulator attach-agent line 2)     invoked from within "$ns!
  attach-agent $N1($i) tcpsrc($i,$j)         "     ("for" body line 8)     invoked from within "for {set i 1} {$i<=$NetNb1} { incr i } {         for {set j 1} {$j<=$NumFlows} { incr j } {                 set tcpsrc($i,$j) [new Agent/TCP/Newreno]                 # setting tcpsink w..."     (file "mypareto.tcl" line 54)   This part of code is from 'NS2 for beginners' (Chapter 4 - TCP/IP), but it doesn't  work. However, this code seems to be all right to me, I don't understand, why ns don't want to attach agent, and what's the problem concerned in "$agent set node_ $self". When I was trying similar code as one dimensional array (only $i) on version ns2-29 the error was the same... so there is probably some error in that part of code, but as I mentioned, I don't see, and was trying to do little changes to code, but without positive effect. Any idea? Thank You for any help friends... 


More information about the Ns-users mailing list