A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-helper.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 INRIA
3 * Copyright (c) 2009 MIRKO BANCHI
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19 * Mirko Banchi <mk.banchi@gmail.com>
20 */
21
22#ifndef WIFI_HELPER_H
23#define WIFI_HELPER_H
24
25#include "wifi-mac-helper.h"
26
27#include "ns3/qos-utils.h"
28#include "ns3/trace-helper.h"
29#include "ns3/wifi-phy.h"
30
31#include <functional>
32#include <vector>
33
34namespace ns3
35{
36
37class WifiNetDevice;
38class Node;
39class RadiotapHeader;
40class QueueItem;
41
42/**
43 * \brief create PHY objects
44 *
45 * This base class must be implemented by new PHY implementation which wish to integrate
46 * with the \ref ns3::WifiHelper class.
47 */
49{
50 public:
51 /**
52 * Constructor
53 *
54 * \param nLinks the number of links to configure (>1 only for 11be devices)
55 */
56 WifiPhyHelper(uint8_t nLinks = 1);
57 ~WifiPhyHelper() override;
58
59 /**
60 * \param node the node on which the PHY object(s) will reside
61 * \param device the device within which the PHY object(s) will reside
62 *
63 * \returns new PHY objects.
64 *
65 * Subclasses must implement this method to allow the ns3::WifiHelper class
66 * to create PHY objects from ns3::WifiHelper::Install.
67 */
68 virtual std::vector<Ptr<WifiPhy>> Create(Ptr<Node> node, Ptr<WifiNetDevice> device) const = 0;
69
70 /**
71 * \param name the name of the attribute to set
72 * \param v the value of the attribute
73 *
74 * Set an attribute of all the underlying PHY object.
75 */
76 void Set(std::string name, const AttributeValue& v);
77
78 /**
79 * \param name the name of the attribute to set
80 * \param v the value of the attribute
81 * \param linkId ID of the link to configure (>0 only for 11be devices)
82 *
83 * Set an attribute of the given underlying PHY object.
84 */
85 void Set(uint8_t linkId, std::string name, const AttributeValue& v);
86
87 /**
88 * Helper function used to set the interference helper.
89 *
90 * \tparam Args \deduced Template type parameter pack for the sequence of name-value pairs.
91 * \param type the type of interference helper
92 * \param args A sequence of name-value pairs of the attributes to set.
93 */
94 template <typename... Args>
95 void SetInterferenceHelper(std::string type, Args&&... args);
96
97 /**
98 * Helper function used to set the error rate model.
99 *
100 * \tparam Args \deduced Template type parameter pack for the sequence of name-value pairs.
101 * \param type the type of error rate model
102 * \param args A sequence of name-value pairs of the attributes to set.
103 */
104 template <typename... Args>
105 void SetErrorRateModel(std::string type, Args&&... args);
106
107 /**
108 * \tparam Args \deduced Template type parameter pack for the sequence of name-value pairs.
109 * \param linkId ID of the link to configure (>0 only for 11be devices)
110 * \param type the type of the error rate model to set.
111 * \param args A sequence of name-value pairs of the attributes to set.
112 *
113 * Set the error rate model and its attributes to use for the given link when Install is called.
114 */
115 template <typename... Args>
116 void SetErrorRateModel(uint8_t linkId, std::string type, Args&&... args);
117
118 /**
119 * Helper function used to set the frame capture model.
120 *
121 * \tparam Args \deduced Template type parameter pack for the sequence of name-value pairs.
122 * \param type the type of frame capture model
123 * \param args A sequence of name-value pairs of the attributes to set.
124 */
125 template <typename... Args>
126 void SetFrameCaptureModel(std::string type, Args&&... args);
127
128 /**
129 * \tparam Args \deduced Template type parameter pack for the sequence of name-value pairs.
130 * \param linkId ID of the link to configure (>0 only for 11be devices)
131 * \param type the type of the frame capture model to set.
132 * \param args A sequence of name-value pairs of the attributes to set.
133 *
134 * Set the frame capture model and its attributes to use for the given link when Install is
135 * called.
136 */
137 template <typename... Args>
138 void SetFrameCaptureModel(uint8_t linkId, std::string type, Args&&... args);
139
140 /**
141 * Helper function used to set the preamble detection model.
142 *
143 * \tparam Args \deduced Template type parameter pack for the sequence of name-value pairs.
144 * \param type the type of preamble detection model
145 * \param args A sequence of name-value pairs of the attributes to set.
146 */
147 template <typename... Args>
148 void SetPreambleDetectionModel(std::string type, Args&&... args);
149
150 /**
151 * \tparam Args \deduced Template type parameter pack for the sequence of name-value pairs.
152 * \param linkId ID of the link to configure (>0 only for 11be devices)
153 * \param type the type of the preamble detection model to set.
154 * \param args A sequence of name-value pairs of the attributes to set.
155 *
156 * Set the preamble detection model and its attributes to use for the given link when Install is
157 * called.
158 */
159 template <typename... Args>
160 void SetPreambleDetectionModel(uint8_t linkId, std::string type, Args&&... args);
161
162 /**
163 * Disable the preamble detection model on all links.
164 */
166
167 /**
168 * An enumeration of the pcap data link types (DLTs) which this helper
169 * supports. See http://wiki.wireshark.org/Development/LibpcapFileFormat
170 * for more information on these formats.
171 */
173 {
175 PcapHelper::DLT_IEEE802_11, /**< IEEE 802.11 Wireless LAN headers on packets */
177 PcapHelper::DLT_PRISM_HEADER, /**< Include Prism monitor mode information */
179 PcapHelper::DLT_IEEE802_11_RADIO /**< Include Radiotap link layer information */
180 };
181
182 /**
183 * Set the data link type of PCAP traces to be used. This function has to be
184 * called before EnablePcap(), so that the header of the pcap file can be
185 * written correctly.
186 *
187 * \see SupportedPcapDataLinkTypes
188 *
189 * \param dlt The data link type of the pcap file (and packets) to be used
190 */
192
193 /**
194 * Get the data link type of PCAP traces to be used.
195 *
196 * \see SupportedPcapDataLinkTypes
197 *
198 * \returns The data link type of the pcap file (and packets) to be used
199 */
201
202 protected:
203 /**
204 * \param file the pcap file wrapper
205 * \param packet the packet
206 * \param channelFreqMhz the channel frequency
207 * \param txVector the TXVECTOR
208 * \param aMpdu the A-MPDU information
209 * \param staId the STA-ID (only used for MU)
210 *
211 * Handle TX pcap.
212 */
213 static void PcapSniffTxEvent(Ptr<PcapFileWrapper> file,
214 Ptr<const Packet> packet,
215 uint16_t channelFreqMhz,
216 WifiTxVector txVector,
217 MpduInfo aMpdu,
218 uint16_t staId = SU_STA_ID);
219 /**
220 * \param file the pcap file wrapper
221 * \param packet the packet
222 * \param channelFreqMhz the channel frequency
223 * \param txVector the TXVECTOR
224 * \param aMpdu the A-MPDU information
225 * \param signalNoise the RX signal and noise information
226 * \param staId the STA-ID (only used for MU)
227 *
228 * Handle RX pcap.
229 */
230 static void PcapSniffRxEvent(Ptr<PcapFileWrapper> file,
231 Ptr<const Packet> packet,
232 uint16_t channelFreqMhz,
233 WifiTxVector txVector,
234 MpduInfo aMpdu,
235 SignalNoiseDbm signalNoise,
236 uint16_t staId = SU_STA_ID);
237
238 std::vector<ObjectFactory> m_phys; ///< PHY objects
239 ObjectFactory m_interferenceHelper; ///< interference helper
240 std::vector<ObjectFactory> m_errorRateModel; ///< error rate model
241 std::vector<ObjectFactory> m_frameCaptureModel; ///< frame capture model
242 std::vector<ObjectFactory> m_preambleDetectionModel; ///< preamble detection model
243
244 private:
245 /**
246 * Get the Radiotap header for a transmitted packet.
247 *
248 * \param header the radiotap header to be filled in
249 * \param packet the packet
250 * \param channelFreqMhz the channel frequency
251 * \param txVector the TXVECTOR
252 * \param aMpdu the A-MPDU information
253 * \param staId the STA-ID
254 */
255 static void GetRadiotapHeader(RadiotapHeader& header,
256 Ptr<Packet> packet,
257 uint16_t channelFreqMhz,
258 WifiTxVector txVector,
259 MpduInfo aMpdu,
260 uint16_t staId);
261
262 /**
263 * Get the Radiotap header for a received packet.
264 *
265 * \param header the radiotap header to be filled in
266 * \param packet the packet
267 * \param channelFreqMhz the channel frequency
268 * \param txVector the TXVECTOR
269 * \param aMpdu the A-MPDU information
270 * \param staId the STA-ID
271 * \param signalNoise the rx signal and noise information
272 */
273 static void GetRadiotapHeader(RadiotapHeader& header,
274 Ptr<Packet> packet,
275 uint16_t channelFreqMhz,
276 WifiTxVector txVector,
277 MpduInfo aMpdu,
278 uint16_t staId,
279 SignalNoiseDbm signalNoise);
280
281 /**
282 * \brief Enable pcap output the indicated net device.
283 *
284 * NetDevice-specific implementation mechanism for hooking the trace and
285 * writing to the trace file.
286 *
287 * \param prefix Filename prefix to use for pcap files.
288 * \param nd Net device for which you want to enable tracing.
289 * \param promiscuous If true capture all possible packets available at the device.
290 * \param explicitFilename Treat the prefix as an explicit filename if true
291 */
292 void EnablePcapInternal(std::string prefix,
294 bool promiscuous,
295 bool explicitFilename) override;
296
297 /**
298 * \brief Enable ASCII trace output on the indicated net device.
299 *
300 * NetDevice-specific implementation mechanism for hooking the trace and
301 * writing to the trace file.
302 *
303 * \param stream The output stream object to use when logging ASCII traces.
304 * \param prefix Filename prefix to use for ASCII trace files.
305 * \param nd Net device for which you want to enable tracing.
306 * \param explicitFilename Treat the prefix as an explicit filename if true
307 */
309 std::string prefix,
311 bool explicitFilename) override;
312
313 PcapHelper::DataLinkType m_pcapDlt; ///< PCAP data link type
314};
315
316/**
317 * \brief helps to create WifiNetDevice objects
318 *
319 * This class can help to create a large set of similar
320 * WifiNetDevice objects and to configure a large set of
321 * their attributes during creation.
322 */
324{
325 public:
326 virtual ~WifiHelper();
327
328 /**
329 * Create a Wifi helper in an empty state: all its parameters
330 * must be set before calling ns3::WifiHelper::Install
331 *
332 * The default state is defined as being an Adhoc MAC layer with an ARF rate control algorithm
333 * and both objects using their default attribute values.
334 * By default, configure MAC and PHY for 802.11a.
335 */
336 WifiHelper();
337
338 /**
339 * Helper function used to set the station manager
340 *
341 * \tparam Args \deduced Template type parameter pack for the sequence of name-value pairs.
342 * \param type the type of station manager
343 * \param args A sequence of name-value pairs of the attributes to set.
344 */
345 template <typename... Args>
346 void SetRemoteStationManager(std::string type, Args&&... args);
347
348 /**
349 * \tparam Args \deduced Template type parameter pack for the sequence of name-value pairs.
350 * \param linkId ID of the link to configure (>0 only for 11be devices)
351 * \param type the type of the preamble detection model to set.
352 * \param args A sequence of name-value pairs of the attributes to set.
353 *
354 * Set the remote station manager model and its attributes to use for the given link.
355 * If the helper stored a remote station manager model for the first N links only
356 * (corresponding to link IDs from 0 to N-1) and the given linkId is M >= N, then a
357 * remote station manager model using the given attributes is configured for all links
358 * with ID from N to M.
359 */
360 template <typename... Args>
361 void SetRemoteStationManager(uint8_t linkId, std::string type, Args&&... args);
362
363 /**
364 * Helper function used to set the OBSS-PD algorithm
365 *
366 * \tparam Args \deduced Template type parameter pack for the sequence of name-value pairs.
367 * \param type the type of OBSS-PD algorithm
368 * \param args A sequence of name-value pairs of the attributes to set.
369 */
370 template <typename... Args>
371 void SetObssPdAlgorithm(std::string type, Args&&... args);
372
373 /// Callback invoked to determine the MAC queue selected for a given packet
374 typedef std::function<std::size_t(Ptr<QueueItem>)> SelectQueueCallback;
375
376 /**
377 * \param f the select queue callback
378 *
379 * Set the select queue callback to set on the NetDevice queue interface aggregated
380 * to the WifiNetDevice, in case WifiMac with QoS enabled is used
381 */
383
384 /**
385 * Disable flow control only if you know what you are doing. By disabling
386 * flow control, this NetDevice will be sent packets even if there is no
387 * room for them (such packets will be likely dropped by this NetDevice).
388 * Also, any queue disc installed on this NetDevice will have no effect,
389 * as every packet enqueued to the traffic control layer queue disc will
390 * be immediately dequeued.
391 */
392 void DisableFlowControl();
393
394 /**
395 * \param phy the PHY helper to create PHY objects
396 * \param mac the MAC helper to create MAC objects
397 * \param first lower bound on the set of nodes on which a wifi device must be created
398 * \param last upper bound on the set of nodes on which a wifi device must be created
399 * \returns a device container which contains all the devices created by this method.
400 */
401 NetDeviceContainer virtual Install(const WifiPhyHelper& phy,
402 const WifiMacHelper& mac,
404 NodeContainer::Iterator last) const;
405 /**
406 * \param phy the PHY helper to create PHY objects
407 * \param mac the MAC helper to create MAC objects
408 * \param c the set of nodes on which a wifi device must be created
409 * \returns a device container which contains all the devices created by this method.
410 */
411 virtual NetDeviceContainer Install(const WifiPhyHelper& phy,
412 const WifiMacHelper& mac,
413 NodeContainer c) const;
414 /**
415 * \param phy the PHY helper to create PHY objects
416 * \param mac the MAC helper to create MAC objects
417 * \param node the node on which a wifi device must be created
418 * \returns a device container which contains all the devices created by this method.
419 */
420 virtual NetDeviceContainer Install(const WifiPhyHelper& phy,
421 const WifiMacHelper& mac,
422 Ptr<Node> node) const;
423 /**
424 * \param phy the PHY helper to create PHY objects
425 * \param mac the MAC helper to create MAC objects
426 * \param nodeName the name of node on which a wifi device must be created
427 * \returns a device container which contains all the devices created by this method.
428 */
429 virtual NetDeviceContainer Install(const WifiPhyHelper& phy,
430 const WifiMacHelper& mac,
431 std::string nodeName) const;
432 /**
433 * \param standard the standard to configure during installation
434 *
435 * This method sets standards-compliant defaults for WifiMac
436 * parameters such as SIFS time, slot time, timeout values, etc.,
437 * based on the standard selected. It results in
438 * WifiMac::ConfigureStandard(standard) being called on each
439 * installed MAC object.
440 *
441 * The default standard of 802.11a will be applied if SetStandard()
442 * is not called.
443 *
444 * Note that WifiMac::ConfigureStandard () will overwrite certain
445 * defaults in the attribute system, so if a user wants to manipulate
446 * any default values affected by ConfigureStandard() while using this
447 * helper, the user should use a post-install configuration such as
448 * Config::Set() on any objects that this helper creates, such as:
449 * \code
450 * Config::Set ("/NodeList/0/DeviceList/0/$ns3::WifiNetDevice/Mac/Slot", TimeValue (MicroSeconds
451 * (slot))); \endcode
452 *
453 * \sa WifiMac::ConfigureStandard
454 * \sa Config::Set
455 */
456 virtual void SetStandard(WifiStandard standard);
457
458 /**
459 * Helper function used to configure the HT options listed as attributes of
460 * the HtConfiguration class.
461 *
462 * \tparam Args \deduced Template type parameter pack for the sequence of name-value pairs.
463 * \param args A sequence of name-value pairs of the attributes to set.
464 */
465 template <typename... Args>
466 void ConfigHtOptions(Args&&... args);
467
468 /**
469 * Helper function used to configure the VHT options listed as attributes of
470 * the VhtConfiguration class.
471 *
472 * \tparam Args \deduced Template type parameter pack for the sequence of name-value pairs.
473 * \param args A sequence of name-value pairs of the attributes to set.
474 */
475 template <typename... Args>
476 void ConfigVhtOptions(Args&&... args);
477
478 /**
479 * Helper function used to configure the HE options listed as attributes of
480 * the HeConfiguration class.
481 *
482 * \tparam Args \deduced Template type parameter pack for the sequence of name-value pairs.
483 * \param args A sequence of name-value pairs of the attributes to set.
484 */
485 template <typename... Args>
486 void ConfigHeOptions(Args&&... args);
487
488 /**
489 * Helper function used to configure the EHT options listed as attributes of
490 * the EhtConfiguration class.
491 *
492 * \tparam Args \deduced Template type parameter pack for the sequence of name-value pairs.
493 * \param args A sequence of name-value pairs of the attributes to set.
494 */
495 template <typename... Args>
496 void ConfigEhtOptions(Args&&... args);
497
498 /**
499 * Helper to enable all WifiNetDevice log components with one statement
500 * \param logLevel (optional) log level setting
501 */
502 static void EnableLogComponents(LogLevel logLevel = LOG_LEVEL_ALL);
503
504 /**
505 * Assign a fixed random variable stream number to the random variables
506 * used by the PHY and MAC aspects of the Wifi models. Each device in
507 * container c has fixed stream numbers assigned to its random variables.
508 * The Wifi channel (e.g. propagation loss model) is excluded.
509 * Return the number of streams (possibly zero) that
510 * have been assigned. The Install() method should have previously been
511 * called by the user.
512 *
513 * \param c NetDeviceContainer of the set of net devices for which the
514 * WifiNetDevice should be modified to use fixed streams
515 * \param stream first stream index to use
516 * \return the number of stream indices assigned by this helper
517 */
518 int64_t AssignStreams(NetDeviceContainer c, int64_t stream);
519
520 protected:
521 mutable std::vector<ObjectFactory> m_stationManager; ///< station manager
522 WifiStandard m_standard; ///< wifi standard
523 ObjectFactory m_htConfig; ///< HT configuration
524 ObjectFactory m_vhtConfig; ///< VHT configuration
525 ObjectFactory m_heConfig; ///< HE configuration
526 ObjectFactory m_ehtConfig; ///< EHT configuration
527 SelectQueueCallback m_selectQueueCallback; ///< select queue callback
528 ObjectFactory m_obssPdAlgorithm; ///< OBSS_PD algorithm
529 bool m_enableFlowControl; //!< whether to enable flow control
530};
531
532} // namespace ns3
533
534/***************************************************************
535 * Implementation of the templates declared above.
536 ***************************************************************/
537
538namespace ns3
539{
540
541template <typename... Args>
542void
543WifiPhyHelper::SetInterferenceHelper(std::string type, Args&&... args)
544{
546 m_interferenceHelper.Set(args...);
547}
548
549template <typename... Args>
550void
551WifiPhyHelper::SetErrorRateModel(std::string type, Args&&... args)
552{
553 for (std::size_t linkId = 0; linkId < m_phys.size(); linkId++)
554 {
555 SetErrorRateModel(linkId, type, std::forward<Args>(args)...);
556 }
557}
558
559template <typename... Args>
560void
561WifiPhyHelper::SetErrorRateModel(uint8_t linkId, std::string type, Args&&... args)
562{
563 m_errorRateModel.at(linkId).SetTypeId(type);
564 m_errorRateModel.at(linkId).Set(args...);
565}
566
567template <typename... Args>
568void
569WifiPhyHelper::SetFrameCaptureModel(std::string type, Args&&... args)
570{
571 for (std::size_t linkId = 0; linkId < m_phys.size(); linkId++)
572 {
573 SetFrameCaptureModel(linkId, type, std::forward<Args>(args)...);
574 }
575}
576
577template <typename... Args>
578void
579WifiPhyHelper::SetFrameCaptureModel(uint8_t linkId, std::string type, Args&&... args)
580{
581 m_frameCaptureModel.at(linkId).SetTypeId(type);
582 m_frameCaptureModel.at(linkId).Set(args...);
583}
584
585template <typename... Args>
586void
587WifiPhyHelper::SetPreambleDetectionModel(std::string type, Args&&... args)
588{
589 for (std::size_t linkId = 0; linkId < m_phys.size(); linkId++)
590 {
591 SetPreambleDetectionModel(linkId, type, std::forward<Args>(args)...);
592 }
593}
594
595template <typename... Args>
596void
597WifiPhyHelper::SetPreambleDetectionModel(uint8_t linkId, std::string type, Args&&... args)
598{
599 m_preambleDetectionModel.at(linkId).SetTypeId(type);
600 m_preambleDetectionModel.at(linkId).Set(args...);
601}
602
603template <typename... Args>
604void
605WifiHelper::SetRemoteStationManager(std::string type, Args&&... args)
606{
607 SetRemoteStationManager(0, type, std::forward<Args>(args)...);
608}
609
610template <typename... Args>
611void
612WifiHelper::SetRemoteStationManager(uint8_t linkId, std::string type, Args&&... args)
613{
614 if (m_stationManager.size() > linkId)
615 {
616 m_stationManager[linkId] = ObjectFactory(type, std::forward<Args>(args)...);
617 }
618 else
619 {
620 m_stationManager.resize(linkId + 1, ObjectFactory(type, std::forward<Args>(args)...));
621 }
622}
623
624template <typename... Args>
625void
626WifiHelper::SetObssPdAlgorithm(std::string type, Args&&... args)
627{
629 m_obssPdAlgorithm.Set(args...);
630}
631
632template <typename... Args>
633void
635{
636 m_htConfig.Set(args...);
637}
638
639template <typename... Args>
640void
642{
643 m_vhtConfig.Set(args...);
644}
645
646template <typename... Args>
647void
649{
650 m_heConfig.Set(args...);
651}
652
653template <typename... Args>
654void
656{
657 m_ehtConfig.Set(args...);
658}
659
660} // namespace ns3
661
662#endif /* WIFI_HELPER_H */
Base class providing common user-level ascii trace operations for helpers representing net devices.
Definition: trace-helper.h:729
Hold a value for an Attribute.
Definition: attribute.h:70
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
Instantiate subclasses of ns3::Object.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Base class providing common user-level pcap operations for helpers representing net devices.
Definition: trace-helper.h:624
DataLinkType
This enumeration holds the data link types that will be written to the pcap file.
Definition: trace-helper.h:52
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Radiotap header implementation.
helps to create WifiNetDevice objects
Definition: wifi-helper.h:324
virtual ~WifiHelper()
Definition: wifi-helper.cc:721
void SetRemoteStationManager(std::string type, Args &&... args)
Helper function used to set the station manager.
Definition: wifi-helper.h:605
void ConfigEhtOptions(Args &&... args)
Helper function used to configure the EHT options listed as attributes of the EhtConfiguration class.
Definition: wifi-helper.h:655
void SetObssPdAlgorithm(std::string type, Args &&... args)
Helper function used to set the OBSS-PD algorithm.
Definition: wifi-helper.h:626
void ConfigHtOptions(Args &&... args)
Helper function used to configure the HT options listed as attributes of the HtConfiguration class.
Definition: wifi-helper.h:634
ObjectFactory m_htConfig
HT configuration.
Definition: wifi-helper.h:523
void ConfigHeOptions(Args &&... args)
Helper function used to configure the HE options listed as attributes of the HeConfiguration class.
Definition: wifi-helper.h:648
ObjectFactory m_obssPdAlgorithm
OBSS_PD algorithm.
Definition: wifi-helper.h:528
ObjectFactory m_ehtConfig
EHT configuration.
Definition: wifi-helper.h:526
void ConfigVhtOptions(Args &&... args)
Helper function used to configure the VHT options listed as attributes of the VhtConfiguration class.
Definition: wifi-helper.h:641
ObjectFactory m_vhtConfig
VHT configuration.
Definition: wifi-helper.h:524
static void EnableLogComponents(LogLevel logLevel=LOG_LEVEL_ALL)
Helper to enable all WifiNetDevice log components with one statement.
Definition: wifi-helper.cc:880
void SetSelectQueueCallback(SelectQueueCallback f)
Definition: wifi-helper.cc:750
std::vector< ObjectFactory > m_stationManager
station manager
Definition: wifi-helper.h:521
WifiStandard m_standard
wifi standard
Definition: wifi-helper.h:522
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:988
virtual void SetStandard(WifiStandard standard)
Definition: wifi-helper.cc:738
ObjectFactory m_heConfig
HE configuration.
Definition: wifi-helper.h:525
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer::Iterator first, NodeContainer::Iterator last) const
Definition: wifi-helper.cc:756
void DisableFlowControl()
Disable flow control only if you know what you are doing.
Definition: wifi-helper.cc:744
SelectQueueCallback m_selectQueueCallback
select queue callback
Definition: wifi-helper.h:527
bool m_enableFlowControl
whether to enable flow control
Definition: wifi-helper.h:529
WifiHelper()
Create a Wifi helper in an empty state: all its parameters must be set before calling ns3::WifiHelper...
Definition: wifi-helper.cc:725
std::function< std::size_t(Ptr< QueueItem >)> SelectQueueCallback
Callback invoked to determine the MAC queue selected for a given packet.
Definition: wifi-helper.h:374
create MAC layers for a ns3::WifiNetDevice.
create PHY objects
Definition: wifi-helper.h:49
void SetPcapDataLinkType(SupportedPcapDataLinkTypes dlt)
Set the data link type of PCAP traces to be used.
Definition: wifi-helper.cc:543
void EnableAsciiInternal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename) override
Enable ASCII trace output on the indicated net device.
Definition: wifi-helper.cc:624
void Set(std::string name, const AttributeValue &v)
Definition: wifi-helper.cc:163
~WifiPhyHelper() override
Definition: wifi-helper.cc:158
void DisablePreambleDetectionModel()
Disable the preamble detection model on all links.
Definition: wifi-helper.cc:178
void SetErrorRateModel(std::string type, Args &&... args)
Helper function used to set the error rate model.
Definition: wifi-helper.h:551
void SetInterferenceHelper(std::string type, Args &&... args)
Helper function used to set the interference helper.
Definition: wifi-helper.h:543
void EnablePcapInternal(std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename) override
Enable pcap output the indicated net device.
Definition: wifi-helper.cc:568
PcapHelper::DataLinkType m_pcapDlt
PCAP data link type.
Definition: wifi-helper.h:313
std::vector< ObjectFactory > m_frameCaptureModel
frame capture model
Definition: wifi-helper.h:241
std::vector< ObjectFactory > m_preambleDetectionModel
preamble detection model
Definition: wifi-helper.h:242
PcapHelper::DataLinkType GetPcapDataLinkType() const
Get the data link type of PCAP traces to be used.
Definition: wifi-helper.cc:562
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:218
void SetFrameCaptureModel(std::string type, Args &&... args)
Helper function used to set the frame capture model.
Definition: wifi-helper.h:569
std::vector< ObjectFactory > m_phys
PHY objects.
Definition: wifi-helper.h:238
void SetPreambleDetectionModel(std::string type, Args &&... args)
Helper function used to set the preamble detection model.
Definition: wifi-helper.h:587
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:187
SupportedPcapDataLinkTypes
An enumeration of the pcap data link types (DLTs) which this helper supports.
Definition: wifi-helper.h:173
@ DLT_IEEE802_11
IEEE 802.11 Wireless LAN headers on packets.
Definition: wifi-helper.h:174
@ DLT_IEEE802_11_RADIO
Include Radiotap link layer information.
Definition: wifi-helper.h:178
@ DLT_PRISM_HEADER
Include Prism monitor mode information.
Definition: wifi-helper.h:176
std::vector< ObjectFactory > m_errorRateModel
error rate model
Definition: wifi-helper.h:240
virtual std::vector< Ptr< WifiPhy > > Create(Ptr< Node > node, Ptr< WifiNetDevice > device) const =0
ObjectFactory m_interferenceHelper
interference helper
Definition: wifi-helper.h:239
static void GetRadiotapHeader(RadiotapHeader &header, Ptr< Packet > packet, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu, uint16_t staId)
Get the Radiotap header for a transmitted packet.
Definition: wifi-helper.cc:264
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
Definition: first.py:1
Every class exported by the ns3 library is enclosed in the ns3 namespace.
LogLevel
Logging severity classes and levels.
Definition: log.h:94
@ LOG_LEVEL_ALL
Print everything.
Definition: log.h:116
static constexpr uint16_t SU_STA_ID
STA_ID to identify a single user (SU)
Definition: wifi-mode.h:35
MpduInfo structure.
Definition: phy-entity.h:62
SignalNoiseDbm structure.
Definition: phy-entity.h:55