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 
31 namespace ns3 {
32 
33 class NetDeviceContainer;
34 class WifiPhyHelper;
35 class WifiNetDevice;
36 class NodeContainer;
37 
44 {
45 public:
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 ());
147  void SetAckPolicySelectorForAc (AcIndex ac, std::string type,
148  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
149  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
150  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
151  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
152  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
153  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
154  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
155  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
160  void SetStandard (enum WifiStandard standard);
162  //void SetMeshId (std::string s);
170  {
173  };
174 
184  void SetNumberOfInterfaces (uint32_t nInterfaces);
185 
195  Install (const WifiPhyHelper &phyHelper, NodeContainer c) const;
215  void SetStackInstaller (std::string type,
216  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
217  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
218  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
219  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
220  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
221  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
222  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
223  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
224 
231  void Report (const ns3::Ptr<ns3::NetDevice>& device, std::ostream& os);
232 
237  void ResetStats (const ns3::Ptr<ns3::NetDevice>& device);
249  int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
250 
251 private:
258  Ptr<WifiNetDevice> CreateInterface (const WifiPhyHelper &phyHelper, Ptr<Node> node, uint16_t channelId) const;
259  uint32_t m_nInterfaces;
263 
264  // Interface factory
269 
270 };
271 } // namespace ns3
272 
273 #endif /* MESH_HELPER_H */
274 
Ptr< WifiNetDevice > CreateInterface(const WifiPhyHelper &phyHelper, Ptr< Node > node, uint16_t channelId) const
Definition: mesh-helper.cc:202
ObjectFactory m_ackPolicySelector[4]
ack policy selector for all ACs
Definition: mesh-helper.h:267
Hold a value for an Attribute.
Definition: attribute.h:68
create PHY objects
Definition: wifi-helper.h:46
void Report(const ns3::Ptr< ns3::NetDevice > &device, std::ostream &os)
Print statistics.
Definition: mesh-helper.cc:255
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:152
ChannelPolicy m_spreadChannelPolicy
spread channel policy
Definition: mesh-helper.h:260
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())
Definition: mesh-helper.cc:174
void SetNumberOfInterfaces(uint32_t nInterfaces)
Set a number of interfaces in a mesh network.
Definition: mesh-helper.cc:79
MeshHelper()
Construct a MeshHelper used to make life easier when creating 802.11s networks.
Definition: mesh-helper.cc:34
void SetStandard(enum WifiStandard standard)
Set standard.
Definition: mesh-helper.cc:196
void SetSpreadInterfaceChannels(ChannelPolicy policy)
set the channel policy
Definition: mesh-helper.cc:46
uint32_t m_nInterfaces
number of interfaces
Definition: mesh-helper.h:259
A class for an empty attribute value.
Definition: attribute.h:232
ObjectFactory m_mac
the MAC
Definition: mesh-helper.h:265
holds a vector of ns3::NetDevice pointers
ObjectFactory m_stackFactory
stack factory
Definition: mesh-helper.h:262
Ptr< MeshStack > m_stack
stack
Definition: mesh-helper.h:261
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:132
ChannelPolicy
Spread/not spread frequency channels of MP interfaces.
Definition: mesh-helper.h:169
Every class exported by the ns3 library is enclosed in the ns3 namespace.
WifiStandard
Identifies the allowed configurations that a Wifi device is configured to use.
keep track of a set of node pointers.
ObjectFactory m_stationManager
the station manager
Definition: mesh-helper.h:266
void ResetStats(const ns3::Ptr< ns3::NetDevice > &device)
Reset statistics.
Definition: mesh-helper.cc:267
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:275
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:51
enum WifiStandard m_standard
standard
Definition: mesh-helper.h:268
Instantiate subclasses of ns3::Object.
NetDeviceContainer Install(const WifiPhyHelper &phyHelper, NodeContainer c) const
Install 802.11s mesh device & protocols on given node list.
Definition: mesh-helper.cc:84
static MeshHelper Default()
Set the helper to the default values for the MAC type, remote station manager and channel policy...
Definition: mesh-helper.cc:118
Helper to create IEEE 802.11s mesh networks.
Definition: mesh-helper.h:43
~MeshHelper()
Destroy a MeshHelper.
Definition: mesh-helper.cc:41
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:38