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/socket.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;
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 may have set a tag, which is removed here
259  AcIndex ac;
260  SocketPriorityTag tag;
261  if (packet->RemovePacketTag (tag))
262  {
263  hdr.SetQosTid (tag.GetPriority ());
264  ac = QosUtilsMapTidToAc (tag.GetPriority ());
265  }
266  else
267  {
268  // No tag found; set to best effort
269  ac = AC_BE;
270  hdr.SetQosTid (0);
271  }
273  m_stats.sentBytes += packet->GetSize ();
274  NS_ASSERT (m_edca.find (ac) != m_edca.end ());
275  m_edca[ac]->Queue (packet, hdr);
276 }
277 void
279 {
280  //Filter management frames:
281  WifiMacHeader header = hdr;
282  for (PluginList::const_iterator i = m_plugins.end () - 1; i != m_plugins.begin () - 1; i--)
283  {
284  bool drop = !((*i)->UpdateOutcomingFrame (packet, header, Mac48Address (), Mac48Address ()));
285  if (drop)
286  {
287  return; // plugin drops frame
288  }
289  }
291  m_stats.sentBytes += packet->GetSize ();
292  if ((m_edca.find (AC_VO) == m_edca.end ()) || (m_edca.find (AC_BK) == m_edca.end ()))
293  {
294  NS_FATAL_ERROR ("Voice or Background queue is not set up!");
295  }
296  /*
297  * When we send a management frame - it is better to enqueue it to
298  * priority queue. But when we send a broadcast management frame,
299  * like PREQ, little MinCw value may cause collisions during
300  * retransmissions (two neighbor stations may choose the same window
301  * size, and two packets will be collided). So, broadcast management
302  * frames go to BK queue.
303  */
304  if (hdr.GetAddr1 () != Mac48Address::GetBroadcast ())
305  {
306  m_edca[AC_VO]->Queue (packet, header);
307  }
308  else
309  {
310  m_edca[AC_BK]->Queue (packet, header);
311  }
312 }
315 {
316  // set the set of supported rates and make sure that we indicate
317  // the Basic Rate set in this set of supported rates.
318  SupportedRates rates;
319  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
320  {
321  WifiMode mode = m_phy->GetMode (i);
323  }
324  // set the basic rates
325  for (uint32_t j = 0; j < m_stationManager->GetNBasicModes (); j++)
326  {
329  }
330  return rates;
331 }
332 bool
334 {
335  for (uint32_t i = 0; i < m_stationManager->GetNBasicModes (); i++)
336  {
338  if (!rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), 1)))
339  {
340  return false;
341  }
342  }
343  return true;
344 }
345 //-----------------------------------------------------------------------------
346 // Beacons
347 //-----------------------------------------------------------------------------
348 void
350 {
351  NS_LOG_FUNCTION (this << interval);
352  m_randomStart = interval;
353 }
354 void
356 {
357  NS_LOG_FUNCTION (this << interval);
358  m_beaconInterval = interval;
359 }
360 Time
362 {
363  return m_beaconInterval;
364 }
365 void
367 {
368  NS_LOG_FUNCTION (this << enable);
369  m_beaconEnable = enable;
370 }
371 bool
373 {
374  return m_beaconSendEvent.IsRunning ();
375 }
376 Time
378 {
379  return m_tbtt;
380 }
381 void
383 {
384  // User of ShiftTbtt () must take care don't shift it to the past
385  NS_ASSERT (GetTbtt () + shift > Simulator::Now ());
386 
387  m_tbtt += shift;
388  // Shift scheduled event
391  this);
392 }
393 void
395 {
398 }
399 void
401 {
402  NS_LOG_FUNCTION (this);
403  NS_LOG_DEBUG (GetAddress () << " is sending beacon");
404 
406 
407  // Form & send beacon
409 
410  // Ask all plugins to add their specific information elements to beacon
411  for (PluginList::const_iterator i = m_plugins.begin (); i != m_plugins.end (); ++i)
412  {
413  (*i)->UpdateBeacon (beacon);
414  }
415  m_dca->Queue (beacon.CreatePacket (), beacon.CreateHeader (GetAddress (), GetMeshPointAddress ()));
416 
418 }
419 void
421 {
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  {
447  m_stationManager->AddSupportedMode (hdr->GetAddr2 (), mode);
448  if (rates.IsBasicRate (mode.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), 1)))
449  {
451  }
452  }
453  }
454  }
455  }
456  else
457  {
458  m_stats.recvBytes += packet->GetSize ();
460  }
461  // Filter frame through all installed plugins
462  for (PluginList::iterator i = m_plugins.begin (); i != m_plugins.end (); ++i)
463  {
464  bool drop = !((*i)->Receive (packet, *hdr));
465  if (drop)
466  {
467  return; // plugin drops frame
468  }
469  }
470  // Check if QoS tag exists and add it:
471  if (hdr->IsQosData ())
472  {
473  SocketPriorityTag priorityTag;
474  priorityTag.SetPriority (hdr->GetQosTid ());
475  packet->ReplacePacketTag (priorityTag);
476  }
477  // Forward data up
478  if (hdr->IsData ())
479  {
480  ForwardUp (packet, hdr->GetAddr4 (), hdr->GetAddr3 ());
481  }
482 
483  // We don't bother invoking RegularWifiMac::Receive() here, because
484  // we've explicitly handled all the frames we care about. This is in
485  // contrast to most classes which derive from RegularWifiMac.
486 }
487 uint32_t
489 {
490  uint32_t metric = 1;
491  if (!m_linkMetricCallback.IsNull ())
492  {
493  metric = m_linkMetricCallback (peerAddress, this);
494  }
495  return metric;
496 }
497 void
499 {
501 }
502 void
504 {
505  m_mpAddress = a;
506 }
509 {
510  return m_mpAddress;
511 }
512 //Statistics:
514  : recvBeacons (0),
515  sentFrames (0),
516  sentBytes (0),
517  recvFrames (0),
518  recvBytes (0)
519 {
520 }
521 void
523 {
524  os << "<Statistics "
526  "rxBeacons=\"" << recvBeacons << "\" "
527  "txFrames=\"" << sentFrames << "\" "
528  "txBytes=\"" << sentBytes << "\" "
529  "rxFrames=\"" << recvFrames << "\" "
530  "rxBytes=\"" << recvBytes << "\"/>" << std::endl;
531 }
532 void
533 MeshWifiInterfaceMac::Report (std::ostream & os) const
534 {
535  os << "<Interface "
536  "BeaconInterval=\"" << GetBeaconInterval ().GetSeconds () << "\" "
537  "Channel=\"" << GetFrequencyChannel () << "\" "
538  "Address = \"" << GetAddress () << "\">" << std::endl;
539  m_stats.Print (os);
540  os << "</Interface>" << std::endl;
541 }
542 void
544 {
545  m_stats = Statistics ();
546 }
547 
548 void
550 {
552  m_standard = standard;
553 
554  // We use the single DCF provided by WifiMac for the purpose of
555  // Beacon transmission. For this we need to reconfigure the channel
556  // access parameters slightly, and do so here.
557  m_dca->SetMinCw (0);
558  m_dca->SetMaxCw (0);
559  m_dca->SetAifsn (1);
560 }
563 {
564  return m_standard;
565 }
566 } // namespace ns3
567 
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:183
#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
virtual bool GetGuardInterval(void) const
Return whether guard interval is being used.
Definition: wifi-phy.cc:579
Ssid GetSsid(void) const
Return the Service Set Identifier (SSID).
Definition: mgt-headers.cc:171
#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.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:462
bool m_beaconEnable
whether beaconing is enabled
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.
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:792
#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's associated function will not be invoked when it expires...
Definition: simulator.cc:321
bool IsRunning(void) const
This method is syntactic sugar for !IsExpired().
Definition: event-id.cc:65
Ptr< WifiPhy > m_phy
Wifi PHY.
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:73
virtual Ssid GetSsid(void) const
The Supported Rates Information ElementThis class knows how to serialise and deserialise the Supporte...
Voice.
Definition: qos-utils.h:45
Best Effort.
Definition: qos-utils.h:39
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:99
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:949
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:41
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:341
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.
virtual uint16_t GetChannelNumber(void) const
Return current channel number.
Definition: wifi-phy.cc:1329
tuple phy
Definition: third.py:86
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
Definition: simulator.h:1238
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:349
AttributeValue implementation for Time.
Definition: nstime.h:957
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.
bool ReplacePacketTag(Tag &tag)
Replace the value of a packet tag.
Definition: packet.cc:838
indicates whether the socket has a priority set.
Definition: socket.h:1304
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
Definition: qos-utils.cc:28
static Mac48Address GetBroadcast(void)
Mac48Address GetAddress(void) const
Return the MAC address of this MacLow.
Definition: mac-low.cc:627
uint16_t GetFrequencyChannel() const
Current channel Id.
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.
virtual uint32_t GetNModes(void) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Definition: wifi-phy.cc:2850
virtual void SetChannelNumber(uint16_t id)
Set channel number.
Definition: wifi-phy.cc:1275
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:278
Mac48Address m_mpAddress
Mesh point address.
virtual uint32_t GetChannelWidth(void) const
Definition: wifi-phy.cc:1157
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:47
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)
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
uint64_t GetDataRate(uint32_t channelWidth, bool isShortGuardInterval, uint8_t nss) const
Definition: wifi-mode.cc:109
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:958
void Receive(Ptr< Packet > packet, WifiMacHeader const *hdr)
Frame receive handler.
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:224
Time m_randomStart
Maximum delay before first beacon.
uint8_t GetPriority(void) const
Get the tag's priority.
Definition: socket.cc:854
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:831
#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
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:895
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.
void SetPriority(uint8_t priority)
Set the tag's priority.
Definition: socket.cc:848
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:191
a unique identifier for an interface.
Definition: type-id.h:58
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:904
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:36
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:525
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 WifiMode GetMode(uint32_t mode) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Definition: wifi-phy.cc:2856
virtual void FinishConfigureStandard(enum WifiPhyStandard standard)