11#include "ns3/wifi-phy.h"
23 TypeId(
"ns3::dot11s::AirtimeLinkMetricCalculator")
27 .AddAttribute(
"TestLength",
28 "Number of bytes in test frame (a constant 1024 in the standard)",
32 .AddAttribute(
"Dot11MetricTid",
33 "TID used to calculate metric (data rate)",
76 WifiMode mode = mac->GetWifiRemoteStationManager()
77 ->GetDataTxVector(
m_testHeader, mac->GetWifiPhy()->GetChannelWidth())
80 double failAvg = mac->GetWifiRemoteStationManager()->GetInfo(peerAddress).GetFrameErrorRate();
94 2 * mac->GetWifiPhy()->GetSifs() + 2 * mac->GetWifiPhy()->GetSlot() +
95 mac->GetWifiPhy()->GetAckTxTime() +
98 mac->GetWifiPhy()->GetPhyBand()))
100 (10.24 * (1.0 - failAvg)));
A base class which provides memory management and object aggregation.
uint32_t GetSize() const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
represent a single transmission mode
static Time CalculateTxDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
Airtime link metric calculator.
Ptr< Packet > m_testFrame
test frame
uint32_t CalculateMetric(Mac48Address peerAddress, Ptr< MeshWifiInterfaceMac > mac)
Airtime link metric is defined in Section 13.9 of IEEE 802.11-2012 as:
void SetHeaderTid(uint8_t tid)
Set header TID from the Dot11MetricTid attribute.
WifiMacHeader m_testHeader
test header
AirtimeLinkMetricCalculator()
void SetTestLength(uint16_t testLength)
Set number of bytes in test frame (a constant 1024 in the standard)
static TypeId GetTypeId()
Get the type ID.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Ptr< const AttributeChecker > MakeUintegerChecker()
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.