A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::WifiPhyRxTraceSink Class Reference

Sink class for capturing and analyzing PHY layer reception events in Wi-Fi networks. More...

#include "wifi-phy-rx-trace-helper.h"

+ Inheritance diagram for ns3::WifiPhyRxTraceSink:
+ Collaboration diagram for ns3::WifiPhyRxTraceSink:

Classes

class  UniqueTagGenerator
 Generating unique tags for more than one instance of a WifiPpdu object. More...
 

Public Member Functions

 WifiPhyRxTraceSink ()
 Constructor.
 
int ContextToDeviceId (std::string context) const
 Translates a context string to a device ID, enabling the identification of devices involved in reception events based on context information.
 
int ContextToLinkId (std::string context) const
 Translates a context string to a link ID, facilitating the association of events with specific links in the network.
 
uint32_t ContextToNodeId (std::string context) const
 Translates a context string to a node ID.
 
std::string ContextToTuple (std::string context) const
 Translate a context string to a colon-delimited tuple "0:0:0" where the first element is a node ID, second is a device ID, third is a link ID.
 
WifiPhyTraceStatistics CountStatistics () const
 Counts and aggregates PHY layer statistics including receptions, transmissions, and performance metrics (Success, Failure, Overlap) of unicast data PPDUs and MPDUs across all nodes.
 
WifiPhyTraceStatistics CountStatistics (uint32_t nodeId, uint32_t deviceId, uint8_t linkId) const
 Counts statistics related to PHY layer receptions, transmissions, and performance metrics such as Success, Failure or Overlap of a PPDU containing unicast data, and the MPDUs within, for the specific node, device and link.
 
void CreateVectorFromRecords ()
 Creates a vector with all completed WiFi reception records to be returned by the GetPpduRecords().
 
void EndTx (uint32_t nodeId, uint32_t deviceId, WifiPpduRxRecord ppduRecord)
 Handles the conclusion of a transmission event, facilitating the logging of transmission outcomes.
 
std::optional< std::pair< uint8_t, uint16_t > > GetChannelInfo (uint32_t node, uint32_t deviceId, int link) const
 Retrieves the frequency and channel number used by a specific link.
 
const std::vector< WifiPpduRxRecord > & GetPpduRecords () const
 Provides access to all saved and completed PPDU reception records across all nodes, WifiNetDevices, and links.
 
std::optional< std::reference_wrapper< const std::vector< WifiPpduRxRecord > > > GetPpduRecords (uint32_t nodeId, uint32_t deviceId=0, uint8_t linkId=0) const
 Provides access to PPDU reception records for a specific node, device, and link.
 
WifiPhyTraceStatistics GetStatistics () const
 Returns statistics on the count of successful and failed PPDUs with unicast data, and their MPDUs, across all nodes, devices, and links.
 
WifiPhyTraceStatistics GetStatistics (uint32_t nodeId, uint32_t deviceId, uint8_t linkId) const
 Returns statistics on the count of successful and failed PPDUs with unicast data, and their MPDUs, for a specific node, device, and link.
 
bool IsCollectionPeriodActive () const
 Returns whether the collection period is active.
 
void MapNodeToLinkToChannel (NodeContainer nodes)
 Maps nodes to links and channels, creating a structured association between network elements and their communication channels.
 
void PhyPpduDrop (std::string context, Ptr< const WifiPpdu > ppdu, WifiPhyRxfailureReason reason)
 Logs the drop of a PPDU at the PHY layer, detailing the context and reason for the drop.
 
void PhyRxEnd (uint32_t nodeId, uint32_t deviceId, uint64_t rxTag, uint64_t ppduUid)
 Handles the end of a PHY reception event, logging the conclusion of a reception and its associated details.
 
void PhySignalArrival (std::string context, Ptr< const WifiPpdu > ppdu, double rxPower, Time duration)
 Handles the event of a Wi-Fi PPDU arrival.
 
void PhySignalTransmission (std::string context, Ptr< const WifiPpdu > ppdu, const WifiTxVector &txVector)
 Handles the event of a PHY signal transmission.
 
void PpduOutcome (std::string context, Ptr< const WifiPpdu > ppdu, RxSignalInfo signal, const WifiTxVector &txVector, const std::vector< bool > &statusPerMpdu)
 Records the outcome of a PPDU transmission, including the signal info, and the success or failure status of each MPDU within the PPDU.
 
void PrintStatistics () const
 Prints a summary of the statistics collected, offering a concise overview of PHY layer performance and reception outcomes for all nodes, devices and links.
 
void PrintStatistics (uint32_t nodeId, uint32_t deviceId, uint8_t linkId) const
 Prints statistics collected in the period for a node, device, and link.
 
