A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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.
 
 ~MeshHelper ()
 Destroy a MeshHelper.
 
int64_t AssignStreams (NetDeviceContainer c, int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model.
 
NetDeviceContainer Install (const WifiPhyHelper &phyHelper, NodeContainer c) const
 Install 802.11s mesh device & protocols on given node list.
 
void Report (const ns3::Ptr< ns3::NetDevice > &device, std::ostream &os)
 Print statistics.
 
void ResetStats (const ns3::Ptr< ns3::NetDevice > &device)
 Reset statistics.
 
template<typename... Ts>
void SetMacType (Ts &&... args)
 Set the Mac Attributes.
 
void SetNumberOfInterfaces (uint32_t nInterfaces)
 Set a number of interfaces in a mesh network.
 
template<typename... Ts>
void SetRemoteStationManager (std::string type, Ts &&... args)
 Set the remote station manager type and Attributes.
 
void SetSpreadInterfaceChannels (ChannelPolicy policy)
 set the channel policy
 
template<typename... Ts>
void SetStackInstaller (std::string type, Ts &&... args)
 Set the MeshStack type to use.
 
void SetStandard (WifiStandard standard)
 Set standard.
 

Static Public Member Functions

static MeshHelper Default ()
 Set the helper to the default values for the MAC type, remote station manager and channel policy.
 
static void EnableLogComponents ()
 Helper to enable all MeshPointDevice log components with one statement.
 

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
 
ObjectFactory m_mac
 the MAC
 
uint32_t m_nInterfaces
 number of interfaces
 
ChannelPolicy m_spreadChannelPolicy
 spread channel policy
 
Ptr< MeshStackm_stack
 stack
 
ObjectFactory m_stackFactory
 stack factory
 
WifiStandard m_standard
 standard
 
ObjectFactory m_stationManager
 the station manager
 

Detailed Description

Helper to create IEEE 802.11s mesh networks.

Definition at line 32 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 89 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 27 of file mesh-helper.cc.

◆ ~MeshHelper()

ns3::MeshHelper::~MeshHelper ( )

Destroy a MeshHelper.

Definition at line 35 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 176 of file mesh-helper.cc.

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

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

+ 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
Parameters
phyHelper
node
channelId
Returns
a WifiNetDevice with ready-to-use interface

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

References ns3::Mac48Address::Allocate(), ns3::ObjectFactory::Create(), ns3::WifiPhyHelper::Create(), ns3::CreateObject(), ns3::CreateObjectWithAttributes(), ns3::GetFrameExchangeManagerTypeIdName(), m_mac, m_standard, m_stationManager, NS_ABORT_IF, NS_ASSERT, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().

Referenced by Install().

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

◆ Default()

MeshHelper ns3::MeshHelper::Default ( )
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 88 of file mesh-helper.cc.

References SetMacType(), SetRemoteStationManager(), SetSpreadInterfaceChannels(), and SPREAD_CHANNELS.

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

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

◆ EnableLogComponents()

void ns3::MeshHelper::EnableLogComponents ( )
static

Helper to enable all MeshPointDevice log components with one statement.

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

References ns3::WifiHelper::EnableLogComponents(), ns3::LOG_LEVEL_ALL, and ns3::LogComponentEnable().

+ 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 53 of file mesh-helper.cc.

References ns3::NodeContainer::Begin(), CreateInterface(), ns3::CreateObject(), ns3::NodeContainer::End(), m_nInterfaces, m_spreadChannelPolicy, m_stack, NS_ASSERT, NS_FATAL_ERROR, SPREAD_CHANNELS, and ZERO_CHANNEL.

Referenced by FlameRegressionTest::CreateDevices(), HwmpDoRfRegressionTest::CreateDevices(), HwmpProactiveRegressionTest::CreateDevices(), HwmpReactiveRegressionTest::CreateDevices(), HwmpSimplestRegressionTest::CreateDevices(), PeerManagementProtocolRegressionTest::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 154 of file mesh-helper.cc.

References ns3::Mac48Address::ConvertFrom(), 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 167 of file mesh-helper.cc.

References m_stack, and NS_ASSERT.

◆ SetMacType()

template<typename... Ts>
void ns3::MeshHelper::SetMacType ( Ts &&... args)

Set the Mac Attributes.

All the attributes specified in this method should exist in the requested mac.

Template Parameters
Ts[deduced] Argument types
Parameters
[in]argsName and AttributeValue pairs to set.

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

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

Referenced by FlameRegressionTest::CreateDevices(), HwmpDoRfRegressionTest::CreateDevices(), HwmpProactiveRegressionTest::CreateDevices(), HwmpReactiveRegressionTest::CreateDevices(), HwmpSimplestRegressionTest::CreateDevices(), PeerManagementProtocolRegressionTest::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 47 of file mesh-helper.cc.

References m_nInterfaces.

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

+ Here is the caller graph for this function:

◆ SetRemoteStationManager()

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

Set the remote station manager type and Attributes.

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

Template Parameters
Ts[deduced] Argument types
Parameters
typethe type of remote station manager to use.
[in]argsName and AttributeValue pairs to set.

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

References m_stationManager.

Referenced by Default().

+ 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 41 of file mesh-helper.cc.

References m_spreadChannelPolicy.

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

+ Here is the caller graph for this function:

◆ SetStackInstaller()

template<typename... Ts>
void ns3::MeshHelper::SetStackInstaller ( std::string type,
Ts &&... args )

Set the MeshStack type to use.

Template Parameters
Ts[deduced] Argument types
Parameters
typethe type of ns3::MeshStack.
[in]argsName and AttributeValue pairs to set.

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

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

Referenced by FlameRegressionTest::CreateDevices(), HwmpDoRfRegressionTest::CreateDevices(), HwmpProactiveRegressionTest::CreateDevices(), HwmpReactiveRegressionTest::CreateDevices(), HwmpSimplestRegressionTest::CreateDevices(), PeerManagementProtocolRegressionTest::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 ( WifiStandard standard)

Set standard.

Parameters
standardthe wifi phy standard

Definition at line 98 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 174 of file mesh-helper.h.

◆ m_mac

ObjectFactory ns3::MeshHelper::m_mac
private

the MAC

Definition at line 172 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 166 of file mesh-helper.h.

Referenced by Install(), and SetNumberOfInterfaces().

◆ m_spreadChannelPolicy

ChannelPolicy ns3::MeshHelper::m_spreadChannelPolicy
private

spread channel policy

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

Referenced by Install(), and SetSpreadInterfaceChannels().

◆ m_stack

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

stack

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

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

◆ m_stackFactory

ObjectFactory ns3::MeshHelper::m_stackFactory
private

stack factory

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

Referenced by SetStackInstaller().

◆ m_standard

WifiStandard ns3::MeshHelper::m_standard
private

standard

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

Referenced by CreateInterface(), and SetStandard().

◆ m_stationManager

ObjectFactory ns3::MeshHelper::m_stationManager
private

the station manager

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

Referenced by CreateInterface(), and SetRemoteStationManager().


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