A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
mesh-wifi-interface-mac.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 IITP RAS
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Authors: Kirill Andreev <andreev@iitp.ru>
19  * Pavel Boyko <boyko@iitp.ru>
20  */
21 
22 #include "ns3/mesh-wifi-interface-mac.h"
23 #include "ns3/mesh-wifi-beacon.h"
24 #include "ns3/log.h"
25 #include "ns3/boolean.h"
26 #include "ns3/wifi-phy.h"
27 #include "ns3/dcf-manager.h"
28 #include "ns3/mac-rx-middle.h"
29 #include "ns3/mac-low.h"
30 #include "ns3/dca-txop.h"
31 #include "ns3/random-variable-stream.h"
32 #include "ns3/simulator.h"
33 #include "ns3/yans-wifi-phy.h"
34 #include "ns3/pointer.h"
35 #include "ns3/double.h"
36 #include "ns3/trace-source-accessor.h"
37 #include "ns3/qos-tag.h"
38 
39 NS_LOG_COMPONENT_DEFINE ("MeshWifiInterfaceMac");
40 
41 namespace ns3 {
42 
43 NS_OBJECT_ENSURE_REGISTERED (MeshWifiInterfaceMac)
44  ;
45 
46 TypeId
48 {
49  static TypeId tid = TypeId ("ns3::MeshWifiInterfaceMac")
51  .AddConstructor<MeshWifiInterfaceMac> ()
52  .AddAttribute ( "BeaconInterval",
53  "Beacon Interval",
54  TimeValue (Seconds (0.5)),
55 
56  MakeTimeAccessor (
59  )
60  .AddAttribute ( "RandomStart",
61  "Window when beacon generating starts (uniform random) in seconds",
62  TimeValue (Seconds (0.5)),
63  MakeTimeAccessor (
66  )
67  .AddAttribute ( "BeaconGeneration",
68  "Enable/Disable Beaconing.",
69  BooleanValue (true),
70  MakeBooleanAccessor (
72  MakeBooleanChecker ()
73  )
74  ;
75  return tid;
76 }
78  m_standard (WIFI_PHY_STANDARD_80211a)
79 {
80  NS_LOG_FUNCTION (this);
81 
82  // Let the lower layers know that we are acting as a mesh node
84  m_coefficient = CreateObject<UniformRandomVariable> ();
85 }
87 {
88  NS_LOG_FUNCTION (this);
89 }
90 //-----------------------------------------------------------------------------
91 // WifiMac inherited
92 //-----------------------------------------------------------------------------
93 void
95 {
96  NS_LOG_FUNCTION (this << packet << to << from);
97  ForwardDown (packet, from, to);
98 }
99 void
101 {
102  NS_LOG_FUNCTION (this << packet << to);
103  ForwardDown (packet, m_low->GetAddress (), to);
104 }
105 bool
107 {
108  return true;
109 }
110 void
112 {
113  NS_LOG_FUNCTION (this);
115 
116  // The approach taken here is that, from the point of view of a mesh
117  // node, the link is always up, so we immediately invoke the
118  // callback if one is set
119  linkUp ();
120 }
121 void
123 {
124  NS_LOG_FUNCTION (this);
125  m_plugins.clear ();
127 
129 }
130 void
132 {
134  if (m_beaconEnable)
135  {
136  Time randomStart = Seconds (m_coefficient->GetValue ());
137  // Now start sending beacons after some random delay (to avoid collisions)
140  m_tbtt = Simulator::Now () + randomStart;
141  }
142  else
143  {
144  // stop sending beacons
146  }
147 }
148 
149 int64_t
151 {
152  NS_LOG_FUNCTION (this << stream);
153  int64_t currentStream = stream;
154  m_coefficient->SetStream (currentStream++);
155  for (PluginList::const_iterator i = m_plugins.begin (); i < m_plugins.end (); i++)
156  {
157  currentStream += (*i)->AssignStreams (currentStream);
158  }
159  return (currentStream - stream);
160 }
161 
162 //-----------------------------------------------------------------------------
163 // Plugins
164 //-----------------------------------------------------------------------------
165 void
167 {
168  NS_LOG_FUNCTION (this);
169 
170  plugin->SetParent (this);
171  m_plugins.push_back (plugin);
172 }
173 //-----------------------------------------------------------------------------
174 // Switch channels
175 //-----------------------------------------------------------------------------
176 uint16_t
178 {
179  NS_LOG_FUNCTION (this);
180  NS_ASSERT (m_phy != 0); // need PHY to set/get channel
181 
183  if (phy != 0)
184  {
185  return phy->GetChannelNumber ();
186  }
187  else
188  {
189  return 0;
190  }
191 }
192 void
194 {
195  NS_LOG_FUNCTION (this);
196  NS_ASSERT (m_phy != 0); // need PHY to set/get channel
209  phy->SetChannelNumber (new_id);
210  // Don't know NAV on new channel
211  m_dcfManager->NotifyNavResetNow (Seconds (0));
212 }
213 //-----------------------------------------------------------------------------
214 // Forward frame down
215 //-----------------------------------------------------------------------------
216 void
218 {
219  // copy packet to allow modifications
220  Ptr<Packet> packet = const_packet->Copy ();
221  WifiMacHeader hdr;
222  hdr.SetTypeData ();
223  hdr.SetAddr2 (GetAddress ());
224  hdr.SetAddr3 (to);
225  hdr.SetAddr4 (from);
226  hdr.SetDsFrom ();
227  hdr.SetDsTo ();
228  // Fill QoS fields:
230  hdr.SetQosNoEosp ();
231  hdr.SetQosNoAmsdu ();
232  hdr.SetQosTxopLimit (0);
233  // Address 1 is unknwon here. Routing plugin is responsible to correctly set it.
234  hdr.SetAddr1 (Mac48Address ());
235  // Filter packet through all installed plugins
236  for (PluginList::const_iterator i = m_plugins.end () - 1; i != m_plugins.begin () - 1; i--)
237  {
238  bool drop = !((*i)->UpdateOutcomingFrame (packet, hdr, from, to));
239  if (drop)
240  {
241  return; // plugin drops frame
242  }
243  }
244  // Assert that address1 is set. Assert will fail e.g. if there is no installed routing plugin.
245  NS_ASSERT (hdr.GetAddr1 () != Mac48Address ());
246  // Queue frame
247  if (m_stationManager->IsBrandNew (hdr.GetAddr1 ()))
248  {
249  // in adhoc mode, we assume that every destination
250  // supports all the rates we support.
251  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
252  {
253  m_stationManager->AddSupportedMode (hdr.GetAddr1 (), m_phy->GetMode (i));
254  }
255  m_stationManager->RecordDisassociated (hdr.GetAddr1 ());
256  }
257  //Classify: application sets a tag, which is removed here
258  // Get Qos tag:
259  AcIndex ac = AC_BE;
260  QosTag tag;
261  if (packet->RemovePacketTag (tag))
262  {
264  hdr.SetQosTid (tag.GetTid ());
265  //Aftre setting type DsFrom and DsTo fields are reset.
266  hdr.SetDsFrom ();
267  hdr.SetDsTo ();
268  ac = QosUtilsMapTidToAc (tag.GetTid ());
269  }
271  m_stats.sentBytes += packet->GetSize ();
272  NS_ASSERT (m_edca.find (ac) != m_edca.end ());
273  m_edca[ac]->Queue (packet, hdr);
274 }
275 void
277 {
278  //Filter management frames:
279  WifiMacHeader header = hdr;
280  for (PluginList::const_iterator i = m_plugins.end () - 1; i != m_plugins.begin () - 1; i--)
281  {
282  bool drop = !((*i)->UpdateOutcomingFrame (packet, header, Mac48Address (), Mac48Address ()));
283  if (drop)
284  {
285  return; // plugin drops frame
286  }
287  }
289  m_stats.sentBytes += packet->GetSize ();
290  if ((m_edca.find (AC_VO) == m_edca.end ()) || (m_edca.find (AC_BK) == m_edca.end ()))
291  {
292  NS_FATAL_ERROR ("Voice or Background queue is not set up!");
293  }
294  /*
295  * When we send a management frame - it is better to enqueue it to
296  * priority queue. But when we send a broadcast management frame,
297  * like PREQ, little MinCw value may cause collisions during
298  * retransmissions (two neighbor stations may choose the same window
299  * size, and two packets will be collided). So, broadcast management
300  * frames go to BK queue.
301  */
302  if (hdr.GetAddr1 () != Mac48Address::GetBroadcast ())
303  {
304  m_edca[AC_VO]->Queue (packet, header);
305  }
306  else
307  {
308  m_edca[AC_BK]->Queue (packet, header);
309  }
310 }
313 {
314  // set the set of supported rates and make sure that we indicate
315  // the Basic Rate set in this set of supported rates.
316  SupportedRates rates;
317  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
318  {
319  WifiMode mode = m_phy->GetMode (i);
320  rates.AddSupportedRate (mode.GetDataRate ());
321  }
322  // set the basic rates
323  for (uint32_t j = 0; j < m_stationManager->GetNBasicModes (); j++)
324  {
325  WifiMode mode = m_stationManager->GetBasicMode (j);
326  rates.SetBasicRate (mode.GetDataRate ());
327  }
328  return rates;
329 }
330 bool
332 {
333  for (uint32_t i = 0; i < m_stationManager->GetNBasicModes (); i++)
334  {
335  WifiMode mode = m_stationManager->GetBasicMode (i);
336  if (!rates.IsSupportedRate (mode.GetDataRate ()))
337  {
338  return false;
339  }
340  }
341  return true;
342 }
343 //-----------------------------------------------------------------------------
344 // Beacons
345 //-----------------------------------------------------------------------------
346 void
348 {
349  NS_LOG_FUNCTION (this << interval);
350  m_randomStart = interval;
351 }
352 void
354 {
355  NS_LOG_FUNCTION (this << interval);
356  m_beaconInterval = interval;
357 }
358 Time
360 {
361  return m_beaconInterval;
362 }
363 void
365 {
366  NS_LOG_FUNCTION (this << enable);
367  m_beaconEnable = enable;
368 }
369 bool
371 {
372  return m_beaconSendEvent.IsRunning ();
373 }
374 Time
376 {
377  return m_tbtt;
378 }
379 void
381 {
382  // User of ShiftTbtt () must take care don't shift it to the past
383  NS_ASSERT (GetTbtt () + shift > Simulator::Now ());
384 
385  m_tbtt += shift;
386  // Shift scheduled event
389  this);
390 }
391 void
393 {
396 }
397 void
399 {
400  NS_LOG_FUNCTION (this);
401  NS_LOG_DEBUG (GetAddress () << " is sending beacon");
402 
404 
405  // Form & send beacon
407 
408  // Ask all plugins to add their specific information elements to beacon
409  for (PluginList::const_iterator i = m_plugins.begin (); i != m_plugins.end (); ++i)
410  {
411  (*i)->UpdateBeacon (beacon);
412  }
413  m_dca->Queue (beacon.CreatePacket (), beacon.CreateHeader (GetAddress (), GetMeshPointAddress ()));
414 
416 }
417 void
419 {
420  // Process beacon
421  if ((hdr->GetAddr1 () != GetAddress ()) && (hdr->GetAddr1 () != Mac48Address::GetBroadcast ()))
422  {
423  return;
424  }
425  if (hdr->IsBeacon ())
426  {
428  MgtBeaconHeader beacon_hdr;
429 
430  packet->PeekHeader (beacon_hdr);
431 
432  NS_LOG_DEBUG ("Beacon received from " << hdr->GetAddr2 () << " I am " << GetAddress () << " at "
433  << Simulator::Now ().GetMicroSeconds () << " microseconds");
434 
435  // update supported rates
436  if (beacon_hdr.GetSsid ().IsEqual (GetSsid ()))
437  {
438  SupportedRates rates = beacon_hdr.GetSupportedRates ();
439 
440  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
441  {
442  WifiMode mode = m_phy->GetMode (i);
443  if (rates.IsSupportedRate (mode.GetDataRate ()))
444  {
445  m_stationManager->AddSupportedMode (hdr->GetAddr2 (), mode);
446  if (rates.IsBasicRate (mode.GetDataRate ()))
447  {
448  m_stationManager->AddBasicMode (mode);
449  }
450  }
451  }
452  }
453  }
454  else
455  {
456  m_stats.recvBytes += packet->GetSize ();
458  }
459  // Filter frame through all installed plugins
460  for (PluginList::iterator i = m_plugins.begin (); i != m_plugins.end (); ++i)
461  {
462  bool drop = !((*i)->Receive (packet, *hdr));
463  if (drop)
464  {
465  return; // plugin drops frame
466  }
467  }
468  // Check if QoS tag exists and add it:
469  if (hdr->IsQosData ())
470  {
471  packet->AddPacketTag (QosTag (hdr->GetQosTid ()));
472  }
473  // Forward data up
474  if (hdr->IsData ())
475  {
476  ForwardUp (packet, hdr->GetAddr4 (), hdr->GetAddr3 ());
477  }
478 
479  // We don't bother invoking RegularWifiMac::Receive() here, because
480  // we've explicitly handled all the frames we care about. This is in
481  // contrast to most classes which derive from RegularWifiMac.
482 }
483 uint32_t
485 {
486  uint32_t metric = 1;
487  if (!m_linkMetricCallback.IsNull ())
488  {
489  metric = m_linkMetricCallback (peerAddress, this);
490  }
491  return metric;
492 }
493 void
495 {
497 }
498 void
500 {
501  m_mpAddress = a;
502 }
505 {
506  return m_mpAddress;
507 }
508 //Statistics:
510  recvBeacons (0), sentFrames (0), sentBytes (0), recvFrames (0), recvBytes (0)
511 {
512 }
513 void
515 {
516  os << "<Statistics "
518  "rxBeacons=\"" << recvBeacons << "\" "
519  "txFrames=\"" << sentFrames << "\" "
520  "txBytes=\"" << sentBytes << "\" "
521  "rxFrames=\"" << recvFrames << "\" "
522  "rxBytes=\"" << recvBytes << "\"/>" << std::endl;
523 }
524 void
525 MeshWifiInterfaceMac::Report (std::ostream & os) const
526 {
527  os << "<Interface "
528  "BeaconInterval=\"" << GetBeaconInterval ().GetSeconds () << "\" "
529  "Channel=\"" << GetFrequencyChannel () << "\" "
530  "Address = \"" << GetAddress () << "\">" << std::endl;
531  m_stats.Print (os);
532  os << "</Interface>" << std::endl;
533 }
534 void
536 {
537  m_stats = Statistics ();
538 }
539 
540 void
542 {
544  m_standard = standard;
545 
546  // We use the single DCF provided by WifiMac for the purpose of
547  // Beacon transmission. For this we need to reconfigure the channel
548  // access parameters slightly, and do so here.
549  m_dca->SetMinCw (0);
550  m_dca->SetMaxCw (0);
551  m_dca->SetAifsn (1);
552 }
555 {
556  return m_standard;
557 }
558 } // namespace ns3
559 
bool IsBeacon(void) const
Return true if the header is a Beacon header.
void AddSupportedRate(uint32_t bs)
Add the given rate to the supported rates.
keep track of time values and allow control of global simulation resolution
Definition: nstime.h:81
SupportedRates GetSupportedRates(void) const
Return the supported rates.
Definition: mgt-headers.cc:151
#define NS_LOG_FUNCTION(parameters)
Definition: log.h:345
void SetStream(int64_t stream)
Specifies the stream number for this RNG stream.
void SetQosAckPolicy(enum QosAckPolicy policy)
Set the QoS ACK policy in the QoS control field.
Hold a bool native type.
Definition: boolean.h:38
Ssid GetSsid(void) const
Return the Service Set Identifier (SSID).
Definition: mgt-headers.cc:141
Ptr< UniformRandomVariable > m_coefficient
Add randomness to beacon generation.
bool m_beaconEnable
whether beaconing is enabled
virtual uint32_t GetNModes(void) const =0
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
SupportedRates GetSupportedRates() const
WifiPhyStandard GetPhyStandard() const
EdcaQueues m_edca
This is a map from Access Category index to the corresponding channel access function.
void AddPacketTag(const Tag &tag) const
Add a packet tag.
Definition: packet.cc:841
Mac48Address GetAddr3(void) const
Return the address in the Address 3 field.
bool CheckSupportedRates(SupportedRates rates) const
virtual void DoDispose()
Real d-tor.
Mac48Address GetAddr4(void) const
Return the address in the Address 4 field.
#define NS_ASSERT(condition)
Definition: assert.h:64
void SetLinkMetricCallback(Callback< uint32_t, Mac48Address, Ptr< MeshWifiInterfaceMac > > cb)
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
uint32_t GetSize(void) const
Definition: packet.h:650
uint16_t GetChannelNumber() const
Return the current channel number.
static void Cancel(const EventId &id)
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
Definition: simulator.cc:268
void SetChannelNumber(uint16_t id)
Set the current channel number.
bool IsRunning(void) const
This method is syntactic sugar for the ns3::Simulator::isExpired method.
Definition: event-id.cc:59
Ptr< WifiPhy > m_phy
Wifi PHY.
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
Definition: simulator.h:824
void SwitchFrequencyChannel(uint16_t new_id)
Switch channel.
bool IsEqual(const Ssid &o) const
Check if the two SSIDs are equal.
Definition: ssid.cc:69
virtual Ssid GetSsid(void) const
The Supported Rates Information ElementThis class knows how to serialise and deserialise the Supporte...
Voice.
Definition: qos-utils.h:44
Best Effort.
Definition: qos-utils.h:38
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:91
WifiPhyStandard m_standard
Current PHY standard: needed to configure metric.
virtual void Enqueue(Ptr< const Packet > packet, Mac48Address to, Mac48Address from)
Time GetTbtt() const
Next beacon frame time.
#define NS_FATAL_ERROR(msg)
fatal error handling
Definition: fatal-error.h:72
void SendManagementFrame(Ptr< Packet > frame, const WifiMacHeader &hdr)
To be used by plugins sending management frames.
NS_LOG_COMPONENT_DEFINE("MeshWifiInterfaceMac")
void NotifyNavResetNow(Time duration)
Definition: dcf-manager.cc:747
void ScheduleNextBeacon()
Schedule next beacon.
virtual void DoInitialize()
This method is called only once by Object::Initialize.
uint8_t GetQosTid(void) const
Return the Traffic ID of a QoS header.
Background.
Definition: qos-utils.h:40
double GetSeconds(void) const
Definition: nstime.h:274
void ForwardUp(Ptr< Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet up to the device.
WifiPhyStandard
Identifies the PHY specification that a Wifi device is configured to use.
base class for all MAC-level wifi objects.
void SetAddr1(Mac48Address address)
Fill the Address 1 field with the given address.
void SetTypeOfStation(TypeOfStation type)
This method is invoked by a subclass to specify what type of station it is implementing.
int64_t GetMicroSeconds(void) const
Definition: nstime.h:291
hold objects of type ns3::Time
Definition: nstime.h:961
Ptr< DcaTxop > m_dca
This holds a pointer to the DCF instance for this WifiMac - used for transmission of frames to non-Qo...
void SetAddr3(Mac48Address address)
Fill the Address 3 field with the given address.
void SetAddr4(Mac48Address address)
Fill the Address 4 field with the given address.
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
Definition: qos-utils.cc:27
static Mac48Address GetBroadcast(void)
uint16_t GetFrequencyChannel() const
Current channel Id.
The aim of the QosTag is to provide means for an Application to specify the TID which will be used by...
Definition: qos-tag.h:61
virtual void FinishConfigureStandard(enum WifiPhyStandard standard)
bool GetBeaconGeneration() const
Get current beaconing status.
uint32_t GetLinkMetric(Mac48Address peerAddress)
PluginList m_plugins
List of all installed plugins.
Ptr< MacLow > m_low
MacLow (RTS, CTS, DATA, ACK etc.)
void SetBasicRate(uint32_t bs)
Set the given rate to basic rates.
Mac48Address GetMeshPointAddress() const
void SetQosTid(uint8_t tid)
Set the TID for the QoS header.
bool IsBasicRate(uint32_t bs) const
Check if the given rate is a basic rate.
virtual bool SupportsSendFrom() const
Ptr< Packet > Copy(void) const
Definition: packet.cc:122
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
Definition: packet.cc:277
Mac48Address m_mpAddress
Mesh point address.
virtual void SetLinkUpCallback(Callback< void > linkUp)
virtual void DoDispose()
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
OFDM PHY for the 5 GHz band (Clause 17)
802.11 PHY layer modelThis PHY implements a model of 802.11a.
Definition: yans-wifi-phy.h:64
void SetAddr2(Mac48Address address)
Fill the Address 2 field with the given address.
DcfManager * m_dcfManager
DCF manager (access to channel)
double GetValue(double min, double max)
Returns a random double from the uniform distribution with the specified range.
Time m_beaconInterval
Beaconing interval.
an EUI-48 address
Definition: mac48-address.h:41
virtual WifiMode GetMode(uint32_t mode) const =0
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
void Receive(Ptr< Packet > packet, WifiMacHeader const *hdr)
Frame receive handler.
static Time Now(void)
Return the "current simulation time".
Definition: simulator.cc:180
Time m_randomStart
Maximum delay before first beacon.
Beacon is beacon header + list of arbitrary information elements.
static TypeId GetTypeId()
Never forget to support typeid.
virtual void SetLinkUpCallback(Callback< void > linkUp)
Callback< uint32_t, Mac48Address, Ptr< MeshWifiInterfaceMac > > m_linkMetricCallback
void SetQosTxopLimit(uint8_t txop)
Set TXOP limit in the QoS control field.
void ForwardDown(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
Send frame.
bool IsData(void) const
Return true if the Type is DATA.
void SetRandomStartDelay(Time interval)
Set maximum initial random delay before first beacon.
void InstallPlugin(Ptr< MeshWifiInterfaceMacPlugin > plugin)
Install plugin.
bool IsQosData(void) const
Return true if the Type is DATA and Subtype is one of the possible values for QoS DATA...
bool RemovePacketTag(Tag &tag)
Remove a packet tag.
Definition: packet.cc:848
#define NS_LOG_DEBUG(msg)
Definition: log.h:289
virtual Mac48Address GetAddress(void) const
void SetTypeData(void)
Set Type/Subtype values for a data packet with no subtype equal to 0.
void SetQosNoAmsdu(void)
Set that A-MSDU is not present.
void Report(std::ostream &) const
Statistics:
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::cancel method.
Definition: event-id.cc:47
void SetDsTo(void)
Set the To DS bit in the Frame Control field.
void SetBeaconGeneration(bool enable)
Enable/disable beacons.
bool IsSupportedRate(uint32_t bs) const
Check if the given rate is supported.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:452
EventId m_beaconSendEvent
"Timer" for the next beacon
void SetDsFrom(void)
Set the From DS bit in the Frame Control field.
void SetBeaconInterval(Time interval)
Set interval between two successive beacons.
void SetType(enum WifiMacType type)
Set Type/Subtype values with the correct values depending on the given type.
Time m_tbtt
Time for the next frame.
Mac48Address GetAddr1(void) const
Return the address in the Address 1 field.
void ShiftTbtt(Time shift)
Shift TBTT.
Ptr< WifiRemoteStationManager > m_stationManager
Remote station manager (rate control, RTS/CTS/fragmentation thresholds etc.)
void SetQosNoEosp()
Un-set the end of service period (EOSP) bit in the QoS control field.
Hold a floating point type.
Definition: double.h:41
void SetAttribute(std::string name, const AttributeValue &value)
Definition: object-base.cc:161
Ptr< T > GetObject(void) const
Definition: object.h:361
a unique identifier for an interface.
Definition: type-id.h:49
uint64_t GetDataRate(void) const
Definition: wifi-mode.cc:79
TypeId SetParent(TypeId tid)
Definition: type-id.cc:611
uint8_t GetTid(void) const
Return the Type ID.
Definition: qos-tag.cc:89
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:35
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
Implement the header for management frames of type beacon.
Definition: mgt-headers.h:321
virtual void SetParent(Ptr< MeshWifiInterfaceMac > parent)=0
Each plugin must be installed on interface to work.
Implements the IEEE 802.11 MAC header.
Mac48Address GetAddr2(void) const
Return the address in the Address 2 field.
virtual void FinishConfigureStandard(enum WifiPhyStandard standard)