Hi,

How do I monitor the queue size for wireless nodes?  I have tried using
the following lines of code:

+++++++++++++++++++++++++++++++++++++++++++++
  set monitor [$ns_ monitor-queue $node_(1) $node_(0) stdout]

  proc queueLength {sum number} {
    global ns monitor
    set time 0.1
    set len [$monitor set pkts ]
    set now [$ns now]
    set sum [expr $sum+$len]
    set number [expr $number+1]
    puts ‘‘[expr 1.0*$sum/$number]’’
    $ns_ at [expr $now+$time] "queueLength $sum $number"
  }
  $ns_ at 0 "queueLength 0 0"
++++++++++++++++++++++++++++++++++++++++++++++++

However, I get an error message from ns2 that states:
> can't read "link_(1:0)": 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 $node_(1) $node_(0) stdout"
>     invoked from within
> "set monitor [$ns_ monitor-queue $node_(1) $node_(0) stdout]"

Any help will be appreciated; I have checked the ns-2 manual and have not
been able to resolve this issue.

Thanks,
Daniel

Reply via email to