Hi Ahmed,
>From what I see, the error is caused by $link_([$n1 id]:[$n2 id]) I think there is no link connecting nodes $n0 and $n1. You are asking NS2 to monitor the link which does not exist. Make sure that there is a link connecting $n0 and $n1 "BEFORE" invoking monitor-queue. If you would like to learn how to read OTcl error message, please read http://www.ns2ultimate.com/post/419191200/tcl-error-message-in-ns2 Best Regards, Teerawat Issariyakul http://www.ns2ultimate.com/ http://www.facebook.com/pages/Teerawat-Issariyakul/358240861417 http://twitter.com/T_Bear http://www.t-issariyakul.blogspot.com http://www.ece.ubc.ca/~teerawat On 7/9/2010, "Ahmed Hesham" <ahes...@live.com> wrote: > > > > > > > > > > > > > Dear All > >I am having this error while trying to run monitor-queue > > > >can't read "link_(5:6)": no such variable > while executing >"$link_([$n1 id]:[$n2 id]) init-monitor $self $qtrace $sampleInterval" > (procedure "_o3" line 3) > (Simulator monitor-queue line 3) > invoked from within >"$ns_ monitor-queue $n0 $n1 stdout" > invoked from within >"set qmon [$ns_ monitor-queue $n0 $n1 stdout]" > (file "ranWless.tcl" line 165) > >this tcl script is > >set queue [open queue w] >set qmon [$ns_ monitor-queue $n0 $n1 stdout]; >[$ns_ link $n0 $n1] queue-sample-timeout; >proc queueLength {} { >global ns_ qmon queue >set time 0.05 >set length [$qmon set pkts_] >set now [$ns_ now] >puts $queue "$now $length" >$ns_ at [expr $now+$time] "queueLength" >} >$ns_ at 0.0 "queueLength" > >Hotmail: Powerful Free email with security by Microsoft. Get it now. >_________________________________________________________________ >Hotmail: Powerful Free email with security by Microsoft. >https://signup.live.com/signup.aspx?id=60969 >