INET Framework for OMNeT++/OMNEST
inet::ieee80211::AARFRateControl Class Reference

Implements the ARF and AARF rate control algorithms. More...

#include <AARFRateControl.h>

Inheritance diagram for inet::ieee80211::AARFRateControl:
inet::ieee80211::RateControlBase inet::ieee80211::ModeSetListener inet::ieee80211::IRateControl

Public Member Functions

virtual const IIeee80211ModegetRate () override
 
virtual void frameTransmitted (const Ieee80211Frame *frame, int retryCount, bool isSuccessful, bool isGivenUp) override
 
virtual void frameReceived (const Ieee80211Frame *frame, const Ieee80211ReceptionIndication *receptionIndication) override
 
- Public Member Functions inherited from inet::ieee80211::IRateControl
virtual ~IRateControl ()
 

Protected Member Functions

virtual int numInitStages () const override
 
virtual void initialize (int stage) override
 
virtual void handleMessage (cMessage *msg) override
 
virtual void multiplyIncreaseThreshold (double factor)
 
virtual void resetIncreaseThreshdold ()
 
virtual void resetTimer ()
 
virtual void increaseRateIfTimerIsExpired ()
 
virtual void updateDisplayString ()
 
- Protected Member Functions inherited from inet::ieee80211::RateControlBase
virtual void receiveSignal (cComponent *source, simsignal_t signalID, cObject *obj, cObject *details) override
 
virtual void emitDatarateSignal ()
 
const IIeee80211ModeincreaseRateIfPossible (const IIeee80211Mode *currentMode)
 
const IIeee80211ModedecreaseRateIfPossible (const IIeee80211Mode *currentMode)
 

Protected Attributes

simtime_t timer = SIMTIME_ZERO
 
simtime_t interval = SIMTIME_ZERO
 
bool probing = false
 
int increaseThreshold = -1
 
int maxIncreaseThreshold = -1
 
int decreaseThreshold = -1
 
double factor = -1
 
int numberOfConsSuccTransmissions = 0
 
- Protected Attributes inherited from inet::ieee80211::RateControlBase
const IIeee80211ModecurrentMode = nullptr
 
- Protected Attributes inherited from inet::ieee80211::ModeSetListener
Ieee80211ModeSetmodeSet = nullptr
 

Additional Inherited Members

- Static Public Attributes inherited from inet::ieee80211::RateControlBase
static simsignal_t datarateSignal = cComponent::registerSignal("datarate")
 

Detailed Description

Implements the ARF and AARF rate control algorithms.

Member Function Documentation

void inet::ieee80211::AARFRateControl::frameReceived ( const Ieee80211Frame frame,
const Ieee80211ReceptionIndication receptionIndication 
)
overridevirtual

Implements inet::ieee80211::IRateControl.

128 {
129 }
void inet::ieee80211::AARFRateControl::frameTransmitted ( const Ieee80211Frame frame,
int  retryCount,
bool  isSuccessful,
bool  isGivenUp 
)
overridevirtual

Implements inet::ieee80211::IRateControl.

58 {
60 
61  if (!isSuccessful && probing) // probing packet failed
62  {
67  EV_DETAIL << "Decreased rate to " << *currentMode << endl;
69  resetTimer();
70  }
71  else if (!isSuccessful && retryCount >= decreaseThreshold - 1) // decreaseThreshold consecutive failed transmissions
72  {
77  EV_DETAIL << "Decreased rate to " << *currentMode << endl;
79  resetTimer();
80  }
81  else if (isSuccessful && retryCount == 0)
83 
85  {
90  EV_DETAIL << "Increased rate to " << *currentMode << endl;
91  resetTimer();
92  probing = true;
93  }
94  else
95  probing = false;
96 
97 }
virtual void resetIncreaseThreshdold()
Definition: AARFRateControl.cc:105
const IIeee80211Mode * increaseRateIfPossible(const IIeee80211Mode *currentMode)
Definition: RateControlBase.cc:31
double factor
Definition: AARFRateControl.h:38
bool probing
Definition: AARFRateControl.h:34
virtual void increaseRateIfTimerIsExpired()
Definition: AARFRateControl.cc:115
int decreaseThreshold
Definition: AARFRateControl.h:37
virtual void resetTimer()
Definition: AARFRateControl.cc:110
virtual void updateDisplayString()
Definition: AARFRateControl.cc:52
int increaseThreshold
Definition: AARFRateControl.h:35
const IIeee80211Mode * currentMode
Definition: RateControlBase.h:33
virtual void emitDatarateSignal()
Definition: RateControlBase.cc:43
virtual void multiplyIncreaseThreshold(double factor)
Definition: AARFRateControl.cc:99
int numberOfConsSuccTransmissions
Definition: AARFRateControl.h:40
const IIeee80211Mode * decreaseRateIfPossible(const IIeee80211Mode *currentMode)
Definition: RateControlBase.cc:37
const IIeee80211Mode * inet::ieee80211::AARFRateControl::getRate ( )
overridevirtual

Implements inet::ieee80211::IRateControl.

