[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ns] Queue-monitor
>From: "laurent marchal" <[email protected]>
>To: <[email protected]>
>Subject: [ns] Queue-monitor
>MIME-Version: 1.0
>Date: Thu, 20 Jul 2000 09:56:33 +0200 (MET DST)
>Content-Transfer-Encoding: 8bit
>X-MIME-Autoconverted: from quoted-printable to 8bit by zephyr.isi.edu id
AAA23689
>
>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.
<ns-lib.tcl>
1176 Simulator instproc monitor-queue { n1 n2 qtrace { sampleInterval 0.1 } }
{
1177 $self instvar link_
1178 return [$link_([$n1 id]:[$n2 id]) init-monitor $self $qtrace
$sampleInterval]
1179 }
<ns-lib.tcl>
>proc record {} {
> global f0 n2 n3
>
> #Get an instance of the simulator
> set ns [Simulator instance]
>
> #Set the time after which the procedure should be called again
> set time 0.05
>
> # Queue-Monitor
> set mq [open qmon.tr w]
> set monq [$ns monitor-queue $n2 $n3 $mq]
>
> #Parametres de la file d'attente
> set monq0 [$monq set size_]
>
> #Get the current time
> set now [$ns now]
>
> #Write parameters to the files
> puts $f0 "$now $monq0"
>
> #Re-schedule the procedure
> $ns at [expr $now+$time] "record"
>}
>
>Regards,
>Laurent MARCHAL
Tarik Alj
INRS-Telecommunications
Place Bonaventure
900 De La Gauchetierre Ouest
Niveau C, Case Postale 644
Montreal, Qc, H5A 1C6
Canada
514 875-1266 #2036 (email preferred)