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

helps to create WifiNetDevice objects More...

#include "wifi-helper.h"

+ Collaboration diagram for ns3::WifiHelper:

Public Types

typedef std::function< std::size_t(Ptr< QueueItem >)> SelectQueueCallback
 Callback invoked to determine the MAC queue selected for a given packet.
 

Public Member Functions

 WifiHelper ()
 Create a Wifi helper in an empty state: all its parameters must be set before calling ns3::WifiHelper::Install.
 
virtual ~WifiHelper ()
 
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 of the Wifi models.
 
template<typename... Args>
void ConfigEhtOptions (Args &&... args)
 Helper function used to configure the EHT options listed as attributes of the EhtConfiguration class.
 
template<typename... Args>
void ConfigHeOptions (Args &&... args)
 Helper function used to configure the HE options listed as attributes of the HeConfiguration class.
 
template<typename... Args>
void ConfigHtOptions (Args &&... args)
 Helper function used to configure the HT options listed as attributes of the HtConfiguration class.
 
template<typename... Args>
void ConfigVhtOptions (Args &&... args)
 Helper function used to configure the VHT options listed as attributes of the VhtConfiguration class.
 
void DisableFlowControl ()
 Disable flow control only if you know what you are doing.
 
virtual NetDeviceContainer Install (const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer c) const
 
virtual NetDeviceContainer Install (const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer::Iterator first, NodeContainer::Iterator last) const
 
virtual NetDeviceContainer Install (const WifiPhyHelper &phy, const WifiMacHelper &mac, Ptr< Node > node) const
 
virtual NetDeviceContainer Install (const WifiPhyHelper &phy, const WifiMacHelper &mac, std::string nodeName) const
 
template<typename... Args>
void SetObssPdAlgorithm (std::string type, Args &&... args)
 Helper function used to set the OBSS-PD algorithm.
 
template<typename... Args>
void SetRemoteStationManager (std::string type, Args &&... args)
 Helper function used to set the station manager.
 
template<typename... Args>
void SetRemoteStationManager (uint8_t linkId, std::string type, Args &&... args)
 
void SetSelectQueueCallback (SelectQueueCallback f)
 
virtual void SetStandard (WifiStandard standard)
 

Static Public Member Functions

static void EnableLogComponents (LogLevel logLevel=LOG_LEVEL_ALL)
 Helper to enable all WifiNetDevice log components with one statement.
 

Protected Attributes

ObjectFactory m_ehtConfig
 EHT configuration.
 
bool m_enableFlowControl
 whether to enable flow control
 
ObjectFactory m_heConfig
 HE configuration.
 
ObjectFactory m_htConfig
 HT configuration.
 
ObjectFactory m_obssPdAlgorithm
 OBSS_PD algorithm.
 
SelectQueueCallback m_selectQueueCallback
 select queue callback
 
WifiStandard m_standard
 wifi standard
 
std::vector< ObjectFactorym_stationManager
 station manager
 
ObjectFactory m_vhtConfig
 VHT configuration.
 

Detailed Description

helps to create WifiNetDevice objects

This class can help to create a large set of similar WifiNetDevice objects and to configure a large set of their attributes during creation.

Definition at line 323 of file wifi-helper.h.

Member Typedef Documentation

◆ SelectQueueCallback

typedef std::function<std::size_t(Ptr<QueueItem>)> ns3::WifiHelper::SelectQueueCallback

Callback invoked to determine the MAC queue selected for a given packet.

Definition at line 374 of file wifi-helper.h.

Constructor & Destructor Documentation

◆ ~WifiHelper()

ns3::WifiHelper::~WifiHelper ( )
virtual

Definition at line 721 of file wifi-helper.cc.

◆ WifiHelper()

ns3::WifiHelper::WifiHelper ( )

Create a Wifi helper in an empty state: all its parameters must be set before calling ns3::WifiHelper::Install.

The default state is defined as being an Adhoc MAC layer with an ARF rate control algorithm and both objects using their default attribute values. By default, configure MAC and PHY for 802.11a.

Definition at line 725 of file wifi-helper.cc.

References m_ehtConfig, m_heConfig, m_htConfig, m_vhtConfig, SetRemoteStationManager(), and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

Member Function Documentation

◆ AssignStreams()

int64_t ns3::WifiHelper::AssignStreams ( NetDeviceContainer  c,
int64_t  stream 
)

Assign a fixed random variable stream number to the random variables used by the PHY and MAC aspects of the Wifi models.

Each device in container c has fixed stream numbers assigned to its random variables. The Wifi channel (e.g. propagation loss model) is excluded. Return the number of streams (possibly zero) that have been assigned. The Install() method should have previously been called by the user.

Parameters
cNetDeviceContainer of the set of net devices for which the WifiNetDevice should be modified to use fixed streams
streamfirst stream index to use
Returns
the number of stream indices assigned by this helper

Definition at line 988 of file wifi-helper.cc.

References ns3::Txop::AssignStreams(), ns3::NetDeviceContainer::Begin(), ns3::NetDeviceContainer::End(), and ns3::PointerValue::Get().

+ Here is the call graph for this function:

◆ ConfigEhtOptions()

template<typename... Args>
void ns3::WifiHelper::ConfigEhtOptions ( Args &&...  args)

Helper function used to configure the EHT options listed as attributes of the EhtConfiguration class.

Template Parameters
Args[deduced] Template type parameter pack for the sequence of name-value pairs.
Parameters
argsA sequence of name-value pairs of the attributes to set.

Definition at line 655 of file wifi-helper.h.

References m_ehtConfig, and ns3::ObjectFactory::Set().

+ Here is the call graph for this function:

◆ ConfigHeOptions()

template<typename... Args>
void ns3::WifiHelper::ConfigHeOptions ( Args &&...  args)

Helper function used to configure the HE options listed as attributes of the HeConfiguration class.

Template Parameters
Args[deduced] Template type parameter pack for the sequence of name-value pairs.
Parameters
argsA sequence of name-value pairs of the attributes to set.

Definition at line 648 of file wifi-helper.h.

References m_heConfig, and ns3::ObjectFactory::Set().

+ Here is the call graph for this function:

◆ ConfigHtOptions()

template<typename... Args>
void ns3::WifiHelper::ConfigHtOptions ( Args &&...  args)

Helper function used to configure the HT options listed as attributes of the HtConfiguration class.

Template Parameters
Args[deduced] Template type parameter pack for the sequence of name-value pairs.
Parameters
argsA sequence of name-value pairs of the attributes to set.

Definition at line 634 of file wifi-helper.h.

References m_htConfig, and ns3::ObjectFactory::Set().

+ Here is the call graph for this function:

◆ ConfigVhtOptions()

template<typename... Args>
void ns3::WifiHelper::ConfigVhtOptions ( Args &&...  args)

Helper function used to configure the VHT options listed as attributes of the VhtConfiguration class.

Template Parameters
Args[deduced] Template type parameter pack for the sequence of name-value pairs.
Parameters
argsA sequence of name-value pairs of the attributes to set.

Definition at line 641 of file wifi-helper.h.

References m_vhtConfig, and ns3::ObjectFactory::Set().

+ Here is the call graph for this function:

◆ DisableFlowControl()

void ns3::WifiHelper::DisableFlowControl ( )

Disable flow control only if you know what you are doing.

By disabling flow control, this NetDevice will be sent packets even if there is no room for them (such packets will be likely dropped by this NetDevice). Also, any queue disc installed on this NetDevice will have no effect, as every packet enqueued to the traffic control layer queue disc will be immediately dequeued.

Definition at line 744 of file wifi-helper.cc.

References m_enableFlowControl.

◆ EnableLogComponents()

void ns3::WifiHelper::EnableLogComponents ( LogLevel  logLevel = LOG_LEVEL_ALL)
static

Helper to enable all WifiNetDevice log components with one statement.

Parameters
logLevel(optional) log level setting

Definition at line 880 of file wifi-helper.cc.

References ns3::LOG_PREFIX_NODE, ns3::LOG_PREFIX_TIME, ns3::LogComponentEnable(), and ns3::LogComponentEnableAll().

Referenced by ns3::MeshHelper::EnableLogComponents().

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

◆ Install() [1/4]

