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

FW: Add queue



> Hi Huiwen,
> 
> Here is some code from a script that I used that traced the instantaneous
> queue size.  In my simualtion, I attach a flow monitor with an integrator
> using the following code:
> 
>     set fm [$ns makeflowmon Fid]
>     $fm attach [open flowfile.out w]
>     $fm set-pkts-integrator [new Integrator]
>     $ns attach-fmon [$ns link $r0 $c0] $fm
> 
> The new Integrator object is used for tracing the size of the queue, in
> packets.  At any time, the running sum of this Integrator can be obtained
> as follows:
> 
>     [[$fm get-pkts-integrator] set sum_]
> 
> To get the average queue size, you simply divide this sum by the elapsed
> time of the simulation.
> 
> 
> Additionally, if you wish to track the queue size in bytes, you can use a
> similar Integrator object:
> 
>     $fm set-bytes-integrator [new Integrator]
> 
> whose running sum should be accessible with the command:
> 
>     [[$fm get-bytes-integrator] set sum_]
> 
> 
> As a final note, I should point out that you should be able to use a
> QueueMonitor object in place of the FlowMon that I use.
> 
> I hope that this message helps,
> 
> Jeremy Ethridge, 
> Computing Technology Lab, 
> Nortel Networks.
> 
> 
> -----Original Message-----
> From:	Huiwen Li [SMTP:[email protected]]
> Sent:	Monday, August 09, 1999 6:26 PM
> To:	'Haobo Yu'
> Cc:	'[email protected]'
> Subject:	RE: Add queue
> 
> Hi,
> 
> Thanks for the reply. Actually I was confused because when I looked into
> monitor-queue function, there is a parameter SampleInstance, which is
> actually used in init-monitor function. But I couldn't find any use of it.
> I
> thought it was used to sample the queue length.
> 
> I am wondering if I want to record a trace of the instantaneous queue size
> sampled at each packet arrival and departure, and compute the average of
> the
> queue size over the duration of the simulation, should I use the trace
> file
> to record it or I could just use queuemonitor? Where can I get a similar
> example or has anyone done this before?
> 
> Thanks a lot,
> Huiwen
>