A Discrete-Event Network Simulator
API
wifi-helper.cc
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 #include "ns3/wifi-net-device.h"
24 #include "ns3/minstrel-wifi-manager.h"
25 #include "ns3/minstrel-ht-wifi-manager.h"
26 #include "ns3/ap-wifi-mac.h"
27 #include "ns3/ampdu-subframe-header.h"
28 #include "ns3/mobility-model.h"
29 #include "ns3/log.h"
30 #include "ns3/pointer.h"
31 #include "ns3/radiotap-header.h"
32 #include "ns3/config.h"
33 #include "ns3/names.h"
34 #include "ns3/net-device-queue-interface.h"
35 #include "ns3/wifi-mac-queue.h"
36 #include "ns3/qos-utils.h"
37 #include "ns3/ht-configuration.h"
38 #include "ns3/vht-configuration.h"
39 #include "ns3/he-configuration.h"
40 #include "ns3/obss-pd-algorithm.h"
41 #include "wifi-helper.h"
42 
43 namespace ns3 {
44 
45 NS_LOG_COMPONENT_DEFINE ("WifiHelper");
46 
56 static void
59  std::string context,
61  WifiMode mode,
62  WifiPreamble preamble,
63  uint8_t txLevel)
64 {
65  NS_LOG_FUNCTION (stream << context << p << mode << preamble << txLevel);
66  *stream->GetStream () << "t " << Simulator::Now ().GetSeconds () << " " << context << " " << mode << " " << *p << std::endl;
67 }
68 
77 static void
81  WifiMode mode,
82  WifiPreamble preamble,
83  uint8_t txLevel)
84 {
85  NS_LOG_FUNCTION (stream << p << mode << preamble << txLevel);
86  *stream->GetStream () << "t " << Simulator::Now ().GetSeconds () << " " << mode << " " << *p << std::endl;
87 }
88 
98 static void
101  std::string context,
103  double snr,
104  WifiMode mode,
105  WifiPreamble preamble)
106 {
107  NS_LOG_FUNCTION (stream << context << p << snr << mode << preamble);
108  *stream->GetStream () << "r " << Simulator::Now ().GetSeconds () << " " << mode << "" << context << " " << *p << std::endl;
109 }
110 
119 static void
123  double snr,
124  WifiMode mode,
125  WifiPreamble preamble)
126 {
127  NS_LOG_FUNCTION (stream << p << snr << mode << preamble);
128  *stream->GetStream () << "r " << Simulator::Now ().GetSeconds () << " " << mode << " " << *p << std::endl;
129 }
130 
132  : m_pcapDlt (PcapHelper::DLT_IEEE802_11)
133 {
134  SetPreambleDetectionModel ("ns3::ThresholdPreambleDetectionModel");
135 }
136 
138 {
139 }
140 
141 void
142 WifiPhyHelper::Set (std::string name, const AttributeValue &v)
143 {
144  m_phy.Set (name, v);
145 }
146 
147 void
149  std::string n0, const AttributeValue &v0,
150  std::string n1, const AttributeValue &v1,
151  std::string n2, const AttributeValue &v2,
152  std::string n3, const AttributeValue &v3,
153  std::string n4, const AttributeValue &v4,
154  std::string n5, const AttributeValue &v5,
155  std::string n6, const AttributeValue &v6,
156  std::string n7, const AttributeValue &v7)
157 {
160  m_errorRateModel.Set (n0, v0);
161  m_errorRateModel.Set (n1, v1);
162  m_errorRateModel.Set (n2, v2);
163  m_errorRateModel.Set (n3, v3);
164  m_errorRateModel.Set (n4, v4);
165  m_errorRateModel.Set (n5, v5);
166  m_errorRateModel.Set (n6, v6);
167  m_errorRateModel.Set (n7, v7);
168 }
169 
170 void
172  std::string n0, const AttributeValue &v0,
173  std::string n1, const AttributeValue &v1,
174  std::string n2, const AttributeValue &v2,
175  std::string n3, const AttributeValue &v3,
176  std::string n4, const AttributeValue &v4,
177  std::string n5, const AttributeValue &v5,
178  std::string n6, const AttributeValue &v6,
179  std::string n7, const AttributeValue &v7)
180 {
183  m_frameCaptureModel.Set (n0, v0);
184  m_frameCaptureModel.Set (n1, v1);
185  m_frameCaptureModel.Set (n2, v2);
186  m_frameCaptureModel.Set (n3, v3);
187  m_frameCaptureModel.Set (n4, v4);
188  m_frameCaptureModel.Set (n5, v5);
189  m_frameCaptureModel.Set (n6, v6);
190  m_frameCaptureModel.Set (n7, v7);
191 }
192 
193 void
195  std::string n0, const AttributeValue &v0,
196  std::string n1, const AttributeValue &v1,
197  std::string n2, const AttributeValue &v2,
198  std::string n3, const AttributeValue &v3,
199  std::string n4, const AttributeValue &v4,
200  std::string n5, const AttributeValue &v5,
201  std::string n6, const AttributeValue &v6,
202  std::string n7, const AttributeValue &v7)
203 {
206  m_preambleDetectionModel.Set (n0, v0);
207  m_preambleDetectionModel.Set (n1, v1);
208  m_preambleDetectionModel.Set (n2, v2);
209  m_preambleDetectionModel.Set (n3, v3);
210  m_preambleDetectionModel.Set (n4, v4);
211  m_preambleDetectionModel.Set (n5, v5);
212  m_preambleDetectionModel.Set (n6, v6);
213  m_preambleDetectionModel.Set (n7, v7);
214 }
215 
216 void
218 {
220 }
221 
222 void
225  Ptr<const Packet> packet,
226  uint16_t channelFreqMhz,
227  WifiTxVector txVector,
228  MpduInfo aMpdu)
229 {
230  uint32_t dlt = file->GetDataLinkType ();
231  switch (dlt)
232  {
234  file->Write (Simulator::Now (), packet);
235  return;
237  {
238  NS_FATAL_ERROR ("PcapSniffTxEvent(): DLT_PRISM_HEADER not implemented");
239  return;
240  }
242  {
243  Ptr<Packet> p = packet->Copy ();
244  RadiotapHeader header = GetRadiotapHeader (p, channelFreqMhz, txVector, aMpdu);
245  p->AddHeader (header);
246  file->Write (Simulator::Now (), p);
247  return;
248  }
249  default:
250  NS_ABORT_MSG ("PcapSniffTxEvent(): Unexpected data link type " << dlt);
251  }
252 }
253 
254 void
257  Ptr<const Packet> packet,
258  uint16_t channelFreqMhz,
259  WifiTxVector txVector,
260  MpduInfo aMpdu,
261  SignalNoiseDbm signalNoise)
262 {
263  uint32_t dlt = file->GetDataLinkType ();
264  switch (dlt)
265  {
267  file->Write (Simulator::Now (), packet);
268  return;
270  {
271  NS_FATAL_ERROR ("PcapSniffRxEvent(): DLT_PRISM_HEADER not implemented");
272  return;
273  }
275  {
276  Ptr<Packet> p = packet->Copy ();
277  RadiotapHeader header = GetRadiotapHeader (p, channelFreqMhz, txVector, aMpdu);
278  header.SetAntennaSignalPower (signalNoise.signal);
279  header.SetAntennaNoisePower (signalNoise.noise);
280  p->AddHeader (header);
281  file->Write (Simulator::Now (), p);
282  return;
283  }
284  default:
285  NS_ABORT_MSG ("PcapSniffRxEvent(): Unexpected data link type " << dlt);
286  }
287 }
288 
291  Ptr<Packet> packet,
292  uint16_t channelFreqMhz,
293  WifiTxVector txVector,
294  MpduInfo aMpdu)
295 {
296  RadiotapHeader header;
297  WifiPreamble preamble = txVector.GetPreambleType ();
298 
299  uint8_t frameFlags = RadiotapHeader::FRAME_FLAG_NONE;
300  header.SetTsft (Simulator::Now ().GetMicroSeconds ());
301 
302  //Our capture includes the FCS, so we set the flag to say so.
304 
305  if (preamble == WIFI_PREAMBLE_SHORT)
306  {
308  }
309 
310  if (txVector.GetGuardInterval () == 400)
311  {
313  }
314 
315  header.SetFrameFlags (frameFlags);
316 
317  uint64_t rate = 0;
318  if (txVector.GetMode ().GetModulationClass () != WIFI_MOD_CLASS_HT
319  && txVector.GetMode ().GetModulationClass () != WIFI_MOD_CLASS_VHT
320  && txVector.GetMode ().GetModulationClass () != WIFI_MOD_CLASS_HE)
321  {
322  rate = txVector.GetMode ().GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), 1) * txVector.GetNss () / 500000;
323  header.SetRate (static_cast<uint8_t> (rate));
324  }
325 
326  uint16_t channelFlags = 0;
327  switch (rate)
328  {
329  case 2: //1Mbps
330  case 4: //2Mbps
331  case 10: //5Mbps
332  case 22: //11Mbps
333  channelFlags |= RadiotapHeader::CHANNEL_FLAG_CCK;
334  break;
335  default:
336  channelFlags |= RadiotapHeader::CHANNEL_FLAG_OFDM;
337  break;
338  }
339 
340  if (channelFreqMhz < 2500)
341  {
343  }
344  else
345  {
347  }
348 
349  header.SetChannelFrequencyAndFlags (channelFreqMhz, channelFlags);
350 
351  if (txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HT)
352  {
353  uint8_t mcsKnown = RadiotapHeader::MCS_KNOWN_NONE;
354  uint8_t mcsFlags = RadiotapHeader::MCS_FLAGS_NONE;
355 
357 
359  if (txVector.GetChannelWidth () == 40)
360  {
362  }
363 
365  if (txVector.GetGuardInterval () == 400)
366  {
368  }
369 
371  if (preamble == WIFI_PREAMBLE_HT_GF)
372  {
374  }
375 
376  mcsKnown |= RadiotapHeader::MCS_KNOWN_NESS;
377  if (txVector.GetNess () & 0x01) //bit 1
378  {
380  }
381  if (txVector.GetNess () & 0x02) //bit 2
382  {
384  }
385 
386  mcsKnown |= RadiotapHeader::MCS_KNOWN_FEC_TYPE; //only BCC is currently supported
387 
388  mcsKnown |= RadiotapHeader::MCS_KNOWN_STBC;
389  if (txVector.IsStbc ())
390  {
392  }
393 
394  header.SetMcsFields (mcsKnown, mcsFlags, txVector.GetMode ().GetMcsValue ());
395  }
396 
397  if (txVector.IsAggregation ())
398  {
399  uint16_t ampduStatusFlags = RadiotapHeader::A_MPDU_STATUS_NONE;
400  ampduStatusFlags |= RadiotapHeader::A_MPDU_STATUS_LAST_KNOWN;
401  /* For PCAP file, MPDU Delimiter and Padding should be removed by the MAC Driver */
403  uint32_t extractedLength;
404  packet->RemoveHeader (hdr);
405  extractedLength = hdr.GetLength ();
406  packet = packet->CreateFragment (0, static_cast<uint32_t> (extractedLength));
407  if (aMpdu.type == LAST_MPDU_IN_AGGREGATE || (hdr.GetEof () == true && hdr.GetLength () > 0))
408  {
409  ampduStatusFlags |= RadiotapHeader::A_MPDU_STATUS_LAST;
410  }
411  header.SetAmpduStatus (aMpdu.mpduRefNumber, ampduStatusFlags, 1 /*CRC*/);
412  }
413 
414  if (txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_VHT)
415  {
416  uint16_t vhtKnown = RadiotapHeader::VHT_KNOWN_NONE;
417  uint8_t vhtFlags = RadiotapHeader::VHT_FLAGS_NONE;
418  uint8_t vhtBandwidth = 0;
419  uint8_t vhtMcsNss[4] = {0,0,0,0};
420  uint8_t vhtCoding = 0;
421  uint8_t vhtGroupId = 0;
422  uint16_t vhtPartialAid = 0;
423 
424  vhtKnown |= RadiotapHeader::VHT_KNOWN_STBC;
425  if (txVector.IsStbc ())
426  {
427  vhtFlags |= RadiotapHeader::VHT_FLAGS_STBC;
428  }
429 
431  if (txVector.GetGuardInterval () == 400)
432  {
434  }
435 
436  vhtKnown |= RadiotapHeader::VHT_KNOWN_BEAMFORMED; //Beamforming is currently not supported
437 
439  //not all bandwidth values are currently supported
440  if (txVector.GetChannelWidth () == 40)
441  {
442  vhtBandwidth = 1;
443  }
444  else if (txVector.GetChannelWidth () == 80)
445  {
446  vhtBandwidth = 4;
447  }
448  else if (txVector.GetChannelWidth () == 160)
449  {
450  vhtBandwidth = 11;
451  }
452 
453  //only SU PPDUs are currently supported
454  vhtMcsNss[0] |= (txVector.GetNss () & 0x0f);
455  vhtMcsNss[0] |= ((txVector.GetMode ().GetMcsValue () << 4) & 0xf0);
456 
457  header.SetVhtFields (vhtKnown, vhtFlags, vhtBandwidth, vhtMcsNss, vhtCoding, vhtGroupId, vhtPartialAid);
458  }
459 
460  if (txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HE)
461  {
463  if (preamble == WIFI_PREAMBLE_HE_ER_SU)
464  {
466  }
467  else if (preamble == WIFI_PREAMBLE_HE_MU)
468  {
470  }
471  else if (preamble == WIFI_PREAMBLE_HE_TB)
472  {
474  }
475 
477 
478  uint16_t data3 = 0;
479  if (txVector.IsStbc ())
480  {
482  }
483 
484  uint16_t data5 = 0;
485  if (txVector.GetChannelWidth () == 40)
486  {
488  }
489  else if (txVector.GetChannelWidth () == 80)
490  {
492  }
493  else if (txVector.GetChannelWidth () == 160)
494  {
496  }
497  if (txVector.GetGuardInterval () == 1600)
498  {
500  }
501  else if (txVector.GetGuardInterval () == 3200)
502  {
504  }
505 
506  header.SetHeFields (data1, data2, data3, data5);
507  }
508 
509  return header;
510 }
511 
512 void
514 {
515  switch (dlt)
516  {
517  case DLT_IEEE802_11:
519  return;
520  case DLT_PRISM_HEADER:
522  return;
525  return;
526  default:
527  NS_ABORT_MSG ("WifiPhyHelper::SetPcapFormat(): Unexpected format");
528  }
529 }
530 
533 {
534  return m_pcapDlt;
535 }
536 
537 void
538 WifiPhyHelper::EnablePcapInternal (std::string prefix, Ptr<NetDevice> nd, bool promiscuous, bool explicitFilename)
539 {
540  NS_LOG_FUNCTION (this << prefix << nd << promiscuous << explicitFilename);
541 
542  //All of the Pcap enable functions vector through here including the ones
543  //that are wandering through all of devices on perhaps all of the nodes in
544  //the system. We can only deal with devices of type WifiNetDevice.
545  Ptr<WifiNetDevice> device = nd->GetObject<WifiNetDevice> ();
546  if (device == 0)
547  {
548  NS_LOG_INFO ("WifiHelper::EnablePcapInternal(): Device " << &device << " not of type ns3::WifiNetDevice");
549  return;
550  }
551 
552  Ptr<WifiPhy> phy = device->GetPhy ();
553  NS_ABORT_MSG_IF (phy == 0, "WifiPhyHelper::EnablePcapInternal(): Phy layer in WifiNetDevice must be set");
554 
555  PcapHelper pcapHelper;
556 
557  std::string filename;
558  if (explicitFilename)
559  {
560  filename = prefix;
561  }
562  else
563  {
564  filename = pcapHelper.GetFilenameFromDevice (prefix, device);
565  }
566 
567  Ptr<PcapFileWrapper> file = pcapHelper.CreateFile (filename, std::ios::out, m_pcapDlt);
568 
569  phy->TraceConnectWithoutContext ("MonitorSnifferTx", MakeBoundCallback (&WifiPhyHelper::PcapSniffTxEvent, file));
570  phy->TraceConnectWithoutContext ("MonitorSnifferRx", MakeBoundCallback (&WifiPhyHelper::PcapSniffRxEvent, file));
571 }
572 
573 void
576  std::string prefix,
577  Ptr<NetDevice> nd,
578  bool explicitFilename)
579 {
580  //All of the ascii enable functions vector through here including the ones
581  //that are wandering through all of devices on perhaps all of the nodes in
582  //the system. We can only deal with devices of type WifiNetDevice.
583  Ptr<WifiNetDevice> device = nd->GetObject<WifiNetDevice> ();
584  if (device == 0)
585  {
586  NS_LOG_INFO ("WifiHelper::EnableAsciiInternal(): Device " << device << " not of type ns3::WifiNetDevice");
587  return;
588  }
589 
590  //Our trace sinks are going to use packet printing, so we have to make sure
591  //that is turned on.
593 
594  uint32_t nodeid = nd->GetNode ()->GetId ();
595  uint32_t deviceid = nd->GetIfIndex ();
596  std::ostringstream oss;
597 
598  //If we are not provided an OutputStreamWrapper, we are expected to create
599  //one using the usual trace filename conventions and write our traces
600  //without a context since there will be one file per context and therefore
601  //the context would be redundant.
602  if (stream == 0)
603  {
604  //Set up an output stream object to deal with private ofstream copy
605  //constructor and lifetime issues. Let the helper decide the actual
606  //name of the file given the prefix.
607  AsciiTraceHelper asciiTraceHelper;
608 
609  std::string filename;
610  if (explicitFilename)
611  {
612  filename = prefix;
613  }
614  else
615  {
616  filename = asciiTraceHelper.GetFilenameFromDevice (prefix, device);
617  }
618 
619  Ptr<OutputStreamWrapper> theStream = asciiTraceHelper.CreateFileStream (filename);
620  //We could go poking through the phy and the state looking for the
621  //correct trace source, but we can let Config deal with that with
622  //some search cost. Since this is presumably happening at topology
623  //creation time, it doesn't seem much of a price to pay.
624  oss.str ("");
625  oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WifiNetDevice/Phy/State/RxOk";
627 
628  oss.str ("");
629  oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WifiNetDevice/Phy/State/Tx";
631 
632  return;
633  }
634 
635  //If we are provided an OutputStreamWrapper, we are expected to use it, and
636  //to provide a context. We are free to come up with our own context if we
637  //want, and use the AsciiTraceHelper Hook*WithContext functions, but for
638  //compatibility and simplicity, we just use Config::Connect and let it deal
639  //with coming up with a context.
640  oss.str ("");
641  oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WifiNetDevice/Phy/State/RxOk";
643 
644  oss.str ("");
645  oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WifiNetDevice/Phy/State/Tx";
647 }
648 
650 {
651 }
652 
654  : m_standard (WIFI_PHY_STANDARD_80211a),
655  m_selectQueueCallback (&SelectQueueByDSField)
656 {
657  SetRemoteStationManager ("ns3::ArfWifiManager");
658 }
659 
660 void
662  std::string n0, const AttributeValue &v0,
663  std::string n1, const AttributeValue &v1,
664  std::string n2, const AttributeValue &v2,
665  std::string n3, const AttributeValue &v3,
666  std::string n4, const AttributeValue &v4,
667  std::string n5, const AttributeValue &v5,
668  std::string n6, const AttributeValue &v6,
669  std::string n7, const AttributeValue &v7)
670 {
673  m_stationManager.Set (n0, v0);
674  m_stationManager.Set (n1, v1);
675  m_stationManager.Set (n2, v2);
676  m_stationManager.Set (n3, v3);
677  m_stationManager.Set (n4, v4);
678  m_stationManager.Set (n5, v5);
679  m_stationManager.Set (n6, v6);
680  m_stationManager.Set (n7, v7);
681 }
682 
683 void
685  std::string n0, const AttributeValue &v0,
686  std::string n1, const AttributeValue &v1,
687  std::string n2, const AttributeValue &v2,
688  std::string n3, const AttributeValue &v3,
689  std::string n4, const AttributeValue &v4,
690  std::string n5, const AttributeValue &v5,
691  std::string n6, const AttributeValue &v6,
692  std::string n7, const AttributeValue &v7)
693 {
696  m_obssPdAlgorithm.Set (n0, v0);
697  m_obssPdAlgorithm.Set (n1, v1);
698  m_obssPdAlgorithm.Set (n2, v2);
699  m_obssPdAlgorithm.Set (n3, v3);
700  m_obssPdAlgorithm.Set (n4, v4);
701  m_obssPdAlgorithm.Set (n5, v5);
702  m_obssPdAlgorithm.Set (n6, v6);
703  m_obssPdAlgorithm.Set (n7, v7);
704 }
705 
706 void
708 {
709  m_standard = standard;
710 }
711 
712 void
714 {
716 }
717 
720  const WifiMacHelper &macHelper,
722  NodeContainer::Iterator last) const
723 {
725  for (NodeContainer::Iterator i = first; i != last; ++i)
726  {
727  Ptr<Node> node = *i;
728  Ptr<WifiNetDevice> device = CreateObject<WifiNetDevice> ();
730  {
731  Ptr<HtConfiguration> htConfiguration = CreateObject<HtConfiguration> ();
732  device->SetHtConfiguration (htConfiguration);
733  }
735  {
736  Ptr<VhtConfiguration> vhtConfiguration = CreateObject<VhtConfiguration> ();
737  device->SetVhtConfiguration (vhtConfiguration);
738  }
740  {
741  Ptr<HeConfiguration> heConfiguration = CreateObject<HeConfiguration> ();
742  device->SetHeConfiguration (heConfiguration);
743  }
745  Ptr<WifiMac> mac = macHelper.Create (device);
746  Ptr<WifiPhy> phy = phyHelper.Create (node, device);
747  mac->SetAddress (Mac48Address::Allocate ());
748  mac->ConfigureStandard (m_standard);
749  phy->ConfigureStandard (m_standard);
750  device->SetMac (mac);
751  device->SetPhy (phy);
752  device->SetRemoteStationManager (manager);
753  node->AddDevice (device);
755  {
757  device->AggregateObject (obssPdAlgorithm);
758  obssPdAlgorithm->ConnectWifiNetDevice (device);
759  }
760  devices.Add (device);
761  NS_LOG_DEBUG ("node=" << node << ", mob=" << node->GetObject<MobilityModel> ());
762  // Aggregate a NetDeviceQueueInterface object if a RegularWifiMac is installed
763  Ptr<RegularWifiMac> rmac = DynamicCast<RegularWifiMac> (mac);
764  if (rmac)
765  {
767  BooleanValue qosSupported;
768  PointerValue ptr;
769  Ptr<WifiMacQueue> wmq;
770 
771  rmac->GetAttributeFailSafe ("QosSupported", qosSupported);
772  if (qosSupported.Get ())
773  {
774  ndqi = CreateObjectWithAttributes<NetDeviceQueueInterface> ("NTxQueues",
775  UintegerValue (4));
776 
777  rmac->GetAttributeFailSafe ("BE_Txop", ptr);
778  wmq = ptr.Get<QosTxop> ()->GetWifiMacQueue ();
779  ndqi->GetTxQueue (0)->ConnectQueueTraces (wmq);
780 
781  rmac->GetAttributeFailSafe ("BK_Txop", ptr);
782  wmq = ptr.Get<QosTxop> ()->GetWifiMacQueue ();
783  ndqi->GetTxQueue (1)->ConnectQueueTraces (wmq);
784 
785  rmac->GetAttributeFailSafe ("VI_Txop", ptr);
786  wmq = ptr.Get<QosTxop> ()->GetWifiMacQueue ();
787  ndqi->GetTxQueue (2)->ConnectQueueTraces (wmq);
788 
789  rmac->GetAttributeFailSafe ("VO_Txop", ptr);
790  wmq = ptr.Get<QosTxop> ()->GetWifiMacQueue ();
791  ndqi->GetTxQueue (3)->ConnectQueueTraces (wmq);
792  ndqi->SetSelectQueueCallback (m_selectQueueCallback);
793  }
794  else
795  {
796  ndqi = CreateObject<NetDeviceQueueInterface> ();
797 
798  rmac->GetAttributeFailSafe ("Txop", ptr);
799  wmq = ptr.Get<Txop> ()->GetWifiMacQueue ();
800  ndqi->GetTxQueue (0)->ConnectQueueTraces (wmq);
801  }
802  device->AggregateObject (ndqi);
803  }
804  }
805  return devices;
806 }
807 
810  const WifiMacHelper &macHelper, NodeContainer c) const
811 {
812  return Install (phyHelper, macHelper, c.Begin (), c.End ());
813 }
814 
817  const WifiMacHelper &mac, Ptr<Node> node) const
818 {
819  return Install (phy, mac, NodeContainer (node));
820 }
821 
824  const WifiMacHelper &mac, std::string nodeName) const
825 {
826  Ptr<Node> node = Names::Find<Node> (nodeName);
827  return Install (phy, mac, NodeContainer (node));
828 }
829 
830 void
832 {
835 
836  LogComponentEnable ("AarfWifiManager", LOG_LEVEL_ALL);
837  LogComponentEnable ("AarfcdWifiManager", LOG_LEVEL_ALL);
838  LogComponentEnable ("AdhocWifiMac", LOG_LEVEL_ALL);
839  LogComponentEnable ("AmrrWifiManager", LOG_LEVEL_ALL);
840  LogComponentEnable ("ApWifiMac", LOG_LEVEL_ALL);
841  LogComponentEnable ("AparfWifiManager", LOG_LEVEL_ALL);
842  LogComponentEnable ("ArfWifiManager", LOG_LEVEL_ALL);
843  LogComponentEnable ("BlockAckAgreement", LOG_LEVEL_ALL);
844  LogComponentEnable ("BlockAckCache", LOG_LEVEL_ALL);
845  LogComponentEnable ("BlockAckManager", LOG_LEVEL_ALL);
846  LogComponentEnable ("CaraWifiManager", LOG_LEVEL_ALL);
847  LogComponentEnable ("ConstantObssPdAlgorithm", LOG_LEVEL_ALL);
848  LogComponentEnable ("ConstantRateWifiManager", LOG_LEVEL_ALL);
850  LogComponentEnable ("ChannelAccessManager", LOG_LEVEL_ALL);
851  LogComponentEnable ("DsssErrorRateModel", LOG_LEVEL_ALL);
852  LogComponentEnable ("QosTxop", LOG_LEVEL_ALL);
853  LogComponentEnable ("IdealWifiManager", LOG_LEVEL_ALL);
854  LogComponentEnable ("InfrastructureWifiMac", LOG_LEVEL_ALL);
855  LogComponentEnable ("InterferenceHelper", LOG_LEVEL_ALL);
856  LogComponentEnable ("MacLow", LOG_LEVEL_ALL);
857  LogComponentEnable ("MacRxMiddle", LOG_LEVEL_ALL);
858  LogComponentEnable ("MacTxMiddle", LOG_LEVEL_ALL);
859  LogComponentEnable ("MinstrelHtWifiManager", LOG_LEVEL_ALL);
860  LogComponentEnable ("MinstrelWifiManager", LOG_LEVEL_ALL);
861  LogComponentEnable ("MpduAggregator", LOG_LEVEL_ALL);
862  LogComponentEnable ("MsduAggregator", LOG_LEVEL_ALL);
863  LogComponentEnable ("NistErrorRateModel", LOG_LEVEL_ALL);
864  LogComponentEnable ("ObssPdAlgorithm", LOG_LEVEL_ALL);
865  LogComponentEnable ("OnoeWifiManager", LOG_LEVEL_ALL);
866  LogComponentEnable ("ParfWifiManager", LOG_LEVEL_ALL);
867  LogComponentEnable ("RegularWifiMac", LOG_LEVEL_ALL);
868  LogComponentEnable ("RraaWifiManager", LOG_LEVEL_ALL);
869  LogComponentEnable ("RrpaaWifiManager", LOG_LEVEL_ALL);
870  LogComponentEnable ("SimpleFrameCaptureModel", LOG_LEVEL_ALL);
871  LogComponentEnable ("SpectrumWifiPhy", LOG_LEVEL_ALL);
872  LogComponentEnable ("StaWifiMac", LOG_LEVEL_ALL);
873  LogComponentEnable ("SupportedRates", LOG_LEVEL_ALL);
874  LogComponentEnable ("ThresholdPreambleDetectionModel", LOG_LEVEL_ALL);
875  LogComponentEnable ("WifiMac", LOG_LEVEL_ALL);
876  LogComponentEnable ("WifiMacQueueItem", LOG_LEVEL_ALL);
877  LogComponentEnable ("WifiNetDevice", LOG_LEVEL_ALL);
878  LogComponentEnable ("WifiPhyStateHelper", LOG_LEVEL_ALL);
879  LogComponentEnable ("WifiPhy", LOG_LEVEL_ALL);
880  LogComponentEnable ("WifiRadioEnergyModel", LOG_LEVEL_ALL);
881  LogComponentEnable ("WifiRemoteStationManager", LOG_LEVEL_ALL);
882  LogComponentEnable ("WifiSpectrumPhyInterface", LOG_LEVEL_ALL);
883  LogComponentEnable ("WifiSpectrumSignalParameters", LOG_LEVEL_ALL);
884  LogComponentEnable ("WifiTxCurrentModel", LOG_LEVEL_ALL);
885  LogComponentEnable ("YansErrorRateModel", LOG_LEVEL_ALL);
886  LogComponentEnable ("YansWifiChannel", LOG_LEVEL_ALL);
887  LogComponentEnable ("YansWifiPhy", LOG_LEVEL_ALL);
888 }
889 
890 int64_t
892 {
893  int64_t currentStream = stream;
894  Ptr<NetDevice> netDevice;
895  for (NetDeviceContainer::Iterator i = c.Begin (); i != c.End (); ++i)
896  {
897  netDevice = (*i);
898  Ptr<WifiNetDevice> wifi = DynamicCast<WifiNetDevice> (netDevice);
899  if (wifi)
900  {
901  //Handle any random numbers in the PHY objects.
902  currentStream += wifi->GetPhy ()->AssignStreams (currentStream);
903 
904  //Handle any random numbers in the station managers.
905  Ptr<WifiRemoteStationManager> manager = wifi->GetRemoteStationManager ();
906  Ptr<MinstrelWifiManager> minstrel = DynamicCast<MinstrelWifiManager> (manager);
907  if (minstrel)
908  {
909  currentStream += minstrel->AssignStreams (currentStream);
910  }
911 
912  Ptr<MinstrelHtWifiManager> minstrelHt = DynamicCast<MinstrelHtWifiManager> (manager);
913  if (minstrelHt)
914  {
915  currentStream += minstrelHt->AssignStreams (currentStream);
916  }
917 
918  //Handle any random numbers in the MAC objects.
919  Ptr<WifiMac> mac = wifi->GetMac ();
920  Ptr<RegularWifiMac> rmac = DynamicCast<RegularWifiMac> (mac);
921  if (rmac)
922  {
923  PointerValue ptr;
924  rmac->GetAttribute ("Txop", ptr);
925  Ptr<Txop> txop = ptr.Get<Txop> ();
926  currentStream += txop->AssignStreams (currentStream);
927 
928  rmac->GetAttribute ("VO_Txop", ptr);
929  Ptr<QosTxop> vo_txop = ptr.Get<QosTxop> ();
930  currentStream += vo_txop->AssignStreams (currentStream);
931 
932  rmac->GetAttribute ("VI_Txop", ptr);
933  Ptr<QosTxop> vi_txop = ptr.Get<QosTxop> ();
934  currentStream += vi_txop->AssignStreams (currentStream);
935 
936  rmac->GetAttribute ("BE_Txop", ptr);
937  Ptr<QosTxop> be_txop = ptr.Get<QosTxop> ();
938  currentStream += be_txop->AssignStreams (currentStream);
939 
940  rmac->GetAttribute ("BK_Txop", ptr);
941  Ptr<QosTxop> bk_txop = ptr.Get<QosTxop> ();
942  currentStream += bk_txop->AssignStreams (currentStream);
943 
944  //if an AP, handle any beacon jitter
945  Ptr<ApWifiMac> apmac = DynamicCast<ApWifiMac> (rmac);
946  if (apmac)
947  {
948  currentStream += apmac->AssignStreams (currentStream);
949  }
950  }
951  }
952  }
953  return (currentStream - stream);
954 }
955 
956 } //namespace ns3
virtual ~WifiPhyHelper()
Definition: wifi-helper.cc:137
MpduInfo structure.
Definition: wifi-phy.h:71
WifiPhyStandard m_standard
wifi standard
Definition: wifi-helper.h:474
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Definition: packet.cc:280
Frame used short guard interval (HT)
void Set(std::string name, const AttributeValue &v)
Definition: wifi-helper.cc:142
void SetVhtFields(uint16_t known, uint8_t flags, uint8_t bandwidth, uint8_t mcs_nss [4], uint8_t coding, uint8_t group_id, uint16_t partial_aid)
Set the VHT fields.
void SetPreambleDetectionModel(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:194
double signal
in dBm
Definition: wifi-phy.h:66
bool IsAggregation(void) const
Checks whether the PSDU contains A-MPDU.
Prefix all trace prints with simulation node.
Definition: log.h:119
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 "...
AttributeValue implementation for Boolean.
Definition: boolean.h:36
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition: abort.h:50
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Beamformed known/applicable (this flag should be set to zero for MU PPDUs).
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer::Iterator first, NodeContainer::Iterator last) const
Definition: wifi-helper.cc:719
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
void SetObssPdAlgorithm(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:684
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:661
Iterator End(void) const
Get an iterator which indicates past-the-last NetDevice in the container.
Radiotap header implementation.
virtual ~WifiHelper()
Definition: wifi-helper.cc:649
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:44
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
Definition: callback.h:1686
PcapHelper::DataLinkType m_pcapDlt
PCAP data link type.
Definition: wifi-helper.h:288
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
Definition: object.cc:252
Handle packet fragmentation and retransmissions for QoS data frames as well as MSDU aggregation (A-MS...
Definition: qos-txop.h:91
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:355
Ptr< Packet > CreateFragment(uint32_t start, uint32_t length) const
Create a new packet which contains a fragment of the original packet.
Definition: packet.cc:227
void SetHtConfiguration(Ptr< HtConfiguration > htConfiguration)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:204
HE PHY for the 2.4 GHz band (clause 26)
OBSS PD algorithm interfaceThis object provides the interface for all OBSS_PD algorithms and is desig...
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
bool IsStbc(void) const
Check if STBC is used or not.
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
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:280
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:162
uint8_t GetNess(void) const
uint16_t GetGuardInterval(void) const
Ptr< OutputStreamWrapper > CreateFileStream(std::string filename, std::ios::openmode filemode=std::ios::out)
Create and initialize an output stream object we&#39;ll use to write the traced bits. ...
HT PHY for the 2.4 GHz band (clause 20)
void SetAntennaNoisePower(double noise)
Set the RF noise power at the antenna as a decibel difference from an arbitrary, fixed reference...
VHT PHY (Clause 22)
Definition: wifi-mode.h:60
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
ObjectFactory m_errorRateModel
error rate model
Definition: wifi-helper.h:235
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...
Frame sent/received with short preamble.
void SetTsft(uint64_t tsft)
Set the Time Synchronization Function Timer (TSFT) value.
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
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:97
WifiHelper()
Create a Wifi helper in an empty state: all its parameters must be set before calling ns3::WifiHelper...
Definition: wifi-helper.cc:653
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:574
phy
Definition: third.py:93
ObjectFactory m_preambleDetectionModel
preamble detection model
Definition: wifi-helper.h:237
static void PcapSniffTxEvent(Ptr< PcapFileWrapper > file, Ptr< const Packet > packet, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu)
Definition: wifi-helper.cc:223
WifiPreamble GetPreambleType(void) const
DataLinkType
This enumeration holds the data link types that will be written to the pcap file. ...
Definition: trace-helper.h:50
void SetHeConfiguration(Ptr< HeConfiguration > heConfiguration)
virtual void SetStandard(WifiPhyStandard standard)
Definition: wifi-helper.cc:707
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition: wifi-preamble.h:32
Keep track of the current position and velocity of an object.
WifiPhyStandard
Identifies the PHY specification that a Wifi device is configured to use.
HE PHY for the 5 GHz band (clause 26)
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
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.
Definition: log.cc:369
static Mac48Address Allocate(void)
Allocate a new Mac48Address.
bool GetEof(void) const
Return the EOF field.
static void EnablePrinting(void)
Enable printing packets metadata.
Definition: packet.cc:572
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
void SetMac(const Ptr< WifiMac > mac)
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
Definition: txop.cc:321
Iterator Begin(void) const
Get an iterator which refers to the first NetDevice in the container.
This frame is the last subframe.
Hold an unsigned integer type.
Definition: uinteger.h:44
void SetChannelFrequencyAndFlags(uint16_t frequency, uint16_t flags)
Set the transmit/receive channel frequency and flags.
holds a vector of ns3::NetDevice pointers
mac
Definition: third.py:99
Ness - bit 0 (LSB) of Number of extension spatial streams.
static void PcapSniffRxEvent(Ptr< PcapFileWrapper > file, Ptr< const Packet > packet, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu, SignalNoiseDbm signalNoise)
Definition: wifi-helper.cc:255
void SetFrameCaptureModel(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:171
WifiMode GetMode(void) const
Introspection did not find any typical Config paths.
HT PHY (Clause 20)
Definition: wifi-mode.h:58
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:891
Hold together all Wifi-related objects.
void ConnectWithoutContext(std::string path, const CallbackBase &cb)
Definition: config.cc:860
ObjectFactory m_obssPdAlgorithm
OBSS PD algorithm.
Definition: wifi-helper.h:476
PcapHelper::DataLinkType GetPcapDataLinkType(void) const
Get the data link type of PCAP traces to be used.
Definition: wifi-helper.cc:532
hold a list of per-remote-station state.
WifiModulationClass GetModulationClass() const
Definition: wifi-mode.cc:494
void Connect(std::string path, const CallbackBase &cb)
Definition: config.cc:871
Include Prism monitor mode information.
Definition: wifi-helper.h:177
void SetFrameFlags(uint8_t flags)
Set the frame flags of the transmitted or received frame.
bool Get(void) const
Definition: boolean.cc:51
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:459
Ptr< WifiPhy > GetPhy(void) const
void SetRate(uint8_t rate)
Set the transmit/receive channel frequency in units of megahertz.
double f(double x, void *params)
Definition: 80211b.c:70
static RadiotapHeader GetRadiotapHeader(Ptr< Packet > packet, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu)
Get the radiotap header.
Definition: wifi-helper.cc:290
void LogComponentEnableAll(enum LogLevel level)
Enable the logging output for all registered log components.
Definition: log.cc:393
Prefix all trace prints with simulation time.
Definition: log.h:118
OFDM PHY for the 5 GHz band (Clause 17)
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<T>.
Definition: pointer.h:36
uint8_t SelectQueueByDSField(Ptr< QueueItem > item)
Determine the tx queue for a given packet.
Definition: qos-utils.cc:164
Ness data - bit 1 (MSB) of Number of extension spatial streams.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
Definition: packet.cc:121
SelectQueueCallback m_selectQueueCallback
select queue callback
Definition: wifi-helper.h:475
void SetMcsFields(uint8_t known, uint8_t flags, uint8_t mcs)
Set the MCS fields.
void Set(std::string name, const AttributeValue &value)
Set an attribute to be set during construction.
ObjectFactory m_stationManager
station manager
Definition: wifi-helper.h:473
create MAC layers for a ns3::WifiNetDevice.
Ness known (Number of extension spatial streams)
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:193
void SetPcapDataLinkType(SupportedPcapDataLinkTypes dlt)
Set the data link type of PCAP traces to be used.
Definition: wifi-helper.cc:513
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:148
bool IsTypeIdSet(void) const
Check if the ObjectFactory has been configured with a TypeId.
virtual void EnablePcapInternal(std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename)
Enable pcap output the indicated net device.
Definition: wifi-helper.cc:538
ObjectFactory m_phy
PHY object.
Definition: wifi-helper.h:234
virtual Ptr< WifiMac > Create(Ptr< NetDevice > device) const
Space-time block coding (1 if all spatial streams of all users have STBC, 0 otherwise).
wifi
Definition: third.py:96
Instantiate subclasses of ns3::Object.
void SetPhy(const Ptr< WifiPhy > phy)
Set if all spatial streams of all users have space-time block coding.
static void EnableLogComponents(void)
Helper to enable all WifiNetDevice log components with one statement.
Definition: wifi-helper.cc:831
virtual Ptr< WifiPhy > Create(Ptr< Node > node, Ptr< NetDevice > device) const =0
void SetSelectQueueCallback(SelectQueueCallback f)
Definition: wifi-helper.cc:713
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
SignalNoiseDbm structure.
Definition: wifi-phy.h:64
uint32_t mpduRefNumber
MPDU ref number.
Definition: wifi-phy.h:74
The MPDU is the last aggregate in an A-MPDU with muliple MPDUs.
std::vector< Ptr< NetDevice > >::const_iterator Iterator
NetDevice container iterator.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:272
IEEE 802.11 Wireless LAN headers on packets.
Definition: wifi-helper.h:176
Ptr< T > Get(void) const
Definition: pointer.h:194
uint16_t GetLength(void) const
Return the length field.
Last subframe is known (should be set for all subframes in an A-MPDU)
Print everything.
Definition: log.h:115
ObjectFactory m_frameCaptureModel
frame capture model
Definition: wifi-helper.h:236
double noise
in dBm
Definition: wifi-phy.h:67
std::function< std::size_t(Ptr< QueueItem >)> SelectQueueCallback
Callback invoked to determine the MAC queue selected for a given packet.
Definition: wifi-helper.h:379
uint16_t GetChannelWidth(void) const
Default: 20 MHz, long guard interval, mixed HT format and BCC FEC type.
SupportedPcapDataLinkTypes
An enumeration of the pcap data link types (DLTs) which this helper supports.
Definition: wifi-helper.h:174
devices
Definition: first.py:32
void DisablePreambleDetectionModel()
Disable the preamble detection model.
Definition: wifi-helper.cc:217
Definition: first.py:1
MpduType type
type
Definition: wifi-phy.h:73
uint8_t GetMcsValue(void) const
Definition: wifi-mode.cc:472
void SetAmpduStatus(uint32_t referenceNumber, uint16_t flags, uint8_t crc)
Set the A-MPDU status fields.
void SetHeFields(uint16_t data1, uint16_t data2, uint16_t data3, uint16_t data5)
Set the HE fields.
a unique identifier for an interface.
Definition: type-id.h:58
Include Radiotap link layer information.
Definition: wifi-helper.h:178
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
void SetVhtConfiguration(Ptr< VhtConfiguration > vhtConfiguration)
std::ostream * GetStream(void)
Return a pointer to an ostream previously set in the wrapper.
HE PHY (Clause 26)
Definition: wifi-mode.h:62
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
Definition: wifi-mode.cc:150
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:256
Iterator Begin(void) const
Get an iterator which refers to the first Node in the container.
uint8_t GetNss(void) const
void SetAntennaSignalPower(double signal)
Set the RF signal power at the antenna as a decibel difference from an arbitrary, fixed reference...
void SetRemoteStationManager(const Ptr< WifiRemoteStationManager > manager)
Handle packet fragmentation and retransmissions for data and management frames.
Definition: txop.h:65
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