void Reset ()
 Resets the statistics collection, clearing all counts and discarding all fully completed PPDU records.
 
void SetMapMacAddressToNodeId (const std::map< Mac48Address, uint32_t > &MacAddressToNodeIdMap)
 Provides a custom mapping of MAC addresses to intended receiver node IDs.
 
void SpectrumPhySignalArrival (std::string context, Ptr< const SpectrumSignalParameters > signal, uint32_t senderNodeId, double rxPower, Time duration)
 Handles the event of a PHY signal arrival from a SpectrumChannel.
 
void Start ()
 Starts the statistics collection period from a specified start time.
 
void Stop ()
 Stops the statistics collection period at a specified time.
 
void UpdateCurrentlyReceivedSignal (uint32_t nodeId, uint32_t deviceId, uint8_t linkId)
 Updates the information for signals currently being received by a node.
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
virtual TypeId GetInstanceTypeId () const =0
 Get the most derived TypeId for this Object.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Retrieves the TypeId of the class.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Public Attributes

std::map< uint32_t, std::map< uint32_t, std::map< uint8_t, std::vector< WifiPpduRxRecord > > > > m_completedRecords
 Stores records of PPDUs that have completed reception, organized by node, device, and link.
 
std::map< Mac48Address, uint32_tm_macAddressToNodeId
 Maps MAC addresses to node IDs.
 
std::map< uint64_t, std::map< uint64_t, std::map< uint64_t, std::map< uint64_t, uint64_t > > > > m_nodeDeviceLinkPidToRxId
 Aids in correlating PHY reception drops and outcomes with specific reception tags.
 
std::map< uint32_t, std::map< uint32_t, std::map< uint32_t, std::vector< WifiPpduRxRecord > > > > m_nodeDeviceLinkRxRecords
 Tracks ongoing frames being transmitted or received per node, device, and link.
 
std::map< uint32_t, std::map< uint32_t, std::map< int, std::pair< uint8_t, uint16_t > > > > m_nodeToDeviceToLinkToChannelInfo
 Maps node IDs to device IDs and further to link IDs, associating each with a pair consisting of the channel number and frequency.
 
std::map< uint64_t, uint64_t > m_ppduUidToTxTag
 Maps WifiPpdu UIDs to WifiPpduRxRecord tags stored by transmitter.
 
std::vector< WifiPpduRxRecordm_records
 Stores a flat vector of all records of PPDUs that have completed reception.
 
std::map< uint64_t, std::vector< WifiPpduRxRecord > > m_rxTagToListOfOverlappingPpduRecords
 Maps each reception tag to a list of overlapping WifiPpduRxRecords.
 
std::map< uint64_t, WifiPpduRxRecordm_rxTagToPpduRecord
 Maps a reception tag to the corresponding WifiPpduRxRecord.
 
UniqueTagGenerator m_tagGenerator
 Instance of UniqueTagGenerator used for generating unique reception tags.
 

Private Member Functions

void CountStatisticsForRecord (WifiPhyTraceStatistics &statistics, const WifiPpduRxRecord &record) const
 Update the passed-in statistics object with statistics from the passed-in record.
 

Private Attributes

bool m_statisticsCollectionPeriodStarted
 Flag indicating whether to keep a record of certain statistics or events for analysis.
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoDispose ()
 Destructor implementation.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

Detailed Description

Sink class for capturing and analyzing PHY layer reception events in Wi-Fi networks.

The WifiPhyRxTraceSink class acts as a comprehensive sink for events related to the reception of signals at the Physical Layer (PHY) of Wi-Fi networks. It is designed to facilitate the detailed analysis and tracing of reception activities, and the management of reception data across nodes, devices, and links. This class supports the capture and analysis of detailed reception records, including successful and failed receptions, and offers capabilities to manage the collection of reception statistics.

Features include:

  • Unique tag generation for tracking individual reception events.
  • Access to detailed PPDU reception records for analysis.
  • Management of reception statistics collection through start, stop, and reset operations.
  • Mapping of MAC addresses to node IDs for network element identification.
  • Handling of PHY signal transmission and reception events for detailed outcome logging.
  • Tracking and analysis of overlapping reception events for interference assessment.

Definition at line 286 of file wifi-phy-rx-trace-helper.h.

Constructor & Destructor Documentation

◆ WifiPhyRxTraceSink()

ns3::WifiPhyRxTraceSink::WifiPhyRxTraceSink ( )

Constructor.

Definition at line 280 of file wifi-phy-rx-trace-helper.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ ContextToDeviceId()

int ns3::WifiPhyRxTraceSink::ContextToDeviceId ( std::string  context) const

Translates a context string to a device ID, enabling the identification of devices involved in reception events based on context information.

Parameters
contextThe context string.
Returns
The device ID associated with the context.

