A Discrete-Event Network Simulator
API
mesh-helper.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2008,2009 IITP RAS
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Kirill Andreev <andreev@iitp.ru>
19 * Pavel Boyko <boyko@iitp.ru>
20 */
21
22
23#ifndef MESH_HELPER_H
24#define MESH_HELPER_H
25
26#include "ns3/mesh-stack-installer.h"
27#include "ns3/wifi-standards.h"
28#include "ns3/qos-utils.h"
29#include "ns3/object-factory.h"
30
31namespace ns3 {
32
33class NetDeviceContainer;
34class WifiPhyHelper;
35class WifiNetDevice;
36class NodeContainer;
37
44{
45public:
49 MeshHelper ();
50
54 ~MeshHelper ();
55
61 static MeshHelper Default ();
62
84 void SetMacType (std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
85 std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
86 std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
87 std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
88 std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
89 std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
90 std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
91 std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
114 void
115 SetRemoteStationManager (std::string type,
116 std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
117 std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
118 std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
119 std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
120 std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
121 std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
122 std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
123 std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
128 void SetStandard (enum WifiStandard standard);
130 //void SetMeshId (std::string s);
138 {
141 };
142
152 void SetNumberOfInterfaces (uint32_t nInterfaces);
153
163 Install (const WifiPhyHelper &phyHelper, NodeContainer c) const;
183 void SetStackInstaller (std::string type,
184 std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
185 std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
186 std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
187 std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
188 std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
189 std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
190 std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
191 std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
192
199 void Report (const ns3::Ptr<ns3::NetDevice>& device, std::ostream& os);
200
205 void ResetStats (const ns3::Ptr<ns3::NetDevice>& device);
217 int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
218
222 static void EnableLogComponents (void);
223
224private:
231 Ptr<WifiNetDevice> CreateInterface (const WifiPhyHelper &phyHelper, Ptr<Node> node, uint16_t channelId) const;
236
237 // Interface factory
242
243};
244} // namespace ns3
245
246#endif /* MESH_HELPER_H */
247
Hold a value for an Attribute.
Definition: attribute.h:69
A class for an empty attribute value.
Definition: attribute.h:233
Helper to create IEEE 802.11s mesh networks.
Definition: mesh-helper.h:44
ObjectFactory m_stackFactory
stack factory
Definition: mesh-helper.h:235
enum WifiStandard m_standard
standard
Definition: mesh-helper.h:241
Ptr< WifiNetDevice > CreateInterface(const WifiPhyHelper &phyHelper, Ptr< Node > node, uint16_t channelId) const
Definition: mesh-helper.cc:178
Ptr< MeshStack > m_stack
stack
Definition: mesh-helper.h:234
~MeshHelper()
Destroy a MeshHelper.
Definition: mesh-helper.cc:43
uint32_t m_nInterfaces
number of interfaces
Definition: mesh-helper.h:232
ObjectFactory m_stationManager
the station manager
Definition: mesh-helper.h:239
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())
Definition: mesh-helper.cc:130
void SetSpreadInterfaceChannels(ChannelPolicy policy)
set the channel policy
Definition: mesh-helper.cc:48
ObjectFactory m_ackPolicySelector[4]
ack policy selector for all ACs
Definition: mesh-helper.h:240
ObjectFactory m_mac
the MAC
Definition: mesh-helper.h:238
ChannelPolicy m_spreadChannelPolicy
spread channel policy
Definition: mesh-helper.h:233
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())
Definition: mesh-helper.cc:150
void SetStandard(enum WifiStandard standard)
Set standard.
Definition: mesh-helper.cc:172
MeshHelper()
Construct a MeshHelper used to make life easier when creating 802.11s networks.
Definition: mesh-helper.cc:36
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition: mesh-helper.cc:235
static MeshHelper Default()
Set the helper to the default values for the MAC type, remote station manager and channel policy.
Definition: mesh-helper.cc:120
NetDeviceContainer Install(const WifiPhyHelper &phyHelper, NodeContainer c) const
Install 802.11s mesh device & protocols on given node list.
Definition: mesh-helper.cc:86
ChannelPolicy
Spread/not spread frequency channels of MP interfaces.
Definition: mesh-helper.h:138
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())
Definition: mesh-helper.cc:53
void ResetStats(const ns3::Ptr< ns3::NetDevice > &device)
Reset statistics.
Definition: mesh-helper.cc:227
void Report(const ns3::Ptr< ns3::NetDevice > &device, std::ostream &os)
Print statistics.
Definition: mesh-helper.cc:215
void SetNumberOfInterfaces(uint32_t nInterfaces)
Set a number of interfaces in a mesh network.
Definition: mesh-helper.cc:81
static void EnableLogComponents(void)
Helper to enable all MeshPointDevice log components with one statement.
Definition: mesh-helper.cc:295
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
Instantiate subclasses of ns3::Object.
create PHY objects
Definition: wifi-helper.h:48
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
Every class exported by the ns3 library is enclosed in the ns3 namespace.