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