A Discrete-Event Network Simulator
API
wifi-remote-station-manager.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005,2006,2007 INRIA
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  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 
21 #include "ns3/log.h"
22 #include "ns3/boolean.h"
23 #include "ns3/uinteger.h"
24 #include "ns3/enum.h"
25 #include "ns3/simulator.h"
27 #include "wifi-phy.h"
28 #include "wifi-mac.h"
29 #include "wifi-utils.h"
30 #include "wifi-mac-header.h"
31 #include "wifi-mac-trailer.h"
32 #include "ht-configuration.h"
33 #include "vht-configuration.h"
34 #include "he-configuration.h"
35 #include "wifi-net-device.h"
36 #include "tx-vector-tag.h"
37 
38 namespace ns3 {
39 
40 NS_LOG_COMPONENT_DEFINE ("WifiRemoteStationManager");
41 
42 NS_OBJECT_ENSURE_REGISTERED (WifiRemoteStationManager);
43 
44 TypeId
46 {
47  static TypeId tid = TypeId ("ns3::WifiRemoteStationManager")
48  .SetParent<Object> ()
49  .SetGroupName ("Wifi")
50  .AddAttribute ("IsLowLatency",
51  "If true, we attempt to modelize a so-called low-latency device: "
52  "a device where decisions about tx parameters can be made on a per-packet basis and "
53  "feedback about the transmission of each packet is obtained before sending the next. "
54  "Otherwise, we modelize a high-latency device, that is a device where we cannot update "
55  "our decision about tx parameters after every packet transmission.",
57  BooleanValue (true), //this value is ignored because there is no setter
60  .AddAttribute ("MaxSsrc",
61  "The maximum number of retransmission attempts for any packet with size <= RtsCtsThreshold. "
62  "This value will not have any effect on some rate control algorithms.",
63  UintegerValue (7),
65  MakeUintegerChecker<uint32_t> ())
66  .AddAttribute ("MaxSlrc",
67  "The maximum number of retransmission attempts for any packet with size > RtsCtsThreshold. "
68  "This value will not have any effect on some rate control algorithms.",
69  UintegerValue (4),
71  MakeUintegerChecker<uint32_t> ())
72  .AddAttribute ("RtsCtsThreshold",
73  "If the size of the PSDU is bigger than this value, we use an RTS/CTS handshake before sending the data frame."
74  "This value will not have any effect on some rate control algorithms.",
75  UintegerValue (65535),
77  MakeUintegerChecker<uint32_t> ())
78  .AddAttribute ("FragmentationThreshold",
79  "If the size of the PSDU is bigger than this value, we fragment it such that the size of the fragments are equal or smaller. "
80  "This value does not apply when it is carried in an A-MPDU. "
81  "This value will not have any effect on some rate control algorithms.",
82  UintegerValue (65535),
85  MakeUintegerChecker<uint32_t> ())
86  .AddAttribute ("NonUnicastMode",
87  "Wifi mode used for non-unicast transmissions.",
88  WifiModeValue (),
91  .AddAttribute ("DefaultTxPowerLevel",
92  "Default power level to be used for transmissions. "
93  "This is the power level that is used by all those WifiManagers that do not implement TX power control.",
94  UintegerValue (0),
96  MakeUintegerChecker<uint8_t> ())
97  .AddAttribute ("ErpProtectionMode",
98  "Protection mode used when non-ERP STAs are connected to an ERP AP: Rts-Cts or Cts-To-Self",
103  .AddAttribute ("HtProtectionMode",
104  "Protection mode used when non-HT STAs are connected to a HT AP: Rts-Cts or Cts-To-Self",
109  .AddTraceSource ("MacTxRtsFailed",
110  "The transmission of a RTS by the MAC layer has failed",
112  "ns3::Mac48Address::TracedCallback")
113  .AddTraceSource ("MacTxDataFailed",
114  "The transmission of a data packet by the MAC layer has failed",
116  "ns3::Mac48Address::TracedCallback")
117  .AddTraceSource ("MacTxFinalRtsFailed",
118  "The transmission of a RTS has exceeded the maximum number of attempts",
120  "ns3::Mac48Address::TracedCallback")
121  .AddTraceSource ("MacTxFinalDataFailed",
122  "The transmission of a data packet has exceeded the maximum number of attempts",
124  "ns3::Mac48Address::TracedCallback")
125  ;
126  return tid;
127 }
128 
130  : m_pcfSupported (false),
131  m_useNonErpProtection (false),
132  m_useNonHtProtection (false),
133  m_useGreenfieldProtection (false),
134  m_shortPreambleEnabled (false),
135  m_shortSlotTimeEnabled (false),
136  m_rifsPermitted (false)
137 {
138  NS_LOG_FUNCTION (this);
139 }
140 
142 {
143  NS_LOG_FUNCTION (this);
144 }
145 
146 void
148 {
149  NS_LOG_FUNCTION (this);
150  Reset ();
151 }
152 
153 void
155 {
156  NS_LOG_FUNCTION (this << phy);
157  //We need to track our PHY because it is the object that knows the
158  //full set of transmit rates that are supported. We need to know
159  //this in order to find the relevant mandatory rates when choosing a
160  //transmit rate for automatic control responses like
161  //acknowledgements.
162  m_wifiPhy = phy;
163  m_defaultTxMode = phy->GetMode (0);
165  if (GetHtSupported ())
166  {
167  m_defaultTxMcs = phy->GetMcs (0);
168  }
169  Reset ();
170 }
171 
172 void
174 {
175  NS_LOG_FUNCTION (this << mac);
176  //We need to track our MAC because it is the object that knows the
177  //full set of interframe spaces.
178  m_wifiMac = mac;
179  Reset ();
180 }
181 
182 void
184 {
185  NS_LOG_FUNCTION (this << maxSsrc);
186  m_maxSsrc = maxSsrc;
187 }
188 
189 void
191 {
192  NS_LOG_FUNCTION (this << maxSlrc);
193  m_maxSlrc = maxSlrc;
194 }
195 
196 void
198 {
199  NS_LOG_FUNCTION (this << threshold);
200  m_rtsCtsThreshold = threshold;
201 }
202 
203 void
205 {
206  NS_LOG_FUNCTION (this << threshold);
207  DoSetFragmentationThreshold (threshold);
208 }
209 
210 void
212 {
213  NS_LOG_FUNCTION (this << enable);
214  m_shortPreambleEnabled = enable;
215 }
216 
217 void
219 {
220  NS_LOG_FUNCTION (this << enable);
221  m_shortSlotTimeEnabled = enable;
222 }
223 
224 void
226 {
227  NS_LOG_FUNCTION (this << allow);
228  m_rifsPermitted = allow;
229 }
230 
231 bool
233 {
234  return m_shortSlotTimeEnabled;
235 }
236 
237 bool
239 {
240  return m_shortPreambleEnabled;
241 }
242 
243 bool
245 {
246  return m_rifsPermitted;
247 }
248 
249 bool
251 {
252  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
253  Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
254  if (htConfiguration)
255  {
256  return true;
257  }
258  return false;
259 }
260 
261 bool
263 {
264  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
265  Ptr<VhtConfiguration> vhtConfiguration = device->GetVhtConfiguration ();
266  if (vhtConfiguration)
267  {
268  return true;
269  }
270  return false;
271 }
272 
273 bool
275 {
276  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
277  Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration ();
278  if (heConfiguration)
279  {
280  return true;
281  }
282  return false;
283 }
284 
285 void
287 {
288  m_pcfSupported = enable;
289 }
290 
291 bool
293 {
294  return m_pcfSupported;
295 }
296 
297 bool
299 {
300  if (GetHtSupported ())
301  {
302  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
303  Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
304  NS_ASSERT (htConfiguration); //If HT is supported, we should have a HT configuration attached
305  if (htConfiguration->GetGreenfieldSupported ())
306  {
307  return true;
308  }
309  }
310  return false;
311 }
312 
313 bool
315 {
316  if (GetHtSupported ())
317  {
318  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
319  Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
320  NS_ASSERT (htConfiguration); //If HT is supported, we should have a HT configuration attached
321  if (htConfiguration->GetShortGuardIntervalSupported ())
322  {
323  return true;
324  }
325  }
326  return false;
327 }
328 
329 uint16_t
331 {
332  uint16_t gi = 0;
333  if (GetHeSupported ())
334  {
335  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
336  Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration ();
337  NS_ASSERT (heConfiguration); //If HE is supported, we should have a HE configuration attached
338  gi = static_cast<uint16_t>(heConfiguration->GetGuardInterval ().GetNanoSeconds ());
339  }
340  return gi;
341 }
342 
343 uint32_t
345 {
346  return DoGetFragmentationThreshold ();
347 }
348 
349 void
351 {
352  NS_LOG_FUNCTION (this << address << isShortPreambleSupported);
353  NS_ASSERT (!address.IsGroup ());
355  state->m_shortPreamble = isShortPreambleSupported;
356 }
357 
358 void
360 {
361  NS_LOG_FUNCTION (this << address << isShortSlotTimeSupported);
362  NS_ASSERT (!address.IsGroup ());
364  state->m_shortSlotTime = isShortSlotTimeSupported;
365 }
366 
367 void
369 {
370  NS_LOG_FUNCTION (this << address << mode);
371  NS_ASSERT (!address.IsGroup ());
373  for (WifiModeListIterator i = state->m_operationalRateSet.begin (); i != state->m_operationalRateSet.end (); i++)
374  {
375  if ((*i) == mode)
376  {
377  //already in.
378  return;
379  }
380  }
381  state->m_operationalRateSet.push_back (mode);
382 }
383 
384 void
386 {
387  NS_LOG_FUNCTION (this << address);
388  NS_ASSERT (!address.IsGroup ());
390  state->m_operationalRateSet.clear ();
391  for (uint8_t i = 0; i < m_wifiPhy->GetNModes (); i++)
392  {
393  state->m_operationalRateSet.push_back (m_wifiPhy->GetMode (i));
394  if (m_wifiPhy->GetMode (i).IsMandatory ())
395  {
397  }
398  }
399 }
400 
401 void
403 {
404  NS_LOG_FUNCTION (this << address);
405  NS_ASSERT (!address.IsGroup ());
407  state->m_operationalMcsSet.clear ();
408  for (uint8_t i = 0; i < m_wifiPhy->GetNMcs (); i++)
409  {
410  state->m_operationalMcsSet.push_back (m_wifiPhy->GetMcs (i));
411  }
412 }
413 
414 void
416 {
417  NS_LOG_FUNCTION (this << address);
418  NS_ASSERT (!address.IsGroup ());
420  state->m_operationalMcsSet.clear ();
421 }
422 
423 void
425 {
426  NS_LOG_FUNCTION (this << address << mcs);
427  NS_ASSERT (!address.IsGroup ());
429  for (WifiModeListIterator i = state->m_operationalMcsSet.begin (); i != state->m_operationalMcsSet.end (); i++)
430  {
431  if ((*i) == mcs)
432  {
433  //already in.
434  return;
435  }
436  }
437  state->m_operationalMcsSet.push_back (mcs);
438 }
439 
440 bool
442 {
444 }
445 
446 bool
448 {
450 }
451 
452 bool
454 {
456 }
457 
458 bool
460 {
461  if (address.IsGroup ())
462  {
463  return false;
464  }
466 }
467 
468 bool
470 {
471  if (address.IsGroup ())
472  {
473  return true;
474  }
476 }
477 
478 bool
480 {
481  if (address.IsGroup ())
482  {
483  return false;
484  }
486 }
487 
488 void
490 {
491  NS_ASSERT (!address.IsGroup ());
493 }
494 
495 void
497 {
498  NS_ASSERT (!address.IsGroup ());
500 }
501 
502 void
504 {
505  NS_ASSERT (!address.IsGroup ());
507 }
508 
509 void
511 {
512  NS_ASSERT (!address.IsGroup ());
514 }
515 
516 void
518 {
519  NS_LOG_FUNCTION (this << address << *header << packet);
520  if (IsLowLatency () || address.IsGroup ())
521  {
522  return;
523  }
524  WifiRemoteStation *station = Lookup (address, header);
525  WifiTxVector rts = DoGetRtsTxVector (station);
526  WifiTxVector data = DoGetDataTxVector (station);
527  WifiTxVector ctstoself = DoGetCtsToSelfTxVector ();
530  HighLatencyCtsToSelfTxVectorTag ctstoselftag;
531  //first, make sure that the tag is not here anymore.
532  ConstCast<Packet> (packet)->RemovePacketTag (datatag);
533  ConstCast<Packet> (packet)->RemovePacketTag (rtstag);
534  ConstCast<Packet> (packet)->RemovePacketTag (ctstoselftag);
535  datatag = HighLatencyDataTxVectorTag (data);
536  rtstag = HighLatencyRtsTxVectorTag (rts);
537  ctstoselftag = HighLatencyCtsToSelfTxVectorTag (ctstoself);
538  //and then, add it back
539  packet->AddPacketTag (datatag);
540  packet->AddPacketTag (rtstag);
541  packet->AddPacketTag (ctstoselftag);
542 }
543 
546 {
547  NS_LOG_FUNCTION (this << address << *header << packet);
548  if (!header->IsMgt () && address.IsGroup ())
549  {
550  WifiMode mode = GetNonUnicastMode ();
551  WifiTxVector v;
552  v.SetMode (mode);
556  v.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ())));
557  v.SetNTx (1);
558  v.SetNss (1);
559  v.SetNess (0);
560  v.SetStbc (0);
561  return v;
562  }
563  if (!IsLowLatency ())
564  {
566  bool found = ConstCast<Packet> (packet)->PeekPacketTag (datatag);
567  NS_ASSERT (found);
568  return datatag.GetDataTxVector ();
569  }
570  WifiTxVector txVector;
571  if (header->IsMgt ())
572  {
573  //Use the lowest basic rate for management frames
574  WifiMode mgtMode;
575  if (GetNBasicModes () > 0)
576  {
577  mgtMode = GetBasicMode (0);
578  }
579  else
580  {
581  mgtMode = GetDefaultMode ();
582  }
583  txVector.SetMode (mgtMode);
587  txVector.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mgtMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ())));
588  }
589  else
590  {
591  txVector = DoGetDataTxVector (Lookup (address, header));
592  }
593  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
594  Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration ();
595  if (heConfiguration)
596  {
597  UintegerValue bssColor;
598  heConfiguration->GetAttribute ("BssColor", bssColor);
599  txVector.SetBssColor (bssColor.Get ());
600  }
601  return txVector;
602 }
603 
606  Ptr<const Packet> packet)
607 {
608  NS_LOG_FUNCTION (this << *header << packet);
609  if (!IsLowLatency ())
610  {
611  HighLatencyCtsToSelfTxVectorTag ctstoselftag;
612  bool found = ConstCast<Packet> (packet)->PeekPacketTag (ctstoselftag);
613  NS_ASSERT (found);
614  return ctstoselftag.GetCtsToSelfTxVector ();
615  }
616  return DoGetCtsToSelfTxVector ();
617 }
618 
621 {
622  WifiMode defaultMode = GetDefaultMode ();
623  WifiPreamble defaultPreamble;
624  if (defaultMode.GetModulationClass () == WIFI_MOD_CLASS_HE)
625  {
626  defaultPreamble = WIFI_PREAMBLE_HE_SU;
627  }
628  else if (defaultMode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
629  {
630  defaultPreamble = WIFI_PREAMBLE_VHT_SU;
631  }
632  else if (defaultMode.GetModulationClass () == WIFI_MOD_CLASS_HT)
633  {
634  defaultPreamble = WIFI_PREAMBLE_HT_MF;
635  }
636  else
637  {
638  defaultPreamble = WIFI_PREAMBLE_LONG;
639  }
640 
641  return WifiTxVector (defaultMode,
643  defaultPreamble,
644  ConvertGuardIntervalToNanoSeconds (defaultMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ())),
647  0,
649  false,
650  false);
651 }
652 
655  Ptr<const Packet> packet)
656 {
657  NS_LOG_FUNCTION (this << address << *header << packet);
658  if (address.IsGroup ())
659  {
660  WifiMode mode = GetNonUnicastMode ();
661  WifiTxVector v;
662  v.SetMode (mode);
666  v.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ())));
667  v.SetNTx (1);
668  v.SetNss (1);
669  v.SetNess (0);
670  v.SetStbc (0);
671  return v;
672  }
673  if (!IsLowLatency ())
674  {
676  bool found = ConstCast<Packet> (packet)->PeekPacketTag (rtstag);
677  NS_ASSERT (found);
678  return rtstag.GetRtsTxVector ();
679  }
680  return DoGetRtsTxVector (Lookup (address, header));
681 }
682 
683 void
685 {
686  NS_LOG_FUNCTION (this << address << *header);
687  NS_ASSERT (!address.IsGroup ());
688  WifiRemoteStation *station = Lookup (address, header);
689  station->m_ssrc++;
691  DoReportRtsFailed (station);
692 }
693 
694 void
696  uint32_t packetSize)
697 {
698  NS_LOG_FUNCTION (this << address << *header);
699  NS_ASSERT (!address.IsGroup ());
700  WifiRemoteStation *station = Lookup (address, header);
701  bool longMpdu = (packetSize + header->GetSize () + WIFI_MAC_FCS_LENGTH) > m_rtsCtsThreshold;
702  if (longMpdu)
703  {
704  station->m_slrc++;
705  }
706  else
707  {
708  station->m_ssrc++;
709  }
711  DoReportDataFailed (station);
712 }
713 
714 void
716  double ctsSnr, WifiMode ctsMode, double rtsSnr)
717 {
718  NS_LOG_FUNCTION (this << address << *header << ctsSnr << ctsMode << rtsSnr);
719  NS_ASSERT (!address.IsGroup ());
720  WifiRemoteStation *station = Lookup (address, header);
721  station->m_state->m_info.NotifyTxSuccess (station->m_ssrc);
722  station->m_ssrc = 0;
723  DoReportRtsOk (station, ctsSnr, ctsMode, rtsSnr);
724 }
725 
726 void
728  double ackSnr, WifiMode ackMode, double dataSnr,
729  uint32_t packetSize)
730 {
731  NS_LOG_FUNCTION (this << address << *header << ackSnr << ackMode << dataSnr);
732  NS_ASSERT (!address.IsGroup ());
733  WifiRemoteStation *station = Lookup (address, header);
734  bool longMpdu = (packetSize + header->GetSize () + WIFI_MAC_FCS_LENGTH) > m_rtsCtsThreshold;
735  if (longMpdu)
736  {
737  station->m_state->m_info.NotifyTxSuccess (station->m_slrc);
738  station->m_slrc = 0;
739  }
740  else
741  {
742  station->m_state->m_info.NotifyTxSuccess (station->m_ssrc);
743  station->m_ssrc = 0;
744  }
745  DoReportDataOk (station, ackSnr, ackMode, dataSnr);
746 }
747 
748 void
750 {
751  NS_LOG_FUNCTION (this << address << *header);
752  NS_ASSERT (!address.IsGroup ());
753  WifiRemoteStation *station = Lookup (address, header);
754  station->m_state->m_info.NotifyTxFailed ();
755  station->m_ssrc = 0;
757  DoReportFinalRtsFailed (station);
758 }
759 
760 void
762  uint32_t packetSize)
763 {
764  NS_LOG_FUNCTION (this << address << *header);
765  NS_ASSERT (!address.IsGroup ());
766  WifiRemoteStation *station = Lookup (address, header);
767  station->m_state->m_info.NotifyTxFailed ();
768  bool longMpdu = (packetSize + header->GetSize () + WIFI_MAC_FCS_LENGTH) > m_rtsCtsThreshold;
769  if (longMpdu)
770  {
771  station->m_slrc = 0;
772  }
773  else
774  {
775  station->m_ssrc = 0;
776  }
778  DoReportFinalDataFailed (station);
779 }
780 
781 void
783  double rxSnr, WifiMode txMode)
784 {
785  NS_LOG_FUNCTION (this << address << *header << rxSnr << txMode);
786  if (address.IsGroup ())
787  {
788  return;
789  }
790  WifiRemoteStation *station = Lookup (address, header);
791  DoReportRxOk (station, rxSnr, txMode);
792 }
793 
794 void
796  uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus,
797  double rxSnr, double dataSnr)
798 {
799  NS_LOG_FUNCTION (this << address << +tid << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr);
800  NS_ASSERT (!address.IsGroup ());
801  WifiRemoteStation *station = Lookup (address, tid);
802  for (uint8_t i = 0; i < nFailedMpdus; i++)
803  {
805  }
806  DoReportAmpduTxStatus (station, nSuccessfulMpdus, nFailedMpdus, rxSnr, dataSnr);
807 }
808 
809 bool
811  Ptr<const Packet> packet, WifiTxVector txVector)
812 {
813  WifiMode mode = txVector.GetMode ();
814  NS_LOG_FUNCTION (this << address << *header << packet << mode);
815  if (address.IsGroup ())
816  {
817  return false;
818  }
821  || (mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
822  || (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
823  || (mode.GetModulationClass () == WIFI_MOD_CLASS_HE))
825  {
826  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedRTS returning true to protect non-ERP stations");
827  return true;
828  }
829  else if (m_htProtectionMode == RTS_CTS
830  && ((mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
831  || (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT))
834  {
835  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedRTS returning true to protect non-HT stations");
836  return true;
837  }
838  bool normally = (packet->GetSize () + header->GetSize () + WIFI_MAC_FCS_LENGTH) > m_rtsCtsThreshold;
839  return DoNeedRts (Lookup (address, header), packet, normally);
840 }
841 
842 bool
844 {
845  WifiMode mode = txVector.GetMode ();
846  NS_LOG_FUNCTION (this << mode);
849  || (mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
850  || (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
851  || (mode.GetModulationClass () == WIFI_MOD_CLASS_HE))
853  {
854  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning true to protect non-ERP stations");
855  return true;
856  }
857  else if (m_htProtectionMode == CTS_TO_SELF
858  && ((mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
859  || (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT))
862  {
863  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning true to protect non-HT stations");
864  return true;
865  }
866  else if (!m_useNonErpProtection)
867  {
868  //search for the BSS Basic Rate set, if the used mode is in the basic set then there is no need for Cts To Self
869  for (WifiModeListIterator i = m_bssBasicRateSet.begin (); i != m_bssBasicRateSet.end (); i++)
870  {
871  if (mode == *i)
872  {
873  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning false");
874  return false;
875  }
876  }
877  if (GetHtSupported ())
878  {
879  //search for the BSS Basic MCS set, if the used mode is in the basic set then there is no need for Cts To Self
880  for (WifiModeListIterator i = m_bssBasicMcsSet.begin (); i != m_bssBasicMcsSet.end (); i++)
881  {
882  if (mode == *i)
883  {
884  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning false");
885  return false;
886  }
887  }
888  }
889  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning true");
890  return true;
891  }
892  return false;
893 }
894 
895 void
897 {
898  NS_LOG_FUNCTION (this << enable);
899  m_useNonErpProtection = enable;
900 }
901 
902 bool
904 {
905  return m_useNonErpProtection;
906 }
907 
908 void
910 {
911  NS_LOG_FUNCTION (this << enable);
912  m_useNonHtProtection = enable;
913 }
914 
915 bool
917 {
918  return m_useNonHtProtection;
919 }
920 
921 void
923 {
924  NS_LOG_FUNCTION (this << enable);
925  m_useGreenfieldProtection = enable;
926 }
927 
928 bool
930 {
932 }
933 
934 bool
936  Ptr<const Packet> packet)
937 {
938  NS_LOG_FUNCTION (this << address << packet << *header);
939  NS_ASSERT (!address.IsGroup ());
940  WifiRemoteStation *station = Lookup (address, header);
941  bool longMpdu = (packet->GetSize () + header->GetSize () + WIFI_MAC_FCS_LENGTH) > m_rtsCtsThreshold;
942  uint32_t retryCount, maxRetryCount;
943  if (longMpdu)
944  {
945  retryCount = station->m_slrc;
946  maxRetryCount = m_maxSlrc;
947  }
948  else
949  {
950  retryCount = station->m_ssrc;
951  maxRetryCount = m_maxSsrc;
952  }
953  bool normally = retryCount < maxRetryCount;
954  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedRetransmission count: " << retryCount << " result: " << std::boolalpha << normally);
955  return DoNeedRetransmission (station, packet, normally);
956 }
957 
958 bool
960  Ptr<const Packet> packet)
961 {
962  NS_LOG_FUNCTION (this << address << packet << *header);
963  if (address.IsGroup ())
964  {
965  return false;
966  }
967  WifiRemoteStation *station = Lookup (address, header);
968  bool normally = (packet->GetSize () + header->GetSize () + WIFI_MAC_FCS_LENGTH) > GetFragmentationThreshold ();
969  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedFragmentation result: " << std::boolalpha << normally);
970  return DoNeedFragmentation (station, packet, normally);
971 }
972 
973 void
975 {
976  NS_LOG_FUNCTION (this << threshold);
977  if (threshold < 256)
978  {
979  /*
980  * ASN.1 encoding of the MAC and PHY MIB (256 ... 8000)
981  */
982  NS_LOG_WARN ("Fragmentation threshold should be larger than 256. Setting to 256.");
984  }
985  else
986  {
987  /*
988  * The length of each fragment shall be an even number of octets, except for the last fragment if an MSDU or
989  * MMPDU, which may be either an even or an odd number of octets.
990  */
991  if (threshold % 2 != 0)
992  {
993  NS_LOG_WARN ("Fragmentation threshold should be an even number. Setting to " << threshold - 1);
994  m_nextFragmentationThreshold = threshold - 1;
995  }
996  else
997  {
998  m_nextFragmentationThreshold = threshold;
999  }
1000  }
1001 }
1002 
1003 void
1005 {
1007 }
1008 
1009 uint32_t
1011 {
1012  return m_fragmentationThreshold;
1013 }
1014 
1015 uint32_t
1017 {
1018  NS_LOG_FUNCTION (this << *header << packet);
1019  //The number of bytes a fragment can support is (Threshold - WIFI_HEADER_SIZE - WIFI_FCS).
1020  uint32_t nFragments = (packet->GetSize () / (GetFragmentationThreshold () - header->GetSize () - WIFI_MAC_FCS_LENGTH));
1021 
1022  //If the size of the last fragment is not 0.
1023  if ((packet->GetSize () % (GetFragmentationThreshold () - header->GetSize () - WIFI_MAC_FCS_LENGTH)) > 0)
1024  {
1025  nFragments++;
1026  }
1027  NS_LOG_DEBUG ("WifiRemoteStationManager::GetNFragments returning " << nFragments);
1028  return nFragments;
1029 }
1030 
1031 uint32_t
1033  Ptr<const Packet> packet, uint32_t fragmentNumber)
1034 {
1035  NS_LOG_FUNCTION (this << address << *header << packet << fragmentNumber);
1036  NS_ASSERT (!address.IsGroup ());
1037  uint32_t nFragment = GetNFragments (header, packet);
1038  if (fragmentNumber >= nFragment)
1039  {
1040  NS_LOG_DEBUG ("WifiRemoteStationManager::GetFragmentSize returning 0");
1041  return 0;
1042  }
1043  //Last fragment
1044  if (fragmentNumber == nFragment - 1)
1045  {
1046  uint32_t lastFragmentSize = packet->GetSize () - (fragmentNumber * (GetFragmentationThreshold () - header->GetSize () - WIFI_MAC_FCS_LENGTH));
1047  NS_LOG_DEBUG ("WifiRemoteStationManager::GetFragmentSize returning " << lastFragmentSize);
1048  return lastFragmentSize;
1049  }
1050  //All fragments but the last, the number of bytes is (Threshold - WIFI_HEADER_SIZE - WIFI_FCS).
1051  else
1052  {
1053  uint32_t fragmentSize = GetFragmentationThreshold () - header->GetSize () - WIFI_MAC_FCS_LENGTH;
1054  NS_LOG_DEBUG ("WifiRemoteStationManager::GetFragmentSize returning " << fragmentSize);
1055  return fragmentSize;
1056  }
1057 }
1058 
1059 uint32_t
1061  Ptr<const Packet> packet, uint32_t fragmentNumber)
1062 {
1063  NS_LOG_FUNCTION (this << address << *header << packet << fragmentNumber);
1064  NS_ASSERT (!address.IsGroup ());
1065  NS_ASSERT (fragmentNumber < GetNFragments (header, packet));
1066  uint32_t fragmentOffset = fragmentNumber * (GetFragmentationThreshold () - header->GetSize () - WIFI_MAC_FCS_LENGTH);
1067  NS_LOG_DEBUG ("WifiRemoteStationManager::GetFragmentOffset returning " << fragmentOffset);
1068  return fragmentOffset;
1069 }
1070 
1071 bool
1073  Ptr<const Packet> packet, uint32_t fragmentNumber)
1074 {
1075  NS_LOG_FUNCTION (this << address << *header << packet << fragmentNumber);
1076  NS_ASSERT (!address.IsGroup ());
1077  bool isLast = fragmentNumber == (GetNFragments (header, packet) - 1);
1078  NS_LOG_DEBUG ("WifiRemoteStationManager::IsLastFragment returning " << std::boolalpha << isLast);
1079  return isLast;
1080 }
1081 
1082 uint8_t
1084 {
1085  return m_defaultTxPowerLevel;
1086 }
1087 
1090 {
1092  return state->m_info;
1093 }
1094 
1097 {
1098  NS_LOG_FUNCTION (this << address);
1099  for (StationStates::const_iterator i = m_states.begin (); i != m_states.end (); i++)
1100  {
1101  if ((*i)->m_address == address)
1102  {
1103  NS_LOG_DEBUG ("WifiRemoteStationManager::LookupState returning existing state");
1104  return (*i);
1105  }
1106  }
1109  state->m_address = address;
1110  state->m_operationalRateSet.push_back (GetDefaultMode ());
1111  state->m_operationalMcsSet.push_back (GetDefaultMcs ());
1112  state->m_htCapabilities = 0;
1113  state->m_vhtCapabilities = 0;
1114  state->m_heCapabilities = 0;
1116  state->m_guardInterval = GetGuardInterval ();
1117  state->m_ness = 0;
1118  state->m_aggregation = false;
1119  state->m_qosSupported = false;
1120  const_cast<WifiRemoteStationManager *> (this)->m_states.push_back (state);
1121  NS_LOG_DEBUG ("WifiRemoteStationManager::LookupState returning new state");
1122  return state;
1123 }
1124 
1127 {
1128  uint8_t tid;
1129  if (header->IsQosData ())
1130  {
1131  tid = header->GetQosTid ();
1132  }
1133  else
1134  {
1135  tid = 0;
1136  }
1137  return Lookup (address, tid);
1138 }
1139 
1142 {
1143  NS_LOG_FUNCTION (this << address << +tid);
1144  for (Stations::const_iterator i = m_stations.begin (); i != m_stations.end (); i++)
1145  {
1146  if ((*i)->m_tid == tid
1147  && (*i)->m_state->m_address == address)
1148  {
1149  return (*i);
1150  }
1151  }
1153 
1154  WifiRemoteStation *station = DoCreateStation ();
1155  station->m_state = state;
1156  station->m_tid = tid;
1157  station->m_ssrc = 0;
1158  station->m_slrc = 0;
1159  const_cast<WifiRemoteStationManager *> (this)->m_stations.push_back (station);
1160  return station;
1161 }
1162 
1163 void
1165 {
1166  NS_LOG_FUNCTION (this << from << qosSupported);
1167  WifiRemoteStationState *state;
1168  state = LookupState (from);
1169  state->m_qosSupported = qosSupported;
1170 }
1171 
1172 void
1174 {
1175  //Used by all stations to record HT capabilities of remote stations
1176  NS_LOG_FUNCTION (this << from << htCapabilities);
1177  WifiRemoteStationState *state;
1178  state = LookupState (from);
1179  if (htCapabilities.GetSupportedChannelWidth () == 1)
1180  {
1181  state->m_channelWidth = 40;
1182  }
1183  else
1184  {
1185  state->m_channelWidth = 20;
1186  }
1187  SetQosSupport (from, true);
1188  for (uint8_t j = 0; j < m_wifiPhy->GetNMcs (); j++)
1189  {
1190  WifiMode mcs = m_wifiPhy->GetMcs (j);
1191  if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HT && htCapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
1192  {
1193  AddSupportedMcs (from, mcs);
1194  }
1195  }
1196  state->m_htCapabilities = Create<const HtCapabilities> (htCapabilities);
1197 }
1198 
1199 void
1201 {
1202  //Used by all stations to record VHT capabilities of remote stations
1203  NS_LOG_FUNCTION (this << from << vhtCapabilities);
1204  WifiRemoteStationState *state;
1205  state = LookupState (from);
1206  if (vhtCapabilities.GetSupportedChannelWidthSet () == 1)
1207  {
1208  state->m_channelWidth = 160;
1209  }
1210  else
1211  {
1212  state->m_channelWidth = 80;
1213  }
1214  //This is a workaround to enable users to force a 20 or 40 MHz channel for a VHT-compliant device,
1215  //since IEEE 802.11ac standard says that 20, 40 and 80 MHz channels are mandatory.
1216  if (m_wifiPhy->GetChannelWidth () < state->m_channelWidth)
1217  {
1219  }
1220  for (uint8_t i = 1; i <= m_wifiPhy->GetMaxSupportedTxSpatialStreams (); i++)
1221  {
1222  for (uint8_t j = 0; j < m_wifiPhy->GetNMcs (); j++)
1223  {
1224  WifiMode mcs = m_wifiPhy->GetMcs (j);
1225  if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtCapabilities.IsSupportedMcs (mcs.GetMcsValue (), i))
1226  {
1227  AddSupportedMcs (from, mcs);
1228  }
1229  }
1230  }
1231  state->m_vhtCapabilities = Create<const VhtCapabilities> (vhtCapabilities);
1232 }
1233 
1234 void
1236 {
1237  //Used by all stations to record HE capabilities of remote stations
1238  NS_LOG_FUNCTION (this << from << heCapabilities);
1239  WifiRemoteStationState *state;
1240  state = LookupState (from);
1241  if (Is5Ghz (m_wifiPhy->GetFrequency ()))
1242  {
1243  if (heCapabilities.GetChannelWidthSet () & 0x04)
1244  {
1245  state->m_channelWidth = 160;
1246  }
1247  else if (heCapabilities.GetChannelWidthSet () & 0x02)
1248  {
1249  state->m_channelWidth = 80;
1250  }
1251  //For other cases at 5 GHz, the supported channel width is set by the VHT capabilities
1252  }
1253  else if (Is2_4Ghz (m_wifiPhy->GetFrequency ()))
1254  {
1255  if (heCapabilities.GetChannelWidthSet () & 0x01)
1256  {
1257  state->m_channelWidth = 40;
1258  }
1259  else
1260  {
1261  state->m_channelWidth = 20;
1262  }
1263  }
1264  if (heCapabilities.GetHeLtfAndGiForHePpdus () >= 2)
1265  {
1266  state->m_guardInterval = 800;
1267  }
1268  else if (heCapabilities.GetHeLtfAndGiForHePpdus () == 1)
1269  {
1270  state->m_guardInterval = 1600;
1271  }
1272  else
1273  {
1274  state->m_guardInterval = 3200;
1275  }
1276  for (uint8_t i = 1; i <= m_wifiPhy->GetMaxSupportedTxSpatialStreams (); i++)
1277  {
1278  for (uint8_t j = 0; j < m_wifiPhy->GetNMcs (); j++)
1279  {
1280  WifiMode mcs = m_wifiPhy->GetMcs (j);
1282  && heCapabilities.GetHighestNssSupported () >= i
1283  && heCapabilities.GetHighestMcsSupported () >= j)
1284  {
1285  AddSupportedMcs (from, mcs);
1286  }
1287  }
1288  }
1289  state->m_heCapabilities = Create<const HeCapabilities> (heCapabilities);
1290  SetQosSupport (from, true);
1291 }
1292 
1295 {
1296  return LookupState (from)->m_htCapabilities;
1297 }
1298 
1301 {
1302  return LookupState (from)->m_vhtCapabilities;
1303 }
1304 
1307 {
1308  return LookupState (from)->m_heCapabilities;
1309 }
1310 
1311 bool
1313 {
1315 
1316  if (!htCapabilities)
1317  {
1318  return false;
1319  }
1320  return htCapabilities->GetGreenfield ();
1321 }
1322 
1323 WifiMode
1325 {
1326  return m_defaultTxMode;
1327 }
1328 
1329 WifiMode
1331 {
1332  return m_defaultTxMcs;
1333 }
1334 
1335 void
1337 {
1338  NS_LOG_FUNCTION (this);
1339  for (StationStates::const_iterator i = m_states.begin (); i != m_states.end (); i++)
1340  {
1341  delete (*i);
1342  }
1343  m_states.clear ();
1344  for (Stations::const_iterator i = m_stations.begin (); i != m_stations.end (); i++)
1345  {
1346  delete (*i);
1347  }
1348  m_stations.clear ();
1349  m_bssBasicRateSet.clear ();
1350  m_bssBasicMcsSet.clear ();
1351 }
1352 
1353 void
1355 {
1356  NS_LOG_FUNCTION (this << mode);
1357  if (mode.GetModulationClass () >= WIFI_MOD_CLASS_HT)
1358  {
1359  NS_FATAL_ERROR ("It is not allowed to add a HT rate in the BSSBasicRateSet!");
1360  }
1361  for (uint8_t i = 0; i < GetNBasicModes (); i++)
1362  {
1363  if (GetBasicMode (i) == mode)
1364  {
1365  return;
1366  }
1367  }
1368  m_bssBasicRateSet.push_back (mode);
1369 }
1370 
1371 uint8_t
1373 {
1374  return static_cast<uint8_t> (m_bssBasicRateSet.size ());
1375 }
1376 
1377 WifiMode
1379 {
1380  NS_ASSERT (i < GetNBasicModes ());
1381  return m_bssBasicRateSet[i];
1382 }
1383 
1384 uint32_t
1386 {
1387  uint32_t size = 0;
1388  for (WifiModeListIterator i = m_bssBasicRateSet.begin (); i != m_bssBasicRateSet.end (); i++)
1389  {
1390  if (i->GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM)
1391  {
1392  continue;
1393  }
1394  size++;
1395  }
1396  return size;
1397 }
1398 
1399 WifiMode
1401 {
1403  uint32_t index = 0;
1404  bool found = false;
1405  for (WifiModeListIterator j = m_bssBasicRateSet.begin (); j != m_bssBasicRateSet.end (); )
1406  {
1407  if (i == index)
1408  {
1409  found = true;
1410  }
1411  if (j->GetModulationClass () != WIFI_MOD_CLASS_ERP_OFDM)
1412  {
1413  if (found)
1414  {
1415  break;
1416  }
1417  }
1418  index++;
1419  j++;
1420  }
1421  return m_bssBasicRateSet[index];
1422 }
1423 
1424 void
1426 {
1427  NS_LOG_FUNCTION (this << +mcs.GetMcsValue ());
1428  for (uint8_t i = 0; i < GetNBasicMcs (); i++)
1429  {
1430  if (GetBasicMcs (i) == mcs)
1431  {
1432  return;
1433  }
1434  }
1435  m_bssBasicMcsSet.push_back (mcs);
1436 }
1437 
1438 uint8_t
1440 {
1441  return static_cast<uint8_t> (m_bssBasicMcsSet.size ());
1442 }
1443 
1444 WifiMode
1446 {
1447  NS_ASSERT (i < GetNBasicMcs ());
1448  return m_bssBasicMcsSet[i];
1449 }
1450 
1451 WifiMode
1453 {
1454  if (m_nonUnicastMode == WifiMode ())
1455  {
1456  if (GetNBasicModes () > 0)
1457  {
1458  return GetBasicMode (0);
1459  }
1460  else
1461  {
1462  return GetDefaultMode ();
1463  }
1464  }
1465  else
1466  {
1467  return m_nonUnicastMode;
1468  }
1469 }
1470 
1471 bool
1473  Ptr<const Packet> packet, bool normally)
1474 {
1475  return normally;
1476 }
1477 
1478 bool
1480  Ptr<const Packet> packet, bool normally)
1481 {
1482  return normally;
1483 }
1484 
1485 bool
1487  Ptr<const Packet> packet, bool normally)
1488 {
1489  return normally;
1490 }
1491 
1492 void
1493 WifiRemoteStationManager::DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr)
1494 {
1495  NS_LOG_DEBUG ("DoReportAmpduTxStatus received but the manager does not handle A-MPDUs!");
1496 }
1497 
1498 WifiMode
1500 {
1501  NS_ASSERT (i < GetNSupported (station));
1502  return station->m_state->m_operationalRateSet[i];
1503 }
1504 
1505 WifiMode
1507 {
1508  NS_ASSERT (i < GetNMcsSupported (station));
1509  return station->m_state->m_operationalMcsSet[i];
1510 }
1511 
1512 WifiMode
1514 {
1515  NS_ASSERT (i < GetNNonErpSupported (station));
1516  //IEEE 802.11g standard defines that if the protection mechanism is enabled, Rts, Cts and Cts-To-Self
1517  //frames should select a rate in the BSSBasicRateSet that corresponds to an 802.11b basic rate.
1518  //This is a implemented here to avoid changes in every RAA, but should maybe be moved in case it breaks standard rules.
1519  uint32_t index = 0;
1520  bool found = false;
1521  for (WifiModeListIterator j = station->m_state->m_operationalRateSet.begin (); j != station->m_state->m_operationalRateSet.end (); )
1522  {
1523  if (i == index)
1524  {
1525  found = true;
1526  }
1527  if (j->GetModulationClass () != WIFI_MOD_CLASS_ERP_OFDM)
1528  {
1529  if (found)
1530  {
1531  break;
1532  }
1533  }
1534  index++;
1535  j++;
1536  }
1537  return station->m_state->m_operationalRateSet[index];
1538 }
1539 
1542 {
1543  return station->m_state->m_address;
1544 }
1545 
1546 uint16_t
1548 {
1549  return station->m_state->m_channelWidth;
1550 }
1551 
1552 bool
1554 {
1555  Ptr<const HtCapabilities> htCapabilities = station->m_state->m_htCapabilities;
1556 
1557  if (!htCapabilities)
1558  {
1559  return false;
1560  }
1561  return htCapabilities->GetShortGuardInterval20 ();
1562 }
1563 
1564 uint16_t
1566 {
1567  return station->m_state->m_guardInterval;
1568 }
1569 
1570 bool
1572 {
1573  Ptr<const HtCapabilities> htCapabilities = station->m_state->m_htCapabilities;
1574 
1575  if (!htCapabilities)
1576  {
1577  return false;
1578  }
1579  return htCapabilities->GetGreenfield ();
1580 }
1581 
1582 bool
1584 {
1585  return station->m_state->m_aggregation;
1586 }
1587 
1588 uint8_t
1590 {
1591  Ptr<const HtCapabilities> htCapabilities = station->m_state->m_htCapabilities;
1592 
1593  if (!htCapabilities)
1594  {
1595  return 1;
1596  }
1597  return htCapabilities->GetRxHighestSupportedAntennas ();
1598 }
1599 
1600 uint8_t
1602 {
1603  return station->m_state->m_ness;
1604 }
1605 
1608 {
1609  return m_wifiPhy;
1610 }
1611 
1614 {
1615  return m_wifiMac;
1616 }
1617 
1618 uint8_t
1620 {
1621  return static_cast<uint8_t> (station->m_state->m_operationalRateSet.size ());
1622 }
1623 
1624 bool
1626 {
1627  return station->m_state->m_qosSupported;
1628 }
1629 
1630 bool
1632 {
1633  return (station->m_state->m_htCapabilities != 0);
1634 }
1635 
1636 bool
1638 {
1639  return (station->m_state->m_vhtCapabilities != 0);
1640 }
1641 
1642 bool
1644 {
1645  return (station->m_state->m_heCapabilities != 0);
1646 }
1647 
1648 uint8_t
1650 {
1651  return static_cast<uint8_t> (station->m_state->m_operationalMcsSet.size ());
1652 }
1653 
1654 uint32_t
1656 {
1657  uint32_t size = 0;
1658  for (WifiModeListIterator i = station->m_state->m_operationalRateSet.begin (); i != station->m_state->m_operationalRateSet.end (); i++)
1659  {
1660  if (i->GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM)
1661  {
1662  continue;
1663  }
1664  size++;
1665  }
1666  return size;
1667 }
1668 
1669 uint16_t
1671 {
1673 }
1674 
1675 bool
1677 {
1679 
1680  if (!htCapabilities)
1681  {
1682  return false;
1683  }
1684  return htCapabilities->GetShortGuardInterval20 ();
1685 }
1686 
1687 uint8_t
1689 {
1691 
1692  if (!htCapabilities)
1693  {
1694  return 1;
1695  }
1696  return htCapabilities->GetRxHighestSupportedAntennas ();
1697 }
1698 
1699 uint8_t
1701 {
1702  return static_cast<uint8_t> (LookupState (address)->m_operationalMcsSet.size ());
1703 }
1704 
1705 bool
1707 {
1708  return (LookupState (address)->m_htCapabilities != 0);
1709 }
1710 
1711 bool
1713 {
1714  return (LookupState (address)->m_vhtCapabilities != 0);
1715 }
1716 
1717 bool
1719 {
1720  return (LookupState (address)->m_heCapabilities != 0);
1721 }
1722 
1723 void
1725 {
1726  m_defaultTxPowerLevel = txPower;
1727 }
1728 
1729 uint8_t
1731 {
1732  return m_wifiPhy->GetNumberOfAntennas ();
1733 }
1734 
1735 uint8_t
1737 {
1739 }
1740 
1741 bool
1743 {
1745 }
1746 
1747 } //namespace ns3
uint8_t GetNMcsSupported(Mac48Address address) const
Return the number of MCS supported by the station.
bool m_useNonHtProtection
flag if protection for non-HT stations against HT transmissions is enabled
uint32_t m_ssrc
STA short retry count.
bool GetRifsPermitted(void) const
Return whether the device can use RIFS.
bool m_shortPreamble
Flag if short PLCP preamble is supported by the remote station.
uint8_t GetChannelWidthSet(void) const
Get channel width set.
HighLatencyDataTxVectorTag class.
Definition: tx-vector-tag.h:36
void AddSupportedMcs(Mac48Address address, WifiMode mcs)
Record the MCS index supported by the station.
uint32_t GetNFragments(const WifiMacHeader *header, Ptr< const Packet > packet)
Return the number of fragments needed for the given packet.
Ptr< WifiMac > GetMac(void) const
Return the WifiMac.
void SetDefaultTxPowerLevel(uint8_t txPower)
Set the default transmission power level.
bool GetVhtSupported(void) const
Return whether the device has VHT capability support enabled.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
uint8_t GetNSupported(const WifiRemoteStation *station) const
Return the number of modes supported by the given station.
ERP-OFDM PHY (19.5)
Definition: wifi-mode.h:54
AttributeValue implementation for Boolean.
Definition: boolean.h:36
Ptr< HeConfiguration > GetHeConfiguration(void) const
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
uint32_t m_rtsCtsThreshold
Threshold for RTS/CTS.
bool m_shortSlotTimeEnabled
flag if short slot time is enabled
enum ns3::WifiRemoteStationState::@77 m_state
State of the station.
WifiMode GetMcs(uint8_t mcs) const
The WifiPhy::GetMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of tr...
Definition: wifi-phy.cc:3932
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
bool GetShortPreambleSupported(Mac48Address address) const
Return whether the station supports short PLCP preamble or not.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:852
void ReportFinalDataFailed(Mac48Address address, const WifiMacHeader *header, uint32_t packetSize)
Should be invoked after calling ReportDataFailed if NeedRetransmission returns false.
void AddAllSupportedMcs(Mac48Address address)
Invoked in a STA or AP to store all of the MCS supported by a destination which is also supported loc...
void RecordWaitAssocTxOk(Mac48Address address)
Records that we are waiting for an ACK for the association response we sent.
virtual void DoReportRtsFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
static const uint32_t packetSize
WifiMode m_nonUnicastMode
Transmission mode for non-unicast DATA frames.
void SetBssColor(uint8_t color)
Set the BSS color.
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: enum.h:209
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:84
uint32_t m_nextFragmentationThreshold
Threshold for fragmentation that will be used for the next transmission.
bool Is2_4Ghz(double frequency)
Definition: wifi-utils.cc:59
uint32_t GetSize(void) const
Return the size of the WifiMacHeader in octets.
void ReportDataOk(Mac48Address address, const WifiMacHeader *header, double ackSnr, WifiMode ackMode, double dataSnr, uint32_t packetSize)
Should be invoked whenever we receive the Ack associated to a data packet we just sent...
bool GetHeSupported(void) const
Return whether the device has HE capability support enabled.
#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
Ptr< const HeCapabilities > m_heCapabilities
remote station HE capabilities
static const uint16_t WIFI_MAC_FCS_LENGTH
The length in octects of the IEEE 802.11 MAC FCS field.
WifiMode GetDefaultMcs(void) const
Return the default Modulation and Coding Scheme (MCS) index.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:204
uint32_t m_fragmentationThreshold
Current threshold for fragmentation.
The HT Capabilities Information ElementThis class knows how to serialise and deserialise the HT Capab...
uint8_t m_defaultTxPowerLevel
Default transmission power level.
void SetStbc(bool stbc)
Sets if STBC is being used.
WifiMode GetNonUnicastMode(void) const
Return a mode for non-unicast packets.
WifiMode GetBasicMcs(uint8_t i) const
Return the MCS at the given list index.
Mac48Address m_address
Mac48Address of the remote station.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:162
bool NeedRts(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, WifiTxVector txVector)
void UpdateFragmentationThreshold(void)
Typically called to update the fragmentation threshold at the start of a new transmission.
bool Is5Ghz(double frequency)
Definition: wifi-utils.cc:65
void SetPcfSupported(bool enable)
Enable or disable PCF capability support.
bool GetUseNonHtProtection(void) const
Return whether the device supports protection of non-HT stations.
bool IsLastFragment(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, uint32_t fragmentNumber)
VHT PHY (Clause 22)
Definition: wifi-mode.h:60
TracedCallback< Mac48Address > m_macTxFinalRtsFailed
The trace source fired when the transmission of a RTS has exceeded the maximum number of attempts...
void PrepareForQueue(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
uint32_t GetFragmentationThreshold(void) const
Return the fragmentation threshold.
WifiPreamble GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble, bool useGreenfield)
Return the preamble to be used for the transmission.
Definition: wifi-utils.cc:128
bool GetUseGreenfieldProtection(void) const
Return whether protection for stations that do not support HT greenfield format is enabled...
WifiMode GetSupported(const WifiRemoteStation *station, uint8_t i) const
Return whether mode associated with the specified station at the specified index. ...
uint8_t GetNBasicMcs(void) const
Return the number of basic MCS index.
uint32_t GetNNonErpSupported(const WifiRemoteStation *station) const
Return the number of non-ERP modes supported by the given station.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:97
bool m_shortPreambleEnabled
flag if short PLCP preamble is enabled
uint8_t GetSupportedChannelWidth(void) const
Return the supported channel width.
WifiTxVector GetRtsTxVector(void) const
virtual bool DoNeedRts(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
Tid independent remote station statistics.
WifiRemoteStationState * m_state
Remote station state.
WifiTxVector GetCtsToSelfTxVector(const WifiMacHeader *header, Ptr< const Packet > packet)
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
bool IsMandatory(void) const
Definition: wifi-mode.cc:465
void RecordDisassociated(Mac48Address address)
Records that the STA was disassociated.
phy
Definition: third.py:93
TracedCallback< Mac48Address > m_macTxFinalDataFailed
The trace source fired when the transmission of a data packet has exceeded the maximum number of atte...
uint16_t GetChannelWidth(void) const
Definition: wifi-phy.cc:1388
The attribute can be read.
Definition: type-id.h:63
void SetShortSlotTimeEnabled(bool enable)
Enable or disable short slot time.
uint8_t GetNMcs(void) const
The WifiPhy::GetNMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of t...
Definition: wifi-phy.cc:3926
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition: wifi-preamble.h:32
uint8_t GetNumberOfSupportedStreams(Mac48Address address) const
Return the number of spatial streams supported by the station.
bool GetShortPreambleEnabled(void) const
Return whether the device uses short PLCP preambles.
bool GetGreenfield(const WifiRemoteStation *station) const
Return whether the station supports Greenfield or not.
ProtectionMode m_htProtectionMode
Protection mode for HT stations when non-HT stations are detected.
WifiTxVector GetDataTxVector(void) const
void SetRtsCtsThreshold(uint32_t threshold)
Sets the RTS threshold.
bool m_qosSupported
Flag if HT is supported by the station.
Hold variables of type enum.
Definition: enum.h:54
WifiRemoteStationState * LookupState(Mac48Address address) const
Return the state of the station associated with the given address.
WifiMode m_defaultTxMcs
The default transmission modulation-coding scheme (MCS)
bool IsSupportedMcs(uint8_t mcs) const
Return the is MCS supported flag.
virtual void DoReportRtsOk(WifiRemoteStation *station, double ctsSnr, WifiMode ctsMode, double rtsSnr)=0
This method is a pure virtual method that must be implemented by the sub-class.
Ptr< WifiPhy > m_wifiPhy
This is a pointer to the WifiPhy associated with this WifiRemoteStationManager that is set on call to...
virtual void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)=0
This method is a pure virtual method that must be implemented by the sub-class.
void ReportRtsFailed(Mac48Address address, const WifiMacHeader *header)
Should be invoked whenever the RtsTimeout associated to a transmission attempt expires.
bool GetPcfSupported(void) const
Return whether the device has PCF capability support enabled.
bool GetShortSlotTimeSupported(Mac48Address address) const
Return whether the station supports short ERP slot time or not.
The IEEE 802.11ac VHT Capabilities.
void SetGuardInterval(uint16_t guardInterval)
Sets the guard interval duration (in nanoseconds)
bool m_useNonErpProtection
flag if protection for non-ERP stations against ERP transmissions is enabled
Hold an unsigned integer type.
Definition: uinteger.h:44
virtual void DoReportDataFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
uint8_t GetSupportedChannelWidthSet() const
Get the supported channel width set.
uint8_t data[writeSize]
void RecordGotAssocTxFailed(Mac48Address address)
Records that we missed an ACK for the association response we sent.
bool GetHtSupported(void) const
Return whether the device has HT capability support enabled.
void AddStationHtCapabilities(Mac48Address from, HtCapabilities htcapabilities)
Records HT capabilities of the remote station.
mac
Definition: third.py:99
uint16_t ConvertGuardIntervalToNanoSeconds(WifiMode mode, const Ptr< WifiNetDevice > device)
Convert the guard interval to nanoseconds based on the wifimode.
Definition: wifi-utils.cc:71
WifiRemoteStationInfo GetInfo(Mac48Address address)
uint8_t GetQosTid(void) const
Return the Traffic ID of a QoS header.
void SetMaxSsrc(uint32_t maxSsrc)
Sets the maximum STA short retry count (SSRC).
WifiMode GetMode(void) const
HT PHY (Clause 20)
Definition: wifi-mode.h:58
uint32_t m_maxSlrc
Maximum STA long retry count (SLRC)
bool m_pcfSupported
Flag if PCF capability is supported.
Ptr< const HeCapabilities > GetStationHeCapabilities(Mac48Address from)
Return the HE capabilities sent by the remote station.
bool NeedRetransmission(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
Ptr< WifiMac > m_wifiMac
This is a pointer to the WifiMac associated with this WifiRemoteStationManager that is set on call to...
Ptr< const VhtCapabilities > m_vhtCapabilities
remote station VHT capabilities
uint32_t GetNNonErpBasicModes(void) const
Return the number of non-ERP basic modes we support.
Ptr< const HtCapabilities > m_htCapabilities
remote station HT capabilities
WifiMode GetNonErpBasicMode(uint8_t i) const
Return a basic mode from the set of basic modes that is not an ERP mode.
void AddStationHeCapabilities(Mac48Address from, HeCapabilities hecapabilities)
Records HE capabilities of the remote station.
bool IsAssociated(Mac48Address address) const
Return whether the station associated.
virtual void SetupPhy(const Ptr< WifiPhy > phy)
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
hold a list of per-remote-station state.
WifiModulationClass GetModulationClass() const
Definition: wifi-mode.cc:494
bool GetQosSupported(Mac48Address address) const
Return whether the given station is QoS capable.
Ptr< const HtCapabilities > GetStationHtCapabilities(Mac48Address from)
Return the HT capabilities sent by the remote station.
WifiMode GetDefaultMode(void) const
Return the default transmission mode.
void SetQosSupport(Mac48Address from, bool qosSupported)
Records QoS support of the remote station.
WifiMode m_defaultTxMode
The default transmission mode.
void SetNss(uint8_t nss)
Sets the number of Nss refer to IEEE 802.11n Table 20-28 for explanation and range.
WifiModeList m_bssBasicRateSet
This member is the list of WifiMode objects that comprise the BSSBasicRateSet parameter.
uint64_t Get(void) const
Definition: uinteger.cc:35
uint32_t GetFragmentOffset(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, uint32_t fragmentNumber)
bool GetShortSlotTimeEnabled(void) const
Return whether the device uses short slot time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
address
Definition: first.py:44
WifiTxVector DoGetCtsToSelfTxVector(void)
Since CTS-to-self parameters are not dependent on the station, it is implemented in wifiremote statio...
uint16_t GetFrequency(void) const
Definition: wifi-phy.cc:1368
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
uint8_t GetNumberOfAntennas(void) const
Definition: wifi-phy.cc:1402
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...
WifiModeList m_operationalRateSet
This member is the list of WifiMode objects that comprise the OperationalRateSet parameter for this r...
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
uint32_t GetFragmentSize(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, uint32_t fragmentNumber)
void DoSetFragmentationThreshold(uint32_t threshold)
Actually sets the fragmentation threshold, it also checks the validity of the given threshold...
void AddBasicMode(WifiMode mode)
Invoked in a STA upon association to store the set of rates which belong to the BSSBasicRateSet of th...
uint16_t GetChannelWidthForTransmission(WifiMode mode, uint16_t maxSupportedChannelWidth)
Return the channel width that corresponds to the selected mode (instead of letting the PHY&#39;s default ...
Definition: wifi-utils.cc:109
void SetUseNonErpProtection(bool enable)
Enable or disable protection for non-ERP stations.
WifiModeList::const_iterator WifiModeListIterator
An iterator for WifiModeList vector.
Definition: wifi-mode.h:254
bool UseGreenfieldForDestination(Mac48Address dest) const
bool m_useGreenfieldProtection
flag if protection for stations that do not support HT greenfield format is enabled ...
bool m_aggregation
Flag if MPDU aggregation is used by the remote station.
an EUI-48 address
Definition: mac48-address.h:43
TracedCallback< Mac48Address > m_macTxRtsFailed
The trace source fired when the transmission of a single RTS has failed.
virtual bool IsLowLatency(void) const =0
Mac48Address GetAddress(const WifiRemoteStation *station) const
Return the address of the station.
WifiMode GetNonErpSupported(const WifiRemoteStation *station, uint8_t i) const
Return whether non-ERP mode associated with the specified station at the specified index...
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
Ptr< const AttributeAccessor > MakeWifiModeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: wifi-mode.h:242
void SetNTx(uint8_t nTx)
Sets the number of TX antennas.
bool GetShortGuardIntervalSupported(void) const
Return whether the device has SGI support enabled.
Stations m_stations
Information for each known stations.
void ReportRtsOk(Mac48Address address, const WifiMacHeader *header, double ctsSnr, WifiMode ctsMode, double rtsSnr)
Should be invoked whenever we receive the Cts associated to an RTS we just sent.
TracedCallback< Mac48Address > m_macTxDataFailed
The trace source fired when the transmission of a single data packet has failed.
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
uint16_t m_channelWidth
Channel width (in MHz) supported by the remote station.
virtual bool DoNeedRetransmission(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
uint8_t GetHighestMcsSupported(void) const
Get highest MCS supported.
void AddBasicMcs(WifiMode mcs)
Add a given Modulation and Coding Scheme (MCS) index to the set of basic MCS.
void AddSupportedPlcpPreamble(Mac48Address address, bool isShortPreambleSupported)
Record whether the short PLCP preamble is supported by the station.
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
uint8_t GetNModes(void) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Definition: wifi-phy.cc:3914
virtual bool DoNeedFragmentation(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
bool NeedCtsToSelf(WifiTxVector txVector)
Return if we need to do Cts-to-self before sending a DATA.
HighLatencyCtsToSelfTxVectorTag class.
uint8_t GetNBasicModes(void) const
Return the number of basic modes we support.
uint8_t GetHeLtfAndGiForHePpdus(void) const
Get HE LTF and GI for HE PDPUs.
void SetUseNonHtProtection(bool enable)
Enable or disable protection for non-HT stations.
Ptr< const AttributeChecker > MakeEnumChecker(int v1, std::string n1, int v2, std::string n2, int v3, std::string n3, int v4, std::string n4, int v5, std::string n5, int v6, std::string n6, int v7, std::string n7, int v8, std::string n8, int v9, std::string n9, int v10, std::string n10, int v11, std::string n11, int v12, std::string n12, int v13, std::string n13, int v14, std::string n14, int v15, std::string n15, int v16, std::string n16, int v17, std::string n17, int v18, std::string n18, int v19, std::string n19, int v20, std::string n20, int v21, std::string n21, int v22, std::string n22)
Make an EnumChecker pre-configured with a set of allowed values by name.
Definition: enum.cc:184
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
virtual void SetupMac(const Ptr< WifiMac > mac)
Set up MAC associated with this device since it is the object that knows the full set of timing param...
void SetMaxSlrc(uint32_t maxSlrc)
Sets the maximum STA long retry count (SLRC).
Ptr< WifiPhy > GetPhy(void) const
Return the WifiPhy.
void ReportDataFailed(Mac48Address address, const WifiMacHeader *header, uint32_t packetSize)
Should be invoked whenever the AckTimeout associated to a transmission attempt expires.
WifiTxVector GetDataTxVector(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
uint16_t GetGuardInterval(void) const
Return the supported HE guard interval duration (in nanoseconds).
bool IsMgt(void) const
Return true if the Type is Management.
A struct that holds information about each remote station.
WifiModeList m_operationalMcsSet
operational MCS set
static TypeId GetTypeId(void)
Get the type ID.
void AddPacketTag(const Tag &tag) const
Add a packet tag.
Definition: packet.cc:863
void AddSupportedErpSlotTime(Mac48Address address, bool isShortSlotTimeSupported)
Record whether the short ERP slot time is supported by the station.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:264
void SetFragmentationThreshold(uint32_t threshold)
Sets a fragmentation threshold.
void Reset(void)
Reset the station, invoked in a STA upon dis-association or in an AP upon reboot. ...
bool GetUseNonErpProtection(void) const
Return whether the device supports protection of non-ERP stations.
uint32_t m_maxSsrc
Maximum STA short retry count (SSRC)
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:272
virtual void DoDispose(void)
Destructor implementation.
Ptr< const VhtCapabilities > GetStationVhtCapabilities(Mac48Address from)
Return the VHT capabilities sent by the remote station.
bool GetGreenfieldSupported(void) const
Return whether the device has HT Greenfield support enabled.
void ReportRxOk(Mac48Address address, const WifiMacHeader *header, double rxSnr, WifiMode txMode)
void SetUseGreenfieldProtection(bool enable)
Enable or disable protection for stations that do not support HT greenfield format.
bool NeedFragmentation(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
void SetNess(uint8_t ness)
Sets the Ness number refer to IEEE 802.11n Table 20-6 for explanation.
WifiRemoteStation * Lookup(Mac48Address address, uint8_t tid) const
Return the station associated with the given address and TID.
Ptr< NetDevice > GetDevice(void) const
Return the device this PHY is associated with.
Definition: wifi-phy.cc:742
WifiTxVector GetCtsToSelfTxVector(void) const
bool IsQosData(void) const
Return true if the Type is DATA and Subtype is one of the possible values for QoS DATA...
Ptr< const AttributeChecker > MakeWifiModeChecker(void)
Definition: wifi-mode.cc:681
uint8_t m_ness
Number of streams in beamforming of the remote station.
bool m_shortSlotTime
Flag if short ERP slot time is supported by the remote station.
void ReportAmpduTxStatus(Mac48Address address, uint8_t tid, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr)
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
WifiTxVector GetRtsTxVector(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
A base class which provides memory management and object aggregation.
Definition: object.h:87
AttributeValue implementation for WifiMode.
Definition: wifi-mode.h:242
virtual void DoReportAmpduTxStatus(WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr)
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
StationStates m_states
States of known stations.
bool IsWaitAssocTxOk(Mac48Address address) const
Return whether we are waiting for an ACK for the association response we sent.
void SetShortPreambleEnabled(bool enable)
Enable or disable short PLCP preambles.
bool IsSupportedMcs(uint8_t mcs, uint8_t Nss) const
Get the is MCS supported.
ProtectionMode m_erpProtectionMode
Protection mode for ERP stations when non-ERP stations are detected.
WifiMode GetBasicMode(uint8_t i) const
Return a basic mode from the set of basic modes.
uint32_t m_slrc
STA long retry count.
void AddAllSupportedModes(Mac48Address address)
Invoked in a STA or AP to store all of the modes supported by a destination which is also supported l...
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)=0
Ptr< VhtConfiguration > GetVhtConfiguration(void) const
The IEEE 802.11ax HE Capabilities.
uint8_t GetMcsValue(void) const
Definition: wifi-mode.cc:472
Ptr< HtConfiguration > GetHtConfiguration(void) const
virtual void DoReportFinalDataFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: uinteger.h:45
virtual WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)=0
bool IsBrandNew(Mac48Address address) const
Return whether the station state is brand new.
uint8_t GetMaxSupportedTxSpatialStreams(void) const
Definition: wifi-phy.cc:1421
a unique identifier for an interface.
Definition: type-id.h:58
bool m_rifsPermitted
flag if RIFS is enabled
void ReportFinalRtsFailed(Mac48Address address, const WifiMacHeader *header)
Should be invoked after calling ReportRtsFailed if NeedRetransmission returns false.
void RemoveAllSupportedMcs(Mac48Address address)
Invoked in a STA or AP to delete all of the supported MCS by a destination.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:915
HighLatencyRtsTxVectorTag class.
Definition: tx-vector-tag.h:69
WifiRemoteStationInfo m_info
remote station info
WifiModeList m_bssBasicMcsSet
basic MCS set
virtual void DoReportFinalRtsFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
HE PHY (Clause 26)
Definition: wifi-mode.h:62
hold per-remote-station state.
void SetRifsPermitted(bool allow)
Permit or prohibit RIFS.
virtual WifiRemoteStation * DoCreateStation(void) const =0
void RecordGotAssocTxOk(Mac48Address address)
Records that we got an ACK for the association response we sent.
uint8_t GetHighestNssSupported(void) const
Get highest NSS supported.
void AddStationVhtCapabilities(Mac48Address from, VhtCapabilities vhtcapabilities)
Records VHT capabilities of the remote station.
Implements the IEEE 802.11 MAC header.
WifiMode GetMcsSupported(const WifiRemoteStation *station, uint8_t i) const
Return the WifiMode supported by the specified station at the specified index.
uint16_t GetChannelWidthSupported(Mac48Address address) const
Return the channel width supported by the station.
virtual void DoReportDataOk(WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr)=0
This method is a pure virtual method that must be implemented by the sub-class.
uint16_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
uint8_t GetNess(const WifiRemoteStation *station) const
uint16_t m_guardInterval
HE Guard interval duration (in nanoseconds) supported by the remote station.
uint32_t DoGetFragmentationThreshold(void) const
Return the current fragmentation threshold.