author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Thu, 25 Feb 2010 14:17:21 +0100 | |
changeset 6068 | a2127017ecb4 |
parent 6065 | 0f012e7d9128 |
parent 5965 | 4e64e751be07 |
child 6080 | 41ee42654550 |
permissions | -rw-r--r-- |
4408 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2006, 2009 INRIA |
|
4 |
* Copyright (c) 2009 MIRKO BANCHI |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or modify |
|
7 |
* it under the terms of the GNU General Public License version 2 as |
|
8 |
* published by the Free Software Foundation; |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
18 |
* |
|
19 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
|
20 |
* Author: Mirko Banchi <mk.banchi@gmail.com> |
|
21 |
*/ |
|
22 |
#include "ns3/pointer.h" |
|
23 |
#include "ns3/log.h" |
|
24 |
#include "ns3/string.h" |
|
25 |
||
26 |
#include "qos-tag.h" |
|
27 |
#include "edca-txop-n.h" |
|
28 |
#include "qadhoc-wifi-mac.h" |
|
29 |
#include "mac-low.h" |
|
30 |
#include "dcf-manager.h" |
|
31 |
#include "mac-rx-middle.h" |
|
32 |
#include "mac-tx-middle.h" |
|
33 |
#include "wifi-mac-header.h" |
|
34 |
#include "msdu-aggregator.h" |
|
35 |
#include "amsdu-subframe-header.h" |
|
36 |
#include "mgt-headers.h" |
|
37 |
||
38 |
NS_LOG_COMPONENT_DEFINE ("QadhocWifiMac"); |
|
39 |
||
40 |
namespace ns3 { |
|
41 |
||
42 |
NS_OBJECT_ENSURE_REGISTERED (QadhocWifiMac); |
|
43 |
||
44 |
TypeId |
|
45 |
QadhocWifiMac::GetTypeId (void) |
|
46 |
{ |
|
47 |
static TypeId tid = TypeId ("ns3::QadhocWifiMac") |
|
48 |
.SetParent<WifiMac> () |
|
49 |
.AddConstructor<QadhocWifiMac> () |
|
50 |
.AddAttribute ("VO_EdcaTxopN", |
|
51 |
"Queue that manages packets belonging to AC_VO access class", |
|
52 |
PointerValue (), |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
53 |
MakePointerAccessor(&QadhocWifiMac::GetVOQueue), |
4408 | 54 |
MakePointerChecker<EdcaTxopN> ()) |
55 |
.AddAttribute ("VI_EdcaTxopN", |
|
56 |
"Queue that manages packets belonging to AC_VI access class", |
|
57 |
PointerValue (), |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
58 |
MakePointerAccessor(&QadhocWifiMac::GetVIQueue), |
4408 | 59 |
MakePointerChecker<EdcaTxopN> ()) |
60 |
.AddAttribute ("BE_EdcaTxopN", |
|
61 |
"Queue that manages packets belonging to AC_BE access class", |
|
62 |
PointerValue (), |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
63 |
MakePointerAccessor(&QadhocWifiMac::GetBEQueue), |
4408 | 64 |
MakePointerChecker<EdcaTxopN> ()) |
65 |
.AddAttribute ("BK_EdcaTxopN", |
|
66 |
"Queue that manages packets belonging to AC_BK access class", |
|
67 |
PointerValue (), |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
68 |
MakePointerAccessor(&QadhocWifiMac::GetBKQueue), |
4408 | 69 |
MakePointerChecker<EdcaTxopN> ()) |
70 |
; |
|
71 |
return tid; |
|
72 |
} |
|
73 |
||
74 |
QadhocWifiMac::QadhocWifiMac () |
|
75 |
{ |
|
76 |
NS_LOG_FUNCTION (this); |
|
77 |
m_rxMiddle = new MacRxMiddle (); |
|
78 |
m_rxMiddle->SetForwardCallback (MakeCallback (&QadhocWifiMac::Receive, this)); |
|
79 |
||
80 |
m_txMiddle = new MacTxMiddle (); |
|
81 |
||
82 |
m_low = CreateObject<MacLow> (); |
|
83 |
m_low->SetRxCallback (MakeCallback (&MacRxMiddle::Receive, m_rxMiddle)); |
|
84 |
||
85 |
m_dcfManager = new DcfManager (); |
|
86 |
m_dcfManager->SetupLowListener (m_low); |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
87 |
|
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
88 |
SetQueue (AC_VO); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
89 |
SetQueue (AC_VI); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
90 |
SetQueue (AC_BE); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
91 |
SetQueue (AC_BK); |
4408 | 92 |
} |
93 |
||
94 |
QadhocWifiMac::~QadhocWifiMac () |
|
95 |
{ |
|
96 |
NS_LOG_FUNCTION (this); |
|
97 |
} |
|
98 |
||
99 |
void |
|
100 |
QadhocWifiMac::DoDispose (void) |
|
101 |
{ |
|
102 |
NS_LOG_FUNCTION (this); |
|
103 |
delete m_rxMiddle; |
|
104 |
m_rxMiddle = 0; |
|
105 |
delete m_txMiddle; |
|
106 |
m_txMiddle = 0; |
|
107 |
delete m_dcfManager; |
|
108 |
m_dcfManager = 0; |
|
109 |
m_low = 0; |
|
110 |
m_phy = 0; |
|
5906
509b5089a081
Revert bug 706 fix because it breaks the regression testing
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
5903
diff
changeset
|
111 |
m_voEdca = 0; |
509b5089a081
Revert bug 706 fix because it breaks the regression testing
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
5903
diff
changeset
|
112 |
m_viEdca = 0; |
509b5089a081
Revert bug 706 fix because it breaks the regression testing
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
5903
diff
changeset
|
113 |
m_beEdca = 0; |
509b5089a081
Revert bug 706 fix because it breaks the regression testing
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
5903
diff
changeset
|
114 |
m_bkEdca = 0; |
4408 | 115 |
m_stationManager = 0; |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
116 |
for (Queues::iterator i = m_queues.begin (); i != m_queues.end (); ++i) |
4408 | 117 |
{ |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
118 |
(*i).second = 0; |
4408 | 119 |
} |
120 |
WifiMac::DoDispose (); |
|
121 |
} |
|
122 |
||
123 |
void |
|
124 |
QadhocWifiMac::SetSlot (Time slotTime) |
|
125 |
{ |
|
126 |
m_dcfManager->SetSlot (slotTime); |
|
127 |
m_low->SetSlotTime (slotTime); |
|
128 |
} |
|
129 |
||
130 |
void |
|
131 |
QadhocWifiMac::SetSifs (Time sifs) |
|
132 |
{ |
|
133 |
m_dcfManager->SetSifs (sifs); |
|
134 |
m_low->SetSifs (sifs); |
|
135 |
} |
|
136 |
||
137 |
void |
|
138 |
QadhocWifiMac::SetEifsNoDifs (Time eifsNoDifs) |
|
139 |
{ |
|
140 |
m_dcfManager->SetEifsNoDifs (eifsNoDifs); |
|
141 |
m_eifsNoDifs = eifsNoDifs; |
|
142 |
} |
|
143 |
||
144 |
void |
|
145 |
QadhocWifiMac::SetAckTimeout (Time ackTimeout) |
|
146 |
{ |
|
147 |
m_low->SetAckTimeout (ackTimeout); |
|
148 |
} |
|
149 |
||
5958 | 150 |
void |
151 |
QadhocWifiMac::SetBasicBlockAckTimeout (Time blockAckTimeout) |
|
152 |
{ |
|
153 |
m_low->SetBasicBlockAckTimeout (blockAckTimeout); |
|
154 |
} |
|
155 |
||
156 |
void |
|
157 |
QadhocWifiMac::SetCompressedBlockAckTimeout (Time blockAckTimeout) |
|
158 |
{ |
|
159 |
m_low->SetCompressedBlockAckTimeout (blockAckTimeout); |
|
160 |
} |
|
161 |
||
4408 | 162 |
void |
163 |
QadhocWifiMac::SetCtsTimeout (Time ctsTimeout) |
|
164 |
{ |
|
165 |
m_low->SetCtsTimeout (ctsTimeout); |
|
166 |
} |
|
167 |
||
168 |
void |
|
169 |
QadhocWifiMac::SetPifs (Time pifs) |
|
170 |
{ |
|
171 |
m_low->SetPifs (pifs); |
|
172 |
} |
|
173 |
||
174 |
Time |
|
175 |
QadhocWifiMac::GetSlot (void) const |
|
176 |
{ |
|
177 |
return m_low->GetSlotTime (); |
|
178 |
} |
|
179 |
||
180 |
Time |
|
181 |
QadhocWifiMac::GetSifs (void) const |
|
182 |
{ |
|
183 |
return m_low->GetSifs (); |
|
184 |
} |
|
185 |
||
186 |
Time |
|
187 |
QadhocWifiMac::GetEifsNoDifs (void) const |
|
188 |
{ |
|
189 |
return m_eifsNoDifs; |
|
190 |
} |
|
191 |
||
192 |
Time |
|
193 |
QadhocWifiMac::GetAckTimeout (void) const |
|
194 |
{ |
|
195 |
return m_low->GetAckTimeout (); |
|
196 |
} |
|
197 |
||
5958 | 198 |
Time |
199 |
QadhocWifiMac::GetBasicBlockAckTimeout (void) const |
|
200 |
{ |
|
201 |
return m_low->GetBasicBlockAckTimeout (); |
|
202 |
} |
|
203 |
||
204 |
Time |
|
205 |
QadhocWifiMac::GetCompressedBlockAckTimeout (void) const |
|
206 |
{ |
|
207 |
return m_low->GetCompressedBlockAckTimeout (); |
|
208 |
} |
|
209 |
||
4408 | 210 |
Time |
211 |
QadhocWifiMac::GetCtsTimeout (void) const |
|
212 |
{ |
|
213 |
return m_low->GetCtsTimeout (); |
|
214 |
} |
|
215 |
||
216 |
Time |
|
217 |
QadhocWifiMac::GetPifs (void) const |
|
218 |
{ |
|
219 |
return m_low->GetPifs (); |
|
220 |
} |
|
221 |
||
222 |
void |
|
223 |
QadhocWifiMac::SetWifiPhy (Ptr<WifiPhy> phy) |
|
224 |
{ |
|
225 |
m_phy = phy; |
|
226 |
m_dcfManager->SetupPhyListener (phy); |
|
227 |
m_low->SetPhy (phy); |
|
228 |
} |
|
229 |
||
230 |
void |
|
231 |
QadhocWifiMac::SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> stationManager) |
|
232 |
{ |
|
233 |
NS_LOG_FUNCTION (this << stationManager); |
|
234 |
m_stationManager = stationManager; |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
235 |
for (Queues::iterator i = m_queues.begin (); i != m_queues.end (); ++i) |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
236 |
{ |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
237 |
(*i).second->SetWifiRemoteStationManager (stationManager); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
238 |
} |
4408 | 239 |
m_low->SetWifiRemoteStationManager (stationManager); |
240 |
} |
|
241 |
||
242 |
void |
|
243 |
QadhocWifiMac::Enqueue (Ptr<const Packet> packet, Mac48Address to, Mac48Address from) |
|
244 |
{ |
|
245 |
NS_FATAL_ERROR ("Adhoc does not support a from != m_low->GetAddress ()"); |
|
246 |
} |
|
247 |
||
248 |
void |
|
249 |
QadhocWifiMac::Enqueue (Ptr<const Packet> packet, Mac48Address to) |
|
250 |
{ |
|
251 |
/* For now Qos adhoc stations sends only Qos frame. In the future they |
|
252 |
* should be able to send frames also to Non-Qos Stas. |
|
253 |
*/ |
|
254 |
NS_LOG_FUNCTION (packet->GetSize () << to); |
|
255 |
WifiMacHeader hdr; |
|
256 |
hdr.SetType (WIFI_MAC_QOSDATA); |
|
257 |
hdr.SetQosAckPolicy (WifiMacHeader::NORMAL_ACK); |
|
258 |
hdr.SetQosNoEosp (); |
|
259 |
hdr.SetQosNoAmsdu (); |
|
260 |
/* Transmission of multiple frames in the same |
|
261 |
Txop is not supported for now */ |
|
262 |
hdr.SetQosTxopLimit (0); |
|
263 |
||
264 |
hdr.SetAddr1 (to); |
|
265 |
hdr.SetAddr2 (m_low->GetAddress ()); |
|
266 |
hdr.SetAddr3 (GetBssid ()); |
|
267 |
hdr.SetDsNotFrom (); |
|
268 |
hdr.SetDsNotTo (); |
|
269 |
||
6065 | 270 |
if (m_stationManager->IsBrandNew (to)) |
4408 | 271 |
{ |
272 |
// in adhoc mode, we assume that every destination |
|
273 |
// supports all the rates we support. |
|
274 |
for (uint32_t i = 0; i < m_phy->GetNModes (); i++) |
|
275 |
{ |
|
6065 | 276 |
m_stationManager->AddSupportedMode (to, m_phy->GetMode (i)); |
4408 | 277 |
} |
6065 | 278 |
m_stationManager->RecordDisassociated (to); |
4408 | 279 |
} |
280 |
||
281 |
uint8_t tid = QosUtilsGetTidForPacket (packet); |
|
282 |
if (tid < 8) |
|
283 |
{ |
|
284 |
hdr.SetQosTid (tid); |
|
285 |
AccessClass ac = QosUtilsMapTidToAc (tid); |
|
286 |
m_queues[ac]->Queue (packet, hdr); |
|
287 |
} |
|
288 |
else |
|
289 |
{ |
|
290 |
//packet is considerated belonging to BestEffort AC |
|
291 |
hdr.SetQosTid (0); |
|
292 |
m_queues[AC_BE]->Queue (packet, hdr); |
|
293 |
} |
|
294 |
} |
|
295 |
||
296 |
bool |
|
297 |
QadhocWifiMac::SupportsSendFrom (void) const |
|
298 |
{ |
|
299 |
return false; |
|
300 |
} |
|
301 |
||
302 |
void |
|
303 |
QadhocWifiMac::SetForwardUpCallback (Callback<void,Ptr<Packet>, Mac48Address, Mac48Address> upCallback) |
|
304 |
{ |
|
305 |
m_forwardUp = upCallback; |
|
306 |
} |
|
307 |
||
308 |
void |
|
309 |
QadhocWifiMac::SetLinkUpCallback (Callback<void> linkUp) |
|
310 |
{ |
|
311 |
// an Adhoc network is always UP. |
|
312 |
linkUp (); |
|
313 |
} |
|
314 |
||
315 |
void |
|
316 |
QadhocWifiMac::SetLinkDownCallback (Callback<void> linkDown) |
|
317 |
{} |
|
318 |
||
319 |
Mac48Address |
|
320 |
QadhocWifiMac::GetAddress (void) const |
|
321 |
{ |
|
322 |
return m_low->GetAddress (); |
|
323 |
} |
|
324 |
||
325 |
Ssid |
|
326 |
QadhocWifiMac::GetSsid (void) const |
|
327 |
{ |
|
328 |
return m_ssid; |
|
329 |
} |
|
330 |
||
331 |
void |
|
332 |
QadhocWifiMac::SetAddress (Mac48Address address) |
|
333 |
{ |
|
334 |
m_low->SetAddress (address); |
|
335 |
m_low->SetBssid (address); |
|
336 |
} |
|
337 |
||
338 |
void |
|
339 |
QadhocWifiMac::SetSsid (Ssid ssid) |
|
340 |
{ |
|
341 |
NS_LOG_FUNCTION (this << ssid); |
|
342 |
// XXX: here, we should start a special adhoc network |
|
343 |
m_ssid = ssid; |
|
344 |
} |
|
345 |
||
346 |
Mac48Address |
|
347 |
QadhocWifiMac::GetBssid (void) const |
|
348 |
{ |
|
349 |
return m_low->GetBssid (); |
|
350 |
} |
|
351 |
||
352 |
void |
|
353 |
QadhocWifiMac::ForwardUp (Ptr<Packet> packet, Mac48Address from, Mac48Address to) |
|
354 |
{ |
|
355 |
NS_LOG_FUNCTION (this << packet << from); |
|
356 |
m_forwardUp (packet, from, to); |
|
357 |
} |
|
358 |
||
359 |
void |
|
5819
514ec98954ab
Wifi code cleanup: Correcting various const keyword ordering and removing superfluous (boolean)?true:false.
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
360 |
QadhocWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr) |
4408 | 361 |
{ |
362 |
NS_LOG_FUNCTION (this << packet << hdr); |
|
363 |
NS_ASSERT (!hdr->IsCtl ()); |
|
364 |
Mac48Address from = hdr->GetAddr2 (); |
|
365 |
Mac48Address to = hdr->GetAddr1 (); |
|
366 |
if (hdr->IsData ()) |
|
367 |
{ |
|
368 |
if (hdr->IsQosData () && hdr->IsQosAmsdu ()) |
|
369 |
{ |
|
370 |
NS_LOG_DEBUG ("Received A-MSDU from"<<from); |
|
371 |
DeaggregateAmsduAndForward (packet, hdr); |
|
372 |
} |
|
373 |
else |
|
374 |
{ |
|
375 |
ForwardUp (packet, from, to); |
|
376 |
} |
|
377 |
} |
|
378 |
else if (hdr->IsMgt ()) |
|
379 |
{ |
|
5953
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
380 |
if (hdr->IsAction ()) |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
381 |
{ |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
382 |
WifiActionHeader actionHdr; |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
383 |
packet->RemoveHeader (actionHdr); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
384 |
if (actionHdr.GetCategory () == WifiActionHeader::BLOCK_ACK && |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
385 |
actionHdr.GetAction().blockAck == WifiActionHeader::BLOCK_ACK_ADDBA_REQUEST) |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
386 |
{ |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
387 |
MgtAddBaRequestHeader reqHdr; |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
388 |
packet->RemoveHeader (reqHdr); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
389 |
SendAddBaResponse (&reqHdr, hdr->GetAddr2 ()); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
390 |
} |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
391 |
else if (actionHdr.GetCategory () == WifiActionHeader::BLOCK_ACK && |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
392 |
actionHdr.GetAction().blockAck == WifiActionHeader::BLOCK_ACK_ADDBA_REQUEST) |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
393 |
{ |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
394 |
MgtAddBaResponseHeader respHdr; |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
395 |
packet->RemoveHeader (respHdr); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
396 |
m_queues[QosUtilsMapTidToAc (respHdr.GetTid ())]->GotAddBaResponse (&respHdr, hdr->GetAddr2 ()); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
397 |
} |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
398 |
else if (actionHdr.GetCategory () == WifiActionHeader::BLOCK_ACK && |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
399 |
actionHdr.GetAction().blockAck == WifiActionHeader::BLOCK_ACK_DELBA) |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
400 |
{ |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
401 |
MgtDelBaHeader delBaHdr; |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
402 |
packet->RemoveHeader (delBaHdr); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
403 |
if (delBaHdr.IsByOriginator ()) |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
404 |
{ |
5964
8a59a619c30e
add support to block ack tear down in MacLow
Mirko Banchi <mk.banchi@gmail.com>
parents:
5963
diff
changeset
|
405 |
/* Delba frame was sent by originator, this means that an ingoing established |
8a59a619c30e
add support to block ack tear down in MacLow
Mirko Banchi <mk.banchi@gmail.com>
parents:
5963
diff
changeset
|
406 |
agreement exists in MacLow */ |
8a59a619c30e
add support to block ack tear down in MacLow
Mirko Banchi <mk.banchi@gmail.com>
parents:
5963
diff
changeset
|
407 |
m_low->DestroyBlockAckAgreement (hdr->GetAddr2 (), delBaHdr.GetTid ()); } |
5953
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
408 |
else |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
409 |
{ |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
410 |
/* We must notify correct queue tear down of agreement */ |
5965
4e64e751be07
add support to block ack tear down in EdcaTxopN
Mirko Banchi <mk.banchi@gmail.com>
parents:
5964
diff
changeset
|
411 |
AccessClass ac = QosUtilsMapTidToAc (delBaHdr.GetTid ()); |
4e64e751be07
add support to block ack tear down in EdcaTxopN
Mirko Banchi <mk.banchi@gmail.com>
parents:
5964
diff
changeset
|
412 |
m_queues[ac]->GotDelBaFrame (&delBaHdr, hdr->GetAddr2 ()); |
5953
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
413 |
} |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
414 |
} |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
415 |
} |
4408 | 416 |
} |
417 |
} |
|
418 |
||
419 |
void |
|
420 |
QadhocWifiMac::DeaggregateAmsduAndForward (Ptr<Packet> aggregatedPacket, |
|
5819
514ec98954ab
Wifi code cleanup: Correcting various const keyword ordering and removing superfluous (boolean)?true:false.
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
421 |
const WifiMacHeader *hdr) |
4408 | 422 |
{ |
423 |
DeaggregatedMsdus packets = MsduAggregator::Deaggregate (aggregatedPacket); |
|
424 |
for (DeaggregatedMsdusCI i = packets.begin (); i != packets.end (); ++i) |
|
425 |
{ |
|
426 |
ForwardUp ((*i).first, (*i).second.GetSourceAddr (), |
|
427 |
(*i).second.GetDestinationAddr ()); |
|
428 |
} |
|
429 |
} |
|
430 |
||
431 |
Ptr<EdcaTxopN> |
|
432 |
QadhocWifiMac::GetVOQueue (void) const |
|
433 |
{ |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
434 |
return m_queues.find (AC_VO)->second; |
4408 | 435 |
} |
436 |
||
437 |
Ptr<EdcaTxopN> |
|
438 |
QadhocWifiMac::GetVIQueue (void) const |
|
439 |
{ |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
440 |
return m_queues.find (AC_VI)->second; |
4408 | 441 |
} |
442 |
||
443 |
Ptr<EdcaTxopN> |
|
444 |
QadhocWifiMac::GetBEQueue (void) const |
|
445 |
{ |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
446 |
return m_queues.find (AC_BE)->second; |
4408 | 447 |
} |
448 |
||
449 |
Ptr<EdcaTxopN> |
|
450 |
QadhocWifiMac::GetBKQueue (void) const |
|
451 |
{ |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
452 |
return m_queues.find (AC_BK)->second; |
4408 | 453 |
} |
454 |
||
455 |
void |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
456 |
QadhocWifiMac::SetQueue (enum AccessClass ac) |
4408 | 457 |
{ |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
458 |
Ptr<EdcaTxopN> edca = CreateObject<EdcaTxopN> (); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
459 |
edca->SetLow (m_low); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
460 |
edca->SetManager (m_dcfManager); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
461 |
edca->SetTypeOfStation (ADHOC_STA); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
462 |
edca->SetTxMiddle (m_txMiddle); |
5964
8a59a619c30e
add support to block ack tear down in MacLow
Mirko Banchi <mk.banchi@gmail.com>
parents:
5963
diff
changeset
|
463 |
edca->SetAccessClass (ac); |
5963
5f82c5a7068e
add support to block ack in EdcaTxopN
Mirko Banchi <mk.banchi@gmail.com>
parents:
5958
diff
changeset
|
464 |
edca->CompleteConfig (); |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
465 |
m_queues.insert (std::make_pair(ac, edca)); |
4408 | 466 |
} |
467 |
||
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
468 |
void |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
469 |
QadhocWifiMac::FinishConfigureStandard (enum WifiPhyStandard standard) |
4408 | 470 |
{ |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
471 |
switch (standard) |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
472 |
{ |
5747
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
4720
diff
changeset
|
473 |
case WIFI_PHY_STANDARD_80211p_CCH: |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
4720
diff
changeset
|
474 |
ConfigureCCHDcf (m_queues[AC_BK], 15, 511, AC_BK); |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
4720
diff
changeset
|
475 |
ConfigureCCHDcf (m_queues[AC_BE], 15, 511, AC_BE); |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
4720
diff
changeset
|
476 |
ConfigureCCHDcf (m_queues[AC_VI], 15, 511, AC_VI); |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
4720
diff
changeset
|
477 |
ConfigureCCHDcf (m_queues[AC_VO], 15, 511, AC_VO); |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
4720
diff
changeset
|
478 |
break; |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
4720
diff
changeset
|
479 |
case WIFI_PHY_STANDARD_80211p_SCH: |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
4720
diff
changeset
|
480 |
ConfigureDcf (m_queues[AC_BK], 15, 511, AC_BK); |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
4720
diff
changeset
|
481 |
ConfigureDcf (m_queues[AC_BE], 15, 511, AC_BE); |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
4720
diff
changeset
|
482 |
ConfigureDcf (m_queues[AC_VI], 15, 511, AC_VI); |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
4720
diff
changeset
|
483 |
ConfigureDcf (m_queues[AC_VO], 15, 511, AC_VO); |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
4720
diff
changeset
|
484 |
break; |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
485 |
case WIFI_PHY_STANDARD_holland: |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
486 |
// fall through |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
487 |
case WIFI_PHY_STANDARD_80211a: |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
488 |
// fall through |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
489 |
case WIFI_PHY_STANDARD_80211_10Mhz: |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
490 |
// fall through |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
491 |
case WIFI_PHY_STANDARD_80211_5Mhz: |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
492 |
ConfigureDcf (m_queues[AC_BK], 15, 1023, AC_BK); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
493 |
ConfigureDcf (m_queues[AC_BE], 15, 1023, AC_BE); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
494 |
ConfigureDcf (m_queues[AC_VI], 15, 1023, AC_VI); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
495 |
ConfigureDcf (m_queues[AC_VO], 15, 1023, AC_VO); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
496 |
break; |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
497 |
case WIFI_PHY_STANDARD_80211b: |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
498 |
ConfigureDcf (m_queues[AC_BK], 31, 1023, AC_BK); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
499 |
ConfigureDcf (m_queues[AC_BE], 31, 1023, AC_BE); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
500 |
ConfigureDcf (m_queues[AC_VI], 31, 1023, AC_VI); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
501 |
ConfigureDcf (m_queues[AC_VO], 31, 1023, AC_VO); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
502 |
break; |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
503 |
default: |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
504 |
NS_ASSERT (false); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
505 |
break; |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
506 |
} |
4408 | 507 |
} |
508 |
||
5953
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
509 |
|
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
510 |
void |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
511 |
QadhocWifiMac::SendAddBaResponse (const MgtAddBaRequestHeader *reqHdr, Mac48Address originator) |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
512 |
{ |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
513 |
NS_LOG_FUNCTION (this); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
514 |
WifiMacHeader hdr; |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
515 |
hdr.SetAction (); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
516 |
hdr.SetAddr1 (originator); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
517 |
hdr.SetAddr2 (m_low->GetAddress ()); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
518 |
hdr.SetAddr3 (m_low->GetAddress ()); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
519 |
hdr.SetDsNotFrom (); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
520 |
hdr.SetDsNotTo (); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
521 |
|
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
522 |
MgtAddBaResponseHeader respHdr; |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
523 |
StatusCode code; |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
524 |
code.SetSuccess (); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
525 |
respHdr.SetStatusCode (code); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
526 |
//Here a control about queues type? |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
527 |
respHdr.SetAmsduSupport (reqHdr->IsAmsduSupported ()); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
528 |
|
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
529 |
if (reqHdr->IsImmediateBlockAck ()) |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
530 |
{ |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
531 |
respHdr.SetImmediateBlockAck (); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
532 |
} |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
533 |
else |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
534 |
{ |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
535 |
respHdr.SetDelayedBlockAck (); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
536 |
} |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
537 |
respHdr.SetTid (reqHdr->GetTid ()); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
538 |
/* For now there's not no control about limit of reception. |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
539 |
We assume that receiver has no limit on reception. |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
540 |
However we assume that a receiver sets a bufferSize in order to satisfy |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
541 |
next equation: |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
542 |
(bufferSize + 1) % 16 = 0 |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
543 |
So if a recipient is able to buffer a packet, it should be also able to buffer |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
544 |
all possible packet's fragments. |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
545 |
See section 7.3.1.14 in IEEE802.11e for more details. */ |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
546 |
respHdr.SetBufferSize (1023); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
547 |
respHdr.SetTimeout (reqHdr->GetTimeout ()); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
548 |
|
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
549 |
WifiActionHeader actionHdr; |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
550 |
WifiActionHeader::ActionValue action; |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
551 |
action.blockAck = WifiActionHeader::BLOCK_ACK_ADDBA_RESPONSE; |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
552 |
actionHdr.SetAction (WifiActionHeader::BLOCK_ACK, action); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
553 |
|
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
554 |
Ptr<Packet> packet = Create<Packet> (); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
555 |
packet->AddHeader (respHdr); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
556 |
packet->AddHeader (actionHdr); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
557 |
|
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
558 |
/* ns3::MacLow have to buffer all correctly received packet for this block ack session */ |
5956
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5953
diff
changeset
|
559 |
m_low->CreateBlockAckAgreement (&respHdr, originator, reqHdr->GetStartingSequence ()); |
5953
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
560 |
|
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
561 |
//Better a management queue? |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
562 |
m_queues[QosUtilsMapTidToAc (reqHdr->GetTid ())]->PushFront (packet, hdr); |
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5906
diff
changeset
|
563 |
} |
4408 | 564 |
} //namespace ns3 |