author | Tom Henderson <tomh@tomh.org> |
Wed, 06 May 2015 14:23:50 -0700 | |
changeset 11388 | e367c5bde0fa |
parent 11384 | 935dc1cc08a4 |
child 11419 | d118c95b966c |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
7227
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
/* |
1912
028e1945d5b2
fix copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1911
diff
changeset
|
3 |
* Copyright (c) 2005,2006,2007 INRIA |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
4 |
* |
d72388b06b22
add MacStations 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 |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
* |
d72388b06b22
add MacStations 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, |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
* |
d72388b06b22
add MacStations 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 |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
d72388b06b22
add MacStations 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 |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
* |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
*/ |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
21 |
#include <iostream> |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
22 |
#include "wifi-remote-station-manager.h" |
6069
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
23 |
#include "ns3/simulator.h" |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
24 |
#include "ns3/assert.h" |
1980
3fa3bac40b5b
add asserts and some debug log
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1975
diff
changeset
|
25 |
#include "ns3/log.h" |
3041
a624276a897b
mtag -> tag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3040
diff
changeset
|
26 |
#include "ns3/tag.h" |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
27 |
#include "ns3/boolean.h" |
6065 | 28 |
#include "ns3/double.h" |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
29 |
#include "ns3/uinteger.h" |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
30 |
#include "ns3/wifi-phy.h" |
11059
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
31 |
#include "ns3/wifi-mac.h" |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
32 |
#include "ns3/trace-source-accessor.h" |
6065 | 33 |
#include "wifi-mac-header.h" |
6473 | 34 |
#include "wifi-mac-trailer.h" |
1980
3fa3bac40b5b
add asserts and some debug log
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1975
diff
changeset
|
35 |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
36 |
/*************************************************************** |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
37 |
* Packet Mode Tagger |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
38 |
***************************************************************/ |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
39 |
|
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
40 |
namespace ns3 { |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
41 |
|
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
|
42 |
NS_LOG_COMPONENT_DEFINE ("WifiRemoteStationManager"); |
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
|
43 |
|
10139 | 44 |
class HighLatencyDataTxVectorTag : public Tag |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
45 |
{ |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
46 |
public: |
10139 | 47 |
HighLatencyDataTxVectorTag (); |
48 |
HighLatencyDataTxVectorTag (WifiTxVector dataTxVector); |
|
10424
9d29c9a5ddcb
doxygen warnings for wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10410
diff
changeset
|
49 |
/** |
9d29c9a5ddcb
doxygen warnings for wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10410
diff
changeset
|
50 |
* \returns the transmission mode to use to send this packet |
9d29c9a5ddcb
doxygen warnings for wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10410
diff
changeset
|
51 |
*/ |
10139 | 52 |
WifiTxVector GetDataTxVector (void) const; |
53 |
||
54 |
static TypeId GetTypeId (void); |
|
55 |
virtual TypeId GetInstanceTypeId (void) const; |
|
56 |
virtual uint32_t GetSerializedSize (void) const; |
|
57 |
virtual void Serialize (TagBuffer i) const; |
|
58 |
virtual void Deserialize (TagBuffer i); |
|
59 |
virtual void Print (std::ostream &os) const; |
|
60 |
private: |
|
61 |
WifiTxVector m_dataTxVector; |
|
62 |
}; |
|
63 |
||
64 |
HighLatencyDataTxVectorTag::HighLatencyDataTxVectorTag () |
|
65 |
{ |
|
66 |
} |
|
67 |
HighLatencyDataTxVectorTag::HighLatencyDataTxVectorTag ( WifiTxVector dataTxVector) |
|
68 |
: m_dataTxVector (dataTxVector) |
|
69 |
{ |
|
70 |
} |
|
71 |
||
72 |
WifiTxVector |
|
73 |
HighLatencyDataTxVectorTag::GetDataTxVector (void) const |
|
74 |
{ |
|
75 |
return m_dataTxVector; |
|
76 |
} |
|
77 |
TypeId |
|
78 |
HighLatencyDataTxVectorTag::GetTypeId (void) |
|
79 |
{ |
|
80 |
static TypeId tid = TypeId ("ns3::HighLatencyDataTxVectorTag") |
|
81 |
.SetParent<Tag> () |
|
11245
5c781d7e5a25
SetGroupName for wifi module
Tom Henderson <tomh@tomh.org>
parents:
11159
diff
changeset
|
82 |
.SetGroupName ("Wifi") |
10139 | 83 |
.AddConstructor<HighLatencyDataTxVectorTag> () |
84 |
; |
|
85 |
return tid; |
|
86 |
} |
|
87 |
TypeId |
|
88 |
HighLatencyDataTxVectorTag::GetInstanceTypeId (void) const |
|
89 |
{ |
|
90 |
return GetTypeId (); |
|
91 |
} |
|
92 |
uint32_t |
|
93 |
HighLatencyDataTxVectorTag::GetSerializedSize (void) const |
|
94 |
{ |
|
95 |
return sizeof (WifiTxVector); |
|
96 |
} |
|
97 |
void |
|
98 |
HighLatencyDataTxVectorTag::Serialize (TagBuffer i) const |
|
99 |
{ |
|
100 |
i.Write ((uint8_t *)&m_dataTxVector, sizeof (WifiTxVector)); |
|
101 |
} |
|
102 |
void |
|
103 |
HighLatencyDataTxVectorTag::Deserialize (TagBuffer i) |
|
104 |
{ |
|
105 |
i.Read ((uint8_t *)&m_dataTxVector, sizeof (WifiTxVector)); |
|
106 |
} |
|
107 |
void |
|
108 |
HighLatencyDataTxVectorTag::Print (std::ostream &os) const |
|
109 |
{ |
|
110 |
os << "Data=" << m_dataTxVector; |
|
111 |
} |
|
112 |
||
113 |
class HighLatencyRtsTxVectorTag : public Tag |
|
114 |
{ |
|
115 |
public: |
|
116 |
HighLatencyRtsTxVectorTag (); |
|
117 |
HighLatencyRtsTxVectorTag (WifiTxVector rtsTxVector); |
|
10424
9d29c9a5ddcb
doxygen warnings for wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10410
diff
changeset
|
118 |
/** |
9d29c9a5ddcb
doxygen warnings for wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10410
diff
changeset
|
119 |
* \returns the transmission mode to use to send the RTS prior to the |
9d29c9a5ddcb
doxygen warnings for wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10410
diff
changeset
|
120 |
* transmission of the data packet itself. |
9d29c9a5ddcb
doxygen warnings for wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10410
diff
changeset
|
121 |
*/ |
10139 | 122 |
WifiTxVector GetRtsTxVector (void) const; |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
123 |
|
3038
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
124 |
static TypeId GetTypeId (void); |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
125 |
virtual TypeId GetInstanceTypeId (void) const; |
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
126 |
virtual uint32_t GetSerializedSize (void) const; |
3040
e11e106c7c19
Mtag -> Tag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3038
diff
changeset
|
127 |
virtual void Serialize (TagBuffer i) const; |
e11e106c7c19
Mtag -> Tag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3038
diff
changeset
|
128 |
virtual void Deserialize (TagBuffer i); |
3208
1a754d09c4ba
bug 200: Packet::PrintTags is not implemented.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3041
diff
changeset
|
129 |
virtual void Print (std::ostream &os) const; |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
130 |
private: |
10139 | 131 |
WifiTxVector m_rtsTxVector; |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
132 |
}; |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
133 |
|
10139 | 134 |
HighLatencyRtsTxVectorTag::HighLatencyRtsTxVectorTag () |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
135 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
136 |
} |
10139 | 137 |
HighLatencyRtsTxVectorTag::HighLatencyRtsTxVectorTag ( WifiTxVector rtsTxVector) |
138 |
: m_rtsTxVector (rtsTxVector) |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
139 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
140 |
} |
10139 | 141 |
|
142 |
WifiTxVector |
|
143 |
HighLatencyRtsTxVectorTag::GetRtsTxVector (void) const |
|
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
144 |
{ |
10139 | 145 |
return m_rtsTxVector; |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
146 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
147 |
TypeId |
10139 | 148 |
HighLatencyRtsTxVectorTag::GetTypeId (void) |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
149 |
{ |
10139 | 150 |
static TypeId tid = TypeId ("ns3::HighLatencyRtsTxVectorTag") |
3040
e11e106c7c19
Mtag -> Tag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3038
diff
changeset
|
151 |
.SetParent<Tag> () |
11245
5c781d7e5a25
SetGroupName for wifi module
Tom Henderson <tomh@tomh.org>
parents:
11159
diff
changeset
|
152 |
.SetGroupName ("Wifi") |
10139 | 153 |
.AddConstructor<HighLatencyRtsTxVectorTag> () |
154 |
; |
|
3038
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
155 |
return tid; |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
156 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
157 |
TypeId |
10139 | 158 |
HighLatencyRtsTxVectorTag::GetInstanceTypeId (void) const |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
159 |
{ |
3038
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
160 |
return GetTypeId (); |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
161 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
162 |
uint32_t |
10139 | 163 |
HighLatencyRtsTxVectorTag::GetSerializedSize (void) const |
164 |
{ |
|
165 |
return sizeof (WifiTxVector); |
|
166 |
} |
|
167 |
void |
|
168 |
HighLatencyRtsTxVectorTag::Serialize (TagBuffer i) const |
|
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
169 |
{ |
10139 | 170 |
i.Write ((uint8_t *)&m_rtsTxVector, sizeof (WifiTxVector)); |
171 |
} |
|
172 |
void |
|
173 |
HighLatencyRtsTxVectorTag::Deserialize (TagBuffer i) |
|
174 |
{ |
|
175 |
i.Read ((uint8_t *)&m_rtsTxVector, sizeof (WifiTxVector)); |
|
3038
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
176 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
177 |
void |
10139 | 178 |
HighLatencyRtsTxVectorTag::Print (std::ostream &os) const |
179 |
{ |
|
180 |
os << "Rts=" << m_rtsTxVector; |
|
181 |
} |
|
182 |
||
183 |
class HighLatencyCtsToSelfTxVectorTag : public Tag |
|
184 |
{ |
|
185 |
public: |
|
186 |
HighLatencyCtsToSelfTxVectorTag (); |
|
187 |
HighLatencyCtsToSelfTxVectorTag (WifiTxVector ctsToSelfTxVector); |
|
10424
9d29c9a5ddcb
doxygen warnings for wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10410
diff
changeset
|
188 |
/** |
9d29c9a5ddcb
doxygen warnings for wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10410
diff
changeset
|
189 |
* \returns the transmission mode to use for the CTS-to-self. |
9d29c9a5ddcb
doxygen warnings for wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10410
diff
changeset
|
190 |
*/ |
10139 | 191 |
WifiTxVector GetCtsToSelfTxVector (void) const; |
192 |
||
193 |
static TypeId GetTypeId (void); |
|
194 |
virtual TypeId GetInstanceTypeId (void) const; |
|
195 |
virtual uint32_t GetSerializedSize (void) const; |
|
196 |
virtual void Serialize (TagBuffer i) const; |
|
197 |
virtual void Deserialize (TagBuffer i); |
|
198 |
virtual void Print (std::ostream &os) const; |
|
199 |
private: |
|
200 |
WifiTxVector m_ctsToSelfTxVector; |
|
201 |
}; |
|
202 |
||
203 |
HighLatencyCtsToSelfTxVectorTag::HighLatencyCtsToSelfTxVectorTag () |
|
3038
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
204 |
{ |
10139 | 205 |
} |
206 |
HighLatencyCtsToSelfTxVectorTag::HighLatencyCtsToSelfTxVectorTag ( WifiTxVector ctsToSelfTxVector) |
|
207 |
: m_ctsToSelfTxVector (ctsToSelfTxVector) |
|
208 |
{ |
|
209 |
} |
|
210 |
||
211 |
WifiTxVector |
|
212 |
HighLatencyCtsToSelfTxVectorTag::GetCtsToSelfTxVector (void) const |
|
213 |
{ |
|
214 |
return m_ctsToSelfTxVector; |
|
215 |
} |
|
216 |
TypeId |
|
217 |
HighLatencyCtsToSelfTxVectorTag::GetTypeId (void) |
|
218 |
{ |
|
219 |
static TypeId tid = TypeId ("ns3::HighLatencyCtsToSelfTxVectorTag") |
|
220 |
.SetParent<Tag> () |
|
11245
5c781d7e5a25
SetGroupName for wifi module
Tom Henderson <tomh@tomh.org>
parents:
11159
diff
changeset
|
221 |
.SetGroupName ("Wifi") |
10139 | 222 |
.AddConstructor<HighLatencyCtsToSelfTxVectorTag> () |
223 |
; |
|
224 |
return tid; |
|
225 |
} |
|
226 |
TypeId |
|
227 |
HighLatencyCtsToSelfTxVectorTag::GetInstanceTypeId (void) const |
|
228 |
{ |
|
229 |
return GetTypeId (); |
|
230 |
} |
|
231 |
uint32_t |
|
232 |
HighLatencyCtsToSelfTxVectorTag::GetSerializedSize (void) const |
|
233 |
{ |
|
234 |
return sizeof (WifiTxVector); |
|
3038
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
235 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
236 |
void |
10139 | 237 |
HighLatencyCtsToSelfTxVectorTag::Serialize (TagBuffer i) const |
3038
5962e2962fa9
convert to new tag API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
238 |
{ |
10139 | 239 |
i.Write ((uint8_t *)&m_ctsToSelfTxVector, sizeof (WifiTxVector)); |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
240 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
241 |
void |
10139 | 242 |
HighLatencyCtsToSelfTxVectorTag::Deserialize (TagBuffer i) |
3208
1a754d09c4ba
bug 200: Packet::PrintTags is not implemented.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3041
diff
changeset
|
243 |
{ |
10139 | 244 |
i.Read ((uint8_t *)&m_ctsToSelfTxVector, sizeof (WifiTxVector)); |
245 |
} |
|
246 |
void |
|
247 |
HighLatencyCtsToSelfTxVectorTag::Print (std::ostream &os) const |
|
248 |
{ |
|
249 |
os << "Cts To Self=" << m_ctsToSelfTxVector; |
|
3208
1a754d09c4ba
bug 200: Packet::PrintTags is not implemented.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3041
diff
changeset
|
250 |
} |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
251 |
|
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
252 |
} // namespace ns3 |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2027
diff
changeset
|
253 |
|
6065 | 254 |
namespace ns3 { |
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
255 |
|
10652
dc18deba4502
[doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10580
diff
changeset
|
256 |
NS_OBJECT_ENSURE_REGISTERED (WifiRemoteStationManager); |
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
257 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
258 |
TypeId |
6065 | 259 |
WifiRemoteStationManager::GetTypeId (void) |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
260 |
{ |
6065 | 261 |
static TypeId tid = TypeId ("ns3::WifiRemoteStationManager") |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
262 |
.SetParent<Object> () |
11245
5c781d7e5a25
SetGroupName for wifi module
Tom Henderson <tomh@tomh.org>
parents:
11159
diff
changeset
|
263 |
.SetGroupName ("Wifi") |
6065 | 264 |
.AddAttribute ("IsLowLatency", "If true, we attempt to modelize a so-called low-latency device: a device" |
265 |
" where decisions about tx parameters can be made on a per-packet basis and feedback about the" |
|
266 |
" transmission of each packet is obtained before sending the next. Otherwise, we modelize a " |
|
267 |
" high-latency device, that is a device where we cannot update our decision about tx parameters" |
|
268 |
" after every packet transmission.", |
|
6241
d9a65be745f0
Bug 802 - Minstrel, Onoe and Amrr not working
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6087
diff
changeset
|
269 |
BooleanValue (true), // this value is ignored because there is no setter |
6065 | 270 |
MakeBooleanAccessor (&WifiRemoteStationManager::IsLowLatency), |
271 |
MakeBooleanChecker ()) |
|
272 |
.AddAttribute ("MaxSsrc", "The maximum number of retransmission attempts for an RTS. This value" |
|
273 |
" will not have any effect on some rate control algorithms.", |
|
274 |
UintegerValue (7), |
|
275 |
MakeUintegerAccessor (&WifiRemoteStationManager::m_maxSsrc), |
|
276 |
MakeUintegerChecker<uint32_t> ()) |
|
277 |
.AddAttribute ("MaxSlrc", "The maximum number of retransmission attempts for a DATA packet. This value" |
|
278 |
" will not have any effect on some rate control algorithms.", |
|
279 |
UintegerValue (7), |
|
280 |
MakeUintegerAccessor (&WifiRemoteStationManager::m_maxSlrc), |
|
281 |
MakeUintegerChecker<uint32_t> ()) |
|
6473 | 282 |
.AddAttribute ("RtsCtsThreshold", "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than " |
10580
2a29a9bd6fd6
Update (most of) IEEE Std 802.11-2007 to IEEE Std 802.11-2012
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
283 |
"this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. " |
6473 | 284 |
"This value will not have any effect on some rate control algorithms.", |
285 |
UintegerValue (2346), |
|
6065 | 286 |
MakeUintegerAccessor (&WifiRemoteStationManager::m_rtsCtsThreshold), |
287 |
MakeUintegerChecker<uint32_t> ()) |
|
6473 | 288 |
.AddAttribute ("FragmentationThreshold", "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger" |
289 |
"than this value, we fragment it such that the size of the fragments are equal or smaller " |
|
10580
2a29a9bd6fd6
Update (most of) IEEE Std 802.11-2007 to IEEE Std 802.11-2012
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
290 |
"than this value, as per IEEE Std. 802.11-2012, Section 9.5. " |
6473 | 291 |
"This value will not have any effect on some rate control algorithms.", |
292 |
UintegerValue (2346), |
|
9165
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
293 |
MakeUintegerAccessor (&WifiRemoteStationManager::DoSetFragmentationThreshold, |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
294 |
&WifiRemoteStationManager::DoGetFragmentationThreshold), |
6065 | 295 |
MakeUintegerChecker<uint32_t> ()) |
296 |
.AddAttribute ("NonUnicastMode", "Wifi mode used for non-unicast transmissions.", |
|
297 |
WifiModeValue (), |
|
298 |
MakeWifiModeAccessor (&WifiRemoteStationManager::m_nonUnicastMode), |
|
299 |
MakeWifiModeChecker ()) |
|
10139 | 300 |
.AddAttribute ("DefaultTxPowerLevel", "Default power level to be used for transmissions. " |
301 |
"This is the power level that is used by all those WifiManagers that do not" |
|
302 |
"implement TX power control.", |
|
303 |
UintegerValue (0), |
|
304 |
MakeUintegerAccessor (&WifiRemoteStationManager::m_defaultTxPowerLevel), |
|
305 |
MakeUintegerChecker<uint8_t> ()) |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
306 |
.AddTraceSource ("MacTxRtsFailed", |
6065 | 307 |
"The transmission of a RTS by the MAC layer has failed", |
11085
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11066
diff
changeset
|
308 |
MakeTraceSourceAccessor (&WifiRemoteStationManager::m_macTxRtsFailed), |
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11066
diff
changeset
|
309 |
"ns3::Mac48Address::TracedCallback") |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
310 |
.AddTraceSource ("MacTxDataFailed", |
6065 | 311 |
"The transmission of a data packet by the MAC layer has failed", |
11085
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11066
diff
changeset
|
312 |
MakeTraceSourceAccessor (&WifiRemoteStationManager::m_macTxDataFailed), |
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11066
diff
changeset
|
313 |
"ns3::Mac48Address::TracedCallback") |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
314 |
.AddTraceSource ("MacTxFinalRtsFailed", |
6065 | 315 |
"The transmission of a RTS has exceeded the maximum number of attempts", |
11085
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11066
diff
changeset
|
316 |
MakeTraceSourceAccessor (&WifiRemoteStationManager::m_macTxFinalRtsFailed), |
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11066
diff
changeset
|
317 |
"ns3::Mac48Address::TracedCallback") |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
318 |
.AddTraceSource ("MacTxFinalDataFailed", |
6065 | 319 |
"The transmission of a data packet has exceeded the maximum number of attempts", |
11085
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11066
diff
changeset
|
320 |
MakeTraceSourceAccessor (&WifiRemoteStationManager::m_macTxFinalDataFailed), |
6e4d08656d7c
TracedCallback function signatures, the simple ones.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11066
diff
changeset
|
321 |
"ns3::Mac48Address::TracedCallback") |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
322 |
; |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
323 |
return tid; |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
324 |
} |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
325 |
|
6065 | 326 |
WifiRemoteStationManager::WifiRemoteStationManager () |
11388
e367c5bde0fa
clear valgrind warnings for aggregation test
Tom Henderson <tomh@tomh.org>
parents:
11384
diff
changeset
|
327 |
: m_htSupported (false) |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
328 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
329 |
} |
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
330 |
|
6065 | 331 |
WifiRemoteStationManager::~WifiRemoteStationManager () |
332 |
{ |
|
333 |
} |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
334 |
void |
6065 | 335 |
WifiRemoteStationManager::DoDispose (void) |
2003
335dc094e52a
support BRAND_NEW station in adhoc code. initialize the supported rates.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1989
diff
changeset
|
336 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
337 |
for (StationStates::const_iterator i = m_states.begin (); i != m_states.end (); i++) |
6065 | 338 |
{ |
339 |
delete (*i); |
|
340 |
} |
|
341 |
m_states.clear (); |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
342 |
for (Stations::const_iterator i = m_stations.begin (); i != m_stations.end (); i++) |
6065 | 343 |
{ |
344 |
delete (*i); |
|
345 |
} |
|
346 |
m_stations.clear (); |
|
347 |
} |
|
348 |
void |
|
349 |
WifiRemoteStationManager::SetupPhy (Ptr<WifiPhy> phy) |
|
350 |
{ |
|
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
351 |
// We need to track our PHY because it is the object that knows the |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
352 |
// full set of transmit rates that are supported. We need to know |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
353 |
// this in order to find the relevant mandatory rates when chosing a |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
354 |
// transmit rate for automatic control responses like |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
355 |
// acknowledgements. |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
356 |
m_wifiPhy = phy; |
6065 | 357 |
m_defaultTxMode = phy->GetMode (0); |
10139 | 358 |
if(HasHtSupported()) |
359 |
{ |
|
360 |
m_defaultTxMcs = phy->GetMcs (0); |
|
361 |
} |
|
362 |
else |
|
363 |
{ |
|
364 |
m_defaultTxMcs = 0; |
|
365 |
} |
|
6065 | 366 |
Reset (); |
2003
335dc094e52a
support BRAND_NEW station in adhoc code. initialize the supported rates.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1989
diff
changeset
|
367 |
} |
10139 | 368 |
void |
11059
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
369 |
WifiRemoteStationManager::SetupMac (Ptr<WifiMac> mac) |
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
370 |
{ |
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
371 |
// We need to track our MAC because it is the object that knows the |
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
372 |
// full set of interframe spaces. |
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
373 |
m_wifiMac = mac; |
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
374 |
Reset (); |
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
375 |
} |
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
376 |
void |
10139 | 377 |
WifiRemoteStationManager::SetHtSupported (bool enable) |
378 |
{ |
|
379 |
m_htSupported=enable; |
|
380 |
} |
|
2003
335dc094e52a
support BRAND_NEW station in adhoc code. initialize the supported rates.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1989
diff
changeset
|
381 |
|
10139 | 382 |
bool |
383 |
WifiRemoteStationManager::HasHtSupported (void) const |
|
384 |
{ |
|
385 |
return m_htSupported; |
|
386 |
} |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
387 |
uint32_t |
6065 | 388 |
WifiRemoteStationManager::GetMaxSsrc (void) const |
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
389 |
{ |
6065 | 390 |
return m_maxSsrc; |
391 |
} |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
392 |
uint32_t |
6065 | 393 |
WifiRemoteStationManager::GetMaxSlrc (void) const |
394 |
{ |
|
395 |
return m_maxSlrc; |
|
396 |
} |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
397 |
uint32_t |
6065 | 398 |
WifiRemoteStationManager::GetRtsCtsThreshold (void) const |
399 |
{ |
|
400 |
return m_rtsCtsThreshold; |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
401 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
402 |
uint32_t |
6065 | 403 |
WifiRemoteStationManager::GetFragmentationThreshold (void) const |
404 |
{ |
|
9165
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
405 |
return DoGetFragmentationThreshold (); |
6065 | 406 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
407 |
void |
6065 | 408 |
WifiRemoteStationManager::SetMaxSsrc (uint32_t maxSsrc) |
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
409 |
{ |
6065 | 410 |
m_maxSsrc = maxSsrc; |
411 |
} |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
412 |
void |
6065 | 413 |
WifiRemoteStationManager::SetMaxSlrc (uint32_t maxSlrc) |
414 |
{ |
|
415 |
m_maxSlrc = maxSlrc; |
|
416 |
} |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
417 |
void |
6065 | 418 |
WifiRemoteStationManager::SetRtsCtsThreshold (uint32_t threshold) |
419 |
{ |
|
420 |
m_rtsCtsThreshold = threshold; |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
421 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
422 |
void |
6065 | 423 |
WifiRemoteStationManager::SetFragmentationThreshold (uint32_t threshold) |
424 |
{ |
|
9165
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
425 |
DoSetFragmentationThreshold (threshold); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
426 |
} |
6065 | 427 |
|
428 |
void |
|
429 |
WifiRemoteStationManager::Reset (Mac48Address address) |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
430 |
{ |
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
431 |
NS_LOG_FUNCTION (this << address); |
6065 | 432 |
NS_ASSERT (!address.IsGroup ()); |
433 |
WifiRemoteStationState *state = LookupState (address); |
|
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
434 |
state->m_operationalRateSet.clear (); |
10139 | 435 |
state->m_operationalMcsSet.clear (); |
6065 | 436 |
AddSupportedMode (address, GetDefaultMode ()); |
10139 | 437 |
AddSupportedMcs(address,GetDefaultMcs()); |
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
438 |
} |
6065 | 439 |
void |
440 |
WifiRemoteStationManager::AddSupportedMode (Mac48Address address, WifiMode mode) |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
441 |
{ |
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
442 |
NS_LOG_FUNCTION (this << address << mode); |
6065 | 443 |
NS_ASSERT (!address.IsGroup ()); |
444 |
WifiRemoteStationState *state = LookupState (address); |
|
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
445 |
for (WifiModeListIterator i = state->m_operationalRateSet.begin (); i != state->m_operationalRateSet.end (); i++) |
6065 | 446 |
{ |
447 |
if ((*i) == mode) |
|
448 |
{ |
|
449 |
// already in. |
|
450 |
return; |
|
451 |
} |
|
452 |
} |
|
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
453 |
state->m_operationalRateSet.push_back (mode); |
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
454 |
} |
11159
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11100
diff
changeset
|
455 |
void |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11100
diff
changeset
|
456 |
WifiRemoteStationManager::AddAllSupportedModes (Mac48Address address) |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11100
diff
changeset
|
457 |
{ |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11100
diff
changeset
|
458 |
NS_ASSERT (!address.IsGroup ()); |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11100
diff
changeset
|
459 |
WifiRemoteStationState *state = LookupState (address); |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11100
diff
changeset
|
460 |
state->m_operationalRateSet.clear (); |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11100
diff
changeset
|
461 |
for (uint32_t i = 0; i < m_wifiPhy->GetNModes (); i++) |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11100
diff
changeset
|
462 |
{ |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11100
diff
changeset
|
463 |
state->m_operationalRateSet.push_back ( m_wifiPhy->GetMode (i)); |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11100
diff
changeset
|
464 |
} |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11100
diff
changeset
|
465 |
} |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11100
diff
changeset
|
466 |
|
10139 | 467 |
/*void |
468 |
WifiRemoteStationManager::AddBssMembershipParameters(Mac48Address address, uint32_t selector) |
|
469 |
{ |
|
470 |
NS_ASSERT (!address.IsGroup ()); |
|
471 |
WifiRemoteStationState *state = LookupState (address); |
|
472 |
WifiMode mode; |
|
473 |
WifiModeList membershipselectormodes = m_wifiPhy->GetMembershipSelectorModes(selector); |
|
474 |
for (WifiModeListIterator j = membershipselectormodes.begin (); j != membershipselectormodes.end (); j++) |
|
475 |
{ |
|
476 |
mode=(*j); |
|
477 |
for (WifiModeListIterator i = state->m_operationalRateSet.begin (); i != state->m_operationalRateSet.end (); i++) |
|
478 |
{ |
|
479 |
if ((*i) == mode) |
|
480 |
{ |
|
481 |
// already in. |
|
482 |
break; |
|
483 |
} |
|
484 |
} |
|
485 |
state->m_operationalRateSet.push_back (mode); |
|
486 |
} |
|
487 |
}*/ |
|
488 |
void |
|
489 |
WifiRemoteStationManager::AddSupportedMcs (Mac48Address address, uint8_t mcs) |
|
490 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
491 |
NS_LOG_FUNCTION (this << address << (uint16_t) mcs); |
10139 | 492 |
NS_ASSERT (!address.IsGroup ()); |
493 |
WifiRemoteStationState *state = LookupState (address); |
|
494 |
for (WifiMcsListIterator i = state->m_operationalMcsSet.begin (); i != state->m_operationalMcsSet.end (); i++) |
|
495 |
{ |
|
496 |
if ((*i) == mcs) |
|
497 |
{ |
|
498 |
// already in. |
|
499 |
return; |
|
500 |
} |
|
501 |
} |
|
502 |
state->m_operationalMcsSet.push_back (mcs); |
|
503 |
} |
|
6065 | 504 |
bool |
505 |
WifiRemoteStationManager::IsBrandNew (Mac48Address address) const |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
506 |
{ |
6065 | 507 |
if (address.IsGroup ()) |
508 |
{ |
|
509 |
return false; |
|
510 |
} |
|
511 |
return LookupState (address)->m_state == WifiRemoteStationState::BRAND_NEW; |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
512 |
} |
6065 | 513 |
bool |
514 |
WifiRemoteStationManager::IsAssociated (Mac48Address address) const |
|
515 |
{ |
|
516 |
if (address.IsGroup ()) |
|
517 |
{ |
|
518 |
return true; |
|
519 |
} |
|
520 |
return LookupState (address)->m_state == WifiRemoteStationState::GOT_ASSOC_TX_OK; |
|
521 |
} |
|
522 |
bool |
|
523 |
WifiRemoteStationManager::IsWaitAssocTxOk (Mac48Address address) const |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
524 |
{ |
6065 | 525 |
if (address.IsGroup ()) |
526 |
{ |
|
527 |
return false; |
|
528 |
} |
|
529 |
return LookupState (address)->m_state == WifiRemoteStationState::WAIT_ASSOC_TX_OK; |
|
530 |
} |
|
531 |
void |
|
532 |
WifiRemoteStationManager::RecordWaitAssocTxOk (Mac48Address address) |
|
533 |
{ |
|
534 |
NS_ASSERT (!address.IsGroup ()); |
|
535 |
LookupState (address)->m_state = WifiRemoteStationState::WAIT_ASSOC_TX_OK; |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
536 |
} |
6065 | 537 |
void |
538 |
WifiRemoteStationManager::RecordGotAssocTxOk (Mac48Address address) |
|
539 |
{ |
|
540 |
NS_ASSERT (!address.IsGroup ()); |
|
541 |
LookupState (address)->m_state = WifiRemoteStationState::GOT_ASSOC_TX_OK; |
|
542 |
} |
|
543 |
void |
|
544 |
WifiRemoteStationManager::RecordGotAssocTxFailed (Mac48Address address) |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
545 |
{ |
6065 | 546 |
NS_ASSERT (!address.IsGroup ()); |
547 |
LookupState (address)->m_state = WifiRemoteStationState::DISASSOC; |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
548 |
} |
6065 | 549 |
void |
550 |
WifiRemoteStationManager::RecordDisassociated (Mac48Address address) |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
551 |
{ |
6065 | 552 |
NS_ASSERT (!address.IsGroup ()); |
553 |
LookupState (address)->m_state = WifiRemoteStationState::DISASSOC; |
|
554 |
} |
|
555 |
void |
|
556 |
WifiRemoteStationManager::PrepareForQueue (Mac48Address address, const WifiMacHeader *header, |
|
557 |
Ptr<const Packet> packet, uint32_t fullPacketSize) |
|
558 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
559 |
NS_LOG_FUNCTION (this << address << *header << packet << fullPacketSize); |
6065 | 560 |
if (IsLowLatency () || address.IsGroup ()) |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
561 |
{ |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
562 |
return; |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
563 |
} |
6241
d9a65be745f0
Bug 802 - Minstrel, Onoe and Amrr not working
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6087
diff
changeset
|
564 |
WifiRemoteStation *station = Lookup (address, header); |
10139 | 565 |
WifiTxVector rts = DoGetRtsTxVector (station); |
566 |
WifiTxVector data = DoGetDataTxVector (station, fullPacketSize); |
|
567 |
WifiTxVector ctstoself = DoGetCtsToSelfTxVector (); |
|
568 |
HighLatencyDataTxVectorTag datatag; |
|
569 |
HighLatencyRtsTxVectorTag rtstag; |
|
570 |
HighLatencyCtsToSelfTxVectorTag ctstoselftag; |
|
6241
d9a65be745f0
Bug 802 - Minstrel, Onoe and Amrr not working
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6087
diff
changeset
|
571 |
// first, make sure that the tag is not here anymore. |
10139 | 572 |
ConstCast<Packet> (packet)->RemovePacketTag (datatag); |
573 |
ConstCast<Packet> (packet)->RemovePacketTag (rtstag); |
|
574 |
ConstCast<Packet> (packet)->RemovePacketTag (ctstoselftag); |
|
575 |
datatag = HighLatencyDataTxVectorTag (data); |
|
576 |
rtstag = HighLatencyRtsTxVectorTag (rts); |
|
577 |
ctstoselftag = HighLatencyCtsToSelfTxVectorTag (ctstoself); |
|
6241
d9a65be745f0
Bug 802 - Minstrel, Onoe and Amrr not working
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6087
diff
changeset
|
578 |
// and then, add it back |
10139 | 579 |
packet->AddPacketTag (datatag); |
580 |
packet->AddPacketTag (rtstag); |
|
581 |
packet->AddPacketTag (ctstoselftag); |
|
6065 | 582 |
} |
10139 | 583 |
WifiTxVector |
584 |
WifiRemoteStationManager::GetDataTxVector (Mac48Address address, const WifiMacHeader *header, |
|
6065 | 585 |
Ptr<const Packet> packet, uint32_t fullPacketSize) |
586 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
587 |
NS_LOG_FUNCTION (this << address << *header << packet << fullPacketSize); |
6065 | 588 |
if (address.IsGroup ()) |
589 |
{ |
|
10139 | 590 |
WifiTxVector v; |
591 |
v.SetMode (GetNonUnicastMode ()); |
|
592 |
v.SetTxPowerLevel (m_defaultTxPowerLevel); |
|
593 |
v.SetShortGuardInterval (false); |
|
594 |
v.SetNss (1); |
|
595 |
v.SetNess (0); |
|
596 |
v.SetStbc (false); |
|
597 |
return v; |
|
6065 | 598 |
} |
599 |
if (!IsLowLatency ()) |
|
600 |
{ |
|
10139 | 601 |
HighLatencyDataTxVectorTag datatag; |
6065 | 602 |
bool found; |
10139 | 603 |
found = ConstCast<Packet> (packet)->PeekPacketTag (datatag); |
6065 | 604 |
NS_ASSERT (found); |
10139 | 605 |
// cast found to void, to suppress 'found' set but not used |
606 |
// compiler warning |
|
607 |
(void) found; |
|
608 |
return datatag.GetDataTxVector (); |
|
6065 | 609 |
} |
10139 | 610 |
return DoGetDataTxVector (Lookup (address, header), fullPacketSize); |
6065 | 611 |
} |
10139 | 612 |
WifiTxVector |
613 |
WifiRemoteStationManager::GetCtsToSelfTxVector(const WifiMacHeader *header, |
|
614 |
Ptr<const Packet> packet) |
|
615 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
616 |
NS_LOG_FUNCTION (this << *header << packet); |
10139 | 617 |
if (!IsLowLatency ()) |
618 |
{ |
|
619 |
HighLatencyCtsToSelfTxVectorTag ctstoselftag; |
|
620 |
bool found; |
|
621 |
found = ConstCast<Packet> (packet)->PeekPacketTag (ctstoselftag); |
|
622 |
NS_ASSERT (found); |
|
623 |
// cast found to void, to suppress 'found' set but not used |
|
624 |
// compiler warning |
|
625 |
(void) found; |
|
626 |
return ctstoselftag.GetCtsToSelfTxVector (); |
|
627 |
} |
|
628 |
return DoGetCtsToSelfTxVector (); |
|
629 |
} |
|
630 |
||
631 |
WifiTxVector |
|
632 |
WifiRemoteStationManager::DoGetCtsToSelfTxVector (void) |
|
633 |
{ |
|
634 |
return WifiTxVector (GetDefaultMode(), GetDefaultTxPowerLevel (),0,m_wifiPhy->GetGuardInterval(),GetNumberOfTransmitAntennas(), GetNumberOfTransmitAntennas(), false); |
|
635 |
} |
|
636 |
||
637 |
WifiTxVector |
|
638 |
WifiRemoteStationManager::GetRtsTxVector (Mac48Address address, const WifiMacHeader *header, |
|
6065 | 639 |
Ptr<const Packet> packet) |
640 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
641 |
NS_LOG_FUNCTION (this << address << *header << packet); |
6065 | 642 |
NS_ASSERT (!address.IsGroup ()); |
643 |
if (!IsLowLatency ()) |
|
644 |
{ |
|
10139 | 645 |
HighLatencyRtsTxVectorTag rtstag; |
6065 | 646 |
bool found; |
10139 | 647 |
found = ConstCast<Packet> (packet)->PeekPacketTag (rtstag); |
6065 | 648 |
NS_ASSERT (found); |
10139 | 649 |
// cast found to void, to suppress 'found' set but not used |
650 |
// compiler warning |
|
651 |
(void) found; |
|
652 |
return rtstag.GetRtsTxVector (); |
|
6065 | 653 |
} |
10139 | 654 |
return DoGetRtsTxVector (Lookup (address, header)); |
6065 | 655 |
} |
656 |
void |
|
657 |
WifiRemoteStationManager::ReportRtsFailed (Mac48Address address, const WifiMacHeader *header) |
|
658 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
659 |
NS_LOG_FUNCTION (this << address << *header); |
6065 | 660 |
NS_ASSERT (!address.IsGroup ()); |
661 |
WifiRemoteStation *station = Lookup (address, header); |
|
662 |
station->m_ssrc++; |
|
663 |
m_macTxRtsFailed (address); |
|
664 |
DoReportRtsFailed (station); |
|
665 |
} |
|
666 |
void |
|
667 |
WifiRemoteStationManager::ReportDataFailed (Mac48Address address, const WifiMacHeader *header) |
|
668 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
669 |
NS_LOG_FUNCTION (this << address << *header); |
6065 | 670 |
NS_ASSERT (!address.IsGroup ()); |
671 |
WifiRemoteStation *station = Lookup (address, header); |
|
672 |
station->m_slrc++; |
|
673 |
m_macTxDataFailed (address); |
|
674 |
DoReportDataFailed (station); |
|
675 |
} |
|
676 |
void |
|
677 |
WifiRemoteStationManager::ReportRtsOk (Mac48Address address, const WifiMacHeader *header, |
|
678 |
double ctsSnr, WifiMode ctsMode, double rtsSnr) |
|
679 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
680 |
NS_LOG_FUNCTION (this << address << *header << ctsSnr << ctsMode << rtsSnr); |
6065 | 681 |
NS_ASSERT (!address.IsGroup ()); |
682 |
WifiRemoteStation *station = Lookup (address, header); |
|
6069
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
683 |
station->m_state->m_info.NotifyTxSuccess (station->m_ssrc); |
6065 | 684 |
station->m_ssrc = 0; |
685 |
DoReportRtsOk (station, ctsSnr, ctsMode, rtsSnr); |
|
686 |
} |
|
687 |
void |
|
688 |
WifiRemoteStationManager::ReportDataOk (Mac48Address address, const WifiMacHeader *header, |
|
689 |
double ackSnr, WifiMode ackMode, double dataSnr) |
|
690 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
691 |
NS_LOG_FUNCTION (this << address << *header << ackSnr << ackMode << dataSnr); |
6065 | 692 |
NS_ASSERT (!address.IsGroup ()); |
693 |
WifiRemoteStation *station = Lookup (address, header); |
|
6069
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
694 |
station->m_state->m_info.NotifyTxSuccess (station->m_slrc); |
6065 | 695 |
station->m_slrc = 0; |
696 |
DoReportDataOk (station, ackSnr, ackMode, dataSnr); |
|
697 |
} |
|
698 |
void |
|
699 |
WifiRemoteStationManager::ReportFinalRtsFailed (Mac48Address address, const WifiMacHeader *header) |
|
700 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
701 |
NS_LOG_FUNCTION (this << address << *header); |
6065 | 702 |
NS_ASSERT (!address.IsGroup ()); |
703 |
WifiRemoteStation *station = Lookup (address, header); |
|
6069
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
704 |
station->m_state->m_info.NotifyTxFailed (); |
6065 | 705 |
station->m_ssrc = 0; |
706 |
m_macTxFinalRtsFailed (address); |
|
707 |
DoReportFinalRtsFailed (station); |
|
708 |
} |
|
709 |
void |
|
710 |
WifiRemoteStationManager::ReportFinalDataFailed (Mac48Address address, const WifiMacHeader *header) |
|
711 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
712 |
NS_LOG_FUNCTION (this << address << *header); |
6065 | 713 |
NS_ASSERT (!address.IsGroup ()); |
714 |
WifiRemoteStation *station = Lookup (address, header); |
|
6069
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
715 |
station->m_state->m_info.NotifyTxFailed (); |
6065 | 716 |
station->m_slrc = 0; |
717 |
m_macTxFinalDataFailed (address); |
|
718 |
DoReportFinalDataFailed (station); |
|
719 |
} |
|
720 |
void |
|
721 |
WifiRemoteStationManager::ReportRxOk (Mac48Address address, const WifiMacHeader *header, |
|
722 |
double rxSnr, WifiMode txMode) |
|
723 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
724 |
NS_LOG_FUNCTION (this << address << *header << rxSnr << txMode); |
6065 | 725 |
if (address.IsGroup ()) |
726 |
{ |
|
727 |
return; |
|
728 |
} |
|
729 |
WifiRemoteStation *station = Lookup (address, header); |
|
730 |
DoReportRxOk (station, rxSnr, txMode); |
|
731 |
} |
|
732 |
bool |
|
733 |
WifiRemoteStationManager::NeedRts (Mac48Address address, const WifiMacHeader *header, |
|
734 |
Ptr<const Packet> packet) |
|
735 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
736 |
NS_LOG_FUNCTION (this << address << *header << packet); |
6065 | 737 |
if (address.IsGroup ()) |
738 |
{ |
|
739 |
return false; |
|
740 |
} |
|
6473 | 741 |
bool normally = (packet->GetSize () + header->GetSize () + WIFI_MAC_FCS_LENGTH) > GetRtsCtsThreshold (); |
6065 | 742 |
return DoNeedRts (Lookup (address, header), packet, normally); |
743 |
} |
|
744 |
bool |
|
10139 | 745 |
WifiRemoteStationManager::NeedCtsToSelf (WifiTxVector txVector) |
746 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
747 |
NS_LOG_FUNCTION (this << txVector); |
10139 | 748 |
WifiMode mode = txVector.GetMode(); |
749 |
||
750 |
// search the BSS Basic Rate set if the used mode in the basic set then no need for Cts to self |
|
751 |
for (WifiModeListIterator i = m_bssBasicRateSet.begin (); |
|
752 |
i != m_bssBasicRateSet.end (); i++) |
|
753 |
{ |
|
754 |
if (mode == *i) |
|
755 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
756 |
NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning false"); |
10139 | 757 |
return false; |
758 |
} |
|
759 |
} |
|
760 |
if (HasHtSupported()) |
|
761 |
{ |
|
762 |
uint8_t mcs = m_wifiPhy->WifiModeToMcs (mode); |
|
763 |
for (WifiMcsListIterator i = m_bssBasicMcsSet.begin (); |
|
764 |
i != m_bssBasicMcsSet.end (); i++) |
|
765 |
{ |
|
766 |
if (mcs == *i) |
|
767 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
768 |
NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning false"); |
10139 | 769 |
return false; |
770 |
} |
|
771 |
} |
|
772 |
} |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
773 |
NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning true"); |
10139 | 774 |
return true; |
775 |
} |
|
776 |
bool |
|
6065 | 777 |
WifiRemoteStationManager::NeedRtsRetransmission (Mac48Address address, const WifiMacHeader *header, |
778 |
Ptr<const Packet> packet) |
|
779 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
780 |
NS_LOG_FUNCTION (this << address << packet << *header); |
6065 | 781 |
NS_ASSERT (!address.IsGroup ()); |
782 |
WifiRemoteStation *station = Lookup (address, header); |
|
783 |
bool normally = station->m_ssrc < GetMaxSsrc (); |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
784 |
NS_LOG_DEBUG ("WifiRemoteStationManager::NeedDataRetransmission count: " << station->m_ssrc << " result: " << std::boolalpha << normally); |
6065 | 785 |
return DoNeedRtsRetransmission (station, packet, normally); |
786 |
} |
|
787 |
bool |
|
788 |
WifiRemoteStationManager::NeedDataRetransmission (Mac48Address address, const WifiMacHeader *header, |
|
789 |
Ptr<const Packet> packet) |
|
790 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
791 |
NS_LOG_FUNCTION (this << address << packet << *header); |
6065 | 792 |
NS_ASSERT (!address.IsGroup ()); |
793 |
WifiRemoteStation *station = Lookup (address, header); |
|
794 |
bool normally = station->m_slrc < GetMaxSlrc (); |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
795 |
NS_LOG_DEBUG ("WifiRemoteStationManager::NeedDataRetransmission count: " << station->m_slrc << " result: " << std::boolalpha << normally); |
6065 | 796 |
return DoNeedDataRetransmission (station, packet, normally); |
797 |
} |
|
798 |
bool |
|
799 |
WifiRemoteStationManager::NeedFragmentation (Mac48Address address, const WifiMacHeader *header, |
|
800 |
Ptr<const Packet> packet) |
|
801 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
802 |
NS_LOG_FUNCTION (this << address << packet << *header); |
6065 | 803 |
if (address.IsGroup ()) |
804 |
{ |
|
805 |
return false; |
|
806 |
} |
|
807 |
WifiRemoteStation *station = Lookup (address, header); |
|
6473 | 808 |
bool normally = (packet->GetSize () + header->GetSize () + WIFI_MAC_FCS_LENGTH) > GetFragmentationThreshold (); |
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
809 |
NS_LOG_DEBUG ("WifiRemoteStationManager::NeedFragmentation result: " << std::boolalpha << normally); |
6065 | 810 |
return DoNeedFragmentation (station, packet, normally); |
811 |
} |
|
9165
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
812 |
|
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
813 |
void |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
814 |
WifiRemoteStationManager::DoSetFragmentationThreshold (uint32_t threshold) |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
815 |
{ |
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
816 |
NS_LOG_FUNCTION (this << threshold); |
9165
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
817 |
if (threshold < 256) |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
818 |
{ |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
819 |
/* |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
820 |
* ASN.1 encoding of the MAC and PHY MIB (256 ... 8000) |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
821 |
*/ |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
822 |
NS_LOG_WARN ("Fragmentation threshold should be larger than 256. Setting to 256."); |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
823 |
m_fragmentationThreshold = 256; |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
824 |
} |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
825 |
else |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
826 |
{ |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
827 |
/* |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
828 |
* The length of each fragment shall be an even number of octets, except for the last fragment if an MSDU or |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
829 |
* MMPDU, which may be either an even or an odd number of octets. |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
830 |
*/ |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
831 |
if (threshold % 2 != 0) |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
832 |
{ |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
833 |
NS_LOG_WARN ("Fragmentation threshold should be an even number. Setting to " << threshold - 1); |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
834 |
m_fragmentationThreshold = threshold - 1; |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
835 |
} |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
836 |
else |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
837 |
{ |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
838 |
m_fragmentationThreshold = threshold; |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
839 |
} |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
840 |
} |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
841 |
} |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
842 |
|
6065 | 843 |
uint32_t |
9165
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
844 |
WifiRemoteStationManager::DoGetFragmentationThreshold (void) const |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
845 |
{ |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
846 |
return m_fragmentationThreshold; |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
847 |
} |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
848 |
|
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
849 |
uint32_t |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
850 |
WifiRemoteStationManager::GetNFragments (const WifiMacHeader *header, Ptr<const Packet> packet) |
6065 | 851 |
{ |
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
852 |
NS_LOG_FUNCTION (this << *header << packet); |
9165
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
853 |
//The number of bytes a fragment can support is (Threshold - WIFI_HEADER_SIZE - WIFI_FCS). |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
854 |
uint32_t nFragments = (packet->GetSize () / (GetFragmentationThreshold () - header->GetSize () - WIFI_MAC_FCS_LENGTH)); |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
855 |
|
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
856 |
//If the size of the last fragment is not 0. |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
857 |
if ((packet->GetSize () % (GetFragmentationThreshold () - header->GetSize () - WIFI_MAC_FCS_LENGTH)) > 0) |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
858 |
{ |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
859 |
nFragments++; |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
860 |
} |
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
861 |
NS_LOG_DEBUG ("WifiRemoteStationManager::GetNFragments returning " << nFragments); |
6065 | 862 |
return nFragments; |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
863 |
} |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
864 |
|
6065 | 865 |
uint32_t |
866 |
WifiRemoteStationManager::GetFragmentSize (Mac48Address address, const WifiMacHeader *header, |
|
867 |
Ptr<const Packet> packet, uint32_t fragmentNumber) |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
868 |
{ |
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
869 |
NS_LOG_FUNCTION (this << address << *header << packet << fragmentNumber); |
6065 | 870 |
NS_ASSERT (!address.IsGroup ()); |
9165
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
871 |
uint32_t nFragment = GetNFragments (header, packet); |
6065 | 872 |
if (fragmentNumber >= nFragment) |
873 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
874 |
NS_LOG_DEBUG ("WifiRemoteStationManager::GetFragmentSize returning 0"); |
6065 | 875 |
return 0; |
876 |
} |
|
9165
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
877 |
//Last fragment |
6065 | 878 |
if (fragmentNumber == nFragment - 1) |
879 |
{ |
|
9165
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
880 |
uint32_t lastFragmentSize = packet->GetSize () - (fragmentNumber * (GetFragmentationThreshold () - header->GetSize () - WIFI_MAC_FCS_LENGTH)); |
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
881 |
NS_LOG_DEBUG ("WifiRemoteStationManager::GetFragmentSize returning " << lastFragmentSize); |
6065 | 882 |
return lastFragmentSize; |
883 |
} |
|
9165
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
884 |
//All fragments but the last, the number of bytes is (Threshold - WIFI_HEADER_SIZE - WIFI_FCS). |
6065 | 885 |
else |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
886 |
{ |
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
887 |
uint32_t fragmentSize = GetFragmentationThreshold () - header->GetSize () - WIFI_MAC_FCS_LENGTH; |
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
888 |
NS_LOG_DEBUG ("WifiRemoteStationManager::GetFragmentSize returning " << fragmentSize); |
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
889 |
return fragmentSize; |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
890 |
} |
6065 | 891 |
} |
892 |
uint32_t |
|
893 |
WifiRemoteStationManager::GetFragmentOffset (Mac48Address address, const WifiMacHeader *header, |
|
894 |
Ptr<const Packet> packet, uint32_t fragmentNumber) |
|
895 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
896 |
NS_LOG_FUNCTION (this << address << *header << packet << fragmentNumber); |
6065 | 897 |
NS_ASSERT (!address.IsGroup ()); |
9165
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
898 |
NS_ASSERT (fragmentNumber < GetNFragments (header, packet)); |
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
899 |
uint32_t fragmentOffset = fragmentNumber * (GetFragmentationThreshold () - header->GetSize () - WIFI_MAC_FCS_LENGTH); |
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
900 |
NS_LOG_DEBUG ("WifiRemoteStationManager::GetFragmentOffset returning " << fragmentOffset); |
6065 | 901 |
return fragmentOffset; |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
902 |
} |
6065 | 903 |
bool |
904 |
WifiRemoteStationManager::IsLastFragment (Mac48Address address, const WifiMacHeader *header, |
|
905 |
Ptr<const Packet> packet, uint32_t fragmentNumber) |
|
906 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
907 |
NS_LOG_FUNCTION (this << address << *header << packet << fragmentNumber); |
6065 | 908 |
NS_ASSERT (!address.IsGroup ()); |
9165
7b219a73b844
Bug 1524 - WiFi fragmentation issue
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
9063
diff
changeset
|
909 |
bool isLast = fragmentNumber == (GetNFragments (header, packet) - 1); |
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
910 |
NS_LOG_DEBUG ("WifiRemoteStationManager::IsLastFragment returning " << std::boolalpha << isLast); |
6065 | 911 |
return isLast; |
912 |
} |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
913 |
WifiMode |
6065 | 914 |
WifiRemoteStationManager::GetControlAnswerMode (Mac48Address address, WifiMode reqMode) |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
915 |
{ |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
916 |
/** |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
917 |
* The standard has relatively unambiguous rules for selecting a |
10580
2a29a9bd6fd6
Update (most of) IEEE Std 802.11-2007 to IEEE Std 802.11-2012
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
918 |
* control response rate (the below is quoted from IEEE 802.11-2012, |
2a29a9bd6fd6
Update (most of) IEEE Std 802.11-2007 to IEEE Std 802.11-2012
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
919 |
* Section 9.7): |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
920 |
* |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
921 |
* To allow the transmitting STA to calculate the contents of the |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
922 |
* Duration/ID field, a STA responding to a received frame shall |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
923 |
* transmit its Control Response frame (either CTS or ACK), other |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
924 |
* than the BlockAck control frame, at the highest rate in the |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
925 |
* BSSBasicRateSet parameter that is less than or equal to the |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
926 |
* rate of the immediately previous frame in the frame exchange |
10580
2a29a9bd6fd6
Update (most of) IEEE Std 802.11-2007 to IEEE Std 802.11-2012
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
927 |
* sequence (as defined in Annex G) and that is of the same |
2a29a9bd6fd6
Update (most of) IEEE Std 802.11-2007 to IEEE Std 802.11-2012
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
928 |
* modulation class (see Section 9.7.8) as the received frame... |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
929 |
*/ |
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
930 |
NS_LOG_FUNCTION (this << address << reqMode); |
6065 | 931 |
WifiMode mode = GetDefaultMode (); |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
932 |
bool found = false; |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
933 |
|
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
934 |
// First, search the BSS Basic Rate set |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
935 |
for (WifiModeListIterator i = m_bssBasicRateSet.begin (); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
936 |
i != m_bssBasicRateSet.end (); i++) |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
937 |
{ |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
938 |
if ((!found || i->GetPhyRate () > mode.GetPhyRate ()) |
11384
935dc1cc08a4
Bug 2097 [wifi] - ACKs should be sent using legacy rates and preambles in 802.11n
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
939 |
&& (i->GetPhyRate () <= reqMode.GetPhyRate ()) |
935dc1cc08a4
Bug 2097 [wifi] - ACKs should be sent using legacy rates and preambles in 802.11n
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
940 |
&& ((i->GetModulationClass () == reqMode.GetModulationClass ()) |
935dc1cc08a4
Bug 2097 [wifi] - ACKs should be sent using legacy rates and preambles in 802.11n
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
941 |
|| (reqMode.GetModulationClass () == WIFI_MOD_CLASS_HT))) |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
942 |
{ |
1930
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
943 |
mode = *i; |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
944 |
// We've found a potentially-suitable transmit rate, but we |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
945 |
// need to continue and consider all the basic rates before |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
946 |
// we can be sure we've got the right one. |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
947 |
found = true; |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
948 |
} |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
949 |
} |
10139 | 950 |
if(HasHtSupported()) |
11384
935dc1cc08a4
Bug 2097 [wifi] - ACKs should be sent using legacy rates and preambles in 802.11n
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
951 |
{ |
935dc1cc08a4
Bug 2097 [wifi] - ACKs should be sent using legacy rates and preambles in 802.11n
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
952 |
if (!found) |
935dc1cc08a4
Bug 2097 [wifi] - ACKs should be sent using legacy rates and preambles in 802.11n
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
953 |
{ |
935dc1cc08a4
Bug 2097 [wifi] - ACKs should be sent using legacy rates and preambles in 802.11n
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
954 |
uint8_t mcs = GetDefaultMcs (); |
935dc1cc08a4
Bug 2097 [wifi] - ACKs should be sent using legacy rates and preambles in 802.11n
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
955 |
mode = m_wifiPhy->McsToWifiMode (mcs); |
935dc1cc08a4
Bug 2097 [wifi] - ACKs should be sent using legacy rates and preambles in 802.11n
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
956 |
|
935dc1cc08a4
Bug 2097 [wifi] - ACKs should be sent using legacy rates and preambles in 802.11n
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
957 |
for (WifiMcsListIterator i = m_bssBasicMcsSet.begin (); |
10207
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
958 |
i != m_bssBasicMcsSet.end (); i++) |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
959 |
{ |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
960 |
WifiMode thismode= m_wifiPhy->McsToWifiMode (*i); |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
961 |
if ((!found || thismode.GetPhyRate () > mode.GetPhyRate ()) |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
962 |
&& thismode.GetPhyRate () <= reqMode.GetPhyRate () |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
963 |
&& thismode.GetModulationClass () == reqMode.GetModulationClass ()) |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
964 |
{ |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
965 |
mode = thismode; |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
966 |
// We've found a potentially-suitable transmit rate, but we |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
967 |
// need to continue and consider all the basic rates before |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
968 |
// we can be sure we've got the right one. |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
969 |
found = true; |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
970 |
} |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
971 |
} |
11384
935dc1cc08a4
Bug 2097 [wifi] - ACKs should be sent using legacy rates and preambles in 802.11n
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
972 |
} |
10207
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
973 |
} |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
974 |
// If we found a suitable rate in the BSSBasicRateSet, then we are |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
975 |
// done and can return that mode. |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
976 |
if (found) |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
977 |
{ |
11384
935dc1cc08a4
Bug 2097 [wifi] - ACKs should be sent using legacy rates and preambles in 802.11n
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
978 |
NS_LOG_DEBUG ("WifiRemoteStationManager::GetControlAnswerMode returning " << mode); |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
979 |
return mode; |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
980 |
} |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
981 |
|
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
982 |
/** |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
983 |
* If no suitable basic rate was found, we search the mandatory |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
984 |
* rates. The standard (IEEE 802.11-2007, Section 9.6) says: |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
985 |
* |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
986 |
* ...If no rate contained in the BSSBasicRateSet parameter meets |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
987 |
* these conditions, then the control frame sent in response to a |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
988 |
* received frame shall be transmitted at the highest mandatory |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
989 |
* rate of the PHY that is less than or equal to the rate of the |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
990 |
* received frame, and that is of the same modulation class as the |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
991 |
* received frame. In addition, the Control Response frame shall |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
992 |
* be sent using the same PHY options as the received frame, |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
993 |
* unless they conflict with the requirement to use the |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
994 |
* BSSBasicRateSet parameter. |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
995 |
* |
9870
6543f3876ff5
[Doxygen] use \todo
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9165
diff
changeset
|
996 |
* \todo Note that we're ignoring the last sentence for now, because |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
997 |
* there is not yet any manipulation here of PHY options. |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
998 |
*/ |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
999 |
for (uint32_t idx = 0; idx < m_wifiPhy->GetNModes (); idx++) |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1000 |
{ |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1001 |
WifiMode thismode = m_wifiPhy->GetMode (idx); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1002 |
|
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1003 |
/* If the rate: |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1004 |
* |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1005 |
* - is a mandatory rate for the PHY, and |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1006 |
* - is equal to or faster than our current best choice, and |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1007 |
* - is less than or equal to the rate of the received frame, and |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1008 |
* - is of the same modulation class as the received frame |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1009 |
* |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1010 |
* ...then it's our best choice so far. |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1011 |
*/ |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1012 |
if (thismode.IsMandatory () |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1013 |
&& (!found || thismode.GetPhyRate () > mode.GetPhyRate ()) |
11384
935dc1cc08a4
Bug 2097 [wifi] - ACKs should be sent using legacy rates and preambles in 802.11n
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
1014 |
&& (thismode.GetPhyRate () <= reqMode.GetPhyRate ()) |
935dc1cc08a4
Bug 2097 [wifi] - ACKs should be sent using legacy rates and preambles in 802.11n
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
1015 |
&& ((thismode.GetModulationClass () == reqMode.GetModulationClass ()) || |
935dc1cc08a4
Bug 2097 [wifi] - ACKs should be sent using legacy rates and preambles in 802.11n
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11245
diff
changeset
|
1016 |
(reqMode.GetModulationClass () == WIFI_MOD_CLASS_HT))) |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1017 |
{ |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1018 |
mode = thismode; |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1019 |
// As above; we've found a potentially-suitable transmit |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1020 |
// rate, but we need to continue and consider all the |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1021 |
// mandatory rates before we can be sure we've got the right |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1022 |
// one. |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1023 |
found = true; |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1024 |
} |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1025 |
} |
10207
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
1026 |
if(HasHtSupported()) |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
1027 |
{ |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
1028 |
for (uint32_t idx = 0; idx < m_wifiPhy->GetNMcs (); idx++) |
10139 | 1029 |
{ |
10207
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
1030 |
uint8_t thismcs = m_wifiPhy->GetMcs (idx); |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
1031 |
WifiMode thismode= m_wifiPhy->McsToWifiMode (thismcs); |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
1032 |
if (thismode.IsMandatory () |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
1033 |
&& (!found || thismode.GetPhyRate () > mode.GetPhyRate ()) |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
1034 |
&& thismode.GetPhyRate () <= reqMode.GetPhyRate () |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
1035 |
&& thismode.GetModulationClass () == reqMode.GetModulationClass ()) |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
1036 |
{ |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
1037 |
mode = thismode; |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
1038 |
// As above; we've found a potentially-suitable transmit |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
1039 |
// rate, but we need to continue and consider all the |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
1040 |
// mandatory rates before we can be sure we've got the right |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
1041 |
// one. |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
1042 |
found = true; |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
1043 |
} |
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
1044 |
|
10139 | 1045 |
} |
10207
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
1046 |
} |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1047 |
|
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1048 |
/** |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1049 |
* If we still haven't found a suitable rate for the response then |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1050 |
* someone has messed up the simulation config. This probably means |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1051 |
* that the WifiPhyStandard is not set correctly, or that a rate that |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1052 |
* is not supported by the PHY has been explicitly requested in a |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1053 |
* WifiRemoteStationManager (or descendant) configuration. |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1054 |
* |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1055 |
* Either way, it is serious - we can either disobey the standard or |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1056 |
* fail, and I have chosen to do the latter... |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1057 |
*/ |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1058 |
if (!found) |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1059 |
{ |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1060 |
NS_FATAL_ERROR ("Can't find response rate for " << reqMode |
10207
4c42c64f7ea8
Fixed indentation in wifi-remote-station-manager.cc
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
1061 |
<< ". Check standard and selected rates match."); |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1062 |
} |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1063 |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
1064 |
NS_LOG_DEBUG ("WifiRemoteStationManager::GetControlAnswerMode returning " << mode); |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
1065 |
return mode; |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
1066 |
} |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
1067 |
|
10139 | 1068 |
WifiTxVector |
1069 |
WifiRemoteStationManager::GetCtsTxVector (Mac48Address address, WifiMode rtsMode) |
|
1070 |
{ |
|
1071 |
NS_ASSERT (!address.IsGroup ()); |
|
1072 |
WifiTxVector v; |
|
1073 |
v.SetMode (GetControlAnswerMode (address, rtsMode)); |
|
1074 |
v.SetTxPowerLevel (DoGetCtsTxPowerLevel (address, v.GetMode())); |
|
1075 |
v.SetShortGuardInterval (DoGetCtsTxGuardInterval(address, v.GetMode())); |
|
1076 |
v.SetNss (DoGetCtsTxNss(address, v.GetMode())); |
|
1077 |
v.SetNess (DoGetCtsTxNess(address, v.GetMode())); |
|
1078 |
v.SetStbc (DoGetCtsTxStbc(address, v.GetMode())); |
|
1079 |
return v; |
|
1080 |
} |
|
1081 |
WifiTxVector |
|
1082 |
WifiRemoteStationManager::GetAckTxVector (Mac48Address address, WifiMode dataMode) |
|
1083 |
{ |
|
1084 |
NS_ASSERT (!address.IsGroup ()); |
|
1085 |
WifiTxVector v; |
|
1086 |
v.SetMode (GetControlAnswerMode (address, dataMode)); |
|
1087 |
v.SetTxPowerLevel (DoGetAckTxPowerLevel (address, v.GetMode())); |
|
1088 |
v.SetShortGuardInterval(DoGetAckTxGuardInterval(address, v.GetMode())); |
|
1089 |
v.SetNss(DoGetAckTxNss(address, v.GetMode())); |
|
1090 |
v.SetNess(DoGetAckTxNess(address, v.GetMode())); |
|
1091 |
v.SetStbc(DoGetAckTxStbc(address, v.GetMode())); |
|
1092 |
return v; |
|
1093 |
} |
|
1094 |
WifiTxVector |
|
1095 |
WifiRemoteStationManager::GetBlockAckTxVector (Mac48Address address, WifiMode blockAckReqMode) |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
1096 |
{ |
6065 | 1097 |
NS_ASSERT (!address.IsGroup ()); |
10139 | 1098 |
WifiTxVector v; |
1099 |
v.SetMode (GetControlAnswerMode (address, blockAckReqMode)); |
|
1100 |
v.SetTxPowerLevel (DoGetBlockAckTxPowerLevel (address, v.GetMode())); |
|
1101 |
v.SetShortGuardInterval (DoGetBlockAckTxGuardInterval(address, v.GetMode())); |
|
1102 |
v.SetNss (DoGetBlockAckTxNss(address, v.GetMode())); |
|
1103 |
v.SetNess (DoGetBlockAckTxNess(address, v.GetMode())); |
|
1104 |
v.SetStbc (DoGetBlockAckTxStbc(address, v.GetMode())); |
|
1105 |
return v; |
|
1106 |
} |
|
1107 |
||
1108 |
uint8_t |
|
1109 |
WifiRemoteStationManager::DoGetCtsTxPowerLevel (Mac48Address address, WifiMode ctsMode) |
|
1110 |
{ |
|
1111 |
return m_defaultTxPowerLevel; |
|
1112 |
} |
|
1113 |
||
1114 |
bool |
|
1115 |
WifiRemoteStationManager::DoGetCtsTxGuardInterval(Mac48Address address, WifiMode ctsMode) |
|
1116 |
{ |
|
1117 |
return m_wifiPhy->GetGuardInterval(); |
|
1118 |
} |
|
1119 |
||
1120 |
uint8_t |
|
1121 |
WifiRemoteStationManager::DoGetCtsTxNss(Mac48Address address, WifiMode ctsMode) |
|
1122 |
{ |
|
1123 |
return 1; |
|
1124 |
} |
|
1125 |
uint8_t |
|
1126 |
WifiRemoteStationManager::DoGetCtsTxNess(Mac48Address address, WifiMode ctsMode) |
|
1127 |
{ |
|
1128 |
return 0; |
|
1129 |
} |
|
1130 |
bool |
|
1131 |
WifiRemoteStationManager::DoGetCtsTxStbc(Mac48Address address, WifiMode ctsMode) |
|
1132 |
{ |
|
1133 |
return m_wifiPhy->GetStbc(); |
|
1134 |
} |
|
1135 |
||
1136 |
uint8_t |
|
1137 |
WifiRemoteStationManager::DoGetAckTxPowerLevel (Mac48Address address, WifiMode ackMode) |
|
1138 |
{ |
|
1139 |
return m_defaultTxPowerLevel; |
|
1140 |
} |
|
1141 |
||
1142 |
bool |
|
1143 |
WifiRemoteStationManager::DoGetAckTxGuardInterval(Mac48Address address, WifiMode ackMode) |
|
1144 |
{ |
|
1145 |
return m_wifiPhy->GetGuardInterval(); |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
1146 |
} |
10139 | 1147 |
|
1148 |
uint8_t |
|
1149 |
WifiRemoteStationManager::DoGetAckTxNss(Mac48Address address, WifiMode ackMode) |
|
1150 |
{ |
|
1151 |
return 1; |
|
1152 |
} |
|
1153 |
uint8_t |
|
1154 |
WifiRemoteStationManager::DoGetAckTxNess(Mac48Address address, WifiMode ackMode) |
|
1155 |
{ |
|
1156 |
return 0; |
|
1157 |
} |
|
1158 |
bool |
|
1159 |
WifiRemoteStationManager::DoGetAckTxStbc(Mac48Address address, WifiMode ackMode) |
|
1160 |
{ |
|
1161 |
return m_wifiPhy->GetStbc(); |
|
1162 |
} |
|
1163 |
||
1164 |
uint8_t |
|
1165 |
WifiRemoteStationManager::DoGetBlockAckTxPowerLevel (Mac48Address address, WifiMode blockAckMode) |
|
1166 |
{ |
|
1167 |
return m_defaultTxPowerLevel; |
|
1168 |
} |
|
1169 |
||
1170 |
bool |
|
1171 |
WifiRemoteStationManager::DoGetBlockAckTxGuardInterval(Mac48Address address, WifiMode blockAckMode) |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
1172 |
{ |
10139 | 1173 |
return m_wifiPhy->GetGuardInterval(); |
1174 |
} |
|
1175 |
||
1176 |
uint8_t |
|
1177 |
WifiRemoteStationManager::DoGetBlockAckTxNss(Mac48Address address, WifiMode blockAckMode) |
|
1178 |
{ |
|
1179 |
return 1; |
|
1180 |
} |
|
1181 |
uint8_t |
|
1182 |
WifiRemoteStationManager::DoGetBlockAckTxNess(Mac48Address address, WifiMode blockAckMode) |
|
1183 |
{ |
|
1184 |
return 0; |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
1185 |
} |
10139 | 1186 |
bool |
1187 |
WifiRemoteStationManager::DoGetBlockAckTxStbc(Mac48Address address, WifiMode blockAckMode) |
|
1188 |
{ |
|
1189 |
return m_wifiPhy->GetStbc(); |
|
1190 |
} |
|
1191 |
||
1192 |
||
1193 |
uint8_t |
|
1194 |
WifiRemoteStationManager::GetDefaultTxPowerLevel (void) const |
|
1195 |
{ |
|
1196 |
return m_defaultTxPowerLevel; |
|
1197 |
} |
|
1198 |
||
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
1199 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1200 |
WifiRemoteStationInfo |
6071
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
1201 |
WifiRemoteStationManager::GetInfo (Mac48Address address) |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
1202 |
{ |
6339 | 1203 |
WifiRemoteStationState *state = LookupState (address); |
6071
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
1204 |
return state->m_info; |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
1205 |
} |
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
1206 |
|
6065 | 1207 |
WifiRemoteStationState * |
1208 |
WifiRemoteStationManager::LookupState (Mac48Address address) const |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
1209 |
{ |
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
1210 |
NS_LOG_FUNCTION (this << address); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1211 |
for (StationStates::const_iterator i = m_states.begin (); i != m_states.end (); i++) |
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
1212 |
{ |
6065 | 1213 |
if ((*i)->m_address == address) |
1214 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
1215 |
NS_LOG_DEBUG ("WifiRemoteStationManager::LookupState returning existing state"); |
6065 | 1216 |
return (*i); |
1217 |
} |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
1218 |
} |
6065 | 1219 |
WifiRemoteStationState *state = new WifiRemoteStationState (); |
1220 |
state->m_state = WifiRemoteStationState::BRAND_NEW; |
|
1221 |
state->m_address = address; |
|
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1222 |
state->m_operationalRateSet.push_back (GetDefaultMode ()); |
10139 | 1223 |
state->m_operationalMcsSet.push_back(GetDefaultMcs()); |
1224 |
state->m_shortGuardInterval=m_wifiPhy->GetGuardInterval(); |
|
1225 |
state->m_greenfield=m_wifiPhy->GetGreenfield(); |
|
1226 |
state->m_rx=1; |
|
1227 |
state->m_tx=1; |
|
11100
86e53d8a4cfe
bug 2026: 802.11n Ness parameter badly set for data frames
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11085
diff
changeset
|
1228 |
state->m_ness=0; |
10139 | 1229 |
state->m_stbc=false; |
6067
ccbdc2b19ea5
add newly-created state to state list.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6065
diff
changeset
|
1230 |
const_cast<WifiRemoteStationManager *> (this)->m_states.push_back (state); |
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
1231 |
NS_LOG_DEBUG ("WifiRemoteStationManager::LookupState returning new state"); |
6065 | 1232 |
return state; |
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
1233 |
} |
6065 | 1234 |
WifiRemoteStation * |
1235 |
WifiRemoteStationManager::Lookup (Mac48Address address, const WifiMacHeader *header) const |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
1236 |
{ |
6065 | 1237 |
uint8_t tid; |
1238 |
if (header->IsQosData ()) |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
1239 |
{ |
6065 | 1240 |
tid = header->GetQosTid (); |
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
1241 |
} |
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
1242 |
else |
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
1243 |
{ |
6065 | 1244 |
tid = 0; |
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
1245 |
} |
6065 | 1246 |
return Lookup (address, tid); |
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
1247 |
} |
6065 | 1248 |
WifiRemoteStation * |
1249 |
WifiRemoteStationManager::Lookup (Mac48Address address, uint8_t tid) const |
|
3745
73e7bb607014
bug 372: fragmentation is broken
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3212
diff
changeset
|
1250 |
{ |
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
1251 |
NS_LOG_FUNCTION (this << address << (uint16_t) tid); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1252 |
for (Stations::const_iterator i = m_stations.begin (); i != m_stations.end (); i++) |
6065 | 1253 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1254 |
if ((*i)->m_tid == tid |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1255 |
&& (*i)->m_state->m_address == address) |
6065 | 1256 |
{ |
1257 |
return (*i); |
|
1258 |
} |
|
1259 |
} |
|
1260 |
WifiRemoteStationState *state = LookupState (address); |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1261 |
|
6065 | 1262 |
WifiRemoteStation *station = DoCreateStation (); |
1263 |
station->m_state = state; |
|
6087
2c4e9171497e
Simple bug of WifiRemoteStationManager: station's tid is not initialized.
Kirill Andreev <andreev@iitp.ru>
parents:
6071
diff
changeset
|
1264 |
station->m_tid = tid; |
6065 | 1265 |
station->m_ssrc = 0; |
1266 |
station->m_slrc = 0; |
|
1267 |
// XXX |
|
1268 |
const_cast<WifiRemoteStationManager *> (this)->m_stations.push_back (station); |
|
1269 |
return station; |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1270 |
|
3745
73e7bb607014
bug 372: fragmentation is broken
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3212
diff
changeset
|
1271 |
} |
10139 | 1272 |
//Used by all stations to record HT capabilities of remote stations |
1273 |
void |
|
1274 |
WifiRemoteStationManager::AddStationHtCapabilities (Mac48Address from, HtCapabilities htcapabilities) |
|
1275 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
1276 |
NS_LOG_FUNCTION (this << from << htcapabilities); |
10139 | 1277 |
WifiRemoteStationState *state; |
1278 |
state=LookupState (from); |
|
1279 |
state->m_shortGuardInterval=htcapabilities.GetShortGuardInterval20(); |
|
1280 |
state->m_greenfield=htcapabilities.GetGreenfield(); |
|
1281 |
||
1282 |
} |
|
1283 |
//Used by mac low to choose format used GF, MF or Non HT |
|
1284 |
bool |
|
1285 |
WifiRemoteStationManager::GetGreenfieldSupported (Mac48Address address) const |
|
1286 |
{ |
|
1287 |
return LookupState(address)->m_greenfield; |
|
1288 |
} |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1289 |
WifiMode |
6065 | 1290 |
WifiRemoteStationManager::GetDefaultMode (void) const |
1291 |
{ |
|
1292 |
return m_defaultTxMode; |
|
1293 |
} |
|
10139 | 1294 |
uint8_t |
1295 |
WifiRemoteStationManager::GetDefaultMcs (void) const |
|
1296 |
{ |
|
1297 |
return m_defaultTxMcs; |
|
1298 |
} |
|
6065 | 1299 |
void |
1300 |
WifiRemoteStationManager::Reset (void) |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
1301 |
{ |
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
1302 |
NS_LOG_FUNCTION (this); |
6065 | 1303 |
for (Stations::const_iterator i = m_stations.begin (); i != m_stations.end (); i++) |
1304 |
{ |
|
1305 |
delete (*i); |
|
1306 |
} |
|
1307 |
m_stations.clear (); |
|
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1308 |
m_bssBasicRateSet.clear (); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1309 |
m_bssBasicRateSet.push_back (m_defaultTxMode); |
10139 | 1310 |
m_bssBasicMcsSet.clear(); |
1311 |
m_bssBasicMcsSet.push_back (m_defaultTxMcs); |
|
6065 | 1312 |
NS_ASSERT (m_defaultTxMode.IsMandatory ()); |
1313 |
} |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1314 |
void |
6065 | 1315 |
WifiRemoteStationManager::AddBasicMode (WifiMode mode) |
1316 |
{ |
|
11064
a0562c615abc
add logging to WifiRemoteStationManager
Tom Henderson <tomh@tomh.org>
parents:
11059
diff
changeset
|
1317 |
NS_LOG_FUNCTION (this << mode); |
6065 | 1318 |
for (uint32_t i = 0; i < GetNBasicModes (); i++) |
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
1319 |
{ |
6065 | 1320 |
if (GetBasicMode (i) == mode) |
1321 |
{ |
|
1322 |
return; |
|
1323 |
} |
|
1324 |
} |
|
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1325 |
m_bssBasicRateSet.push_back (mode); |
6065 | 1326 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1327 |
uint32_t |
6065 | 1328 |
WifiRemoteStationManager::GetNBasicModes (void) const |
1329 |
{ |
|
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1330 |
return m_bssBasicRateSet.size (); |
6065 | 1331 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1332 |
WifiMode |
6065 | 1333 |
WifiRemoteStationManager::GetBasicMode (uint32_t i) const |
1334 |
{ |
|
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1335 |
NS_ASSERT (i < m_bssBasicRateSet.size ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1336 |
return m_bssBasicRateSet[i]; |
6065 | 1337 |
} |
10139 | 1338 |
|
1339 |
void |
|
1340 |
WifiRemoteStationManager::AddBasicMcs (uint8_t mcs) |
|
1341 |
{ |
|
1342 |
for (uint32_t i = 0; i < GetNBasicMcs (); i++) |
|
1343 |
{ |
|
1344 |
if (GetBasicMcs (i) == mcs) |
|
1345 |
{ |
|
1346 |
return; |
|
1347 |
} |
|
1348 |
} |
|
1349 |
m_bssBasicMcsSet.push_back (mcs); |
|
1350 |
} |
|
1351 |
||
1352 |
uint32_t |
|
1353 |
WifiRemoteStationManager::GetNBasicMcs (void) const |
|
1354 |
{ |
|
1355 |
return m_bssBasicMcsSet.size (); |
|
1356 |
} |
|
1357 |
uint8_t |
|
1358 |
WifiRemoteStationManager::GetBasicMcs (uint32_t i) const |
|
1359 |
{ |
|
1360 |
NS_ASSERT (i < m_bssBasicMcsSet.size ()); |
|
1361 |
return m_bssBasicMcsSet[i]; |
|
1362 |
} |
|
1363 |
||
6065 | 1364 |
WifiMode |
1365 |
WifiRemoteStationManager::GetNonUnicastMode (void) const |
|
1366 |
{ |
|
1367 |
if (m_nonUnicastMode == WifiMode ()) |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
1368 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1369 |
return GetBasicMode (0); |
6065 | 1370 |
} |
1371 |
else |
|
1372 |
{ |
|
1373 |
return m_nonUnicastMode; |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
1374 |
} |
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2280
diff
changeset
|
1375 |
} |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
1376 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1377 |
bool |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1378 |
WifiRemoteStationManager::DoNeedRts (WifiRemoteStation *station, |
6065 | 1379 |
Ptr<const Packet> packet, bool normally) |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
1380 |
{ |
6065 | 1381 |
return normally; |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
1382 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1383 |
bool |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1384 |
WifiRemoteStationManager::DoNeedRtsRetransmission (WifiRemoteStation *station, |
6065 | 1385 |
Ptr<const Packet> packet, bool normally) |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
1386 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1387 |
return normally; |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
1388 |
} |
6065 | 1389 |
bool |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1390 |
WifiRemoteStationManager::DoNeedDataRetransmission (WifiRemoteStation *station, |
6065 | 1391 |
Ptr<const Packet> packet, bool normally) |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
1392 |
{ |
6065 | 1393 |
return normally; |
1394 |
} |
|
1395 |
bool |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1396 |
WifiRemoteStationManager::DoNeedFragmentation (WifiRemoteStation *station, |
6065 | 1397 |
Ptr<const Packet> packet, bool normally) |
1398 |
{ |
|
1399 |
return normally; |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
1400 |
} |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
1401 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1402 |
WifiMode |
6065 | 1403 |
WifiRemoteStationManager::GetSupported (const WifiRemoteStation *station, uint32_t i) const |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
1404 |
{ |
6065 | 1405 |
NS_ASSERT (i < GetNSupported (station)); |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1406 |
return station->m_state->m_operationalRateSet[i]; |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
1407 |
} |
10139 | 1408 |
uint8_t |
1409 |
WifiRemoteStationManager::GetMcsSupported (const WifiRemoteStation *station, uint32_t i) const |
|
1410 |
{ |
|
1411 |
NS_ASSERT (i < GetNMcsSupported (station)); |
|
1412 |
return station->m_state->m_operationalMcsSet[i]; |
|
1413 |
} |
|
1414 |
bool |
|
1415 |
WifiRemoteStationManager::GetShortGuardInterval (const WifiRemoteStation *station) const |
|
1416 |
{ |
|
1417 |
return station->m_state->m_shortGuardInterval; |
|
1418 |
} |
|
1419 |
bool |
|
1420 |
WifiRemoteStationManager::GetGreenfield (const WifiRemoteStation *station) const |
|
1421 |
{ |
|
1422 |
return station->m_state->m_greenfield; |
|
1423 |
} |
|
1424 |
bool |
|
1425 |
WifiRemoteStationManager::GetStbc (const WifiRemoteStation *station) const |
|
1426 |
{ |
|
1427 |
return station->m_state->m_stbc; |
|
1428 |
} |
|
1429 |
uint32_t |
|
1430 |
WifiRemoteStationManager::GetNumberOfReceiveAntennas (const WifiRemoteStation *station) const |
|
1431 |
{ |
|
1432 |
return station->m_state->m_rx; |
|
1433 |
} |
|
1434 |
uint32_t |
|
1435 |
WifiRemoteStationManager::GetNumberOfTransmitAntennas (const WifiRemoteStation *station) const |
|
1436 |
{ |
|
1437 |
return station->m_state->m_tx; |
|
1438 |
} |
|
1439 |
uint32_t |
|
11100
86e53d8a4cfe
bug 2026: 802.11n Ness parameter badly set for data frames
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11085
diff
changeset
|
1440 |
WifiRemoteStationManager::GetNess (const WifiRemoteStation *station) const |
86e53d8a4cfe
bug 2026: 802.11n Ness parameter badly set for data frames
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11085
diff
changeset
|
1441 |
{ |
86e53d8a4cfe
bug 2026: 802.11n Ness parameter badly set for data frames
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11085
diff
changeset
|
1442 |
return station->m_state->m_ness; |
86e53d8a4cfe
bug 2026: 802.11n Ness parameter badly set for data frames
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11085
diff
changeset
|
1443 |
} |
86e53d8a4cfe
bug 2026: 802.11n Ness parameter badly set for data frames
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11085
diff
changeset
|
1444 |
uint32_t |
10139 | 1445 |
WifiRemoteStationManager::GetShortRetryCount (const WifiRemoteStation *station) const |
1446 |
{ |
|
1447 |
return station->m_ssrc; |
|
1448 |
} |
|
11059
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
1449 |
|
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
1450 |
Ptr<WifiPhy> |
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
1451 |
WifiRemoteStationManager::GetPhy (void) const |
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
1452 |
{ |
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
1453 |
return m_wifiPhy; |
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
1454 |
} |
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
1455 |
Ptr<WifiMac> |
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
1456 |
WifiRemoteStationManager::GetMac (void) const |
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
1457 |
{ |
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
1458 |
return m_wifiMac; |
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
1459 |
} |
2fe905238013
bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and MatÃas Richart)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10968
diff
changeset
|
1460 |
|
10139 | 1461 |
uint32_t |
1462 |
WifiRemoteStationManager::GetLongRetryCount (const WifiRemoteStation *station) const |
|
1463 |
{ |
|
1464 |
return station->m_slrc; |
|
1465 |
} |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1466 |
uint32_t |
6065 | 1467 |
WifiRemoteStationManager::GetNSupported (const WifiRemoteStation *station) const |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
1468 |
{ |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
1469 |
return station->m_state->m_operationalRateSet.size (); |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
1470 |
} |
10139 | 1471 |
uint32_t |
1472 |
WifiRemoteStationManager::GetNMcsSupported (const WifiRemoteStation *station) const |
|
1473 |
{ |
|
1474 |
return station->m_state->m_operationalMcsSet.size (); |
|
1475 |
} |
|
1476 |
void |
|
1477 |
WifiRemoteStationManager::SetDefaultTxPowerLevel (uint8_t txPower) |
|
1478 |
{ |
|
1479 |
m_defaultTxPowerLevel = txPower; |
|
1480 |
} |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
1481 |
|
10139 | 1482 |
//support 11n |
1483 |
uint32_t |
|
1484 |
WifiRemoteStationManager::GetNumberOfTransmitAntennas (void) |
|
1485 |
{ |
|
1486 |
return m_wifiPhy->GetNumberOfTransmitAntennas(); |
|
1487 |
} |
|
6069
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1488 |
//WifiRemoteStationInfo constructor |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1489 |
WifiRemoteStationInfo::WifiRemoteStationInfo () |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1490 |
: m_memoryTime (Seconds (1.0)), |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1491 |
m_lastUpdate (Seconds (0.0)), |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1492 |
m_failAvg (0.0) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1493 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1494 |
} |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
1495 |
|
6069
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1496 |
double |
6070 | 1497 |
WifiRemoteStationInfo::CalculateAveragingCoefficient () |
6069
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1498 |
{ |
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
7704
diff
changeset
|
1499 |
double retval = std::exp ((double)(m_lastUpdate.GetMicroSeconds () - Simulator::Now ().GetMicroSeconds ()) |
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
7704
diff
changeset
|
1500 |
/ (double)m_memoryTime.GetMicroSeconds ()); |
6069
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1501 |
m_lastUpdate = Simulator::Now (); |
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1502 |
return retval; |
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1503 |
} |
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1504 |
|
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1505 |
void |
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1506 |
WifiRemoteStationInfo::NotifyTxSuccess (uint32_t retryCounter) |
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1507 |
{ |
6071
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
1508 |
double coefficient = CalculateAveragingCoefficient (); |
6069
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1509 |
m_failAvg = (double)retryCounter / (1 + (double) retryCounter) * (1.0 - coefficient) + coefficient * m_failAvg; |
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1510 |
} |
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1511 |
|
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1512 |
void |
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1513 |
WifiRemoteStationInfo::NotifyTxFailed () |
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1514 |
{ |
6071
6a25c600c450
tweak slightly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6070
diff
changeset
|
1515 |
double coefficient = CalculateAveragingCoefficient (); |
6069
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1516 |
m_failAvg = (1.0 - coefficient) + coefficient * m_failAvg; |
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1517 |
} |
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1518 |
|
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1519 |
double |
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1520 |
WifiRemoteStationInfo::GetFrameErrorRate () const |
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1521 |
{ |
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1522 |
return m_failAvg; |
c21754b56036
change airtime metric to work with new wifi remote station manager
Kirill Andreev <andreev@iitp.ru>
parents:
6067
diff
changeset
|
1523 |
} |
11066
d78d77e4b920
WifiRemoteStation needs virtual destructor for subclassing
Tom Henderson <tomh@tomh.org>
parents:
11064
diff
changeset
|
1524 |
|
d78d77e4b920
WifiRemoteStation needs virtual destructor for subclassing
Tom Henderson <tomh@tomh.org>
parents:
11064
diff
changeset
|
1525 |
WifiRemoteStation::~WifiRemoteStation () |
d78d77e4b920
WifiRemoteStation needs virtual destructor for subclassing
Tom Henderson <tomh@tomh.org>
parents:
11064
diff
changeset
|
1526 |
{ |
d78d77e4b920
WifiRemoteStation needs virtual destructor for subclassing
Tom Henderson <tomh@tomh.org>
parents:
11064
diff
changeset
|
1527 |
NS_LOG_FUNCTION (this); |
d78d77e4b920
WifiRemoteStation needs virtual destructor for subclassing
Tom Henderson <tomh@tomh.org>
parents:
11064
diff
changeset
|
1528 |
} |
d78d77e4b920
WifiRemoteStation needs virtual destructor for subclassing
Tom Henderson <tomh@tomh.org>
parents:
11064
diff
changeset
|
1529 |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
1530 |
} // namespace ns3 |