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-phy-standard.h"
28 #include "ns3/object-factory.h"
29 
30 namespace ns3 {
31 
32 class NetDeviceContainer;
33 class WifiPhyHelper;
34 class WifiNetDevice;
35 class NodeContainer;
36 
43 {
44 public:
48  MeshHelper ();
49 
53  ~MeshHelper ();
54 
60  static MeshHelper Default ();
61 
83  void SetMacType (std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
84  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
85  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
86  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
87  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
88  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
89  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
90  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
113  void
114  SetRemoteStationManager (std::string type,
115  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
116  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
117  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
118  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
119  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
120  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
121  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
122  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
127  void SetStandard (enum WifiPhyStandard standard);
129  //void SetMeshId (std::string s);
137  {
140  };
141 
151  void SetNumberOfInterfaces (uint32_t nInterfaces);
152 
162  Install (const WifiPhyHelper &phyHelper, NodeContainer c) const;
182  void SetStackInstaller (std::string type,
183  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
184  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
185  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
186  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
187  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
188  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
189  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
190  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
191 
198  void Report (const ns3::Ptr<ns3::NetDevice>& device, std::ostream& os);
199 
204  void ResetStats (const ns3::Ptr<ns3::NetDevice>& device);
216  int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
217 
218 private:
225  Ptr<WifiNetDevice> CreateInterface (const WifiPhyHelper &phyHelper, Ptr<Node> node, uint16_t channelId) const;
226  uint32_t m_nInterfaces;
230 
231  // Interface factory
235 
236 };
237 } // namespace ns3
238 
239 #endif /* MESH_HELPER_H */
240 
Ptr< WifiNetDevice > CreateInterface(const WifiPhyHelper &phyHelper, Ptr< Node > node, uint16_t channelId) const
Definition: mesh-helper.cc:175
Hold a value for an Attribute.
Definition: attribute.h:68
create PHY objects
Definition: wifi-helper.h:42
void Report(const ns3::Ptr< ns3::NetDevice > &device, std::ostream &os)
Print statistics.
Definition: mesh-helper.cc:196
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:147
ChannelPolicy m_spreadChannelPolicy
spread channel policy
Definition: mesh-helper.h:227
void SetNumberOfInterfaces(uint32_t nInterfaces)
Set a number of interfaces in a mesh network.
Definition: mesh-helper.cc:78
MeshHelper()
Construct a MeshHelper used to make life easier when creating 802.11s networks.
Definition: mesh-helper.cc:33
WifiPhyStandard
Identifies the PHY specification that a Wifi device is configured to use.
void SetSpreadInterfaceChannels(ChannelPolicy policy)
set the channel policy
Definition: mesh-helper.cc:45
uint32_t m_nInterfaces
number of interfaces
Definition: mesh-helper.h:226
A class for an empty attribute value.
Definition: attribute.h:232
ObjectFactory m_mac
the MAC
Definition: mesh-helper.h:232
holds a vector of ns3::NetDevice pointers
ObjectFactory m_stackFactory
stack factory
Definition: mesh-helper.h:229
Ptr< MeshStack > m_stack
stack
Definition: mesh-helper.h:228
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:127
ChannelPolicy
Spread/not spread frequency channels of MP interfaces.
Definition: mesh-helper.h:136
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
ObjectFactory m_stationManager
the station manager
Definition: mesh-helper.h:233
void ResetStats(const ns3::Ptr< ns3::NetDevice > &device)
Reset statistics.
Definition: mesh-helper.cc:208
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:216
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:50
void SetStandard(enum WifiPhyStandard standard)
Set PHY standard.
Definition: mesh-helper.cc:169
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:83
static MeshHelper Default()
Set the helper to the default values for the MAC type, remote station manager and channel policy...
Definition: mesh-helper.cc:117
Helper to create IEEE 802.11s mesh networks.
Definition: mesh-helper.h:42
enum WifiPhyStandard m_standard
phy standard
Definition: mesh-helper.h:234
~MeshHelper()
Destroy a MeshHelper.
Definition: mesh-helper.cc:40