Definition at line 315 of file wifi-phy-rx-trace-helper.cc.

Referenced by ContextToTuple(), PhyPpduDrop(), PhySignalArrival(), PhySignalTransmission(), and PpduOutcome().

+ Here is the caller graph for this function:

◆ ContextToLinkId()

int ns3::WifiPhyRxTraceSink::ContextToLinkId ( std::string  context) const

Translates a context string to a link ID, facilitating the association of events with specific links in the network.

Parameters
contextThe context string.
Returns
The link ID associated with the context.

Definition at line 301 of file wifi-phy-rx-trace-helper.cc.

Referenced by ContextToTuple(), PhyPpduDrop(), PhySignalArrival(), PhySignalTransmission(), and PpduOutcome().

+ Here is the caller graph for this function:

◆ ContextToNodeId()

uint32_t ns3::WifiPhyRxTraceSink::ContextToNodeId ( std::string  context) const

Translates a context string to a node ID.

Parameters
contextThe context string to translate.
Returns
The corresponding node ID, facilitating the identification of the node involved in a reception event.

Definition at line 293 of file wifi-phy-rx-trace-helper.cc.

Referenced by ContextToTuple(), PhyPpduDrop(), PhySignalArrival(), PhySignalTransmission(), and PpduOutcome().

+ Here is the caller graph for this function:

◆ ContextToTuple()

std::string ns3::WifiPhyRxTraceSink::ContextToTuple ( std::string  context) const

Translate a context string to a colon-delimited tuple "0:0:0" where the first element is a node ID, second is a device ID, third is a link ID.

Parameters
contextThe context string to translate.
Returns
The tuple of node, device, and link IDs

Definition at line 326 of file wifi-phy-rx-trace-helper.cc.

References ContextToDeviceId(), ContextToLinkId(), and ContextToNodeId().

Referenced by PhySignalArrival(), and PhySignalTransmission().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CountStatistics() [1/2]

WifiPhyTraceStatistics ns3::WifiPhyRxTraceSink::CountStatistics ( ) const

Counts and aggregates PHY layer statistics including receptions, transmissions, and performance metrics (Success, Failure, Overlap) of unicast data PPDUs and MPDUs across all nodes.

Returns
WifiPhyTraceStatistics object containing aggregated statistics for all nodes.

Definition at line 941 of file wifi-phy-rx-trace-helper.cc.

References CountStatisticsForRecord(), m_completedRecords, and NS_LOG_FUNCTION.

Referenced by GetStatistics(), and PrintStatistics().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CountStatistics() [2/2]

WifiPhyTraceStatistics ns3::WifiPhyRxTraceSink::CountStatistics ( uint32_t  nodeId,
uint32_t  deviceId,
uint8_t  linkId 
) const

Counts statistics related to PHY layer receptions, transmissions, and performance metrics such as Success, Failure or Overlap of a PPDU containing unicast data, and the MPDUs within, for the specific node, device and link.

Parameters
nodeIdNode identifier.
deviceIdDevice identifier.
linkIdLink identifier.
Returns
WifiPhyTraceStatistics object with current reception stats.

Definition at line 962 of file wifi-phy-rx-trace-helper.cc.

References CountStatisticsForRecord(), m_completedRecords, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ CountStatisticsForRecord()

void ns3::WifiPhyRxTraceSink::CountStatisticsForRecord ( WifiPhyTraceStatistics statistics,
const WifiPpduRxRecord record 
) const
private

Update the passed-in statistics object with statistics from the passed-in record.

Parameters
statisticsThe WifiPhyTraceStatistics object to modify
recordThe WifiPpduRxRecord to examine

Definition at line 816 of file wifi-phy-rx-trace-helper.cc.

References ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetType(), ns3::WifiMacHeader::IsData(), ns3::WifiPhyTraceStatistics::m_failedMpdus, ns3::WifiPhyTraceStatistics::m_failedPpdus, m_macAddressToNodeId, ns3::WifiPhyTraceStatistics::m_nonOverlappingPpdus, ns3::WifiPpduRxRecord::m_overlappingPpdu, ns3::WifiPhyTraceStatistics::m_overlappingPpdus, ns3::WifiPpduRxRecord::m_ppdu, ns3::WifiPhyTraceStatistics::m_ppduDropReasons, ns3::WifiPpduRxRecord::m_reason, ns3::WifiPhyTraceStatistics::m_receivedMpdus, ns3::WifiPhyTraceStatistics::m_receivedPpdus, ns3::WifiPpduRxRecord::m_receiverId, ns3::WifiPpduRxRecord::m_statusPerMpdu, ns3::PeekPointer(), ns3::WIFI_MAC_DATA, and ns3::WIFI_MAC_QOSDATA.

