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

#include <wifi-mac-queue.h>

+ Inheritance diagram for ns3::WifiMacQueue:

Classes

struct  Item
 

Public Member Functions

Ptr< const PacketDequeue (WifiMacHeader *hdr)
 
Ptr< const PacketDequeueByTidAndAddress (WifiMacHeader *hdr, uint8_t tid, WifiMacHeader::AddressType type, Mac48Address addr)
 
Ptr< const PacketDequeueFirstAvailable (WifiMacHeader *hdr, Time &tStamp, const QosBlockedDestinations *blockedPackets)
 
Ptr< const PacketDequeueForChannel (WifiMacHeader *hdr, uint16_t channel)
 
void Enqueue (Ptr< const Packet > packet, const WifiMacHeader &hdr)
 
void Flush (void)
 
Time GetMaxDelay (void) const
 
uint32_t GetMaxSize (void) const
 
uint32_t GetNPacketsByTidAndAddress (uint8_t tid, WifiMacHeader::AddressType type, Mac48Address addr)
 
uint32_t GetSize (void)
 
bool IsEmpty (void)
 
bool IsEmpty (uint16_t channel)
 
Ptr< const PacketPeek (WifiMacHeader *hdr)
 
Ptr< const PacketPeekByTidAndAddress (WifiMacHeader *hdr, uint8_t tid, WifiMacHeader::AddressType type, Mac48Address addr)
 
Ptr< const PacketPeekFirstAvailable (WifiMacHeader *hdr, Time &tStamp, const QosBlockedDestinations *blockedPackets)
 
void PushFront (Ptr< const Packet > packet, const WifiMacHeader &hdr)
 
bool Remove (Ptr< const Packet > packet)
 
void SetMaxDelay (Time delay)
 
void SetMaxSize (uint32_t maxSize)
 
- Public Member Functions inherited from ns3::Object
void AggregateObject (Ptr< Object > other)
 
void Dispose (void)
 
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)
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount (const SimpleRefCount &o)
 
uint32_t GetReferenceCount (void) const
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 
void Ref (void) const
 
void Unref (void) const
 
- Public Member Functions inherited from ns3::ObjectBase
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)
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
static void Cleanup (void)
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 

Private Types

typedef std::list< struct ItemPacketQueue
 
typedef std::list< struct Item >
::iterator 
PacketQueueI
 
typedef std::list< struct Item >
::reverse_iterator 
PacketQueueRI
 

Private Member Functions

void Cleanup (void)
 
Mac48Address GetAddressForPacket (enum WifiMacHeader::AddressType type, PacketQueueI)
 

Private Attributes

Time m_maxDelay
 
uint32_t m_maxSize
 
WifiMacParameters * m_parameters
 
PacketQueue m_queue
 
uint32_t m_size
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 
virtual void DoDispose (void)
 
virtual void DoInitialize (void)
 
virtual void NotifyNewAggregate (void)
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 
virtual void NotifyConstructionCompleted (void)
 

Detailed Description

This queue implements the timeout procedure described in IEEE Std. 802.11-2007, section 9.9.1.6, paragraph 6.

When a packet is received by the MAC, to be sent to the PHY, it is queued in the internal queue after being tagged by the current time.

When a packet is dequeued, the queue checks its timestamp to verify whether or not it should be dropped. If dot11EDCATableMSDULifetime has elapsed, it is dropped. Otherwise, it is returned to the caller.

Config Paths

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

  • /NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/BE_EdcaTxopN/Queue
  • /NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/BK_EdcaTxopN/Queue
  • /NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/DcaTxop/Queue
  • /NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/VI_EdcaTxopN/Queue
  • /NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/VO_EdcaTxopN/Queue

Attributes

  • MaxPacketNumber: If a packet arrives when there are already this number of packets, it is dropped.
  • MaxDelay: If a packet stays longer than this delay in the queue, it is dropped.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +10000000000.0ns
    • Flags: construct write read

No TraceSources are defined for this type.

Definition at line 53 of file wifi-mac-queue.h.

Member Function Documentation

Ptr< const Packet > ns3::WifiMacQueue::DequeueByTidAndAddress ( WifiMacHeader hdr,
uint8_t  tid,
WifiMacHeader::AddressType  type,
Mac48Address  addr 
)

Searchs and returns, if is present in this queue, first packet having address indicated by type equals to addr, and tid equals to tid. This method removes the packet from this queue. Is typically used by ns3::EdcaTxopN in order to perform correct MSDU aggregation (A-MSDU).

Definition at line 201 of file wifi-mac-queue.cc.

References NS_ASSERT.

Ptr< const Packet > ns3::WifiMacQueue::DequeueFirstAvailable ( WifiMacHeader hdr,
Time tStamp,
const QosBlockedDestinations blockedPackets 
)

Returns first available packet for transmission. A packet could be no available if it's a QoS packet with a tid and an address1 fields equal to tid and addr respectively that index a pending agreement in the BlockAckManager object. So that packet must not be transmitted until reception of an ADDBA response frame from station addressed by addr. This method removes the packet from queue.

Definition at line 377 of file wifi-mac-queue.cc.

uint32_t ns3::WifiMacQueue::GetNPacketsByTidAndAddress ( uint8_t  tid,
WifiMacHeader::AddressType  type,
Mac48Address  addr 
)

Returns number of QoS packets having tid equals to tid and address specified by type equals to addr.

Definition at line 353 of file wifi-mac-queue.cc.

References NS_ASSERT.

bool ns3::WifiMacQueue::IsEmpty ( uint16_t  channel)

If packet wasn't tagged with a destination channel and we're requesting a packet on channel 1 (base channel), then return non empty.

Definition at line 261 of file wifi-mac-queue.cc.

Ptr< const Packet > ns3::WifiMacQueue::PeekByTidAndAddress ( WifiMacHeader hdr,
uint8_t  tid,
WifiMacHeader::AddressType  type,
Mac48Address  addr 
)

Searchs and returns, if is present in this queue, first packet having address indicated by type equals to addr, and tid equals to tid. This method doesn't remove the packet from this queue. Is typically used by ns3::EdcaTxopN in order to perform correct MSDU aggregation (A-MSDU).

Definition at line 230 of file wifi-mac-queue.cc.

References NS_ASSERT.

Ptr< const Packet > ns3::WifiMacQueue::PeekFirstAvailable ( WifiMacHeader hdr,
Time tStamp,
const QosBlockedDestinations blockedPackets 
)

Returns first available packet for transmission. The packet isn't removed from queue.

Definition at line 399 of file wifi-mac-queue.cc.

bool ns3::WifiMacQueue::Remove ( Ptr< const Packet packet)

If exists, removes packet from queue and returns true. Otherwise it takes no effects and return false. Deletion of the packet is performed in linear time (O(n)).

Definition at line 324 of file wifi-mac-queue.cc.


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