A Discrete-Event Network Simulator
API
wifi-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 INRIA
4  * Copyright (c) 2009 MIRKO BANCHI
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20  * Mirko Banchi <mk.banchi@gmail.com>
21  */
22 
23 #ifndef WIFI_HELPER_H
24 #define WIFI_HELPER_H
25 
26 #include "ns3/trace-helper.h"
27 #include "ns3/wifi-phy.h"
28 #include "wifi-mac-helper.h"
29 
30 namespace ns3 {
31 
32 class WifiPhy;
33 class WifiNetDevice;
34 class Node;
35 
44 {
45 public:
46  WifiPhyHelper ();
47  virtual ~WifiPhyHelper ();
48 
62  virtual Ptr<WifiPhy> Create (Ptr<Node> node, Ptr<NetDevice> device) const = 0;
63 
70  void Set (std::string name, const AttributeValue &v);
92  void SetErrorRateModel (std::string name,
93  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
94  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
95  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
96  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
97  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
98  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
99  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
100  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
101 
108  {
112  };
113 
124 
133 
134 protected:
145  Ptr<const Packet> packet,
146  uint16_t channelFreqMhz,
147  WifiTxVector txVector,
148  MpduInfo aMpdu);
160  Ptr<const Packet> packet,
161  uint16_t channelFreqMhz,
162  WifiTxVector txVector,
163  MpduInfo aMpdu,
164  SignalNoiseDbm signalNoise);
165 
168 
169 private:
181  virtual void EnablePcapInternal (std::string prefix,
182  Ptr<NetDevice> nd,
183  bool promiscuous,
184  bool explicitFilename);
185 
197  virtual void EnableAsciiInternal (Ptr<OutputStreamWrapper> stream,
198  std::string prefix,
199  Ptr<NetDevice> nd,
200  bool explicitFilename);
201 
203 };
204 
205 
214 {
215 public:
216  virtual ~WifiHelper ();
217 
226  WifiHelper ();
227 
239  static WifiHelper Default (void);
240 
263  void SetRemoteStationManager (std::string type,
264  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
265  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
266  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
267  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
268  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
269  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
270  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
271  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
280  virtual Install (const WifiPhyHelper &phy,
281  const WifiMacHelper &mac,
283  NodeContainer::Iterator last) const;
290  virtual NetDeviceContainer Install (const WifiPhyHelper &phy,
291  const WifiMacHelper &mac, NodeContainer c) const;
298  virtual NetDeviceContainer Install (const WifiPhyHelper &phy,
299  const WifiMacHelper &mac, Ptr<Node> node) const;
306  virtual NetDeviceContainer Install (const WifiPhyHelper &phy,
307  const WifiMacHelper &mac, std::string nodeName) const;
332  virtual void SetStandard (enum WifiPhyStandard standard);
333 
337  static void EnableLogComponents (void);
338 
353  int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
354 
355 
356 protected:
359 };
360 
361 } //namespace ns3
362 
363 #endif /* WIFI_HELPER_H */
virtual ~WifiPhyHelper()
Definition: wifi-helper.cc:127
MpduInfo structure.
Definition: wifi-phy.h:74
Base class providing common user-level ascii trace operations for helpers representing net devices...
Definition: trace-helper.h:641
void Set(std::string name, const AttributeValue &v)
Definition: wifi-helper.cc:132
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
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: wifi-helper.cc:719
virtual ~WifiHelper()
Definition: wifi-helper.cc:700
Hold a value for an Attribute.
Definition: attribute.h:68
create PHY objects
Definition: wifi-helper.h:42
PcapHelper::DataLinkType m_pcapDlt
PCAP data link type.
Definition: wifi-helper.h:202
Base class providing common user-level pcap operations for helpers representing net devices...
Definition: trace-helper.h:552
ObjectFactory m_errorRateModel
error rate model
Definition: wifi-helper.h:167
helps to create WifiNetDevice objects
Definition: wifi-helper.h:213
WifiHelper()
Create a Wifi helper in an empty state: all its parameters must be set before calling ns3::WifiHelper...
Definition: wifi-helper.cc:704
void SetPcapDataLinkType(enum SupportedPcapDataLinkTypes dlt)
Set the data link type of PCAP traces to be used.
Definition: wifi-helper.cc:566
virtual void EnableAsciiInternal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename)
Enable ascii trace output on the indicated net device.
Definition: wifi-helper.cc:625
static void PcapSniffTxEvent(Ptr< PcapFileWrapper > file, Ptr< const Packet > packet, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu)
Definition: wifi-helper.cc:161
DataLinkType
This enumeration holds the data link types that will be written to the pcap file. ...
Definition: trace-helper.h:50
WifiPhyStandard
Identifies the PHY specification that a Wifi device is configured to use.
tuple phy
Definition: third.py:86
A class for an empty attribute value.
Definition: attribute.h:232
holds a vector of ns3::NetDevice pointers
virtual void SetStandard(enum WifiPhyStandard standard)
Definition: wifi-helper.cc:742
static void PcapSniffRxEvent(Ptr< PcapFileWrapper > file, Ptr< const Packet > packet, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu, SignalNoiseDbm signalNoise)
Definition: wifi-helper.cc:361
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer::Iterator first, NodeContainer::Iterator last) const
Definition: wifi-helper.cc:748
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: wifi-helper.cc:849
tuple mac
Definition: third.py:92
Include Prism monitor mode information.
Definition: wifi-helper.h:110
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
ObjectFactory m_stationManager
station manager
Definition: wifi-helper.h:357
create MAC layers for a ns3::WifiNetDevice.
void SetErrorRateModel(std::string name, 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: wifi-helper.cc:138
virtual void EnablePcapInternal(std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename)
Enable pcap output the indicated net device.
Definition: wifi-helper.cc:591
ObjectFactory m_phy
PHY object.
Definition: wifi-helper.h:166
Instantiate subclasses of ns3::Object.
#define NS_DEPRECATED
Mark a function as deprecated.
Definition: deprecated.h:60
static void EnableLogComponents(void)
Helper to enable all WifiNetDevice log components with one statement.
Definition: wifi-helper.cc:797
virtual Ptr< WifiPhy > Create(Ptr< Node > node, Ptr< NetDevice > device) const =0
SignalNoiseDbm structure.
Definition: wifi-phy.h:67
IEEE 802.11 Wireless LAN headers on packets.
Definition: wifi-helper.h:109
enum WifiPhyStandard m_standard
wifi standard
Definition: wifi-helper.h:358
SupportedPcapDataLinkTypes
An enumeration of the pcap data link types (DLTs) which this helper supports.
Definition: wifi-helper.h:107
Definition: first.py:1
Include Radiotap link layer information.
Definition: wifi-helper.h:111
PcapHelper::DataLinkType GetPcapDataLinkType(void) const
Get the data link type of PCAP traces to be used.
Definition: wifi-helper.cc:585
static NS_DEPRECATED WifiHelper Default(void)
Definition: wifi-helper.cc:711