Referenced by CountStatistics().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreateVectorFromRecords()

void ns3::WifiPhyRxTraceSink::CreateVectorFromRecords ( )

Creates a vector with all completed WiFi reception records to be returned by the GetPpduRecords().

This is only called if no specific node, device or link is provided.

Definition at line 1053 of file wifi-phy-rx-trace-helper.cc.

References m_completedRecords, and m_records.

◆ EndTx()

void ns3::WifiPhyRxTraceSink::EndTx ( uint32_t  nodeId,
uint32_t  deviceId,
WifiPpduRxRecord  ppduRecord 
)

Handles the conclusion of a transmission event, facilitating the logging of transmission outcomes.

Parameters
nodeIdThe node ID from which the transmission originated.
deviceIdThe device ID on the node that performed the transmission.
ppduRecordThe WifiPpduRxRecord representing the concluded transmission.

Definition at line 493 of file wifi-phy-rx-trace-helper.cc.

References ns3::WifiPpduRxRecord::m_linkId, m_nodeDeviceLinkRxRecords, ns3::WifiPpduRxRecord::m_rxTag, m_rxTagToPpduRecord, NS_LOG_FUNCTION, and NS_LOG_INFO.

Referenced by PhySignalTransmission().

+ Here is the caller graph for this function:

◆ GetChannelInfo()

std::optional< std::pair< uint8_t, uint16_t > > ns3::WifiPhyRxTraceSink::GetChannelInfo ( uint32_t  node,
uint32_t  deviceId,
int  link 
) const

Retrieves the frequency and channel number used by a specific link.

Parameters
nodeThe node ID.
deviceIdThe device ID of the WifiNetDevice.
linkThe link ID.
Returns
A pair containing the channel number (uint8_t) and frequency (uint16_t).

Definition at line 437 of file wifi-phy-rx-trace-helper.cc.

References m_nodeToDeviceToLinkToChannelInfo.

Referenced by PhySignalArrival().

+ Here is the caller graph for this function:

◆ GetPpduRecords() [1/2]

const std::vector< WifiPpduRxRecord > & ns3::WifiPhyRxTraceSink::GetPpduRecords ( ) const

Provides access to all saved and completed PPDU reception records across all nodes, WifiNetDevices, and links.

Returns
A constant reference to a vector of WifiPpduRxRecord instances.

Definition at line 1072 of file wifi-phy-rx-trace-helper.cc.

References m_records.

◆ GetPpduRecords() [2/2]

std::optional< std::reference_wrapper< const std::vector< WifiPpduRxRecord > > > ns3::WifiPhyRxTraceSink::GetPpduRecords ( uint32_t  nodeId,
uint32_t  deviceId = 0,
uint8_t  linkId = 0 
) const

Provides access to PPDU reception records for a specific node, device, and link.

Parameters
nodeIdThe ID of the node.
deviceIdThe ID of the WifiNetDevice (optional, defaults to 0).
linkIdThe ID of the link (optional, defaults to 0).
Returns
A constant reference to a vector of WifiPpduRxRecord instances.

Definition at line 1078 of file wifi-phy-rx-trace-helper.cc.

References m_completedRecords.

◆ GetStatistics() [1/2]

WifiPhyTraceStatistics ns3::WifiPhyRxTraceSink::GetStatistics ( ) const

Returns statistics on the count of successful and failed PPDUs with unicast data, and their MPDUs, across all nodes, devices, and links.

Returns
A WifiPhyTraceStatistics object containing the current statistics. This method does not reset the collected statistics, allowing for continuous accumulation of data over time.

Definition at line 986 of file wifi-phy-rx-trace-helper.cc.

References CountStatistics().

+ Here is the call graph for this function:

◆ GetStatistics() [2/2]

WifiPhyTraceStatistics ns3::WifiPhyRxTraceSink::GetStatistics ( uint32_t  nodeId,
uint32_t  deviceId,
uint8_t  linkId 
) const

Returns statistics on the count of successful and failed PPDUs with unicast data, and their MPDUs, for a specific node, device, and link.

Parameters
nodeIdThe node ID from which to get the statistics.
deviceIdThe device ID from which to get the statistics.
linkIdThe link ID from which to get the statistics.
Returns
A WifiPhyTraceStatistics object containing the current statistics. This method does not reset the collected statistics, allowing for continuous accumulation of data over time.

Definition at line 993 of file wifi-phy-rx-trace-helper.cc.

References CountStatistics().

+ Here is the call graph for this function:

◆ GetTypeId()

TypeId ns3::WifiPhyRxTraceSink::GetTypeId ( )
static

Retrieves the TypeId of the class.

Returns
The TypeId of the WifiPhyRxTraceSink class.

