A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::AthstatsWifiTraceSink Class Reference

trace sink for wifi device that mimics madwifi's athstats tool. More...

#include <athstats-helper.h>

+ Inheritance diagram for ns3::AthstatsWifiTraceSink:
+ Collaboration diagram for ns3::AthstatsWifiTraceSink:

Public Member Functions

 AthstatsWifiTraceSink ()
 
virtual ~AthstatsWifiTraceSink ()
 
void DevRxTrace (std::string context, Ptr< const Packet > p)
 function to be called when the net device receives a packet More...
 
void DevTxTrace (std::string context, Ptr< const Packet > p)
 function to be called when the net device transmits a packet More...
 
void Open (std::string const &name)
 Open a file for output. More...
 
void PhyRxErrorTrace (std::string context, Ptr< const Packet > packet, double snr)
 Function to be called when a frame reception by the PHY layer of the considered device resulted in an error due to a failure in the CRC check of the frame. More...
 
void PhyRxOkTrace (std::string context, Ptr< const Packet > packet, double snr, WifiMode mode, enum WifiPreamble preamble)
 Function to be called when the PHY layer of the considered device receives a frame. More...
 
void PhyStateTrace (std::string context, Time start, Time duration, enum WifiPhy::State state)
 Function to be called when the PHY layer of the considered device changes state. More...
 
void PhyTxTrace (std::string context, Ptr< const Packet > packet, WifiMode mode, WifiPreamble preamble, uint8_t txPower)
 Function to be called when a frame is being transmitted by the PHY layer of the considered device. More...
 
void TxDataFailedTrace (std::string context, Mac48Address address)
 Function to be called when a data frame transmission by the considered device has failed. More...
 
void TxFinalDataFailedTrace (std::string context, Mac48Address address)
 Function to be called when the transmission of a data frame has exceeded the retry limit. More...
 
void TxFinalRtsFailedTrace (std::string context, Mac48Address address)
 Function to be called when the transmission of a RTS frame has exceeded the retry limit. More...
 
void TxRtsFailedTrace (std::string context, Mac48Address address)
 Function to be called when a RTS frame transmission by the considered device has failed. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 
virtual ~Object ()
 
void AggregateObject (Ptr< Object > other)
 
void Dispose (void)
 Run the DoDispose methods of this object and all the objects aggregated to it. More...
 
AggregateIterator GetAggregateIterator (void) const
 
virtual TypeId GetInstanceTypeId (void) const
 
template<typename T >
Ptr< T > GetObject (void) const
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 
void Initialize (void)
 This method calls the virtual DoInitialize method on all the objects aggregated to this object. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
 
void SetAttribute (std::string name, const AttributeValue &value)
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 

Static Public Member Functions

static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
static void Cleanup (void)
 Noop. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Member Functions

void ResetCounters ()
 
void WriteStats ()
 

Private Attributes

uint32_t m_exceededRetryCount
 
Time m_interval
 
uint32_t m_longRetryCount
 
uint32_t m_phyRxErrorCount
 
uint32_t m_phyRxOkCount
 
uint32_t m_phyTxCount
 
uint32_t m_rxCount
 
uint32_t m_shortRetryCount
 
uint32_t m_txCount
 
std::ofstream * m_writer
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 
virtual void DoDispose (void)
 This method is called by Object::Dispose or by the object's destructor, whichever comes first. More...
 
virtual void DoInitialize (void)
 This method is called only once by Object::Initialize. More...
 
virtual void NotifyNewAggregate (void)
 This method is invoked whenever two sets of objects are aggregated together. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 
virtual void NotifyConstructionCompleted (void)
 This method is invoked once all member attributes have been initialized. More...
 

Detailed Description

trace sink for wifi device that mimics madwifi's athstats tool.

Doxygen introspection did not find any typical Config paths.

The AthstatsWifiTraceSink class is a trace sink to be connected to several of the traces available within a wifi device. The purpose of AthstatsWifiTraceSink is to mimic the behavior of the athstats tool distributed wih the madwifi driver. In particular, the reproduced behavior is that obtained when executing athstats without parameters: a report written in text format is produced every fixed interval, based on the events observed by the wifi device.

Differences with the "real" athstats:


Attributes

  • Interval: Time interval between reports
    • Set with class: ns3::TimeValue
    • Underlying type: Time -9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +1000000000.0ns
    • Flags: construct write read

