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/mac-low.h"
27 #include "ns3/random-variable-stream.h"
28 #include "ns3/simulator.h"
29 #include "ns3/yans-wifi-phy.h"
30 #include "ns3/wifi-utils.h"
31 #include "ns3/pointer.h"
32 #include "ns3/double.h"
33 #include "ns3/trace-source-accessor.h"
34 #include "ns3/socket.h"
35 
36 namespace ns3 {
37 
38 NS_LOG_COMPONENT_DEFINE ("MeshWifiInterfaceMac");
39 
40 NS_OBJECT_ENSURE_REGISTERED (MeshWifiInterfaceMac);
41 
42 TypeId
44 {
45  static TypeId tid = TypeId ("ns3::MeshWifiInterfaceMac")
47  .SetGroupName ("Mesh")
48  .AddConstructor<MeshWifiInterfaceMac> ()
49  .AddAttribute ( "BeaconInterval",
50  "Beacon Interval",
51  TimeValue (Seconds (0.5)),
52 
56  )
57  .AddAttribute ( "RandomStart",
58  "Window when beacon generating starts (uniform random) in seconds",
59  TimeValue (Seconds (0.5)),
63  )
64  .AddAttribute ( "BeaconGeneration",
65  "Enable/Disable Beaconing.",
66  BooleanValue (true),
70  )
71  ;
72  return tid;
73 }
75  : m_standard (WIFI_PHY_STANDARD_80211a)
76 {
77  NS_LOG_FUNCTION (this);
78 
79  // Let the lower layers know that we are acting as a mesh node
81  m_coefficient = CreateObject<UniformRandomVariable> ();
82 }
84 {
85  NS_LOG_FUNCTION (this);
86 }
87 //-----------------------------------------------------------------------------
88 // WifiMac inherited
89 //-----------------------------------------------------------------------------
90 void
92 {
93  NS_LOG_FUNCTION (this << packet << to << from);
94  ForwardDown (packet, from, to);
95 }
96 void
98 {
99  NS_LOG_FUNCTION (this << packet << to);
100  ForwardDown (packet, m_low->GetAddress (), to);
101 }
102 bool
104 {
105  return true;
106 }
107 void
109 {
110  NS_LOG_FUNCTION (this);
112 
113  // The approach taken here is that, from the point of view of a mesh
114  // node, the link is always up, so we immediately invoke the
115  // callback if one is set
116  linkUp ();
117 }
118 void
120 {
121  NS_LOG_FUNCTION (this);
122  m_plugins.clear ();
124 
126 }
127 void
129 {
130  NS_LOG_FUNCTION (this);
132  if (m_beaconEnable)
133  {
134  Time randomStart = Seconds (m_coefficient->GetValue ());
135  // Now start sending beacons after some random delay (to avoid collisions)
138  m_tbtt = Simulator::Now () + randomStart;
139  }
140  else
141  {
142  // stop sending beacons
144  }
145 }
146 
147 int64_t
149 {
150  NS_LOG_FUNCTION (this << stream);
151  int64_t currentStream = stream;
152  m_coefficient->SetStream (currentStream++);
153  for (PluginList::const_iterator i = m_plugins.begin (); i < m_plugins.end (); i++)
154  {
155  currentStream += (*i)->AssignStreams (currentStream);
156  }
157  return (currentStream - stream);
158 }
159 
160 //-----------------------------------------------------------------------------
161 // Plugins
162 //-----------------------------------------------------------------------------
163 void
165 {
166  NS_LOG_FUNCTION (this);
167 
168  plugin->SetParent (this);
169  m_plugins.push_back (plugin);
170 }
171 //-----------------------------------------------------------------------------
172 // Switch channels
173 //-----------------------------------------------------------------------------
174 uint16_t
176 {
177  NS_LOG_FUNCTION (this);
178  NS_ASSERT (m_phy != 0); // need PHY to set/get channel
179 
181  if (phy != 0)
182  {
183  return phy->GetChannelNumber ();
184  }
185  else
186  {
187  return 0;
188  }
189 }
190 void
192 {
193  NS_LOG_FUNCTION (this);
194  NS_ASSERT (m_phy != 0); // need PHY to set/get channel
207  phy->SetChannelNumber (new_id);
208  // Don't know NAV on new channel
210 }
211 //-----------------------------------------------------------------------------
212 // Forward frame down
213 //-----------------------------------------------------------------------------
214 void
216 {
217  WifiMacHeader hdr;
219  hdr.SetAddr2 (GetAddress ());
220  hdr.SetAddr3 (to);
221  hdr.SetAddr4 (from);
222  hdr.SetDsFrom ();
223  hdr.SetDsTo ();
224  // Fill QoS fields:
226  hdr.SetQosNoEosp ();
227  hdr.SetQosNoAmsdu ();
228  hdr.SetQosTxopLimit (0);
229  // Address 1 is unknown here. Routing plugin is responsible to correctly set it.
230  hdr.SetAddr1 (Mac48Address ());
231  // Filter packet through all installed plugins
232  for (PluginList::const_iterator i = m_plugins.end () - 1; i != m_plugins.begin () - 1; i--)
233  {
234  bool drop = !((*i)->UpdateOutcomingFrame (packet, hdr, from, to));
235  if (drop)
236  {
237  return; // plugin drops frame
238  }
239  }
240  // Assert that address1 is set. Assert will fail e.g. if there is no installed routing plugin.
241  NS_ASSERT (hdr.GetAddr1 () != Mac48Address ());
242  // Queue frame
243  if (m_stationManager->IsBrandNew (hdr.GetAddr1 ()))
244  {
245  // in adhoc mode, we assume that every destination
246  // supports all the rates we support.
247  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
248  {
250  }
252  }
253  // Classify: application may have set a tag, which is removed here
254  AcIndex ac;
255  SocketPriorityTag tag;
256  if (packet->RemovePacketTag (tag))
257  {
258  hdr.SetQosTid (tag.GetPriority ());
259  ac = QosUtilsMapTidToAc (tag.GetPriority ());
260  }
261  else
262  {
263  // No tag found; set to best effort
264  ac = AC_BE;
265  hdr.SetQosTid (0);
266  }
268  m_stats.sentBytes += packet->GetSize ();
269  NS_ASSERT (m_edca.find (ac) != m_edca.end ());
270  m_edca[ac]->Queue (packet, hdr);
271 }
272 void
274 {
275  //Filter management frames:
276  WifiMacHeader header = hdr;
277  for (PluginList::const_iterator i = m_plugins.end () - 1; i != m_plugins.begin () - 1; i--)
278  {
279  bool drop = !((*i)->UpdateOutcomingFrame (packet, header, Mac48Address (), Mac48Address ()));
280  if (drop)
281  {
282  return; // plugin drops frame
283  }
284  }
286  m_stats.sentBytes += packet->GetSize ();
287  if ((m_edca.find (AC_VO) == m_edca.end ()) || (m_edca.find (AC_BK) == m_edca.end ()))
288  {
289  NS_FATAL_ERROR ("Voice or Background queue is not set up!");
290  }
291  /*
292  * When we send a management frame - it is better to enqueue it to
293  * priority queue. But when we send a broadcast management frame,
294  * like PREQ, little MinCw value may cause collisions during
295  * retransmissions (two neighbor stations may choose the same window
296  * size, and two packets will be collided). So, broadcast management
297  * frames go to BK queue.
298  */
299  if (hdr.GetAddr1 () != Mac48Address::GetBroadcast ())
300  {
301  m_edca[AC_VO]->Queue (packet, header);
302  }
303  else
304  {
305  m_edca[AC_BK]->Queue (packet, header);
306  }
307 }
310 {
311  // set the set of supported rates and make sure that we indicate
312  // the Basic Rate set in this set of supported rates.
313  SupportedRates rates;
314  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
315  {
316  WifiMode mode = m_phy->GetMode (i);
318  rates.AddSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), gi, 1));
319  }
320  // set the basic rates
321  for (uint32_t j = 0; j < m_stationManager->GetNBasicModes (); j++)
322  {
325  rates.SetBasicRate (mode.GetDataRate (m_phy->GetChannelWidth (), gi, 1));
326  }
327  return rates;
328 }
329 bool
331 {
332  for (uint32_t i = 0; i < m_stationManager->GetNBasicModes (); i++)
333  {
336  if (!rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), gi, 1)))
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_txop->Queue (beacon.CreatePacket (), beacon.CreateHeader (GetAddress (), GetMeshPointAddress ()));
414 
416 }
417 void
419 {
420  const WifiMacHeader* hdr = &mpdu->GetHeader ();
421  Ptr<Packet> packet = mpdu->GetPacket ()->Copy ();
422  // Process beacon
423  if ((hdr->GetAddr1 () != GetAddress ()) && (hdr->GetAddr1 () != Mac48Address::GetBroadcast ()))
424  {
425  return;
426  }
427  if (hdr->IsBeacon ())
428  {
430  MgtBeaconHeader beacon_hdr;
431 
432  packet->PeekHeader (beacon_hdr);
433 
434  NS_LOG_DEBUG ("Beacon received from " << hdr->GetAddr2 () << " I am " << GetAddress () << " at "
435  << Simulator::Now ().GetMicroSeconds () << " microseconds");
436 
437  // update supported rates
438  if (beacon_hdr.GetSsid ().IsEqual (GetSsid ()))
439  {
440  SupportedRates rates = beacon_hdr.GetSupportedRates ();
441 
442  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
443  {
444  WifiMode mode = m_phy->GetMode (i);
446  uint64_t rate = mode.GetDataRate (m_phy->GetChannelWidth (), gi, 1);
447  if (rates.IsSupportedRate (rate))
448  {
449  m_stationManager->AddSupportedMode (hdr->GetAddr2 (), mode);
450  if (rates.IsBasicRate (rate))
451  {
453  }
454  }
455  }
456  }
457  }
458  else
459  {
460  m_stats.recvBytes += packet->GetSize ();
462  }
463  // Filter frame through all installed plugins
464  for (PluginList::iterator i = m_plugins.begin (); i != m_plugins.end (); ++i)
465  {
466  bool drop = !((*i)->Receive (packet, *hdr));
467  if (drop)
468  {
469  return; // plugin drops frame
470  }
471  }
472  // Check if QoS tag exists and add it:
473  if (hdr->IsQosData ())
474  {
475  SocketPriorityTag priorityTag;
476  priorityTag.SetPriority (hdr->GetQosTid ());
477  packet->ReplacePacketTag (priorityTag);
478  }
479  // Forward data up
480  if (hdr->IsData ())
481  {
482  ForwardUp (packet, hdr->GetAddr4 (), hdr->GetAddr3 ());
483  }
484 
485  // We don't bother invoking RegularWifiMac::Receive() here, because
486  // we've explicitly handled all the frames we care about. This is in
487  // contrast to most classes which derive from RegularWifiMac.
488 }
489 uint32_t
491 {
492  uint32_t metric = 1;
493  if (!m_linkMetricCallback.IsNull ())
494  {
495  metric = m_linkMetricCallback (peerAddress, this);
496  }
497  return metric;
498 }
499 void
501 {
503 }
504 void
506 {
507  m_mpAddress = a;
508 }
511 {
512  return m_mpAddress;
513 }
514 //Statistics:
516  : recvBeacons (0),
517  sentFrames (0),
518  sentBytes (0),
519  recvFrames (0),
520  recvBytes (0)
521 {
522 }
523 void
525 {
526  os << "<Statistics "
528  "rxBeacons=\"" << recvBeacons << "\" "
529  "txFrames=\"" << sentFrames << "\" "
530  "txBytes=\"" << sentBytes << "\" "
531  "rxFrames=\"" << recvFrames << "\" "
532  "rxBytes=\"" << recvBytes << "\"/>" << std::endl;
533 }
534 void
535 MeshWifiInterfaceMac::Report (std::ostream & os) const
536 {
537  os << "<Interface "
538  "BeaconInterval=\"" << GetBeaconInterval ().GetSeconds () << "\" "
539  "Channel=\"" << GetFrequencyChannel () << "\" "
540  "Address = \"" << GetAddress () << "\">" << std::endl;
541  m_stats.Print (os);
542  os << "</Interface>" << std::endl;
543 }
544 void
546 {
547  m_stats = Statistics ();
548 }
549 
550 void
552 {
554  m_standard = standard;
555 
556  // We use the single DCF provided by WifiMac for the purpose of
557  // Beacon transmission. For this we need to reconfigure the channel
558  // access parameters slightly, and do so here.
559  m_txop->SetMinCw (0);
560  m_txop->SetMaxCw (0);
561  m_txop->SetAifsn (1);
562 }
565 {
566  return m_standard;
567 }
568 } // namespace ns3
569 
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
#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
bool GetShortGuardInterval(void) const
Return whether short guard interval is supported.
Definition: wifi-phy.cc:664
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:355
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:162
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:290
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.
WifiPhyStandard GetPhyStandard() const
Get phy standard in use.
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...
Voice.
Definition: qos-utils.h:47
Best Effort.
Definition: qos-utils.h:41
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:97
WifiPhyStandard m_standard
Current PHY standard: needed to configure metric.
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.
phy
Definition: third.py:93
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:449
uint16_t GetChannelWidth(void) const
Definition: wifi-phy.cc:1388
void ScheduleNextBeacon()
Schedule next beacon.
virtual void DoInitialize()
Initialize() implementation.
Background.
Definition: qos-utils.h:43
WifiPhyStandard
Identifies the PHY specification that a Wifi device is configured to use.
base class for all MAC-level wifi objects.
Mac48Address GetMeshPointAddress() const
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
Definition: simulator.h:1390
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:1126
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.
void FinishConfigureStandard(WifiPhyStandard standard)
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:877
uint16_t ConvertGuardIntervalToNanoSeconds(WifiMode mode, const Ptr< WifiNetDevice > device)
Convert the guard interval to nanoseconds based on the WifiMode.
Definition: wifi-utils.cc:71
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:32
uint8_t GetQosTid(void) const
Return the Traffic ID of a QoS header.
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
virtual void FinishConfigureStandard(enum WifiPhyStandard standard)
Finish configuration based on the WifiPhyStandard being provided.
void ForwardDown(Ptr< Packet > packet, Mac48Address from, Mac48Address to)
Send frame.
uint32_t GetLinkMetric(Mac48Address peerAddress)
PluginList m_plugins
List of all installed plugins.
Ptr< MacLow > m_low
MacLow (RTS, CTS, Data, Ack etc.)
void NotifyNavResetNow(Time duration)
Mac48Address GetAddr2(void) const
Return the address in the Address 2 field.
void SetQosTid(uint8_t tid)
Set the TID for the QoS header.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:461
Mac48Address GetAddr4(void) const
Return the address in the Address 4 field.
int64_t GetMicroSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:363
SupportedRates GetSupportedRates() const
Mac48Address m_mpAddress
Mesh point address.
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.
bool IsData(void) const
Return true if the Type is DATA.
802.11 PHY layer modelThis PHY implements a model of 802.11a.
Definition: yans-wifi-phy.h:48
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.
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)
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
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:1127
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:193
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 GetNModes(void) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Definition: wifi-phy.cc:3914
uint8_t GetNBasicModes(void) const
Return the number of basic modes we support.
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.
WifiMode GetMode(uint8_t mode) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Definition: wifi-phy.cc:3920
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:185
void SetMaxCw(uint32_t maxCw)
Set the maximum contention window size.
Definition: txop.cc:198
bool RemovePacketTag(Tag &tag)
Remove a packet tag.
Definition: packet.cc:870
#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:1064
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:65
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.
bool CheckSupportedRates(SupportedRates rates) const
Check supported rates.
void SetBeaconGeneration(bool enable)
Enable/disable beacons.
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:269
Time m_tbtt
Time for the next frame.
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.
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:187
virtual void Queue(Ptr< Packet > packet, const WifiMacHeader &hdr)
Definition: txop.cc:316
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:922
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:38
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:847
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:119
Implements the IEEE 802.11 MAC header.
Time GetGuardInterval(void) const
Definition: wifi-phy.cc:696
void SetQosAckPolicy(QosAckPolicy policy)
Set the QoS Ack policy in the QoS control field.