A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ns3::WifiHelper Class Reference

helps to create WifiNetDevice objects More...

#include <wifi-helper.h>

Public Member Functions

 WifiHelper ()
 
int64_t AssignStreams (NetDeviceContainer c, int64_t stream)
 
NetDeviceContainer Install (const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer c) const
 
NetDeviceContainer Install (const WifiPhyHelper &phy, const WifiMacHelper &mac, Ptr< Node > node) const
 
NetDeviceContainer Install (const WifiPhyHelper &phy, const WifiMacHelper &mac, std::string nodeName) const
 
NetDeviceContainer InstallCR (Ptr< Repository > repo, Ptr< PUModel > puModel, const MobilityHelper &mobiHelper, const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer c) const
 
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 SetStandard (enum WifiPhyStandard standard)
 

Static Public Member Functions

static WifiHelper Default (void)
 
static void EnableLogComponents (void)
 

Private Attributes

enum WifiPhyStandard m_standard
 
ObjectFactory m_stationManager
 

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 92 of file wifi-helper.h.

Constructor & Destructor Documentation

ns3::WifiHelper::WifiHelper ( )

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

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

Member Function Documentation

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 211 of file wifi-helper.cc.

References ns3::EdcaTxopN::AssignStreams(), ns3::NetDeviceContainer::Begin(), and ns3::NetDeviceContainer::End().

Referenced by ns3::aodv::Bug772ChainTest::CreateDevices(), ns3::aodv::ChainRegressionTest::CreateDevices(), and ns3::olsr::Bug780Test::CreateNodes().

WifiHelper ns3::WifiHelper::Default ( void  )
static
Returns
a new WifiHelper in a default state

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 60 of file wifi-helper.cc.

References SetRemoteStationManager().

Referenced by ns3::aodv::Bug772ChainTest::CreateDevices(), ns3::aodv::ChainRegressionTest::CreateDevices(), ns3::olsr::TcRegressionTest::CreateNodes(), and ns3::aodv::LoopbackTestCase::DoRun().

void ns3::WifiHelper::EnableLogComponents ( void  )
static

Helper to enable all WifiNetDevice log components with one statement

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

References ns3::LogComponentEnable().

NetDeviceContainer ns3::WifiHelper::Install ( const WifiPhyHelper phy,
const WifiMacHelper mac,
Ptr< Node node 
) const
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 122 of file wifi-helper.cc.

References Install().

NetDeviceContainer ns3::WifiHelper::Install ( const WifiPhyHelper phy,
const WifiMacHelper mac,
std::string  nodeName 
) const
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 129 of file wifi-helper.cc.

References Install().

NetDeviceContainer ns3::WifiHelper::InstallCR ( Ptr< Repository repo,
Ptr< PUModel puModel,
const MobilityHelper mobiHelper,
const WifiPhyHelper phy,
const WifiMacHelper mac,
NodeContainer  c 
) const
Parameters
repothe global repository that will be shared among CR nodes
puModelthe map of PU on and off times that is instantiated via PUModel
mobiHelperthe mobility helper of the nodes
phythe PHY helper to create PHY objects
macthe MAC helper to create MAC objects
cthe name(s) container on which a wifi device must be created
Returns
a device container which contains all the devices created by this method.

This function installs three devices per node instead of one: a CCC, RX and TX device

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

References ns3::NetDeviceContainer::Add(), ns3::Node::AddDevice(), ns3::Mac48Address::Allocate(), ns3::NodeContainer::Begin(), ns3::WifiPhyHelper::Create(), ns3::ObjectFactory::Create(), ns3::WifiMacHelper::Create(), ns3::NodeContainer::End(), ns3::Object::GetObject(), ns3::MobilityHelper::Install(), and NS_LOG_DEBUG.

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 () 
)
Parameters
typethe type of ns3::WifiRemoteStationManager to create.
n0the name of the attribute to set
v0the value of the attribute to set
n1the name of the attribute to set
v1the value of the attribute to set
n2the name of the attribute to set
v2the value of the attribute to set
n3the name of the attribute to set
v3the value of the attribute to set
n4the name of the attribute to set
v4the value of the attribute to set
n5the name of the attribute to set
v5the value of the attribute to set
n6the name of the attribute to set
v6the value of the attribute to set
n7the name of the attribute to set
v7the value of the attribute to set

All the attributes specified in this method should exist in the requested station manager.

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

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

Referenced by BatteryLifetimeTest::ConstantLoadTest(), ns3::aodv::Bug772ChainTest::CreateDevices(), ns3::aodv::ChainRegressionTest::CreateDevices(), ns3::olsr::Bug780Test::CreateNodes(), ns3::olsr::TcRegressionTest::CreateNodes(), Default(), BasicEnergyDepletionTest::DepletionTestCase(), ns3::aodv::LoopbackTestCase::DoRun(), WifiMsduAggregatorThroughputTest::DoRun(), and BatteryLifetimeTest::VariableLoadTest().

void ns3::WifiHelper::SetStandard ( enum WifiPhyStandard  standard)
Parameters
standardthe phy standard to configure during installation

By default, all objects are configured for 802.11a

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

Referenced by BatteryLifetimeTest::ConstantLoadTest(), ns3::olsr::Bug780Test::CreateNodes(), ns3::olsr::TcRegressionTest::CreateNodes(), BasicEnergyDepletionTest::DepletionTestCase(), WifiMsduAggregatorThroughputTest::DoRun(), and BatteryLifetimeTest::VariableLoadTest().


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