A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::DropTailQueue Class Reference

A FIFO packet queue that drops tail-end packets on overflow. More...

#include <drop-tail-queue.h>

+ Inheritance diagram for ns3::DropTailQueue:
+ Collaboration diagram for ns3::DropTailQueue:

Public Member Functions

 DropTailQueue ()
 DropTailQueue Constructor. More...
 
virtual ~DropTailQueue ()
 
DropTailQueue::QueueMode GetMode (void)
 Get the encapsulation mode of this device. More...
 
void SetMode (DropTailQueue::QueueMode mode)
 Set the operating mode of this device. More...
 
- Public Member Functions inherited from ns3::Queue
 Queue ()
 
virtual ~Queue ()
 
Ptr< PacketDequeue (void)
 Remove a packet from the front of the Queue. More...
 
void DequeueAll (void)
 Flush the queue. More...
 
bool Enqueue (Ptr< Packet > p)
 Place a packet into the rear of the Queue. More...
 
uint32_t GetNBytes (void) const
 
uint32_t GetNPackets (void) const
 
uint32_t GetTotalDroppedBytes (void) const
 
uint32_t GetTotalDroppedPackets (void) const
 
uint32_t GetTotalReceivedBytes (void) const
 
uint32_t GetTotalReceivedPackets (void) const
 
bool IsEmpty (void) const
 
Ptr< const PacketPeek (void) const
 Get a copy of the item at the front of the queue without removing it. More...
 
void ResetStatistics (void)
 Resets the counts for dropped packets, dropped bytes, received packets, and received bytes. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 
virtual ~Object ()
 
void AggregateObject (Ptr< Object > other)
 
void Dispose (void)
 Run the DoDispose methods of this object and all the objects aggregated to it. More...
 
AggregateIterator GetAggregateIterator (void) const
 
virtual TypeId GetInstanceTypeId (void) const
 
template<typename T >
Ptr< T > GetObject (void) const
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 
void Initialize (void)
 This method calls the virtual DoInitialize method on all the objects aggregated to this object. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
 
void SetAttribute (std::string name, const AttributeValue &value)
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Queue
static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
static void Cleanup (void)
 Noop. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Member Functions

virtual Ptr< PacketDoDequeue (void)
 Pull a packet from the queue. More...
 
virtual bool DoEnqueue (Ptr< Packet > p)
 Push a packet in the queue. More...
 
virtual Ptr< const PacketDoPeek (void) const
 Peek the front packet in the queue. More...
 

Private Attributes

uint32_t m_bytesInQueue
 actual bytes in the queue More...
 
uint32_t m_maxBytes
 max bytes in the queue More...
 
uint32_t m_maxPackets
 max packets in the queue More...
 
QueueMode m_mode
 queue mode (packets or bytes limited) More...
 
std::queue< Ptr< Packet > > m_packets
 the packets in the queue More...
 

Additional Inherited Members

- Public Types inherited from ns3::Queue
enum  QueueMode { QUEUE_MODE_PACKETS, QUEUE_MODE_BYTES }
 Enumeration of the modes supported in the class. More...
 
- Protected Member Functions inherited from ns3::Queue
void Drop (Ptr< Packet > packet)
 Drop a packet. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 
virtual void DoDispose (void)
 This method is called by Object::Dispose or by the object's destructor, whichever comes first. More...
 
virtual void DoInitialize (void)
 This method is called only once by Object::Initialize. More...
 
virtual void NotifyNewAggregate (void)
 This method is invoked whenever two sets of objects are aggregated together. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 
virtual void NotifyConstructionCompleted (void)
 This method is invoked once all member attributes have been initialized. More...
 

Detailed Description

A FIFO packet queue that drops tail-end packets on overflow.

Config Paths

ns3::DropTailQueue is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Queue/$ns3::DropTailQueue
  • /NodeList/[i]/DeviceList/[i]/$ns3::CsmaNetDevice/TxQueue/$ns3::DropTailQueue
  • /NodeList/[i]/DeviceList/[i]/$ns3::EmuNetDevice/TxQueue/$ns3::DropTailQueue
  • /NodeList/[i]/DeviceList/[i]/$ns3::PointToPointNetDevice/TxQueue/$ns3::DropTailQueue

