- # non-rt class - use red
- min = int(maxrate[i] * 1024 / 8 * 0.05)
- if (min < avpkt) min = avpkt
- dqb = 8 * min;
- max = int(2.1*min)
- rburst = int((2*min + max) / (3 * avpkt))
+ # non-rt class - use RED
+
+ avpkt = pktsize[i]
+ # don't use avpkt values less than 500 bytes
+ if (avpkt < 500) avpkt = 500
+ # if avpkt is too close to min, scale down avpkt to allow proper bursting
+ if (avpkt > min * 0.70) avpkt *= 0.70
+
+
+ # according to http://www.cs.unc.edu/~jeffay/papers/IEEE-ToN-01.pdf a drop
+ # probability somewhere between 0.1 and 0.2 should be a good tradeoff
+ # between link utilization and response time (0.1: response; 0.2: utilization)
+ prob="0.12"
+
+ rburst=int((2*min + max) / (3 * avpkt))