Sink class for capturing and analyzing PHY layer reception events in Wi-Fi networks. More...
#include "wifi-phy-rx-trace-helper.h"
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< Object > | GetObject () 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< Object > | GetObject (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. | |
SimpleRefCount & | operator= (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, bool permissive=false) 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. | |
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_t > | m_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< WifiPpduRxRecord > | m_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, WifiPpduRxRecord > | m_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 {false} |
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. | |
Related Symbols inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
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:
Definition at line 275 of file wifi-phy-rx-trace-helper.h.
ns3::WifiPhyRxTraceSink::WifiPhyRxTraceSink | ( | ) |
Constructor.
Definition at line 269 of file wifi-phy-rx-trace-helper.cc.
References NS_LOG_FUNCTION.
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.
context | The context string. |
Definition at line 304 of file wifi-phy-rx-trace-helper.cc.
Referenced by ContextToTuple(), PhyPpduDrop(), PhySignalArrival(), PhySignalTransmission(), and PpduOutcome().
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.
context | The context string. |
Definition at line 290 of file wifi-phy-rx-trace-helper.cc.
Referenced by ContextToTuple(), PhyPpduDrop(), PhySignalArrival(), PhySignalTransmission(), and PpduOutcome().
uint32_t ns3::WifiPhyRxTraceSink::ContextToNodeId | ( | std::string | context | ) | const |
Translates a context string to a node ID.
context | The context string to translate. |
Definition at line 282 of file wifi-phy-rx-trace-helper.cc.
Referenced by ContextToTuple(), PhyPpduDrop(), PhySignalArrival(), PhySignalTransmission(), and PpduOutcome().
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.
context | The context string to translate. |
Definition at line 315 of file wifi-phy-rx-trace-helper.cc.
References ContextToDeviceId(), ContextToLinkId(), and ContextToNodeId().
Referenced by PhySignalArrival(), and PhySignalTransmission().
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.
Definition at line 930 of file wifi-phy-rx-trace-helper.cc.
References CountStatisticsForRecord(), m_completedRecords, and NS_LOG_FUNCTION.
Referenced by GetStatistics(), GetStatistics(), PrintStatistics(), and PrintStatistics().
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.
nodeId | Node identifier. |
deviceId | Device identifier. |
linkId | Link identifier. |
Definition at line 951 of file wifi-phy-rx-trace-helper.cc.
References CountStatisticsForRecord(), m_completedRecords, and NS_LOG_FUNCTION.
|
private |
Update the passed-in statistics object with statistics from the passed-in record.
statistics | The WifiPhyTraceStatistics object to modify |
record | The WifiPpduRxRecord to examine |
Definition at line 805 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(), and CountStatistics().
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 1042 of file wifi-phy-rx-trace-helper.cc.
References m_completedRecords, and m_records.
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.
nodeId | The node ID from which the transmission originated. |
deviceId | The device ID on the node that performed the transmission. |
ppduRecord | The WifiPpduRxRecord representing the concluded transmission. |
Definition at line 482 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().
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.
node | The node ID. |
deviceId | The device ID of the WifiNetDevice. |
link | The link ID. |
Definition at line 426 of file wifi-phy-rx-trace-helper.cc.
References m_nodeToDeviceToLinkToChannelInfo.
Referenced by PhySignalArrival().
const std::vector< WifiPpduRxRecord > & ns3::WifiPhyRxTraceSink::GetPpduRecords | ( | ) | const |
Provides access to all saved and completed PPDU reception records across all nodes, WifiNetDevices, and links.
Definition at line 1061 of file wifi-phy-rx-trace-helper.cc.
References m_records.
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.
nodeId | The ID of the node. |
deviceId | The ID of the WifiNetDevice (optional, defaults to 0). |
linkId | The ID of the link (optional, defaults to 0). |
Definition at line 1067 of file wifi-phy-rx-trace-helper.cc.
References m_completedRecords.
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.
Definition at line 975 of file wifi-phy-rx-trace-helper.cc.
References CountStatistics().
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.
nodeId | The node ID from which to get the statistics. |
deviceId | The device ID from which to get the statistics. |
linkId | The link ID from which to get the statistics. |
Definition at line 982 of file wifi-phy-rx-trace-helper.cc.
References CountStatistics().
|
static |
Retrieves the TypeId of the class.
Definition at line 260 of file wifi-phy-rx-trace-helper.cc.
References ns3::TypeId::SetParent().
bool ns3::WifiPhyRxTraceSink::IsCollectionPeriodActive | ( | ) | const |
Returns whether the collection period is active.
Definition at line 557 of file wifi-phy-rx-trace-helper.cc.
References m_statisticsCollectionPeriodStarted.
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.
nodes | NodeContainer of all nodes whose MAC address is going to be link to their NodeID. |
Definition at line 397 of file wifi-phy-rx-trace-helper.cc.
References ns3::DynamicCast(), m_nodeToDeviceToLinkToChannelInfo, nodes, and NS_LOG_DEBUG.
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.
context | Descriptive context for the PPDU drop. |
ppdu | Pointer to the PPDU that was dropped. |
reason | The reason for the PPDU drop, represented as a WifiPhyRxfailureReason. |
Definition at line 735 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().
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.
nodeId | The node ID where the reception ended. |
deviceId | The device ID on the node where the reception took place. |
rxTag | The unique reception tag associated with the reception event. |
ppduUid | The PPDU UID of the received WifiPpdu |
Definition at line 506 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().
void ns3::WifiPhyRxTraceSink::PhySignalArrival | ( | std::string | context, |
Ptr< const WifiPpdu > | ppdu, | ||
double | rxPower, | ||
Time | duration ) |
Handles the event of a Wi-Fi PPDU arrival.
context | The context string, offering contextual information about the signal reception. |
ppdu | The received WifiPpdu |
rxPower | The power level at which the signal was received, indicating the signal's strength. |
duration | The duration of the signal, offering temporal information about the reception event. |
Definition at line 642 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().
void ns3::WifiPhyRxTraceSink::PhySignalTransmission | ( | std::string | context, |
Ptr< const WifiPpdu > | ppdu, | ||
const WifiTxVector & | txVector ) |
Handles the event of a PHY signal transmission.
context | The context string, providing situational information about the transmission. |
ppdu | The Wi-Fi PPDU being transmitted. |
txVector | The transmission vector, detailing the parameters of the transmission. |
Definition at line 575 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().
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.
context | Descriptive context for the PPDU outcome. |
ppdu | Pointer to the PPDU whose outcome is being recorded. |
signal | Information about the received signal. |
txVector | The transmission vector used for the PPDU. |
statusPerMpdu | A vector indicating the success (true) or failure (false) of each MPDU. |
Definition at line 773 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().
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 989 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.
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.
nodeId | Node identifier. |
deviceId | Device identifier. |
linkId | Link identifier. |
Definition at line 1012 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.
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 1034 of file wifi-phy-rx-trace-helper.cc.
References m_completedRecords, and m_records.
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.
MacAddressToNodeIdMap | A mapping from MAC addresses to node IDs. |
Definition at line 275 of file wifi-phy-rx-trace-helper.cc.
References m_macAddressToNodeId.
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.
context | The context string, offering contextual information about the signal reception. |
signal | The received signal parameters, detailing the characteristics of the arriving signal. |
senderNodeId | The ID of the node sending the signal, providing insight into the source of the signal. |
rxPower | The power level at which the signal was received, indicating the signal's strength. |
duration | The duration of the signal, offering temporal information about the reception event. |
Definition at line 623 of file wifi-phy-rx-trace-helper.cc.
References ns3::DynamicCast(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and PhySignalArrival().
Referenced by ns3::WifiPhyRxTraceHelper::Enable().
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 563 of file wifi-phy-rx-trace-helper.cc.
References m_statisticsCollectionPeriodStarted.
Referenced by ns3::WifiPhyRxTraceHelper::Start().
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 569 of file wifi-phy-rx-trace-helper.cc.
References m_statisticsCollectionPeriodStarted.
Referenced by ns3::WifiPhyRxTraceHelper::Stop().
void ns3::WifiPhyRxTraceSink::UpdateCurrentlyReceivedSignal | ( | uint32_t | nodeId, |
uint32_t | deviceId, | ||
uint8_t | linkId ) |
Updates the information for signals currently being received by a node.
nodeId | The node ID for which to update the reception information. |
deviceId | The device ID on the node for which to update the information. |
linkId | The link ID associated with the ongoing reception. |
Definition at line 448 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().
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 596 of file wifi-phy-rx-trace-helper.h.
Referenced by CountStatistics(), CountStatistics(), CreateVectorFromRecords(), GetPpduRecords(), PhyRxEnd(), and Reset().
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 647 of file wifi-phy-rx-trace-helper.h.
Referenced by CountStatisticsForRecord(), and SetMapMacAddressToNodeId().
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 631 of file wifi-phy-rx-trace-helper.h.
Referenced by PhyPpduDrop(), PhySignalArrival(), and PpduOutcome().
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 614 of file wifi-phy-rx-trace-helper.h.
Referenced by EndTx(), PhyRxEnd(), PhySignalArrival(), PhySignalTransmission(), and UpdateCurrentlyReceivedSignal().
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 655 of file wifi-phy-rx-trace-helper.h.
Referenced by GetChannelInfo(), and MapNodeToLinkToChannel().
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 638 of file wifi-phy-rx-trace-helper.h.
Referenced by PhySignalArrival(), and PhySignalTransmission().
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 604 of file wifi-phy-rx-trace-helper.h.
Referenced by CreateVectorFromRecords(), GetPpduRecords(), and Reset().
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 622 of file wifi-phy-rx-trace-helper.h.
Referenced by PhyRxEnd(), and UpdateCurrentlyReceivedSignal().
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 585 of file wifi-phy-rx-trace-helper.h.
Referenced by EndTx(), PhyPpduDrop(), PhyRxEnd(), PhySignalArrival(), PhySignalTransmission(), and PpduOutcome().
|
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 663 of file wifi-phy-rx-trace-helper.h.
Referenced by IsCollectionPeriodActive(), PhyRxEnd(), Start(), and Stop().
UniqueTagGenerator ns3::WifiPhyRxTraceSink::m_tagGenerator |
Instance of UniqueTagGenerator used for generating unique reception tags.
Definition at line 313 of file wifi-phy-rx-trace-helper.h.
Referenced by PhySignalArrival(), and PhySignalTransmission().