NetDeviceContainer ns3::WifiHelper::Install ( const WifiPhyHelper phy,
const WifiMacHelper mac,
NodeContainer  c 
) const
virtual
Parameters
phythe PHY helper to create PHY objects
macthe MAC helper to create MAC objects
cthe set of nodes on which a wifi device must be created
Returns
a device container which contains all the devices created by this method.

Definition at line 859 of file wifi-helper.cc.

References ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), and Install().

+ Here is the call graph for this function:

◆ Install() [2/4]

NetDeviceContainer ns3::WifiHelper::Install ( const WifiPhyHelper phy,
const WifiMacHelper mac,
NodeContainer::Iterator  first,
NodeContainer::Iterator  last 
) const
virtual
Parameters
phythe PHY helper to create PHY objects
macthe MAC helper to create MAC objects
firstlower bound on the set of nodes on which a wifi device must be created
lastupper bound on the set of nodes on which a wifi device must be created
Returns
a device container which contains all the devices created by this method.

Definition at line 756 of file wifi-helper.cc.

References ns3::AC_BE, ns3::AC_BK, ns3::AC_VI, ns3::AC_VO, ns3::ObjectFactory::Create(), ns3::WifiPhyHelper::Create(), ns3::WifiMacHelper::Create(), ns3::BooleanValue::Get(), ns3::ObjectFactory::IsTypeIdSet(), m_ehtConfig, m_enableFlowControl, m_heConfig, m_htConfig, m_obssPdAlgorithm, m_selectQueueCallback, m_standard, m_stationManager, m_vhtConfig, NS_ABORT_MSG_IF, NS_FATAL_ERROR, NS_LOG_DEBUG, ns3::WIFI_STANDARD_80211ac, ns3::WIFI_STANDARD_80211ax, ns3::WIFI_STANDARD_80211be, ns3::WIFI_STANDARD_80211n, and ns3::WIFI_STANDARD_UNSPECIFIED.

Referenced by SpectrumWifiPhyInterfacesHelperTest::DoRun(), and Install().

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

◆ Install() [3/4]

NetDeviceContainer ns3::WifiHelper::Install ( const WifiPhyHelper phy,
const WifiMacHelper mac,
Ptr< Node node 
) const
virtual
Parameters
phythe PHY helper to create PHY objects
macthe MAC helper to create MAC objects
nodethe node on which a wifi device must be created
Returns
a device container which contains all the devices created by this method.

Definition at line 867 of file wifi-helper.cc.

References Install().

+ Here is the call graph for this function:

◆ Install() [4/4]

NetDeviceContainer ns3::WifiHelper::Install ( const WifiPhyHelper phy,
const WifiMacHelper mac,
std::string  nodeName 
) const
virtual
Parameters
phythe PHY helper to create PHY objects
macthe MAC helper to create MAC objects
nodeNamethe name of node on which a wifi device must be created
Returns
a device container which contains all the devices created by this method.

Definition at line 873 of file wifi-helper.cc.

References Install().

+ Here is the call graph for this function:

◆ SetObssPdAlgorithm()

template<typename... Args>
void ns3::WifiHelper::SetObssPdAlgorithm ( std::string  type,
Args &&...  args 
)

Helper function used to set the OBSS-PD algorithm.

Template Parameters
Args[deduced] Template type parameter pack for the sequence of name-value pairs.
Parameters
typethe type of OBSS-PD algorithm
argsA sequence of name-value pairs of the attributes to set.

Definition at line 626 of file wifi-helper.h.

References m_obssPdAlgorithm, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

◆ SetRemoteStationManager() [1/2]

template<typename... Args>
void ns3::WifiHelper::SetRemoteStationManager ( std::string  type,
Args &&...  args 
)

Helper function used to set the station manager.

Template Parameters
Args[deduced] Template type parameter pack for the sequence of name-value pairs.
Parameters
typethe type of station manager
argsA sequence of name-value pairs of the attributes to set.

Definition at line 605 of file wifi-helper.h.

References SetRemoteStationManager().

Referenced by WifiHelper(), and SetRemoteStationManager().

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

◆ SetRemoteStationManager() [2/2]

template<typename... Args>
void ns3::WifiHelper::SetRemoteStationManager ( uint8_t  linkId,
std::string  type,
Args &&...  args 
)
Template Parameters
Args[deduced] Template type parameter pack for the sequence of name-value pairs.
Parameters
linkIdID of the link to configure (>0 only for 11be devices)
typethe type of the preamble detection model to set.
argsA sequence of name-value pairs of the attributes to set.

