author | Ghada Badawy <gbadawy@gmail.com> |
Tue, 13 Aug 2013 22:05:25 -0700 | |
changeset 10139 | 17a71cd49da3 |
parent 7385 | 10beb0e53130 |
child 10483 | e3a02ed14587 |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
7141
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2351 | 2 |
/* |
3 |
* Copyright (c) 2005,2006 INRIA |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
2351 | 7 |
* published by the Free Software Foundation; |
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 |
* |
|
18 |
* Author: Federico Maguolo <maguolof@dei.unipd.it> |
|
19 |
*/ |
|
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
20 |
#ifndef RRAA_WIFI_MANAGER_H |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
21 |
#define RRAA_WIFI_MANAGER_H |
2351 | 22 |
|
23 |
#include "ns3/nstime.h" |
|
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
24 |
#include "wifi-remote-station-manager.h" |
2351 | 25 |
|
26 |
namespace ns3 { |
|
27 |
||
6340 | 28 |
struct RraaWifiRemoteStation; |
2351 | 29 |
|
30 |
/** |
|
31 |
* \brief Robust Rate Adaptation Algorithm |
|
7139
79dd02ed46ec
doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents:
6852
diff
changeset
|
32 |
* \ingroup wifi |
2351 | 33 |
* |
34 |
* This is an implementation of RRAA as described in |
|
35 |
* "Robust rate adaptation for 802.11 wireless networks" |
|
36 |
* by "Starsky H. Y. Wong", "Hao Yang", "Songwu Lu", and, |
|
37 |
* "Vaduvur Bharghavan" published in Mobicom 06. |
|
38 |
*/ |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
39 |
class RraaWifiManager : public WifiRemoteStationManager |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
40 |
{ |
2351 | 41 |
public: |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
42 |
static TypeId GetTypeId (void); |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
43 |
|
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
44 |
RraaWifiManager (); |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
45 |
virtual ~RraaWifiManager (); |
6065 | 46 |
|
2351 | 47 |
private: |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
48 |
struct ThresholdsItem |
6065 | 49 |
{ |
50 |
uint32_t datarate; |
|
51 |
double pori; |
|
52 |
double pmtl; |
|
53 |
uint32_t ewnd; |
|
54 |
}; |
|
55 |
||
56 |
// overriden from base class |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
57 |
virtual WifiRemoteStation * DoCreateStation (void) const; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
58 |
virtual void DoReportRxOk (WifiRemoteStation *station, |
6065 | 59 |
double rxSnr, WifiMode txMode); |
60 |
virtual void DoReportRtsFailed (WifiRemoteStation *station); |
|
61 |
virtual void DoReportDataFailed (WifiRemoteStation *station); |
|
62 |
virtual void DoReportRtsOk (WifiRemoteStation *station, |
|
63 |
double ctsSnr, WifiMode ctsMode, double rtsSnr); |
|
64 |
virtual void DoReportDataOk (WifiRemoteStation *station, |
|
65 |
double ackSnr, WifiMode ackMode, double dataSnr); |
|
66 |
virtual void DoReportFinalRtsFailed (WifiRemoteStation *station); |
|
67 |
virtual void DoReportFinalDataFailed (WifiRemoteStation *station); |
|
10139 | 68 |
virtual WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint32_t size); |
69 |
virtual WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station); |
|
6065 | 70 |
virtual bool DoNeedRts (WifiRemoteStation *st, |
71 |
Ptr<const Packet> packet, bool normally); |
|
72 |
virtual bool IsLowLatency (void) const; |
|
73 |
||
74 |
uint32_t GetMaxRate (RraaWifiRemoteStation *station); |
|
75 |
uint32_t GetMinRate (RraaWifiRemoteStation *station); |
|
76 |
void CheckTimeout (RraaWifiRemoteStation *station); |
|
77 |
void RunBasicAlgorithm (RraaWifiRemoteStation *station); |
|
78 |
void ARts (RraaWifiRemoteStation *station); |
|
79 |
void ResetCountersBasic (RraaWifiRemoteStation *station); |
|
80 |
struct ThresholdsItem GetThresholds (WifiMode mode) const; |
|
81 |
struct ThresholdsItem GetThresholds (RraaWifiRemoteStation *station, uint32_t rate) const; |
|
82 |
||
2351 | 83 |
bool m_basic; |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
84 |
Time m_timeout; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
85 |
uint32_t m_ewndfor54; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
86 |
uint32_t m_ewndfor48; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
87 |
uint32_t m_ewndfor36; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
88 |
uint32_t m_ewndfor24; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
89 |
uint32_t m_ewndfor18; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
90 |
uint32_t m_ewndfor12; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
91 |
uint32_t m_ewndfor9; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
92 |
uint32_t m_ewndfor6; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
93 |
double m_porifor48; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
94 |
double m_porifor36; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
95 |
double m_porifor24; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
96 |
double m_porifor18; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
97 |
double m_porifor12; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
98 |
double m_porifor9; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
99 |
double m_porifor6; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
100 |
double m_pmtlfor54; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
101 |
double m_pmtlfor48; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
102 |
double m_pmtlfor36; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
103 |
double m_pmtlfor24; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
104 |
double m_pmtlfor18; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
105 |
double m_pmtlfor12; |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
106 |
double m_pmtlfor9; |
2351 | 107 |
}; |
108 |
||
109 |
} // namespace ns3 |
|
110 |
||
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2351
diff
changeset
|
111 |
#endif /* RRAA_WIFI_MANAGER_H */ |