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,
324 uint16_t channelFreqMhz,
342 uint16_t channelFreqMhz,
362 bool explicitFilename)
override;
378 bool explicitFilename)
override;
413 template <
typename... Args>
428 template <
typename... Args>
438 template <
typename... Args>
499 std::string nodeName)
const;
544 template <
typename... Args>
554 template <
typename... Args>
564 template <
typename... Args>
574 template <
typename... Args>
620template <
typename... Args>
628template <
typename... Args>
632 for (std::size_t linkId = 0; linkId <
m_phys.size(); linkId++)
638template <
typename... Args>
646template <
typename... Args>
650 for (std::size_t linkId = 0; linkId <
m_phys.size(); linkId++)
656template <
typename... Args>
664template <
typename... Args>
668 for (std::size_t linkId = 0; linkId <
m_phys.size(); linkId++)
674template <
typename... Args>
682template <
typename... Args>
689template <
typename... Args>
703template <
typename... Args>
711template <
typename... Args>
718template <
typename... Args>
725template <
typename... Args>
732template <
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.
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
static void GetRadiotapHeader(RadiotapHeader &header, Ptr< Packet > packet, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu, uint16_t staId)
Get the Radiotap header for a transmitted packet.
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