Definition at line 271 of file wifi-phy-rx-trace-helper.cc.

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ IsCollectionPeriodActive()

bool ns3::WifiPhyRxTraceSink::IsCollectionPeriodActive ( ) const

Returns whether the collection period is active.

Returns
Whether the collection period is active

Definition at line 568 of file wifi-phy-rx-trace-helper.cc.

References m_statisticsCollectionPeriodStarted.

◆ MapNodeToLinkToChannel()

void ns3::WifiPhyRxTraceSink::MapNodeToLinkToChannel ( NodeContainer  nodes)

Maps nodes to links and channels, creating a structured association between network elements and their communication channels.

This mapping is essential for understanding what frequency and channel number is used for a given link.

Parameters
nodesNodeContainer of all nodes whose MAC address is going to be link to their NodeID.

Definition at line 408 of file wifi-phy-rx-trace-helper.cc.

References m_nodeToDeviceToLinkToChannelInfo, nodes, and NS_LOG_DEBUG.

◆ PhyPpduDrop()

void ns3::WifiPhyRxTraceSink::PhyPpduDrop ( std::string  context,
Ptr< const WifiPpdu ppdu,
WifiPhyRxfailureReason  reason 
)

Logs the drop of a PPDU at the PHY layer, detailing the context and reason for the drop.

Parameters
contextDescriptive context for the PPDU drop.
ppduPointer to the PPDU that was dropped.
reasonThe reason for the PPDU drop, represented as a WifiPhyRxfailureReason.

Definition at line 746 of file wifi-phy-rx-trace-helper.cc.

References ContextToDeviceId(), ContextToLinkId(), ContextToNodeId(), ns3::WifiPpduRxRecord::m_endTime, m_nodeDeviceLinkPidToRxId, ns3::WifiPpduRxRecord::m_ppdu, ns3::WifiPpduRxRecord::m_reason, ns3::WifiPpduRxRecord::m_rxTag, m_rxTagToPpduRecord, ns3::WifiPpduRxRecord::m_statusPerMpdu, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::PeekPointer(), PhyRxEnd(), and ns3::Simulator::Schedule().

Referenced by ns3::WifiPhyRxTraceHelper::Enable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PhyRxEnd()

void ns3::WifiPhyRxTraceSink::PhyRxEnd ( uint32_t  nodeId,
uint32_t  deviceId,
uint64_t  rxTag,
uint64_t  ppduUid 
)

Handles the end of a PHY reception event, logging the conclusion of a reception and its associated details.

Parameters
nodeIdThe node ID where the reception ended.
deviceIdThe device ID on the node where the reception took place.
rxTagThe unique reception tag associated with the reception event.
ppduUidThe PPDU UID of the received WifiPpdu

Definition at line 517 of file wifi-phy-rx-trace-helper.cc.

References m_completedRecords, m_nodeDeviceLinkRxRecords, m_rxTagToListOfOverlappingPpduRecords, m_rxTagToPpduRecord, m_statisticsCollectionPeriodStarted, ns3::Simulator::Now(), NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, and UpdateCurrentlyReceivedSignal().

Referenced by PhyPpduDrop(), and PpduOutcome().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PhySignalArrival()

void ns3::WifiPhyRxTraceSink::PhySignalArrival ( std::string  context,
Ptr< const WifiPpdu ppdu,
double  rxPower,
Time  duration 
)

Handles the event of a Wi-Fi PPDU arrival.

Parameters
contextThe context string, offering contextual information about the signal reception.
ppduThe received WifiPpdu
rxPowerThe power level at which the signal was received, indicating the signal's strength.
durationThe duration of the signal, offering temporal information about the reception event.

Definition at line 653 of file wifi-phy-rx-trace-helper.cc.

References ContextToDeviceId(), ContextToLinkId(), ContextToNodeId(), ContextToTuple(), ns3::WifiPhyRxTraceSink::UniqueTagGenerator::GenerateUniqueTag(), GetChannelInfo(), ns3::WifiPpduRxRecord::m_endTime, ns3::WifiPpduRxRecord::m_linkId, m_nodeDeviceLinkPidToRxId, m_nodeDeviceLinkRxRecords, ns3::WifiPpduRxRecord::m_ppdu, m_ppduUidToTxTag, ns3::WifiPpduRxRecord::m_receiverId, ns3::WifiPpduRxRecord::m_rssi, ns3::WifiPpduRxRecord::m_rxTag, m_rxTagToPpduRecord, ns3::WifiPpduRxRecord::m_senderDeviceId, ns3::WifiPpduRxRecord::m_senderId, ns3::WifiPpduRxRecord::m_startTime, m_tagGenerator, ns3::Simulator::Now(), NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, and UpdateCurrentlyReceivedSignal().

