A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-remote-station-manager.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005,2006,2007 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7 */
8
9#ifndef WIFI_REMOTE_STATION_MANAGER_H
10#define WIFI_REMOTE_STATION_MANAGER_H
11
13#include "qos-utils.h"
14#include "wifi-mode.h"
16#include "wifi-utils.h"
17
18#include "ns3/common-info-basic-mle.h"
19#include "ns3/data-rate.h"
20#include "ns3/eht-capabilities.h"
21#include "ns3/eht-operation.h"
22#include "ns3/he-6ghz-band-capabilities.h"
23#include "ns3/he-capabilities.h"
24#include "ns3/he-operation.h"
25#include "ns3/ht-capabilities.h"
26#include "ns3/ht-operation.h"
27#include "ns3/mac48-address.h"
28#include "ns3/object.h"
29#include "ns3/traced-callback.h"
30#include "ns3/vht-capabilities.h"
31#include "ns3/vht-operation.h"
32#include "ns3/wifi-export.h"
33
34#include <array>
35#include <list>
36#include <memory>
37#include <optional>
38#include <unordered_map>
39
40namespace ns3
41{
42
43class WifiPhy;
44class WifiMac;
45class WifiMacHeader;
46class Packet;
47class WifiMpdu;
48class WifiPsdu;
49class WifiTxVector;
51
53struct RxSignalInfo;
54
55/**
56 * @brief hold per-remote-station state.
57 *
58 * The state in this class is used to keep track
59 * of association status if we are in an infrastructure
60 * network and to perform the selection of TX parameters
61 * on a per-packet basis.
62 *
63 * This class is typically subclassed and extended by
64 * rate control implementations
65 */
66struct WIFI_EXPORT WifiRemoteStation
67{
69 {
70 }
71
72 WifiRemoteStationState* m_state; //!< Remote station state
73 std::pair<dBm_u, Time>
74 m_rssiAndUpdateTimePair; //!< RSSI of the most recent packet received from
75 //!< the remote station along with update time
76};
77
78/**
79 * A struct that holds information about each remote station.
80 */
81struct WIFI_EXPORT WifiRemoteStationState
82{
83 /**
84 * State of the station
85 */
86 enum
87 {
94 } m_state;
95
96 /**
97 * This member is the list of WifiMode objects that comprise the
98 * OperationalRateSet parameter for this remote station. This list
99 * is constructed through calls to
100 * WifiRemoteStationManager::AddSupportedMode(), and an API that
101 * allows external access to it is available through
102 * WifiRemoteStationManager::GetNSupported() and
103 * WifiRemoteStationManager::GetSupported().
104 */
105 WifiModeList m_operationalRateSet; //!< operational rate set
106 WifiModeList m_operationalMcsSet; //!< operational MCS set
107 Mac48Address m_address; //!< Mac48Address of the remote station
108 uint16_t m_aid; /**< AID of the remote station (unused if this object
109 is installed on a non-AP station) */
110 WifiRemoteStationInfo m_info; //!< remote station info
111 bool m_dsssSupported; //!< Flag if DSSS is supported by the remote station
112 bool m_erpOfdmSupported; //!< Flag if ERP OFDM is supported by the remote station
113 bool m_ofdmSupported; //!< Flag if OFDM is supported by the remote station
114 Ptr<const HtCapabilities> m_htCapabilities; //!< remote station HT capabilities
115 Ptr<const HtOperation> m_htOperation; //!< remote station HT operation
117 m_extendedCapabilities; //!< remote station extended capabilities
118 Ptr<const VhtCapabilities> m_vhtCapabilities; //!< remote station VHT capabilities
119 Ptr<const VhtOperation> m_vhtOperation; //!< remote station VHT operation
120 Ptr<const HeCapabilities> m_heCapabilities; //!< remote station HE capabilities
121 Ptr<const HeOperation> m_heOperation; //!< remote station HE operation
123 m_he6GhzBandCapabilities; //!< remote station HE 6GHz band capabilities
124 Ptr<const EhtCapabilities> m_ehtCapabilities; //!< remote station EHT capabilities
125 Ptr<const EhtOperation> m_ehtOperation; //!< remote station EHT operation
126 /// remote station Multi-Link Element Common Info
127 std::shared_ptr<CommonInfoBasicMle> m_mleCommonInfo;
128 bool m_emlsrEnabled; //!< whether EMLSR mode is enabled on this link
129
130 MHz_u m_channelWidth; //!< Channel width supported by the remote station
131 Time m_guardInterval; //!< HE Guard interval durationsupported by the remote station
132 uint8_t m_ness; //!< Number of extended spatial streams of the remote station
133 bool m_aggregation; //!< Flag if MPDU aggregation is used by the remote station
134 bool m_shortPreamble; //!< Flag if short PHY preamble is supported by the remote station
135 bool m_shortSlotTime; //!< Flag if short ERP slot time is supported by the remote station
136 bool m_qosSupported; //!< Flag if QoS is supported by the station
137 bool m_isInPsMode; //!< Flag if the STA is currently in PS mode
138};
139
140/**
141 * @ingroup wifi
142 * @brief hold a list of per-remote-station state.
143 *
144 * @sa ns3::WifiRemoteStation.
145 */
146class WIFI_EXPORT WifiRemoteStationManager : public Object
147{
148 public:
149 /**
150 * @brief Get the type ID.
151 * @return the object TypeId
152 */
153 static TypeId GetTypeId();
154
156 ~WifiRemoteStationManager() override;
157
158 /// ProtectionMode enumeration
164
165 /**
166 * A map of WifiRemoteStations with Mac48Address as key
167 */
168 using Stations = std::unordered_map<Mac48Address, WifiRemoteStation*, WifiAddressHash>;
169 /**
170 * A map of WifiRemoteStationStates with Mac48Address as key
171 */
173 std::unordered_map<Mac48Address, std::shared_ptr<WifiRemoteStationState>, WifiAddressHash>;
174
175 /**
176 * Set up PHY associated with this device since it is the object that
177 * knows the full set of transmit rates that are supported.
178 *
179 * @param phy the PHY of this device
180 */
181 virtual void SetupPhy(const Ptr<WifiPhy> phy);
182 /**
183 * Set up MAC associated with this device since it is the object that
184 * knows the full set of timing parameters (e.g. IFS).
185 *
186 * @param mac the MAC of this device
187 */
188 virtual void SetupMac(const Ptr<WifiMac> mac);
189
190 /**
191 * Set the ID of the link this Remote Station Manager is associated with.
192 *
193 * @param linkId the ID of the link this Remote Station Manager is associated with
194 */
195 void SetLinkId(uint8_t linkId);
196
197 /**
198 * Assign a fixed random variable stream number to the random variables
199 * used by this model. Return the number of streams (possibly zero) that
200 * have been assigned.
201 *
202 * @param stream first stream index to use
203 * @return the number of stream indices assigned by this model
204 */
205 virtual int64_t AssignStreams(int64_t stream);
206
207 /**
208 * Reset the state of the station corresponding to the given address (if one exists).
209 *
210 * @param address the MAC address of the given station
211 */
212 void ResetState(Mac48Address address) const;
213
214 /**
215 * Sets the maximum STA short retry count (SSRC).
216 *
217 * @param maxSsrc the maximum SSRC
218 */
219 void SetMaxSsrc(uint32_t maxSsrc);
220 /**
221 * Sets the maximum STA long retry count (SLRC).
222 *
223 * @param maxSlrc the maximum SLRC
224 */
225 void SetMaxSlrc(uint32_t maxSlrc);
226 /**
227 * Sets the RTS threshold.
228 *
229 * @param threshold the RTS threshold
230 */
231 void SetRtsCtsThreshold(uint32_t threshold);
232
233 /**
234 * Return the fragmentation threshold.
235 *
236 * @return the fragmentation threshold
237 */
239 /**
240 * Sets a fragmentation threshold. The method calls a private method
241 * DoSetFragmentationThreshold that checks the validity of the value given.
242 *
243 * @param threshold the fragmentation threshold
244 */
245 void SetFragmentationThreshold(uint32_t threshold);
246
247 /**
248 * Record the AID of a remote station. Should only be called by APs.
249 *
250 * @param remoteAddress the MAC address of the remote station
251 * @param aid the Association ID
252 */
253 void SetAssociationId(Mac48Address remoteAddress, uint16_t aid);
254 /**
255 * Records QoS support of the remote station.
256 *
257 * @param from the address of the station being recorded
258 * @param qosSupported whether the station supports QoS
259 */
260 void SetQosSupport(Mac48Address from, bool qosSupported);
261 /**
262 * @param from the address of the station being recorded
263 * @param emlsrEnabled whether EMLSR mode is enabled for the station on this link
264 */
265 void SetEmlsrEnabled(const Mac48Address& from, bool emlsrEnabled);
266 /**
267 * Records HT capabilities of the remote station.
268 *
269 * @param from the address of the station being recorded
270 * @param htCapabilities the HT capabilities of the station
271 */
272 void AddStationHtCapabilities(Mac48Address from, const HtCapabilities& htCapabilities);
273 /**
274 * Records HT operation of the remote station.
275 *
276 * @param from the address of the station being recorded
277 * @param htOperation the HT operation of the station
278 */
279 void AddStationHtOperation(Mac48Address from, const HtOperation& htOperation);
280 /**
281 * Records extended capabilities of the remote station.
282 *
283 * @param from the address of the station being recorded
284 * @param extendedCapabilities the extended capabilities of the station
285 */
287 const ExtendedCapabilities& extendedCapabilities);
288 /**
289 * Records VHT capabilities of the remote station.
290 *
291 * @param from the address of the station being recorded
292 * @param vhtCapabilities the VHT capabilities of the station
293 */
294 void AddStationVhtCapabilities(Mac48Address from, const VhtCapabilities& vhtCapabilities);
295 /**
296 * Records VHT operation of the remote station.
297 *
298 * @param from the address of the station being recorded
299 * @param vhtOperation the VHT operation of the station
300 */
301 void AddStationVhtOperation(Mac48Address from, const VhtOperation& vhtOperation);
302 /**
303 * Records HE capabilities of the remote station.
304 *
305 * @param from the address of the station being recorded
306 * @param heCapabilities the HE capabilities of the station
307 */
308 void AddStationHeCapabilities(Mac48Address from, const HeCapabilities& heCapabilities);
309 /**
310 * Records HE operation of the remote station.
311 *
312 * @param from the address of the station being recorded
313 * @param heOperation the HE operation of the station
314 */
315 void AddStationHeOperation(Mac48Address from, const HeOperation& heOperation);
316 /**
317 * Records HE 6 GHz Band Capabilities of a remote station
318 *
319 * @param from the address of the remote station
320 * @param he6GhzCapabilities the HE 6 GHz Band Capabilities of the remote station
321 */
323 const He6GhzBandCapabilities& he6GhzCapabilities);
324 /**
325 * Records EHT capabilities of the remote station.
326 *
327 * @param from the address of the station being recorded
328 * @param ehtCapabilities the EHT capabilities of the station
329 */
330 void AddStationEhtCapabilities(Mac48Address from, const EhtCapabilities& ehtCapabilities);
331 /**
332 * Records EHT operation of the remote station.
333 *
334 * @param from the address of the station being recorded
335 * @param ehtOperation the EHT operation of the station
336 */
337 void AddStationEhtOperation(Mac48Address from, const EhtOperation& ehtOperation);
338 /**
339 * Records the Common Info field advertised by the given remote station in a Multi-Link
340 * Element. It includes the MLD address of the remote station.
341 *
342 * @param from the address of the station being recorded
343 * @param mleCommonInfo the MLE Common Info advertised by the station
344 */
346 const std::shared_ptr<CommonInfoBasicMle>& mleCommonInfo);
347 /**
348 * Return the HT capabilities sent by the remote station.
349 *
350 * @param from the address of the remote station
351 * @return the HT capabilities sent by the remote station
352 */
354 /**
355 * Return the HT operation sent by the remote station.
356 *
357 * @param from the address of the remote station
358 * @return the HT operation sent by the remote station
359 */
361 /**
362 * Return the extended capabilities sent by the remote station.
363 *
364 * @param from the address of the remote station
365 * @return the extended capabilities sent by the remote station
366 */
368 /**
369 * Return the VHT capabilities sent by the remote station.
370 *
371 * @param from the address of the remote station
372 * @return the VHT capabilities sent by the remote station
373 */
375 /**
376 * Return the VHT operation sent by the remote station.
377 *
378 * @param from the address of the remote station
379 * @return the VHT operation sent by the remote station
380 */
382 /**
383 * Return the HE capabilities sent by the remote station.
384 *
385 * @param from the address of the remote station
386 * @return the HE capabilities sent by the remote station
387 */
389 /**
390 * Return the HE operation sent by the remote station.
391 *
392 * @param from the address of the remote station
393 * @return the HE operation sent by the remote station
394 */
396 /**
397 * Return the HE 6 GHz Band Capabilities sent by a remote station.
398 *
399 * @param from the address of the remote station
400 * @return the HE 6 GHz Band capabilities sent by the remote station
401 */
403 /**
404 * Return the EHT capabilities sent by the remote station.
405 *
406 * @param from the address of the remote station
407 * @return the EHT capabilities sent by the remote station
408 */
410 /**
411 * Return the EHT operation sent by the remote station.
412 *
413 * @param from the address of the remote station
414 * @return the EHT operation sent by the remote station
415 */
417 /**
418 * @param from the (MLD or link) address of the remote non-AP MLD
419 * @return the EML Capabilities advertised by the remote non-AP MLD
420 */
421 std::optional<std::reference_wrapper<CommonInfoBasicMle::EmlCapabilities>>
423 /**
424 * @param from the (MLD or link) address of the remote non-AP MLD
425 * @return the MLD Capabilities advertised by the remote non-AP MLD
426 */
427 std::optional<std::reference_wrapper<CommonInfoBasicMle::MldCapabilities>>
429 /**
430 * Return whether the device has HT capability support enabled on the link this manager is
431 * associated with. Note that this means that this function returns false if this is a
432 * 6 GHz link.
433 *
434 * @return true if HT capability support is enabled, false otherwise
435 */
436 bool GetHtSupported() const;
437 /**
438 * Return whether the device has VHT capability support enabled on the link this manager is
439 * associated with. Note that this means that this function returns false if this is a
440 * 2.4 or 6 GHz link.
441 *
442 * @return true if VHT capability support is enabled, false otherwise
443 */
444 bool GetVhtSupported() const;
445 /**
446 * Return whether the device has HE capability support enabled.
447 *
448 * @return true if HE capability support is enabled, false otherwise
449 */
450 bool GetHeSupported() const;
451 /**
452 * Return whether the device has EHT capability support enabled.
453 *
454 * @return true if EHT capability support is enabled, false otherwise
455 */
456 bool GetEhtSupported() const;
457 /**
458 * Return whether the device has LDPC support enabled.
459 *
460 * @return true if LDPC support is enabled, false otherwise
461 */
462 bool GetLdpcSupported() const;
463 /**
464 * Return whether the device has SGI support enabled.
465 *
466 * @return true if SGI support is enabled, false otherwise
467 */
469 /**
470 * Return the shortest supported HE guard interval duration.
471 *
472 * @return the shortest supported HE guard interval duration
473 */
474 Time GetGuardInterval() const;
475 /**
476 * Enable or disable protection for non-ERP stations.
477 *
478 * @param enable enable or disable protection for non-ERP stations
479 */
480 void SetUseNonErpProtection(bool enable);
481 /**
482 * Return whether the device supports protection of non-ERP stations.
483 *
484 * @return true if protection for non-ERP stations is enabled,
485 * false otherwise
486 */
487 bool GetUseNonErpProtection() const;
488 /**
489 * Enable or disable protection for non-HT stations.
490 *
491 * @param enable enable or disable protection for non-HT stations
492 */
493 void SetUseNonHtProtection(bool enable);
494 /**
495 * Return whether the device supports protection of non-HT stations.
496 *
497 * @return true if protection for non-HT stations is enabled,
498 * false otherwise
499 */
500 bool GetUseNonHtProtection() const;
501 /**
502 * Enable or disable short PHY preambles.
503 *
504 * @param enable enable or disable short PHY preambles
505 */
506 void SetShortPreambleEnabled(bool enable);
507 /**
508 * Return whether the device uses short PHY preambles.
509 *
510 * @return true if short PHY preambles are enabled,
511 * false otherwise
512 */
513 bool GetShortPreambleEnabled() const;
514 /**
515 * Enable or disable short slot time.
516 *
517 * @param enable enable or disable short slot time
518 */
519 void SetShortSlotTimeEnabled(bool enable);
520 /**
521 * Return whether the device uses short slot time.
522 *
523 * @return true if short slot time is enabled,
524 * false otherwise
525 */
526 bool GetShortSlotTimeEnabled() const;
527
528 /**
529 * Reset the station, invoked in a STA upon dis-association or in an AP upon reboot.
530 */
531 void Reset();
532
533 /**
534 * Invoked in a STA upon association to store the set of rates which belong to the
535 * BSSBasicRateSet of the associated AP and which are supported locally.
536 * Invoked in an AP to configure the BSSBasicRateSet.
537 *
538 * @param mode the WifiMode to be added to the basic mode set
539 */
540 void AddBasicMode(WifiMode mode);
541 /**
542 * Return the default transmission mode.
543 *
544 * @return WifiMode the default transmission mode
545 */
546 WifiMode GetDefaultMode() const;
547 /**
548 * Return the number of basic modes we support.
549 *
550 * @return the number of basic modes we support
551 */
552 uint8_t GetNBasicModes() const;
553 /**
554 * Return a basic mode from the set of basic modes.
555 *
556 * @param i index of the basic mode in the basic mode set
557 *
558 * @return the basic mode at the given index
559 */
560 WifiMode GetBasicMode(uint8_t i) const;
561 /**
562 * Return the number of non-ERP basic modes we support.
563 *
564 * @return the number of basic modes we support
565 */
567 /**
568 * Return a basic mode from the set of basic modes that is not an ERP mode.
569 *
570 * @param i index of the basic mode in the basic mode set
571 *
572 * @return the basic mode at the given index
573 */
574 WifiMode GetNonErpBasicMode(uint8_t i) const;
575 /**
576 * Return whether the station supports LDPC or not.
577 *
578 * @param address the address of the station
579 *
580 * @return true if LDPC is supported by the station,
581 * false otherwise
582 */
583 bool GetLdpcSupported(Mac48Address address) const;
584 /**
585 * Return whether the station supports short PHY preamble or not.
586 *
587 * @param address the address of the station
588 *
589 * @return true if short PHY preamble is supported by the station,
590 * false otherwise
591 */
592 bool GetShortPreambleSupported(Mac48Address address) const;
593 /**
594 * Return whether the station supports short ERP slot time or not.
595 *
596 * @param address the address of the station
597 *
598 * @return true if short ERP slot time is supported by the station,
599 * false otherwise
600 */
601 bool GetShortSlotTimeSupported(Mac48Address address) const;
602 /**
603 * Return whether the given station is QoS capable.
604 *
605 * @param address the address of the station
606 *
607 * @return true if the station has QoS capabilities,
608 * false otherwise
609 */
610 bool GetQosSupported(Mac48Address address) const;
611 /**
612 * Get the AID of a remote station. Should only be called by APs.
613 *
614 * @param remoteAddress the MAC address of the remote station
615 * @return the Association ID if the station is associated, SU_STA_ID otherwise
616 */
617 uint16_t GetAssociationId(Mac48Address remoteAddress) const;
618 /**
619 * Add a given Modulation and Coding Scheme (MCS) index to
620 * the set of basic MCS.
621 *
622 * @param mcs the WifiMode to be added to the basic MCS set
623 */
624 void AddBasicMcs(WifiMode mcs);
625 /**
626 * Return the default Modulation and Coding Scheme (MCS) index.
627 *
628 * @return the default WifiMode
629 */
630 WifiMode GetDefaultMcs() const;
631 /**
632 * Return the default MCS to use to transmit frames to the given station.
633 *
634 * @param st the given station
635 * @return the default MCS to use to transmit frames to the given station
636 */
638 /**
639 * Return the number of basic MCS index.
640 *
641 * @return the number of basic MCS index
642 */
643 uint8_t GetNBasicMcs() const;
644 /**
645 * Return the MCS at the given <i>list</i> index.
646 *
647 * @param i the position in the list
648 *
649 * @return the basic MCS at the given list index
650 */
651 WifiMode GetBasicMcs(uint8_t i) const;
652 /**
653 * Record the MCS index supported by the station.
654 *
655 * @param address the address of the station
656 * @param mcs the WifiMode supported by the station
657 */
658 void AddSupportedMcs(Mac48Address address, WifiMode mcs);
659 /**
660 * Return the channel width supported by the station.
661 *
662 * @param address the address of the station
663 *
664 * @return the channel width supported by the station
665 */
667 /**
668 * Return whether the station supports HT/VHT short guard interval.
669 *
670 * @param address the address of the station
671 *
672 * @return true if the station supports HT/VHT short guard interval,
673 * false otherwise
674 */
676 /**
677 * Return the number of spatial streams supported by the station.
678 *
679 * @param address the address of the station
680 *
681 * @return the number of spatial streams supported by the station
682 */
683 uint8_t GetNumberOfSupportedStreams(Mac48Address address) const;
684 /**
685 * Return the number of MCS supported by the station.
686 *
687 * @param address the address of the station
688 *
689 * @return the number of MCS supported by the station
690 */
691 uint8_t GetNMcsSupported(Mac48Address address) const;
692 /**
693 * Return whether the station supports DSSS or not.
694 *
695 * @param address the address of the station
696 *
697 * @return true if DSSS is supported by the station,
698 * false otherwise
699 */
700 bool GetDsssSupported(const Mac48Address& address) const;
701 /**
702 * Return whether the station supports ERP OFDM or not.
703 *
704 * @param address the address of the station
705 *
706 * @return true if ERP OFDM is supported by the station,
707 * false otherwise
708 */
709 bool GetErpOfdmSupported(const Mac48Address& address) const;
710 /**
711 * Return whether the station supports OFDM or not.
712 *
713 * @param address the address of the station
714 *
715 * @return true if OFDM is supported by the station,
716 * false otherwise
717 */
718 bool GetOfdmSupported(const Mac48Address& address) const;
719 /**
720 * Return whether the station supports HT or not.
721 *
722 * @param address the address of the station
723 *
724 * @return true if HT is supported by the station,
725 * false otherwise
726 */
727 bool GetHtSupported(Mac48Address address) const;
728 /**
729 * Return whether the station supports VHT or not.
730 *
731 * @param address the address of the station
732 *
733 * @return true if VHT is supported by the station,
734 * false otherwise
735 */
736 bool GetVhtSupported(Mac48Address address) const;
737 /**
738 * Return whether the station supports HE or not.
739 *
740 * @param address the address of the station
741 *
742 * @return true if HE is supported by the station,
743 * false otherwise
744 */
745 bool GetHeSupported(Mac48Address address) const;
746 /**
747 * Return whether the station supports EHT or not.
748 *
749 * @param address the address of the station
750 *
751 * @return true if EHT is supported by the station,
752 * false otherwise
753 */
754 bool GetEhtSupported(Mac48Address address) const;
755 /**
756 * @param address the (MLD or link) address of the non-AP MLD
757 * @return whether the non-AP MLD supports EMLSR
758 */
759 bool GetEmlsrSupported(const Mac48Address& address) const;
760 /**
761 * @param address the (MLD or link) address of the non-AP MLD
762 * @return whether EMLSR mode is enabled for the non-AP MLD on this link
763 */
764 bool GetEmlsrEnabled(const Mac48Address& address) const;
765
766 /**
767 * Return a mode for non-unicast packets.
768 *
769 * @return WifiMode for non-unicast packets
770 */
772
773 /**
774 * Return the TXVECTOR to use for a groupcast packet.
775 *
776 * @param header the MAC header of the groupcast packet
777 * @param allowedWidth the allowed width in MHz to send this packet
778 * @return the TXVECTOR to use to send the groupcast packet
779 */
780 WifiTxVector GetGroupcastTxVector(const WifiMacHeader& header, MHz_u allowedWidth);
781
782 /**
783 * Invoked in a STA or AP to store the set of
784 * modes supported by a destination which is
785 * also supported locally.
786 * The set of supported modes includes
787 * the BSSBasicRateSet.
788 *
789 * @param address the address of the station being recorded
790 * @param mode the WifiMode supports by the station
791 */
792 void AddSupportedMode(Mac48Address address, WifiMode mode);
793 /**
794 * Invoked in a STA or AP to store all of the modes supported
795 * by a destination which is also supported locally.
796 * The set of supported modes includes the BSSBasicRateSet.
797 *
798 * @param address the address of the station being recorded
799 */
801 /**
802 * Invoked in a STA or AP to store all of the MCS supported
803 * by a destination which is also supported locally.
804 *
805 * @param address the address of the station being recorded
806 */
807 void AddAllSupportedMcs(Mac48Address address);
808 /**
809 * Invoked in a STA or AP to delete all of the supported MCS by a destination.
810 *
811 * @param address the address of the station being recorded
812 */
814 /**
815 * Record whether the short PHY preamble is supported by the station.
816 *
817 * @param address the address of the station
818 * @param isShortPreambleSupported whether or not short PHY preamble is supported by the station
819 */
820 void AddSupportedPhyPreamble(Mac48Address address, bool isShortPreambleSupported);
821 /**
822 * Record whether the short ERP slot time is supported by the station.
823 *
824 * @param address the address of the station
825 * @param isShortSlotTimeSupported whether or not short ERP slot time is supported by the
826 * station
827 */
828 void AddSupportedErpSlotTime(Mac48Address address, bool isShortSlotTimeSupported);
829 /**
830 * Return whether the station state is brand new.
831 *
832 * @param address the address of the station
833 *
834 * @return true if the state of the station is brand new,
835 * false otherwise
836 */
837 bool IsBrandNew(Mac48Address address) const;
838 /**
839 * Return whether the station state is a known adhoc peer.
840 *
841 * @param address the address of the station
842 * @return true if the address is a known adhoc peer, false otherwise
843 */
844 bool IsAdhocPeer(Mac48Address address) const;
845 /**
846 * Return whether the station associated.
847 *
848 * @param address the address of the station
849 *
850 * @return true if the station is associated,
851 * false otherwise
852 */
853 bool IsAssociated(Mac48Address address) const;
854 /**
855 * Return whether we are waiting for an ACK for
856 * the association response we sent.
857 *
858 * @param address the address of the station
859 *
860 * @return true if the station is associated,
861 * false otherwise
862 */
863 bool IsWaitAssocTxOk(Mac48Address address) const;
864 /**
865 * Records that we are waiting for an ACK for
866 * the association response we sent.
867 *
868 * @param address the address of the station
869 */
870 void RecordWaitAssocTxOk(Mac48Address address);
871 /**
872 * Records that we got an ACK for
873 * the association response we sent.
874 *
875 * @param address the address of the station
876 */
877 void RecordGotAssocTxOk(Mac48Address address);
878 /**
879 * Records that we missed an ACK for
880 * the association response we sent.
881 *
882 * @param address the address of the station
883 */
885 /**
886 * Records that the STA was disassociated.
887 *
888 * @param address the address of the station
889 */
890 void RecordDisassociated(Mac48Address address);
891 /**
892 * Records that the STA is an adhoc peer.
893 *
894 * @param address the address of the station
895 */
896 void RecordAdhocPeer(Mac48Address address);
897 /**
898 * Return whether we refused an association request from the given station
899 *
900 * @param address the address of the station
901 * @return true if we refused an association request, false otherwise
902 */
903 bool IsAssocRefused(Mac48Address address) const;
904 /**
905 * Records that association request was refused
906 *
907 * @param address the address of the station
908 */
909 void RecordAssocRefused(Mac48Address address);
910
911 /**
912 * Return whether the STA is currently in Power Save mode.
913 *
914 * @param address the address of the station
915 *
916 * @return true if the station is in Power Save mode, false otherwise
917 */
918 bool IsInPsMode(const Mac48Address& address) const;
919 /**
920 * Register whether the STA is in Power Save mode or not.
921 *
922 * @param address the address of the station
923 * @param isInPsMode whether the STA is in PS mode or not
924 */
925 void SetPsMode(const Mac48Address& address, bool isInPsMode);
926
927 /**
928 * Get the address of the MLD the given station is affiliated with, if any.
929 * Note that an MLD address is only present if an ML discovery/setup was performed
930 * with the given station (which requires both this station and the given
931 * station to be MLDs).
932 *
933 * @param address the MAC address of the remote station
934 * @return the address of the MLD the given station is affiliated with, if any
935 */
936 std::optional<Mac48Address> GetMldAddress(const Mac48Address& address) const;
937 /**
938 * Get the address of the remote station operating on this link and affiliated
939 * with the MLD having the given MAC address, if any.
940 *
941 * @param mldAddress the MLD MAC address
942 * @return the address of the remote station operating on this link and
943 * affiliated with the MLD, if any
944 */
945 std::optional<Mac48Address> GetAffiliatedStaAddress(const Mac48Address& mldAddress) const;
946
947 /**
948 * @param header MAC header
949 * @param allowedWidth the allowed width to send this packet
950 * @return the TXVECTOR to use to send this packet
951 */
952 WifiTxVector GetDataTxVector(const WifiMacHeader& header, MHz_u allowedWidth);
953 /**
954 * @param address remote address
955 * @param allowedWidth the allowed width for the data frame being protected
956 *
957 * @return the TXVECTOR to use to send the RTS prior to the
958 * transmission of the data packet itself.
959 */
960 WifiTxVector GetRtsTxVector(Mac48Address address, MHz_u allowedWidth);
961 /**
962 * Return a TXVECTOR for the CTS frame given the destination and the mode of the RTS
963 * used by the sender.
964 *
965 * @param to the MAC address of the CTS receiver
966 * @param rtsTxMode the mode of the RTS used by the sender
967 * @return TXVECTOR for the CTS
968 */
970 /**
971 * Since CTS-to-self parameters are not dependent on the station,
972 * it is implemented in wifi remote station manager
973 *
974 * @param allowedWidth the width of the data frame being protected, which the
975 * CTS-to-self must cover (using the non-HT duplicate format if wider
976 * than 20 MHz)
977 * @return the transmission mode to use to send the CTS-to-self prior to the
978 * transmission of the data packet itself.
979 */
981 /**
982 * Adjust the TXVECTOR for a control response frame to ensure that, if appropriate, the non-HT
983 * duplicate format is used and the TX width matches that of the data frame transmitted (in case
984 * of, e.g., Ack or BlockAck) or to transmit (in case of, e.g., RTS or BlockAckReq) in the same
985 * frame exchange sequence.
986 *
987 * @param txVector the TXVECTOR to adjust
988 * @param allowedWidth the allowed width for the data frame in the same frame exchange sequence
989 */
990 void AdjustTxVectorForCtlResponse(WifiTxVector& txVector, MHz_u allowedWidth) const;
991 /**
992 * Adjust the TXVECTOR for an initial Control frame to ensure that the modulation class
993 * is non-HT and the rate is 6 Mbps, 12 Mbps or 24 Mbps.
994 *
995 * @param txVector the TXVECTOR to adjust
996 */
997 void AdjustTxVectorForIcf(WifiTxVector& txVector) const;
998 /**
999 * Return a TXVECTOR for the Ack frame given the destination and the mode of the Data
1000 * used by the sender.
1001 *
1002 * @param to the MAC address of the Ack receiver
1003 * @param dataTxVector the TXVECTOR of the Data used by the sender
1004 * @return TXVECTOR for the Ack
1005 */
1006 WifiTxVector GetAckTxVector(Mac48Address to, const WifiTxVector& dataTxVector) const;
1007 /**
1008 * Return a TXVECTOR for the BlockAck frame given the destination and the mode of the Data
1009 * used by the sender.
1010 *
1011 * @param to the MAC address of the BlockAck receiver
1012 * @param dataTxVector the TXVECTOR of the Data used by the sender
1013 * @return TXVECTOR for the BlockAck
1014 */
1015 WifiTxVector GetBlockAckTxVector(Mac48Address to, const WifiTxVector& dataTxVector) const;
1016 /**
1017 * Get control answer mode function.
1018 *
1019 * @param reqMode request mode
1020 * @return control answer mode
1021 */
1022 WifiMode GetControlAnswerMode(WifiMode reqMode) const;
1023
1024 /**
1025 * Return a TXVECTOR for a BlockAckReq frame sent in a frame exchange sequence involving the
1026 * transmission of a data frame (e.g., a BAR-BA sequence after a DL MU PPDU). The returned
1027 * TXVECTOR is determined as the TXVECTOR that would be used to transmit a BlockAck in response
1028 * to a data frame sent with the given TXVECTOR.
1029 *
1030 * @param to the MAC address of the BlockAckReq receiver
1031 * @param dataTxVector the TXVECTOR of the Data frame
1032 * @return TXVECTOR for the BlockAckReq
1033 */
1035 const WifiTxVector& dataTxVector) const;
1036
1037 /**
1038 * Return a TXVECTOR for a BlockAckReq frame sent in a frame exchange sequence that does not
1039 * involve the transmission of a data frame (e.g., a BAR scheduled to advance the recipient
1040 * window). The returned TXVECTOR is determined as the TXVECTOR that would be used to transmit
1041 * a BlockAck in response to a data frame sent to the given receiver and using the given width.
1042 *
1043 * @param to the MAC address of the BlockAckReq receiver
1044 * @param allowedWidth the allowed width to send this BlockAckReq
1045 * @return TXVECTOR for the BlockAckReq
1046 */
1047 virtual WifiTxVector GetBlockAckReqTxVector(Mac48Address to, MHz_u allowedWidth);
1048
1049 /**
1050 * Should be invoked whenever the RtsTimeout associated to a transmission
1051 * attempt expires.
1052 *
1053 * @param header MAC header of the DATA packet
1054 */
1055 void ReportRtsFailed(const WifiMacHeader& header);
1056 /**
1057 * Should be invoked whenever the AckTimeout associated to a transmission
1058 * attempt expires.
1059 *
1060 * @param mpdu the MPDU whose transmission failed
1061 */
1063 /**
1064 * Should be invoked whenever we receive the CTS associated to an RTS
1065 * we just sent. Note that we also get the SNR of the RTS we sent since
1066 * the receiver put a SnrTag in the CTS.
1067 *
1068 * @param header MAC header of the DATA packet
1069 * @param ctsSnr the SNR of the CTS we received
1070 * @param ctsMode the WifiMode the receiver used to send the CTS
1071 * @param rtsSnr the SNR of the RTS we sent
1072 */
1073 void ReportRtsOk(const WifiMacHeader& header, double ctsSnr, WifiMode ctsMode, double rtsSnr);
1074 /**
1075 * Should be invoked whenever we receive the ACK associated to a data packet
1076 * we just sent.
1077 *
1078 * @param mpdu the MPDU
1079 * @param ackSnr the SNR of the ACK we received
1080 * @param ackMode the WifiMode the receiver used to send the ACK
1081 * @param dataSnr the SNR of the DATA we sent
1082 * @param dataTxVector the TXVECTOR of the DATA we sent
1083 */
1085 double ackSnr,
1086 WifiMode ackMode,
1087 double dataSnr,
1088 WifiTxVector dataTxVector);
1089 /**
1090 * Should be invoked after calling ReportRtsFailed if frames are dropped
1091 *
1092 * @param header MAC header of the DATA packet
1093 */
1094 void ReportFinalRtsFailed(const WifiMacHeader& header);
1095 /**
1096 * Should be invoked after calling ReportDataFailed if frames are dropped
1097 *
1098 * @param mpdu the MPDU which was discarded
1099 */
1101 /**
1102 * Typically called per A-MPDU, either when a Block ACK was successfully
1103 * received or when a BlockAckTimeout has elapsed.
1104 *
1105 * @param address the address of the receiver
1106 * @param nSuccessfulMpdus number of successfully transmitted MPDUs
1107 * A value of 0 means that the Block ACK was missed.
1108 * @param nFailedMpdus number of unsuccessfully transmitted MPDUs
1109 * @param rxSnr received SNR of the block ack frame itself
1110 * @param dataSnr data SNR reported by remote station
1111 * @param dataTxVector the TXVECTOR of the MPDUs we sent
1112 */
1113 void ReportAmpduTxStatus(Mac48Address address,
1114 uint16_t nSuccessfulMpdus,
1115 uint16_t nFailedMpdus,
1116 double rxSnr,
1117 double dataSnr,
1118 const WifiTxVector& dataTxVector);
1119
1120 /**
1121 * @param address remote address
1122 * @param rxSignalInfo the info on the received signal (\see RxSignalInfo)
1123 * @param txVector the TXVECTOR used for the packet received
1124 *
1125 * Should be invoked whenever a packet is successfully received.
1126 */
1127 void ReportRxOk(Mac48Address address, RxSignalInfo rxSignalInfo, const WifiTxVector& txVector);
1128
1129 /**
1130 * Increment the retry count for all the MPDUs (if needed) in the given PSDU and find the
1131 * MPDUs to drop based on the frame retry count.
1132 *
1133 * @param psdu the given PSDU, whose transmission failed
1134 * @return the list of MPDUs that have to be dropped
1135 */
1136 std::list<Ptr<WifiMpdu>> GetMpdusToDropOnTxFailure(Ptr<WifiPsdu> psdu);
1137
1138 /**
1139 * @param header MAC header of the data frame to send
1140 * @param txParams the TX parameters for the data frame to send
1141 *
1142 * @return true if we want to use an RTS/CTS handshake for this
1143 * frame before sending it, false otherwise.
1144 */
1145 bool NeedRts(const WifiMacHeader& header, const WifiTxParameters& txParams);
1146 /**
1147 * Return if we need to do CTS-to-self before sending a DATA.
1148 *
1149 * @param txVector the TXVECTOR of the DATA
1150 * @param header the MAC header of the DATA
1151 * @return true if CTS-to-self is needed,
1152 * false otherwise
1153 */
1154 bool NeedCtsToSelf(const WifiTxVector& txVector, const WifiMacHeader& header);
1155
1156 /**
1157 * @param mpdu the MPDU to send
1158 *
1159 * @return true if this packet should be fragmented,
1160 * false otherwise.
1161 */
1163 /**
1164 * @param mpdu the MPDU to send
1165 * @param fragmentNumber the fragment index of the next fragment to send (starts at zero).
1166 *
1167 * @return the size of the corresponding fragment.
1168 */
1170 /**
1171 * @param mpdu the packet to send
1172 * @param fragmentNumber the fragment index of the next fragment to send (starts at zero).
1173 *
1174 * @return the offset within the original packet where this fragment starts.
1175 */
1177 /**
1178 * @param mpdu the packet to send
1179 * @param fragmentNumber the fragment index of the next fragment to send (starts at zero).
1180 *
1181 * @return true if this is the last fragment, false otherwise.
1182 */
1183 bool IsLastFragment(Ptr<const WifiMpdu> mpdu, uint32_t fragmentNumber);
1184
1185 /**
1186 * @return the default transmission power
1187 */
1188 uint8_t GetDefaultTxPowerLevel() const;
1189 /**
1190 * @param address of the remote station
1191 *
1192 * @return information regarding the remote station associated with the given address
1193 */
1195 /**
1196 * @param address of the remote station
1197 *
1198 * @return the RSSI of the most recent packet received from the remote station (irrespective of
1199 * TID)
1200 *
1201 * This method is typically used when the device needs
1202 * to estimate the target UL RSSI info to put in the
1203 * Trigger frame to send to the remote station.
1204 */
1205 std::optional<dBm_u> GetMostRecentRssi(Mac48Address address) const;
1206 /**
1207 * Set the default transmission power level
1208 *
1209 * @param txPower the default transmission power level
1210 */
1211 void SetDefaultTxPowerLevel(uint8_t txPower);
1212 /**
1213 * @return the number of antennas supported by the PHY layer
1214 */
1215 uint8_t GetNumberOfAntennas() const;
1216 /**
1217 * @return the maximum number of spatial streams supported by the PHY layer
1218 */
1219 uint8_t GetMaxNumberOfTransmitStreams() const;
1220 /**
1221 * @returns whether LDPC should be used for a given destination address.
1222 *
1223 * @param dest the destination address
1224 *
1225 * @return whether LDPC should be used for a given destination address
1226 */
1227 bool UseLdpcForDestination(Mac48Address dest) const;
1228
1229 /**
1230 * TracedCallback signature for power change events.
1231 *
1232 * @param [in] oldPower The previous power (in dBm).
1233 * @param [in] newPower The new power (in dBm).
1234 * @param [in] address The remote station MAC address.
1235 */
1236 typedef void (*PowerChangeTracedCallback)(double oldPower,
1237 double newPower,
1238 Mac48Address remoteAddress);
1239
1240 /**
1241 * TracedCallback signature for rate change events.
1242 *
1243 * @param [in] oldRate The previous data rate.
1244 * @param [in] newRate The new data rate.
1245 * @param [in] address The remote station MAC address.
1246 */
1247 typedef void (*RateChangeTracedCallback)(DataRate oldRate,
1248 DataRate newRate,
1249 Mac48Address remoteAddress);
1250
1251 /**
1252 * Return the WifiPhy.
1253 *
1254 * @return a pointer to the WifiPhy
1255 */
1256 Ptr<WifiPhy> GetPhy() const;
1257 /**
1258 * Return the WifiMac.
1259 *
1260 * @return a pointer to the WifiMac
1261 */
1262 Ptr<WifiMac> GetMac() const;
1263
1264 protected:
1265 void DoDispose() override;
1266 /**
1267 * Return whether mode associated with the specified station at the specified index.
1268 *
1269 * @param station the station being queried
1270 * @param i the index
1271 *
1272 * @return WifiMode at the given index of the specified station
1273 */
1274 WifiMode GetSupported(const WifiRemoteStation* station, uint8_t i) const;
1275 /**
1276 * Return the number of modes supported by the given station.
1277 *
1278 * @param station the station being queried
1279 *
1280 * @return the number of modes supported by the given station
1281 */
1282 uint8_t GetNSupported(const WifiRemoteStation* station) const;
1283 /**
1284 * Return whether the given station is QoS capable.
1285 *
1286 * @param station the station being queried
1287 *
1288 * @return true if the station has QoS capabilities,
1289 * false otherwise
1290 */
1291 bool GetQosSupported(const WifiRemoteStation* station) const;
1292 /**
1293 * Return whether the given station is HT capable.
1294 *
1295 * @param station the station being queried
1296 *
1297 * @return true if the station has HT capabilities,
1298 * false otherwise
1299 */
1300 bool GetHtSupported(const WifiRemoteStation* station) const;
1301 /**
1302 * Return whether the given station is VHT capable.
1303 *
1304 * @param station the station being queried
1305 *
1306 * @return true if the station has VHT capabilities,
1307 * false otherwise
1308 */
1309 bool GetVhtSupported(const WifiRemoteStation* station) const;
1310 /**
1311 * Return whether the given station is HE capable.
1312 *
1313 * @param station the station being queried
1314 *
1315 * @return true if the station has HE capabilities,
1316 * false otherwise
1317 */
1318 bool GetHeSupported(const WifiRemoteStation* station) const;
1319 /**
1320 * Return whether the given station is EHT capable.
1321 *
1322 * @param station the station being queried
1323 *
1324 * @return true if the station has EHT capabilities,
1325 * false otherwise
1326 */
1327 bool GetEhtSupported(const WifiRemoteStation* station) const;
1328 /**
1329 * @param station the station of a non-AP MLD
1330 * @return whether the non-AP MLD supports EMLSR
1331 */
1332 bool GetEmlsrSupported(const WifiRemoteStation* station) const;
1333 /**
1334 * @param station the station of a non-AP MLD
1335 * @return whether EMLSR mode is enabled for the non-AP MLD on this link
1336 */
1337 bool GetEmlsrEnabled(const WifiRemoteStation* station) const;
1338 /**
1339 * Return the WifiMode supported by the specified station at the specified index.
1340 *
1341 * @param station the station being queried
1342 * @param i the index
1343 *
1344 * @return the WifiMode at the given index of the specified station
1345 */
1346
1347 WifiMode GetMcsSupported(const WifiRemoteStation* station, uint8_t i) const;
1348 /**
1349 * Return the number of MCS supported by the given station.
1350 *
1351 * @param station the station being queried
1352 *
1353 * @return the number of MCS supported by the given station
1354 */
1355 uint8_t GetNMcsSupported(const WifiRemoteStation* station) const;
1356 /**
1357 * Return whether non-ERP mode associated with the specified station at the specified index.
1358 *
1359 * @param station the station being queried
1360 * @param i the index
1361 *
1362 * @return WifiMode at the given index of the specified station
1363 */
1364 WifiMode GetNonErpSupported(const WifiRemoteStation* station, uint8_t i) const;
1365 /**
1366 * Return the number of non-ERP modes supported by the given station.
1367 *
1368 * @param station the station being queried
1369 *
1370 * @return the number of non-ERP modes supported by the given station
1371 */
1372 uint32_t GetNNonErpSupported(const WifiRemoteStation* station) const;
1373 /**
1374 * Return the address of the station.
1375 *
1376 * @param station the station being queried
1377 *
1378 * @return the address of the station
1379 */
1380 Mac48Address GetAddress(const WifiRemoteStation* station) const;
1381 /**
1382 * Return the channel width supported by the station.
1383 *
1384 * @param station the station being queried
1385 *
1386 * @return the channel width supported by the station
1387 */
1388 MHz_u GetChannelWidth(const WifiRemoteStation* station) const;
1389 /**
1390 * Return whether the given station supports HT/VHT short guard interval.
1391 *
1392 * @param station the station being queried
1393 *
1394 * @return true if the station supports HT/VHT short guard interval,
1395 * false otherwise
1396 */
1397 bool GetShortGuardIntervalSupported(const WifiRemoteStation* station) const;
1398 /**
1399 * Return the shortest HE guard interval duration supported by the station.
1400 *
1401 * @param station the station being queried
1402 *
1403 * @return the shortest HE guard interval duration supported by the station
1404 */
1405 Time GetGuardInterval(const WifiRemoteStation* station) const;
1406 /**
1407 * Return whether the given station supports A-MPDU.
1408 *
1409 * @param station the station being queried
1410 *
1411 * @return true if the station supports MPDU aggregation,
1412 * false otherwise
1413 */
1414 bool GetAggregation(const WifiRemoteStation* station) const;
1415
1416 /**
1417 * Return the number of supported streams the station has.
1418 *
1419 * @param station the station being queried
1420 *
1421 * @return the number of supported streams the station has
1422 */
1423 uint8_t GetNumberOfSupportedStreams(const WifiRemoteStation* station) const;
1424 /**
1425 * @returns the number of Ness the station has.
1426 *
1427 * @param station the station being queried
1428 *
1429 * @return the number of Ness the station has
1430 */
1431 uint8_t GetNess(const WifiRemoteStation* station) const;
1432
1433 uint8_t m_linkId; //!< the ID of the link this object is associated with
1434 bool m_incrRetryCountUnderBa; //!< whether to increment the retry count of frames that are
1435 //!< part of a Block Ack agreement
1436
1437 private:
1438 /**
1439 * If the given TXVECTOR is used for a MU transmission, return the STAID of
1440 * the station with the given address if we are an AP or our own STAID if we
1441 * are a STA associated with some AP. Otherwise, return SU_STA_ID.
1442 *
1443 * @param address the address of the station
1444 * @param txVector the TXVECTOR used for a MU transmission
1445 * @return the STA-ID of the station
1446 */
1447 uint16_t GetStaId(Mac48Address address, const WifiTxVector& txVector) const;
1448
1449 /**
1450 * Increment the retry count (if needed) for the given PSDU, whose transmission failed.
1451 *
1452 * @param station the station the PSDU is addressed to
1453 * @param psdu the given PSDU
1454 */
1456
1457 /**
1458 * Find the MPDUs to drop (possibly based on their frame retry count) in the given PSDU,
1459 * whose transmission failed.
1460 *
1461 * @param station the station the PSDU is addressed to
1462 * @param psdu the given PSDU
1463 * @return the MPDUs in the PSDU to drop
1464 */
1465 virtual std::list<Ptr<WifiMpdu>> DoGetMpdusToDropOnTxFailure(WifiRemoteStation* station,
1466 Ptr<WifiPsdu> psdu);
1467
1468 /**
1469 * @param station the station that we need to communicate
1470 * @param size the size of the frame to send in bytes
1471 * @param normally indicates whether the normal 802.11 RTS enable mechanism would
1472 * request that the RTS is sent or not.
1473 *
1474 * @return true if we want to use an RTS/CTS handshake for this frame before sending it,
1475 * false otherwise.
1476 *
1477 * Note: This method is called before a unicast packet is sent on the medium.
1478 */
1479 virtual bool DoNeedRts(WifiRemoteStation* station, uint32_t size, bool normally);
1480 /**
1481 * @param station the station that we need to communicate
1482 * @param packet the packet to send
1483 * @param normally indicates whether the normal 802.11 data fragmentation mechanism
1484 * would request that the data packet is fragmented or not.
1485 *
1486 * @return true if this packet should be fragmented,
1487 * false otherwise.
1488 *
1489 * Note: This method is called before sending a unicast packet.
1490 */
1491 virtual bool DoNeedFragmentation(WifiRemoteStation* station,
1492 Ptr<const Packet> packet,
1493 bool normally);
1494 /**
1495 * @return a new station data structure
1496 */
1498 /**
1499 * @param station the station that we need to communicate
1500 * @param allowedWidth the allowed width to send a packet to the station
1501 * @return the TXVECTOR to use to send a packet to the station
1502 *
1503 * Note: This method is called before sending a unicast packet or a fragment
1504 * of a unicast packet to decide which transmission mode to use.
1505 */
1506 virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation* station, MHz_u allowedWidth) = 0;
1507 /**
1508 * @param station the station that we need to communicate
1509 *
1510 * @return the transmission mode to use to send an RTS to the station
1511 *
1512 * Note: This method is called before sending an RTS to a station
1513 * to decide which transmission mode to use for the RTS.
1514 */
1516
1517 /**
1518 * This method is a pure virtual method that must be implemented by the sub-class.
1519 * This allows different types of WifiRemoteStationManager to respond differently,
1520 *
1521 * @param station the station that we failed to send RTS
1522 */
1523 virtual void DoReportRtsFailed(WifiRemoteStation* station) = 0;
1524 /**
1525 * This method is a pure virtual method that must be implemented by the sub-class.
1526 * This allows different types of WifiRemoteStationManager to respond differently,
1527 *
1528 * @param station the station that we failed to send DATA
1529 */
1530 virtual void DoReportDataFailed(WifiRemoteStation* station) = 0;
1531 /**
1532 * This method is a pure virtual method that must be implemented by the sub-class.
1533 * This allows different types of WifiRemoteStationManager to respond differently,
1534 *
1535 * @param station the station that we successfully sent RTS
1536 * @param ctsSnr the SNR of the CTS we received
1537 * @param ctsMode the WifiMode the receiver used to send the CTS
1538 * @param rtsSnr the SNR of the RTS we sent
1539 */
1540 virtual void DoReportRtsOk(WifiRemoteStation* station,
1541 double ctsSnr,
1542 WifiMode ctsMode,
1543 double rtsSnr) = 0;
1544 /**
1545 * This method is a pure virtual method that must be implemented by the sub-class.
1546 * This allows different types of WifiRemoteStationManager to respond differently,
1547 *
1548 * @param station the station that we successfully sent RTS
1549 * @param ackSnr the SNR of the ACK we received
1550 * @param ackMode the WifiMode the receiver used to send the ACK
1551 * @param dataSnr the SNR of the DATA we sent
1552 * @param dataChannelWidth the channel width of the DATA we sent
1553 * @param dataNss the number of spatial streams used to send the DATA
1554 */
1555 virtual void DoReportDataOk(WifiRemoteStation* station,
1556 double ackSnr,
1557 WifiMode ackMode,
1558 double dataSnr,
1559 MHz_u dataChannelWidth,
1560 uint8_t dataNss) = 0;
1561 /**
1562 * This method is a pure virtual method that must be implemented by the sub-class.
1563 * This allows different types of WifiRemoteStationManager to respond differently,
1564 *
1565 * @param station the station that we failed to send RTS
1566 */
1567 virtual void DoReportFinalRtsFailed(WifiRemoteStation* station) = 0;
1568 /**
1569 * This method is a pure virtual method that must be implemented by the sub-class.
1570 * This allows different types of WifiRemoteStationManager to respond differently,
1571 *
1572 * @param station the station that we failed to send DATA
1573 */
1574 virtual void DoReportFinalDataFailed(WifiRemoteStation* station) = 0;
1575 /**
1576 * This method is a pure virtual method that must be implemented by the sub-class.
1577 * This allows different types of WifiRemoteStationManager to respond differently,
1578 *
1579 * @param station the station that sent the DATA to us
1580 * @param rxSnr the SNR of the DATA we received
1581 * @param txMode the WifiMode the sender used to send the DATA
1582 */
1583 virtual void DoReportRxOk(WifiRemoteStation* station, double rxSnr, WifiMode txMode) = 0;
1584 /**
1585 * Typically called per A-MPDU, either when a Block ACK was successfully received
1586 * or when a BlockAckTimeout has elapsed. This method is a virtual method that must
1587 * be implemented by the sub-class intended to handle A-MPDUs. This allows different
1588 * types of WifiRemoteStationManager to respond differently.
1589 *
1590 * @param station the station that sent the DATA to us
1591 * @param nSuccessfulMpdus number of successfully transmitted MPDUs.
1592 * A value of 0 means that the Block ACK was missed.
1593 * @param nFailedMpdus number of unsuccessfully transmitted MPDUs.
1594 * @param rxSnr received SNR of the block ack frame itself
1595 * @param dataSnr data SNR reported by remote station
1596 * @param dataChannelWidth the channel width of the A-MPDU we sent
1597 * @param dataNss the number of spatial streams used to send the A-MPDU
1598 */
1599 virtual void DoReportAmpduTxStatus(WifiRemoteStation* station,
1600 uint16_t nSuccessfulMpdus,
1601 uint16_t nFailedMpdus,
1602 double rxSnr,
1603 double dataSnr,
1604 MHz_u dataChannelWidth,
1605 uint8_t dataNss);
1606
1607 /**
1608 * Return the state of the station associated with the given address.
1609 *
1610 * @param address the address of the station
1611 * @return WifiRemoteStationState corresponding to the address
1612 * @hidecaller
1613 */
1614 std::shared_ptr<WifiRemoteStationState> LookupState(Mac48Address address) const;
1615 /**
1616 * Return the station associated with the given address.
1617 *
1618 * @param address the address of the station
1619 *
1620 * @return WifiRemoteStation corresponding to the address
1621 */
1622 WifiRemoteStation* Lookup(Mac48Address address) const;
1623
1624 /**
1625 * Actually sets the fragmentation threshold, it also checks the validity of
1626 * the given threshold.
1627 *
1628 * @param threshold the fragmentation threshold
1629 */
1630 void DoSetFragmentationThreshold(uint32_t threshold);
1631 /**
1632 * Return the current fragmentation threshold
1633 *
1634 * @return the fragmentation threshold
1635 */
1637 /**
1638 * Return the number of fragments needed for the given packet.
1639 *
1640 * @param mpdu the packet to be fragmented
1641 *
1642 * @return the number of fragments needed
1643 */
1645
1646 /**
1647 * This is a pointer to the WifiPhy associated with this
1648 * WifiRemoteStationManager that is set on call to
1649 * WifiRemoteStationManager::SetupPhy(). Through this pointer the
1650 * station manager can determine PHY characteristics, such as the
1651 * set of all transmission rates that may be supported (the
1652 * "DeviceRateSet").
1653 */
1655 /**
1656 * This is a pointer to the WifiMac associated with this
1657 * WifiRemoteStationManager that is set on call to
1658 * WifiRemoteStationManager::SetupMac(). Through this pointer the
1659 * station manager can determine MAC characteristics, such as the
1660 * interframe spaces.
1661 */
1663
1664 /**
1665 * This member is the list of WifiMode objects that comprise the
1666 * BSSBasicRateSet parameter. This list is constructed through calls
1667 * to WifiRemoteStationManager::AddBasicMode(), and an API that
1668 * allows external access to it is available through
1669 * WifiRemoteStationManager::GetNBasicModes() and
1670 * WifiRemoteStationManager::GetBasicMode().
1671 */
1672 WifiModeList m_bssBasicRateSet; //!< basic rate set
1673 WifiModeList m_bssBasicMcsSet; //!< basic MCS set
1674
1675 StationStates m_states; //!< States of known stations
1676 Stations m_stations; //!< Information for each known stations
1677
1678 uint32_t m_maxSsrc; //!< Maximum STA short retry count (SSRC)
1679 uint32_t m_maxSlrc; //!< Maximum STA long retry count (SLRC)
1680 uint32_t m_rtsCtsThreshold; //!< Threshold for RTS/CTS
1681 Time m_rtsCtsTxDurationThresh; //!< TX duration threshold for RTS/CTS
1682 uint32_t m_fragmentationThreshold; //!< Current threshold for fragmentation
1683 uint8_t m_defaultTxPowerLevel; //!< Default transmission power level
1684 WifiMode m_nonUnicastMode; //!< Transmission mode for non-unicast Data frames
1685 bool m_useNonErpProtection; //!< flag if protection for non-ERP stations against ERP
1686 //!< transmissions is enabled
1687 bool m_useNonHtProtection; //!< flag if protection for non-HT stations against HT transmissions
1688 //!< is enabled
1689 bool m_shortPreambleEnabled; //!< flag if short PHY preamble is enabled
1690 bool m_shortSlotTimeEnabled; //!< flag if short slot time is enabled
1691 ProtectionMode m_erpProtectionMode; //!< Protection mode for ERP stations when non-ERP stations
1692 //!< are detected
1694 m_htProtectionMode; //!< Protection mode for HT stations when non-HT stations are detected
1695
1696 std::array<uint32_t, AC_BE_NQOS> m_ssrc; //!< short retry count per AC
1697 std::array<uint32_t, AC_BE_NQOS> m_slrc; //!< long retry count per AC
1698
1699 /**
1700 * The trace source fired when the transmission of a single RTS has failed
1701 */
1703 /**
1704 * The trace source fired when the transmission of a single data packet has failed
1705 */
1707 /**
1708 * The trace source fired when the transmission of a RTS has
1709 * exceeded the maximum number of attempts
1710 */
1712 /**
1713 * The trace source fired when the transmission of a data packet has
1714 * exceeded the maximum number of attempts
1715 */
1717};
1718
1719} // namespace ns3
1720
1721#endif /* WIFI_REMOTE_STATION_MANAGER_H */
Class for representing data rates.
Definition data-rate.h:78
The IEEE 802.11be EHT Capabilities.
EHT Operation Information Element.
The Extended Capabilities Information Element.
The HE 6 GHz Band Capabilities (IEEE 802.11ax-2021 9.4.2.263).
The IEEE 802.11ax HE Capabilities.
The HE Operation Information Element.
The HT Capabilities Information Element.
The HT Operation Information Element.
an EUI-48 address
Object()
Caller graph was not generated because of its size.
Definition object.cc:93
network packets
Definition packet.h:228
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
Simulation virtual time values and global simulation resolution.
Definition nstime.h:95
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition type-id.h:50
The IEEE 802.11ac VHT Capabilities.
The VHT Operation Information Element.
Implements the IEEE 802.11 MAC header.
base class for all MAC-level wifi objects.
Definition wifi-mac.h:117
represent a single transmission mode
Definition wifi-mode.h:39
WifiMpdu stores a (const) packet along with a MAC header.
Definition wifi-mpdu.h:52
802.11 PHY layer model
Definition wifi-phy.h:66
WifiPsdu stores an MPDU, S-MPDU or A-MPDU, by keeping header(s) and payload(s) separate for each cons...
Definition wifi-psdu.h:34
TID independent remote station statistics.
void ReportDataFailed(Ptr< const WifiMpdu > mpdu)
Should be invoked whenever the AckTimeout associated to a transmission attempt expires.
void AddStationHeOperation(Mac48Address from, const HeOperation &heOperation)
Records HE operation of the remote station.
bool GetQosSupported(Mac48Address address) const
Return whether the given station is QoS capable.
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station, MHz_u allowedWidth)=0
uint8_t GetNumberOfSupportedStreams(Mac48Address address) const
Return the number of spatial streams supported by the station.
WifiTxVector GetAckTxVector(Mac48Address to, const WifiTxVector &dataTxVector) const
Return a TXVECTOR for the Ack frame given the destination and the mode of the Data used by the sender...
virtual bool DoNeedFragmentation(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
uint32_t m_fragmentationThreshold
Current threshold for fragmentation.
void SetShortSlotTimeEnabled(bool enable)
Enable or disable short slot time.
void SetPsMode(const Mac48Address &address, bool isInPsMode)
Register whether the STA is in Power Save mode or not.
uint8_t GetNess(const WifiRemoteStation *station) const
void AddBasicMode(WifiMode mode)
Invoked in a STA upon association to store the set of rates which belong to the BSSBasicRateSet of th...
bool GetEmlsrEnabled(const Mac48Address &address) const
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Ptr< const HeOperation > GetStationHeOperation(Mac48Address from)
Return the HE operation sent by the remote station.
uint32_t GetNFragments(Ptr< const WifiMpdu > mpdu)
Return the number of fragments needed for the given packet.
uint16_t GetAssociationId(Mac48Address remoteAddress) const
Get the AID of a remote station.
virtual void DoIncrementRetryCountOnTxFailure(WifiRemoteStation *station, Ptr< WifiPsdu > psdu)
Increment the retry count (if needed) for the given PSDU, whose transmission failed.
ProtectionMode m_htProtectionMode
Protection mode for HT stations when non-HT stations are detected.
WifiMode GetDefaultModeForSta(const WifiRemoteStation *st) const
Return the default MCS to use to transmit frames to the given station.
void AdjustTxVectorForIcf(WifiTxVector &txVector) const
Adjust the TXVECTOR for an initial Control frame to ensure that the modulation class is non-HT and th...
std::array< uint32_t, AC_BE_NQOS > m_slrc
long retry count per AC
WifiRemoteStation * Lookup(Mac48Address address) const
Return the station associated with the given address.
uint32_t GetFragmentationThreshold() const
Return the fragmentation threshold.
void AddStationHtOperation(Mac48Address from, const HtOperation &htOperation)
Records HT operation of the remote station.
uint8_t GetNBasicModes() const
Return the number of basic modes we support.
bool UseLdpcForDestination(Mac48Address dest) const
uint32_t m_maxSsrc
Maximum STA short retry count (SSRC).
void SetRtsCtsThreshold(uint32_t threshold)
Sets the RTS threshold.
void AddAllSupportedMcs(Mac48Address address)
Invoked in a STA or AP to store all of the MCS supported by a destination which is also supported loc...
TracedCallback< Mac48Address > m_macTxRtsFailed
The trace source fired when the transmission of a single RTS has failed.
virtual bool DoNeedRts(WifiRemoteStation *station, uint32_t size, bool normally)
Time GetGuardInterval() const
Return the shortest supported HE guard interval duration.
WifiTxVector GetRtsTxVector(Mac48Address address, MHz_u allowedWidth)
void AddStationHeCapabilities(Mac48Address from, const HeCapabilities &heCapabilities)
Records HE capabilities of the remote station.
void DoSetFragmentationThreshold(uint32_t threshold)
Actually sets the fragmentation threshold, it also checks the validity of the given threshold.
bool IsBrandNew(Mac48Address address) const
Return whether the station state is brand new.
virtual void DoReportFinalDataFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
virtual void DoReportRtsOk(WifiRemoteStation *station, double ctsSnr, WifiMode ctsMode, double rtsSnr)=0
This method is a pure virtual method that must be implemented by the sub-class.
void AdjustTxVectorForCtlResponse(WifiTxVector &txVector, MHz_u allowedWidth) const
Adjust the TXVECTOR for a control response frame to ensure that, if appropriate, the non-HT duplicate...
Time m_rtsCtsTxDurationThresh
TX duration threshold for RTS/CTS.
bool GetShortSlotTimeEnabled() const
Return whether the device uses short slot time.
void DoDispose() override
Destructor implementation.
void AddStationMleCommonInfo(Mac48Address from, const std::shared_ptr< CommonInfoBasicMle > &mleCommonInfo)
Records the Common Info field advertised by the given remote station in a Multi-Link Element.
virtual void DoReportDataFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
WifiTxVector GetCtsToSelfTxVector(MHz_u allowedWidth)
Since CTS-to-self parameters are not dependent on the station, it is implemented in wifi remote stati...
Ptr< const VhtOperation > GetStationVhtOperation(Mac48Address from)
Return the VHT operation sent by the remote station.
bool IsLastFragment(Ptr< const WifiMpdu > mpdu, uint32_t fragmentNumber)
void ReportFinalDataFailed(Ptr< const WifiMpdu > mpdu)
Should be invoked after calling ReportDataFailed if frames are dropped.
uint32_t GetNNonErpBasicModes() const
Return the number of non-ERP basic modes we support.
void SetUseNonErpProtection(bool enable)
Enable or disable protection for non-ERP stations.
uint8_t GetNSupported(const WifiRemoteStation *station) const
Return the number of modes supported by the given station.
bool m_useNonHtProtection
flag if protection for non-HT stations against HT transmissions is enabled
bool GetShortPreambleSupported(Mac48Address address) const
Return whether the station supports short PHY preamble or not.
void(* PowerChangeTracedCallback)(double oldPower, double newPower, Mac48Address remoteAddress)
TracedCallback signature for power change events.
Ptr< const EhtOperation > GetStationEhtOperation(Mac48Address from)
Return the EHT operation sent by the remote station.
void AddAllSupportedModes(Mac48Address address)
Invoked in a STA or AP to store all of the modes supported by a destination which is also supported l...
virtual void DoReportAmpduTxStatus(WifiRemoteStation *station, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus, double rxSnr, double dataSnr, MHz_u dataChannelWidth, uint8_t dataNss)
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
std::optional< Mac48Address > GetAffiliatedStaAddress(const Mac48Address &mldAddress) const
Get the address of the remote station operating on this link and affiliated with the MLD having the g...
WifiMode GetNonErpBasicMode(uint8_t i) const
Return a basic mode from the set of basic modes that is not an ERP mode.
std::list< Ptr< WifiMpdu > > GetMpdusToDropOnTxFailure(Ptr< WifiPsdu > psdu)
Increment the retry count for all the MPDUs (if needed) in the given PSDU and find the MPDUs to drop ...
WifiTxVector GetDataTxVector(const WifiMacHeader &header, MHz_u allowedWidth)
std::optional< dBm_u > GetMostRecentRssi(Mac48Address address) const
void ReportRtsOk(const WifiMacHeader &header, double ctsSnr, WifiMode ctsMode, double rtsSnr)
Should be invoked whenever we receive the CTS associated to an RTS we just sent.
Ptr< WifiPhy > GetPhy() const
Return the WifiPhy.
void AddSupportedMcs(Mac48Address address, WifiMode mcs)
Record the MCS index supported by the station.
std::optional< std::reference_wrapper< CommonInfoBasicMle::EmlCapabilities > > GetStationEmlCapabilities(const Mac48Address &from)
WifiTxVector GetBlockAckTxVector(Mac48Address to, const WifiTxVector &dataTxVector) const
Return a TXVECTOR for the BlockAck frame given the destination and the mode of the Data used by the s...
void RemoveAllSupportedMcs(Mac48Address address)
Invoked in a STA or AP to delete all of the supported MCS by a destination.
void ReportRxOk(Mac48Address address, RxSignalInfo rxSignalInfo, const WifiTxVector &txVector)
uint32_t DoGetFragmentationThreshold() const
Return the current fragmentation threshold.
MHz_u GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
TracedCallback< Mac48Address > m_macTxFinalRtsFailed
The trace source fired when the transmission of a RTS has exceeded the maximum number of attempts.
WifiMode GetNonUnicastMode() const
Return a mode for non-unicast packets.
bool m_shortPreambleEnabled
flag if short PHY preamble is enabled
void RecordAdhocPeer(Mac48Address address)
Records that the STA is an adhoc peer.
WifiTxVector GetGroupcastTxVector(const WifiMacHeader &header, MHz_u allowedWidth)
Return the TXVECTOR to use for a groupcast packet.
bool GetShortSlotTimeSupported(Mac48Address address) const
Return whether the station supports short ERP slot time or not.
void SetShortPreambleEnabled(bool enable)
Enable or disable short PHY preambles.
WifiMode GetDefaultMcs() const
Return the default Modulation and Coding Scheme (MCS) index.
Ptr< WifiPhy > m_wifiPhy
This is a pointer to the WifiPhy associated with this WifiRemoteStationManager that is set on call to...
void AddBasicMcs(WifiMode mcs)
Add a given Modulation and Coding Scheme (MCS) index to the set of basic MCS.
uint8_t m_defaultTxPowerLevel
Default transmission power level.
bool GetErpOfdmSupported(const Mac48Address &address) const
Return whether the station supports ERP OFDM or not.
static TypeId GetTypeId()
Get the type ID.
WifiMode m_nonUnicastMode
Transmission mode for non-unicast Data frames.
void SetUseNonHtProtection(bool enable)
Enable or disable protection for non-HT stations.
MHz_u GetChannelWidthSupported(Mac48Address address) const
Return the channel width supported by the station.
bool IsAssociated(Mac48Address address) const
Return whether the station associated.
Ptr< const HtCapabilities > GetStationHtCapabilities(Mac48Address from)
Return the HT capabilities sent by the remote station.
bool IsAdhocPeer(Mac48Address address) const
Return whether the station state is a known adhoc peer.
bool NeedFragmentation(Ptr< const WifiMpdu > mpdu)
void ReportAmpduTxStatus(Mac48Address address, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus, double rxSnr, double dataSnr, const WifiTxVector &dataTxVector)
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
Ptr< const He6GhzBandCapabilities > GetStationHe6GhzCapabilities(const Mac48Address &from) const
Return the HE 6 GHz Band Capabilities sent by a remote station.
bool GetDsssSupported(const Mac48Address &address) const
Return whether the station supports DSSS or not.
uint32_t GetFragmentOffset(Ptr< const WifiMpdu > mpdu, uint32_t fragmentNumber)
void SetQosSupport(Mac48Address from, bool qosSupported)
Records QoS support of the remote station.
void AddStationHe6GhzCapabilities(const Mac48Address &from, const He6GhzBandCapabilities &he6GhzCapabilities)
Records HE 6 GHz Band Capabilities of a remote station.
WifiRemoteStationInfo GetInfo(Mac48Address address)
bool GetOfdmSupported(const Mac48Address &address) const
Return whether the station supports OFDM or not.
void(* RateChangeTracedCallback)(DataRate oldRate, DataRate newRate, Mac48Address remoteAddress)
TracedCallback signature for rate change events.
uint32_t GetFragmentSize(Ptr< const WifiMpdu > mpdu, uint32_t fragmentNumber)
uint8_t GetNBasicMcs() const
Return the number of basic MCS index.
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
bool GetHtSupported() const
Return whether the device has HT capability support enabled on the link this manager is associated wi...
void RecordWaitAssocTxOk(Mac48Address address)
Records that we are waiting for an ACK for the association response we sent.
void SetFragmentationThreshold(uint32_t threshold)
Sets a fragmentation threshold.
Ptr< WifiMac > m_wifiMac
This is a pointer to the WifiMac associated with this WifiRemoteStationManager that is set on call to...
void RecordGotAssocTxOk(Mac48Address address)
Records that we got an ACK for the association response we sent.
void AddStationVhtCapabilities(Mac48Address from, const VhtCapabilities &vhtCapabilities)
Records VHT capabilities of the remote station.
bool GetLdpcSupported() const
Return whether the device has LDPC support enabled.
bool GetEhtSupported() const
Return whether the device has EHT capability support enabled.
void AddSupportedMode(Mac48Address address, WifiMode mode)
Invoked in a STA or AP to store the set of modes supported by a destination which is also supported l...
std::shared_ptr< WifiRemoteStationState > LookupState(Mac48Address address) const
Return the state of the station associated with the given address.
Ptr< WifiMac > GetMac() const
Return the WifiMac.
bool m_incrRetryCountUnderBa
whether to increment the retry count of frames that are part of a Block Ack agreement
WifiMode GetNonErpSupported(const WifiRemoteStation *station, uint8_t i) const
Return whether non-ERP mode associated with the specified station at the specified index.
std::array< uint32_t, AC_BE_NQOS > m_ssrc
short retry count per AC
void AddStationEhtCapabilities(Mac48Address from, const EhtCapabilities &ehtCapabilities)
Records EHT capabilities of the remote station.
Ptr< const EhtCapabilities > GetStationEhtCapabilities(Mac48Address from)
Return the EHT capabilities sent by the remote station.
virtual std::list< Ptr< WifiMpdu > > DoGetMpdusToDropOnTxFailure(WifiRemoteStation *station, Ptr< WifiPsdu > psdu)
Find the MPDUs to drop (possibly based on their frame retry count) in the given PSDU,...
void RecordAssocRefused(Mac48Address address)
Records that association request was refused.
bool IsInPsMode(const Mac48Address &address) const
Return whether the STA is currently in Power Save mode.
void ReportFinalRtsFailed(const WifiMacHeader &header)
Should be invoked after calling ReportRtsFailed if frames are dropped.
StationStates m_states
States of known stations.
std::unordered_map< Mac48Address, WifiRemoteStation *, WifiAddressHash > Stations
A map of WifiRemoteStations with Mac48Address as key.
WifiTxVector GetCtsTxVector(Mac48Address to, WifiMode rtsTxMode) const
Return a TXVECTOR for the CTS frame given the destination and the mode of the RTS used by the sender.
bool NeedCtsToSelf(const WifiTxVector &txVector, const WifiMacHeader &header)
Return if we need to do CTS-to-self before sending a DATA.
void SetMaxSsrc(uint32_t maxSsrc)
Sets the maximum STA short retry count (SSRC).
Ptr< const HeCapabilities > GetStationHeCapabilities(Mac48Address from)
Return the HE capabilities sent by the remote station.
WifiMode GetBasicMcs(uint8_t i) const
Return the MCS at the given list index.
uint8_t GetNMcsSupported(Mac48Address address) const
Return the number of MCS supported by the station.
TracedCallback< Mac48Address > m_macTxDataFailed
The trace source fired when the transmission of a single data packet has failed.
uint16_t GetStaId(Mac48Address address, const WifiTxVector &txVector) const
If the given TXVECTOR is used for a MU transmission, return the STAID of the station with the given a...
virtual void DoReportDataOk(WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr, MHz_u dataChannelWidth, uint8_t dataNss)=0
This method is a pure virtual method that must be implemented by the sub-class.
WifiMode GetBasicMode(uint8_t i) const
Return a basic mode from the set of basic modes.
void AddSupportedPhyPreamble(Mac48Address address, bool isShortPreambleSupported)
Record whether the short PHY preamble is supported by the station.
bool GetEmlsrSupported(const Mac48Address &address) const
Ptr< const ExtendedCapabilities > GetStationExtendedCapabilities(const Mac48Address &from)
Return the extended capabilities sent by the remote station.
bool GetShortGuardIntervalSupported() const
Return whether the device has SGI support enabled.
Mac48Address GetAddress(const WifiRemoteStation *station) const
Return the address of the station.
Ptr< const HtOperation > GetStationHtOperation(Mac48Address from)
Return the HT operation sent by the remote station.
virtual void SetupPhy(const Ptr< WifiPhy > phy)
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
virtual void DoReportRtsFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
void SetDefaultTxPowerLevel(uint8_t txPower)
Set the default transmission power level.
void RecordDisassociated(Mac48Address address)
Records that the STA was disassociated.
Stations m_stations
Information for each known stations.
virtual WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)=0
WifiMode GetMcsSupported(const WifiRemoteStation *station, uint8_t i) const
Return the WifiMode supported by the specified station at the specified index.
std::optional< std::reference_wrapper< CommonInfoBasicMle::MldCapabilities > > GetStationMldCapabilities(const Mac48Address &from)
uint32_t GetNNonErpSupported(const WifiRemoteStation *station) const
Return the number of non-ERP modes supported by the given station.
uint32_t m_maxSlrc
Maximum STA long retry count (SLRC).
virtual WifiRemoteStation * DoCreateStation() const =0
void Reset()
Reset the station, invoked in a STA upon dis-association or in an AP upon reboot.
bool GetUseNonErpProtection() const
Return whether the device supports protection of non-ERP stations.
bool IsAssocRefused(Mac48Address address) const
Return whether we refused an association request from the given station.
void SetAssociationId(Mac48Address remoteAddress, uint16_t aid)
Record the AID of a remote station.
bool GetVhtSupported() const
Return whether the device has VHT capability support enabled on the link this manager is associated w...
Ptr< const VhtCapabilities > GetStationVhtCapabilities(Mac48Address from)
Return the VHT capabilities sent by the remote station.
void AddStationHtCapabilities(Mac48Address from, const HtCapabilities &htCapabilities)
Records HT capabilities of the remote station.
ProtectionMode m_erpProtectionMode
Protection mode for ERP stations when non-ERP stations are detected.
WifiModeList m_bssBasicRateSet
This member is the list of WifiMode objects that comprise the BSSBasicRateSet parameter.
ProtectionMode
ProtectionMode enumeration.
void ReportDataOk(Ptr< const WifiMpdu > mpdu, double ackSnr, WifiMode ackMode, double dataSnr, WifiTxVector dataTxVector)
Should be invoked whenever we receive the ACK associated to a data packet we just sent.
void ReportRtsFailed(const WifiMacHeader &header)
Should be invoked whenever the RtsTimeout associated to a transmission attempt expires.
void AddSupportedErpSlotTime(Mac48Address address, bool isShortSlotTimeSupported)
Record whether the short ERP slot time is supported by the station.
bool GetShortPreambleEnabled() const
Return whether the device uses short PHY preambles.
uint8_t m_linkId
the ID of the link this object is associated with
WifiMode GetSupported(const WifiRemoteStation *station, uint8_t i) const
Return whether mode associated with the specified station at the specified index.
std::unordered_map< Mac48Address, std::shared_ptr< WifiRemoteStationState >, WifiAddressHash > StationStates
A map of WifiRemoteStationStates with Mac48Address as key.
bool GetHeSupported() const
Return whether the device has HE capability support enabled.
virtual void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)=0
This method is a pure virtual method that must be implemented by the sub-class.
WifiMode GetDefaultMode() const
Return the default transmission mode.
void SetEmlsrEnabled(const Mac48Address &from, bool emlsrEnabled)
void AddStationExtendedCapabilities(Mac48Address from, const ExtendedCapabilities &extendedCapabilities)
Records extended capabilities of the remote station.
void ResetState(Mac48Address address) const
Reset the state of the station corresponding to the given address (if one exists).
void AddStationVhtOperation(Mac48Address from, const VhtOperation &vhtOperation)
Records VHT operation of the remote station.
void RecordGotAssocTxFailed(Mac48Address address)
Records that we missed an ACK for the association response we sent.
std::optional< Mac48Address > GetMldAddress(const Mac48Address &address) const
Get the address of the MLD the given station is affiliated with, if any.
virtual void DoReportFinalRtsFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
virtual WifiTxVector GetBlockAckReqTxVector(Mac48Address to, const WifiTxVector &dataTxVector) const
Return a TXVECTOR for a BlockAckReq frame sent in a frame exchange sequence involving the transmissio...
void AddStationEhtOperation(Mac48Address from, const EhtOperation &ehtOperation)
Records EHT operation of the remote station.
virtual void SetupMac(const Ptr< WifiMac > mac)
Set up MAC associated with this device since it is the object that knows the full set of timing param...
void SetLinkId(uint8_t linkId)
Set the ID of the link this Remote Station Manager is associated with.
bool NeedRts(const WifiMacHeader &header, const WifiTxParameters &txParams)
uint32_t m_rtsCtsThreshold
Threshold for RTS/CTS.
bool m_useNonErpProtection
flag if protection for non-ERP stations against ERP transmissions is enabled
WifiMode GetControlAnswerMode(WifiMode reqMode) const
Get control answer mode function.
bool m_shortSlotTimeEnabled
flag if short slot time is enabled
bool IsWaitAssocTxOk(Mac48Address address) const
Return whether we are waiting for an ACK for the association response we sent.
void SetMaxSlrc(uint32_t maxSlrc)
Sets the maximum STA long retry count (SLRC).
TracedCallback< Mac48Address > m_macTxFinalDataFailed
The trace source fired when the transmission of a data packet has exceeded the maximum number of atte...
bool GetUseNonHtProtection() const
Return whether the device supports protection of non-HT stations.
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism,...
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double MHz_u
MHz weak type.
Definition wifi-units.h:31
std::vector< WifiMode > WifiModeList
In various parts of the code, folk are interested in maintaining a list of transmission modes.
Definition wifi-mode.h:289
RxSignalInfo structure containing info on the received signal.
Definition wifi-types.h:85
Function object to compute the hash of a MAC address.
Definition qos-utils.h:47
hold per-remote-station state.
WifiRemoteStationState * m_state
Remote station state.
std::pair< dBm_u, Time > m_rssiAndUpdateTimePair
RSSI of the most recent packet received from the remote station along with update time.
A struct that holds information about each remote station.
std::shared_ptr< CommonInfoBasicMle > m_mleCommonInfo
remote station Multi-Link Element Common Info
Mac48Address m_address
Mac48Address of the remote station.
bool m_shortSlotTime
Flag if short ERP slot time is supported by the remote station.
bool m_dsssSupported
Flag if DSSS is supported by the remote station.
Ptr< const EhtOperation > m_ehtOperation
remote station EHT operation
MHz_u m_channelWidth
Channel width supported by the remote station.
uint16_t m_aid
AID of the remote station (unused if this object is installed on a non-AP station).
bool m_ofdmSupported
Flag if OFDM is supported by the remote station.
uint8_t m_ness
Number of extended spatial streams of the remote station.
bool m_aggregation
Flag if MPDU aggregation is used by the remote station.
bool m_qosSupported
Flag if QoS is supported by the station.
WifiModeList m_operationalRateSet
This member is the list of WifiMode objects that comprise the OperationalRateSet parameter for this r...
WifiModeList m_operationalMcsSet
operational MCS set
bool m_isInPsMode
Flag if the STA is currently in PS mode.
Ptr< const EhtCapabilities > m_ehtCapabilities
remote station EHT capabilities
bool m_shortPreamble
Flag if short PHY preamble is supported by the remote station.
bool m_erpOfdmSupported
Flag if ERP OFDM is supported by the remote station.
Ptr< const VhtCapabilities > m_vhtCapabilities
remote station VHT capabilities
Ptr< const He6GhzBandCapabilities > m_he6GhzBandCapabilities
remote station HE 6GHz band capabilities
WifiRemoteStationInfo m_info
remote station info
bool m_emlsrEnabled
whether EMLSR mode is enabled on this link
Ptr< const HeOperation > m_heOperation
remote station HE operation
Ptr< const HtCapabilities > m_htCapabilities
remote station HT capabilities
Time m_guardInterval
HE Guard interval durationsupported by the remote station.
Ptr< const ExtendedCapabilities > m_extendedCapabilities
remote station extended capabilities
Ptr< const VhtOperation > m_vhtOperation
remote station VHT operation
Ptr< const HeCapabilities > m_heCapabilities
remote station HE capabilities
Ptr< const HtOperation > m_htOperation
remote station HT operation