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

BUG on cbq.cc





Hello..

I am new to the ns and using the ns version 2.1b4.
It seems that there is a BUG in cbq.cc. Please correct me if I am wrong about
the following or my CBQ algorithm understanding.
To change the bandwidth allocation, we can do 

     $cbqclass newallot $bw.

In the code, it says

     double diff = allotment_ - bw;
     allotment_ = bw;
     cbq_->addallot(pri_, diff);

If the current allotment for the cbqclass is 0.8 and new allotment is 0.4, 
then it will execute addallot(pri_,0.4). If the current allotment for 
the pri_ is 0.9, then new allotment for pri_ is 1.3 which is more than 1. 
On the other hand, if the current allotment is 0.4 and new allotment is 1, 
then it will execute addallot(pri_,-0.6). If the current allotment for the 
pri_ is 0.5 then new allotment for pri_ is -0.1 which is less than 0.

Is this correctly working? I think "double diff = allotment_ - bw;" needs to
be changed to "double diff = bw - allotment_;" ??

Thanks in advance.

		Hyeong Soo Chang.