No TraceSources are defined for this type.

Definition at line 82 of file athstats-helper.h.

Constructor & Destructor Documentation

ns3::AthstatsWifiTraceSink::AthstatsWifiTraceSink ( )

Definition at line 126 of file athstats-helper.cc.

References ns3::Simulator::ScheduleNow(), and WriteStats().

+ Here is the call graph for this function:

ns3::AthstatsWifiTraceSink::~AthstatsWifiTraceSink ( )
virtual

Definition at line 140 of file athstats-helper.cc.

References m_writer, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Member Function Documentation

void ns3::AthstatsWifiTraceSink::DevRxTrace ( std::string  context,
Ptr< const Packet p 
)

function to be called when the net device receives a packet

Parameters
context
pthe packet being received

Definition at line 186 of file athstats-helper.cc.

References m_rxCount, and NS_LOG_FUNCTION.

Referenced by ns3::AthstatsHelper::EnableAthstats().

+ Here is the caller graph for this function:

void ns3::AthstatsWifiTraceSink::DevTxTrace ( std::string  context,
Ptr< const Packet p 
)

function to be called when the net device transmits a packet

Parameters
context
pthe packet being transmitted

Definition at line 179 of file athstats-helper.cc.

References m_txCount, and NS_LOG_FUNCTION.

Referenced by ns3::AthstatsHelper::EnableAthstats().

+ Here is the caller graph for this function:

TypeId ns3::AthstatsWifiTraceSink::GetTypeId ( void  )
static

Definition at line 112 of file athstats-helper.cc.