Attributes

  • Mode: Whether to use bytes (see MaxBytes) or packets (see MaxPackets) as the maximum queue size metric.
    • Set with class: ns3::EnumValue
    • Underlying type:
    • Initial value: QUEUE_MODE_PACKETS
    • Flags: construct write
  • MaxPackets: The maximum number of packets accepted by this DropTailQueue.
  • MaxBytes: The maximum number of bytes accepted by this DropTailQueue.

No TraceSources are defined for this type.

TraceSources defined in parent class ns3::Queue

  • Enqueue: Enqueue a packet in the queue.
  • Dequeue: Dequeue a packet from the queue.
  • Drop: Drop a packet stored in the queue.

Definition at line 35 of file drop-tail-queue.h.

Constructor & Destructor Documentation

ns3::DropTailQueue::DropTailQueue ( )

DropTailQueue Constructor.

Creates a droptail queue with a maximum size of 100 packets by default

Definition at line 56 of file drop-tail-queue.cc.

References NS_LOG_FUNCTION.

ns3::DropTailQueue::~DropTailQueue ( )
virtual

Definition at line 64 of file drop-tail-queue.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

Ptr< Packet > ns3::DropTailQueue::DoDequeue ( void  )
privatevirtual

Pull a packet from the queue.

Returns
the packet.

Implements ns3::Queue.

Definition at line 112 of file drop-tail-queue.cc.

References ns3::Packet::GetSize(), m_bytesInQueue, m_packets, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

bool ns3::DropTailQueue::DoEnqueue ( Ptr< Packet p)
privatevirtual

Push a packet in the queue.

Parameters
pthe packet to enqueue
Returns
true if success, false if the packet has been dropped.

Implements ns3::Queue.

Definition at line 84 of file drop-tail-queue.cc.

References ns3::Queue::Drop(), ns3::Packet::GetSize(), m_bytesInQueue, m_maxBytes, m_maxPackets, m_mode, m_packets, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Queue::QUEUE_MODE_BYTES, and ns3::Queue::QUEUE_MODE_PACKETS.

+ Here is the call graph for this function:

Ptr< const Packet > ns3::DropTailQueue::DoPeek ( void  ) const
privatevirtual

Peek the front packet in the queue.

Returns
the packet.

Implements ns3::Queue.

Definition at line 135 of file drop-tail-queue.cc.

References m_bytesInQueue, m_packets, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

DropTailQueue::QueueMode ns3::DropTailQueue::GetMode ( void  )

Get the encapsulation mode of this device.

Returns
The encapsulation mode of this device.

Definition at line 77 of file drop-tail-queue.cc.

References m_mode, and NS_LOG_FUNCTION.

TypeId ns3::DropTailQueue::GetTypeId ( void  )
static

Get the type ID.

Returns
the object TypeId

Definition at line 30 of file drop-tail-queue.cc.

References m_maxBytes, m_maxPackets, ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), ns3::Queue::QUEUE_MODE_BYTES, ns3::Queue::QUEUE_MODE_PACKETS, SetMode(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

void ns3::DropTailQueue::SetMode ( DropTailQueue::QueueMode  mode)

Set the operating mode of this device.

Parameters
modeThe operating mode of this device.

Definition at line 70 of file drop-tail-queue.cc.

References m_mode, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

Member Data Documentation

uint32_t ns3::DropTailQueue::m_bytesInQueue
private

actual bytes in the queue

Definition at line 74 of file drop-tail-queue.h.

Referenced by DoDequeue(), DoEnqueue(), and DoPeek().

uint32_t ns3::DropTailQueue::m_maxBytes
private

max bytes in the queue

Definition at line 73 of file drop-tail-queue.h.

Referenced by DoEnqueue(), and GetTypeId().

uint32_t ns3::DropTailQueue::m_maxPackets
private

max packets in the queue

Definition at line 72 of file drop-tail-queue.h.

Referenced by DoEnqueue(), and GetTypeId().

QueueMode ns3::DropTailQueue::m_mode
private

queue mode (packets or bytes limited)

Definition at line 75 of file drop-tail-queue.h.

Referenced by DoEnqueue(), GetMode(), and SetMode().

std::queue<Ptr<Packet> > ns3::DropTailQueue::m_packets
private

the packets in the queue

Definition at line 71 of file drop-tail-queue.h.

Referenced by DoDequeue(), DoEnqueue(), and DoPeek().


The documentation for this class was generated from the following files: