author | Kirill Andreev <andreev@iitp.ru> |
Mon, 11 Jan 2010 12:23:09 +0300 | |
changeset 5903 | 395e17028faf |
parent 5819 | 514ec98954ab |
child 5906 | 509b5089a081 |
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; |
|
111 |
m_stationManager = 0; |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
112 |
for (Queues::iterator i = m_queues.begin (); i != m_queues.end (); ++i) |
4408 | 113 |
{ |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
114 |
(*i).second = 0; |
4408 | 115 |
} |
116 |
WifiMac::DoDispose (); |
|
117 |
} |
|
118 |
||
119 |
void |
|
120 |
QadhocWifiMac::SetSlot (Time slotTime) |
|
121 |
{ |
|
122 |
m_dcfManager->SetSlot (slotTime); |
|
123 |
m_low->SetSlotTime (slotTime); |
|
124 |
} |
|
125 |
||
126 |
void |
|
127 |
QadhocWifiMac::SetSifs (Time sifs) |
|
128 |
{ |
|
129 |
m_dcfManager->SetSifs (sifs); |
|
130 |
m_low->SetSifs (sifs); |
|
131 |
} |
|
132 |
||
133 |
void |
|
134 |
QadhocWifiMac::SetEifsNoDifs (Time eifsNoDifs) |
|
135 |
{ |
|
136 |
m_dcfManager->SetEifsNoDifs (eifsNoDifs); |
|
137 |
m_eifsNoDifs = eifsNoDifs; |
|
138 |
} |
|
139 |
||
140 |
void |
|
141 |
QadhocWifiMac::SetAckTimeout (Time ackTimeout) |
|
142 |
{ |
|
143 |
m_low->SetAckTimeout (ackTimeout); |
|
144 |
} |
|
145 |
||
146 |
void |
|
147 |
QadhocWifiMac::SetCtsTimeout (Time ctsTimeout) |
|
148 |
{ |
|
149 |
m_low->SetCtsTimeout (ctsTimeout); |
|
150 |
} |
|
151 |
||
152 |
void |
|
153 |
QadhocWifiMac::SetPifs (Time pifs) |
|
154 |
{ |
|
155 |
m_low->SetPifs (pifs); |
|
156 |
} |
|
157 |
||
158 |
Time |
|
159 |
QadhocWifiMac::GetSlot (void) const |
|
160 |
{ |
|
161 |
return m_low->GetSlotTime (); |
|
162 |
} |
|
163 |
||
164 |
Time |
|
165 |
QadhocWifiMac::GetSifs (void) const |
|
166 |
{ |
|
167 |
return m_low->GetSifs (); |
|
168 |
} |
|
169 |
||
170 |
Time |
|
171 |
QadhocWifiMac::GetEifsNoDifs (void) const |
|
172 |
{ |
|
173 |
return m_eifsNoDifs; |
|
174 |
} |
|
175 |
||
176 |
Time |
|
177 |
QadhocWifiMac::GetAckTimeout (void) const |
|
178 |
{ |
|
179 |
return m_low->GetAckTimeout (); |
|
180 |
} |
|
181 |
||
182 |
Time |
|
183 |
QadhocWifiMac::GetCtsTimeout (void) const |
|
184 |
{ |
|
185 |
return m_low->GetCtsTimeout (); |
|
186 |
} |
|
187 |
||
188 |
Time |
|
189 |
QadhocWifiMac::GetPifs (void) const |
|
190 |
{ |
|
191 |
return m_low->GetPifs (); |
|
192 |
} |
|
193 |
||
194 |
void |
|
195 |
QadhocWifiMac::SetWifiPhy (Ptr<WifiPhy> phy) |
|
196 |
{ |
|
197 |
m_phy = phy; |
|
198 |
m_dcfManager->SetupPhyListener (phy); |
|
199 |
m_low->SetPhy (phy); |
|
200 |
} |
|
201 |
||
202 |
void |
|
203 |
QadhocWifiMac::SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> stationManager) |
|
204 |
{ |
|
205 |
NS_LOG_FUNCTION (this << stationManager); |
|
206 |
m_stationManager = stationManager; |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
207 |
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
|
208 |
{ |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
209 |
(*i).second->SetWifiRemoteStationManager (stationManager); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
210 |
} |
4408 | 211 |
m_low->SetWifiRemoteStationManager (stationManager); |
212 |
} |
|
213 |
||
214 |
void |
|
215 |
QadhocWifiMac::Enqueue (Ptr<const Packet> packet, Mac48Address to, Mac48Address from) |
|
216 |
{ |
|
217 |
NS_FATAL_ERROR ("Adhoc does not support a from != m_low->GetAddress ()"); |
|
218 |
} |
|
219 |
||
220 |
void |
|
221 |
QadhocWifiMac::Enqueue (Ptr<const Packet> packet, Mac48Address to) |
|
222 |
{ |
|
223 |
/* For now Qos adhoc stations sends only Qos frame. In the future they |
|
224 |
* should be able to send frames also to Non-Qos Stas. |
|
225 |
*/ |
|
226 |
NS_LOG_FUNCTION (packet->GetSize () << to); |
|
227 |
WifiMacHeader hdr; |
|
228 |
hdr.SetType (WIFI_MAC_QOSDATA); |
|
229 |
hdr.SetQosAckPolicy (WifiMacHeader::NORMAL_ACK); |
|
230 |
hdr.SetQosNoEosp (); |
|
231 |
hdr.SetQosNoAmsdu (); |
|
232 |
/* Transmission of multiple frames in the same |
|
233 |
Txop is not supported for now */ |
|
234 |
hdr.SetQosTxopLimit (0); |
|
235 |
||
236 |
hdr.SetAddr1 (to); |
|
237 |
hdr.SetAddr2 (m_low->GetAddress ()); |
|
238 |
hdr.SetAddr3 (GetBssid ()); |
|
239 |
hdr.SetDsNotFrom (); |
|
240 |
hdr.SetDsNotTo (); |
|
241 |
||
242 |
WifiRemoteStation *destination = m_stationManager->Lookup (to); |
|
243 |
if (destination->IsBrandNew ()) |
|
244 |
{ |
|
245 |
// in adhoc mode, we assume that every destination |
|
246 |
// supports all the rates we support. |
|
247 |
for (uint32_t i = 0; i < m_phy->GetNModes (); i++) |
|
248 |
{ |
|
249 |
destination->AddSupportedMode (m_phy->GetMode (i)); |
|
250 |
} |
|
251 |
destination->RecordDisassociated (); |
|
252 |
} |
|
253 |
||
254 |
uint8_t tid = QosUtilsGetTidForPacket (packet); |
|
255 |
if (tid < 8) |
|
256 |
{ |
|
257 |
hdr.SetQosTid (tid); |
|
258 |
AccessClass ac = QosUtilsMapTidToAc (tid); |
|
259 |
m_queues[ac]->Queue (packet, hdr); |
|
260 |
} |
|
261 |
else |
|
262 |
{ |
|
263 |
//packet is considerated belonging to BestEffort AC |
|
264 |
hdr.SetQosTid (0); |
|
265 |
m_queues[AC_BE]->Queue (packet, hdr); |
|
266 |
} |
|
267 |
} |
|
268 |
||
269 |
bool |
|
270 |
QadhocWifiMac::SupportsSendFrom (void) const |
|
271 |
{ |
|
272 |
return false; |
|
273 |
} |
|
274 |
||
275 |
void |
|
276 |
QadhocWifiMac::SetForwardUpCallback (Callback<void,Ptr<Packet>, Mac48Address, Mac48Address> upCallback) |
|
277 |
{ |
|
278 |
m_forwardUp = upCallback; |
|
279 |
} |
|
280 |
||
281 |
void |
|
282 |
QadhocWifiMac::SetLinkUpCallback (Callback<void> linkUp) |
|
283 |
{ |
|
284 |
// an Adhoc network is always UP. |
|
285 |
linkUp (); |
|
286 |
} |
|
287 |
||
288 |
void |
|
289 |
QadhocWifiMac::SetLinkDownCallback (Callback<void> linkDown) |
|
290 |
{} |
|
291 |
||
292 |
Mac48Address |
|
293 |
QadhocWifiMac::GetAddress (void) const |
|
294 |
{ |
|
295 |
return m_low->GetAddress (); |
|
296 |
} |
|
297 |
||
298 |
Ssid |
|
299 |
QadhocWifiMac::GetSsid (void) const |
|
300 |
{ |
|
301 |
return m_ssid; |
|
302 |
} |
|
303 |
||
304 |
void |
|
305 |
QadhocWifiMac::SetAddress (Mac48Address address) |
|
306 |
{ |
|
307 |
m_low->SetAddress (address); |
|
308 |
m_low->SetBssid (address); |
|
309 |
} |
|
310 |
||
311 |
void |
|
312 |
QadhocWifiMac::SetSsid (Ssid ssid) |
|
313 |
{ |
|
314 |
NS_LOG_FUNCTION (this << ssid); |
|
315 |
// XXX: here, we should start a special adhoc network |
|
316 |
m_ssid = ssid; |
|
317 |
} |
|
318 |
||
319 |
Mac48Address |
|
320 |
QadhocWifiMac::GetBssid (void) const |
|
321 |
{ |
|
322 |
return m_low->GetBssid (); |
|
323 |
} |
|
324 |
||
325 |
void |
|
326 |
QadhocWifiMac::ForwardUp (Ptr<Packet> packet, Mac48Address from, Mac48Address to) |
|
327 |
{ |
|
328 |
NS_LOG_FUNCTION (this << packet << from); |
|
329 |
m_forwardUp (packet, from, to); |
|
330 |
} |
|
331 |
||
332 |
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
|
333 |
QadhocWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr) |
4408 | 334 |
{ |
335 |
NS_LOG_FUNCTION (this << packet << hdr); |
|
336 |
NS_ASSERT (!hdr->IsCtl ()); |
|
337 |
Mac48Address from = hdr->GetAddr2 (); |
|
338 |
Mac48Address to = hdr->GetAddr1 (); |
|
339 |
if (hdr->IsData ()) |
|
340 |
{ |
|
341 |
if (hdr->IsQosData () && hdr->IsQosAmsdu ()) |
|
342 |
{ |
|
343 |
NS_LOG_DEBUG ("Received A-MSDU from"<<from); |
|
344 |
DeaggregateAmsduAndForward (packet, hdr); |
|
345 |
} |
|
346 |
else |
|
347 |
{ |
|
348 |
ForwardUp (packet, from, to); |
|
349 |
} |
|
350 |
} |
|
351 |
else if (hdr->IsMgt ()) |
|
352 |
{ |
|
353 |
//Handling action frames |
|
354 |
} |
|
355 |
} |
|
356 |
||
357 |
void |
|
358 |
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
|
359 |
const WifiMacHeader *hdr) |
4408 | 360 |
{ |
361 |
DeaggregatedMsdus packets = MsduAggregator::Deaggregate (aggregatedPacket); |
|
362 |
for (DeaggregatedMsdusCI i = packets.begin (); i != packets.end (); ++i) |
|
363 |
{ |
|
364 |
ForwardUp ((*i).first, (*i).second.GetSourceAddr (), |
|
365 |
(*i).second.GetDestinationAddr ()); |
|
366 |
} |
|
367 |
} |
|
368 |
||
369 |
Ptr<EdcaTxopN> |
|
370 |
QadhocWifiMac::GetVOQueue (void) const |
|
371 |
{ |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
372 |
return m_queues.find (AC_VO)->second; |
4408 | 373 |
} |
374 |
||
375 |
Ptr<EdcaTxopN> |
|
376 |
QadhocWifiMac::GetVIQueue (void) const |
|
377 |
{ |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
378 |
return m_queues.find (AC_VI)->second; |
4408 | 379 |
} |
380 |
||
381 |
Ptr<EdcaTxopN> |
|
382 |
QadhocWifiMac::GetBEQueue (void) const |
|
383 |
{ |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
384 |
return m_queues.find (AC_BE)->second; |
4408 | 385 |
} |
386 |
||
387 |
Ptr<EdcaTxopN> |
|
388 |
QadhocWifiMac::GetBKQueue (void) const |
|
389 |
{ |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
390 |
return m_queues.find (AC_BK)->second; |
4408 | 391 |
} |
392 |
||
393 |
void |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
394 |
QadhocWifiMac::SetQueue (enum AccessClass ac) |
4408 | 395 |
{ |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
396 |
Ptr<EdcaTxopN> edca = CreateObject<EdcaTxopN> (); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
397 |
edca->SetLow (m_low); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
398 |
edca->SetManager (m_dcfManager); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
399 |
edca->SetTypeOfStation (ADHOC_STA); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
400 |
edca->SetTxMiddle (m_txMiddle); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
401 |
m_queues.insert (std::make_pair(ac, edca)); |
4408 | 402 |
} |
403 |
||
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
404 |
void |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
405 |
QadhocWifiMac::FinishConfigureStandard (enum WifiPhyStandard standard) |
4408 | 406 |
{ |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
407 |
switch (standard) |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
408 |
{ |
5747
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
4720
diff
changeset
|
409 |
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
|
410 |
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
|
411 |
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
|
412 |
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
|
413 |
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
|
414 |
break; |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
4720
diff
changeset
|
415 |
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
|
416 |
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
|
417 |
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
|
418 |
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
|
419 |
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
|
420 |
break; |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
421 |
case WIFI_PHY_STANDARD_holland: |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
422 |
// fall through |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
423 |
case WIFI_PHY_STANDARD_80211a: |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
424 |
// fall through |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
425 |
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
|
426 |
// fall through |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
427 |
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
|
428 |
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
|
429 |
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
|
430 |
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
|
431 |
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
|
432 |
break; |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
433 |
case WIFI_PHY_STANDARD_80211b: |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
434 |
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
|
435 |
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
|
436 |
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
|
437 |
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
|
438 |
break; |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
439 |
default: |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
440 |
NS_ASSERT (false); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
441 |
break; |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
442 |
} |
4408 | 443 |
} |
5903
395e17028faf
Fix of bug 706: Backoff counting when starting NS
Kirill Andreev <andreev@iitp.ru>
parents:
5819
diff
changeset
|
444 |
void |
395e17028faf
Fix of bug 706: Backoff counting when starting NS
Kirill Andreev <andreev@iitp.ru>
parents:
5819
diff
changeset
|
445 |
QadhocWifiMac::DoStart () |
395e17028faf
Fix of bug 706: Backoff counting when starting NS
Kirill Andreev <andreev@iitp.ru>
parents:
5819
diff
changeset
|
446 |
{ |
395e17028faf
Fix of bug 706: Backoff counting when starting NS
Kirill Andreev <andreev@iitp.ru>
parents:
5819
diff
changeset
|
447 |
for (Queues::iterator i = m_queues.begin (); i != m_queues.end (); ++i) |
395e17028faf
Fix of bug 706: Backoff counting when starting NS
Kirill Andreev <andreev@iitp.ru>
parents:
5819
diff
changeset
|
448 |
{ |
395e17028faf
Fix of bug 706: Backoff counting when starting NS
Kirill Andreev <andreev@iitp.ru>
parents:
5819
diff
changeset
|
449 |
i->second->Start (); |
395e17028faf
Fix of bug 706: Backoff counting when starting NS
Kirill Andreev <andreev@iitp.ru>
parents:
5819
diff
changeset
|
450 |
} |
395e17028faf
Fix of bug 706: Backoff counting when starting NS
Kirill Andreev <andreev@iitp.ru>
parents:
5819
diff
changeset
|
451 |
WifiMac::DoStart (); |
395e17028faf
Fix of bug 706: Backoff counting when starting NS
Kirill Andreev <andreev@iitp.ru>
parents:
5819
diff
changeset
|
452 |
} |
4408 | 453 |
|
454 |
} //namespace ns3 |