A Discrete-Event Network Simulator
API
ns3::WifiMacQueue Class Reference

This queue implements the timeout procedure described in (Section 9.19.2.6 "Retransmit procedures" paragraph 6; IEEE 802.11-2012). More...

#include "wifi-mac-queue.h"

+ Inheritance diagram for ns3::WifiMacQueue:
+ Collaboration diagram for ns3::WifiMacQueue:

Public Types

enum  DropPolicy { DROP_NEWEST , DROP_OLDEST }
 drop policy More...
 

Public Member Functions

 WifiMacQueue (AcIndex ac=AC_UNDEF)
 Constructor. More...
 
 ~WifiMacQueue ()
 
Ptr< WifiMacQueueItemDequeue (void) override
 Dequeue the packet in the front of the queue. More...
 
void DequeueIfQueued (Ptr< const WifiMacQueueItem > mpdu)
 Dequeue the given MPDU if it is stored in this queue. More...
 
bool Enqueue (Ptr< WifiMacQueueItem > item) override
 Enqueue the given Wifi MAC queue item at the end of the queue. More...
 
Time GetMaxDelay (void) const
 Return the maximum delay before the packet is discarded. More...
 
uint32_t GetNBytes (uint8_t tid, Mac48Address dest) const
 Return the number of bytes in the queue having tid equal to tid and destination address equal to dest. More...
 
uint32_t GetNBytes (void)
 
uint32_t GetNPackets (uint8_t tid, Mac48Address dest) const
 Return the number of QoS packets in the queue having tid equal to tid and destination address equal to dest. More...
 
uint32_t GetNPackets (void)
 
uint32_t GetNPacketsByAddress (Mac48Address dest)
 Return the number of packets having destination address specified by dest. More...
 
uint32_t GetNPacketsByTidAndAddress (uint8_t tid, Mac48Address dest)
 Return the number of QoS packets having TID equal to tid and destination address equal to dest. More...
 
bool IsEmpty (void)
 
Ptr< const WifiMacQueueItemPeek (void) const override
 Peek the packet in the front of the queue. More...
 
Ptr< const WifiMacQueueItemPeekByAddress (Mac48Address dest, Ptr< const WifiMacQueueItem > item=nullptr) const
 Search and return, if present in the queue, the first packet (either Data frame or QoS Data frame) having the receiver address equal to addr. More...
 
Ptr< const WifiMacQueueItemPeekByTid (uint8_t tid, Ptr< const WifiMacQueueItem > item=nullptr) const
 Search and return, if present in the queue, the first packet having the TID equal to tid. More...
 
Ptr< const WifiMacQueueItemPeekByTidAndAddress (uint8_t tid, Mac48Address dest, Ptr< const WifiMacQueueItem > item=nullptr) const
 Search and return, if present in the queue, the first packet having the receiver address equal to dest, and TID equal to tid. More...
 
Ptr< const WifiMacQueueItemPeekFirstAvailable (const Ptr< QosBlockedDestinations > blockedPackets=nullptr, Ptr< const WifiMacQueueItem > item=nullptr) const
 Return first available packet for transmission. More...
 
bool PushFront (Ptr< WifiMacQueueItem > item)
 Enqueue the given Wifi MAC queue item at the front of the queue. More...
 
Ptr< const WifiMacQueueItemRemove (Ptr< const WifiMacQueueItem > item, bool removeExpired=false)
 Remove the given item from the queue and return the item following the removed one, if any, or a null pointer otherwise. More...
 
Ptr< WifiMacQueueItemRemove (void) override
 Remove the packet in the front of the queue. More...
 
void Replace (Ptr< const WifiMacQueueItem > currentItem, Ptr< WifiMacQueueItem > newItem)
 Replace the given current item with the given new item. More...
 
void SetMaxDelay (Time delay)
 Set the maximum delay before the packet is discarded. More...
 
template<class CALLABLE >
void Transform (Ptr< const WifiMacQueueItem > item, CALLABLE func)
 Transform the given item by invoking the given function with the given item as parameter. More...
 
