A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
aarfcd-wifi-manager.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005,2006 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Federico Maguolo <maguolof@dei.unipd.it>
7 */
8
9#ifndef AARFCD_WIFI_MANAGER_H
10#define AARFCD_WIFI_MANAGER_H
11
12#include "ns3/traced-value.h"
13#include "ns3/wifi-remote-station-manager.h"
14
15namespace ns3
16{
17
18struct AarfcdWifiRemoteStation;
19
20/**
21 * @brief an implementation of the AARF-CD algorithm
22 * @ingroup wifi
23 *
24 * This algorithm was first described in "Efficient Collision Detection for Auto Rate Fallback
25 * Algorithm". The implementation available here was done by Federico Maguolo for a very early
26 * development version of ns-3. Federico died before merging this work in ns-3 itself so his code
27 * was ported to ns-3 later without his supervision.
28 *
29 * This RAA does not support HT modes and will error
30 * exit if the user tries to configure this RAA with a Wi-Fi MAC
31 * that supports 802.11n or higher.
32 */
34{
35 public:
36 /**
37 * @brief Get the type ID.
38 * @return the object TypeId
39 */
40 static TypeId GetTypeId();
42 ~AarfcdWifiManager() override;
43
44 private:
45 void DoInitialize() override;
46 WifiRemoteStation* DoCreateStation() const override;
47 void DoReportRxOk(WifiRemoteStation* station, double rxSnr, WifiMode txMode) override;
48
50 /**
51 * It is important to realize that "recovery" mode starts after failure of
52 * the first transmission after a rate increase and ends at the first successful
53 * transmission. Specifically, recovery mode transcends retransmissions boundaries.
54 * Fundamentally, ARF handles each data transmission independently, whether it
55 * is the initial transmission of a packet or the retransmission of a packet.
56 * The fundamental reason for this is that there is a backoff between each data
57 * transmission, be it an initial transmission or a retransmission.
58 *
59 * @param station the station that we failed to send Data
60 */
63 double ctsSnr,
65 double rtsSnr) override;
67 double ackSnr,
69 double dataSnr,
71 uint8_t dataNss) override;
76 bool DoNeedRts(WifiRemoteStation* station, uint32_t size, bool normally) override;
77
78 /**
79 * Check if the use of RTS for the given station can be turned off.
80 *
81 * @param station the station that we are checking
82 */
84 /**
85 * Increase the RTS window size of the given station.
86 *
87 * @param station the station to increase RTS window
88 */
90 /**
91 * Reset the RTS window of the given station.
92 *
93 * @param station the station to reset RTS window
94 */
96 /**
97 * Turn off RTS for the given station.
98 *
99 * @param station the station to turn RTS off
100 */
102 /**
103 * Turn on RTS for the given station.
104 *
105 * @param station the station to turn RTS on
106 */
108
109 // AARF fields below
110 uint32_t m_minTimerThreshold; ///< minimum timer threshold
111 uint32_t m_minSuccessThreshold; ///< minimum success threshold
112 double m_successK; ///< Multiplication factor for the success threshold
113 uint32_t m_maxSuccessThreshold; ///< maximum success threshold
114 double m_timerK; ///< Multiplication factor for the timer threshold
115
116 // AARF-CD fields below
117 uint32_t m_minRtsWnd; ///< minimum RTS window
118 uint32_t m_maxRtsWnd; ///< maximum RTS window
119 bool m_turnOffRtsAfterRateDecrease; ///< turn off RTS after rate decrease
120 bool m_turnOnRtsAfterRateIncrease; ///< turn on RTS after rate increase
121
122 TracedValue<uint64_t> m_currentRate; //!< Trace rate changes
123};
124
125} // namespace ns3
126
127#endif /* AARFCD_WIFI_MANAGER_H */
an implementation of the AARF-CD algorithm
void ResetRtsWnd(AarfcdWifiRemoteStation *station)
Reset the RTS window of the given station.
bool m_turnOnRtsAfterRateIncrease
turn on RTS after rate increase
double m_timerK
Multiplication factor for the timer threshold.
TracedValue< uint64_t > m_currentRate
Trace rate changes.
uint32_t m_maxSuccessThreshold
maximum success threshold
bool DoNeedRts(WifiRemoteStation *station, uint32_t size, bool normally) override
WifiRemoteStation * DoCreateStation() const override
uint32_t m_minTimerThreshold
minimum timer threshold
uint32_t m_minSuccessThreshold
minimum success threshold
uint32_t m_minRtsWnd
minimum RTS window
bool m_turnOffRtsAfterRateDecrease
turn off RTS after rate decrease
uint32_t m_maxRtsWnd
maximum RTS window
void TurnOffRts(AarfcdWifiRemoteStation *station)
Turn off RTS for the given station.
double m_successK
Multiplication factor for the success threshold.
void DoInitialize() override
Initialize() implementation.
void TurnOnRts(AarfcdWifiRemoteStation *station)
Turn on RTS for the given station.
void DoReportFinalDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station) override
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode) override
This method is a pure virtual method that must be implemented by the sub-class.
void DoReportDataFailed(WifiRemoteStation *station) override
It is important to realize that "recovery" mode starts after failure of the first transmission after ...
static TypeId GetTypeId()
Get the type ID.
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station, MHz_u allowedWidth) override
void DoReportRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
void DoReportDataOk(WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr, MHz_u dataChannelWidth, uint8_t dataNss) override
This method is a pure virtual method that must be implemented by the sub-class.
void DoReportRtsOk(WifiRemoteStation *station, double ctsSnr, WifiMode ctsMode, double rtsSnr) override
This method is a pure virtual method that must be implemented by the sub-class.
void CheckRts(AarfcdWifiRemoteStation *station)
Check if the use of RTS for the given station can be turned off.
void DoReportFinalRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
void IncreaseRtsWnd(AarfcdWifiRemoteStation *station)
Increase the RTS window size of the given station.
Trace classes with value semantics.
a unique identifier for an interface.
Definition type-id.h:49
represent a single transmission mode
Definition wifi-mode.h:40
hold a list of per-remote-station state.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
Every class exported by the ns3 library is enclosed in the ns3 namespace.
hold per-remote-station state for AARF-CD Wifi manager.
hold per-remote-station state.