Bug 457 - [contribution] drop tail queue with byte limits
[contribution] drop tail queue with byte limits
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: network
ns-3-dev
All All
: P3 normal
Assigned To: Craig Dowell
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-31 18:08 EST by Salik Syed
Modified: 2009-02-19 01:20 EST (History)
2 users (show)

See Also:


Attachments
src files (2.16 KB, application/x-zip-compressed)
2008-12-31 18:08 EST, Salik Syed
Details

Note You need to log in before you can comment on or make changes to this bug.
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.