src/wifi/model/minstrel-wifi-manager.h
author Lalith Suresh <suresh.lalith@gmail.com>
Fri, 04 Mar 2011 01:26:54 +0000
changeset 6852 8f1a53d3f6ca
parent 6848 src/devices/wifi/model/minstrel-wifi-manager.h@1f453ad50ef3
child 7139 79dd02ed46ec
permissions -rw-r--r--
Moves devices/* and routing/* to src/
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4703
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
     2
/* 
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
     3
 * Copyright (c) 2009 Duy Nguyen 
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
     4
 * 
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
     8
 *
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    12
 * GNU General Public License for more details.
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    13
 *
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    17
 * 
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    18
 * Author: Duy Nguyen <duy@soe.ucsc.edu> 
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    19
 */
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    20
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    21
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    22
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    23
#ifndef MINSTREL_WIFI_MANAGER_H
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    24
#define MINSTREL_WIFI_MANAGER_H
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    25
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    26
#include "wifi-remote-station-manager.h"
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    27
#include "wifi-mode.h"
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    28
#include "ns3/nstime.h"
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    29
#include <vector>
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    30
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    31
/**
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    32
 * \author Duy Nguyen
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    33
 * \brief Implementation of Minstrel Rate Control Algorithm 
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    34
 *
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    35
 * Porting Minstrel from Madwifi and Linux Kernel 
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    36
 * http://linuxwireless.org/en/developers/Documentation/mac80211/RateControl/minstrel
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    37
 */
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    38
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    39
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    40
namespace ns3 {
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    41
6340
fe24c9edacb6 fixed bug 924
Quincy Tse <quincy.tse@gmail.com>
parents: 6339
diff changeset
    42
struct MinstrelWifiRemoteStation;
4703
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    43
6337
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    44
/**
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    45
 * A struct to contain all information related to a data rate
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    46
 */
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    47
struct RateInfo
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    48
{
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    49
  /**
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    50
   * Perfect transmission time calculation, or frame calculation
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    51
   * Given a bit rate and a packet length n bytes
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    52
   */
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    53
  Time perfectTxTime;
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    54
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    55
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    56
  uint32_t retryCount;  ///< retry limit
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    57
  uint32_t adjustedRetryCount;  ///< adjust the retry limit for this rate
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    58
  uint32_t numRateAttempt;  ///< how many number of attempts so far
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    59
    uint32_t numRateSuccess;  ///< number of successful pkts
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    60
  uint32_t prob;  ///< (# pkts success )/(# total pkts)
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    61
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    62
  /**
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    63
   * EWMA calculation
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    64
   * ewma_prob =[prob *(100 - ewma_level) + (ewma_prob_old * ewma_level)]/100
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    65
   */
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    66
  uint32_t ewmaProb;
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    67
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    68
  uint32_t prevNumRateAttempt;  ///< from last rate
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    69
  uint32_t prevNumRateSuccess;  ///< from last rate
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    70
  uint64_t successHist;  ///< aggregate of all successes
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    71
  uint64_t attemptHist;  ///< aggregate of all attempts
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    72
  uint32_t throughput;  ///< throughput of a rate
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    73
};
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    74
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    75
/**
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    76
 * Data structure for a Minstrel Rate table
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    77
 * A vector of a struct RateInfo
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    78
 */
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    79
typedef std::vector<struct RateInfo> MinstrelRate;
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    80
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    81
/**
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    82
 * Data structure for a Sample Rate table
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    83
 * A vector of a vector uint32_t
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    84
 */
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    85
typedef std::vector<std::vector<uint32_t> > SampleRate;
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    86
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
    87
4703
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    88
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    89
class MinstrelWifiManager : public WifiRemoteStationManager
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    90
{
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    91
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    92
public:
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    93
  static TypeId GetTypeId (void);
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    94
  MinstrelWifiManager ();
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    95
  virtual ~MinstrelWifiManager();
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    96
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    97
  virtual void SetupPhy (Ptr<WifiPhy> phy);
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
    98
6065
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
    99
private:
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   100
  // overriden from base class
6339
84cbcc1a3f16 fixed bug 922
Nicola Baldo <nbaldo@cttc.es>
parents: 6337
diff changeset
   101
  virtual WifiRemoteStation *DoCreateStation (void) const;
6065
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   102
  virtual void DoReportRxOk (WifiRemoteStation *station, 
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   103
                             double rxSnr, WifiMode txMode);
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   104
  virtual void DoReportRtsFailed (WifiRemoteStation *station);
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   105
  virtual void DoReportDataFailed (WifiRemoteStation *station);
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   106
  virtual void DoReportRtsOk (WifiRemoteStation *station,
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   107
                              double ctsSnr, WifiMode ctsMode, double rtsSnr);
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   108
  virtual void DoReportDataOk (WifiRemoteStation *station,
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   109
                               double ackSnr, WifiMode ackMode, double dataSnr);
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   110
  virtual void DoReportFinalRtsFailed (WifiRemoteStation *station);
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   111
  virtual void DoReportFinalDataFailed (WifiRemoteStation *station);
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   112
  virtual WifiMode DoGetDataMode (WifiRemoteStation *station, uint32_t size);
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   113
  virtual WifiMode DoGetRtsMode (WifiRemoteStation *station);
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   114
  virtual bool IsLowLatency (void) const;
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   115
4703
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
   116
  /// for estimating the TxTime of a packet with a given mode  
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
   117
  Time GetCalcTxTime (WifiMode mode) const;
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
   118
  void AddCalcTxTime (WifiMode mode, Time t);
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
   119
6065
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   120
  /// update the number of retries and reset accordingly
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   121
  void UpdateRetry (MinstrelWifiRemoteStation *station);
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   122
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   123
  /// getting the next sample from Sample Table
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   124
  uint32_t GetNextSample (MinstrelWifiRemoteStation *station);
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   125
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   126
  /// find a rate to use from Minstrel Table
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   127
  uint32_t FindRate (MinstrelWifiRemoteStation *station);
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   128
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   129
  /// updating the Minstrel Table every 1/10 seconds
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   130
  void UpdateStats (MinstrelWifiRemoteStation *station);
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   131
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   132
  /// initialize Minstrel Table
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   133
  void RateInit (MinstrelWifiRemoteStation *station);
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   134
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   135
  /// initialize Sample Table
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   136
  void InitSampleTable (MinstrelWifiRemoteStation *station);
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   137
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   138
  /// printing Sample Table
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   139
  void PrintSampleTable (MinstrelWifiRemoteStation *station);
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   140
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   141
  /// printing Minstrel Table
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   142
  void PrintTable (MinstrelWifiRemoteStation *station);
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   143
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   144
  void CheckInit (MinstrelWifiRemoteStation *station);  ///< check for initializations
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   145
4703
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
   146
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
   147
  typedef std::vector<std::pair<Time,WifiMode> > TxTime;
6337
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
   148
  MinstrelRate m_minstrelTable;  ///< minstrel table
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
   149
  SampleRate m_sampleTable;  ///< sample table
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
   150
4703
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
   151
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
   152
  TxTime m_calcTxTime;  ///< to hold all the calculated TxTime for all modes
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
   153
  Time m_updateStats;  ///< how frequent do we calculate the stats(1/10 seconds)
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
   154
  double m_lookAroundRate;  ///< the % to try other rates than our current rate 
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
   155
  double m_ewmaLevel;  ///< exponential weighted moving average
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
   156
  uint32_t m_segmentSize;  ///< largest allowable segment size
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
   157
  uint32_t m_sampleCol;  ///< number of sample columns
6065
0f012e7d9128 bug 602
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4703
diff changeset
   158
  uint32_t m_pktLen;  ///< packet length used  for calculate mode TxTime  
6337
92c95748a915 Fixed Bug 802 and Bug 919
Duy Nguyen <duy@soe.ucsc.edu>
parents: 6065
diff changeset
   159
  uint32_t m_nsupported;  ///< modes supported
4703
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
   160
};
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
   161
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
   162
}// namespace ns3
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
   163
e1259e2fdaad add an implementation of the minstrel rate control algorithm
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff changeset
   164
#endif /* MINSTREL_WIFI_MANAGER_H */