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

RE: [ns] Strange DiffServ Results.



I would do in this way:


in file dsred.h, class dsREDQueue, private section

	int IdleCounter[MAX_QUEUES];



in  file dsred.cc, method dsREDQueue::dsREDQueue()
		initialize the counter to 0

in  file dsred.cc, method dsREDQueue::selectQueueToDeque()


else if (schedMode==schedModeWRR) {
      if(wirrTemp[qToDq]<=0){
  	      qToDq = ((qToDq + 1) % numQueues_);
     	   wirrTemp[qToDq] = queueWeight[qToDq] - 1;
		} else {
			wirrTemp[qToDq] = wirrTemp[qToDq] -1;
		}
      while ((i < numQueues_) && (redq_[qToDq].getRealLength() == 0)) {
			// if the program enter this cicle, it means that
		      // qToDq has the right to be served
		      // but it's in idle status
			// so just increase the counter here
			IdleCounter[qToDq]++;
			wirrTemp[qToDq] = 0;
  	      qToDq = ((qToDq + 1) % numQueues_);
     	   wirrTemp[qToDq] = queueWeight[qToDq] - 1;
			i++;
		}

then just put some printf to check the counter values where you prefer.

Regards,

	Sergio


..............................................

Sergio Andreozzi

email: sergio.andreozzi@lut.fi



> -----Original Message-----
> From: Xiang [mailto:ns@cdnet.edu.cn]
> Sent: 19. hein�kuuta 2001 6:08
> To: Sungwon Yi; Sergio Andreozzi
> Cc: Ns-Users@Isi. Edu
> Subject: Re: [ns] Strange DiffServ Results.
>
>
> Excuse me, how can I check the idle time of the two queues? Thank you very
> much.
> Xiang
>