Hallo ns-users

I am working to extend the controlled load service implemented with 
intergrated service
in Ns2 (file: .../adc/simple-intserv-sched.cc) so that it will support 
multiservices.
That is I want to add more queues so that each class of service will be 
mapped to a
queue. Here is the c++ code to create 4 queues for the multiservice:

#define CLASSES 4

class MultiClassServ : public Queue {
public:
        MultiClassServ() {
                int i;
                char buf[10];
                for (i=0;i<CLASSES;i++) {
                        q_[i] = new PacketQueue;
                        qlimit_[i] = 0;
                        sprintf(buf,"qlimit%d_",i);
                        bind(buf,&qlimit_[i]);
                }
        }
        protected :
        void enque(Packet *);
        Packet *deque();
        int command(int argc, const char*const* argv);
        PacketQueue *q_[CLASSES];
        int qlimit_[CLASSES];
};


The multiple queues created in an array in the above code is added as 
an object to a
link. The problem I am having now is how to add the measurement module 
in the link to
measure each of the queue in the array of packet queues.

The original implemented intserv link (../tcl/lib/ns-intserv.tcl) did 
the measurement for
controlled load service queue in the link as follows:

        if { [lindex $arg 5] == "CL" } {
                #Create a suitable est unit                 set esttype 
[lindex $arg 4]
                set est_ [new Est/$esttype]
                $est_ set src_ [$src id]
                $est_ set dst_ [$dst id]
                $adc_ attach-est $est_ 1

                #Create a Measurement Module                 set 
measmod_ [new MeasureMod]
                $measmod_ target $queue_       ;# measurement module 
set here to measure queue.
                $adc_ attach-measmod $measmod_ 1
        }
In this case there is one queue. But in my extension there are 4 
queues. The problem is
that, I can create four instances of the measurement module but I have 
only one instance
of the queue object. Do anyone have idea how i can have access to each 
of the queue in
the queue array to measure it and also to monitor it?

I am very grateful for your help!
Thanks!
Jobby.

-- 



Reply via email to