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