24 #include "ns3/simulator.h" 25 #include "ns3/packet.h" 105 NS_ABORT_MSG_IF (!msdu->GetHeader ().IsQosData () || msdu->GetHeader ().IsQosAmsdu (),
106 "Only QoS data frames that do not contain an A-MSDU can be aggregated");
151 : msdu->GetHeader ().GetAddr1 ());
152 hdr.
SetSourceAddr (!msdu->GetHeader ().IsFromDs () ? msdu->GetHeader ().GetAddr2 ()
153 : (!msdu->GetHeader ().IsToDs ()
154 ? msdu->GetHeader ().GetAddr3 ()
155 : msdu->GetHeader ().GetAddr4 ()));
156 hdr.
SetLength (static_cast<uint16_t> (msdu->GetPacket ()->GetSize ()));
158 m_msduList.push_back ({msdu->GetPacket (), hdr});
171 amsdu->
AddAtEnd (Create<Packet> (padding));
176 Ptr<Packet> amsduSubframe = msdu->GetPacket ()->Copy ();
218 os <<
", ack=NormalAck";
222 os <<
", ack=BlockAck";
Simulation virtual time values and global simulation resolution.
MsduAggregator::DeaggregatedMsdusCI begin(void)
Get a constant iterator pointing to the first MSDU in the list of aggregated MSDUs.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
Control the scheduling of simulation events.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
void AddWifiMacTrailer(Ptr< Packet > packet)
Add FCS trailer to a packet.
virtual void Print(std::ostream &os) const
Print the item contents.
uint32_t GetSize(void) const
Return the size of the packet stored by this item, including header size and trailer size...
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Time GetTimeStamp(void) const
Get the timestamp included in this item.
static const uint16_t WIFI_MAC_FCS_LENGTH
The length in octects of the IEEE 802.11 MAC FCS field.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
static DeaggregatedMsdus Deaggregate(Ptr< Packet > aggregatedPacket)
Mac48Address GetDestinationAddress(void) const
Return the destination address present in the header.
MsduAggregator::DeaggregatedMsdusCI end(void)
Get a constant iterator indicating past-the-last MSDU in the list of aggregated MSDUs.
Ptr< const Packet > m_packet
The packet (MSDU or A-MSDU) contained in this queue item.
void AddAtEnd(Ptr< const Packet > packet)
Concatenate the input packet at the end of the current packet.
std::list< std::pair< Ptr< const Packet >, AmsduSubframeHeader > >::const_iterator DeaggregatedMsdusCI
DeaggregatedMsdusCI typedef.
WifiMacQueueItem stores (const) packets along with their Wifi MAC headers and the time when they were...
const WifiMacHeader & GetHeader(void) const
Get the header stored in this item.
Time m_tstamp
timestamp when the packet arrived at the queue
MsduAggregator::DeaggregatedMsdus m_msduList
The list of aggregated MSDUs included in this MPDU.
int64x64_t Max(const int64x64_t &a, const int64x64_t &b)
Maximum.
WifiMacHeader m_header
Wifi MAC header associated with the packet.
void Aggregate(Ptr< const WifiMacQueueItem > msdu)
Aggregate the MSDU contained in the given MPDU to this MPDU (thus constituting an A-MSDU)...
virtual ~WifiMacQueueItem()
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Ptr< const Packet > GetPacket(void) const
Get the packet stored in this item.
Ptr< Packet > GetProtocolDataUnit(void) const
Get the MAC protocol data unit (MPDU) corresponding to this item (i.e.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
WifiMacQueueItem(Ptr< const Packet > p, const WifiMacHeader &header)
Create a Wifi MAC queue item containing a packet and a Wifi MAC header.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
static Time Now(void)
Return the current simulation virtual time.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
static uint8_t CalculatePadding(uint16_t amsduSize)
Calculate how much padding must be added to the end of an A-MSDU of the given size if a new MSDU is a...
void DoAggregate(Ptr< const WifiMacQueueItem > msdu)
Aggregate the MSDU contained in the given MPDU to this MPDU (thus constituting an A-MSDU)...
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
void AddHeader(const Header &header)
Add header to this packet.