[Ns-developers] [bug] Differentiated Services module - RED algorithm

Lengyel Miklós mlengyel at inf.unideb.hu
Fri Dec 14 07:00:51 PST 2007


Dear Sally,

As you observed from the source code the RED in diffserv module
doesn't support gentle mode. The implementation of this feature could be
a nice target for the development of future releases.
Returning to the original problem, PKT_EDROPPED is also used to gather
packet
loss statistics (look at diffserv/dsred.cc, function dsREDQueue::enque, for
ex. stats.edrops++).
And as you mentioned packets that arrive when the average queue is greater
than maxthresh are dropped and these
are early drops. But the implementation (diffserv/dsredq.cc, function
redQueue::enque) treat this packets 
as if they were link drops (PKT_DROPPED).
I modified the source code according to my suggestion and the output of the
printStats (packet loss statistics) function changed drastically (proportion
of link drop and early drop).

Best regards,
	Miklos Lengyel


Miklos -

> I think there is a bug in the DiffServ module of ns (version 2.32),  
> namely
> in the implemetation of the RED algorithm. In my opinion the wrong  
> line is
> in file diffserv/dsredq.cc line number 239 in function redQueue::enque  
> :
>
> "return PKT_DROPPED;"
>
> This is the case when the RED drops a packet because the average queue  
> is
> greater than the max. threshold. I think the above line should be  
> "return
> PKT_EDROPPED;" because PKT_DROPPED should happen only when the link  
> drops a
> packet. When the RED algorithm drops a packet it should be early drop
> (PKT_EDROPPED).
>
> Please let me know if I am right or not.

Looking at the diffserv code (which I have never looked at before),
PKT_EDROPPED is there so that the flowmonitor can monitor
early drops.

/ 
*----------------------------------------------------------------------- 
------
void edrop(Packet* pkt)
     This method is used so that flowmonitor can monitor early drops.
------------------------------------------------------------------------ 
-----*/

But without knowing what the flow monitor is *doing* with
the early drops that it is counting, it is hard to tell whether
it would include packets dropped when the average queue size
is greater than maxthresh, or not.

 From a quick glance, it would seem that the RED in the diffserv
code doesn't use gentle mode, so all packets that arrive
when the average queue is greater than maxthresh are dropped.
That is, although these are still early drops, they aren't a good
statistical sample of the arriving traffic.

- Sally
http://www.icir.org/floyd/



More information about the Ns-developers mailing list