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/random-variable-stream.h"
27 #include "ns3/simulator.h"
28 #include "ns3/yans-wifi-phy.h"
29 #include "ns3/wifi-utils.h"
30 #include "ns3/pointer.h"
31 #include "ns3/double.h"
32 #include "ns3/trace-source-accessor.h"
33 #include "ns3/socket.h"
34 #include "ns3/wifi-net-device.h"
35 #include "ns3/channel-access-manager.h"
36 
37 namespace ns3 {
38 
39 NS_LOG_COMPONENT_DEFINE ("MeshWifiInterfaceMac");
40 
41 NS_OBJECT_ENSURE_REGISTERED (MeshWifiInterfaceMac);
42 
43 TypeId
45 {
46  static TypeId tid = TypeId ("ns3::MeshWifiInterfaceMac")
48  .SetGroupName ("Mesh")
49  .AddConstructor<MeshWifiInterfaceMac> ()
50  .AddAttribute ( "BeaconInterval",
51  "Beacon Interval",
52  TimeValue (Seconds (0.5)),
53 
57  )
58  .AddAttribute ( "RandomStart",
59  "Window when beacon generating starts (uniform random) in seconds",
60  TimeValue (Seconds (0.5)),
64  )
65  .AddAttribute ( "BeaconGeneration",
66  "Enable/Disable Beaconing.",
67  BooleanValue (true),
71  )
72  ;
73  return tid;
74 }
76  : m_standard (WIFI_STANDARD_80211a)
77 {
78  NS_LOG_FUNCTION (this);
79 
80  // Let the lower layers know that we are acting as a mesh node
82  m_coefficient = CreateObject<UniformRandomVariable> ();
83 }
85 {
86  NS_LOG_FUNCTION (this);
87 }
88 //-----------------------------------------------------------------------------
89 // WifiMac inherited
90 //-----------------------------------------------------------------------------
91 void
93 {
94  NS_LOG_FUNCTION (this << packet << to << from);
95  ForwardDown (packet, from, to);
96 }
97 void
99 {
100  NS_LOG_FUNCTION (this << packet << to);
101  ForwardDown (packet, GetAddress (), to);
102 }
103 bool
105 {
106  return true;
107 }
108 void
110 {
111  NS_LOG_FUNCTION (this);
113 
114  // The approach taken here is that, from the point of view of a mesh
115  // node, the link is always up, so we immediately invoke the
116  // callback if one is set
117  linkUp ();
118 }
119 void
121 {
122  NS_LOG_FUNCTION (this);
123  m_plugins.clear ();
125 
127 }
128 void
130 {
131  NS_LOG_FUNCTION (this);
133  if (m_beaconEnable)
134  {
135  Time randomStart = Seconds (m_coefficient->GetValue ());
136  // Now start sending beacons after some random delay (to avoid collisions)
139  m_tbtt = Simulator::Now () + randomStart;
140  }
141  else
142  {
143  // stop sending beacons
145  }
146 }
147 
148 int64_t
150 {
151  NS_LOG_FUNCTION (this << stream);
152  int64_t currentStream = stream;
153  m_coefficient->SetStream (currentStream++);
154  for (PluginList::const_iterator i = m_plugins.begin (); i < m_plugins.end (); i++)
155  {
156  currentStream += (*i)->AssignStreams (currentStream);
157  }
158  return (currentStream - stream);
159 }
160 
161 //-----------------------------------------------------------------------------
162 // Plugins
163 //-----------------------------------------------------------------------------
164 void
166 {
167  NS_LOG_FUNCTION (this);
168 
169  plugin->SetParent (this);
170  m_plugins.push_back (plugin);
171 }
172 //-----------------------------------------------------------------------------
173 // Switch channels
174 //-----------------------------------------------------------------------------
175 uint16_t
177 {
178  NS_LOG_FUNCTION (this);
179  NS_ASSERT (m_phy != 0); // need PHY to set/get channel
180  return m_phy->GetChannelNumber ();
181 }
182 
183 void
185 {
186  NS_LOG_FUNCTION (this);
187  NS_ASSERT (m_phy != 0); // need PHY to set/get channel
199  m_phy->SetChannelNumber (new_id);
200  // Don't know NAV on new channel
201  m_channelAccessManager->NotifyNavResetNow (Seconds (0));
202 }
203 //-----------------------------------------------------------------------------
204 // Forward frame down
205 //-----------------------------------------------------------------------------
206 void
208 {
209  WifiMacHeader hdr;
211  hdr.SetAddr2 (GetAddress ());
212  hdr.SetAddr3 (to);
213  hdr.SetAddr4 (from);
214  hdr.SetDsFrom ();
215  hdr.SetDsTo ();
216  // Fill QoS fields:
218  hdr.SetQosNoEosp ();
219  hdr.SetQosNoAmsdu ();
220  hdr.SetQosTxopLimit (0);
221  // Address 1 is unknown here. Routing plugin is responsible to correctly set it.
222  hdr.SetAddr1 (Mac48Address ());
223  // Filter packet through all installed plugins
224  for (PluginList::const_iterator i = m_plugins.end () - 1; i != m_plugins.begin () - 1; i--)
225  {
226  bool drop = !((*i)->UpdateOutcomingFrame (packet, hdr, from, to));
227  if (drop)
228  {
229  return; // plugin drops frame
230  }
231  }
232  // Assert that address1 is set. Assert will fail e.g. if there is no installed routing plugin.
233  NS_ASSERT (hdr.GetAddr1 () != Mac48Address ());
234  // Queue frame
235  if (m_stationManager->IsBrandNew (hdr.GetAddr1 ()))
236  {
237  // in adhoc mode, we assume that every destination
238  // supports all the rates we support.
239  for (const auto & mode : m_phy->GetModeList ())
240  {
242  }
244  }
245  // Classify: application may have set a tag, which is removed here
246  AcIndex ac;
247  SocketPriorityTag tag;
248  if (packet->RemovePacketTag (tag))
249  {
250  hdr.SetQosTid (tag.GetPriority ());
251  ac = QosUtilsMapTidToAc (tag.GetPriority ());
252  }
253  else
254  {
255  // No tag found; set to best effort
256  ac = AC_BE;
257  hdr.SetQosTid (0);
258  }
260  m_stats.sentBytes += packet->GetSize ();
261  NS_ASSERT (m_edca.find (ac) != m_edca.end ());
262  m_edca[ac]->Queue (packet, hdr);
263 }
264 void
266 {
267  //Filter management frames:
268  WifiMacHeader header = hdr;
269  for (PluginList::const_iterator i = m_plugins.end () - 1; i != m_plugins.begin () - 1; i--)
270  {
271  bool drop = !((*i)->UpdateOutcomingFrame (packet, header, Mac48Address (), Mac48Address ()));
272  if (drop)
273  {
274  return; // plugin drops frame
275  }
276  }
278  m_stats.sentBytes += packet->GetSize ();
279  if ((m_edca.find (AC_VO) == m_edca.end ()) || (m_edca.find (AC_BK) == m_edca.end ()))
280  {
281  NS_FATAL_ERROR ("Voice or Background queue is not set up!");
282  }
283  /*
284  * When we send a management frame - it is better to enqueue it to
285  * priority queue. But when we send a broadcast management frame,
286  * like PREQ, little MinCw value may cause collisions during
287  * retransmissions (two neighbor stations may choose the same window
288  * size, and two packets will be collided). So, broadcast management
289  * frames go to BK queue.
290  */
291  if (hdr.GetAddr1 () != Mac48Address::GetBroadcast ())
292  {
293  m_edca[AC_VO]->Queue (packet, header);
294  }
295  else
296  {
297  m_edca[AC_BK]->Queue (packet, header);
298  }
299 }
302 {
303  // set the set of supported rates and make sure that we indicate
304  // the Basic Rate set in this set of supported rates.
305  SupportedRates rates;
306  for (const auto & mode : m_phy->GetModeList ())
307  {
308  uint16_t gi = ConvertGuardIntervalToNanoSeconds (mode, DynamicCast<WifiNetDevice> (m_phy->GetDevice ()));
309  rates.AddSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), gi, 1));
310  }
311  // set the basic rates
312  for (uint32_t j = 0; j < m_stationManager->GetNBasicModes (); j++)
313  {
315  uint16_t gi = ConvertGuardIntervalToNanoSeconds (mode, DynamicCast<WifiNetDevice> (m_phy->GetDevice ()));
316  rates.SetBasicRate (mode.GetDataRate (m_phy->GetChannelWidth (), gi, 1));
317  }
318  return rates;
319 }
320 bool
322 {
323  for (uint32_t i = 0; i < m_stationManager->GetNBasicModes (); i++)
324  {
326  uint16_t gi = ConvertGuardIntervalToNanoSeconds (mode, DynamicCast<WifiNetDevice> (m_phy->GetDevice ()));
327  if (!rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), gi, 1)))
328  {
329  return false;
330  }
331  }
332  return true;
333 }
334 //-----------------------------------------------------------------------------
335 // Beacons
336 //-----------------------------------------------------------------------------
337 void
339 {
340  NS_LOG_FUNCTION (this << interval);
341  m_randomStart = interval;
342 }
343 void
345 {
346  NS_LOG_FUNCTION (this << interval);
347  m_beaconInterval = interval;
348 }
349 Time
351 {
352  return m_beaconInterval;
353 }
354 void
356 {
357  NS_LOG_FUNCTION (this << enable);
358  m_beaconEnable = enable;
359 }
360 bool
362 {
363  return m_beaconSendEvent.IsRunning ();
364 }
365 Time
367 {
368  return m_tbtt;
369 }
370 void
372 {
373  // User of ShiftTbtt () must take care don't shift it to the past
374  NS_ASSERT (GetTbtt () + shift > Simulator::Now ());
375 
376  m_tbtt += shift;
377  // Shift scheduled event
380  this);
381 }
382 void
384 {
387 }
388 void
390 {
391  NS_LOG_FUNCTION (this);
392  NS_LOG_DEBUG (GetAddress () << " is sending beacon");
393 
395 
396  // Form & send beacon
398 
399  // Ask all plugins to add their specific information elements to beacon
400  for (PluginList::const_iterator i = m_plugins.begin (); i != m_plugins.end (); ++i)
401  {
402  (*i)->UpdateBeacon (beacon);
403  }
404  m_txop->Queue (beacon.CreatePacket (), beacon.CreateHeader (GetAddress (), GetMeshPointAddress ()));
405 
407 }
408 void
410 {
411  const WifiMacHeader* hdr = &mpdu->GetHeader ();
412  Ptr<Packet> packet = mpdu->GetPacket ()->Copy ();
413  // Process beacon
414  if ((hdr->GetAddr1 () != GetAddress ()) && (hdr->GetAddr1 () != Mac48Address::GetBroadcast ()))
415  {
416  return;
417  }
418  if (hdr->IsBeacon ())
419  {
421  MgtBeaconHeader beacon_hdr;
422 
423  packet->PeekHeader (beacon_hdr);
424 
425  NS_LOG_DEBUG ("Beacon received from " << hdr->GetAddr2 () << " I am " << GetAddress () << " at "
426  << Simulator::Now ().GetMicroSeconds () << " microseconds");
427 
428  // update supported rates
429  if (beacon_hdr.GetSsid ().IsEqual (GetSsid ()))
430  {
431  SupportedRates rates = beacon_hdr.GetSupportedRates ();
432 
433  for (const auto & mode : m_phy->GetModeList ())
434  {
435  uint16_t gi = ConvertGuardIntervalToNanoSeconds (mode, DynamicCast<WifiNetDevice> (m_phy->GetDevice ()));
436  uint64_t rate = mode.GetDataRate (m_phy->GetChannelWidth (), gi, 1);
437  if (rates.IsSupportedRate (rate))
438  {
439  m_stationManager->AddSupportedMode (hdr->GetAddr2 (), mode);
440  if (rates.IsBasicRate (rate))
441  {
443  }
444  }
445  }
446  }
447  }
448  else
449  {
450  m_stats.recvBytes += packet->GetSize ();
452  }
453  // Filter frame through all installed plugins
454  for (PluginList::iterator i = m_plugins.begin (); i != m_plugins.end (); ++i)
455  {
456  bool drop = !((*i)->Receive (packet, *hdr));
457  if (drop)
458  {
459  return; // plugin drops frame
460  }
461  }
462  // Check if QoS tag exists and add it:
463  if (hdr->IsQosData ())
464  {
465  SocketPriorityTag priorityTag;
466  priorityTag.SetPriority (hdr->GetQosTid ());
467  packet->ReplacePacketTag (priorityTag);
468  }
469  // Forward data up
470  if (hdr->IsData ())
471  {
472  ForwardUp (packet, hdr->GetAddr4 (), hdr->GetAddr3 ());
473  }
474 
475  // We don't bother invoking RegularWifiMac::Receive() here, because
476  // we've explicitly handled all the frames we care about. This is in
477  // contrast to most classes which derive from RegularWifiMac.
478 }
479 uint32_t
481 {
482  uint32_t metric = 1;
483  if (!m_linkMetricCallback.IsNull ())
484  {
485  metric = m_linkMetricCallback (peerAddress, this);
486  }
487  return metric;
488 }
489 void
491 {
493 }
494 void
496 {
497  m_mpAddress = a;
498 }
501 {
502  return m_mpAddress;
503 }
504 //Statistics:
506  : recvBeacons (0),
507  sentFrames (0),
508  sentBytes (0),
509  recvFrames (0),
510  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_txop->SetMinCw (0);
550  m_txop->SetMaxCw (0);
551  m_txop->SetAifsn (1);
552 }
553 } // namespace ns3
554 
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition: simulator.h:557
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
#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 the RngStream.
AttributeValue implementation for Boolean.
Definition: boolean.h:36
bool GetBeaconGeneration() const
Get current beaconing status.
Ptr< Txop > m_txop
This holds a pointer to the TXOP instance for this WifiMac - used for transmission of frames to non-Q...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:852
Ptr< UniformRandomVariable > m_coefficient
Add randomness to beacon generation.
bool m_beaconEnable
whether beaconing is enabled
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:57
bool IsSupportedRate(uint64_t bs) const
Check if the given rate is supported.
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:85
EdcaQueues m_edca
This is a map from Access Category index to the corresponding channel access function.
void SetBasicRate(uint64_t bs)
Set the given rate to basic rates.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:380
std::list< WifiMode > GetModeList(void) const
The WifiPhy::GetModeList() method is used (e.g., by a WifiRemoteStationManager) to determine the set ...
Definition: wifi-phy.cc:2000
uint8_t GetPriority(void) const
Get the tag&#39;s priority.
Definition: socket.cc:848
virtual void DoDispose()
Real d-tor.
Mac48Address GetAddr1(void) const
Return the address in the Address 1 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 Report(std::ostream &) const
Statistics:
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:205
Time GetTbtt() const
Next beacon frame time.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
static void Cancel(const EventId &id)
Set the cancel bit on this event: the event&#39;s associated function will not be invoked when it expires...
Definition: simulator.cc:268
virtual void Enqueue(Ptr< Packet > packet, Mac48Address to, Mac48Address from)
bool IsBasicRate(uint64_t bs) const
Check if the given rate is a basic rate.
Ptr< WifiPhy > m_phy
Wifi PHY.
Ptr< ChannelAccessManager > m_channelAccessManager
channel access manager
void SwitchFrequencyChannel(uint16_t new_id)
Switch frequency channel.
The Supported Rates Information ElementThis class knows how to serialise and deserialise the Supporte...
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:47
void AddSupportedRate(uint64_t bs)
Add the given rate to the supported rates.
void Print(std::ostream &os) const
Print statistics.
void ResetStats()
Reset statistics.
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.
uint16_t GetChannelWidth(void) const
Definition: wifi-phy.cc:1233
void ScheduleNextBeacon()
Schedule next beacon.
virtual void DoInitialize()
Initialize() implementation.
base class for all MAC-level wifi objects.
const WifiMacHeader & GetHeader(void) const
Get the header stored in this item.
Mac48Address GetMeshPointAddress() const
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.
AttributeValue implementation for Time.
Definition: nstime.h:1353
void SetAddr3(Mac48Address address)
Fill the Address 3 field with the given address.
bool IsBeacon(void) const
Return true if the header is a Beacon header.
void SetAddr4(Mac48Address address)
Fill the Address 4 field with the given address.
virtual bool SupportsSendFrom() const
SupportedRates GetSupportedRates(void) const
Return the supported rates.
Definition: mgt-headers.cc:214
bool ReplacePacketTag(Tag &tag)
Replace the value of a packet tag.
Definition: packet.cc:970
uint16_t ConvertGuardIntervalToNanoSeconds(WifiMode mode, const Ptr< WifiNetDevice > device)
Convert the guard interval to nanoseconds based on the WifiMode.
Definition: wifi-utils.cc:59
Mac48Address GetAddr3(void) const
Return the address in the Address 3 field.
indicates whether the socket has a priority set.
Definition: socket.h:1307
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
Definition: qos-utils.cc:53
uint8_t GetQosTid(void) const
Return the Traffic ID of a QoS header.
Best Effort.
Definition: qos-utils.h:60
static Mac48Address GetBroadcast(void)
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
Definition: packet.cc:290
void ForwardDown(Ptr< Packet > packet, Mac48Address from, Mac48Address to)
Send frame.
uint32_t GetLinkMetric(Mac48Address peerAddress)
PluginList m_plugins
List of all installed plugins.
Mac48Address GetAddr2(void) const
Return the address in the Address 2 field.
void SetQosTid(uint8_t tid)
Set the TID for the QoS header.
Mac48Address GetAddr4(void) const
Return the address in the Address 4 field.
WifiStandard m_standard
Current standard: needed to configure metric.
int64_t GetMicroSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:388
SupportedRates GetSupportedRates() const
Ptr< const Packet > GetPacket(void) const
Get the packet stored in this item.
Mac48Address m_mpAddress
Mesh point address.
void SetLinkUpCallback(Callback< void > linkUp)
virtual void DoDispose()
Destructor implementation.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
WifiStandard
Identifies the allowed configurations that a Wifi device is configured to use.
bool IsData(void) const
Return true if the Type is DATA.
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...
Background.
Definition: qos-utils.h:62
void SetAddr2(Mac48Address address)
Fill the Address 2 field with the given address.
void AddBasicMode(WifiMode mode)
Invoked in a STA upon association to store the set of rates which belong to the BSSBasicRateSet of th...
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
Definition: packet.cc:121
double GetValue(double min, double max)
Get the next random value, as a double in the specified range .
Time m_beaconInterval
Beaconing interval.
an EUI-48 address
Definition: mac48-address.h:43
Ssid GetSsid(void) const
virtual void SetChannelNumber(uint8_t id)
Set channel number.
Definition: wifi-phy.cc:1174
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:1354
uint8_t GetChannelNumber(void) const
Return current channel number.
Definition: wifi-phy.cc:1199
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:195
Ssid GetSsid(void) const
Return the Service Set Identifier (SSID).
Definition: mgt-headers.cc:202
Time m_randomStart
Maximum delay before first beacon.
Beacon is beacon header + list of arbitrary information elements.
static TypeId GetTypeId()
Get the type ID.
virtual void SetLinkUpCallback(Callback< void > linkUp)
Mac48Address GetAddress(void) const
uint8_t GetNBasicModes(void) const
Return the number of basic modes we support.
Voice.
Definition: qos-utils.h:66
uint16_t GetFrequencyChannel() const
Current channel Id.
void SetType(WifiMacType type, bool resetToDsFromDs=true)
Set Type/Subtype values with the correct values depending on the given type.
Callback< uint32_t, Mac48Address, Ptr< MeshWifiInterfaceMac > > m_linkMetricCallback
linkMetricCallback
void SetQosTxopLimit(uint8_t txop)
Set TXOP limit in the QoS control field.
void SetRandomStartDelay(Time interval)
Set maximum initial random delay before first beacon.
void InstallPlugin(Ptr< MeshWifiInterfaceMacPlugin > plugin)
Install plugin.
void SetMinCw(uint32_t minCw)
Set the minimum contention window size.
Definition: txop.cc:157
void SetMaxCw(uint32_t maxCw)
Set the maximum contention window size.
Definition: txop.cc:169
virtual void ConfigureStandard(enum WifiStandard standard)
Finish configuration based on the WifiStandard being provided.
bool RemovePacketTag(Tag &tag)
Remove a packet tag.
Definition: packet.cc:963
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
void SetQosNoAmsdu(void)
Set that A-MSDU is not present.
bool IsRunning(void) const
This method is syntactic sugar for !IsExpired().
Definition: event-id.cc:71
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
Definition: event-id.cc:53
bool IsEqual(const Ssid &o) const
Check if the two SSIDs are equal.
Definition: ssid.cc:55
void SetDsTo(void)
Set the To DS bit in the Frame Control field.
void Receive(Ptr< WifiMacQueueItem > mpdu)
Frame receive handler.
Ptr< NetDevice > GetDevice(void) const
Return the device this PHY is associated with.
Definition: wifi-phy.cc:783
bool CheckSupportedRates(SupportedRates rates) const
Check supported rates.
void SetBeaconGeneration(bool enable)
Enable/disable beacons.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:533
void ForwardUp(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet up to the device.
EventId m_beaconSendEvent
"Timer" for the next beacon
void SetDsFrom(void)
Set the From DS bit in the Frame Control field.
bool IsQosData(void) const
Return true if the Type is DATA and Subtype is one of the possible values for QoS Data...
void SetBeaconInterval(Time interval)
Set interval between two successive beacons.
void SetAifsn(uint8_t aifsn)
Set the number of slots that make up an AIFS.
Definition: txop.cc:241
Time m_tbtt
Time for the next frame.
void ShiftTbtt(Time shift)
Shift TBTT.
void ConfigureStandard(WifiStandard standard)
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.
WifiMode GetBasicMode(uint8_t i) const
Return a basic mode from the set of basic modes.
void SetPriority(uint8_t priority)
Set the tag&#39;s priority.
Definition: socket.cc:842
This class can be used to hold variables of floating point type such as &#39;double&#39; or &#39;float&#39;...
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:185
virtual void Queue(Ptr< Packet > packet, const WifiMacHeader &hdr)
Definition: txop.cc:288
bool IsBrandNew(Mac48Address address) const
Return whether the station state is brand new.
a unique identifier for an interface.
Definition: type-id.h:58
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
Basic MAC of mesh point Wi-Fi interface.
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:833
virtual void SetParent(Ptr< MeshWifiInterfaceMac > parent)=0
Each plugin must be installed on an interface to work.
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
Definition: wifi-mode.cc:100
Implements the IEEE 802.11 MAC header.
void SetQosAckPolicy(QosAckPolicy policy)
Set the QoS Ack policy in the QoS control field.