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

Re: Link Utilisation



Dear Colin, ns-users,

On Wed, 18 Aug 1999, Colin Horsington wrote:

> Also after experimenting with Queuemonitor, it appears (and please correct
> me if I am wrong) that when using a duplex link the queuemonitor state
> variables (parraivals_, barrivals_, pdepartures_,bdepartures, the others I
> have not tested) monitor the packets arriving or departing on the link. ie
> at both ends, and therefore both queues at each end.

I am not so familiar with the Queuemonitor -- I "only" use it to trace
the queue length.
 
> Back to link utilisation...

I tried a different approach which works fine for me.

I modified the class Queue ( queue.{h,cc} ).  Specifically I added a
command which allows me to attach a file handle to a queue object --
this is where the trace infos go.

So in my sim script I do something like:

set qlog [open tracefile w]
[[$ns link $n0 $n1] queue] attach $qlog
# don't forget to close your tracefiles when you`re finished!

Moreover I modified the code ( queue.cc ) to put an entry into the
attached file whenever the state of the queue changes from BLOCKED to
UNBLOCKED (or the other way around).  Having run the simulation, my
tracefile looks something like:

QUEUE blocked 0.0018
QUEUE unblocked 0.0058
QUEUE blocked 0.1018
QUEUE unblocked 0.1058
QUEUE blocked 0.2018
QUEUE unblocked 0.2058
QUEUE blocked 0.3018
QUEUE unblocked 0.3058
QUEUE blocked 0.611624
QUEUE unblocked 0.619624
[...]

>From this file I calculate the link utilization using a Tcl script (I
wrote it myself, beware!).  It outputs the link util. for time
intervals with an adjustable length, e.g.:

% link-util tracefile 0.5

outputs the link util. in percent for the intervals:
0.0 .. 0.5
0.5 .. 1.0
1.0 .. 1.5
[...]

Given the above tracefile this would result in:
0.5 3.2    // i.e. link util. of 3.2% for the interval 0 .. 0.5
1.0 6.4
1.5 9.6
2.0 16.0
2.5 24.58
[...]

This output can then be fed to gnuplot or something else.

This approach does not slow down my sims to a degree that would be
worth mentioning.  Note that if there are some packets in the queue,
no trace entry has to be written because the queue is blocked all the
time.  Subsequently the log files are small for links with a high link
util.

Any comments?  Does this sound like a reasonable approach to you??

If you are really interested, feel free to contact me.  I can send
you the modified queue.{h,cc} and my Tcl script if you want it (after
having translated some of the german comments that I just found in the
code... ;-)

regards,
chris


 -----------------------------------------------------------------
  Christof Brandauer                        [email protected]
  Student of Applied Informatics                 
  Department of Computer Science, University of Salzburg, Austria
 -----------------------------------------------------------------