References m_interval, ns3::MakeTimeChecker(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

void ns3::AthstatsWifiTraceSink::Open ( std::string const &  name)

Open a file for output.

Parameters
namethe name of the file to be opened.

Definition at line 255 of file athstats-helper.cc.

References m_writer, NS_ABORT_MSG_IF, NS_ABORT_MSG_UNLESS, NS_ASSERT_MSG, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

void ns3::AthstatsWifiTraceSink::PhyRxErrorTrace ( std::string  context,
Ptr< const Packet packet,
double  snr 
)

Function to be called when a frame reception by the PHY layer of the considered device resulted in an error due to a failure in the CRC check of the frame.

Parameters
context
packet
snr

Definition at line 231 of file athstats-helper.cc.

References m_phyRxErrorCount, and NS_LOG_FUNCTION.

Referenced by ns3::AthstatsHelper::EnableAthstats().

+ Here is the caller graph for this function:

void ns3::AthstatsWifiTraceSink::PhyRxOkTrace ( std::string  context,
Ptr< const Packet packet,
double  snr,
WifiMode  mode,
enum WifiPreamble  preamble 
)

Function to be called when the PHY layer of the considered device receives a frame.

Parameters
context
packet
snr
mode
preamble

Definition at line 224 of file athstats-helper.cc.

References m_phyRxOkCount, and NS_LOG_FUNCTION.

Referenced by ns3::AthstatsHelper::EnableAthstats().

+ Here is the caller graph for this function:

void ns3::AthstatsWifiTraceSink::PhyStateTrace ( std::string  context,
Time  start,
Time  duration,
enum WifiPhy::State  state 
)

Function to be called when the PHY layer of the considered device changes state.

Parameters
context
start
duration
state

Definition at line 246 of file athstats-helper.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::AthstatsHelper::EnableAthstats().

+ Here is the caller graph for this function:

void ns3::AthstatsWifiTraceSink::PhyTxTrace ( std::string  context,
Ptr< const Packet packet,
WifiMode  mode,
WifiPreamble  preamble,
uint8_t  txPower 
)

Function to be called when a frame is being transmitted by the PHY layer of the considered device.

Parameters
context
packet
mode
preamble
txPower

Definition at line 238 of file athstats-helper.cc.

References m_phyTxCount, and NS_LOG_FUNCTION.

Referenced by ns3::AthstatsHelper::EnableAthstats().

+ Here is the caller graph for this function:

void ns3::AthstatsWifiTraceSink::ResetCounters ( )
private
Internal:

Definition at line 166 of file athstats-helper.cc.

References m_exceededRetryCount, m_longRetryCount, m_phyRxErrorCount, m_phyRxOkCount, m_phyTxCount, m_rxCount, m_shortRetryCount, and m_txCount.

Referenced by WriteStats().

+ Here is the caller graph for this function:

void ns3::AthstatsWifiTraceSink::TxDataFailedTrace ( std::string  context,
Mac48Address  address 
)

Function to be called when a data frame transmission by the considered device has failed.

Parameters
context
addressthe MAC address of the remote station

Definition at line 201 of file athstats-helper.cc.

References m_longRetryCount, and NS_LOG_FUNCTION.

Referenced by ns3::AthstatsHelper::EnableAthstats().

+ Here is the caller graph for this function:

void ns3::AthstatsWifiTraceSink::TxFinalDataFailedTrace ( std::string  context,
Mac48Address  address 
)

Function to be called when the transmission of a data frame has exceeded the retry limit.

Parameters
context
addressthe MAC address of the remote station

Definition at line 215 of file athstats-helper.cc.

References m_exceededRetryCount, and NS_LOG_FUNCTION.

Referenced by ns3::AthstatsHelper::EnableAthstats().

+ Here is the caller graph for this function:

void ns3::AthstatsWifiTraceSink::TxFinalRtsFailedTrace ( std::string  context,
Mac48Address  address 
)

Function to be called when the transmission of a RTS frame has exceeded the retry limit.

Parameters
context
addressthe MAC address of the remote station

Definition at line 208 of file athstats-helper.cc.

References m_exceededRetryCount, and NS_LOG_FUNCTION.

Referenced by ns3::AthstatsHelper::EnableAthstats().

+ Here is the caller graph for this function:

void ns3::AthstatsWifiTraceSink::TxRtsFailedTrace ( std::string  context,
Mac48Address  address 
)

Function to be called when a RTS frame transmission by the considered device has failed.

Parameters
context
addressthe MAC address of the remote station

Definition at line 194 of file athstats-helper.cc.

References m_shortRetryCount, and NS_LOG_FUNCTION.

Referenced by ns3::AthstatsHelper::EnableAthstats().

+ Here is the caller graph for this function:

void ns3::AthstatsWifiTraceSink::WriteStats ( )
private
Internal:

Definition at line 275 of file athstats-helper.cc.

References m_exceededRetryCount, m_interval, m_longRetryCount, m_phyRxErrorCount, m_rxCount, m_shortRetryCount, m_txCount, m_writer, ns3::Now(), NS_ABORT_MSG_UNLESS, ResetCounters(), and ns3::Simulator::Schedule().

Referenced by AthstatsWifiTraceSink().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

uint32_t ns3::AthstatsWifiTraceSink::m_exceededRetryCount
private
Time ns3::AthstatsWifiTraceSink::m_interval
private

Definition at line 217 of file athstats-helper.h.

Referenced by GetTypeId(), and WriteStats().

uint32_t ns3::AthstatsWifiTraceSink::m_longRetryCount
private

Definition at line 209 of file athstats-helper.h.

Referenced by ResetCounters(), TxDataFailedTrace(), and WriteStats().

uint32_t ns3::AthstatsWifiTraceSink::m_phyRxErrorCount
private

Definition at line 212 of file athstats-helper.h.

Referenced by PhyRxErrorTrace(), ResetCounters(), and WriteStats().

uint32_t ns3::AthstatsWifiTraceSink::m_phyRxOkCount
private

Definition at line 211 of file athstats-helper.h.

Referenced by PhyRxOkTrace(), and ResetCounters().

uint32_t ns3::AthstatsWifiTraceSink::m_phyTxCount
private

Definition at line 213 of file athstats-helper.h.

Referenced by PhyTxTrace(), and ResetCounters().

uint32_t ns3::AthstatsWifiTraceSink::m_rxCount
private

Definition at line 207 of file athstats-helper.h.

Referenced by DevRxTrace(), ResetCounters(), and WriteStats().

uint32_t ns3::AthstatsWifiTraceSink::m_shortRetryCount
private

Definition at line 208 of file athstats-helper.h.

Referenced by ResetCounters(), TxRtsFailedTrace(), and WriteStats().

uint32_t ns3::AthstatsWifiTraceSink::m_txCount
private

Definition at line 206 of file athstats-helper.h.

Referenced by DevTxTrace(), ResetCounters(), and WriteStats().

std::ofstream* ns3::AthstatsWifiTraceSink::m_writer
private

Definition at line 215 of file athstats-helper.h.

Referenced by Open(), WriteStats(), and ~AthstatsWifiTraceSink().


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