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

Instantiation problem - new type of Queue



Dear ns-users,

I have a problem that I can't seem to solve on my own :-(
so any ideas or solutions would be greatly appreciated!

I've done some work on a queue management algorithm using ns-1 and I'm
now trying to implement this in ns-2.

The new type of queue I've implemented is called BUCQueue. This is how
I register the new class:

   static class BUCClass : public TclClass {
   public:
      BUCClass () : TclClass ("Queue/BUC") {}
      TclObject* create(int, const char*const*) {
         return (new BUCQueue);
      }
   } class_buc;


I've added code to ns-default.tcl to initialize BUC parameters:

   Queue/BUC set thresh 60000
   Queue/BUC set max_down 0.5
   etc.


Moreover I've added the following to ns-lib.tcl in 'Simulator instproc
simplex-link' (I use the same mechanism as in RED) 

   if {[string first "BUC" $type] != -1} {
           $q link [$link_($sid:$did) set link_]
   }



I do however not seem to be able to instantiate a link using a
BUCQueue. Running the following script (only the first lines)

   set ns [new Simulator]

   set n0 [$ns node]
   set n1 [$ns node]

   # N0 -> N1
   $ns simplex-link $n0 $n1 2Mb 10ms BUC


produces the following output:

   can't read "off_CtrMcast_": no such variable
       (Object set line 1)
       invoked from within
   "DelayLink set off_CtrMcast_"
       invoked from within
   "catch "$c set $var" val"
       (procedure "_o14" line 1)
       (SplitObject unknown line 1)
       invoked from within
   "$queue_ target $link_"
       (procedure "_o15" line 18)
       (SimpleLink init line 18)
       invoked from within
   "_o15 init _o10 _o12 2Mb 10ms _o14"
       (Class create line 1)
       invoked from within
   "SimpleLink create _o15 _o10 _o12 2Mb 10ms _o14"
       invoked from within
   "catch "$className create $o $args" msg"
       (procedure "new" line 3)
       invoked from within
   "new SimpleLink $nd1 $nd2 $bw $delay $q"
       (procedure "_o3" line 65)
       (Simulator simplex-link line 65)
       invoked from within
   "$ns simplex-link $n0 $n1 2Mb 10ms BUC"
       (file "first.tcl" line 10)



I guess that I'm making some major mistake somewhere but unfortunately
I can't figure out where.

many thanks in advance,
chris


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