FW: Add queue
Tue, 10 Aug 1999 09:06:26 -0400
> 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:firstname.lastname@example.org]
> Sent: Monday, August 09, 1999 6:26 PM
> To: 'Haobo Yu'
> Cc: 'email@example.com'
> Subject: RE: Add queue
> 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.
> 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
> queue size over the duration of the simulation, should I use the trace
> 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,