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