Bug 457

Summary: [contribution] drop tail queue with byte limits
Product: ns-3 Reporter: Salik Syed <bcrawlsite>
Component: networkAssignee: Craig Dowell <craigdo>
Status: RESOLVED FIXED    
Severity: normal CC: ns-bugs, tomh
Priority: P3    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: src files

Description Salik Syed 2008-12-31 18:08:03 EST
Created attachment 344 [details]
src files 

I've attached the files below -- basically it's a droptailqueue which uses the cumulative number of bytes in the queue rather than number of packets when deciding whether or not to drop packets. I know it's very simple change to make took like 5 min but figured this might be useful
Comment 1 Tom Henderson 2009-01-02 10:39:36 EST
(In reply to comment #0)
> Created an attachment (id=344) [details]
> src files 
> 
> I've attached the files below -- basically it's a droptailqueue which uses the
> cumulative number of bytes in the queue rather than number of packets when
> deciding whether or not to drop packets. I know it's very simple change to make
> took like 5 min but figured this might be useful
> 

I would be OK with this class but since it is such a simple change to DropTailQueue I wonder whether it should just be added as a mode of operation of the existing class.

Another possibility along such lines would be to define a private virtual CheckOverflow (Ptr <const Packet> p) that could be used as follows:

bool
DropTailQueue::DoEnqueue (Ptr<Packet> p)
{
  NS_LOG_FUNCTION (this << p);

-  if (m_packets.size () >= m_maxPackets)
+  if (CheckOverflow (p))
    {
      NS_LOG_LOGIC ("Queue full -- droppping pkt");

and then, put the policy into CheckOverflow whether it checks a packet counter or running byte counter.  This could be enabled by two attributes such as "byteLimit" (default false) and "maxBytes".
Comment 2 Tom Henderson 2009-01-19 01:48:57 EST
Assigning to src/node maintainer to review and mark priority.