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/wifi-helper.h"
27 #include "ns3/mesh-stack-installer.h"
28 
29 namespace ns3 {
30 
31 class WifiChannel;
32 
39 {
40 public:
44  MeshHelper ();
45 
49  ~MeshHelper ();
50 
56  static MeshHelper Default ();
57 
79  void SetMacType (std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
80  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
81  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
82  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
83  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
84  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
85  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
86  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
109  void
110  SetRemoteStationManager (std::string type,
111  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
112  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
113  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
114  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
115  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
116  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
117  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
118  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
123  void SetStandard (enum WifiPhyStandard standard);
125  //void SetMeshId (std::string s);
133  {
136  };
137 
147  void SetNumberOfInterfaces (uint32_t nInterfaces);
148 
158  Install (const WifiPhyHelper &phyHelper, NodeContainer c) const;
178  void SetStackInstaller (std::string type,
179  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
180  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
181  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
182  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
183  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
184  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
185  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
186  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
187 
194  void Report (const ns3::Ptr<ns3::NetDevice>& device, std::ostream& os);
195 
200  void ResetStats (const ns3::Ptr<ns3::NetDevice>& device);
212  int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
213 
214 private:
221  Ptr<WifiNetDevice> CreateInterface (const WifiPhyHelper &phyHelper, Ptr<Node> node, uint16_t channelId) const;
222  uint32_t m_nInterfaces;
226 
227  // Interface factory
231 
232 };
233 } // namespace ns3
234 
235 #endif /* MESH_HELPER_H */
236 
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:195
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:146
ChannelPolicy m_spreadChannelPolicy
spread channel policy
Definition: mesh-helper.h:223
Ptr< WifiNetDevice > CreateInterface(const WifiPhyHelper &phyHelper, Ptr< Node > node, uint16_t channelId) const
Definition: mesh-helper.cc:174
void SetNumberOfInterfaces(uint32_t nInterfaces)
Set a number of interfaces in a mesh network.
Definition: mesh-helper.cc:77
MeshHelper()
Construct a MeshHelper used to make life easier when creating 802.11s networks.
Definition: mesh-helper.cc:32
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:44
ChannelPolicy
Spread/not spread frequency channels of MP interfaces.
Definition: mesh-helper.h:132
uint32_t m_nInterfaces
number of interfaces
Definition: mesh-helper.h:222
A class for an empty attribute value.
Definition: attribute.h:232
ObjectFactory m_mac
the MAC
Definition: mesh-helper.h:228
holds a vector of ns3::NetDevice pointers
ObjectFactory m_stackFactory
stack factory
Definition: mesh-helper.h:225
Ptr< MeshStack > m_stack
stack
Definition: mesh-helper.h:224
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:126
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:229
void ResetStats(const ns3::Ptr< ns3::NetDevice > &device)
Reset statistics.
Definition: mesh-helper.cc:207
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:215
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:49
void SetStandard(enum WifiPhyStandard standard)
Set PHY standard.
Definition: mesh-helper.cc:168
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:82
static MeshHelper Default()
Set the helper to the default values for the MAC type, remote station manager and channel policy...
Definition: mesh-helper.cc:116
Helper to create IEEE 802.11s mesh networks.
Definition: mesh-helper.h:38
enum WifiPhyStandard m_standard
phy standard
Definition: mesh-helper.h:230
~MeshHelper()
Destroy a MeshHelper.
Definition: mesh-helper.cc:39