A Discrete-Event Network Simulator
API
ns3::MeshHelper Class Reference

Helper to create IEEE 802.11s mesh networks. More...

#include "mesh-helper.h"

+ Collaboration diagram for ns3::MeshHelper:

Public Types

enum  ChannelPolicy { SPREAD_CHANNELS, ZERO_CHANNEL }
 Spread/not spread frequency channels of MP interfaces. More...
 

Public Member Functions

 MeshHelper ()
 Construct a MeshHelper used to make life easier when creating 802.11s networks. More...
 
 ~MeshHelper ()
 Destroy a MeshHelper. More...
 
int64_t AssignStreams (NetDeviceContainer c, int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model. More...
 
NetDeviceContainer Install (const WifiPhyHelper &phyHelper, NodeContainer c) const
 Install 802.11s mesh device & protocols on given node list. More...
 
void Report (const ns3::Ptr< ns3::NetDevice > &device, std::ostream &os)
 Print statistics. More...
 
void ResetStats (const ns3::Ptr< ns3::NetDevice > &device)
 Reset statistics. More...
 
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 SetMacType (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 SetNumberOfInterfaces (uint32_t nInterfaces)
 Set a number of interfaces in a mesh network. More...
 
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 SetSpreadInterfaceChannels (ChannelPolicy policy)
 set the channel policy More...
 
void SetStackInstaller (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 WifiStandard standard)
 Set standard. More...
 

Static Public Member Functions

static MeshHelper Default ()
 Set the helper to the default values for the MAC type, remote station manager and channel policy. More...
 

Private Member Functions

Ptr< WifiNetDeviceCreateInterface (const WifiPhyHelper &phyHelper, Ptr< Node > node, uint16_t channelId) const
 

Private Attributes

ObjectFactory m_ackPolicySelector [4]
 ack policy selector for all ACs More...
 
ObjectFactory m_mac
 the MAC More...
 
uint32_t m_nInterfaces
 number of interfaces More...
 
ChannelPolicy m_spreadChannelPolicy
 spread channel policy More...
 
Ptr< MeshStackm_stack
 stack More...
 
ObjectFactory m_stackFactory
 stack factory More...
 
enum WifiStandard m_standard
 standard More...
 
ObjectFactory m_stationManager
 the station manager More...
 

Detailed Description

Helper to create IEEE 802.11s mesh networks.

Definition at line 43 of file mesh-helper.h.

Member Enumeration Documentation

◆ ChannelPolicy

Spread/not spread frequency channels of MP interfaces.

Todo:
SetMeshId

If set to true different non-overlapping 20MHz frequency channels will be assigned to different mesh point interfaces.

Enumerator
SPREAD_CHANNELS 
ZERO_CHANNEL 

Definition at line 169 of file mesh-helper.h.

Constructor & Destructor Documentation

◆ MeshHelper()

ns3::MeshHelper::MeshHelper ( )

Construct a MeshHelper used to make life easier when creating 802.11s networks.

Definition at line 37 of file mesh-helper.cc.

◆ ~MeshHelper()

ns3::MeshHelper::~MeshHelper ( )

Destroy a MeshHelper.

Definition at line 44 of file mesh-helper.cc.

References m_stack.

Member Function Documentation

◆ AssignStreams()

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

Assign a fixed random variable stream number to the random variables used by this model.

Return the number of streams (possibly zero) that have been assigned. The Install() method of this helper should have previously been called by the user.

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

Definition at line 290 of file mesh-helper.cc.

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

Referenced by PeerManagementProtocolRegressionTest::CreateDevices(), HwmpProactiveRegressionTest::CreateDevices(), FlameRegressionTest::CreateDevices(), HwmpDoRfRegressionTest::CreateDevices(), HwmpSimplestRegressionTest::CreateDevices(), and HwmpReactiveRegressionTest::CreateDevices().

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

◆ CreateInterface()

Ptr< WifiNetDevice > ns3::MeshHelper::CreateInterface ( const WifiPhyHelper phyHelper,
Ptr< Node node,
uint16_t  channelId 
) const
private

◆ Default()

MeshHelper ns3::MeshHelper::Default ( void  )
static

Set the helper to the default values for the MAC type, remote station manager and channel policy.

Returns
the default MeshHelper

Definition at line 121 of file mesh-helper.cc.

References ns3::AC_BE, ns3::AC_BK, ns3::AC_VI, ns3::AC_VO, SetAckPolicySelectorForAc(), SetMacType(), SetRemoteStationManager(), SetSpreadInterfaceChannels(), and SPREAD_CHANNELS.

+ Here is the call graph for this function:

◆ Install()

NetDeviceContainer ns3::MeshHelper::Install ( const WifiPhyHelper phyHelper,
NodeContainer  c 
) const

Install 802.11s mesh device & protocols on given node list.

Parameters
phyHelperWifi PHY helper
cList of nodes to install
Returns
list of created mesh point devices, see MeshPointDevice

Definition at line 87 of file mesh-helper.cc.

References ns3::Node::AddDevice(), ns3::NodeContainer::Begin(), third::channel, CreateInterface(), first::devices, ns3::NodeContainer::End(), m_nInterfaces, m_spreadChannelPolicy, m_stack, NS_ASSERT, NS_FATAL_ERROR, SPREAD_CHANNELS, and ZERO_CHANNEL.

Referenced by PeerManagementProtocolRegressionTest::CreateDevices(), HwmpProactiveRegressionTest::CreateDevices(), FlameRegressionTest::CreateDevices(), HwmpDoRfRegressionTest::CreateDevices(), HwmpSimplestRegressionTest::CreateDevices(), HwmpReactiveRegressionTest::CreateDevices(), and MeshTest::CreateNodes().

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

◆ Report()

void ns3::MeshHelper::Report ( const ns3::Ptr< ns3::NetDevice > &  device,
std::ostream &  os 
)

Print statistics.

Parameters
devicethe net device
osthe output stream

Definition at line 270 of file mesh-helper.cc.

References ns3::Mac48Address::ConvertFrom(), ns3::Object::GetObject(), ns3::Time::GetSeconds(), m_stack, ns3::Simulator::Now(), and NS_ASSERT.

Referenced by MeshTest::Report().

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

◆ ResetStats()

void ns3::MeshHelper::ResetStats ( const ns3::Ptr< ns3::NetDevice > &  device)

Reset statistics.

Parameters
devicethe net device

Definition at line 282 of file mesh-helper.cc.

References ns3::Object::GetObject(), m_stack, and NS_ASSERT.

+ Here is the call graph for this function:

◆ SetAckPolicySelectorForAc()

void ns3::MeshHelper::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 () 
)
Parameters
acthe Access Category to attach the ack policy selector to.
typethe type of ns3::WifiAckPolicySelector 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 ack policy selector.

Definition at line 177 of file mesh-helper.cc.

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

Referenced by Default().

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

◆ SetMacType()

void ns3::MeshHelper::SetMacType ( 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
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 mac.

Definition at line 135 of file mesh-helper.cc.

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

Referenced by PeerManagementProtocolRegressionTest::CreateDevices(), HwmpProactiveRegressionTest::CreateDevices(), FlameRegressionTest::CreateDevices(), HwmpDoRfRegressionTest::CreateDevices(), HwmpSimplestRegressionTest::CreateDevices(), HwmpReactiveRegressionTest::CreateDevices(), MeshTest::CreateNodes(), and Default().

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

◆ SetNumberOfInterfaces()

void ns3::MeshHelper::SetNumberOfInterfaces ( uint32_t  nInterfaces)

Set a number of interfaces in a mesh network.

Parameters
nInterfacesis the number of interfaces

Definition at line 82 of file mesh-helper.cc.

References m_nInterfaces.

Referenced by PeerManagementProtocolRegressionTest::CreateDevices(), HwmpProactiveRegressionTest::CreateDevices(), FlameRegressionTest::CreateDevices(), HwmpDoRfRegressionTest::CreateDevices(), HwmpSimplestRegressionTest::CreateDevices(), HwmpReactiveRegressionTest::CreateDevices(), and MeshTest::CreateNodes().

+ Here is the caller graph for this function:

◆ SetRemoteStationManager()

void ns3::MeshHelper::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 155 of file mesh-helper.cc.

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

Referenced by Default().

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

◆ SetSpreadInterfaceChannels()

void ns3::MeshHelper::SetSpreadInterfaceChannels ( ChannelPolicy  policy)

set the channel policy

Parameters
policythe channel policy

Definition at line 49 of file mesh-helper.cc.

References m_spreadChannelPolicy.

Referenced by MeshTest::CreateNodes(), and Default().

+ Here is the caller graph for this function:

◆ SetStackInstaller()

void ns3::MeshHelper::SetStackInstaller ( 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::MeshStack.
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

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

References ns3::ObjectFactory::Create(), m_stack, m_stackFactory, NS_FATAL_ERROR, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().

Referenced by PeerManagementProtocolRegressionTest::CreateDevices(), HwmpProactiveRegressionTest::CreateDevices(), FlameRegressionTest::CreateDevices(), HwmpDoRfRegressionTest::CreateDevices(), HwmpSimplestRegressionTest::CreateDevices(), HwmpReactiveRegressionTest::CreateDevices(), and MeshTest::CreateNodes().

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

◆ SetStandard()

void ns3::MeshHelper::SetStandard ( enum WifiStandard  standard)

Set standard.

Parameters
standardthe wifi phy standard

Definition at line 199 of file mesh-helper.cc.

References m_standard.

Member Data Documentation

◆ m_ackPolicySelector

ObjectFactory ns3::MeshHelper::m_ackPolicySelector[4]
private

ack policy selector for all ACs

Definition at line 267 of file mesh-helper.h.

Referenced by CreateInterface(), and SetAckPolicySelectorForAc().

◆ m_mac

ObjectFactory ns3::MeshHelper::m_mac
private

the MAC

Definition at line 265 of file mesh-helper.h.

Referenced by CreateInterface(), and SetMacType().

◆ m_nInterfaces

uint32_t ns3::MeshHelper::m_nInterfaces
private

number of interfaces

Definition at line 259 of file mesh-helper.h.

Referenced by Install(), and SetNumberOfInterfaces().

◆ m_spreadChannelPolicy

ChannelPolicy ns3::MeshHelper::m_spreadChannelPolicy
private

spread channel policy

Definition at line 260 of file mesh-helper.h.

Referenced by Install(), and SetSpreadInterfaceChannels().

◆ m_stack

Ptr<MeshStack> ns3::MeshHelper::m_stack
private

stack

Definition at line 261 of file mesh-helper.h.

Referenced by Install(), Report(), ResetStats(), SetStackInstaller(), and ~MeshHelper().

◆ m_stackFactory

ObjectFactory ns3::MeshHelper::m_stackFactory
private

stack factory

Definition at line 262 of file mesh-helper.h.

Referenced by SetStackInstaller().

◆ m_standard

enum WifiStandard ns3::MeshHelper::m_standard
private

standard

Definition at line 268 of file mesh-helper.h.

Referenced by CreateInterface(), and SetStandard().

◆ m_stationManager

ObjectFactory ns3::MeshHelper::m_stationManager
private

the station manager

Definition at line 266 of file mesh-helper.h.

Referenced by CreateInterface(), and SetRemoteStationManager().


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