[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] Queue-monitor



Tarik Alj wrote:

> >From: "laurent marchal" <[email protected]>
> >
> >Hi all,
> >
> >I tried to get the size of a RED queue. The output-file of the queue
> >size was 0 at all time and I don't have <code> := [Qap] when i use trace
> >-all. Can you help me please ?
> >Thanks a lot.
> >
>
> Every time this proc gets called a new queue monitor is created (?) , if that's
> so I think the queue size will always be 0 Also RED is made of more than one
> queue, I am not sure monitor-queue will work as well with RED as with other
> queue schemes.
>

Yes, you only have to call it once. The actual code you need is:

set mq [open qmon.tr w]
set monq [$ns monitor-queue $n2 $n3 $mq]
set id0 [$n2 id]
set id1 [$n3 id]
set l01 [$ns set link_($id0:$id1)]
$ns at 0.0 "$l01 start-tracing"

It works with RED queues too (more than one queue in a RED queue? I don't think
so). Check tcl/ex for further examples and read queue-monitor.cc for more
documentation.

-- Felix Hernandez.