Subject: [Tsvwg] Some bugs in the QS code..

From: "Arjuna Sathiaseelan" <[email-masked]>
Date: Mon, 18 Dec 2006 12:02:46 -0000

Some bugs were found in the QS agent code (qsagent.cc) and hdr_qs.cc in
ns-2 and was reported to me by Raffaello Secchi (ISTI/CNR). 

1) qsagent.cc

The line of code: 

              aggr_approval_ += app_rate;

was found both in process function and in recv function. Thus the rate
of a single connection was added two time to aggr_approval.

2) hdr_qs.cc

.Some of the QS-requests were calculated with this formula (Bps_to_rate):

          return (int) (log(Bps / 5000) / log(2));

that means that if the rate (Bps) is less than 5000Bps, the log()
gives negative number and the requests are wrong. This can be corrected
with:

       int bpstorate = (int)ceil(log(Bps / 5000) / log(2));
       return (bpstorate >= 1 ? bpstorate : 1);

Regards

Arjuna

-------------------------------

Dr.Arjuna Sathiaseelan

Electronics Research Group

University of Aberdeen

Aberdeen AB24 3UE

Email:  <mailto:[email-masked]> [email-masked]

Web:  <http://www.erg.abdn.ac.uk/users/arjuna>
www.erg.abdn.ac.uk/users/arjuna

Phone : +44-1224-272780 
Fax :     +44-1224-272497