WifiPsdu stores an MPDU, S-MPDU or A-MPDU, by keeping header(s) and payload(s) separate for each constituent MPDU. More...
#include "wifi-psdu.h"
Public Member Functions | |
WifiPsdu (Ptr< const Packet > p, const WifiMacHeader &header) | |
Create a PSDU storing an MPDU. More... | |
WifiPsdu (Ptr< WifiMacQueueItem > mpdu, bool isSingle) | |
Create a PSDU storing an MPDU or S-MPDU. More... | |
WifiPsdu (Ptr< const WifiMacQueueItem > mpdu, bool isSingle) | |
Create a PSDU storing an MPDU or S-MPDU. More... | |
WifiPsdu (std::vector< Ptr< WifiMacQueueItem >> mpduList) | |
Create a PSDU storing an S-MPDU or A-MPDU. More... | |
virtual | ~WifiPsdu () |
std::vector< Ptr< WifiMacQueueItem > >::const_iterator | begin (void) const |
Return a const iterator to the first MPDU. More... | |
std::vector< Ptr< WifiMacQueueItem > >::iterator | begin (void) |
Return an iterator to the first MPDU. More... | |
std::vector< Ptr< WifiMacQueueItem > >::const_iterator | end (void) const |
Return a const iterator to past-the-last MPDU. More... | |
std::vector< Ptr< WifiMacQueueItem > >::iterator | end (void) |
Return an iterator to past-the-last MPDU. More... | |
WifiMacHeader::QosAckPolicy | GetAckPolicyForTid (uint8_t tid) const |
Get the QoS Ack Policy of the QoS Data frames included in the PSDU that have the given TID. More... | |
Mac48Address | GetAddr1 (void) const |
Get the Receiver Address (RA), which is common to all the MPDUs. More... | |
Mac48Address | GetAddr2 (void) const |
Get the Transmitter Address (TA), which is common to all the MPDUs. More... | |
Time | GetDuration (void) const |
Get the duration from the Duration/ID field, which is common to all the MPDUs. More... | |
const WifiMacHeader & | GetHeader (std::size_t i) const |
Get the header of the i-th MPDU. More... | |
WifiMacHeader & | GetHeader (std::size_t i) |
Get the header of the i-th MPDU. More... | |
std::size_t | GetNMpdus (void) const |
Return the number of MPDUs constituting the PSDU. More... | |
Ptr< const Packet > | GetPacket (void) const |
Get the PSDU as a single packet. More... | |
Ptr< const Packet > | GetPayload (std::size_t i) const |
Get the payload of the i-th MPDU. More... | |
uint32_t | GetSize (void) const |
Return the size of the PSDU. More... | |
std::set< uint8_t > | GetTids (void) const |
Get the set of TIDs of the QoS Data frames included in the PSDU. More... | |
Time | GetTimeStamp (std::size_t i) const |
Get the timestamp of the i-th MPDU. More... | |
bool | IsAggregate (void) const |
Return true if the PSDU is an S-MPDU or A-MPDU. More... | |
bool | IsSingle (void) const |
Return true if the PSDU is an S-MPDU. More... | |
void | SetAckPolicyForTid (uint8_t tid, WifiMacHeader::QosAckPolicy policy) |
Set the QoS Ack Policy of the QoS Data frames included in the PSDU that have the given TID to the given policy. More... | |
void | SetDuration (Time duration) |
Set the Duration/ID field on all the MPDUs. 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 Attributes | |
bool | m_isSingle |
true for an S-MPDU More... | |
std::vector< Ptr< WifiMacQueueItem > > | m_mpduList |
list of constituent MPDUs More... | |
uint32_t | m_size |
the size of the PSDU More... | |
WifiPsdu stores an MPDU, S-MPDU or A-MPDU, by keeping header(s) and payload(s) separate for each constituent MPDU.
Definition at line 40 of file wifi-psdu.h.
ns3::WifiPsdu::WifiPsdu | ( | Ptr< const Packet > | p, |
const WifiMacHeader & | header | ||
) |
Create a PSDU storing an MPDU.
Typically used for control and management frames that do not have to keep an associated lifetime and are not stored in an S-MPDU.
p | the payload of the MPDU. |
header | the Wifi Mac header of the MPDU. |
Definition at line 33 of file wifi-psdu.cc.
References ns3::WifiMacHeader::GetSerializedSize(), ns3::Packet::GetSize(), m_mpduList, m_size, and ns3::WIFI_MAC_FCS_LENGTH.
ns3::WifiPsdu::WifiPsdu | ( | Ptr< WifiMacQueueItem > | mpdu, |
bool | isSingle | ||
) |
Create a PSDU storing an MPDU or S-MPDU.
Typically used for QoS data frames that have to keep an associated lifetime.
mpdu | the MPDU. |
isSingle | true for an S-MPDU |
Definition at line 40 of file wifi-psdu.cc.
References m_mpduList, and m_size.
ns3::WifiPsdu::WifiPsdu | ( | Ptr< const WifiMacQueueItem > | mpdu, |
bool | isSingle | ||
) |
Create a PSDU storing an MPDU or S-MPDU.
Typically used for QoS data frames that have to keep an associated lifetime.
mpdu | the MPDU. |
isSingle | true for an S-MPDU |
ns3::WifiPsdu::WifiPsdu | ( | std::vector< Ptr< WifiMacQueueItem >> | mpduList | ) |
Create a PSDU storing an S-MPDU or A-MPDU.
mpduList | the list of constituent MPDUs. |
Definition at line 57 of file wifi-psdu.cc.
References ns3::MpduAggregator::GetSizeIfAggregated(), m_mpduList, m_size, and NS_ABORT_MSG_IF.
|
virtual |
Definition at line 70 of file wifi-psdu.cc.
std::vector< Ptr< WifiMacQueueItem > >::const_iterator ns3::WifiPsdu::begin | ( | void | ) | const |
Return a const iterator to the first MPDU.
Definition at line 283 of file wifi-psdu.cc.
References m_mpduList, and NS_LOG_FUNCTION.
std::vector< Ptr< WifiMacQueueItem > >::iterator ns3::WifiPsdu::begin | ( | void | ) |
Return an iterator to the first MPDU.
Definition at line 290 of file wifi-psdu.cc.
References m_mpduList, and NS_LOG_FUNCTION.
std::vector< Ptr< WifiMacQueueItem > >::const_iterator ns3::WifiPsdu::end | ( | void | ) | const |
Return a const iterator to past-the-last MPDU.
Definition at line 297 of file wifi-psdu.cc.
References m_mpduList, and NS_LOG_FUNCTION.
std::vector< Ptr< WifiMacQueueItem > >::iterator ns3::WifiPsdu::end | ( | void | ) |
Return an iterator to past-the-last MPDU.
Definition at line 304 of file wifi-psdu.cc.
References m_mpduList, and NS_LOG_FUNCTION.
WifiMacHeader::QosAckPolicy ns3::WifiPsdu::GetAckPolicyForTid | ( | uint8_t | tid | ) | const |
Get the QoS Ack Policy of the QoS Data frames included in the PSDU that have the given TID.
Also, check that all the QoS Data frames having the given TID have the same QoS Ack Policy. Do not call this method if there is no QoS Date frame in the PSDU.
tid | the given TID |
Definition at line 193 of file wifi-psdu.cc.
References m_mpduList, NS_ABORT_MSG, NS_ABORT_MSG_IF, and NS_LOG_FUNCTION.
Mac48Address ns3::WifiPsdu::GetAddr1 | ( | void | ) | const |
Get the Receiver Address (RA), which is common to all the MPDUs.
Definition at line 115 of file wifi-psdu.cc.
References m_mpduList, NS_ABORT_MSG, and NS_LOG_FUNCTION.
Mac48Address ns3::WifiPsdu::GetAddr2 | ( | void | ) | const |
Get the Transmitter Address (TA), which is common to all the MPDUs.
Definition at line 132 of file wifi-psdu.cc.
References m_mpduList, NS_ABORT_MSG, and NS_LOG_FUNCTION.
Time ns3::WifiPsdu::GetDuration | ( | void | ) | const |
Get the duration from the Duration/ID field, which is common to all the MPDUs.
Definition at line 149 of file wifi-psdu.cc.
References m_mpduList, NS_ABORT_MSG, and NS_LOG_FUNCTION.
const WifiMacHeader & ns3::WifiPsdu::GetHeader | ( | std::size_t | i | ) | const |
Get the header of the i-th MPDU.
Definition at line 248 of file wifi-psdu.cc.
References m_mpduList, and NS_LOG_FUNCTION.
Referenced by AmpduAggregationTest::DoRun().
WifiMacHeader & ns3::WifiPsdu::GetHeader | ( | std::size_t | i | ) |
Get the header of the i-th MPDU.
Definition at line 255 of file wifi-psdu.cc.
References m_mpduList, and NS_LOG_FUNCTION.
std::size_t ns3::WifiPsdu::GetNMpdus | ( | void | ) | const |
Return the number of MPDUs constituting the PSDU.
Definition at line 276 of file wifi-psdu.cc.
References m_mpduList, and NS_LOG_FUNCTION.
Referenced by AmpduAggregationTest::DoRun().
Get the PSDU as a single packet.
Definition at line 89 of file wifi-psdu.cc.
References ns3::Packet::AddHeader(), ns3::AddWifiMacTrailer(), ns3::MpduAggregator::Aggregate(), m_isSingle, m_mpduList, and NS_LOG_FUNCTION.
Referenced by TestAmpduReception::SendAmpduWithThreeMpdus().
Get the payload of the i-th MPDU.
Definition at line 262 of file wifi-psdu.cc.
References m_mpduList, and NS_LOG_FUNCTION.
uint32_t ns3::WifiPsdu::GetSize | ( | void | ) | const |
Return the size of the PSDU.
Definition at line 241 of file wifi-psdu.cc.
References m_size, and NS_LOG_FUNCTION.
Referenced by AmpduAggregationTest::DoRun(), and TestAmpduReception::SendAmpduWithThreeMpdus().
std::set< uint8_t > ns3::WifiPsdu::GetTids | ( | void | ) | const |
Get the set of TIDs of the QoS Data frames included in the PSDU.
Note that only single-TID A-MPDUs are currently supported, hence the returned set contains at most one TID value.
Definition at line 177 of file wifi-psdu.cc.
References m_mpduList, and NS_LOG_FUNCTION.
Time ns3::WifiPsdu::GetTimeStamp | ( | std::size_t | i | ) | const |
Get the timestamp of the i-th MPDU.
Definition at line 269 of file wifi-psdu.cc.
References m_mpduList, and NS_LOG_FUNCTION.
bool ns3::WifiPsdu::IsAggregate | ( | void | ) | const |
Return true if the PSDU is an S-MPDU or A-MPDU.
Definition at line 82 of file wifi-psdu.cc.
References m_isSingle, m_mpduList, and NS_LOG_FUNCTION.
bool ns3::WifiPsdu::IsSingle | ( | void | ) | const |
Return true if the PSDU is an S-MPDU.
Definition at line 75 of file wifi-psdu.cc.
References m_isSingle, and NS_LOG_FUNCTION.
void ns3::WifiPsdu::SetAckPolicyForTid | ( | uint8_t | tid, |
WifiMacHeader::QosAckPolicy | policy | ||
) |
Set the QoS Ack Policy of the QoS Data frames included in the PSDU that have the given TID to the given policy.
tid | the given TID |
policy | the given QoS Ack policy |
Definition at line 227 of file wifi-psdu.cc.
References m_mpduList, and NS_LOG_FUNCTION.
void ns3::WifiPsdu::SetDuration | ( | Time | duration | ) |
Set the Duration/ID field on all the MPDUs.
duration | the value for the Duration/ID field. |
Definition at line 166 of file wifi-psdu.cc.
References m_mpduList, and NS_LOG_FUNCTION.
Referenced by TestAmpduReception::SendAmpduWithThreeMpdus().
|
private |
true for an S-MPDU
Definition at line 218 of file wifi-psdu.h.
Referenced by GetPacket(), IsAggregate(), and IsSingle().
|
private |
list of constituent MPDUs
Definition at line 219 of file wifi-psdu.h.
Referenced by begin(), end(), GetAckPolicyForTid(), GetAddr1(), GetAddr2(), GetDuration(), GetHeader(), GetNMpdus(), GetPacket(), GetPayload(), GetTids(), GetTimeStamp(), IsAggregate(), SetAckPolicyForTid(), SetDuration(), and WifiPsdu().
|
private |
the size of the PSDU
Definition at line 220 of file wifi-psdu.h.
Referenced by GetSize(), and WifiPsdu().