Set the remote station manager model and its attributes to use for the given link. If the helper stored a remote station manager model for the first N links only (corresponding to link IDs from 0 to N-1) and the given linkId is M >= N, then a remote station manager model using the given attributes is configured for all links with ID from N to M.

Definition at line 612 of file wifi-helper.h.

References m_stationManager.

◆ SetSelectQueueCallback()

void ns3::WifiHelper::SetSelectQueueCallback ( SelectQueueCallback  f)
Parameters
fthe select queue callback

Set the select queue callback to set on the NetDevice queue interface aggregated to the WifiNetDevice, in case WifiMac with QoS enabled is used

Definition at line 750 of file wifi-helper.cc.

References m_selectQueueCallback.

◆ SetStandard()

void ns3::WifiHelper::SetStandard ( WifiStandard  standard)
virtual
Parameters
standardthe standard to configure during installation

This method sets standards-compliant defaults for WifiMac parameters such as SIFS time, slot time, timeout values, etc., based on the standard selected. It results in WifiMac::ConfigureStandard(standard) being called on each installed MAC object.

The default standard of 802.11a will be applied if SetStandard() is not called.

Note that WifiMac::ConfigureStandard () will overwrite certain defaults in the attribute system, so if a user wants to manipulate any default values affected by ConfigureStandard() while using this helper, the user should use a post-install configuration such as Config::Set() on any objects that this helper creates, such as:

Config::Set ("/NodeList/0/DeviceList/0/$ns3::WifiNetDevice/Mac/Slot", TimeValue (MicroSeconds
(slot)));
AttributeValue implementation for Time.
Definition: nstime.h:1406
void Set(std::string path, const AttributeValue &value)
Definition: config.cc:880
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1343
See also
WifiMac::ConfigureStandard
Config::Set

Definition at line 738 of file wifi-helper.cc.

References m_standard.

Referenced by SpectrumWifiPhyInterfacesHelperTest::DoRun().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_ehtConfig

ObjectFactory ns3::WifiHelper::m_ehtConfig
protected

EHT configuration.

Definition at line 526 of file wifi-helper.h.

Referenced by WifiHelper(), ConfigEhtOptions(), and Install().

◆ m_enableFlowControl

bool ns3::WifiHelper::m_enableFlowControl
protected

whether to enable flow control

Definition at line 529 of file wifi-helper.h.

Referenced by DisableFlowControl(), and Install().

◆ m_heConfig

ObjectFactory ns3::WifiHelper::m_heConfig
protected

HE configuration.

Definition at line 525 of file wifi-helper.h.

Referenced by WifiHelper(), ConfigHeOptions(), and Install().

◆ m_htConfig

ObjectFactory ns3::WifiHelper::m_htConfig
protected

HT configuration.

Definition at line 523 of file wifi-helper.h.

Referenced by WifiHelper(), ConfigHtOptions(), and Install().

◆ m_obssPdAlgorithm

ObjectFactory ns3::WifiHelper::m_obssPdAlgorithm
protected

OBSS_PD algorithm.

Definition at line 528 of file wifi-helper.h.

Referenced by Install(), and SetObssPdAlgorithm().

◆ m_selectQueueCallback

SelectQueueCallback ns3::WifiHelper::m_selectQueueCallback
protected

select queue callback

Definition at line 527 of file wifi-helper.h.

Referenced by Install(), and SetSelectQueueCallback().

◆ m_standard

WifiStandard ns3::WifiHelper::m_standard
protected

wifi standard

Definition at line 522 of file wifi-helper.h.

Referenced by Install(), and SetStandard().

◆ m_stationManager

std::vector<ObjectFactory> ns3::WifiHelper::m_stationManager
mutableprotected

station manager

Definition at line 521 of file wifi-helper.h.

Referenced by Install(), and SetRemoteStationManager().

◆ m_vhtConfig

ObjectFactory ns3::WifiHelper::m_vhtConfig
protected

VHT configuration.

Definition at line 524 of file wifi-helper.h.

Referenced by WifiHelper(), ConfigVhtOptions(), and Install().


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