A Discrete-Event Network Simulator
API
wave-helper.cc
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 #include "ns3/wifi-mac.h"
19 #include "ns3/wifi-phy.h"
20 #include "ns3/log.h"
21 #include "ns3/pointer.h"
22 #include "ns3/string.h"
23 #include "ns3/wifi-mode.h"
24 #include "ns3/config.h"
25 #include "ns3/names.h"
26 #include "ns3/abort.h"
27 #include "ns3/ampdu-subframe-header.h"
28 #include "ns3/wave-net-device.h"
29 #include "ns3/minstrel-wifi-manager.h"
30 #include "ns3/radiotap-header.h"
31 #include "ns3/unused.h"
32 #include "wave-mac-helper.h"
33 #include "wave-helper.h"
34 
35 NS_LOG_COMPONENT_DEFINE ("WaveHelper");
36 
37 namespace ns3 {
38 
48 static void
51  std::string context,
53  WifiMode mode,
54  WifiPreamble preamble,
55  uint8_t txLevel)
56 {
57  NS_LOG_FUNCTION (stream << context << p << mode << preamble << txLevel);
58  *stream->GetStream () << "t " << Simulator::Now ().GetSeconds () << " " << context << " " << *p << std::endl;
59 }
60 
69 static void
73  WifiMode mode,
74  WifiPreamble preamble,
75  uint8_t txLevel)
76 {
77  NS_LOG_FUNCTION (stream << p << mode << preamble << txLevel);
78  *stream->GetStream () << "t " << Simulator::Now ().GetSeconds () << " " << *p << std::endl;
79 }
80 
90 static void
93  std::string context,
95  double snr,
96  WifiMode mode,
97  enum WifiPreamble preamble)
98 {
99  NS_LOG_FUNCTION (stream << context << p << snr << mode << preamble);
100  *stream->GetStream () << "r " << Simulator::Now ().GetSeconds () << " " << context << " " << *p << std::endl;
101 }
102 
111 static void
115  double snr,
116  WifiMode mode,
117  enum WifiPreamble preamble)
118 {
119  NS_LOG_FUNCTION (stream << p << snr << mode << preamble);
120  *stream->GetStream () << "r " << Simulator::Now ().GetSeconds () << " " << *p << std::endl;
121 }
122 
123 
124 /****************************** YansWavePhyHelper ***********************************/
125 YansWavePhyHelper
127 {
128  YansWavePhyHelper helper;
129  helper.SetErrorRateModel ("ns3::NistErrorRateModel");
130  return helper;
131 }
132 
133 void
134 YansWavePhyHelper::EnablePcapInternal (std::string prefix, Ptr<NetDevice> nd, bool promiscuous, bool explicitFilename)
135 {
136  //
137  // All of the Pcap enable functions vector through here including the ones
138  // that are wandering through all of devices on perhaps all of the nodes in
139  // the system. We can only deal with devices of type WaveNetDevice.
140  //
141  Ptr<WaveNetDevice> device = nd->GetObject<WaveNetDevice> ();
142  if (device == 0)
143  {
144  NS_LOG_INFO ("YansWavePhyHelper::EnablePcapInternal(): Device " << &device << " not of type ns3::WaveNetDevice");
145  return;
146  }
147 
148  std::vector<Ptr<WifiPhy> > phys = device->GetPhys ();
149  NS_ABORT_MSG_IF (phys.size () == 0, "EnablePcapInternal(): Phy layer in WaveNetDevice must be set");
150 
151  PcapHelper pcapHelper;
152 
153  std::string filename;
154  if (explicitFilename)
155  {
156  filename = prefix;
157  }
158  else
159  {
160  filename = pcapHelper.GetFilenameFromDevice (prefix, device);
161  }
162 
163  Ptr<PcapFileWrapper> file = pcapHelper.CreateFile (filename, std::ios::out, GetPcapDataLinkType ());
164 
165  std::vector<Ptr<WifiPhy> >::iterator i;
166  for (i = phys.begin (); i != phys.end (); ++i)
167  {
168  Ptr<WifiPhy> phy = (*i);
171  }
172 }
173 
174 void
177  std::string prefix,
178  Ptr<NetDevice> nd,
179  bool explicitFilename)
180 {
181  //
182  // All of the ascii enable functions vector through here including the ones
183  // that are wandering through all of devices on perhaps all of the nodes in
184  // the system. We can only deal with devices of type WaveNetDevice.
185  //
186  Ptr<WaveNetDevice> device = nd->GetObject<WaveNetDevice> ();
187  if (device == 0)
188  {
189  NS_LOG_INFO ("EnableAsciiInternal(): Device " << device << " not of type ns3::WaveNetDevice");
190  return;
191  }
192 
193  //
194  // Our trace sinks are going to use packet printing, so we have to make sure
195  // that is turned on.
196  //
198 
199  uint32_t nodeid = nd->GetNode ()->GetId ();
200  uint32_t deviceid = nd->GetIfIndex ();
201  std::ostringstream oss;
202 
203  //
204  // If we are not provided an OutputStreamWrapper, we are expected to create
205  // one using the usual trace filename conventions and write our traces
206  // without a context since there will be one file per context and therefore
207  // the context would be redundant.
208  //
209  if (stream == 0)
210  {
211  //
212  // Set up an output stream object to deal with private ofstream copy
213  // constructor and lifetime issues. Let the helper decide the actual
214  // name of the file given the prefix.
215  //
216  AsciiTraceHelper asciiTraceHelper;
217 
218  std::string filename;
219  if (explicitFilename)
220  {
221  filename = prefix;
222  }
223  else
224  {
225  filename = asciiTraceHelper.GetFilenameFromDevice (prefix, device);
226  }
227 
228  Ptr<OutputStreamWrapper> theStream = asciiTraceHelper.CreateFileStream (filename);
229  //
230  // We could go poking through the phy and the state looking for the
231  // correct trace source, but we can let Config deal with that with
232  // some search cost. Since this is presumably happening at topology
233  // creation time, it doesn't seem much of a price to pay.
234  //
235  oss.str ("");
236  oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WaveNetDevice/PhyEntities/*/$ns3::WifiPhy/State/RxOk";
238 
239  oss.str ("");
240  oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WaveNetDevice/PhyEntities/*/$ns3::WifiPhy/State/Tx";
242 
243  return;
244  }
245 
246  //
247  // If we are provided an OutputStreamWrapper, we are expected to use it, and
248  // to provide a context. We are free to come up with our own context if we
249  // want, and use the AsciiTraceHelper Hook*WithContext functions, but for
250  // compatibility and simplicity, we just use Config::Connect and let it deal
251  // with coming up with a context.
252  //
253  oss.str ("");
254  oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WaveNetDevice/PhyEntities/*/$ns3::WifiPhy/RxOk";
256 
257  oss.str ("");
258  oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WaveNetDevice/PhyEntities/*/$ns3::WifiPhy/State/Tx";
260 }
261 
262 /********************************** WaveHelper ******************************************/
264 {
265 }
266 
268 {
269 }
270 
273 {
274  WaveHelper helper;
275  // default 7 MAC entities and single PHY device.
277  helper.CreatePhys (1);
278  helper.SetChannelScheduler ("ns3::DefaultChannelScheduler");
279  helper.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
280  "DataMode", StringValue ("OfdmRate6MbpsBW10MHz"),
281  "ControlMode",StringValue ("OfdmRate6MbpsBW10MHz"),
282  "NonUnicastMode", StringValue ("OfdmRate6MbpsBW10MHz"));
283  return helper;
284 }
285 
286 void
287 WaveHelper::CreateMacForChannel (std::vector<uint32_t> channelNumbers)
288 {
289  if (channelNumbers.size () == 0)
290  {
291  NS_FATAL_ERROR ("the WAVE MAC entities is at least one");
292  }
293  for (std::vector<uint32_t>::iterator i = channelNumbers.begin (); i != channelNumbers.end (); ++i)
294  {
296  {
297  NS_FATAL_ERROR ("the channel number " << (*i) << " is not a valid WAVE channel number");
298  }
299  }
300  m_macsForChannelNumber = channelNumbers;
301 }
302 
303 void
304 WaveHelper::CreatePhys (uint32_t phys)
305 {
306  if (phys == 0)
307  {
308  NS_FATAL_ERROR ("the WAVE PHY entities is at least one");
309  }
311  {
312  NS_FATAL_ERROR ("the number of assigned WAVE PHY entities is more than the number of valid WAVE channels");
313  }
314  m_physNumber = phys;
315 }
316 
317 void
319  std::string n0, const AttributeValue &v0,
320  std::string n1, const AttributeValue &v1,
321  std::string n2, const AttributeValue &v2,
322  std::string n3, const AttributeValue &v3,
323  std::string n4, const AttributeValue &v4,
324  std::string n5, const AttributeValue &v5,
325  std::string n6, const AttributeValue &v6,
326  std::string n7, const AttributeValue &v7)
327 {
330  m_stationManager.Set (n0, v0);
331  m_stationManager.Set (n1, v1);
332  m_stationManager.Set (n2, v2);
333  m_stationManager.Set (n3, v3);
334  m_stationManager.Set (n4, v4);
335  m_stationManager.Set (n5, v5);
336  m_stationManager.Set (n6, v6);
337  m_stationManager.Set (n7, v7);
338 }
339 
340 void
342  std::string n0, const AttributeValue &v0,
343  std::string n1, const AttributeValue &v1,
344  std::string n2, const AttributeValue &v2,
345  std::string n3, const AttributeValue &v3,
346  std::string n4, const AttributeValue &v4,
347  std::string n5, const AttributeValue &v5,
348  std::string n6, const AttributeValue &v6,
349  std::string n7, const AttributeValue &v7)
350 {
353  m_channelScheduler.Set (n0, v0);
354  m_channelScheduler.Set (n1, v1);
355  m_channelScheduler.Set (n2, v2);
356  m_channelScheduler.Set (n3, v3);
357  m_channelScheduler.Set (n4, v4);
358  m_channelScheduler.Set (n5, v5);
359  m_channelScheduler.Set (n6, v6);
360  m_channelScheduler.Set (n7, v7);
361 }
362 
364 WaveHelper::Install (const WifiPhyHelper &phyHelper, const WifiMacHelper &macHelper, NodeContainer c) const
365 {
366  try
367  {
368  const QosWaveMacHelper& qosMac = dynamic_cast<const QosWaveMacHelper&> (macHelper);
369  NS_UNUSED (qosMac);
370  }
371  catch (const std::bad_cast &)
372  {
373  NS_FATAL_ERROR ("WifiMacHelper should be the class or subclass of QosWaveMacHelper");
374  }
375 
377  for (NodeContainer::Iterator i = c.Begin (); i != c.End (); ++i)
378  {
379  Ptr<Node> node = *i;
380  Ptr<WaveNetDevice> device = CreateObject<WaveNetDevice> ();
381 
382  device->SetChannelManager (CreateObject<ChannelManager> ());
383  device->SetChannelCoordinator (CreateObject<ChannelCoordinator> ());
384  device->SetVsaManager (CreateObject<VsaManager> ());
386 
387  for (uint32_t j = 0; j != m_physNumber; ++j)
388  {
389  Ptr<WifiPhy> phy = phyHelper.Create (node, device);
392  device->AddPhy (phy);
393  }
394 
395  for (std::vector<uint32_t>::const_iterator k = m_macsForChannelNumber.begin ();
396  k != m_macsForChannelNumber.end (); ++k)
397  {
398  Ptr<WifiMac> wifiMac = macHelper.Create ();
399  Ptr<OcbWifiMac> ocbMac = DynamicCast<OcbWifiMac> (wifiMac);
400  // we use WaveMacLow to replace original MacLow
401  ocbMac->EnableForWave (device);
404  device->AddMac (*k, ocbMac);
405  }
406 
407  device->SetAddress (Mac48Address::Allocate ());
408 
409  node->AddDevice (device);
410  devices.Add (device);
411  }
412  return devices;
413 }
414 
417 {
418  return Install (phy, mac, NodeContainer (node));
419 }
420 
422 WaveHelper::Install (const WifiPhyHelper &phy, const WifiMacHelper &mac, std::string nodeName) const
423 {
424  Ptr<Node> node = Names::Find<Node> (nodeName);
425  return Install (phy, mac, NodeContainer (node));
426 }
427 
428 void
430 {
432 
433  LogComponentEnable ("WaveNetDevice", LOG_LEVEL_ALL);
434  LogComponentEnable ("ChannelCoordinator", LOG_LEVEL_ALL);
435  LogComponentEnable ("ChannelManager", LOG_LEVEL_ALL);
436  LogComponentEnable ("ChannelScheduler", LOG_LEVEL_ALL);
437  LogComponentEnable ("DefaultChannelScheduler", LOG_LEVEL_ALL);
438  LogComponentEnable ("VsaManager", LOG_LEVEL_ALL);
439  LogComponentEnable ("OcbWifiMac", LOG_LEVEL_ALL);
440  LogComponentEnable ("VendorSpecificAction", LOG_LEVEL_ALL);
441  LogComponentEnable ("WaveMacLow", LOG_LEVEL_ALL);
442  LogComponentEnable ("HigherLayerTxVectorTag", LOG_LEVEL_ALL);
443 }
444 
445 int64_t
447 {
448  int64_t currentStream = stream;
449  Ptr<NetDevice> netDevice;
450  for (NetDeviceContainer::Iterator i = c.Begin (); i != c.End (); ++i)
451  {
452  netDevice = (*i);
453  Ptr<WaveNetDevice> wave = DynamicCast<WaveNetDevice> (netDevice);
454  if (wave)
455  {
456  // Handle any random numbers in the PHY objects.
457  std::vector<Ptr<WifiPhy> > phys = wave->GetPhys ();
458  for (std::vector<Ptr<WifiPhy> >::iterator j = phys.begin (); j != phys.end (); ++j)
459  {
460  currentStream += (*j)->AssignStreams (currentStream);
461  }
462 
463  // Handle any random numbers in the MAC objects.
464  std::map<uint32_t, Ptr<OcbWifiMac> > macs = wave->GetMacs ();
465  for ( std::map<uint32_t, Ptr<OcbWifiMac> >::iterator k = macs.begin (); k != macs.end (); ++k)
466  {
467  Ptr<RegularWifiMac> rmac = DynamicCast<RegularWifiMac> (k->second);
468 
469  // Handle any random numbers in the station managers.
470  Ptr<WifiRemoteStationManager> manager = rmac->GetWifiRemoteStationManager ();
471  Ptr<MinstrelWifiManager> minstrel = DynamicCast<MinstrelWifiManager> (manager);
472  if (minstrel)
473  {
474  currentStream += minstrel->AssignStreams (currentStream);
475  }
476 
477  PointerValue ptr;
478  rmac->GetAttribute ("DcaTxop", ptr);
479  Ptr<DcaTxop> dcaTxop = ptr.Get<DcaTxop> ();
480  currentStream += dcaTxop->AssignStreams (currentStream);
481 
482  rmac->GetAttribute ("VO_EdcaTxopN", ptr);
483  Ptr<EdcaTxopN> vo_edcaTxopN = ptr.Get<EdcaTxopN> ();
484  currentStream += vo_edcaTxopN->AssignStreams (currentStream);
485 
486  rmac->GetAttribute ("VI_EdcaTxopN", ptr);
487  Ptr<EdcaTxopN> vi_edcaTxopN = ptr.Get<EdcaTxopN> ();
488  currentStream += vi_edcaTxopN->AssignStreams (currentStream);
489 
490  rmac->GetAttribute ("BE_EdcaTxopN", ptr);
491  Ptr<EdcaTxopN> be_edcaTxopN = ptr.Get<EdcaTxopN> ();
492  currentStream += be_edcaTxopN->AssignStreams (currentStream);
493 
494  rmac->GetAttribute ("BK_EdcaTxopN", ptr);
495  Ptr<EdcaTxopN> bk_edcaTxopN = ptr.Get<EdcaTxopN> ();
496  currentStream += bk_edcaTxopN->AssignStreams (currentStream);
497  }
498  }
499  }
500  return (currentStream - stream);
501 }
502 } // namespace ns3
static void EnableLogComponents(void)
Helper to enable all WaveNetDevice log components with one statement.
Definition: wave-helper.cc:429
Iterator Begin(void) const
Get an iterator which refers to the first NetDevice in the container.
void CreateMacForChannel(std::vector< uint32_t > channelNumbers)
Definition: wave-helper.cc:287
ObjectFactory m_channelScheduler
channel scheduler
Definition: wave-helper.h:248
Ptr< T > Get(void) const
Definition: pointer.h:194
Manage ASCII trace files for device models.
Definition: trace-helper.h:161
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
static std::vector< uint32_t > GetWaveChannels(void)
tuple devices
Definition: first.py:32
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:446
static void AsciiPhyReceiveSinkWithoutContext(Ptr< OutputStreamWrapper > stream, Ptr< const Packet > p, double snr, WifiMode mode, enum WifiPreamble preamble)
ASCII Phy receive sink without context.
Definition: wave-helper.cc:112
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
Hold variables of type string.
Definition: string.h:41
Hold a value for an Attribute.
Definition: attribute.h:68
Manage pcap files for device models.
Definition: trace-helper.h:38
create PHY objects
Definition: wifi-helper.h:42
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
Definition: callback.h:1686
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
static bool IsWaveChannel(uint32_t channelNumber)
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
#define NS_UNUSED(x)
Mark a local variable as unused.
Definition: unused.h:36
OFDM PHY for the 5 GHz band (Clause 17 with 10 MHz channel bandwidth)
This class holds together multiple, ns3::WifiPhy, and ns3::OcbWifiMac (including ns3::WifiRemoteStati...
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
static void AsciiPhyReceiveSinkWithContext(Ptr< OutputStreamWrapper > stream, std::string context, Ptr< const Packet > p, double snr, WifiMode mode, enum WifiPreamble preamble)
ASCII Phy receive sink with context.
Definition: wave-helper.cc:91
static WaveHelper Default(void)
Definition: wave-helper.cc:272
void EnableForWave(Ptr< WaveNetDevice > device)
void ConfigureStandard(WifiPhyStandard standard)
Definition: wifi-mac.cc:289
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:277
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:162
Ptr< OutputStreamWrapper > CreateFileStream(std::string filename, std::ios::openmode filemode=std::ios::out)
Create and initialize an output stream object we'll use to write the traced bits. ...
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
Definition: dca-txop.cc:228
std::string GetFilenameFromDevice(std::string prefix, Ptr< NetDevice > device, bool useObjectNames=true)
Let the ascii trace helper figure out a reasonable filename to use for an ascii trace file associated...
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer c) const
Definition: wave-helper.cc:364
virtual void SetAddress(Address address)
Set the address of this interface.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:97
static void PcapSniffTxEvent(Ptr< PcapFileWrapper > file, Ptr< const Packet > packet, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu)
Definition: wifi-helper.cc:161
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition: wifi-preamble.h:30
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:341
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:318
This queue contains packets for a particular access class.
Definition: edca-txop-n.h:68
static uint32_t GetNumberOfWaveChannels(void)
std::string GetFilenameFromDevice(std::string prefix, Ptr< NetDevice > device, bool useObjectNames=true)
Let the pcap helper figure out a reasonable filename to use for a pcap file associated with a device...
Definition: trace-helper.cc:80
std::vector< uint32_t > m_macsForChannelNumber
MACs for channel number.
Definition: wave-helper.h:249
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.
Definition: log.cc:369
tuple phy
Definition: third.py:86
static Mac48Address Allocate(void)
Allocate a new Mac48Address.
static void EnablePrinting(void)
Enable printing packets metadata.
Definition: packet.cc:534
virtual void EnablePcapInternal(std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename)
Enable pcap output the indicated net device.
Definition: wave-helper.cc:134
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
void SetChannelScheduler(Ptr< ChannelScheduler > channelScheduler)
helps to create WaveNetDevice objects
Definition: wave-helper.h:112
virtual ~WaveHelper()
Definition: wave-helper.cc:267
void SetChannelManager(Ptr< ChannelManager > channelManager)
holds a vector of ns3::NetDevice pointers
static void PcapSniffRxEvent(Ptr< PcapFileWrapper > file, Ptr< const Packet > packet, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu, SignalNoiseDbm signalNoise)
Definition: wifi-helper.cc:361
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:341
void ConnectWithoutContext(std::string path, const CallbackBase &cb)
Definition: config.cc:832
tuple mac
Definition: third.py:92
Qos Wave Mac Helper class.
hold a list of per-remote-station state.
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:175
void Connect(std::string path, const CallbackBase &cb)
Definition: config.cc:843
static uint32_t GetCch(void)
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Definition: object-base.cc:293
virtual void SetWifiRemoteStationManager(const Ptr< WifiRemoteStationManager > stationManager)
std::map< uint32_t, Ptr< OcbWifiMac > > GetMacs(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
Hold objects of type Ptr.
Definition: pointer.h:36
void CreatePhys(uint32_t phys)
Definition: wave-helper.cc:304
Iterator Begin(void) const
Get an iterator which refers to the first Node in the container.
void Set(std::string name, const AttributeValue &value)
Set an attribute to be set during construction.
virtual void SetChannelNumber(uint8_t id)
Set channel number.
Definition: wifi-phy.cc:1442
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
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:249
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 Ptr< WifiMac > Create(void) const
std::vector< Ptr< WifiPhy > > GetPhys(void) const
void AddPhy(Ptr< WifiPhy > phy)
ObjectFactory m_stationManager
station manager
Definition: wave-helper.h:247
Instantiate subclasses of ns3::Object.
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
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
Definition: node.cc:128
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition: abort.h:108
static YansWavePhyHelper Default(void)
Create a phy helper in a default working state.
Definition: wave-helper.cc:126
void SetVsaManager(Ptr< VsaManager > vsaManager)
std::vector< Ptr< NetDevice > >::const_iterator Iterator
NetDevice container iterator.
void AddMac(uint32_t channelNumber, Ptr< OcbWifiMac > mac)
Print everything.
Definition: log.h:112
virtual void ConfigureStandard(WifiPhyStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
Definition: wifi-phy.cc:1147
void SetChannelCoordinator(Ptr< ChannelCoordinator > channelCoordinator)
Iterator End(void) const
Get an iterator which indicates past-the-last NetDevice in the container.
handle packet fragmentation and retransmissions.
Definition: dca-txop.h:58
PcapHelper::DataLinkType GetPcapDataLinkType(void) const
Get the data link type of PCAP traces to be used.
Definition: wifi-helper.cc:585
static void AsciiPhyTransmitSinkWithContext(Ptr< OutputStreamWrapper > stream, std::string context, Ptr< const Packet > p, WifiMode mode, WifiPreamble preamble, uint8_t txLevel)
ASCII Phy transmit sink with context.
Definition: wave-helper.cc:49
std::ostream * GetStream(void)
Return a pointer to an ostream previously set in the wrapper.
This class will assign channel access for requests from higher layers.
uint32_t m_physNumber
Phy number.
Definition: wave-helper.h:250
static void AsciiPhyTransmitSinkWithoutContext(Ptr< OutputStreamWrapper > stream, Ptr< const Packet > p, WifiMode mode, WifiPreamble preamble, uint8_t txLevel)
ASCII Phy transmit sink without context.
Definition: wave-helper.cc:70