helps to create WifiNetDevice objects More...
#include "wifi-helper.h"
Public Types | |
typedef std::function< std::size_t(Ptr< QueueItem >)> | SelectQueueCallback |
Callback invoked to determine the MAC queue selected for a given packet. More... | |
Public Member Functions | |
WifiHelper () | |
Create a Wifi helper in an empty state: all its parameters must be set before calling ns3::WifiHelper::Install. More... | |
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. More... | |
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, NodeContainer c) 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 |
void | SetAckPolicySelectorForAc (AcIndex ac, std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue()) |
void | SetObssPdAlgorithm (std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue()) |
void | SetRemoteStationManager (std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue()) |
void | SetSelectQueueCallback (SelectQueueCallback f) |
virtual void | SetStandard (WifiStandard standard) |
virtual NS_DEPRECATED_3_32 void | SetStandard (WifiPhyStandard standard) |
Static Public Member Functions | |
static void | EnableLogComponents (void) |
Helper to enable all WifiNetDevice log components with one statement. More... | |
Protected Attributes | |
ObjectFactory | m_ackPolicySelector [4] |
ack policy selector for all ACs More... | |
ObjectFactory | m_obssPdAlgorithm |
OBSS_PD algorithm. More... | |
SelectQueueCallback | m_selectQueueCallback |
select queue callback More... | |
WifiStandard | m_standard |
wifi standard More... | |
ObjectFactory | m_stationManager |
station manager More... | |
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 318 of file wifi-helper.h.
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 431 of file wifi-helper.h.
|
virtual |
Definition at line 662 of file wifi-helper.cc.
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 666 of file wifi-helper.cc.
References ns3::AC_BE, ns3::AC_BK, ns3::AC_VI, ns3::AC_VO, SetAckPolicySelectorForAc(), and SetRemoteStationManager().
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.
c | NetDeviceContainer of the set of net devices for which the WifiNetDevice should be modified to use fixed streams |
stream | first stream index to use |
Definition at line 986 of file wifi-helper.cc.
References ns3::Txop::AssignStreams(), ns3::NetDeviceContainer::Begin(), ns3::NetDeviceContainer::End(), ns3::PointerValue::Get(), third::mac, and third::wifi.
|
static |
Helper to enable all WifiNetDevice log components with one statement.
Definition at line 924 of file wifi-helper.cc.
References ns3::LOG_LEVEL_ALL, ns3::LOG_PREFIX_NODE, ns3::LOG_PREFIX_TIME, ns3::LogComponentEnable(), and ns3::LogComponentEnableAll().
Referenced by ns3::Wifi80211pHelper::EnableLogComponents(), and ns3::WaveHelper::EnableLogComponents().
|
virtual |
phy | the PHY helper to create PHY objects |
mac | the MAC helper to create MAC objects |
first | lower bound on the set of nodes on which a wifi device must be created |
last | upper bound on the set of nodes on which a wifi device must be created |
Definition at line 793 of file wifi-helper.cc.
References ns3::AC_BE, ns3::AC_BK, ns3::AC_VI, ns3::AC_VO, ns3::Node::AddDevice(), ns3::Object::AggregateObject(), ns3::Mac48Address::Allocate(), ns3::WifiPhyHelper::Create(), ns3::WifiMacHelper::Create(), ns3::ObjectFactory::Create(), first::devices, ns3::BooleanValue::Get(), ns3::PointerValue::Get(), ns3::Object::GetObject(), ns3::ObjectFactory::IsTypeIdSet(), m_ackPolicySelector, m_obssPdAlgorithm, m_selectQueueCallback, m_standard, m_stationManager, third::mac, NS_FATAL_ERROR, NS_LOG_DEBUG, third::phy, ns3::WifiNetDevice::SetHeConfiguration(), ns3::WifiNetDevice::SetHtConfiguration(), ns3::WifiNetDevice::SetMac(), ns3::WifiNetDevice::SetPhy(), ns3::WifiNetDevice::SetRemoteStationManager(), ns3::WifiNetDevice::SetVhtConfiguration(), ns3::WIFI_PHY_BAND_2_4GHZ, ns3::WIFI_PHY_STANDARD_80211ac, ns3::WIFI_PHY_STANDARD_80211ax, ns3::WIFI_PHY_STANDARD_80211n, and ns3::wifiStandards.
Referenced by ns3::Wifi80211pHelper::Install(), and Install().
|
virtual |
phy | the PHY helper to create PHY objects |
mac | the MAC helper to create MAC objects |
c | the set of nodes on which a wifi device must be created |
Reimplemented in ns3::Wifi80211pHelper.
Definition at line 902 of file wifi-helper.cc.
References ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), and Install().
|
virtual |
phy | the PHY helper to create PHY objects |
mac | the MAC helper to create MAC objects |
node | the node on which a wifi device must be created |
Definition at line 909 of file wifi-helper.cc.
References Install(), third::mac, and third::phy.
|
virtual |
phy | the PHY helper to create PHY objects |
mac | the MAC helper to create MAC objects |
nodeName | the name of node on which a wifi device must be created |
Definition at line 916 of file wifi-helper.cc.
References Install(), third::mac, and third::phy.
void ns3::WifiHelper::SetAckPolicySelectorForAc | ( | AcIndex | ac, |
std::string | type, | ||
std::string | n0 = "" , |
||
const AttributeValue & | v0 = EmptyAttributeValue () , |
||
std::string | n1 = "" , |
||
const AttributeValue & | v1 = EmptyAttributeValue () , |
||
std::string | n2 = "" , |
||
const AttributeValue & | v2 = EmptyAttributeValue () , |
||
std::string | n3 = "" , |
||
const AttributeValue & | v3 = EmptyAttributeValue () , |
||
std::string | n4 = "" , |
||
const AttributeValue & | v4 = EmptyAttributeValue () , |
||
std::string | n5 = "" , |
||
const AttributeValue & | v5 = EmptyAttributeValue () , |
||
std::string | n6 = "" , |
||
const AttributeValue & | v6 = EmptyAttributeValue () , |
||
std::string | n7 = "" , |
||
const AttributeValue & | v7 = EmptyAttributeValue () |
||
) |
ac | the Access Category to attach the ack policy selector to. |
type | the type of ns3::WifiAckPolicySelector to create. |
n0 | the name of the attribute to set |
v0 | the value of the attribute to set |
n1 | the name of the attribute to set |
v1 | the value of the attribute to set |
n2 | the name of the attribute to set |
v2 | the value of the attribute to set |
n3 | the name of the attribute to set |
v3 | the value of the attribute to set |
n4 | the name of the attribute to set |
v4 | the value of the attribute to set |
n5 | the name of the attribute to set |
v5 | the value of the attribute to set |
n6 | the name of the attribute to set |
v6 | the value of the attribute to set |
n7 | the name of the attribute to set |
v7 | the value of the attribute to set |
All the attributes specified in this method should exist in the requested ack policy selector.
Definition at line 724 of file wifi-helper.cc.
References m_ackPolicySelector, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().
Referenced by WifiHelper().
void ns3::WifiHelper::SetObssPdAlgorithm | ( | std::string | type, |
std::string | n0 = "" , |
||
const AttributeValue & | v0 = EmptyAttributeValue () , |
||
std::string | n1 = "" , |
||
const AttributeValue & | v1 = EmptyAttributeValue () , |
||
std::string | n2 = "" , |
||
const AttributeValue & | v2 = EmptyAttributeValue () , |
||
std::string | n3 = "" , |
||
const AttributeValue & | v3 = EmptyAttributeValue () , |
||
std::string | n4 = "" , |
||
const AttributeValue & | v4 = EmptyAttributeValue () , |
||
std::string | n5 = "" , |
||
const AttributeValue & | v5 = EmptyAttributeValue () , |
||
std::string | n6 = "" , |
||
const AttributeValue & | v6 = EmptyAttributeValue () , |
||
std::string | n7 = "" , |
||
const AttributeValue & | v7 = EmptyAttributeValue () |
||
) |
type | the type of ns3::ObssPdAlgorithm to create. |
n0 | the name of the attribute to set |
v0 | the value of the attribute to set |
n1 | the name of the attribute to set |
v1 | the value of the attribute to set |
n2 | the name of the attribute to set |
v2 | the value of the attribute to set |
n3 | the name of the attribute to set |
v3 | the value of the attribute to set |
n4 | the name of the attribute to set |
v4 | the value of the attribute to set |
n5 | the name of the attribute to set |
v5 | the value of the attribute to set |
n6 | the name of the attribute to set |
v6 | the value of the attribute to set |
n7 | the name of the attribute to set |
v7 | the value of the attribute to set |
All the attributes specified in this method should exist in the requested algorithm.
Definition at line 701 of file wifi-helper.cc.
References m_obssPdAlgorithm, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().
void ns3::WifiHelper::SetRemoteStationManager | ( | std::string | type, |
std::string | n0 = "" , |
||
const AttributeValue & | v0 = EmptyAttributeValue () , |
||
std::string | n1 = "" , |
||
const AttributeValue & | v1 = EmptyAttributeValue () , |
||
std::string | n2 = "" , |
||
const AttributeValue & | v2 = EmptyAttributeValue () , |
||
std::string | n3 = "" , |
||
const AttributeValue & | v3 = EmptyAttributeValue () , |
||
std::string | n4 = "" , |
||
const AttributeValue & | v4 = EmptyAttributeValue () , |
||
std::string | n5 = "" , |
||
const AttributeValue & | v5 = EmptyAttributeValue () , |
||
std::string | n6 = "" , |
||
const AttributeValue & | v6 = EmptyAttributeValue () , |
||
std::string | n7 = "" , |
||
const AttributeValue & | v7 = EmptyAttributeValue () |
||
) |
type | the type of ns3::WifiRemoteStationManager to create. |
n0 | the name of the attribute to set |
v0 | the value of the attribute to set |
n1 | the name of the attribute to set |
v1 | the value of the attribute to set |
n2 | the name of the attribute to set |
v2 | the value of the attribute to set |
n3 | the name of the attribute to set |
v3 | the value of the attribute to set |
n4 | the name of the attribute to set |
v4 | the value of the attribute to set |
n5 | the name of the attribute to set |
v5 | the value of the attribute to set |
n6 | the name of the attribute to set |
v6 | the value of the attribute to set |
n7 | the name of the attribute to set |
v7 | the value of the attribute to set |
All the attributes specified in this method should exist in the requested station manager.
Definition at line 678 of file wifi-helper.cc.
References m_stationManager, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().
Referenced by OcbWifiMacTestCase::ConfigureOcbMode(), ns3::Wifi80211pHelper::Default(), VanetRoutingExperiment::SetupAdhocDevices(), and WifiHelper().
void ns3::WifiHelper::SetSelectQueueCallback | ( | SelectQueueCallback | f | ) |
f | the select queue callback |
Set the select queue callback to set on the NetDevice queue interface aggregated to the WifiNetDevice, in case RegularWifiMac with QoS enabled is used
Definition at line 787 of file wifi-helper.cc.
References f(), and m_selectQueueCallback.
|
virtual |
standard | the 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:
Reimplemented in ns3::Wifi80211pHelper.
Definition at line 747 of file wifi-helper.cc.
References m_standard.
Referenced by ns3::Wifi80211pHelper::SetStandard().
|
virtual |
standard | the PHY 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:
Reimplemented in ns3::Wifi80211pHelper.
Definition at line 754 of file wifi-helper.cc.
References m_standard, NS_FATAL_ERROR, ns3::WIFI_PHY_STANDARD_80211a, ns3::WIFI_PHY_STANDARD_80211ac, ns3::WIFI_PHY_STANDARD_80211b, ns3::WIFI_PHY_STANDARD_80211g, ns3::WIFI_PHY_STANDARD_80211n_2_4GHZ, ns3::WIFI_PHY_STANDARD_80211n_5GHZ, ns3::WIFI_PHY_STANDARD_holland, ns3::WIFI_STANDARD_80211a, ns3::WIFI_STANDARD_80211ac, ns3::WIFI_STANDARD_80211b, ns3::WIFI_STANDARD_80211g, ns3::WIFI_STANDARD_80211n_2_4GHZ, ns3::WIFI_STANDARD_80211n_5GHZ, and ns3::WIFI_STANDARD_holland.
|
protected |
ack policy selector for all ACs
Definition at line 553 of file wifi-helper.h.
Referenced by Install(), and SetAckPolicySelectorForAc().
|
protected |
OBSS_PD algorithm.
Definition at line 556 of file wifi-helper.h.
Referenced by Install(), and SetObssPdAlgorithm().
|
protected |
select queue callback
Definition at line 555 of file wifi-helper.h.
Referenced by Install(), and SetSelectQueueCallback().
|
protected |
wifi standard
Definition at line 554 of file wifi-helper.h.
Referenced by Install(), and SetStandard().
|
protected |
station manager
Definition at line 552 of file wifi-helper.h.
Referenced by Install(), and SetRemoteStationManager().