Hi All,

Did anyone have a chance to count the number of packets
sitting in a drop-tail queue precisely?

I have the latest ns v.2.33 and faced the following issue:
I was running simple script with the following topology 
>       node ----- router1 ---- router2 ----- receiver
where the link type between routers was set to DropTail 
and queue limit was set to 16 packets
>       set rout_link  [$ns duplex-link $r1 $r2 $bw_rout $delay_rout DropTail]
>       $ns queue-limit $r1 $r2 16

I enabled  trace-all' traces and then parsed the output 
file with the simple awk script. The idea was to see the 
time-dependent built of the bottleneck queue. As a result the 
number of packets in a queue never reached its limit of 16 and 
packets started dropping when queue built was equal to 15 
packets instead of 16 as it should be.

I took a look at the 
>       void DropTail::enque(Packet* p)
function which is implemented in the 
>       \ns-2.33\queue\drop-tail.cc,
file and found that one of the conditions to enable "packet drop"
mechanism is not quite correct (from my viewpoint):
>       if ( + (q_->length() + 1) >= qlim_ +)
Here q_->length() is the current number of packets sitting 
in a queue and qlim_ is a queue-limit (which is 16). This 
explains why the packet-drop started at 15 packets: 15 + 1 
is equal to 16 thus a packet is dropped. It can be 'cured' 
easily by exchanging >= with >.

Link queue is pretty old and one of the basic features 
in ns. So the question is:
"Is it a real bug and nobody ever tried to count the number 
of packets sitting in a queue precisely or it is kinda 
specific logic of ns queue management?"

I understand that it is a minor bug but I just wanted to know 
someone's opinion concerning this issue.

Best regards,
Dmitry Sinelnikov

Reply via email to