bool TtlExceeded (Ptr< const WifiMacQueueItem > item, const Time &now)
 Remove the given item if it has been in the queue for too long. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Member Functions

Ptr< WifiMacQueueItemDoDequeue (ConstIterator pos)
 Wrapper for the DoDequeue method provided by the base class that additionally resets the iterator field of the item and updates internal statistics, if an item was dequeued. More...
 
bool DoEnqueue (ConstIterator pos, Ptr< WifiMacQueueItem > item)
 Wrapper for the DoEnqueue method provided by the base class that additionally sets the iterator field of the item and updates internal statistics, if insertion succeeded. More...
 
Ptr< WifiMacQueueItemDoRemove (ConstIterator pos)
 Wrapper for the DoRemove method provided by the base class that additionally resets the iterator field of the item and updates internal statistics, if an item was dropped. More...
 
bool Insert (ConstIterator pos, Ptr< WifiMacQueueItem > item)
 Enqueue the given Wifi MAC queue item before the given position. More...
 
bool TtlExceeded (ConstIterator &it, const Time &now)
 Remove the item pointed to by the iterator it if it has been in the queue for too long. More...
 

Private Attributes

AcIndex m_ac
 the access category More...
 
DropPolicy m_dropPolicy
 Drop behavior of queue. More...
 
Time m_maxDelay
 Time to live for packets in the queue. More...
 
std::unordered_map< WifiAddressTidPair, uint32_t, WifiAddressTidHashm_nQueuedBytes
 Per (MAC address, TID) pair queued bytes. More...
 
std::unordered_map< WifiAddressTidPair, uint32_t, WifiAddressTidHashm_nQueuedPackets
 Per (MAC address, TID) pair queued packets. More...
 
TracedCallback< Ptr< const WifiMacQueueItem > > m_traceExpired
 Traced callback: fired when a packet is dropped due to lifetime expiration. More...
 
 NS_LOG_TEMPLATE_DECLARE
 redefinition of the log component More...
 

Detailed Description

This queue implements the timeout procedure described in (Section 9.19.2.6 "Retransmit procedures" paragraph 6; IEEE 802.11-2012).

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/Txop/Queue"

Attributes

  • MaxSize: The max queue size
  • MaxDelay: If a packet stays longer than this delay in the queue, it is dropped.
    • Set with class: ns3::TimeValue
    • Underlying type: Time +9.22337e+18ns:+9.22337e+18ns
    • Initial value: +5e+08ns
    • Flags: construct write
  • DropPolicy: Upon enqueue with full queue, drop oldest (DropOldest) or newest (DropNewest) packet
    • Set with class: ns3::EnumValue
    • Underlying type:
    • Initial value: DropNewest
    • Flags: construct write read

TraceSources

  • Expired: MPDU dropped because its lifetime expired.
    Callback signature: ns3::WifiMacQueueItem::TracedCallback

TraceSources defined in parent class ns3::Queue<WifiMacQueueItem>

  • Enqueue: Enqueue a packet in the queue.
    Callback signature: ns3::WifiMacQueueItem::TracedCallback
  • Dequeue: Dequeue a packet from the queue.
    Callback signature: ns3::WifiMacQueueItem::TracedCallback
  • Drop: Drop a packet (for whatever reason).
    Callback signature: ns3::WifiMacQueueItem::TracedCallback
  • DropBeforeEnqueue: Drop a packet before enqueue.
    Callback signature: ns3::WifiMacQueueItem::TracedCallback
  • DropAfterDequeue: Drop a packet after dequeue.
    Callback signature: ns3::WifiMacQueueItem::TracedCallback

TraceSources defined in parent class ns3::QueueBase

Size of this type is 456 bytes (on a 64-bit architecture).

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

Member Enumeration Documentation

◆ DropPolicy

drop policy

Enumerator
DROP_NEWEST 
DROP_OLDEST 

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

Constructor & Destructor Documentation

◆ WifiMacQueue()