Referenced by ns3::WifiPhyRxTraceHelper::Enable(), and SpectrumPhySignalArrival().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PhySignalTransmission()

void ns3::WifiPhyRxTraceSink::PhySignalTransmission ( std::string  context,
Ptr< const WifiPpdu ppdu,
const WifiTxVector txVector 
)

Handles the event of a PHY signal transmission.

Parameters
contextThe context string, providing situational information about the transmission.
ppduThe Wi-Fi PPDU being transmitted.
txVectorThe transmission vector, detailing the parameters of the transmission.

Definition at line 586 of file wifi-phy-rx-trace-helper.cc.

References ContextToDeviceId(), ContextToLinkId(), ContextToNodeId(), ContextToTuple(), EndTx(), ns3::WifiPhyRxTraceSink::UniqueTagGenerator::GenerateUniqueTag(), ns3::WifiPpduRxRecord::m_endTime, ns3::WifiPpduRxRecord::m_linkId, m_nodeDeviceLinkRxRecords, ns3::WifiPpduRxRecord::m_ppdu, m_ppduUidToTxTag, ns3::WifiPpduRxRecord::m_rxTag, m_rxTagToPpduRecord, ns3::WifiPpduRxRecord::m_senderDeviceId, ns3::WifiPpduRxRecord::m_senderId, ns3::WifiPpduRxRecord::m_startTime, m_tagGenerator, ns3::Simulator::Now(), NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_INFO, and ns3::Simulator::Schedule().

Referenced by ns3::WifiPhyRxTraceHelper::Enable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PpduOutcome()

void ns3::WifiPhyRxTraceSink::PpduOutcome ( std::string  context,
Ptr< const WifiPpdu ppdu,
RxSignalInfo  signal,
const WifiTxVector txVector,
const std::vector< bool > &  statusPerMpdu 
)

Records the outcome of a PPDU transmission, including the signal info, and the success or failure status of each MPDU within the PPDU.

Parameters
contextDescriptive context for the PPDU outcome.
ppduPointer to the PPDU whose outcome is being recorded.
signalInformation about the received signal.
txVectorThe transmission vector used for the PPDU.
statusPerMpduA vector indicating the success (true) or failure (false) of each MPDU.

Definition at line 784 of file wifi-phy-rx-trace-helper.cc.

References ContextToDeviceId(), ContextToLinkId(), ContextToNodeId(), m_nodeDeviceLinkPidToRxId, ns3::WifiPpduRxRecord::m_ppdu, ns3::WifiPpduRxRecord::m_rxTag, m_rxTagToPpduRecord, ns3::WifiPpduRxRecord::m_statusPerMpdu, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, and PhyRxEnd().

Referenced by ns3::WifiPhyRxTraceHelper::Enable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PrintStatistics() [1/2]

void ns3::WifiPhyRxTraceSink::PrintStatistics ( ) const

Prints a summary of the statistics collected, offering a concise overview of PHY layer performance and reception outcomes for all nodes, devices and links.

Definition at line 1000 of file wifi-phy-rx-trace-helper.cc.

References CountStatistics(), ns3::WifiPhyTraceStatistics::m_failedMpdus, ns3::WifiPhyTraceStatistics::m_failedPpdus, ns3::WifiPhyTraceStatistics::m_nonOverlappingPpdus, ns3::WifiPhyTraceStatistics::m_overlappingPpdus, ns3::WifiPhyTraceStatistics::m_ppduDropReasons, ns3::WifiPhyTraceStatistics::m_receivedMpdus, and ns3::WifiPhyTraceStatistics::m_receivedPpdus.

+ Here is the call graph for this function:

◆ PrintStatistics() [2/2]

void ns3::WifiPhyRxTraceSink::PrintStatistics ( uint32_t  nodeId,
uint32_t  deviceId,
uint8_t  linkId 
) const

Prints statistics collected in the period for a node, device, and link.

Parameters
nodeIdNode identifier.
deviceIdDevice identifier.
linkIdLink identifier.

Definition at line 1023 of file wifi-phy-rx-trace-helper.cc.

References CountStatistics(), ns3::WifiPhyTraceStatistics::m_failedMpdus, ns3::WifiPhyTraceStatistics::m_failedPpdus, ns3::WifiPhyTraceStatistics::m_nonOverlappingPpdus, ns3::WifiPhyTraceStatistics::m_overlappingPpdus, ns3::WifiPhyTraceStatistics::m_ppduDropReasons, ns3::WifiPhyTraceStatistics::m_receivedMpdus, and ns3::WifiPhyTraceStatistics::m_receivedPpdus.

+ Here is the call graph for this function:

◆ Reset()

void ns3::WifiPhyRxTraceSink::Reset ( )

Resets the statistics collection, clearing all counts and discarding all fully completed PPDU records.

