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 #include "ns3/wifi-net-device.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, m_low->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
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 (uint32_t i = 0; i < m_phy->GetNModes (); i++)
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 (uint32_t i = 0; i < m_phy->GetNModes (); i++)
307  {
308  WifiMode mode = m_phy->GetMode (i);
309  uint16_t gi = ConvertGuardIntervalToNanoSeconds (mode, DynamicCast<WifiNetDevice> (m_phy->GetDevice ()));
310  rates.AddSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), gi, 1));
311  }
312  // set the basic rates
313  for (uint32_t j = 0; j < m_stationManager->GetNBasicModes (); j++)
314  {
316  uint16_t gi = ConvertGuardIntervalToNanoSeconds (mode, DynamicCast<WifiNetDevice> (m_phy->GetDevice ()));
317  rates.SetBasicRate (mode.GetDataRate (m_phy->GetChannelWidth (), gi, 1));
318  }
319  return rates;
320 }
321 bool
323 {
324  for (uint32_t i = 0; i < m_stationManager->GetNBasicModes (); i++)
325  {
327  uint16_t gi = ConvertGuardIntervalToNanoSeconds (mode, DynamicCast<WifiNetDevice> (m_phy->GetDevice ()));
328  if (!rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), gi, 1)))
329  {
330  return false;
331  }
332  }
333  return true;
334 }
335 //-----------------------------------------------------------------------------
336 // Beacons
337 //-----------------------------------------------------------------------------
338 void
340 {
341  NS_LOG_FUNCTION (this << interval);
342  m_randomStart = interval;
343 }
344 void
346 {
347  NS_LOG_FUNCTION (this << interval);
348  m_beaconInterval = interval;
349 }
350 Time
352 {
353  return m_beaconInterval;
354 }
355 void
357 {
358  NS_LOG_FUNCTION (this << enable);
359  m_beaconEnable = enable;
360 }
361 bool
363 {
364  return m_beaconSendEvent.IsRunning ();
365 }
366 Time
368 {
369  return m_tbtt;
370 }
371 void
373 {
374  // User of ShiftTbtt () must take care don't shift it to the past
375  NS_ASSERT (GetTbtt () + shift > Simulator::Now ());
376 
377  m_tbtt += shift;
378  // Shift scheduled event
381  this);
382 }
383 void
385 {
388 }
389 void
391 {
392  NS_LOG_FUNCTION (this);
393  NS_LOG_DEBUG (GetAddress () << " is sending beacon");
394 
396 
397  // Form & send beacon
399 
400  // Ask all plugins to add their specific information elements to beacon
401  for (PluginList::const_iterator i = m_plugins.begin (); i != m_plugins.end (); ++i)
402  {
403  (*i)->UpdateBeacon (beacon);
404  }
405  m_txop->Queue (beacon.CreatePacket (), beacon.CreateHeader (GetAddress (), GetMeshPointAddress ()));
406 
408 }
409 void
411 {
412  const WifiMacHeader* hdr = &mpdu->GetHeader ();
413  Ptr<Packet> packet = mpdu->GetPacket ()->Copy ();
414  // Process beacon
415  if ((hdr->GetAddr1 () != GetAddress ()) && (hdr->GetAddr1 () != Mac48Address::GetBroadcast ()))
416  {
417  return;
418  }
419  if (hdr->IsBeacon ())
420  {
422  MgtBeaconHeader beacon_hdr;
423 
424  packet->PeekHeader (beacon_hdr);
425 
426  NS_LOG_DEBUG ("Beacon received from " << hdr->GetAddr2 () << " I am " << GetAddress () << " at "
427  << Simulator::Now ().GetMicroSeconds () << " microseconds");
428 
429  // update supported rates
430  if (beacon_hdr.GetSsid ().IsEqual (GetSsid ()))
431  {
432  SupportedRates rates = beacon_hdr.GetSupportedRates ();
433 
434  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
435  {
436  WifiMode mode = m_phy->GetMode (i);
437  uint16_t gi = ConvertGuardIntervalToNanoSeconds (mode, DynamicCast<WifiNetDevice> (m_phy->GetDevice ()));
438  uint64_t rate = mode.GetDataRate (m_phy->GetChannelWidth (), gi, 1);
439  if (rates.IsSupportedRate (rate))
440  {
441  m_stationManager->AddSupportedMode (hdr->GetAddr2 (), mode);
442  if (rates.IsBasicRate (rate))
443  {
445  }
446  }
447  }
448  }
449  }
450  else
451  {
452  m_stats.recvBytes += packet->GetSize ();
454  }
455  // Filter frame through all installed plugins
456  for (PluginList::iterator i = m_plugins.begin (); i != m_plugins.end (); ++i)
457  {
458  bool drop = !((*i)->Receive (packet, *hdr));
459  if (drop)
460  {
461  return; // plugin drops frame
462  }
463  }
464  // Check if QoS tag exists and add it:
465  if (hdr->IsQosData ())
466  {
467  SocketPriorityTag priorityTag;
468  priorityTag.SetPriority (hdr->GetQosTid ());
469  packet->ReplacePacketTag (priorityTag);
470  }
471  // Forward data up
472  if (hdr->IsData ())
473  {
474  ForwardUp (packet, hdr->GetAddr4 (), hdr->GetAddr3 ());
475  }
476 
477  // We don't bother invoking RegularWifiMac::Receive() here, because
478  // we've explicitly handled all the frames we care about. This is in
479  // contrast to most classes which derive from RegularWifiMac.
480 }
481 uint32_t
483 {
484  uint32_t metric = 1;
485  if (!m_linkMetricCallback.IsNull ())
486  {
487  metric = m_linkMetricCallback (peerAddress, this);
488  }
489  return metric;
490 }
491 void
493 {
495 }
496 void
498 {
499  m_mpAddress = a;
500 }
503 {
504  return m_mpAddress;
505 }
506 //Statistics:
508  : recvBeacons (0),
509  sentFrames (0),
510  sentBytes (0),
511  recvFrames (0),
512  recvBytes (0)
513 {
514 }
515 void
517 {
518  os << "<Statistics "
520  "rxBeacons=\"" << recvBeacons << "\" "
521  "txFrames=\"" << sentFrames << "\" "
522  "txBytes=\"" << sentBytes << "\" "
523  "rxFrames=\"" << recvFrames << "\" "
524  "rxBytes=\"" << recvBytes << "\"/>" << std::endl;
525 }
526 void
527 MeshWifiInterfaceMac::Report (std::ostream & os) const
528 {
529  os << "<Interface "
530  "BeaconInterval=\"" << GetBeaconInterval ().GetSeconds () << "\" "
531  "Channel=\"" << GetFrequencyChannel () << "\" "
532  "Address = \"" << GetAddress () << "\">" << std::endl;
533  m_stats.Print (os);
534  os << "</Interface>" << std::endl;
535 }
536 void
538 {
539  m_stats = Statistics ();
540 }
541 
542 void
544 {
546  m_standard = standard;
547 
548  // We use the single DCF provided by WifiMac for the purpose of
549  // Beacon transmission. For this we need to reconfigure the channel
550  // access parameters slightly, and do so here.
551  m_txop->SetMinCw (0);
552  m_txop->SetMaxCw (0);
553  m_txop->SetAifsn (1);
554 }
555 } // namespace ns3
556 
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
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:379
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...
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
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:1515
void ScheduleNextBeacon()
Schedule next beacon.
virtual void DoInitialize()
Initialize() implementation.
Background.
Definition: qos-utils.h:43
base class for all MAC-level wifi objects.
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:1342
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: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
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.
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:387
SupportedRates GetSupportedRates() const
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...
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
virtual void SetChannelNumber(uint8_t id)
Set channel number.
Definition: wifi-phy.cc:1613
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:1343
uint8_t GetChannelNumber(void) const
Return current channel number.
Definition: wifi-phy.cc:1666
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 GetNModes(void) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Definition: wifi-phy.cc:4120
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:4126
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:186
void SetMaxCw(uint32_t maxCw)
Set the maximum contention window size.
Definition: txop.cc:199
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:1278
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:758
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:472
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:270
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:317
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.
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.
void SetQosAckPolicy(QosAckPolicy policy)
Set the QoS Ack policy in the QoS control field.