ns3::WifiMacQueue::WifiMacQueue ( AcIndex  ac = AC_UNDEF)

Constructor.

Parameters
acthe Access Category of the packets stored in this queue

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

◆ ~WifiMacQueue()

ns3::WifiMacQueue::~WifiMacQueue ( )

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

References m_nQueuedBytes, m_nQueuedPackets, and NS_LOG_FUNCTION_NOARGS.

Member Function Documentation

◆ Dequeue()

Ptr< WifiMacQueueItem > ns3::WifiMacQueue::Dequeue ( void  )
override

Dequeue the packet in the front of the queue.

Returns
the packet

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

References DoDequeue(), ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and TtlExceeded().

+ Here is the call graph for this function:

◆ DequeueIfQueued()

void ns3::WifiMacQueue::DequeueIfQueued ( Ptr< const WifiMacQueueItem mpdu)

Dequeue the given MPDU if it is stored in this queue.

Parameters
mpduthe given MPDU

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

References DoDequeue(), m_ac, NS_ASSERT, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DoDequeue()

Ptr< WifiMacQueueItem > ns3::WifiMacQueue::DoDequeue ( ConstIterator  pos)
private

Wrapper for the DoDequeue method provided by the base class that additionally resets the iterator field of the item and updates internal statistics, if an item was dequeued.

Parameters
posthe position of the item to dequeue
Returns
the item.

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

References ns3::AC_UNDEF, ns3::Queue< Item >::DoDequeue(), m_nQueuedBytes, m_nQueuedPackets, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by Dequeue(), DequeueIfQueued(), Replace(), and Transform().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoEnqueue()

bool ns3::WifiMacQueue::DoEnqueue ( ConstIterator  pos,
Ptr< WifiMacQueueItem item 
)
private

Wrapper for the DoEnqueue method provided by the base class that additionally sets the iterator field of the item and updates internal statistics, if insertion succeeded.

Parameters
posthe position before where the item will be inserted
itemthe item to enqueue
Returns
true if success, false if the packet has been dropped.

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

References m_ac, m_nQueuedBytes, and m_nQueuedPackets.

Referenced by Insert().

+ Here is the caller graph for this function:

◆ DoRemove()

Ptr< WifiMacQueueItem > ns3::WifiMacQueue::DoRemove ( ConstIterator  pos)
private

Wrapper for the DoRemove method provided by the base class that additionally resets the iterator field of the item and updates internal statistics, if an item was dropped.

Parameters
posthe position of the item to drop
Returns
the item.

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

References ns3::AC_UNDEF, ns3::Queue< Item >::DoRemove(), m_nQueuedBytes, m_nQueuedPackets, and NS_ASSERT.

Referenced by Insert(), Remove(), and TtlExceeded().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Enqueue()

bool ns3::WifiMacQueue::Enqueue ( Ptr< WifiMacQueueItem item)
override

Enqueue the given Wifi MAC queue item at the end of the queue.

Parameters
itemthe Wifi MAC queue item to be enqueued at the end
Returns
true if success, false if the packet has been dropped

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