132 {
133  Enter_Method_Silent("getRate()");
135  EV_INFO << "The current mode is " << currentMode << " the net bitrate is " << currentMode->getDataMode()->getNetBitrate() << std::endl;
136  return currentMode;
137 }
virtual const IIeee80211DataMode * getDataMode() const =0
virtual void increaseRateIfTimerIsExpired()
Definition: AARFRateControl.cc:115
virtual bps getNetBitrate() const =0
const IIeee80211Mode * currentMode
Definition: RateControlBase.h:33
void inet::ieee80211::AARFRateControl::handleMessage ( cMessage *  msg)
overrideprotectedvirtual
48 {
49  throw cRuntimeError("This module doesn't handle self messages");
50 }
void inet::ieee80211::AARFRateControl::increaseRateIfTimerIsExpired ( )
protectedvirtual

Referenced by frameTransmitted(), and getRate().

116 {
117  if (simTime() - timer >= interval)
118  {
122  EV_DETAIL << "Increased rate to " << *currentMode << endl;
123  resetTimer();
124  }
125 }
const IIeee80211Mode * increaseRateIfPossible(const IIeee80211Mode *currentMode)
Definition: RateControlBase.cc:31
simtime_t timer
Definition: AARFRateControl.h:32
virtual void resetTimer()
Definition: AARFRateControl.cc:110
virtual void updateDisplayString()
Definition: AARFRateControl.cc:52
const IIeee80211Mode * currentMode
Definition: RateControlBase.h:33
virtual void emitDatarateSignal()
Definition: RateControlBase.cc:43
simtime_t interval
Definition: AARFRateControl.h:33
void inet::ieee80211::AARFRateControl::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::ieee80211::RateControlBase.

26 {
28  if (stage == INITSTAGE_LOCAL) {
29  factor = par("increaseThresholdFactor");
30  increaseThreshold = par("increaseThreshold");
31  maxIncreaseThreshold = par("maxIncreaseThreshold");
32  decreaseThreshold = par("decreaseThreshold");
33  interval = par("interval");
34  WATCH(factor);
35  WATCH(increaseThreshold);
36  WATCH(maxIncreaseThreshold);
37  WATCH(decreaseThreshold);
38  WATCH(interval);
39  WATCH(probing);
41  }
42  else if (stage == INITSTAGE_LINK_LAYER_2) {
44  }
45 }
double factor
Definition: AARFRateControl.h:38
bool probing
Definition: AARFRateControl.h:34
int decreaseThreshold
Definition: AARFRateControl.h:37
Local initializations.
Definition: InitStages.h:35
virtual void updateDisplayString()
Definition: AARFRateControl.cc:52
int increaseThreshold
Definition: AARFRateControl.h:35
simtime_t interval
Definition: AARFRateControl.h:33
Additional link-layer initializations that depend on the previous stage.
Definition: InitStages.h:64
int numberOfConsSuccTransmissions
Definition: AARFRateControl.h:40
int maxIncreaseThreshold
Definition: AARFRateControl.h:36
virtual void initialize(int stage) override
Definition: RateControlBase.cc:26
void inet::ieee80211::AARFRateControl::multiplyIncreaseThreshold ( double  factor)
protectedvirtual

Referenced by frameTransmitted().

100 {
103 }
double factor
Definition: AARFRateControl.h:38
int increaseThreshold
Definition: AARFRateControl.h:35
int maxIncreaseThreshold
Definition: AARFRateControl.h:36
virtual int inet::ieee80211::AARFRateControl::numInitStages ( ) const
inlineoverrideprotectedvirtual

Reimplemented from inet::ieee80211::RateControlBase.

43 { return NUM_INIT_STAGES; }
The number of initialization stages.
Definition: InitStages.h:116
void inet::ieee80211::AARFRateControl::resetIncreaseThreshdold ( )
protectedvirtual

Referenced by frameTransmitted().

106 {
107  increaseThreshold = par("increaseThreshold");
108 }
int increaseThreshold
Definition: AARFRateControl.h:35
void inet::ieee80211::AARFRateControl::resetTimer ( )
protectedvirtual

Referenced by frameTransmitted(), and increaseRateIfTimerIsExpired().

111 {
112  timer = simTime();
113 }
simtime_t timer
Definition: AARFRateControl.h:32
void inet::ieee80211::AARFRateControl::updateDisplayString ( )
protectedvirtual

Referenced by frameTransmitted(), increaseRateIfTimerIsExpired(), and initialize().

53 {
54  getDisplayString().setTagArg("t", 0, currentMode->getName());
55 }
const IIeee80211Mode * currentMode
Definition: RateControlBase.h:33
virtual const char * getName() const =0

Member Data Documentation

int inet::ieee80211::AARFRateControl::decreaseThreshold = -1
protected

Referenced by frameTransmitted(), and initialize().

double inet::ieee80211::AARFRateControl::factor = -1
protected
int inet::ieee80211::AARFRateControl::increaseThreshold = -1
protected
simtime_t inet::ieee80211::AARFRateControl::interval = SIMTIME_ZERO
protected
int inet::ieee80211::AARFRateControl::maxIncreaseThreshold = -1
protected
int inet::ieee80211::AARFRateControl::numberOfConsSuccTransmissions = 0
protected

Referenced by frameTransmitted(), and initialize().

bool inet::ieee80211::AARFRateControl::probing = false
protected

Referenced by frameTransmitted(), and initialize().

simtime_t inet::ieee80211::AARFRateControl::timer = SIMTIME_ZERO
protected

The documentation for this class was generated from the following files: