author | Tom Henderson <tomh@tomh.org> |
Mon, 28 Sep 2015 20:27:25 -0700 | |
changeset 11676 | 05ea1489e509 |
parent 11644 | 527ed7692b84 |
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; -*- */ |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
/* |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
3 |
* Copyright (c) 2003,2007 INRIA |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
4 |
* |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
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:
6852
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
* |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
* |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
* |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
*/ |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
|
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
21 |
#include "amrr-wifi-manager.h" |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
#include "ns3/simulator.h" |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
23 |
#include "ns3/log.h" |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
24 |
#include "ns3/uinteger.h" |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
25 |
#include "ns3/double.h" |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
26 |
|
10139 | 27 |
#define Min(a,b) ((a < b) ? a : b) |
28 |
||
10968
2d29fee2b7b8
[Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10652
diff
changeset
|
29 |
namespace ns3 { |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
30 |
|
10968
2d29fee2b7b8
[Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10652
diff
changeset
|
31 |
NS_LOG_COMPONENT_DEFINE ("AmrrWifiRemoteStation"); |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
32 |
|
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10410
diff
changeset
|
33 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10410
diff
changeset
|
34 |
* \brief hold per-remote-station state for AMRR Wifi manager. |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10410
diff
changeset
|
35 |
* |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10410
diff
changeset
|
36 |
* This struct extends from WifiRemoteStation struct to hold additional |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10410
diff
changeset
|
37 |
* information required by the AMRR Wifi manager |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10410
diff
changeset
|
38 |
*/ |
6065 | 39 |
struct AmrrWifiRemoteStation : public WifiRemoteStation |
40 |
{ |
|
41 |
Time m_nextModeUpdate; |
|
42 |
uint32_t m_tx_ok; |
|
43 |
uint32_t m_tx_err; |
|
44 |
uint32_t m_tx_retr; |
|
45 |
uint32_t m_retry; |
|
46 |
uint32_t m_txrate; |
|
47 |
uint32_t m_successThreshold; |
|
48 |
uint32_t m_success; |
|
49 |
bool m_recovery; |
|
50 |
}; |
|
51 |
||
52 |
||
10652
dc18deba4502
[doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10483
diff
changeset
|
53 |
NS_OBJECT_ENSURE_REGISTERED (AmrrWifiManager); |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
54 |
|
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
55 |
TypeId |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
56 |
AmrrWifiManager::GetTypeId (void) |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
57 |
{ |
2602
d9262bff6df2
add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2599
diff
changeset
|
58 |
static TypeId tid = TypeId ("ns3::AmrrWifiManager") |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
59 |
.SetParent<WifiRemoteStationManager> () |
11245
5c781d7e5a25
SetGroupName for wifi module
Tom Henderson <tomh@tomh.org>
parents:
11100
diff
changeset
|
60 |
.SetGroupName ("Wifi") |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
61 |
.AddConstructor<AmrrWifiManager> () |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
62 |
.AddAttribute ("UpdatePeriod", |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
63 |
"The interval between decisions about rate control changes", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2784
diff
changeset
|
64 |
TimeValue (Seconds (1.0)), |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
65 |
MakeTimeAccessor (&AmrrWifiManager::m_updatePeriod), |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
66 |
MakeTimeChecker ()) |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
67 |
.AddAttribute ("FailureRatio", |
6273
8d70de29d514
spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents:
6065
diff
changeset
|
68 |
"Ratio of minimum erroneous transmissions needed to switch to a lower rate", |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
69 |
DoubleValue (1.0 / 3.0), |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
70 |
MakeDoubleAccessor (&AmrrWifiManager::m_failureRatio), |
2599
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2544
diff
changeset
|
71 |
MakeDoubleChecker<double> (0.0, 1.0)) |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
72 |
.AddAttribute ("SuccessRatio", |
6273
8d70de29d514
spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents:
6065
diff
changeset
|
73 |
"Ratio of maximum erroneous transmissions needed to switch to a higher rate", |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
74 |
DoubleValue (1.0 / 10.0), |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
75 |
MakeDoubleAccessor (&AmrrWifiManager::m_successRatio), |
2599
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2544
diff
changeset
|
76 |
MakeDoubleChecker<double> (0.0, 1.0)) |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
77 |
.AddAttribute ("MaxSuccessThreshold", |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
78 |
"Maximum number of consecutive success periods needed to switch to a higher rate", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2784
diff
changeset
|
79 |
UintegerValue (10), |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
80 |
MakeUintegerAccessor (&AmrrWifiManager::m_maxSuccessThreshold), |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
81 |
MakeUintegerChecker<uint32_t> ()) |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
82 |
.AddAttribute ("MinSuccessThreshold", |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
83 |
"Minimum number of consecutive success periods needed to switch to a higher rate", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2784
diff
changeset
|
84 |
UintegerValue (1), |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
85 |
MakeUintegerAccessor (&AmrrWifiManager::m_minSuccessThreshold), |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
86 |
MakeUintegerChecker<uint32_t> ()) |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
87 |
; |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
88 |
return tid; |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
89 |
} |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
90 |
|
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
91 |
AmrrWifiManager::AmrrWifiManager () |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
92 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
93 |
NS_LOG_FUNCTION (this); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
94 |
} |
6065 | 95 |
|
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
96 |
WifiRemoteStation * |
6065 | 97 |
AmrrWifiManager::DoCreateStation (void) const |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
98 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
99 |
NS_LOG_FUNCTION (this); |
6065 | 100 |
AmrrWifiRemoteStation *station = new AmrrWifiRemoteStation (); |
101 |
station->m_nextModeUpdate = Simulator::Now () + m_updatePeriod; |
|
102 |
station->m_tx_ok = 0; |
|
103 |
station->m_tx_err = 0; |
|
104 |
station->m_tx_retr = 0; |
|
105 |
station->m_retry = 0; |
|
106 |
station->m_txrate = 0; |
|
107 |
station->m_successThreshold = m_minSuccessThreshold; |
|
108 |
station->m_success = 0; |
|
109 |
station->m_recovery = false; |
|
110 |
return station; |
|
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
111 |
} |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
112 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
113 |
void |
6065 | 114 |
AmrrWifiManager::DoReportRxOk (WifiRemoteStation *station, |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
115 |
double rxSnr, WifiMode txMode) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
116 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
117 |
NS_LOG_FUNCTION (this << station << rxSnr << txMode); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
118 |
} |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
119 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
120 |
void |
6065 | 121 |
AmrrWifiManager::DoReportRtsFailed (WifiRemoteStation *station) |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
122 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
123 |
NS_LOG_FUNCTION (this << station); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
124 |
} |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
125 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
126 |
void |
6065 | 127 |
AmrrWifiManager::DoReportDataFailed (WifiRemoteStation *st) |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
128 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
129 |
NS_LOG_FUNCTION (this << st); |
6065 | 130 |
AmrrWifiRemoteStation *station = (AmrrWifiRemoteStation *)st; |
131 |
station->m_retry++; |
|
132 |
station->m_tx_retr++; |
|
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
133 |
} |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
134 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
135 |
void |
6065 | 136 |
AmrrWifiManager::DoReportRtsOk (WifiRemoteStation *st, |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
137 |
double ctsSnr, WifiMode ctsMode, double rtsSnr) |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
138 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
139 |
NS_LOG_FUNCTION (this << st << ctsSnr << ctsMode << rtsSnr); |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
140 |
} |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
141 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
142 |
void |
6065 | 143 |
AmrrWifiManager::DoReportDataOk (WifiRemoteStation *st, |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
144 |
double ackSnr, WifiMode ackMode, double dataSnr) |
6065 | 145 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
146 |
NS_LOG_FUNCTION (this << st << ackSnr << ackMode << dataSnr); |
6065 | 147 |
AmrrWifiRemoteStation *station = (AmrrWifiRemoteStation *)st; |
148 |
station->m_retry = 0; |
|
149 |
station->m_tx_ok++; |
|
150 |
} |
|
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
151 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
152 |
void |
6065 | 153 |
AmrrWifiManager::DoReportFinalRtsFailed (WifiRemoteStation *station) |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
154 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
155 |
NS_LOG_FUNCTION (this << station); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
156 |
} |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
157 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
158 |
void |
6065 | 159 |
AmrrWifiManager::DoReportFinalDataFailed (WifiRemoteStation *st) |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
160 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
161 |
NS_LOG_FUNCTION (this << st); |
6065 | 162 |
AmrrWifiRemoteStation *station = (AmrrWifiRemoteStation *)st; |
163 |
station->m_retry = 0; |
|
164 |
station->m_tx_err++; |
|
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
165 |
} |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
166 |
|
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
167 |
bool |
6065 | 168 |
AmrrWifiManager::IsMinRate (AmrrWifiRemoteStation *station) const |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
169 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
170 |
NS_LOG_FUNCTION (this << station); |
6065 | 171 |
return (station->m_txrate == 0); |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
172 |
} |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
173 |
|
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
174 |
bool |
6065 | 175 |
AmrrWifiManager::IsMaxRate (AmrrWifiRemoteStation *station) const |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
176 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
177 |
NS_LOG_FUNCTION (this << station); |
6065 | 178 |
NS_ASSERT (station->m_txrate + 1 <= GetNSupported (station)); |
179 |
return (station->m_txrate + 1 == GetNSupported (station)); |
|
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
180 |
} |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
181 |
|
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
182 |
bool |
6065 | 183 |
AmrrWifiManager::IsSuccess (AmrrWifiRemoteStation *station) const |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
184 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
185 |
NS_LOG_FUNCTION (this << station); |
6065 | 186 |
return (station->m_tx_retr + station->m_tx_err) < station->m_tx_ok * m_successRatio; |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
187 |
} |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
188 |
|
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
189 |
bool |
6065 | 190 |
AmrrWifiManager::IsFailure (AmrrWifiRemoteStation *station) const |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
191 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
192 |
NS_LOG_FUNCTION (this << station); |
6065 | 193 |
return (station->m_tx_retr + station->m_tx_err) > station->m_tx_ok * m_failureRatio; |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
194 |
} |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
195 |
|
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
196 |
bool |
6065 | 197 |
AmrrWifiManager::IsEnough (AmrrWifiRemoteStation *station) const |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
198 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
199 |
NS_LOG_FUNCTION (this << station); |
6065 | 200 |
return (station->m_tx_retr + station->m_tx_err + station->m_tx_ok) > 10; |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
201 |
} |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
202 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
203 |
void |
6065 | 204 |
AmrrWifiManager::ResetCnt (AmrrWifiRemoteStation *station) |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
205 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
206 |
NS_LOG_FUNCTION (this << station); |
6065 | 207 |
station->m_tx_ok = 0; |
208 |
station->m_tx_err = 0; |
|
209 |
station->m_tx_retr = 0; |
|
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
210 |
} |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
211 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
212 |
void |
6065 | 213 |
AmrrWifiManager::IncreaseRate (AmrrWifiRemoteStation *station) |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
214 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
215 |
NS_LOG_FUNCTION (this << station); |
6065 | 216 |
station->m_txrate++; |
217 |
NS_ASSERT (station->m_txrate < GetNSupported (station)); |
|
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
218 |
} |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
219 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
220 |
void |
6065 | 221 |
AmrrWifiManager::DecreaseRate (AmrrWifiRemoteStation *station) |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
222 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
223 |
NS_LOG_FUNCTION (this << station); |
6065 | 224 |
station->m_txrate--; |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
225 |
} |
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
226 |
|
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
227 |
void |
6065 | 228 |
AmrrWifiManager::UpdateMode (AmrrWifiRemoteStation *station) |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
229 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
230 |
NS_LOG_FUNCTION (this << station); |
6065 | 231 |
if (Simulator::Now () < station->m_nextModeUpdate) |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
232 |
{ |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
233 |
return; |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
234 |
} |
6065 | 235 |
station->m_nextModeUpdate = Simulator::Now () + m_updatePeriod; |
2278
4b05fbf5c6e3
some debugging. Max rate test was inverted.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2277
diff
changeset
|
236 |
NS_LOG_DEBUG ("Update"); |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
237 |
|
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
238 |
bool needChange = false; |
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
239 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
240 |
if (IsSuccess (station) && IsEnough (station)) |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
241 |
{ |
6065 | 242 |
station->m_success++; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
243 |
NS_LOG_DEBUG ("++ success=" << station->m_success << " successThreshold=" << station->m_successThreshold << |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
244 |
" tx_ok=" << station->m_tx_ok << " tx_err=" << station->m_tx_err << " tx_retr=" << station->m_tx_retr << |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
245 |
" rate=" << station->m_txrate << " n-supported-rates=" << GetNSupported (station)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
246 |
if (station->m_success >= station->m_successThreshold |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
247 |
&& !IsMaxRate (station)) |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
248 |
{ |
6065 | 249 |
station->m_recovery = true; |
250 |
station->m_success = 0; |
|
251 |
IncreaseRate (station); |
|
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
252 |
needChange = true; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
253 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
254 |
else |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
255 |
{ |
6065 | 256 |
station->m_recovery = false; |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
257 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
258 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
259 |
else if (IsFailure (station)) |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
260 |
{ |
6065 | 261 |
station->m_success = 0; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
262 |
NS_LOG_DEBUG ("-- success=" << station->m_success << " successThreshold=" << station->m_successThreshold << |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
263 |
" tx_ok=" << station->m_tx_ok << " tx_err=" << station->m_tx_err << " tx_retr=" << station->m_tx_retr << |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
264 |
" rate=" << station->m_txrate << " n-supported-rates=" << GetNSupported (station)); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
265 |
if (!IsMinRate (station)) |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
266 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
267 |
if (station->m_recovery) |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
268 |
{ |
6065 | 269 |
station->m_successThreshold *= 2; |
270 |
station->m_successThreshold = std::min (station->m_successThreshold, |
|
271 |
m_maxSuccessThreshold); |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
272 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
273 |
else |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
274 |
{ |
6065 | 275 |
station->m_successThreshold = m_minSuccessThreshold; |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
276 |
} |
6065 | 277 |
station->m_recovery = false; |
278 |
DecreaseRate (station); |
|
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
279 |
needChange = true; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
280 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
281 |
else |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
282 |
{ |
6065 | 283 |
station->m_recovery = false; |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
284 |
} |
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
285 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
286 |
if (IsEnough (station) || needChange) |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
287 |
{ |
2278
4b05fbf5c6e3
some debugging. Max rate test was inverted.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2277
diff
changeset
|
288 |
NS_LOG_DEBUG ("Reset"); |
6065 | 289 |
ResetCnt (station); |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
290 |
} |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
291 |
} |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
292 |
|
10139 | 293 |
WifiTxVector |
294 |
AmrrWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint32_t size) |
|
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
295 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
296 |
NS_LOG_FUNCTION (this << st << size); |
6065 | 297 |
AmrrWifiRemoteStation *station = (AmrrWifiRemoteStation *)st; |
298 |
UpdateMode (station); |
|
299 |
NS_ASSERT (station->m_txrate < GetNSupported (station)); |
|
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
300 |
uint32_t rateIndex; |
6065 | 301 |
if (station->m_retry < 1) |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
302 |
{ |
6065 | 303 |
rateIndex = station->m_txrate; |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
304 |
} |
6065 | 305 |
else if (station->m_retry < 2) |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
306 |
{ |
6065 | 307 |
if (station->m_txrate > 0) |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
308 |
{ |
6065 | 309 |
rateIndex = station->m_txrate - 1; |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
310 |
} |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
311 |
else |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
312 |
{ |
6065 | 313 |
rateIndex = station->m_txrate; |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
314 |
} |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
315 |
} |
6065 | 316 |
else if (station->m_retry < 3) |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
317 |
{ |
6065 | 318 |
if (station->m_txrate > 1) |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
319 |
{ |
6065 | 320 |
rateIndex = station->m_txrate - 2; |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
321 |
} |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
322 |
else |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
323 |
{ |
6065 | 324 |
rateIndex = station->m_txrate; |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
325 |
} |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
326 |
} |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
327 |
else |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
328 |
{ |
6065 | 329 |
if (station->m_txrate > 2) |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
330 |
{ |
6065 | 331 |
rateIndex = station->m_txrate - 3; |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
332 |
} |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
333 |
else |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
334 |
{ |
6065 | 335 |
rateIndex = station->m_txrate; |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
336 |
} |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
337 |
} |
11628
243b71de25a0
add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11479
diff
changeset
|
338 |
uint32_t channelWidth = GetChannelWidth (station); |
11644
527ed7692b84
Better visibility in if conditions
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11628
diff
changeset
|
339 |
if (channelWidth > 20 && channelWidth != 22) |
11628
243b71de25a0
add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11479
diff
changeset
|
340 |
{ |
243b71de25a0
add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11479
diff
changeset
|
341 |
//avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac |
243b71de25a0
add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11479
diff
changeset
|
342 |
channelWidth = 20; |
243b71de25a0
add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11479
diff
changeset
|
343 |
} |
243b71de25a0
add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11479
diff
changeset
|
344 |
return WifiTxVector (GetSupported (station, rateIndex), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false); |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
345 |
} |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
346 |
|
10139 | 347 |
WifiTxVector |
348 |
AmrrWifiManager::DoGetRtsTxVector (WifiRemoteStation *st) |
|
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
349 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
350 |
NS_LOG_FUNCTION (this << st); |
6065 | 351 |
AmrrWifiRemoteStation *station = (AmrrWifiRemoteStation *)st; |
11628
243b71de25a0
add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11479
diff
changeset
|
352 |
uint32_t channelWidth = GetChannelWidth (station); |
11644
527ed7692b84
Better visibility in if conditions
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11628
diff
changeset
|
353 |
if (channelWidth > 20 && channelWidth != 22) |
11628
243b71de25a0
add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11479
diff
changeset
|
354 |
{ |
243b71de25a0
add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11479
diff
changeset
|
355 |
//avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac |
243b71de25a0
add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11479
diff
changeset
|
356 |
channelWidth = 20; |
243b71de25a0
add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11479
diff
changeset
|
357 |
} |
6065 | 358 |
UpdateMode (station); |
9894
ac4e52a91d5d
Doxygenate todo's
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9705
diff
changeset
|
359 |
/// \todo can we implement something smarter ? |
11628
243b71de25a0
add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11479
diff
changeset
|
360 |
return WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (station), false, 1, 0, channelWidth, GetAggregation (station), false); |
6065 | 361 |
} |
362 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
363 |
bool |
6065 | 364 |
AmrrWifiManager::IsLowLatency (void) const |
365 |
{ |
|
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
366 |
NS_LOG_FUNCTION (this); |
6065 | 367 |
return true; |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
368 |
} |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
369 |
|
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
370 |
} //namespace ns3 |