A Discrete-Event Network Simulator
API
wave-helper.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License version 2 as
5  * published by the Free Software Foundation;
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15  *
16  * Author: Junling Bu <linlinjavaer@gmail.com>
17  */
18 
19 #ifndef WAVE_HELPER_H
20 #define WAVE_HELPER_H
21 
22 #include <string>
23 #include "ns3/attribute.h"
24 #include "ns3/object-factory.h"
25 #include "ns3/node-container.h"
26 #include "ns3/net-device-container.h"
27 #include "ns3/trace-helper.h"
28 #include "ns3/yans-wifi-helper.h"
29 
30 namespace ns3 {
31 
32 class WaveNetDevice;
33 class Node;
34 
41 {
42 public:
46  static YansWavePhyHelper Default (void);
47 
48 private:
60  virtual void EnablePcapInternal (std::string prefix,
61  Ptr<NetDevice> nd,
62  bool promiscuous,
63  bool explicitFilename);
64 
77  virtual void EnableAsciiInternal (Ptr<OutputStreamWrapper> stream,
78  std::string prefix,
79  Ptr<NetDevice> nd,
80  bool explicitFilename);
81 };
82 
113 {
114 public:
115  WaveHelper ();
116  virtual ~WaveHelper ();
117 
126  static WaveHelper Default (void);
127 
131  void CreateMacForChannel (std::vector<uint32_t> channelNumbers);
135  void CreatePhys (uint32_t phys);
136 
159  void SetRemoteStationManager (std::string type,
160  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
161  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
162  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
163  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
164  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
165  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
166  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
167  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
191  void SetAckPolicySelectorForAc (AcIndex ac, std::string type,
192  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
193  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
194  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
195  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
196  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
197  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
198  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
199  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
222  void SetChannelScheduler (std::string type,
223  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
224  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
225  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
226  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
227  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
228  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
229  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
230  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
231 
239  const WifiMacHelper &mac, NodeContainer c) const;
247  const WifiMacHelper &mac, Ptr<Node> node) const;
255  const WifiMacHelper &mac, std::string nodeName) const;
256 
260  static void EnableLogComponents (void);
261 
276  int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
277 
278 protected:
282  std::vector<uint32_t> m_macsForChannelNumber;
283  uint32_t m_physNumber;
284 };
285 }
286 #endif /* WAVE_HELPER_H */
static void EnableLogComponents(void)
Helper to enable all WaveNetDevice log components with one statement.
Definition: wave-helper.cc:482
void CreateMacForChannel(std::vector< uint32_t > channelNumbers)
Definition: wave-helper.cc:289
ObjectFactory m_channelScheduler
channel scheduler
Definition: wave-helper.h:281
ObjectFactory m_ackPolicySelector[4]
ack policy selector for all ACs
Definition: wave-helper.h:280
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by the Phy and Mac aspects ...
Definition: wave-helper.cc:499
Make it easy to create and manage PHY objects for the YANS model.
Hold a value for an Attribute.
Definition: attribute.h:68
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: wave-helper.cc:343
create PHY objects
Definition: wifi-helper.h:46
static WaveHelper Default(void)
Definition: wave-helper.cc:270
phy
Definition: third.py:93
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: wave-helper.cc:320
std::vector< uint32_t > m_macsForChannelNumber
MACs for channel number.
Definition: wave-helper.h:282
virtual void EnablePcapInternal(std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename)
Enable pcap output the indicated net device.
Definition: wave-helper.cc:132
A class for an empty attribute value.
Definition: attribute.h:232
helps to create WaveNetDevice objects
Definition: wave-helper.h:112
virtual ~WaveHelper()
Definition: wave-helper.cc:265
holds a vector of ns3::NetDevice pointers
mac
Definition: third.py:99
void SetChannelScheduler(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: wave-helper.cc:366
virtual void EnableAsciiInternal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename)
Enable ascii trace output on the indicated net device.
Definition: wave-helper.cc:173
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
void CreatePhys(uint32_t phys)
Definition: wave-helper.cc:306
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer c) const
Definition: wave-helper.cc:389
create MAC layers for a ns3::WifiNetDevice.
To trace WaveNetDevice, we have to overwrite the trace functions of class YansWifiPhyHelper.
Definition: wave-helper.h:40
ObjectFactory m_stationManager
station manager
Definition: wave-helper.h:279
Instantiate subclasses of ns3::Object.
static YansWavePhyHelper Default(void)
Create a phy helper in a default working state.
Definition: wave-helper.cc:124
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:38
uint32_t m_physNumber
Phy number.
Definition: wave-helper.h:283