author | Ghada Badawy <gbadawy@gmail.com> |
Tue, 13 Aug 2013 22:05:25 -0700 | |
changeset 10139 | 17a71cd49da3 |
parent 9894 | ac4e52a91d5d |
child 10410 | 4d4eb8097fa3 |
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 |
||
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
29 |
NS_LOG_COMPONENT_DEFINE ("AmrrWifiRemoteStation"); |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
30 |
|
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
31 |
namespace ns3 { |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
32 |
|
6065 | 33 |
struct AmrrWifiRemoteStation : public WifiRemoteStation |
34 |
{ |
|
35 |
Time m_nextModeUpdate; |
|
36 |
uint32_t m_tx_ok; |
|
37 |
uint32_t m_tx_err; |
|
38 |
uint32_t m_tx_retr; |
|
39 |
uint32_t m_retry; |
|
40 |
uint32_t m_txrate; |
|
41 |
uint32_t m_successThreshold; |
|
42 |
uint32_t m_success; |
|
43 |
bool m_recovery; |
|
44 |
}; |
|
45 |
||
46 |
||
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
47 |
NS_OBJECT_ENSURE_REGISTERED (AmrrWifiManager); |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
48 |
|
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
49 |
TypeId |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
50 |
AmrrWifiManager::GetTypeId (void) |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
51 |
{ |
2602
d9262bff6df2
add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2599
diff
changeset
|
52 |
static TypeId tid = TypeId ("ns3::AmrrWifiManager") |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
53 |
.SetParent<WifiRemoteStationManager> () |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
54 |
.AddConstructor<AmrrWifiManager> () |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
55 |
.AddAttribute ("UpdatePeriod", |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
56 |
"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
|
57 |
TimeValue (Seconds (1.0)), |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
58 |
MakeTimeAccessor (&AmrrWifiManager::m_updatePeriod), |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
59 |
MakeTimeChecker ()) |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
60 |
.AddAttribute ("FailureRatio", |
6273
8d70de29d514
spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents:
6065
diff
changeset
|
61 |
"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
|
62 |
DoubleValue (1.0 / 3.0), |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
63 |
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
|
64 |
MakeDoubleChecker<double> (0.0, 1.0)) |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
65 |
.AddAttribute ("SuccessRatio", |
6273
8d70de29d514
spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents:
6065
diff
changeset
|
66 |
"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
|
67 |
DoubleValue (1.0 / 10.0), |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
68 |
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
|
69 |
MakeDoubleChecker<double> (0.0, 1.0)) |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
70 |
.AddAttribute ("MaxSuccessThreshold", |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
71 |
"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
|
72 |
UintegerValue (10), |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
73 |
MakeUintegerAccessor (&AmrrWifiManager::m_maxSuccessThreshold), |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
74 |
MakeUintegerChecker<uint32_t> ()) |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
75 |
.AddAttribute ("MinSuccessThreshold", |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
76 |
"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
|
77 |
UintegerValue (1), |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
78 |
MakeUintegerAccessor (&AmrrWifiManager::m_minSuccessThreshold), |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
79 |
MakeUintegerChecker<uint32_t> ()) |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
80 |
; |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
81 |
return tid; |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
82 |
} |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
83 |
|
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
84 |
AmrrWifiManager::AmrrWifiManager () |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
85 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
86 |
NS_LOG_FUNCTION (this); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
87 |
} |
6065 | 88 |
|
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
89 |
WifiRemoteStation * |
6065 | 90 |
AmrrWifiManager::DoCreateStation (void) const |
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
91 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
92 |
NS_LOG_FUNCTION (this); |
6065 | 93 |
AmrrWifiRemoteStation *station = new AmrrWifiRemoteStation (); |
94 |
station->m_nextModeUpdate = Simulator::Now () + m_updatePeriod; |
|
95 |
station->m_tx_ok = 0; |
|
96 |
station->m_tx_err = 0; |
|
97 |
station->m_tx_retr = 0; |
|
98 |
station->m_retry = 0; |
|
99 |
station->m_txrate = 0; |
|
100 |
station->m_successThreshold = m_minSuccessThreshold; |
|
101 |
station->m_success = 0; |
|
102 |
station->m_recovery = false; |
|
103 |
return station; |
|
2544
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
104 |
} |
2e6e1a6e0d94
port last rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2279
diff
changeset
|
105 |
|
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
106 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
107 |
void |
6065 | 108 |
AmrrWifiManager::DoReportRxOk (WifiRemoteStation *station, |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
109 |
double rxSnr, WifiMode txMode) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
110 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
111 |
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
|
112 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
113 |
void |
6065 | 114 |
AmrrWifiManager::DoReportRtsFailed (WifiRemoteStation *station) |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
115 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
116 |
NS_LOG_FUNCTION (this << station); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
117 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
118 |
void |
6065 | 119 |
AmrrWifiManager::DoReportDataFailed (WifiRemoteStation *st) |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
120 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
121 |
NS_LOG_FUNCTION (this << st); |
6065 | 122 |
AmrrWifiRemoteStation *station = (AmrrWifiRemoteStation *)st; |
123 |
station->m_retry++; |
|
124 |
station->m_tx_retr++; |
|
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
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::DoReportRtsOk (WifiRemoteStation *st, |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
128 |
double ctsSnr, WifiMode ctsMode, double rtsSnr) |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
129 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
130 |
NS_LOG_FUNCTION (this << st << ctsSnr << ctsMode << rtsSnr); |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
131 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
132 |
void |
6065 | 133 |
AmrrWifiManager::DoReportDataOk (WifiRemoteStation *st, |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
134 |
double ackSnr, WifiMode ackMode, double dataSnr) |
6065 | 135 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
136 |
NS_LOG_FUNCTION (this << st << ackSnr << ackMode << dataSnr); |
6065 | 137 |
AmrrWifiRemoteStation *station = (AmrrWifiRemoteStation *)st; |
138 |
station->m_retry = 0; |
|
139 |
station->m_tx_ok++; |
|
140 |
} |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
141 |
void |
6065 | 142 |
AmrrWifiManager::DoReportFinalRtsFailed (WifiRemoteStation *station) |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
143 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
144 |
NS_LOG_FUNCTION (this << station); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
145 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
146 |
void |
6065 | 147 |
AmrrWifiManager::DoReportFinalDataFailed (WifiRemoteStation *st) |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
148 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
149 |
NS_LOG_FUNCTION (this << st); |
6065 | 150 |
AmrrWifiRemoteStation *station = (AmrrWifiRemoteStation *)st; |
151 |
station->m_retry = 0; |
|
152 |
station->m_tx_err++; |
|
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
153 |
} |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
154 |
bool |
6065 | 155 |
AmrrWifiManager::IsMinRate (AmrrWifiRemoteStation *station) const |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
156 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
157 |
NS_LOG_FUNCTION (this << station); |
6065 | 158 |
return (station->m_txrate == 0); |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
159 |
} |
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
160 |
bool |
6065 | 161 |
AmrrWifiManager::IsMaxRate (AmrrWifiRemoteStation *station) const |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
162 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
163 |
NS_LOG_FUNCTION (this << station); |
6065 | 164 |
NS_ASSERT (station->m_txrate + 1 <= GetNSupported (station)); |
165 |
return (station->m_txrate + 1 == GetNSupported (station)); |
|
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
166 |
} |
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
167 |
bool |
6065 | 168 |
AmrrWifiManager::IsSuccess (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_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
|
172 |
} |
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
173 |
bool |
6065 | 174 |
AmrrWifiManager::IsFailure (AmrrWifiRemoteStation *station) const |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
175 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
176 |
NS_LOG_FUNCTION (this << station); |
6065 | 177 |
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
|
178 |
} |
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
179 |
bool |
6065 | 180 |
AmrrWifiManager::IsEnough (AmrrWifiRemoteStation *station) const |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
181 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
182 |
NS_LOG_FUNCTION (this << station); |
6065 | 183 |
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
|
184 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
185 |
void |
6065 | 186 |
AmrrWifiManager::ResetCnt (AmrrWifiRemoteStation *station) |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
187 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
188 |
NS_LOG_FUNCTION (this << station); |
6065 | 189 |
station->m_tx_ok = 0; |
190 |
station->m_tx_err = 0; |
|
191 |
station->m_tx_retr = 0; |
|
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
192 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
193 |
void |
6065 | 194 |
AmrrWifiManager::IncreaseRate (AmrrWifiRemoteStation *station) |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
195 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
196 |
NS_LOG_FUNCTION (this << station); |
6065 | 197 |
station->m_txrate++; |
198 |
NS_ASSERT (station->m_txrate < GetNSupported (station)); |
|
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
199 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
200 |
void |
6065 | 201 |
AmrrWifiManager::DecreaseRate (AmrrWifiRemoteStation *station) |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
202 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
203 |
NS_LOG_FUNCTION (this << station); |
6065 | 204 |
station->m_txrate--; |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
205 |
} |
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
206 |
|
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
207 |
void |
6065 | 208 |
AmrrWifiManager::UpdateMode (AmrrWifiRemoteStation *station) |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
209 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
210 |
NS_LOG_FUNCTION (this << station); |
6065 | 211 |
if (Simulator::Now () < station->m_nextModeUpdate) |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
212 |
{ |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
213 |
return; |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
214 |
} |
6065 | 215 |
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
|
216 |
NS_LOG_DEBUG ("Update"); |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
217 |
|
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
218 |
bool needChange = false; |
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
219 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
220 |
if (IsSuccess (station) && IsEnough (station)) |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
221 |
{ |
6065 | 222 |
station->m_success++; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
223 |
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
|
224 |
" 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
|
225 |
" 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
|
226 |
if (station->m_success >= station->m_successThreshold |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
227 |
&& !IsMaxRate (station)) |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
228 |
{ |
6065 | 229 |
station->m_recovery = true; |
230 |
station->m_success = 0; |
|
231 |
IncreaseRate (station); |
|
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
232 |
needChange = true; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
233 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
234 |
else |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
235 |
{ |
6065 | 236 |
station->m_recovery = false; |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
237 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
238 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
239 |
else if (IsFailure (station)) |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
240 |
{ |
6065 | 241 |
station->m_success = 0; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
242 |
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
|
243 |
" 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
|
244 |
" 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
|
245 |
if (!IsMinRate (station)) |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
246 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
247 |
if (station->m_recovery) |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
248 |
{ |
6065 | 249 |
station->m_successThreshold *= 2; |
250 |
station->m_successThreshold = std::min (station->m_successThreshold, |
|
251 |
m_maxSuccessThreshold); |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
252 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
253 |
else |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
254 |
{ |
6065 | 255 |
station->m_successThreshold = m_minSuccessThreshold; |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
256 |
} |
6065 | 257 |
station->m_recovery = false; |
258 |
DecreaseRate (station); |
|
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
259 |
needChange = true; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
260 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
261 |
else |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
262 |
{ |
6065 | 263 |
station->m_recovery = false; |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
264 |
} |
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
265 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
266 |
if (IsEnough (station) || needChange) |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
267 |
{ |
2278
4b05fbf5c6e3
some debugging. Max rate test was inverted.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2277
diff
changeset
|
268 |
NS_LOG_DEBUG ("Reset"); |
6065 | 269 |
ResetCnt (station); |
2274
406712a0c6ef
implement AMRR for true.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2273
diff
changeset
|
270 |
} |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
271 |
} |
10139 | 272 |
WifiTxVector |
273 |
AmrrWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint32_t size) |
|
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
274 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
275 |
NS_LOG_FUNCTION (this << st << size); |
6065 | 276 |
AmrrWifiRemoteStation *station = (AmrrWifiRemoteStation *)st; |
277 |
UpdateMode (station); |
|
278 |
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
|
279 |
uint32_t rateIndex; |
6065 | 280 |
if (station->m_retry < 1) |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
281 |
{ |
6065 | 282 |
rateIndex = station->m_txrate; |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
283 |
} |
6065 | 284 |
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
|
285 |
{ |
6065 | 286 |
if (station->m_txrate > 0) |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
287 |
{ |
6065 | 288 |
rateIndex = station->m_txrate - 1; |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
289 |
} |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
290 |
else |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
291 |
{ |
6065 | 292 |
rateIndex = station->m_txrate; |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
293 |
} |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
294 |
} |
6065 | 295 |
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
|
296 |
{ |
6065 | 297 |
if (station->m_txrate > 1) |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
298 |
{ |
6065 | 299 |
rateIndex = station->m_txrate - 2; |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
300 |
} |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
301 |
else |
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 |
} |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
305 |
} |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
306 |
else |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
307 |
{ |
6065 | 308 |
if (station->m_txrate > 2) |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
309 |
{ |
6065 | 310 |
rateIndex = station->m_txrate - 3; |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
311 |
} |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
312 |
else |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
313 |
{ |
6065 | 314 |
rateIndex = station->m_txrate; |
2276
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
315 |
} |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
316 |
} |
26e3bc114fdd
implement the MRR portion of AMRR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2275
diff
changeset
|
317 |
|
10139 | 318 |
return WifiTxVector (GetSupported (station, rateIndex), GetDefaultTxPowerLevel (), GetLongRetryCount (station), GetShortGuardInterval (station), Min (GetNumberOfReceiveAntennas (station),GetNumberOfTransmitAntennas()), GetNumberOfTransmitAntennas (station), GetStbc (station)); |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
319 |
} |
10139 | 320 |
WifiTxVector |
321 |
AmrrWifiManager::DoGetRtsTxVector (WifiRemoteStation *st) |
|
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
322 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
323 |
NS_LOG_FUNCTION (this << st); |
6065 | 324 |
AmrrWifiRemoteStation *station = (AmrrWifiRemoteStation *)st; |
325 |
UpdateMode (station); |
|
9894
ac4e52a91d5d
Doxygenate todo's
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9705
diff
changeset
|
326 |
/// \todo can we implement something smarter ? |
10139 | 327 |
return WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (station), GetShortGuardInterval (station), Min (GetNumberOfReceiveAntennas (station),GetNumberOfTransmitAntennas()), GetNumberOfTransmitAntennas (station), GetStbc (station)); |
6065 | 328 |
} |
329 |
||
330 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
331 |
bool |
6065 | 332 |
AmrrWifiManager::IsLowLatency (void) const |
333 |
{ |
|
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
334 |
NS_LOG_FUNCTION (this); |
6065 | 335 |
return true; |
2273
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
336 |
} |
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
337 |
|
0bfe240ec168
AMRR rate control algorithm
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
338 |
} // namespace ns3 |