A Discrete-Event Network Simulator
API
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 namespace ns3 {
40 
41 NS_LOG_COMPONENT_DEFINE ("MeshWifiInterfaceMac");
42 
43 NS_OBJECT_ENSURE_REGISTERED (MeshWifiInterfaceMac);
44 
45 TypeId
47 {
48  static TypeId tid = TypeId ("ns3::MeshWifiInterfaceMac")
50  .SetGroupName ("Mesh")
51  .AddConstructor<MeshWifiInterfaceMac> ()
52  .AddAttribute ( "BeaconInterval",
53  "Beacon Interval",
54  TimeValue (Seconds (0.5)),
55 
59  )
60  .AddAttribute ( "RandomStart",
61  "Window when beacon generating starts (uniform random) in seconds",
62  TimeValue (Seconds (0.5)),
66  )
67  .AddAttribute ( "BeaconGeneration",
68  "Enable/Disable Beaconing.",
69  BooleanValue (true),
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 {
133  NS_LOG_FUNCTION (this);
135  if (m_beaconEnable)
136  {
137  Time randomStart = Seconds (m_coefficient->GetValue ());
138  // Now start sending beacons after some random delay (to avoid collisions)
141  m_tbtt = Simulator::Now () + randomStart;
142  }
143  else
144  {
145  // stop sending beacons
147  }
148 }
149 
150 int64_t
152 {
153  NS_LOG_FUNCTION (this << stream);
154  int64_t currentStream = stream;
155  m_coefficient->SetStream (currentStream++);
156  for (PluginList::const_iterator i = m_plugins.begin (); i < m_plugins.end (); i++)
157  {
158  currentStream += (*i)->AssignStreams (currentStream);
159  }
160  return (currentStream - stream);
161 }
162 
163 //-----------------------------------------------------------------------------
164 // Plugins
165 //-----------------------------------------------------------------------------
166 void
168 {
169  NS_LOG_FUNCTION (this);
170 
171  plugin->SetParent (this);
172  m_plugins.push_back (plugin);
173 }
174 //-----------------------------------------------------------------------------
175 // Switch channels
176 //-----------------------------------------------------------------------------
177 uint16_t
179 {
180  NS_LOG_FUNCTION (this);
181  NS_ASSERT (m_phy != 0); // need PHY to set/get channel
182 
184  if (phy != 0)
185  {
186  return phy->GetChannelNumber ();
187  }
188  else
189  {
190  return 0;
191  }
192 }
193 void
195 {
196  NS_LOG_FUNCTION (this);
197  NS_ASSERT (m_phy != 0); // need PHY to set/get channel
210  phy->SetChannelNumber (new_id);
211  // Don't know NAV on new channel
213 }
214 //-----------------------------------------------------------------------------
215 // Forward frame down
216 //-----------------------------------------------------------------------------
217 void
219 {
220  // copy packet to allow modifications
221  Ptr<Packet> packet = const_packet->Copy ();
222  WifiMacHeader hdr;
223  hdr.SetTypeData ();
224  hdr.SetAddr2 (GetAddress ());
225  hdr.SetAddr3 (to);
226  hdr.SetAddr4 (from);
227  hdr.SetDsFrom ();
228  hdr.SetDsTo ();
229  // Fill QoS fields:
231  hdr.SetQosNoEosp ();
232  hdr.SetQosNoAmsdu ();
233  hdr.SetQosTxopLimit (0);
234  // Address 1 is unknwon here. Routing plugin is responsible to correctly set it.
235  hdr.SetAddr1 (Mac48Address ());
236  // Filter packet through all installed plugins
237  for (PluginList::const_iterator i = m_plugins.end () - 1; i != m_plugins.begin () - 1; i--)
238  {
239  bool drop = !((*i)->UpdateOutcomingFrame (packet, hdr, from, to));
240  if (drop)
241  {
242  return; // plugin drops frame
243  }
244  }
245  // Assert that address1 is set. Assert will fail e.g. if there is no installed routing plugin.
246  NS_ASSERT (hdr.GetAddr1 () != Mac48Address ());
247  // Queue frame
248  if (m_stationManager->IsBrandNew (hdr.GetAddr1 ()))
249  {
250  // in adhoc mode, we assume that every destination
251  // supports all the rates we support.
252  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
253  {
255  }
257  }
258  //Classify: application sets a tag, which is removed here
259  // Get Qos tag:
260  AcIndex ac = AC_BE;
261  QosTag tag;
262  if (packet->RemovePacketTag (tag))
263  {
265  hdr.SetQosTid (tag.GetTid ());
266  //Aftre setting type DsFrom and DsTo fields are reset.
267  hdr.SetDsFrom ();
268  hdr.SetDsTo ();
269  ac = QosUtilsMapTidToAc (tag.GetTid ());
270  }
272  m_stats.sentBytes += packet->GetSize ();
273  NS_ASSERT (m_edca.find (ac) != m_edca.end ());
274  m_edca[ac]->Queue (packet, hdr);
275 }
276 void
278 {
279  //Filter management frames:
280  WifiMacHeader header = hdr;
281  for (PluginList::const_iterator i = m_plugins.end () - 1; i != m_plugins.begin () - 1; i--)
282  {
283  bool drop = !((*i)->UpdateOutcomingFrame (packet, header, Mac48Address (), Mac48Address ()));
284  if (drop)
285  {
286  return; // plugin drops frame
287  }
288  }
290  m_stats.sentBytes += packet->GetSize ();
291  if ((m_edca.find (AC_VO) == m_edca.end ()) || (m_edca.find (AC_BK) == m_edca.end ()))
292  {
293  NS_FATAL_ERROR ("Voice or Background queue is not set up!");
294  }
295  /*
296  * When we send a management frame - it is better to enqueue it to
297  * priority queue. But when we send a broadcast management frame,
298  * like PREQ, little MinCw value may cause collisions during
299  * retransmissions (two neighbor stations may choose the same window
300  * size, and two packets will be collided). So, broadcast management
301  * frames go to BK queue.
302  */
303  if (hdr.GetAddr1 () != Mac48Address::GetBroadcast ())
304  {
305  m_edca[AC_VO]->Queue (packet, header);
306  }
307  else
308  {
309  m_edca[AC_BK]->Queue (packet, header);
310  }
311 }
314 {
315  // set the set of supported rates and make sure that we indicate
316  // the Basic Rate set in this set of supported rates.
317  SupportedRates rates;
318  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
319  {
320  WifiMode mode = m_phy->GetMode (i);
321  rates.AddSupportedRate (mode.GetDataRate ());
322  }
323  // set the basic rates
324  for (uint32_t j = 0; j < m_stationManager->GetNBasicModes (); j++)
325  {
327  rates.SetBasicRate (mode.GetDataRate ());
328  }
329  return rates;
330 }
331 bool
333 {
334  for (uint32_t i = 0; i < m_stationManager->GetNBasicModes (); i++)
335  {
337  if (!rates.IsSupportedRate (mode.GetDataRate ()))
338  {
339  return false;
340  }
341  }
342  return true;
343 }
344 //-----------------------------------------------------------------------------
345 // Beacons
346 //-----------------------------------------------------------------------------
347 void
349 {
350  NS_LOG_FUNCTION (this << interval);
351  m_randomStart = interval;
352 }
353 void
355 {
356  NS_LOG_FUNCTION (this << interval);
357  m_beaconInterval = interval;
358 }
359 Time
361 {
362  return m_beaconInterval;
363 }
364 void
366 {
367  NS_LOG_FUNCTION (this << enable);
368  m_beaconEnable = enable;
369 }
370 bool
372 {
373  return m_beaconSendEvent.IsRunning ();
374 }
375 Time
377 {
378  return m_tbtt;
379 }
380 void
382 {
383  // User of ShiftTbtt () must take care don't shift it to the past
384  NS_ASSERT (GetTbtt () + shift > Simulator::Now ());
385 
386  m_tbtt += shift;
387  // Shift scheduled event
390  this);
391 }
392 void
394 {
397 }
398 void
400 {
401  NS_LOG_FUNCTION (this);
402  NS_LOG_DEBUG (GetAddress () << " is sending beacon");
403 
405 
406  // Form & send beacon
408 
409  // Ask all plugins to add their specific information elements to beacon
410  for (PluginList::const_iterator i = m_plugins.begin (); i != m_plugins.end (); ++i)
411  {
412  (*i)->UpdateBeacon (beacon);
413  }
414  m_dca->Queue (beacon.CreatePacket (), beacon.CreateHeader (GetAddress (), GetMeshPointAddress ()));
415 
417 }
418 void
420 {
421  // Process beacon
422  if ((hdr->GetAddr1 () != GetAddress ()) && (hdr->GetAddr1 () != Mac48Address::GetBroadcast ()))
423  {
424  return;
425  }
426  if (hdr->IsBeacon ())
427  {
429  MgtBeaconHeader beacon_hdr;
430 
431  packet->PeekHeader (beacon_hdr);
432 
433  NS_LOG_DEBUG ("Beacon received from " << hdr->GetAddr2 () << " I am " << GetAddress () << " at "
434  << Simulator::Now ().GetMicroSeconds () << " microseconds");
435 
436  // update supported rates
437  if (beacon_hdr.GetSsid ().IsEqual (GetSsid ()))
438  {
439  SupportedRates rates = beacon_hdr.GetSupportedRates ();
440 
441  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
442  {
443  WifiMode mode = m_phy->GetMode (i);
444  if (rates.IsSupportedRate (mode.GetDataRate ()))
445  {
446  m_stationManager->AddSupportedMode (hdr->GetAddr2 (), mode);
447  if (rates.IsBasicRate (mode.GetDataRate ()))
448  {
450  }
451  }
452  }
453  }
454  }
455  else
456  {
457  m_stats.recvBytes += packet->GetSize ();
459  }
460  // Filter frame through all installed plugins
461  for (PluginList::iterator i = m_plugins.begin (); i != m_plugins.end (); ++i)
462  {
463  bool drop = !((*i)->Receive (packet, *hdr));
464  if (drop)
465  {
466  return; // plugin drops frame
467  }
468  }
469  // Check if QoS tag exists and add it:
470  if (hdr->IsQosData ())
471  {
472  packet->AddPacketTag (QosTag (hdr->GetQosTid ()));
473  }
474  // Forward data up
475  if (hdr->IsData ())
476  {
477  ForwardUp (packet, hdr->GetAddr4 (), hdr->GetAddr3 ());
478  }
479 
480  // We don't bother invoking RegularWifiMac::Receive() here, because
481  // we've explicitly handled all the frames we care about. This is in
482  // contrast to most classes which derive from RegularWifiMac.
483 }
484 uint32_t
486 {
487  uint32_t metric = 1;
488  if (!m_linkMetricCallback.IsNull ())
489  {
490  metric = m_linkMetricCallback (peerAddress, this);
491  }
492  return metric;
493 }
494 void
496 {
498 }
499 void
501 {
502  m_mpAddress = a;
503 }
506 {
507  return m_mpAddress;
508 }
509 //Statistics:
511  recvBeacons (0), sentFrames (0), sentBytes (0), recvFrames (0), recvBytes (0)
512 {
513 }
514 void
516 {
517  os << "<Statistics "
519  "rxBeacons=\"" << recvBeacons << "\" "
520  "txFrames=\"" << sentFrames << "\" "
521  "txBytes=\"" << sentBytes << "\" "
522  "rxFrames=\"" << recvFrames << "\" "
523  "rxBytes=\"" << recvBytes << "\"/>" << std::endl;
524 }
525 void
526 MeshWifiInterfaceMac::Report (std::ostream & os) const
527 {
528  os << "<Interface "
529  "BeaconInterval=\"" << GetBeaconInterval ().GetSeconds () << "\" "
530  "Channel=\"" << GetFrequencyChannel () << "\" "
531  "Address = \"" << GetAddress () << "\">" << std::endl;
532  m_stats.Print (os);
533  os << "</Interface>" << std::endl;
534 }
535 void
537 {
538  m_stats = Statistics ();
539 }
540 
541 void
543 {
545  m_standard = standard;
546 
547  // We use the single DCF provided by WifiMac for the purpose of
548  // Beacon transmission. For this we need to reconfigure the channel
549  // access parameters slightly, and do so here.
550  m_dca->SetMinCw (0);
551  m_dca->SetMaxCw (0);
552  m_dca->SetAifsn (1);
553 }
556 {
557  return m_standard;
558 }
559 } // namespace ns3
560 
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.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
SupportedRates GetSupportedRates(void) const
Return the supported rates.
Definition: mgt-headers.cc:150
uint16_t GetChannelNumber(void) const
Return the current channel number.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
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.
AttributeValue implementation for Boolean.
Definition: boolean.h:34
Ssid GetSsid(void) const
Return the Service Set Identifier (SSID).
Definition: mgt-headers.cc:140
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:44
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
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: boolean.h:81
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:836
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)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:67
void SetLinkMetricCallback(Callback< uint32_t, Mac48Address, Ptr< MeshWifiInterfaceMac > > cb)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:766
#define NS_FATAL_ERROR(msg)
Fatal error handling.
Definition: fatal-error.h:100
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:311
void SetChannelNumber(uint16_t id)
Set the current channel number.
bool IsRunning(void) const
This method is syntactic sugar for !IsExpired().
Definition: event-id.cc:65
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:819
bool IsBrandNew(Mac48Address address) const
Return whether the station state is brand new.
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:93
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.
void SendManagementFrame(Ptr< Packet > frame, const WifiMacHeader &hdr)
To be used by plugins sending management frames.
void RecordDisassociated(Mac48Address address)
Records that the STA was disassociated.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:446
void NotifyNavResetNow(Time duration)
Definition: dcf-manager.cc:821
void ScheduleNextBeacon()
Schedule next beacon.
virtual void DoInitialize()
Initialize() implementation.
uint8_t GetQosTid(void) const
Return the Traffic ID of a QoS header.
Background.
Definition: qos-utils.h:40
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:334
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
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:342
AttributeValue implementation for Time.
Definition: nstime.h:928
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.
WifiMode GetBasicMode(uint32_t i) const
Return a basic mode from the set of basic modes.
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
Definition: qos-utils.cc:27
static Mac48Address GetBroadcast(void)
Mac48Address GetAddress(void) const
Return the MAC address of this MacLow.
Definition: mac-low.cc:599
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
performs a COW copy of the packet.
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()
Destructor implementation.
OFDM PHY for the 5 GHz band (Clause 17)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
802.11 PHY layer modelThis PHY implements a model of 802.11a.
Definition: yans-wifi-phy.h:64
void AddSupportedMode(Mac48Address address, WifiMode mode)
Invoked in a STA or AP to store the set of modes supported by a destination which is also supported l...
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
void SetAddr2(Mac48Address address)
Fill the Address 2 field with the given address.
DcfManager * m_dcfManager
DCF manager (access to channel)
void AddBasicMode(WifiMode mode)
Invoked in a STA upon association to store the set of rates which belong to the BSSBasicRateSet of th...
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:43
virtual WifiMode GetMode(uint32_t mode) const =0
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: nstime.h:929
void Receive(Ptr< Packet > packet, WifiMacHeader const *hdr)
Frame receive handler.
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:223
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
uint32_t GetNBasicModes(void) const
Return the number of basic modes we support.
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:843
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:236
virtual Mac48Address GetAddress(void) const
void SetTypeData(void)
Set Type/Subtype values for a data packet with no subtype equal to 0.
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:866
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:53
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.
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.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
Definition: double.h:41
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:190
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:455
a unique identifier for an interface.
Definition: type-id.h:57
uint64_t GetDataRate(void) const
Definition: wifi-mode.cc:79
TypeId SetParent(TypeId tid)
Definition: type-id.cc:638
uint8_t GetTid(void) const
Return the Type ID.
Definition: qos-tag.cc:89
Basic MAC of mesh point Wi-Fi interface.
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)