References Insert(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetMaxDelay()

Time ns3::WifiMacQueue::GetMaxDelay ( void  ) const

Return the maximum delay before the packet is discarded.

Returns
the maximum delay

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

References m_maxDelay.

◆ GetNBytes() [1/2]

uint32_t ns3::WifiMacQueue::GetNBytes ( uint8_t  tid,
Mac48Address  dest 
) const

Return the number of bytes in the queue having tid equal to tid and destination address equal to dest.

The complexity in the average case is constant. However, packets expired since the last non-const operation on the queue are included in the returned count.

Parameters
tidthe given TID
destthe given destination
Returns
the number of bytes in the queue

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

References m_nQueuedBytes.

◆ GetNBytes() [2/2]

uint32_t ns3::WifiMacQueue::GetNBytes ( void  )
Returns
The number of bytes currently occupied by the packets in the Queue

Overrides the GetNBytes method provided by QueueBase

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

References ns3::QueueBase::GetNBytes(), ns3::Simulator::Now(), NS_LOG_FUNCTION, and TtlExceeded().

+ Here is the call graph for this function:

◆ GetNPackets() [1/2]

uint32_t ns3::WifiMacQueue::GetNPackets ( uint8_t  tid,
Mac48Address  dest 
) const

Return the number of QoS packets in the queue having tid equal to tid and destination address equal to dest.

The complexity in the average case is constant. However, packets expired since the last non-const operation on the queue are included in the returned count.

Parameters
tidthe given TID
destthe given destination
Returns
the number of QoS packets in the queue

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

References m_nQueuedPackets.

◆ GetNPackets() [2/2]

uint32_t ns3::WifiMacQueue::GetNPackets ( void  )
Returns
The number of packets currently stored in the Queue

Overrides the GetNPackets method provided by QueueBase

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

References ns3::QueueBase::GetNPackets(), ns3::Simulator::Now(), NS_LOG_FUNCTION, and TtlExceeded().

+ Here is the call graph for this function:

◆ GetNPacketsByAddress()

uint32_t ns3::WifiMacQueue::GetNPacketsByAddress ( Mac48Address  dest)

Return the number of packets having destination address specified by dest.

The complexity is linear in the size of the queue.

Parameters
destthe given destination
Returns
the number of packets

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

References ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and TtlExceeded().

+ Here is the call graph for this function:

◆ GetNPacketsByTidAndAddress()

uint32_t ns3::WifiMacQueue::GetNPacketsByTidAndAddress ( uint8_t  tid,
Mac48Address  dest 
)

Return the number of QoS packets having TID equal to tid and destination address equal to dest.

The complexity is linear in the size of the queue.

Parameters
tidthe given TID
destthe given destination
Returns
the number of QoS packets

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

References ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and TtlExceeded().

+ Here is the call graph for this function:

◆ GetTypeId()

◆ Insert()

bool ns3::WifiMacQueue::Insert ( ConstIterator  pos,
Ptr< WifiMacQueueItem item 
)
private

Enqueue the given Wifi MAC queue item before the given position.

Parameters
posthe position before which the item is to be inserted
itemthe Wifi MAC queue item to be enqueued
Returns
true if success, false if the packet has been dropped

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

References DoEnqueue(), DoRemove(), DROP_OLDEST, ns3::QueueBase::GetNPackets(), m_dropPolicy, ns3::Simulator::Now(), NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::PACKETS, and TtlExceeded().

Referenced by Enqueue(), PushFront(), Replace(), and Transform().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsEmpty()

bool ns3::WifiMacQueue::IsEmpty ( void  )
Returns
true if the queue is empty; false otherwise

Overrides the IsEmpty method provided by QueueBase

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

References ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and TtlExceeded().

+ Here is the call graph for this function:

◆ Peek()

Ptr< const WifiMacQueueItem > ns3::WifiMacQueue::Peek ( void  ) const
override

Peek the packet in the front of the queue.

The packet is not removed.

Returns
the packet

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

References m_maxDelay, ns3::Simulator::Now(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ PeekByAddress()

Ptr< const WifiMacQueueItem > ns3::WifiMacQueue::PeekByAddress ( Mac48Address  dest,
Ptr< const WifiMacQueueItem item = nullptr 
) const

Search and return, if present in the queue, the first packet (either Data frame or QoS Data frame) having the receiver address equal to addr.

If item is not a null pointer, the search starts from the packet following item in the queue; otherwise, the search starts from the head of the queue. This method does not remove the packet from the queue.

Parameters
destthe given destination
itemthe item after which the search starts from
Returns
the peeked packet or nullptr if no packet was found

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

References m_maxDelay, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ PeekByTid()

Ptr< const WifiMacQueueItem > ns3::WifiMacQueue::PeekByTid ( uint8_t  tid,
Ptr< const WifiMacQueueItem item = nullptr 
) const

Search and return, if present in the queue, the first packet having the TID equal to tid.

If item is not a null pointer, the search starts from the packet following item in the queue; otherwise, the search starts from the head of the queue. This method does not remove the packet from the queue.

Parameters
tidthe given TID
itemthe item after which the search starts from
Returns
the peeked packet or nullptr if no packet was found

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

References m_maxDelay, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ PeekByTidAndAddress()

Ptr< const WifiMacQueueItem > ns3::WifiMacQueue::PeekByTidAndAddress ( uint8_t  tid,
Mac48Address  dest,
Ptr< const WifiMacQueueItem item = nullptr 
) const

Search and return, if present in the queue, the first packet having the receiver address equal to dest, and TID equal to tid.

If item is not a null pointer, the search starts from the packet following item in the queue; otherwise, the search starts from the head of the queue. This method does not remove the packet from the queue. It is typically used by ns3::QosTxop in order to perform correct MSDU aggregation (A-MSDU).

Parameters
tidthe given TID
destthe given destination
itemthe item after which the search starts from
Returns
the peeked packet or nullptr if no packet was found

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

References m_maxDelay, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ PeekFirstAvailable()

Ptr< const WifiMacQueueItem > ns3::WifiMacQueue::PeekFirstAvailable ( const Ptr< QosBlockedDestinations blockedPackets = nullptr,
Ptr< const WifiMacQueueItem item = nullptr 
) const

Return first available packet for transmission.

If item is not a null pointer, the search starts from the packet following item in the queue; otherwise, the search starts from the head of the queue. The packet is not removed from queue.

Parameters
blockedPacketsthe destination address & TID pairs that are waiting for a BlockAck response
itemthe item after which the search starts from
Returns
the peeked packet or nullptr if no packet was found

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

References m_maxDelay, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ PushFront()

bool ns3::WifiMacQueue::PushFront ( Ptr< WifiMacQueueItem item)

Enqueue the given Wifi MAC queue item at the front of the queue.

Parameters
itemthe Wifi MAC queue item to be enqueued at the front
Returns
true if success, false if the packet has been dropped

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

References Insert(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ Remove() [1/2]

Ptr< const WifiMacQueueItem > ns3::WifiMacQueue::Remove ( Ptr< const WifiMacQueueItem item,
bool  removeExpired = false 
)

Remove the given item from the queue and return the item following the removed one, if any, or a null pointer otherwise.

If removeExpired is true, all the items in the queue from the head to the given position are removed if their lifetime expired.

Parameters
itemthe item to be removed
removeExpiredtrue to remove expired items
Returns
the item following the removed one, if any, or a null pointer, otherwise

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

References DoRemove(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, and TtlExceeded().

+ Here is the call graph for this function:

◆ Remove() [2/2]

Ptr< WifiMacQueueItem > ns3::WifiMacQueue::Remove ( void  )
override

Remove the packet in the front of the queue.

Returns
the packet

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

References DoRemove(), ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and TtlExceeded().

+ Here is the call graph for this function:

◆ Replace()

void ns3::WifiMacQueue::Replace ( Ptr< const WifiMacQueueItem currentItem,
Ptr< WifiMacQueueItem newItem 
)

Replace the given current item with the given new item.

Actually, the current item is dequeued and the new item is enqueued in its place. In this way, statistics about queue size (in terms of bytes) are correctly updated.

Parameters
currentItemthe given current item
newItemthe given new item

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

References DoDequeue(), Insert(), m_ac, NS_ABORT_IF, NS_ASSERT, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ SetMaxDelay()

void ns3::WifiMacQueue::SetMaxDelay ( Time  delay)

Set the maximum delay before the packet is discarded.

Parameters
delaythe maximum delay

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

References m_maxDelay, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ Transform()

template<class CALLABLE >
void ns3::WifiMacQueue::Transform ( Ptr< const WifiMacQueueItem item,
CALLABLE  func 
)

Transform the given item by invoking the given function with the given item as parameter.

The given function must be an object of a callable type and must have an argument of type pointer to WifiMacQueueItem. Actually, the given item is dequeued and the transformed item is enqueued in its place. In this way, statistics about queue size (in terms of bytes) are correctly updated.

Internal:
If this method needs to be overloaded, we can use SFINAE to help in overload resolution:
template <class CALLABLE,
std::invoke_result_t<CALLABLE, Ptr<WifiMacQueueItem>>* = nullptr>
void Transform (Ptr<const WifiMacQueueItem> item, CALLABLE func);
void Transform(Ptr< const WifiMacQueueItem > item, CALLABLE func)
Transform the given item by invoking the given function with the given item as parameter.

Unfortunately, this will break python bindings scanning.

Template Parameters
CALLABLE[deduced] The type of the given function object
Parameters
itemthe given item
functhe given function object

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

References DoDequeue(), Insert(), m_ac, NS_ABORT_IF, and NS_ASSERT.

+ Here is the call graph for this function:

◆ TtlExceeded() [1/2]

bool ns3::WifiMacQueue::TtlExceeded ( ConstIterator &  it,
const Time now 
)
inlineprivate

Remove the item pointed to by the iterator it if it has been in the queue for too long.

If the item is removed, the iterator is updated to point to the item that followed the erased one.

Parameters
itan iterator pointing to the item
nowa copy of Simulator::Now()
Returns
true if the item is removed, false otherwise

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

References DoRemove(), m_maxDelay, m_traceExpired, and NS_LOG_DEBUG.

+ Here is the call graph for this function:

◆ TtlExceeded() [2/2]

bool ns3::WifiMacQueue::TtlExceeded ( Ptr< const WifiMacQueueItem item,
const Time now 
)

Remove the given item if it has been in the queue for too long.

Return true if the item is removed, false otherwise.

Parameters
itemthe item whose lifetime is checked
nowa copy of Simulator::Now()
Returns
true if the item is removed, false otherwise

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

References NS_ASSERT.

Referenced by Dequeue(), GetNBytes(), GetNPackets(), GetNPacketsByAddress(), GetNPacketsByTidAndAddress(), Insert(), IsEmpty(), and Remove().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_ac

AcIndex ns3::WifiMacQueue::m_ac
private

the access category

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

Referenced by DequeueIfQueued(), DoEnqueue(), Replace(), and Transform().

◆ m_dropPolicy

DropPolicy ns3::WifiMacQueue::m_dropPolicy
private

Drop behavior of queue.

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

Referenced by GetTypeId(), and Insert().

◆ m_maxDelay

Time ns3::WifiMacQueue::m_maxDelay
private

Time to live for packets in the queue.

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

Referenced by GetMaxDelay(), Peek(), PeekByAddress(), PeekByTid(), PeekByTidAndAddress(), PeekFirstAvailable(), SetMaxDelay(), and TtlExceeded().

◆ m_nQueuedBytes

std::unordered_map<WifiAddressTidPair, uint32_t, WifiAddressTidHash> ns3::WifiMacQueue::m_nQueuedBytes
private

Per (MAC address, TID) pair queued bytes.

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

Referenced by ~WifiMacQueue(), DoDequeue(), DoEnqueue(), DoRemove(), and GetNBytes().

◆ m_nQueuedPackets

std::unordered_map<WifiAddressTidPair, uint32_t, WifiAddressTidHash> ns3::WifiMacQueue::m_nQueuedPackets
private

Per (MAC address, TID) pair queued packets.

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

Referenced by ~WifiMacQueue(), DoDequeue(), DoEnqueue(), DoRemove(), and GetNPackets().

◆ m_traceExpired

TracedCallback<Ptr<const WifiMacQueueItem> > ns3::WifiMacQueue::m_traceExpired
private

Traced callback: fired when a packet is dropped due to lifetime expiration.

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

Referenced by GetTypeId(), and TtlExceeded().

◆ NS_LOG_TEMPLATE_DECLARE

ns3::WifiMacQueue::NS_LOG_TEMPLATE_DECLARE
private

redefinition of the log component

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


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