[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] DiffServ source code question
Hi all,
In function enque() of class redQueue (in file dsredq.cc), there are some thing magic to me. It's very kind of you to explain them for me.
In mode DropTail, to determine the status of packet (ENQUEUE or DROP), NS2 does as follows:
if (mredMode == dropTail) {
if (q_->length() >= qParam_[0].edp_.th_min)
return PKT_DROPPED;
else {
q_->enque(pkt);
return PKT_ENQUEUE;
}
}
In this piece of code, I noticed that NS2 only uses value edp_.th_min of virtual queue 0 to determine the fate of packet (ENQUEUE or DROP). So
- how about the value of other virtual queue (if we have several) ?
- how about the other values such as : edp_.th_max, edp_max_p_inv ? When we configure the virtual queue, we also set values for these attributes. Maybe they are used for other redMode ?
- I used the example ds-cbr-tb.tcl in directory ../ns/tcl/ex/diffserv (with a little change : set the redMode of queue qCE2 to DropTail) to test this piece of code and I recognized:
+ the results are always the same regardless the changes of parameters of virtual queues of qCE2
+ the value of columns ldrops and edrops always 0 -> the packets are never dropped -> the q_length() is always smaller than the qParam_[0].edp_.th_min.
I tried to print out the value of queue length and saw that it is always 0.
Well, I don't know why the queue length is always 0 ?
The comparision "Bigger" here is correct ?
Any explanations are welcome.
Thank you in advance,
Tuan