16#include "ns3/qos-utils.h"
17#include "ns3/trace-helper.h"
18#include "ns3/wifi-net-device.h"
19#include "ns3/wifi-phy.h"
84 template <
typename... Args>
94 template <
typename... Args>
105 template <
typename... Args>
115 template <
typename... Args>
127 template <
typename... Args>
137 template <
typename... Args>
149 template <
typename... Args>
212 std::map<uint8_t, Ptr<PcapFileWrapper>>
files;
268 uint16_t channelFreqMhz,
287 uint16_t channelFreqMhz,
325 uint16_t channelFreqMhz,
345 uint16_t channelFreqMhz,
366 bool explicitFilename)
override;
382 bool explicitFilename)
override;
417 template <
typename... Args>
432 template <
typename... Args>
442 template <
typename... Args>
503 std::string nodeName)
const;
548 template <
typename... Args>
558 template <
typename... Args>
568 template <
typename... Args>
578 template <
typename... Args>
624template <
typename... Args>
632template <
typename... Args>
636 for (std::size_t linkId = 0; linkId <
m_phys.size(); linkId++)
642template <
typename... Args>
650template <
typename... Args>
654 for (std::size_t linkId = 0; linkId <
m_phys.size(); linkId++)
660template <
typename... Args>
668template <
typename... Args>
672 for (std::size_t linkId = 0; linkId <
m_phys.size(); linkId++)
678template <
typename... Args>
686template <
typename... Args>
693template <
typename... Args>
707template <
typename... Args>
715template <
typename... Args>
722template <
typename... Args>
729template <
typename... Args>
736template <
typename... Args>
Base class providing common user-level ascii trace operations for helpers representing net devices.
Hold a value for an Attribute.
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
Instantiate subclasses of ns3::Object.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Base class providing common user-level pcap operations for helpers representing net devices.
DataLinkType
This enumeration holds the data link types that will be written to the pcap file.
Smart pointer class similar to boost::intrusive_ptr.
helps to create WifiNetDevice objects
void SetRemoteStationManager(std::string type, Args &&... args)
Helper function used to set the station manager.
void ConfigEhtOptions(Args &&... args)
Helper function used to configure the EHT options listed as attributes of the EhtConfiguration class.
void SetObssPdAlgorithm(std::string type, Args &&... args)
Helper function used to set the OBSS-PD algorithm.
void ConfigHtOptions(Args &&... args)
Helper function used to configure the HT options listed as attributes of the HtConfiguration class.
ObjectFactory m_htConfig
HT configuration.
void ConfigHeOptions(Args &&... args)
Helper function used to configure the HE options listed as attributes of the HeConfiguration class.
ObjectFactory m_obssPdAlgorithm
OBSS_PD algorithm.
ObjectFactory m_ehtConfig
EHT configuration.
void ConfigVhtOptions(Args &&... args)
Helper function used to configure the VHT options listed as attributes of the VhtConfiguration class.
ObjectFactory m_vhtConfig
VHT configuration.
static void EnableLogComponents(LogLevel logLevel=LOG_LEVEL_ALL)
Helper to enable all WifiNetDevice log components with one statement.
void SetSelectQueueCallback(SelectQueueCallback f)
std::vector< ObjectFactory > m_stationManager
station manager
WifiStandard m_standard
wifi standard
static int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by the PHY and MAC aspects ...
virtual void SetStandard(WifiStandard standard)
ObjectFactory m_heConfig
HE configuration.
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer::Iterator first, NodeContainer::Iterator last) const
void DisableFlowControl()
Disable flow control only if you know what you are doing.
SelectQueueCallback m_selectQueueCallback
select queue callback
bool m_enableFlowControl
whether to enable flow control
WifiHelper()
Create a Wifi helper in an empty state: all its parameters must be set before calling ns3::WifiHelper...
std::function< std::size_t(Ptr< QueueItem >)> SelectQueueCallback
Callback invoked to determine the MAC queue selected for a given packet.
create MAC layers for a ns3::WifiNetDevice.
void SetPcapCaptureType(PcapCaptureType type)
Set the PCAP capture type to be used.
static void GetRadiotapHeader(RadiotapHeader &header, Ptr< Packet > packet, uint16_t channelFreqMhz, uint8_t p20Index, const WifiTxVector &txVector, MpduInfo aMpdu, uint16_t staId)
Get the Radiotap header for a transmitted packet.
void SetPcapDataLinkType(SupportedPcapDataLinkTypes dlt)
Set the data link type of PCAP traces to be used.
void EnableAsciiInternal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename) override
Enable ASCII trace output on the indicated net device.
WifiPhyHelper(uint8_t nLinks=1)
Constructor.
static void PcapSniffTxEvent(const std::shared_ptr< PcapFilesInfo > &info, uint8_t phyId, Ptr< const Packet > packet, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu, uint16_t staId=SU_STA_ID)
void Set(std::string name, const AttributeValue &v)
~WifiPhyHelper() override
void DisablePreambleDetectionModel()
Disable the preamble detection model on all links.
void SetErrorRateModel(std::string type, Args &&... args)
Helper function used to set the error rate model.
void SetInterferenceHelper(std::string type, Args &&... args)
Helper function used to set the interference helper.
void EnablePcapInternal(std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename) override
Enable pcap output the indicated net device.
PcapHelper::DataLinkType m_pcapDlt
PCAP data link type.
std::vector< ObjectFactory > m_frameCaptureModel
frame capture model
std::vector< ObjectFactory > m_preambleDetectionModel
preamble detection model
PcapHelper::DataLinkType GetPcapDataLinkType() const
Get the data link type of PCAP traces to be used.
void SetFrameCaptureModel(std::string type, Args &&... args)
Helper function used to set the frame capture model.
PcapCaptureType m_pcapType
PCAP capture type.
PcapCaptureType GetPcapCaptureType() const
Get the PCAP capture type to be used.
std::vector< ObjectFactory > m_phys
PHY objects.
static void PcapSniffRxEvent(const std::shared_ptr< PcapFilesInfo > &info, uint8_t phyId, Ptr< const Packet > packet, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu, SignalNoiseDbm signalNoise, uint16_t staId=SU_STA_ID)
void SetPreambleDetectionModel(std::string type, Args &&... args)
Helper function used to set the preamble detection model.
static Ptr< PcapFileWrapper > GetOrCreatePcapFile(const std::shared_ptr< PcapFilesInfo > &info, uint8_t phyId)
Get the PCAP file to write to from a list of PCAP files indexed by PHY ID.
SupportedPcapDataLinkTypes
An enumeration of the pcap data link types (DLTs) which this helper supports.
@ DLT_IEEE802_11
IEEE 802.11 Wireless LAN headers on packets.
@ DLT_IEEE802_11_RADIO
Include Radiotap link layer information.
@ DLT_PRISM_HEADER
Include Prism monitor mode information.
std::vector< ObjectFactory > m_errorRateModel
error rate model
virtual std::vector< Ptr< WifiPhy > > Create(Ptr< Node > node, Ptr< WifiNetDevice > device) const =0
PcapCaptureType
An enumeration of the PCAP capture types.
@ PCAP_PER_PHY
Single capture file per PHY.
@ PCAP_PER_DEVICE
Single capture file per device.
@ PCAP_PER_LINK
Single capture file per link.
ObjectFactory m_interferenceHelper
interference helper
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
LogLevel
Logging severity classes and levels.
@ LOG_LEVEL_ALL
Print everything.
static constexpr uint16_t SU_STA_ID
STA_ID to identify a single user (SU)
SignalNoiseDbm structure.
structure holding the information about PCAP files generated for a given device
std::string commonFilename
common file name of the PCAP files
WifiPhyHelper::PcapCaptureType pcapType
the selected PCAP capture type
Ptr< WifiNetDevice > device
the WifiNetDevice for which the PCAP files are generated
std::map< uint8_t, Ptr< PcapFileWrapper > > files
PCAP files indexed by PHY ID.
PcapFilesInfo(const std::string &filename, PcapHelper::DataLinkType dlt, WifiPhyHelper::PcapCaptureType type, Ptr< WifiNetDevice > dev)
Constructor.
PcapHelper::DataLinkType pcapDlt
the selected data link type of the pcap file