WifiMacQueueItem stores (const) packets along with their Wifi MAC headers and the time when they were enqueued. More...
#include "wifi-mac-queue-item.h"
Classes | |
struct | QueueIteratorPair |
Information needed to remove an MSDU from the queue. More... | |
Public Types | |
typedef std::list< Ptr< WifiMacQueueItem > >::const_iterator | ConstIterator |
Const iterator typedef. More... | |
typedef std::list< std::pair< Ptr< const Packet >, AmsduSubframeHeader > > | DeaggregatedMsdus |
DeaggregatedMsdus typedef. More... | |
typedef std::list< std::pair< Ptr< const Packet >, AmsduSubframeHeader > >::const_iterator | DeaggregatedMsdusCI |
DeaggregatedMsdusCI typedef. More... | |
Public Member Functions | |
WifiMacQueueItem (Ptr< const Packet > p, const WifiMacHeader &header) | |
Create a Wifi MAC queue item containing a packet and a Wifi MAC header. More... | |
WifiMacQueueItem (Ptr< const Packet > p, const WifiMacHeader &header, Time tstamp) | |
Create a Wifi MAC queue item containing a packet and a Wifi MAC header. More... | |
virtual | ~WifiMacQueueItem () |
void | Aggregate (Ptr< const WifiMacQueueItem > msdu) |
Aggregate the MSDU contained in the given MPDU to this MPDU (thus constituting an A-MSDU). More... | |
DeaggregatedMsdusCI | begin (void) |
Get a constant iterator pointing to the first MSDU in the list of aggregated MSDUs. More... | |
DeaggregatedMsdusCI | end (void) |
Get a constant iterator indicating past-the-last MSDU in the list of aggregated MSDUs. More... | |
Mac48Address | GetDestinationAddress (void) const |
Return the destination address present in the header. More... | |
WifiMacHeader & | GetHeader (void) |
Get the header stored in this item. More... | |
const WifiMacHeader & | GetHeader (void) const |
Get the header stored in this item. More... | |
Ptr< const Packet > | GetPacket (void) const |
Get the packet stored in this item. More... | |
uint32_t | GetPacketSize (void) const |
Return the size in bytes of the packet or control header or management header stored by this item. More... | |
Ptr< Packet > | GetProtocolDataUnit (void) const |
Get the MAC protocol data unit (MPDU) corresponding to this item (i.e. More... | |
const std::list< QueueIteratorPair > & | GetQueueIteratorPairs (void) const |
Get a const reference to the list of iterators pointing to the positions of the items in the queue. More... | |
uint32_t | GetSize (void) const |
Return the size of the packet stored by this item, including header size and trailer size. More... | |
Time | GetTimeStamp (void) const |
Get the timestamp included in this item. More... | |
bool | IsFragment (void) const |
Return true if this item contains an MSDU fragment, false otherwise. More... | |
bool | IsQueued (void) const |
Return true if this item is stored in some queue, false otherwise. More... | |
virtual void | Print (std::ostream &os) const |
Print the item contents. More... | |
![]() | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Private Member Functions | |
void | DoAggregate (Ptr< const WifiMacQueueItem > msdu) |
Aggregate the MSDU contained in the given MPDU to this MPDU (thus constituting an A-MSDU). More... | |
Private Attributes | |
WifiMacHeader | m_header |
Wifi MAC header associated with the packet. More... | |
DeaggregatedMsdus | m_msduList |
The list of aggregated MSDUs included in this MPDU. More... | |
Ptr< const Packet > | m_packet |
The packet (MSDU or A-MSDU) contained in this queue item. More... | |
std::list< QueueIteratorPair > | m_queueIts |
Queue iterators pointing to this MSDU(s), if queued. More... | |
Time | m_tstamp |
timestamp when the packet arrived at the queue More... | |
Friends | |
class | WifiMacQueue |
WifiMacQueueItem stores (const) packets along with their Wifi MAC headers and the time when they were enqueued.
Definition at line 44 of file wifi-mac-queue-item.h.
typedef std::list<Ptr<WifiMacQueueItem> >::const_iterator ns3::WifiMacQueueItem::ConstIterator |
Const iterator typedef.
Definition at line 144 of file wifi-mac-queue-item.h.
typedef std::list<std::pair<Ptr<const Packet>, AmsduSubframeHeader> > ns3::WifiMacQueueItem::DeaggregatedMsdus |
DeaggregatedMsdus typedef.
Definition at line 126 of file wifi-mac-queue-item.h.
typedef std::list<std::pair<Ptr<const Packet>, AmsduSubframeHeader> >::const_iterator ns3::WifiMacQueueItem::DeaggregatedMsdusCI |
DeaggregatedMsdusCI typedef.
Definition at line 128 of file wifi-mac-queue-item.h.
ns3::WifiMacQueueItem::WifiMacQueueItem | ( | Ptr< const Packet > | p, |
const WifiMacHeader & | header | ||
) |
Create a Wifi MAC queue item containing a packet and a Wifi MAC header.
p | the const packet included in the created item. |
header | the Wifi MAC header included in the created item. |
Definition at line 36 of file wifi-mac-queue-item.cc.
ns3::WifiMacQueueItem::WifiMacQueueItem | ( | Ptr< const Packet > | p, |
const WifiMacHeader & | header, | ||
Time | tstamp | ||
) |
Create a Wifi MAC queue item containing a packet and a Wifi MAC header.
p | the const packet included in the created item. |
header | the Wifi MAC header included in the created item. |
tstamp | the timestamp associated with the created item. |
Definition at line 41 of file wifi-mac-queue-item.cc.
References ns3::Packet::Copy(), ns3::MsduAggregator::Deaggregate(), ns3::WifiMacHeader::IsQosAmsdu(), ns3::WifiMacHeader::IsQosData(), and m_msduList.
|
virtual |
Definition at line 52 of file wifi-mac-queue-item.cc.
void ns3::WifiMacQueueItem::Aggregate | ( | Ptr< const WifiMacQueueItem > | msdu | ) |
Aggregate the MSDU contained in the given MPDU to this MPDU (thus constituting an A-MSDU).
Note that the given MPDU cannot contain an A-MSDU.
msdu | the MPDU containing the MSDU to aggregate |
Definition at line 114 of file wifi-mac-queue-item.cc.
References DoAggregate(), ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetAddr2(), ns3::WifiMacHeader::IsFromDs(), ns3::WifiMacHeader::IsToDs(), m_header, m_msduList, m_packet, m_queueIts, NS_ABORT_MSG_IF, NS_ASSERT, NS_LOG_FUNCTION, ns3::WifiMacHeader::SetAddr3(), and ns3::WifiMacHeader::SetQosAmsdu().
Referenced by ns3::MsduAggregator::GetNextAmsdu().
WifiMacQueueItem::DeaggregatedMsdusCI ns3::WifiMacQueueItem::begin | ( | void | ) |
Get a constant iterator pointing to the first MSDU in the list of aggregated MSDUs.
Definition at line 217 of file wifi-mac-queue-item.cc.
References m_msduList.
Referenced by TwoLevelAggregationTest::DoRun().
|
private |
Aggregate the MSDU contained in the given MPDU to this MPDU (thus constituting an A-MSDU).
Note that the given MPDU cannot contain an A-MSDU.
msdu | the MPDU containing the MSDU to aggregate |
Definition at line 149 of file wifi-mac-queue-item.cc.
References ns3::Packet::AddAtEnd(), ns3::Packet::AddHeader(), ns3::MsduAggregator::CalculatePadding(), ns3::Packet::Copy(), ns3::Packet::GetSize(), m_msduList, m_packet, m_queueIts, m_tstamp, ns3::Max(), NS_ASSERT, NS_LOG_FUNCTION, ns3::AmsduSubframeHeader::SetDestinationAddr(), ns3::AmsduSubframeHeader::SetLength(), and ns3::AmsduSubframeHeader::SetSourceAddr().
Referenced by Aggregate().
WifiMacQueueItem::DeaggregatedMsdusCI ns3::WifiMacQueueItem::end | ( | void | ) |
Get a constant iterator indicating past-the-last MSDU in the list of aggregated MSDUs.
Definition at line 223 of file wifi-mac-queue-item.cc.
References m_msduList.
Referenced by TwoLevelAggregationTest::DoRun(), grid.TimelinesRenderer::draw_events(), and grid.TimelinesRenderer::draw_ranges().
Mac48Address ns3::WifiMacQueueItem::GetDestinationAddress | ( | void | ) | const |
Return the destination address present in the header.
Definition at line 75 of file wifi-mac-queue-item.cc.
References ns3::WifiMacHeader::GetAddr1(), and m_header.
WifiMacHeader & ns3::WifiMacQueueItem::GetHeader | ( | void | ) |
Get the header stored in this item.
Definition at line 69 of file wifi-mac-queue-item.cc.
References m_header.
const WifiMacHeader & ns3::WifiMacQueueItem::GetHeader | ( | void | ) | const |
Get the header stored in this item.
Definition at line 63 of file wifi-mac-queue-item.cc.
References m_header.
Referenced by ns3::QosTxop::AssignSequenceNumber(), ns3::QosTxop::CompleteMpduTx(), ns3::FrameExchangeManager::CtsTimeout(), ns3::ApWifiMac::DeaggregateAmsduAndForward(), ns3::BlockAckManager::DiscardOutstandingMpdus(), ns3::WifiMacQueue::DoDequeue(), ns3::WifiMacQueue::DoEnqueue(), ns3::WifiMacQueue::DoRemove(), OriginatorBlockAckWindowTest::DoRun(), AmpduAggregationTest::DoRun(), ns3::FrameExchangeManager::GetFirstFragmentIfNeeded(), ns3::MpduAggregator::GetNextAmpdu(), ns3::FrameExchangeManager::GetNextFragment(), ns3::BlockAckManager::InsertInRetryQueue(), ns3::FrameExchangeManager::NormalAckTimeout(), ns3::BlockAckManager::NotifyMissedAck(), ns3::RecipientBlockAckAgreement::NotifyReceivedMpdu(), ns3::HtFrameExchangeManager::NotifyReceivedNormalAck(), ns3::MeshWifiInterfaceMac::Receive(), ns3::OcbWifiMac::Receive(), ns3::MacRxMiddle::Receive(), ns3::RegularWifiMac::Receive(), ns3::AdhocWifiMac::Receive(), ns3::ApWifiMac::Receive(), ns3::StaWifiMac::Receive(), ns3::FrameExchangeManager::ReceivedNormalAck(), ns3::FrameExchangeManager::ReceiveMpdu(), ns3::HeFrameExchangeManager::ReceiveMpdu(), ns3::HtFrameExchangeManager::ReceiveMpdu(), ns3::QosFrameExchangeManager::ReceiveMpdu(), ns3::HtFrameExchangeManager::RetransmitMpduAfterMissedAck(), ns3::FrameExchangeManager::RetransmitMpduAfterMissedCts(), ns3::HtFrameExchangeManager::RetransmitMpduAfterMissedCts(), ns3::HtFrameExchangeManager::SendAddBaRequest(), ns3::FrameExchangeManager::SendMpdu(), ns3::FrameExchangeManager::SendMpduWithProtection(), ns3::HeFrameExchangeManager::SendPsduMap(), ns3::HeFrameExchangeManager::SendQosNullFramesInTbPpdu(), ns3::WifiAckManager::SetQosAckPolicy(), ns3::QosTxop::SetQosQueueSize(), ns3::QosFrameExchangeManager::StartFrameExchange(), ns3::WaveFrameExchangeManager::StartTransmission(), ns3::FrameExchangeManager::StartTransmission(), and ns3::BlockAckManager::StorePacket().
Get the packet stored in this item.
Definition at line 57 of file wifi-mac-queue-item.cc.
References m_packet.
Referenced by ns3::FrameExchangeManager::GetFirstFragmentIfNeeded(), ns3::QosTxop::NotifyInternalCollision(), ns3::HtFrameExchangeManager::NotifyReceivedNormalAck(), ns3::MeshWifiInterfaceMac::Receive(), ns3::OcbWifiMac::Receive(), ns3::MacRxMiddle::Receive(), ns3::RegularWifiMac::Receive(), ns3::AdhocWifiMac::Receive(), ns3::ApWifiMac::Receive(), ns3::StaWifiMac::Receive(), ns3::FrameExchangeManager::ReceiveMpdu(), ns3::HeFrameExchangeManager::ReceiveMpdu(), ns3::HtFrameExchangeManager::ReceiveMpdu(), and ns3::RrMultiUserScheduler::TrySendingBasicTf().
uint32_t ns3::WifiMacQueueItem::GetPacketSize | ( | void | ) | const |
Return the size in bytes of the packet or control header or management header stored by this item.
Definition at line 87 of file wifi-mac-queue-item.cc.
References ns3::Packet::GetSize(), and m_packet.
Referenced by TwoLevelAggregationTest::DoRun(), ns3::FrameExchangeManager::GetNextFragment(), GetSize(), Print(), and ns3::FrameExchangeManager::StartTransmission().
Get the MAC protocol data unit (MPDU) corresponding to this item (i.e.
a copy of the packet stored in this item wrapped with MAC header and trailer)
Definition at line 105 of file wifi-mac-queue-item.cc.
References ns3::Packet::AddHeader(), ns3::AddWifiMacTrailer(), ns3::Packet::Copy(), m_header, and m_packet.
const std::list< WifiMacQueueItem::QueueIteratorPair > & ns3::WifiMacQueueItem::GetQueueIteratorPairs | ( | void | ) | const |
Get a const reference to the list of iterators pointing to the positions of the items in the queue.
The list is empty if the item is not stored in a queue. The list contains multiple iterators in case of A-MSDU that is not stored in the Block Ack Manager retransmit queue.
Definition at line 211 of file wifi-mac-queue-item.cc.
References m_queueIts.
Referenced by ns3::FrameExchangeManager::DequeueMpdu(), and ns3::FrameExchangeManager::GetFirstFragmentIfNeeded().
uint32_t ns3::WifiMacQueueItem::GetSize | ( | void | ) | const |
Return the size of the packet stored by this item, including header size and trailer size.
Definition at line 93 of file wifi-mac-queue-item.cc.
References GetPacketSize(), ns3::WifiMacHeader::GetSerializedSize(), m_header, and ns3::WIFI_MAC_FCS_LENGTH.
Referenced by ns3::WifiPsdu::WifiPsdu(), ns3::WifiMacQueue::DoDequeue(), ns3::WifiMacQueue::DoEnqueue(), ns3::WifiMacQueue::DoRemove(), ns3::MpduAggregator::GetNextAmpdu(), ns3::FrameExchangeManager::SendMpdu(), ns3::HeFrameExchangeManager::SendPsduMap(), and ns3::QosFrameExchangeManager::StartFrameExchange().
Time ns3::WifiMacQueueItem::GetTimeStamp | ( | void | ) | const |
Get the timestamp included in this item.
Definition at line 81 of file wifi-mac-queue-item.cc.
References m_tstamp.
Referenced by ns3::FrameExchangeManager::GetFirstFragmentIfNeeded().
bool ns3::WifiMacQueueItem::IsFragment | ( | void | ) | const |
Return true if this item contains an MSDU fragment, false otherwise.
Definition at line 99 of file wifi-mac-queue-item.cc.
References ns3::WifiMacHeader::GetFragmentNumber(), ns3::WifiMacHeader::IsMoreFragments(), and m_header.
Referenced by ns3::QosTxop::AssignSequenceNumber(), ns3::FrameExchangeManager::GetFirstFragmentIfNeeded(), ns3::QosFrameExchangeManager::StartFrameExchange(), ns3::WaveFrameExchangeManager::StartTransmission(), and ns3::FrameExchangeManager::StartTransmission().
bool ns3::WifiMacQueueItem::IsQueued | ( | void | ) | const |
Return true if this item is stored in some queue, false otherwise.
Definition at line 205 of file wifi-mac-queue-item.cc.
References m_queueIts.
Referenced by ns3::FrameExchangeManager::DequeueMpdu(), and ns3::FrameExchangeManager::SendMpduWithProtection().
|
virtual |
Print the item contents.
os | output stream in which the data should be printed. |
Definition at line 229 of file wifi-mac-queue-item.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetDuration(), GetPacketSize(), ns3::WifiMacHeader::GetQosTid(), ns3::WifiMacHeader::GetSequenceNumber(), ns3::WifiMacHeader::GetTypeString(), ns3::WifiMacHeader::IsQosAck(), ns3::WifiMacHeader::IsQosBlockAck(), ns3::WifiMacHeader::IsQosData(), ns3::WifiMacHeader::IsQosNoAck(), m_header, m_packet, m_tstamp, ns3::Simulator::Now(), and ns3::Time::US.
Referenced by ns3::operator<<().
|
friend |
Definition at line 192 of file wifi-mac-queue-item.h.
|
private |
Wifi MAC header associated with the packet.
Definition at line 195 of file wifi-mac-queue-item.h.
Referenced by Aggregate(), GetDestinationAddress(), GetHeader(), GetProtocolDataUnit(), GetSize(), IsFragment(), and Print().
|
private |
The list of aggregated MSDUs included in this MPDU.
Definition at line 197 of file wifi-mac-queue-item.h.
Referenced by WifiMacQueueItem(), Aggregate(), begin(), DoAggregate(), and end().
The packet (MSDU or A-MSDU) contained in this queue item.
Definition at line 194 of file wifi-mac-queue-item.h.
Referenced by Aggregate(), DoAggregate(), GetPacket(), GetPacketSize(), GetProtocolDataUnit(), and Print().
|
private |
Queue iterators pointing to this MSDU(s), if queued.
Definition at line 198 of file wifi-mac-queue-item.h.
Referenced by Aggregate(), DoAggregate(), ns3::WifiMacQueue::DoDequeue(), ns3::WifiMacQueue::DoEnqueue(), ns3::WifiMacQueue::DoRemove(), GetQueueIteratorPairs(), and IsQueued().
|
private |
timestamp when the packet arrived at the queue
Definition at line 196 of file wifi-mac-queue-item.h.
Referenced by DoAggregate(), GetTimeStamp(), and Print().