This allows for a fresh start in data collection and analysis.

Definition at line 1045 of file wifi-phy-rx-trace-helper.cc.

References m_completedRecords, and m_records.

◆ SetMapMacAddressToNodeId()

void ns3::WifiPhyRxTraceSink::SetMapMacAddressToNodeId ( const std::map< Mac48Address, uint32_t > &  MacAddressToNodeIdMap)

Provides a custom mapping of MAC addresses to intended receiver node IDs.

This mapping is crucial for identifying the nodes involved in reception events based on their MAC addresses, facilitating the analysis of network dynamics at the PHY layer.

Parameters
MacAddressToNodeIdMapA mapping from MAC addresses to node IDs.

Definition at line 286 of file wifi-phy-rx-trace-helper.cc.

References m_macAddressToNodeId.

◆ SpectrumPhySignalArrival()

void ns3::WifiPhyRxTraceSink::SpectrumPhySignalArrival ( std::string  context,
Ptr< const SpectrumSignalParameters signal,
uint32_t  senderNodeId,
double  rxPower,
Time  duration 
)

Handles the event of a PHY signal arrival from a SpectrumChannel.

Parameters
contextThe context string, offering contextual information about the signal reception.
signalThe received signal parameters, detailing the characteristics of the arriving signal.
senderNodeIdThe ID of the node sending the signal, providing insight into the source of the signal.
rxPowerThe power level at which the signal was received, indicating the signal's strength.
durationThe duration of the signal, offering temporal information about the reception event.

Definition at line 634 of file wifi-phy-rx-trace-helper.cc.

References NS_LOG_DEBUG, NS_LOG_FUNCTION, and PhySignalArrival().

Referenced by ns3::WifiPhyRxTraceHelper::Enable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Start()

void ns3::WifiPhyRxTraceSink::Start ( )

Starts the statistics collection period from a specified start time.

Ongoing PPDUs when this method is called will be counted towards this statistics collection period.

Definition at line 574 of file wifi-phy-rx-trace-helper.cc.

References m_statisticsCollectionPeriodStarted.

Referenced by ns3::WifiPhyRxTraceHelper::Start().

+ Here is the caller graph for this function:

◆ Stop()

void ns3::WifiPhyRxTraceSink::Stop ( )

Stops the statistics collection period at a specified time.

This method ensures that incomplete PPDUs at the end of the collection period are not included in the current statistics count.

Definition at line 580 of file wifi-phy-rx-trace-helper.cc.

References m_statisticsCollectionPeriodStarted.

Referenced by ns3::WifiPhyRxTraceHelper::Stop().

+ Here is the caller graph for this function:

◆ UpdateCurrentlyReceivedSignal()

void ns3::WifiPhyRxTraceSink::UpdateCurrentlyReceivedSignal ( uint32_t  nodeId,
uint32_t  deviceId,
uint8_t  linkId 
)

Updates the information for signals currently being received by a node.

Parameters
nodeIdThe node ID for which to update the reception information.
deviceIdThe device ID on the node for which to update the information.
linkIdThe link ID associated with the ongoing reception.

Definition at line 459 of file wifi-phy-rx-trace-helper.cc.

References m_nodeDeviceLinkRxRecords, m_rxTagToListOfOverlappingPpduRecords, NS_LOG_FUNCTION, and NS_LOG_INFO.

Referenced by PhyRxEnd(), and PhySignalArrival().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_completedRecords

std::map<uint32_t, std::map<uint32_t, std::map<uint8_t, std::vector<WifiPpduRxRecord> > > > ns3::WifiPhyRxTraceSink::m_completedRecords

Stores records of PPDUs that have completed reception, organized by node, device, and link.

This nested map structure is updated each time a WifiPpduRxRecord is finalized, keeping a history of all completed packet receptions across different nodes, devices, and links.

Definition at line 607 of file wifi-phy-rx-trace-helper.h.

Referenced by CountStatistics(), CreateVectorFromRecords(), GetPpduRecords(), PhyRxEnd(), and Reset().

◆ m_macAddressToNodeId

std::map<Mac48Address, uint32_t> ns3::WifiPhyRxTraceSink::m_macAddressToNodeId

Maps MAC addresses to node IDs.

This mapping facilitates the identification of nodes within the network based on the MAC addresses observed in reception events. By translating MAC addresses to node IDs, this map enables the association of reception data with specific network nodes.

Definition at line 658 of file wifi-phy-rx-trace-helper.h.

Referenced by CountStatisticsForRecord(), and SetMapMacAddressToNodeId().

◆ m_nodeDeviceLinkPidToRxId

std::map<uint64_t, std::map<uint64_t, std::map<uint64_t, std::map<uint64_t, uint64_t> > > > ns3::WifiPhyRxTraceSink::m_nodeDeviceLinkPidToRxId

