A Discrete-Event Network Simulator
API
ocb-wifi-mac.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2008 INRIA
4  * Copyright (c) 2013 Dalian University of Technology
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  * Junling Bu <linlinjavaer@gmail.com>
21  */
22 
23 #include "ns3/event-id.h"
24 #include "ns3/pointer.h"
25 #include "ns3/log.h"
26 #include "ns3/string.h"
27 #include "ns3/mac-rx-middle.h"
28 #include "ns3/ht-capabilities.h"
29 #include "ns3/vht-capabilities.h"
30 #include "ns3/channel-access-manager.h"
32 #include "ocb-wifi-mac.h"
33 #include "vendor-specific-action.h"
34 #include "higher-tx-tag.h"
35 
36 namespace ns3 {
37 
38 NS_LOG_COMPONENT_DEFINE ("OcbWifiMac");
39 
40 NS_OBJECT_ENSURE_REGISTERED (OcbWifiMac);
41 
44 
45 TypeId
47 {
48  static TypeId tid = TypeId ("ns3::OcbWifiMac")
50  .SetGroupName ("Wave")
51  .AddConstructor<OcbWifiMac> ()
52  ;
53  return tid;
54 }
55 
57 {
58  NS_LOG_FUNCTION (this);
59  // Let the lower layers know that we are acting as an OCB node
61  // BSSID is still needed in the low part of MAC
63 }
64 
66 {
67  NS_LOG_FUNCTION (this);
68 }
69 
70 void
72 {
73  NS_LOG_FUNCTION (this << vsc << peer << oi);
74  WifiMacHeader hdr;
76  hdr.SetAddr1 (peer);
77  hdr.SetAddr2 (GetAddress ());
79  hdr.SetDsNotFrom ();
80  hdr.SetDsNotTo ();
83  vsc->AddHeader (vsa);
84 
85  if (GetQosSupported ())
86  {
87  uint8_t tid = QosUtilsGetTidForPacket (vsc);
88  tid = tid > 7 ? 0 : tid;
89  m_edca[QosUtilsMapTidToAc (tid)]->Queue (vsc, hdr);
90  }
91  else
92  {
93  m_txop->Queue (vsc, hdr);
94  }
95 }
96 
97 void
99 {
100  NS_LOG_FUNCTION (this << oi << &cb);
102 }
103 
104 void
106 {
107  NS_LOG_FUNCTION (this << oi);
109 }
110 
111 void
113 {
114  NS_LOG_WARN ("in OCB mode we should not call SetSsid");
115 }
116 
117 Ssid
119 {
120  NS_LOG_WARN ("in OCB mode we should not call GetSsid");
121  // we really do not want to return ssid, however we have to provide
122  return RegularWifiMac::GetSsid ();
123 }
124 
125 
126 void
128 {
129  NS_LOG_WARN ("in OCB mode we should not call SetBsid");
130 }
131 
134 {
135  NS_LOG_WARN ("in OCB mode we should not call GetBssid");
136  return WILDCARD_BSSID;
137 }
138 
139 void
141 {
142  NS_LOG_FUNCTION (this << &linkUp);
144 
145  // The approach taken here is that, from the point of view of a STA
146  // in OCB mode, the link is always up, so we immediately invoke the
147  // callback if one is set
148  linkUp ();
149 }
150 
151 void
153 {
154  NS_LOG_FUNCTION (this << &linkDown);
156  NS_LOG_WARN ("in OCB mode the like will never down, so linkDown will never be called");
157 }
158 
159 void
161 {
162  NS_LOG_FUNCTION (this << packet << to);
163  if (m_stationManager->IsBrandNew (to))
164  {
165  //In ad hoc mode, we assume that every destination supports all
166  //the rates we support.
167  if (GetHtSupported () || GetVhtSupported ())
168  {
171  }
172  if (GetVhtSupported ())
173  {
175  }
178  }
179 
180  WifiMacHeader hdr;
181 
182  // If we are not a QoS STA then we definitely want to use AC_BE to
183  // transmit the packet. A TID of zero will map to AC_BE (through \c
184  // QosUtilsMapTidToAc()), so we use that as our default here.
185  uint8_t tid = 0;
186 
187  if (GetQosSupported ())
188  {
191  hdr.SetQosNoEosp ();
192  hdr.SetQosNoAmsdu ();
193  // About transmission of multiple frames,
194  // in Ad-hoc mode TXOP is not supported for now, so TxopLimit=0;
195  // however in OCB mode, 802.11p do not allow transmit multiple frames
196  // so TxopLimit must equal 0
197  hdr.SetQosTxopLimit (0);
198 
199  // Fill in the QoS control field in the MAC header
200  tid = QosUtilsGetTidForPacket (packet);
201  // Any value greater than 7 is invalid and likely indicates that
202  // the packet had no QoS tag, so we revert to zero, which'll
203  // mean that AC_BE is used.
204  if (tid > 7)
205  {
206  tid = 0;
207  }
208  hdr.SetQosTid (tid);
209  }
210  else
211  {
212  hdr.SetType (WIFI_MAC_DATA);
213  }
214 
215  if (GetHtSupported () || GetVhtSupported ())
216  {
217  hdr.SetNoOrder (); // explicitly set to 0 for the time being since HT/VHT/HE control field is not yet implemented (set it to 1 when implemented)
218  }
219  hdr.SetAddr1 (to);
220  hdr.SetAddr2 (GetAddress ());
221  hdr.SetAddr3 (WILDCARD_BSSID);
222  hdr.SetDsNotFrom ();
223  hdr.SetDsNotTo ();
224 
225  if (GetQosSupported ())
226  {
227  // Sanity check that the TID is valid
228  NS_ASSERT (tid < 8);
229  m_edca[QosUtilsMapTidToAc (tid)]->Queue (packet, hdr);
230  }
231  else
232  {
233  m_txop->Queue (packet, hdr);
234  }
235 }
236 
237 /*
238  * see 802.11p-2010 chapter 11.19
239  * here we only care about data packet and vsa management frame
240  */
241 void
243 {
244  NS_LOG_FUNCTION (this << *mpdu);
245  const WifiMacHeader* hdr = &mpdu->GetHeader ();
246  // Create a copy of the MPDU payload because non-const operations like RemovePacketTag
247  // and RemoveHeader may need to be performed.
248  Ptr<Packet> packet = mpdu->GetPacket ()->Copy ();
249  NS_ASSERT (!hdr->IsCtl ());
250  NS_ASSERT (hdr->GetAddr3 () == WILDCARD_BSSID);
251 
252  Mac48Address from = hdr->GetAddr2 ();
253  Mac48Address to = hdr->GetAddr1 ();
254 
255  if (m_stationManager->IsBrandNew (from))
256  {
257  //In ad hoc mode, we assume that every destination supports all
258  //the rates we support.
259  if (GetHtSupported () || GetVhtSupported ())
260  {
263  }
264  if (GetVhtSupported ())
265  {
267  }
270  }
271 
272  if (hdr->IsData ())
273  {
274  if (hdr->IsQosData () && hdr->IsQosAmsdu ())
275  {
276  NS_LOG_DEBUG ("Received A-MSDU from" << from);
278  }
279  else
280  {
281  ForwardUp (packet, from, to);
282  }
283  return;
284  }
285 
286  // why put check here, not before "if (hdr->IsData ())" ?
287  // because WifiNetDevice::ForwardUp needs to m_promiscRx data packet
288  // and will filter data packet for itself
289  // so we need to filter management frame
290  if (to != GetAddress () && !to.IsGroup ())
291  {
292  NS_LOG_LOGIC ("the management frame is not for us");
293  NotifyRxDrop (packet);
294  return;
295  }
296 
297  if (hdr->IsMgt () && hdr->IsAction ())
298  {
299  // yes, we only care about VendorSpecificAction frame in OCB mode
300  // other management frames will be handled by RegularWifiMac::Receive
302  packet->PeekHeader (vsaHdr);
303  if (vsaHdr.GetCategory () == CATEGORY_OF_VSA)
304  {
306  packet->RemoveHeader (vsa);
309 
310  if (cb.IsNull ())
311  {
312  NS_LOG_DEBUG ("cannot find VscCallback for OrganizationIdentifier=" << oi);
313  return;
314  }
315  bool succeed = cb (this, oi,packet, from);
316 
317  if (!succeed)
318  {
319  NS_LOG_DEBUG ("vsc callback could not handle the packet successfully");
320  }
321 
322  return;
323  }
324  }
325  // Invoke the receive handler of our parent class to deal with any
326  // other frames. Specifically, this will handle Block Ack-related
327  // Management Action frames.
328  RegularWifiMac::Receive (Create<WifiMacQueueItem> (packet, *hdr));
329 }
330 
331 void
332 OcbWifiMac::ConfigureEdca (uint32_t cwmin, uint32_t cwmax, uint32_t aifsn, enum AcIndex ac)
333 {
334  NS_LOG_FUNCTION (this << cwmin << cwmax << aifsn << ac);
335  Ptr<Txop> dcf;
336  switch (ac)
337  {
338  case AC_VO:
340  dcf->SetMinCw ((cwmin + 1) / 4 - 1);
341  dcf->SetMaxCw ((cwmin + 1) / 2 - 1);
342  dcf->SetAifsn (aifsn);
343  break;
344  case AC_VI:
346  dcf->SetMinCw ((cwmin + 1) / 2 - 1);
347  dcf->SetMaxCw (cwmin);
348  dcf->SetAifsn (aifsn);
349  break;
350  case AC_BE:
352  dcf->SetMinCw (cwmin);
353  dcf->SetMaxCw (cwmax);
354  dcf->SetAifsn (aifsn);
355  break;
356  case AC_BK:
358  dcf->SetMinCw (cwmin);
359  dcf->SetMaxCw (cwmax);
360  dcf->SetAifsn (aifsn);
361  break;
362  case AC_BE_NQOS:
363  dcf = RegularWifiMac::GetTxop ();
364  dcf->SetMinCw (cwmin);
365  dcf->SetMaxCw (cwmax);
366  dcf->SetAifsn (aifsn);
367  break;
368  case AC_BEACON:
369  // done by ApWifiMac
370  break;
371  case AC_UNDEF:
372  NS_FATAL_ERROR ("I don't know what to do with this");
373  break;
374  }
375 }
376 
377 void
379 {
380  NS_LOG_FUNCTION (this << standard);
381  NS_ASSERT (standard == WIFI_STANDARD_80211p);
382 
383  uint32_t cwmin = 15;
384  uint32_t cwmax = 1023;
385 
386  // The special value of AC_BE_NQOS which exists in the Access
387  // Category enumeration allows us to configure plain old DCF.
388  ConfigureEdca (cwmin, cwmax, 2, AC_BE_NQOS);
389 
390  // Now we configure the EDCA functions
391  // see IEEE802.11p-2010 section 7.3.2.29
392  // Wave CCH and SCHs set default 802.11p EDCA
393  ConfigureEdca (cwmin, cwmax, 2, AC_VO);
394  ConfigureEdca (cwmin, cwmax, 3, AC_VI);
395  ConfigureEdca (cwmin, cwmax, 6, AC_BE);
396  ConfigureEdca (cwmin, cwmax, 9, AC_BK);
397 
398  // Setup FrameExchangeManager
399  m_feManager = CreateObject<WaveFrameExchangeManager> ();
400  m_feManager->SetWifiMac (this);
401  m_feManager->SetMacTxMiddle (m_txMiddle);
402  m_feManager->SetMacRxMiddle (m_rxMiddle);
403  m_feManager->SetAddress (GetAddress ());
404  m_channelAccessManager->SetupFrameExchangeManager (m_feManager);
405  if (GetQosSupported ())
406  {
407  for (const auto& pair : m_edca)
408  {
409  pair.second->SetQosFrameExchangeManager (DynamicCast<QosFrameExchangeManager> (m_feManager));
410  }
411  }
412 }
413 
414 
415 void
417 {
418  NS_LOG_FUNCTION (this);
419  m_channelAccessManager->NotifySleepNow ();
420  m_feManager->NotifySleepNow ();
421 }
422 
423 void
425 {
426  NS_LOG_FUNCTION (this);
427  // wake-up operation is not required in m_low object
428  m_channelAccessManager->NotifyWakeupNow ();
429 }
430 
431 void
433 {
434  NS_LOG_FUNCTION (this << duration);
435  m_channelAccessManager->NotifyMaybeCcaBusyStartNow (duration);
436 }
437 
438 void
440 {
441  NS_LOG_FUNCTION (this << ac);
442  Ptr<QosTxop> queue = m_edca.find (ac)->second;
443  NS_ASSERT (queue != 0);
444  // reset and flush queue
445  queue->NotifyChannelSwitching ();
446 }
447 
448 void
450 {
451  NS_LOG_FUNCTION (this);
452  // The switching event is used to notify MAC entity reset its operation.
453  m_channelAccessManager->NotifySwitchingStartNow (Time (0));
454  m_feManager->NotifySwitchingStartNow (Time (0));
455 }
456 
457 void
459 {
460  NS_LOG_FUNCTION (this << device);
461  // To extend current OcbWifiMac for WAVE 1609.4, we shall use WaveFrameExchangeManager
462  StaticCast<WaveFrameExchangeManager> (m_feManager)->SetWaveNetDevice (device);
463 }
464 
465 void
467 {
468  NS_LOG_FUNCTION (this);
470 }
471 
472 } // namespace ns3
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
ns3::WifiMacHeader::SetQosNoEosp
void SetQosNoEosp()
Un-set the end of service period (EOSP) bit in the QoS control field.
Definition: wifi-mac-header.cc:362
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
NS_ASSERT
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:67
ns3::WifiMacQueueItem::GetPacket
Ptr< const Packet > GetPacket(void) const
Get the packet stored in this item.
Definition: wifi-mac-queue-item.cc:59
ns3::Packet::PeekHeader
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
Definition: packet.cc:290
ns3::OcbWifiMac::Receive
virtual void Receive(Ptr< WifiMacQueueItem > mpdu)
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
Definition: ocb-wifi-mac.cc:242
ns3::OcbWifiMac::Suspend
void Suspend(void)
To support MAC extension for multiple channel operation, Suspend the activity in current MAC entity.
Definition: ocb-wifi-mac.cc:416
ns3::OcbWifiMac::AddReceiveVscCallback
void AddReceiveVscCallback(OrganizationIdentifier oi, VscCallback cb)
Definition: ocb-wifi-mac.cc:98
ns3::Mac48Address::IsGroup
bool IsGroup(void) const
Definition: mac48-address.cc:164
ns3::WifiMacHeader::IsData
bool IsData(void) const
Return true if the Type is DATA.
Definition: wifi-mac-header.cc:558
ns3::Packet::AddHeader
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:256
ns3::Txop::SetMaxCw
void SetMaxCw(uint32_t maxCw)
Set the maximum contention window size.
Definition: txop.cc:173
ns3::Callback
Callback template class.
Definition: callback.h:1279
ns3::RegularWifiMac::GetSsid
Ssid GetSsid(void) const override
Definition: regular-wifi-mac.cc:696
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Callback::IsNull
bool IsNull(void) const
Check for null implementation.
Definition: callback.h:1386
ns3::RegularWifiMac::SetBssid
void SetBssid(Mac48Address bssid)
Definition: regular-wifi-mac.cc:702
ns3::WIFI_STANDARD_80211p
@ WIFI_STANDARD_80211p
Definition: wifi-standards.h:130
ns3::OcbWifiMac::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition: ocb-wifi-mac.cc:466
ns3::WifiMacHeader::SetDsNotFrom
void SetDsNotFrom(void)
Un-set the From DS bit in the Frame Control field.
Definition: wifi-mac-header.cc:90
NS_LOG_WARN
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:265
ns3::OcbWifiMac::SetSsid
virtual void SetSsid(Ssid ssid)
Definition: ocb-wifi-mac.cc:112
ns3::RegularWifiMac::SetLinkDownCallback
void SetLinkDownCallback(Callback< void > linkDown) override
Definition: regular-wifi-mac.cc:589
ns3::OcbWifiMac::CancleTx
void CancleTx(enum AcIndex ac)
Definition: ocb-wifi-mac.cc:439
ns3::Mac48Address
an EUI-48 address
Definition: mac48-address.h:44
ns3::WifiMacHeader::GetAddr3
Mac48Address GetAddr3(void) const
Return the address in the Address 3 field.
Definition: wifi-mac-header.cc:436
ns3::WifiMacHeader::GetAddr1
Mac48Address GetAddr1(void) const
Return the address in the Address 1 field.
Definition: wifi-mac-header.cc:424
vendor-specific-action.h
ns3::WifiMacHeader::SetAddr3
void SetAddr3(Mac48Address address)
Fill the Address 3 field with the given address.
Definition: wifi-mac-header.cc:120
ns3::RegularWifiMac::m_rxMiddle
Ptr< MacRxMiddle > m_rxMiddle
RX middle (defragmentation etc.)
Definition: regular-wifi-mac.h:217
ns3::AC_BEACON
@ AC_BEACON
Beacon queue.
Definition: qos-utils.h:83
ns3::RegularWifiMac::SetLinkUpCallback
void SetLinkUpCallback(Callback< void > linkUp) override
Definition: regular-wifi-mac.cc:582
ns3::RegularWifiMac
base class for all MAC-level wifi objects.
Definition: regular-wifi-mac.h:52
ns3::WifiMacQueueItem::GetHeader
const WifiMacHeader & GetHeader(void) const
Get the header stored in this item.
Definition: wifi-mac-queue-item.cc:65
ns3::RegularWifiMac::DeaggregateAmsduAndForward
virtual void DeaggregateAmsduAndForward(Ptr< WifiMacQueueItem > mpdu)
This method can be called to de-aggregate an A-MSDU and forward the constituent packets up the stack.
Definition: regular-wifi-mac.cc:874
ns3::WifiRemoteStationManager::AddAllSupportedModes
void AddAllSupportedModes(Mac48Address address)
Invoked in a STA or AP to store all of the modes supported by a destination which is also supported l...
Definition: wifi-remote-station-manager.cc:364
ns3::RegularWifiMac::GetQosSupported
bool GetQosSupported() const
Return whether the device supports QoS.
Definition: regular-wifi-mac.cc:603
ns3::WifiRemoteStationManager::AddAllSupportedMcs
void AddAllSupportedMcs(Mac48Address address)
Invoked in a STA or AP to store all of the MCS supported by a destination which is also supported loc...
Definition: wifi-remote-station-manager.cc:381
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
ns3::VendorSpecificContentManager::FindVscCallback
VscCallback FindVscCallback(OrganizationIdentifier &oi)
Definition: vendor-specific-action.cc:385
ns3::Ssid
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:36
ns3::OcbWifiMac::OcbWifiMac
OcbWifiMac(void)
Definition: ocb-wifi-mac.cc:56
ns3::VendorSpecificContentManager::DeregisterVscCallback
void DeregisterVscCallback(OrganizationIdentifier &oi)
Definition: vendor-specific-action.cc:363
ns3::OcbWifiMac
STAs communicate with each directly outside the context of a BSS.
Definition: ocb-wifi-mac.h:50
ns3::WifiMacHeader::SetAddr1
void SetAddr1(Mac48Address address)
Fill the Address 1 field with the given address.
Definition: wifi-mac-header.cc:108
ns3::Txop::NotifyChannelSwitching
virtual void NotifyChannelSwitching(void)
When a channel switching occurs, enqueued packets are removed.
Definition: txop.cc:385
ns3::Txop::SetMinCw
void SetMinCw(uint32_t minCw)
Set the minimum contention window size.
Definition: txop.cc:161
ns3::RegularWifiMac::GetAddress
Mac48Address GetAddress(void) const override
Definition: regular-wifi-mac.cc:683
ns3::WifiMacHeader
Implements the IEEE 802.11 MAC header.
Definition: wifi-mac-header.h:85
ns3::Ptr< Packet >
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
ns3::OcbWifiMac::Enqueue
virtual void Enqueue(Ptr< Packet > packet, Mac48Address to)
Definition: ocb-wifi-mac.cc:160
ns3::Mac48Address::GetBroadcast
static Mac48Address GetBroadcast(void)
Definition: mac48-address.cc:170
ns3::WifiMacHeader::SetQosAckPolicy
void SetQosAckPolicy(QosAckPolicy policy)
Set the QoS Ack policy in the QoS control field.
Definition: wifi-mac-header.cc:367
ns3::RegularWifiMac::m_edca
EdcaQueues m_edca
This is a map from Access Category index to the corresponding channel access function.
Definition: regular-wifi-mac.h:241
ns3::AC_VI
@ AC_VI
Video.
Definition: qos-utils.h:77
ns3::OcbWifiMac::GetSsid
virtual Ssid GetSsid(void) const
Definition: ocb-wifi-mac.cc:118
ns3::WifiMacHeader::IsQosAmsdu
bool IsQosAmsdu(void) const
Check if the A-MSDU present bit is set in the QoS control field.
Definition: wifi-mac-header.cc:855
ns3::RegularWifiMac::GetVhtSupported
bool GetVhtSupported() const
Return whether the device supports VHT.
Definition: regular-wifi-mac.cc:619
ns3::OcbWifiMac::SetBssid
virtual void SetBssid(Mac48Address bssid)
Definition: ocb-wifi-mac.cc:127
ns3::QosUtilsMapTidToAc
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
Definition: qos-utils.cc:126
ns3::RegularWifiMac::DoDispose
void DoDispose() override
Destructor implementation.
Definition: regular-wifi-mac.cc:95
ns3::OcbWifiMac::Reset
void Reset(void)
To support MAC extension for multiple channel operation, Reset current MAC entity and flush its inter...
Definition: ocb-wifi-mac.cc:449
wave-frame-exchange-manager.h
ns3::AC_UNDEF
@ AC_UNDEF
Total number of ACs.
Definition: qos-utils.h:85
ns3::Packet::RemoveHeader
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Definition: packet.cc:280
ns3::RegularWifiMac::m_txop
Ptr< Txop > m_txop
This holds a pointer to the TXOP instance for this WifiMac - used for transmission of frames to non-Q...
Definition: regular-wifi-mac.h:233
ns3::AC_BE
@ AC_BE
Best Effort.
Definition: qos-utils.h:73
ns3::WifiMacHeader::NORMAL_ACK
@ NORMAL_ACK
Definition: wifi-mac-header.h:92
ns3::AC_BE_NQOS
@ AC_BE_NQOS
Non-QoS.
Definition: qos-utils.h:81
ns3::RegularWifiMac::GetTxop
Ptr< Txop > GetTxop(void) const
Accessor for the DCF object.
Definition: regular-wifi-mac.cc:495
ns3::RegularWifiMac::m_stationManager
Ptr< WifiRemoteStationManager > m_stationManager
Remote station manager (rate control, RTS/CTS/fragmentation thresholds etc.)
Definition: regular-wifi-mac.h:223
ns3::AC_BK
@ AC_BK
Background.
Definition: qos-utils.h:75
ns3::WifiMacHeader::IsQosData
bool IsQosData(void) const
Return true if the Type is DATA and Subtype is one of the possible values for QoS Data.
Definition: wifi-mac-header.cc:565
ns3::WifiRemoteStationManager::IsBrandNew
bool IsBrandNew(Mac48Address address) const
Return whether the station state is brand new.
Definition: wifi-remote-station-manager.cc:438
ns3::OcbWifiMac::GetBssid
virtual Mac48Address GetBssid(void) const
This method shall not be used in WAVE environment and here it will overloaded to log warn message.
Definition: ocb-wifi-mac.cc:133
ns3::WifiMacHeader::SetNoOrder
void SetNoOrder(void)
Unset order bit in the frame control field.
Definition: wifi-mac-header.cc:337
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::OcbWifiMac::~OcbWifiMac
virtual ~OcbWifiMac(void)
Definition: ocb-wifi-mac.cc:65
ns3::RegularWifiMac::SetTypeOfStation
void SetTypeOfStation(TypeOfStation type) override
This method is invoked by a subclass to specify what type of station it is implementing.
Definition: regular-wifi-mac.cc:482
higher-tx-tag.h
ns3::VendorSpecificActionHeader::GetCategory
uint8_t GetCategory(void) const
Get the category field.
Definition: vendor-specific-action.cc:288
ns3::RegularWifiMac::ForwardUp
void ForwardUp(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet up to the device.
Definition: regular-wifi-mac.cc:757
ns3::WifiRemoteStationManager::AddStationHtCapabilities
void AddStationHtCapabilities(Mac48Address from, HtCapabilities htCapabilities)
Records HT capabilities of the remote station.
Definition: wifi-remote-station-manager.cc:1301
ns3::OcbWifiMac::EnableForWave
void EnableForWave(Ptr< WaveNetDevice > device)
Definition: ocb-wifi-mac.cc:458
ns3::WifiMacHeader::IsMgt
bool IsMgt(void) const
Return true if the Type is Management.
Definition: wifi-mac-header.cc:577
NS_LOG_LOGIC
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:289
ns3::WifiRemoteStationManager::AddStationVhtCapabilities
void AddStationVhtCapabilities(Mac48Address from, VhtCapabilities vhtCapabilities)
Records VHT capabilities of the remote station.
Definition: wifi-remote-station-manager.cc:1327
ns3::WIFI_MAC_MGT_ACTION
@ WIFI_MAC_MGT_ACTION
Definition: wifi-mac-header.h:58
ns3::OcbWifiMac::MakeVirtualBusy
void MakeVirtualBusy(Time duration)
Definition: ocb-wifi-mac.cc:432
ns3::WifiMacHeader::SetAddr2
void SetAddr2(Mac48Address address)
Fill the Address 2 field with the given address.
Definition: wifi-mac-header.cc:114
ns3::WifiMac::NotifyRxDrop
void NotifyRxDrop(Ptr< const Packet > packet)
Definition: wifi-mac.cc:121
ns3::OcbWifiMac::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: ocb-wifi-mac.cc:46
ns3::AC_VO
@ AC_VO
Voice.
Definition: qos-utils.h:79
ns3::OcbWifiMac::RemoveReceiveVscCallback
void RemoveReceiveVscCallback(OrganizationIdentifier oi)
Definition: ocb-wifi-mac.cc:105
ns3::WifiRemoteStationManager::RecordDisassociated
void RecordDisassociated(Mac48Address address)
Records that the STA was disassociated.
Definition: wifi-remote-station-manager.cc:489
ns3::OcbWifiMac::SendVsc
void SendVsc(Ptr< Packet > vsc, Mac48Address peer, OrganizationIdentifier oi)
Definition: ocb-wifi-mac.cc:71
ns3::OcbWifiMac::Resume
void Resume(void)
To support MAC extension for multiple channel operation, Resume the activity of suspended MAC entity.
Definition: ocb-wifi-mac.cc:424
ns3::RegularWifiMac::GetHtCapabilities
HtCapabilities GetHtCapabilities(void) const
Return the HT capabilities of the device.
Definition: regular-wifi-mac.cc:207
NS_LOG_DEBUG
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
ns3::VendorSpecificActionHeader::GetOrganizationIdentifier
OrganizationIdentifier GetOrganizationIdentifier(void) const
Definition: vendor-specific-action.cc:269
ns3::RegularWifiMac::m_feManager
Ptr< FrameExchangeManager > m_feManager
Frame Exchange Manager.
Definition: regular-wifi-mac.h:221
ns3::OCB
@ OCB
Definition: wifi-mac.h:46
ns3::Packet::Copy
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
Definition: packet.cc:121
ns3::WIFI_MAC_DATA
@ WIFI_MAC_DATA
Definition: wifi-mac-header.h:62
ns3::WIFI_MAC_QOSDATA
@ WIFI_MAC_QOSDATA
Definition: wifi-mac-header.h:70
ns3::RegularWifiMac::GetBKQueue
Ptr< QosTxop > GetBKQueue(void) const
Accessor for the AC_BK channel access function.
Definition: regular-wifi-mac.cc:531
ns3::WifiMacHeader::SetQosTxopLimit
void SetQosTxopLimit(uint8_t txop)
Set TXOP limit in the QoS control field.
Definition: wifi-mac-header.cc:396
third.ssid
ssid
Definition: third.py:100
ns3::AcIndex
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:71
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition: log-macros-enabled.h:244
ns3::RegularWifiMac::m_txMiddle
Ptr< MacTxMiddle > m_txMiddle
TX middle (aggregation etc.)
Definition: regular-wifi-mac.h:218
ns3::OcbWifiMac::ConfigureStandard
virtual void ConfigureStandard(enum WifiStandard standard)
Definition: ocb-wifi-mac.cc:378
ns3::WifiMacHeader::IsCtl
bool IsCtl(void) const
Return true if the Type is Control.
Definition: wifi-mac-header.cc:571
ns3::RegularWifiMac::m_channelAccessManager
Ptr< ChannelAccessManager > m_channelAccessManager
channel access manager
Definition: regular-wifi-mac.h:219
ns3::OcbWifiMac::SetLinkDownCallback
virtual void SetLinkDownCallback(Callback< void > linkDown)
Definition: ocb-wifi-mac.cc:152
ns3::WifiMacHeader::SetType
void SetType(WifiMacType type, bool resetToDsFromDs=true)
Set Type/Subtype values with the correct values depending on the given type.
Definition: wifi-mac-header.cc:132
ns3::VendorSpecificContentManager::RegisterVscCallback
void RegisterVscCallback(OrganizationIdentifier oi, VscCallback cb)
Definition: vendor-specific-action.cc:352
ns3::OcbWifiMac::SetLinkUpCallback
virtual void SetLinkUpCallback(Callback< void > linkUp)
SetLinkUpCallback and SetLinkDownCallback will be overloaded In OCB mode, stations can send packets d...
Definition: ocb-wifi-mac.cc:140
ns3::RegularWifiMac::GetVhtCapabilities
VhtCapabilities GetVhtCapabilities(void) const
Return the VHT capabilities of the device.
Definition: regular-wifi-mac.cc:263
ns3::RegularWifiMac::GetBEQueue
Ptr< QosTxop > GetBEQueue(void) const
Accessor for the AC_BE channel access function.
Definition: regular-wifi-mac.cc:525
ns3::VendorSpecificActionHeader
See IEEE 802.11-2007 chapter 7.3.1.11 and 7.4.5 also IEEE 802.11p-2010 chapter 7.4....
Definition: vendor-specific-action.h:160
ns3::WifiMacHeader::SetDsNotTo
void SetDsNotTo(void)
Un-set the To DS bit in the Frame Control field.
Definition: wifi-mac-header.cc:102
ns3::VendorSpecificActionHeader::SetOrganizationIdentifier
void SetOrganizationIdentifier(OrganizationIdentifier oi)
Definition: vendor-specific-action.cc:262
ns3::WifiStandard
WifiStandard
Identifies the allowed configurations that a Wifi device is configured to use.
Definition: wifi-standards.h:126
ns3::OcbWifiMac::ConfigureEdca
void ConfigureEdca(uint32_t cwmin, uint32_t cwmax, uint32_t aifsn, enum AcIndex ac)
Definition: ocb-wifi-mac.cc:332
ns3::RegularWifiMac::GetVOQueue
Ptr< QosTxop > GetVOQueue(void) const
Accessor for the AC_VO channel access function.
Definition: regular-wifi-mac.cc:513
ns3::WifiMacHeader::SetQosTid
void SetQosTid(uint8_t tid)
Set the TID for the QoS header.
Definition: wifi-mac-header.cc:352
ns3::WifiMacHeader::GetAddr2
Mac48Address GetAddr2(void) const
Return the address in the Address 2 field.
Definition: wifi-mac-header.cc:430
ns3::RegularWifiMac::GetHtSupported
bool GetHtSupported() const
Return whether the device supports HT.
Definition: regular-wifi-mac.cc:609
ns3::Txop::Queue
virtual void Queue(Ptr< Packet > packet, const WifiMacHeader &hdr)
Definition: txop.cc:294
ns3::CATEGORY_OF_VSA
static const uint8_t CATEGORY_OF_VSA
see IEEE 802.11-2007 chapter 7.3.1.11 Table 7-24—Category values
Definition: vendor-specific-action.h:139
ns3::RegularWifiMac::GetVIQueue
Ptr< QosTxop > GetVIQueue(void) const
Accessor for the AC_VI channel access function.
Definition: regular-wifi-mac.cc:519
ns3::RegularWifiMac::Receive
virtual void Receive(Ptr< WifiMacQueueItem > mpdu)
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
Definition: regular-wifi-mac.cc:764
ocb-wifi-mac.h
ns3::WifiMacHeader::IsAction
bool IsAction(void) const
Return true if the header is an Action header.
Definition: wifi-mac-header.cc:729
ns3::OcbWifiMac::m_vscManager
VendorSpecificContentManager m_vscManager
VSC manager.
Definition: ocb-wifi-mac.h:184
ns3::QosUtilsGetTidForPacket
uint8_t QosUtilsGetTidForPacket(Ptr< const Packet > packet)
If a QoS tag is attached to the packet, returns a value < 8.
Definition: qos-utils.cc:152
ns3::Txop::SetAifsn
void SetAifsn(uint8_t aifsn)
Set the number of slots that make up an AIFS.
Definition: txop.cc:247
ns3::WifiMacHeader::SetQosNoAmsdu
void SetQosNoAmsdu(void)
Set that A-MSDU is not present.
Definition: wifi-mac-header.cc:391
ns3::WILDCARD_BSSID
static const Mac48Address WILDCARD_BSSID
Wildcard BSSID.
Definition: ocb-wifi-mac.cc:43
ns3::OrganizationIdentifier
the organization identifier is a public organizationally unique identifier assigned by the IEEE.
Definition: vendor-specific-action.h:54