author | Edvin Močibob <edvin.mocibob@gmail.com> |
Sat, 20 Apr 2013 00:30:06 +0200 | |
changeset 9705 | 43fa2408aa05 |
parent 7385 | 10beb0e53130 |
child 9894 | ac4e52a91d5d |
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; -*- */ |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
/* |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
3 |
* Copyright (c) 2004,2005,2006 INRIA |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
4 |
* |
6c2d6a5631bc
add more files to build
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 |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
* |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
* |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
* |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
*/ |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
21 |
#include "aarf-wifi-manager.h" |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
22 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
23 |
#include "ns3/double.h" |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
24 |
#include "ns3/uinteger.h" |
6065 | 25 |
#include "ns3/log.h" |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
26 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
27 |
#define Min(a,b) ((a < b) ? a : b) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
28 |
#define Max(a,b) ((a > b) ? a : b) |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
29 |
|
6393
f7e1f9dfa08d
ensure objects are regsitered
Josh Pelkey <jpelkey@gatech.edu>
parents:
6065
diff
changeset
|
30 |
NS_LOG_COMPONENT_DEFINE ("AarfWifiManager"); |
6065 | 31 |
|
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
32 |
namespace ns3 { |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
33 |
|
6065 | 34 |
struct AarfWifiRemoteStation : public WifiRemoteStation |
35 |
{ |
|
36 |
uint32_t m_timer; |
|
37 |
uint32_t m_success; |
|
38 |
uint32_t m_failed; |
|
39 |
bool m_recovery; |
|
40 |
uint32_t m_retry; |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
41 |
|
6065 | 42 |
uint32_t m_timerTimeout; |
43 |
uint32_t m_successThreshold; |
|
44 |
||
45 |
uint32_t m_rate; |
|
46 |
}; |
|
47 |
||
48 |
||
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
49 |
NS_OBJECT_ENSURE_REGISTERED (AarfWifiManager); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
50 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
51 |
TypeId |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
52 |
AarfWifiManager::GetTypeId (void) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
53 |
{ |
2602
d9262bff6df2
add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2524
diff
changeset
|
54 |
static TypeId tid = TypeId ("ns3::AarfWifiManager") |
6065 | 55 |
.SetParent<WifiRemoteStationManager> () |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
56 |
.AddConstructor<AarfWifiManager> () |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
57 |
.AddAttribute ("SuccessK", "Multiplication factor for the success threshold in the AARF algorithm.", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
58 |
DoubleValue (2.0), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
59 |
MakeDoubleAccessor (&AarfWifiManager::m_successK), |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
60 |
MakeDoubleChecker<double> ()) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
61 |
.AddAttribute ("TimerK", |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
62 |
"Multiplication factor for the timer threshold in the AARF algorithm.", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
63 |
DoubleValue (2.0), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
64 |
MakeDoubleAccessor (&AarfWifiManager::m_timerK), |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
65 |
MakeDoubleChecker<double> ()) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
66 |
.AddAttribute ("MaxSuccessThreshold", |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
67 |
"Maximum value of the success threshold in the AARF algorithm.", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
68 |
UintegerValue (60), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
69 |
MakeUintegerAccessor (&AarfWifiManager::m_maxSuccessThreshold), |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
70 |
MakeUintegerChecker<uint32_t> ()) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
71 |
.AddAttribute ("MinTimerThreshold", |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
72 |
"The minimum value for the 'timer' threshold in the AARF algorithm.", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
73 |
UintegerValue (15), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
74 |
MakeUintegerAccessor (&AarfWifiManager::m_minTimerThreshold), |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
75 |
MakeUintegerChecker<uint32_t> ()) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
76 |
.AddAttribute ("MinSuccessThreshold", |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
77 |
"The minimum value for the success threshold in the AARF algorithm.", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
78 |
UintegerValue (10), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
79 |
MakeUintegerAccessor (&AarfWifiManager::m_minSuccessThreshold), |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
80 |
MakeUintegerChecker<uint32_t> ()) |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
81 |
; |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
82 |
return tid; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
83 |
} |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
84 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
85 |
AarfWifiManager::AarfWifiManager () |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
86 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
87 |
NS_LOG_FUNCTION (this); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
88 |
} |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
89 |
AarfWifiManager::~AarfWifiManager () |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
90 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
91 |
NS_LOG_FUNCTION (this); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
92 |
} |
6065 | 93 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2004
diff
changeset
|
94 |
WifiRemoteStation * |
6065 | 95 |
AarfWifiManager::DoCreateStation (void) const |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
96 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
97 |
NS_LOG_FUNCTION (this); |
6065 | 98 |
AarfWifiRemoteStation *station = new AarfWifiRemoteStation (); |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
99 |
|
6065 | 100 |
station->m_successThreshold = m_minSuccessThreshold; |
101 |
station->m_timerTimeout = m_minTimerThreshold; |
|
102 |
station->m_rate = 0; |
|
103 |
station->m_success = 0; |
|
104 |
station->m_failed = 0; |
|
105 |
station->m_recovery = false; |
|
106 |
station->m_retry = 0; |
|
107 |
station->m_timer = 0; |
|
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
108 |
|
6065 | 109 |
return station; |
4340 | 110 |
} |
111 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
112 |
void |
6065 | 113 |
AarfWifiManager::DoReportRtsFailed (WifiRemoteStation *station) |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
114 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
115 |
NS_LOG_FUNCTION (this << station); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
116 |
} |
6065 | 117 |
/** |
118 |
* It is important to realize that "recovery" mode starts after failure of |
|
119 |
* the first transmission after a rate increase and ends at the first successful |
|
120 |
* transmission. Specifically, recovery mode transcends retransmissions boundaries. |
|
121 |
* Fundamentally, ARF handles each data transmission independently, whether it |
|
122 |
* is the initial transmission of a packet or the retransmission of a packet. |
|
123 |
* The fundamental reason for this is that there is a backoff between each data |
|
124 |
* transmission, be it an initial transmission or a retransmission. |
|
125 |
*/ |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
126 |
void |
6065 | 127 |
AarfWifiManager::DoReportDataFailed (WifiRemoteStation *st) |
1895
6c2d6a5631bc
add more files to build
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 |
AarfWifiRemoteStation *station = (AarfWifiRemoteStation *)st; |
131 |
station->m_timer++; |
|
132 |
station->m_failed++; |
|
133 |
station->m_retry++; |
|
134 |
station->m_success = 0; |
|
135 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
136 |
if (station->m_recovery) |
6065 | 137 |
{ |
138 |
NS_ASSERT (station->m_retry >= 1); |
|
139 |
if (station->m_retry == 1) |
|
140 |
{ |
|
141 |
// need recovery fallback |
|
142 |
station->m_successThreshold = (int)(Min (station->m_successThreshold * m_successK, |
|
143 |
m_maxSuccessThreshold)); |
|
144 |
station->m_timerTimeout = (int)(Max (station->m_timerTimeout * m_timerK, |
|
145 |
m_minSuccessThreshold)); |
|
146 |
if (station->m_rate != 0) |
|
147 |
{ |
|
148 |
station->m_rate--; |
|
149 |
} |
|
150 |
} |
|
151 |
station->m_timer = 0; |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
152 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
153 |
else |
6065 | 154 |
{ |
155 |
NS_ASSERT (station->m_retry >= 1); |
|
156 |
if (((station->m_retry - 1) % 2) == 1) |
|
157 |
{ |
|
158 |
// need normal fallback |
|
159 |
station->m_timerTimeout = m_minTimerThreshold; |
|
160 |
station->m_successThreshold = m_minSuccessThreshold; |
|
161 |
if (station->m_rate != 0) |
|
162 |
{ |
|
163 |
station->m_rate--; |
|
164 |
} |
|
165 |
} |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
166 |
if (station->m_retry >= 2) |
6065 | 167 |
{ |
168 |
station->m_timer = 0; |
|
169 |
} |
|
170 |
} |
|
171 |
} |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
172 |
void |
6065 | 173 |
AarfWifiManager::DoReportRxOk (WifiRemoteStation *station, |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
174 |
double rxSnr, WifiMode txMode) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
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 << rxSnr << txMode); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
177 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
178 |
void |
6065 | 179 |
AarfWifiManager::DoReportRtsOk (WifiRemoteStation *station, |
180 |
double ctsSnr, WifiMode ctsMode, double rtsSnr) |
|
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 << ctsSnr << ctsMode << rtsSnr); |
6065 | 183 |
NS_LOG_DEBUG ("station=" << station << " rts ok"); |
184 |
} |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
185 |
void |
6065 | 186 |
AarfWifiManager::DoReportDataOk (WifiRemoteStation *st, |
187 |
double ackSnr, WifiMode ackMode, double dataSnr) |
|
188 |
{ |
|
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
189 |
NS_LOG_FUNCTION (this << st << ackSnr << ackMode << dataSnr); |
6065 | 190 |
AarfWifiRemoteStation *station = (AarfWifiRemoteStation *) st; |
191 |
station->m_timer++; |
|
192 |
station->m_success++; |
|
193 |
station->m_failed = 0; |
|
194 |
station->m_recovery = false; |
|
195 |
station->m_retry = 0; |
|
196 |
NS_LOG_DEBUG ("station=" << station << " data ok success=" << station->m_success << ", timer=" << station->m_timer); |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
197 |
if ((station->m_success == station->m_successThreshold |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
198 |
|| station->m_timer == station->m_timerTimeout) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
199 |
&& (station->m_rate < (GetNSupported (station) - 1))) |
6065 | 200 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
201 |
NS_LOG_DEBUG ("station=" << station << " inc rate"); |
6065 | 202 |
station->m_rate++; |
203 |
station->m_timer = 0; |
|
204 |
station->m_success = 0; |
|
205 |
station->m_recovery = true; |
|
206 |
} |
|
207 |
} |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
208 |
void |
6065 | 209 |
AarfWifiManager::DoReportFinalRtsFailed (WifiRemoteStation *station) |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
210 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
211 |
NS_LOG_FUNCTION (this << station); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
212 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
213 |
void |
6065 | 214 |
AarfWifiManager::DoReportFinalDataFailed (WifiRemoteStation *station) |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
215 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
216 |
NS_LOG_FUNCTION (this << station); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
217 |
} |
6065 | 218 |
|
219 |
WifiMode |
|
220 |
AarfWifiManager::DoGetDataMode (WifiRemoteStation *st, uint32_t size) |
|
221 |
{ |
|
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
222 |
NS_LOG_FUNCTION (this << st << size); |
6065 | 223 |
AarfWifiRemoteStation *station = (AarfWifiRemoteStation *) st; |
224 |
return GetSupported (station, station->m_rate); |
|
225 |
} |
|
226 |
WifiMode |
|
227 |
AarfWifiManager::DoGetRtsMode (WifiRemoteStation *st) |
|
228 |
{ |
|
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
229 |
NS_LOG_FUNCTION (this << st); |
6065 | 230 |
// XXX: we could/should implement the Aarf algorithm for |
231 |
// RTS only by picking a single rate within the BasicRateSet. |
|
232 |
AarfWifiRemoteStation *station = (AarfWifiRemoteStation *) st; |
|
233 |
return GetSupported (station, 0); |
|
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
234 |
} |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
235 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
236 |
bool |
6065 | 237 |
AarfWifiManager::IsLowLatency (void) const |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
238 |
{ |
9705
43fa2408aa05
Partially clean up function logging of wifi module.
Edvin Močibob <edvin.mocibob@gmail.com>
parents:
7385
diff
changeset
|
239 |
NS_LOG_FUNCTION (this); |
6065 | 240 |
return true; |
1895
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
241 |
} |
6c2d6a5631bc
add more files to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
242 |
|
1918
fee53ba3f388
port to new MacStation API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1895
diff
changeset
|
243 |
} // namespace ns3 |