Aids in correlating PHY reception drops and outcomes with specific reception tags.

This complex map structure is used to navigate from node and device IDs, and link and packet IDs (PIDs), to the corresponding reception tag.

Definition at line 642 of file wifi-phy-rx-trace-helper.h.

Referenced by PhyPpduDrop(), PhySignalArrival(), and PpduOutcome().

◆ m_nodeDeviceLinkRxRecords

std::map<uint32_t, std::map<uint32_t, std::map<uint32_t, std::vector<WifiPpduRxRecord> > > > ns3::WifiPhyRxTraceSink::m_nodeDeviceLinkRxRecords

Tracks ongoing frames being transmitted or received per node, device, and link.

This map associates each node (by its ID) with nested maps keyed by device and link IDs, each containing vectors of WifiPpduRxRecords. It enables the tracking of current packet transmissions and receptions.

Definition at line 625 of file wifi-phy-rx-trace-helper.h.

Referenced by EndTx(), PhyRxEnd(), PhySignalArrival(), PhySignalTransmission(), and UpdateCurrentlyReceivedSignal().

◆ m_nodeToDeviceToLinkToChannelInfo

std::map<uint32_t, std::map<uint32_t, std::map<int, std::pair<uint8_t, uint16_t> > > > ns3::WifiPhyRxTraceSink::m_nodeToDeviceToLinkToChannelInfo

Maps node IDs to device IDs and further to link IDs, associating each with a pair consisting of the channel number and frequency.

This structure is vital for understanding the channel and frequency utilization across different links.

Definition at line 666 of file wifi-phy-rx-trace-helper.h.

Referenced by GetChannelInfo(), and MapNodeToLinkToChannel().

◆ m_ppduUidToTxTag

std::map<uint64_t, uint64_t> ns3::WifiPhyRxTraceSink::m_ppduUidToTxTag

Maps WifiPpdu UIDs to WifiPpduRxRecord tags stored by transmitter.

This map allows a transmit-side PPDU record to be fetched based on the WifiPpdu UID.

Definition at line 649 of file wifi-phy-rx-trace-helper.h.

Referenced by PhySignalArrival(), and PhySignalTransmission().

◆ m_records

std::vector<WifiPpduRxRecord> ns3::WifiPhyRxTraceSink::m_records

Stores a flat vector of all records of PPDUs that have completed reception.

This vector is updated upon the request of GetPpduRecords(), maintaining all packet receptions.

Definition at line 615 of file wifi-phy-rx-trace-helper.h.

Referenced by CreateVectorFromRecords(), GetPpduRecords(), and Reset().

◆ m_rxTagToListOfOverlappingPpduRecords

std::map<uint64_t, std::vector<WifiPpduRxRecord> > ns3::WifiPhyRxTraceSink::m_rxTagToListOfOverlappingPpduRecords

Maps each reception tag to a list of overlapping WifiPpduRxRecords.

For each unique reception tag, this map stores a vector of WifiPpduRxRecords that overlap with the record corresponding to the tag.

Definition at line 633 of file wifi-phy-rx-trace-helper.h.

Referenced by PhyRxEnd(), and UpdateCurrentlyReceivedSignal().

◆ m_rxTagToPpduRecord

std::map<uint64_t, WifiPpduRxRecord> ns3::WifiPhyRxTraceSink::m_rxTagToPpduRecord

Maps a reception tag to the corresponding WifiPpduRxRecord.

This map links each unique reception tag generated upon receiving a frame to the corresponding detailed reception record (WifiPpduRxRecord). It is refreshed every time a new reception record is created.

Definition at line 596 of file wifi-phy-rx-trace-helper.h.

Referenced by EndTx(), PhyPpduDrop(), PhyRxEnd(), PhySignalArrival(), PhySignalTransmission(), and PpduOutcome().

◆ m_statisticsCollectionPeriodStarted

bool ns3::WifiPhyRxTraceSink::m_statisticsCollectionPeriodStarted
private

Flag indicating whether to keep a record of certain statistics or events for analysis.

This boolean flag can be toggled to control the granularity and scope of data collection, enabling customization of the analysis to focus on specific times of interest.

Definition at line 674 of file wifi-phy-rx-trace-helper.h.

Referenced by IsCollectionPeriodActive(), PhyRxEnd(), Start(), and Stop().

◆ m_tagGenerator

UniqueTagGenerator ns3::WifiPhyRxTraceSink::m_tagGenerator

Instance of UniqueTagGenerator used for generating unique reception tags.

Definition at line 324 of file wifi-phy-rx-trace-helper.h.

Referenced by PhySignalArrival(), and PhySignalTransmission().


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