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 = DoGetDataTxVector (Lookup (address, header));
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);
586  txVector.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mgtMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ())));
587  }
588  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
589  Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration ();
590  if (heConfiguration)
591  {
592  UintegerValue bssColor;
593  heConfiguration->GetAttribute ("BssColor", bssColor);
594  txVector.SetBssColor (bssColor.Get ());
595  }
596  return txVector;
597 }
598 
601  Ptr<const Packet> packet)
602 {
603  NS_LOG_FUNCTION (this << *header << packet);
604  if (!IsLowLatency ())
605  {
606  HighLatencyCtsToSelfTxVectorTag ctstoselftag;
607  bool found = ConstCast<Packet> (packet)->PeekPacketTag (ctstoselftag);
608  NS_ASSERT (found);
609  return ctstoselftag.GetCtsToSelfTxVector ();
610  }
611  return DoGetCtsToSelfTxVector ();
612 }
613 
616 {
617  WifiMode defaultMode = GetDefaultMode ();
618  WifiPreamble defaultPreamble;
619  if (defaultMode.GetModulationClass () == WIFI_MOD_CLASS_HE)
620  {
621  defaultPreamble = WIFI_PREAMBLE_HE_SU;
622  }
623  else if (defaultMode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
624  {
625  defaultPreamble = WIFI_PREAMBLE_VHT_SU;
626  }
627  else if (defaultMode.GetModulationClass () == WIFI_MOD_CLASS_HT)
628  {
629  defaultPreamble = WIFI_PREAMBLE_HT_MF;
630  }
631  else
632  {
633  defaultPreamble = WIFI_PREAMBLE_LONG;
634  }
635 
636  return WifiTxVector (defaultMode,
638  defaultPreamble,
639  ConvertGuardIntervalToNanoSeconds (defaultMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ())),
642  0,
644  false,
645  false);
646 }
647 
650  Ptr<const Packet> packet)
651 {
652  NS_LOG_FUNCTION (this << address << *header << packet);
653  if (address.IsGroup ())
654  {
655  WifiMode mode = GetNonUnicastMode ();
656  WifiTxVector v;
657  v.SetMode (mode);
661  v.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ())));
662  v.SetNTx (1);
663  v.SetNss (1);
664  v.SetNess (0);
665  v.SetStbc (0);
666  return v;
667  }
668  if (!IsLowLatency ())
669  {
671  bool found = ConstCast<Packet> (packet)->PeekPacketTag (rtstag);
672  NS_ASSERT (found);
673  return rtstag.GetRtsTxVector ();
674  }
675  return DoGetRtsTxVector (Lookup (address, header));
676 }
677 
678 void
680 {
681  NS_LOG_FUNCTION (this << address << *header);
682  NS_ASSERT (!address.IsGroup ());
683  WifiRemoteStation *station = Lookup (address, header);
684  station->m_ssrc++;
686  DoReportRtsFailed (station);
687 }
688 
689 void
691  uint32_t packetSize)
692 {
693  NS_LOG_FUNCTION (this << address << *header);
694  NS_ASSERT (!address.IsGroup ());
695  WifiRemoteStation *station = Lookup (address, header);
696  bool longMpdu = (packetSize + header->GetSize () + WIFI_MAC_FCS_LENGTH) > m_rtsCtsThreshold;
697  if (longMpdu)
698  {
699  station->m_slrc++;
700  }
701  else
702  {
703  station->m_ssrc++;
704  }
706  DoReportDataFailed (station);
707 }
708 
709 void
711  double ctsSnr, WifiMode ctsMode, double rtsSnr)
712 {
713  NS_LOG_FUNCTION (this << address << *header << ctsSnr << ctsMode << rtsSnr);
714  NS_ASSERT (!address.IsGroup ());
715  WifiRemoteStation *station = Lookup (address, header);
716  station->m_state->m_info.NotifyTxSuccess (station->m_ssrc);
717  station->m_ssrc = 0;
718  DoReportRtsOk (station, ctsSnr, ctsMode, rtsSnr);
719 }
720 
721 void
723  double ackSnr, WifiMode ackMode, double dataSnr,
724  uint32_t packetSize)
725 {
726  NS_LOG_FUNCTION (this << address << *header << ackSnr << ackMode << dataSnr);
727  NS_ASSERT (!address.IsGroup ());
728  WifiRemoteStation *station = Lookup (address, header);
729  bool longMpdu = (packetSize + header->GetSize () + WIFI_MAC_FCS_LENGTH) > m_rtsCtsThreshold;
730  if (longMpdu)
731  {
732  station->m_state->m_info.NotifyTxSuccess (station->m_slrc);
733  station->m_slrc = 0;
734  }
735  else
736  {
737  station->m_state->m_info.NotifyTxSuccess (station->m_ssrc);
738  station->m_ssrc = 0;
739  }
740  DoReportDataOk (station, ackSnr, ackMode, dataSnr);
741 }
742 
743 void
745 {
746  NS_LOG_FUNCTION (this << address << *header);
747  NS_ASSERT (!address.IsGroup ());
748  WifiRemoteStation *station = Lookup (address, header);
749  station->m_state->m_info.NotifyTxFailed ();
750  station->m_ssrc = 0;
752  DoReportFinalRtsFailed (station);
753 }
754 
755 void
757  uint32_t packetSize)
758 {
759  NS_LOG_FUNCTION (this << address << *header);
760  NS_ASSERT (!address.IsGroup ());
761  WifiRemoteStation *station = Lookup (address, header);
762  station->m_state->m_info.NotifyTxFailed ();
763  bool longMpdu = (packetSize + header->GetSize () + WIFI_MAC_FCS_LENGTH) > m_rtsCtsThreshold;
764  if (longMpdu)
765  {
766  station->m_slrc = 0;
767  }
768  else
769  {
770  station->m_ssrc = 0;
771  }
773  DoReportFinalDataFailed (station);
774 }
775 
776 void
778  double rxSnr, WifiMode txMode)
779 {
780  NS_LOG_FUNCTION (this << address << *header << rxSnr << txMode);
781  if (address.IsGroup ())
782  {
783  return;
784  }
785  WifiRemoteStation *station = Lookup (address, header);
786  DoReportRxOk (station, rxSnr, txMode);
787 }
788 
789 void
791  uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus,
792  double rxSnr, double dataSnr)
793 {
794  NS_LOG_FUNCTION (this << address << +tid << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr);
795  NS_ASSERT (!address.IsGroup ());
796  WifiRemoteStation *station = Lookup (address, tid);
797  for (uint8_t i = 0; i < nFailedMpdus; i++)
798  {
800  }
801  DoReportAmpduTxStatus (station, nSuccessfulMpdus, nFailedMpdus, rxSnr, dataSnr);
802 }
803 
804 bool
806  Ptr<const Packet> packet, WifiTxVector txVector)
807 {
808  WifiMode mode = txVector.GetMode ();
809  NS_LOG_FUNCTION (this << address << *header << packet << mode);
810  if (address.IsGroup ())
811  {
812  return false;
813  }
816  || (mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
817  || (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
818  || (mode.GetModulationClass () == WIFI_MOD_CLASS_HE))
820  {
821  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedRTS returning true to protect non-ERP stations");
822  return true;
823  }
824  else if (m_htProtectionMode == RTS_CTS
825  && ((mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
826  || (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT))
829  {
830  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedRTS returning true to protect non-HT stations");
831  return true;
832  }
833  bool normally = (packet->GetSize () + header->GetSize () + WIFI_MAC_FCS_LENGTH) > m_rtsCtsThreshold;
834  return DoNeedRts (Lookup (address, header), packet, normally);
835 }
836 
837 bool
839 {
840  WifiMode mode = txVector.GetMode ();
841  NS_LOG_FUNCTION (this << mode);
844  || (mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
845  || (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
846  || (mode.GetModulationClass () == WIFI_MOD_CLASS_HE))
848  {
849  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning true to protect non-ERP stations");
850  return true;
851  }
852  else if (m_htProtectionMode == CTS_TO_SELF
853  && ((mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
854  || (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT))
857  {
858  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning true to protect non-HT stations");
859  return true;
860  }
861  else if (!m_useNonErpProtection)
862  {
863  //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
864  for (WifiModeListIterator i = m_bssBasicRateSet.begin (); i != m_bssBasicRateSet.end (); i++)
865  {
866  if (mode == *i)
867  {
868  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning false");
869  return false;
870  }
871  }
872  if (GetHtSupported ())
873  {
874  //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
875  for (WifiModeListIterator i = m_bssBasicMcsSet.begin (); i != m_bssBasicMcsSet.end (); i++)
876  {
877  if (mode == *i)
878  {
879  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning false");
880  return false;
881  }
882  }
883  }
884  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning true");
885  return true;
886  }
887  return false;
888 }
889 
890 void
892 {
893  NS_LOG_FUNCTION (this << enable);
894  m_useNonErpProtection = enable;
895 }
896 
897 bool
899 {
900  return m_useNonErpProtection;
901 }
902 
903 void
905 {
906  NS_LOG_FUNCTION (this << enable);
907  m_useNonHtProtection = enable;
908 }
909 
910 bool
912 {
913  return m_useNonHtProtection;
914 }
915 
916 void
918 {
919  NS_LOG_FUNCTION (this << enable);
920  m_useGreenfieldProtection = enable;
921 }
922 
923 bool
925 {
927 }
928 
929 bool
931  Ptr<const Packet> packet)
932 {
933  NS_LOG_FUNCTION (this << address << packet << *header);
934  NS_ASSERT (!address.IsGroup ());
935  WifiRemoteStation *station = Lookup (address, header);
936  bool longMpdu = (packet->GetSize () + header->GetSize () + WIFI_MAC_FCS_LENGTH) > m_rtsCtsThreshold;
937  uint32_t retryCount, maxRetryCount;
938  if (longMpdu)
939  {
940  retryCount = station->m_slrc;
941  maxRetryCount = m_maxSlrc;
942  }
943  else
944  {
945  retryCount = station->m_ssrc;
946  maxRetryCount = m_maxSsrc;
947  }
948  bool normally = retryCount < maxRetryCount;
949  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedRetransmission count: " << retryCount << " result: " << std::boolalpha << normally);
950  return DoNeedRetransmission (station, packet, normally);
951 }
952 
953 bool
955  Ptr<const Packet> packet)
956 {
957  NS_LOG_FUNCTION (this << address << packet << *header);
958  if (address.IsGroup ())
959  {
960  return false;
961  }
962  WifiRemoteStation *station = Lookup (address, header);
963  bool normally = (packet->GetSize () + header->GetSize () + WIFI_MAC_FCS_LENGTH) > GetFragmentationThreshold ();
964  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedFragmentation result: " << std::boolalpha << normally);
965  return DoNeedFragmentation (station, packet, normally);
966 }
967 
968 void
970 {
971  NS_LOG_FUNCTION (this << threshold);
972  if (threshold < 256)
973  {
974  /*
975  * ASN.1 encoding of the MAC and PHY MIB (256 ... 8000)
976  */
977  NS_LOG_WARN ("Fragmentation threshold should be larger than 256. Setting to 256.");
979  }
980  else
981  {
982  /*
983  * The length of each fragment shall be an even number of octets, except for the last fragment if an MSDU or
984  * MMPDU, which may be either an even or an odd number of octets.
985  */
986  if (threshold % 2 != 0)
987  {
988  NS_LOG_WARN ("Fragmentation threshold should be an even number. Setting to " << threshold - 1);
989  m_nextFragmentationThreshold = threshold - 1;
990  }
991  else
992  {
993  m_nextFragmentationThreshold = threshold;
994  }
995  }
996 }
997 
998 void
1000 {
1002 }
1003 
1004 uint32_t
1006 {
1007  return m_fragmentationThreshold;
1008 }
1009 
1010 uint32_t
1012 {
1013  NS_LOG_FUNCTION (this << *header << packet);
1014  //The number of bytes a fragment can support is (Threshold - WIFI_HEADER_SIZE - WIFI_FCS).
1015  uint32_t nFragments = (packet->GetSize () / (GetFragmentationThreshold () - header->GetSize () - WIFI_MAC_FCS_LENGTH));
1016 
1017  //If the size of the last fragment is not 0.
1018  if ((packet->GetSize () % (GetFragmentationThreshold () - header->GetSize () - WIFI_MAC_FCS_LENGTH)) > 0)
1019  {
1020  nFragments++;
1021  }
1022  NS_LOG_DEBUG ("WifiRemoteStationManager::GetNFragments returning " << nFragments);
1023  return nFragments;
1024 }
1025 
1026 uint32_t
1028  Ptr<const Packet> packet, uint32_t fragmentNumber)
1029 {
1030  NS_LOG_FUNCTION (this << address << *header << packet << fragmentNumber);
1031  NS_ASSERT (!address.IsGroup ());
1032  uint32_t nFragment = GetNFragments (header, packet);
1033  if (fragmentNumber >= nFragment)
1034  {
1035  NS_LOG_DEBUG ("WifiRemoteStationManager::GetFragmentSize returning 0");
1036  return 0;
1037  }
1038  //Last fragment
1039  if (fragmentNumber == nFragment - 1)
1040  {
1041  uint32_t lastFragmentSize = packet->GetSize () - (fragmentNumber * (GetFragmentationThreshold () - header->GetSize () - WIFI_MAC_FCS_LENGTH));
1042  NS_LOG_DEBUG ("WifiRemoteStationManager::GetFragmentSize returning " << lastFragmentSize);
1043  return lastFragmentSize;
1044  }
1045  //All fragments but the last, the number of bytes is (Threshold - WIFI_HEADER_SIZE - WIFI_FCS).
1046  else
1047  {
1048  uint32_t fragmentSize = GetFragmentationThreshold () - header->GetSize () - WIFI_MAC_FCS_LENGTH;
1049  NS_LOG_DEBUG ("WifiRemoteStationManager::GetFragmentSize returning " << fragmentSize);
1050  return fragmentSize;
1051  }
1052 }
1053 
1054 uint32_t
1056  Ptr<const Packet> packet, uint32_t fragmentNumber)
1057 {
1058  NS_LOG_FUNCTION (this << address << *header << packet << fragmentNumber);
1059  NS_ASSERT (!address.IsGroup ());
1060  NS_ASSERT (fragmentNumber < GetNFragments (header, packet));
1061  uint32_t fragmentOffset = fragmentNumber * (GetFragmentationThreshold () - header->GetSize () - WIFI_MAC_FCS_LENGTH);
1062  NS_LOG_DEBUG ("WifiRemoteStationManager::GetFragmentOffset returning " << fragmentOffset);
1063  return fragmentOffset;
1064 }
1065 
1066 bool
1068  Ptr<const Packet> packet, uint32_t fragmentNumber)
1069 {
1070  NS_LOG_FUNCTION (this << address << *header << packet << fragmentNumber);
1071  NS_ASSERT (!address.IsGroup ());
1072  bool isLast = fragmentNumber == (GetNFragments (header, packet) - 1);
1073  NS_LOG_DEBUG ("WifiRemoteStationManager::IsLastFragment returning " << std::boolalpha << isLast);
1074  return isLast;
1075 }
1076 
1077 uint8_t
1079 {
1080  return m_defaultTxPowerLevel;
1081 }
1082 
1085 {
1087  return state->m_info;
1088 }
1089 
1092 {
1093  NS_LOG_FUNCTION (this << address);
1094  for (StationStates::const_iterator i = m_states.begin (); i != m_states.end (); i++)
1095  {
1096  if ((*i)->m_address == address)
1097  {
1098  NS_LOG_DEBUG ("WifiRemoteStationManager::LookupState returning existing state");
1099  return (*i);
1100  }
1101  }
1104  state->m_address = address;
1105  state->m_operationalRateSet.push_back (GetDefaultMode ());
1106  state->m_operationalMcsSet.push_back (GetDefaultMcs ());
1107  state->m_htCapabilities = 0;
1108  state->m_vhtCapabilities = 0;
1109  state->m_heCapabilities = 0;
1111  state->m_guardInterval = GetGuardInterval ();
1112  state->m_ness = 0;
1113  state->m_aggregation = false;
1114  state->m_qosSupported = false;
1115  const_cast<WifiRemoteStationManager *> (this)->m_states.push_back (state);
1116  NS_LOG_DEBUG ("WifiRemoteStationManager::LookupState returning new state");
1117  return state;
1118 }
1119 
1122 {
1123  uint8_t tid;
1124  if (header->IsQosData ())
1125  {
1126  tid = header->GetQosTid ();
1127  }
1128  else
1129  {
1130  tid = 0;
1131  }
1132  return Lookup (address, tid);
1133 }
1134 
1137 {
1138  NS_LOG_FUNCTION (this << address << +tid);
1139  for (Stations::const_iterator i = m_stations.begin (); i != m_stations.end (); i++)
1140  {
1141  if ((*i)->m_tid == tid
1142  && (*i)->m_state->m_address == address)
1143  {
1144  return (*i);
1145  }
1146  }
1148 
1149  WifiRemoteStation *station = DoCreateStation ();
1150  station->m_state = state;
1151  station->m_tid = tid;
1152  station->m_ssrc = 0;
1153  station->m_slrc = 0;
1154  const_cast<WifiRemoteStationManager *> (this)->m_stations.push_back (station);
1155  return station;
1156 }
1157 
1158 void
1160 {
1161  NS_LOG_FUNCTION (this << from << qosSupported);
1162  WifiRemoteStationState *state;
1163  state = LookupState (from);
1164  state->m_qosSupported = qosSupported;
1165 }
1166 
1167 void
1169 {
1170  //Used by all stations to record HT capabilities of remote stations
1171  NS_LOG_FUNCTION (this << from << htCapabilities);
1172  WifiRemoteStationState *state;
1173  state = LookupState (from);
1174  if (htCapabilities.GetSupportedChannelWidth () == 1)
1175  {
1176  state->m_channelWidth = 40;
1177  }
1178  else
1179  {
1180  state->m_channelWidth = 20;
1181  }
1182  SetQosSupport (from, true);
1183  for (uint8_t j = 0; j < m_wifiPhy->GetNMcs (); j++)
1184  {
1185  WifiMode mcs = m_wifiPhy->GetMcs (j);
1186  if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HT && htCapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
1187  {
1188  AddSupportedMcs (from, mcs);
1189  }
1190  }
1191  state->m_htCapabilities = Create<const HtCapabilities> (htCapabilities);
1192 }
1193 
1194 void
1196 {
1197  //Used by all stations to record VHT capabilities of remote stations
1198  NS_LOG_FUNCTION (this << from << vhtCapabilities);
1199  WifiRemoteStationState *state;
1200  state = LookupState (from);
1201  if (vhtCapabilities.GetSupportedChannelWidthSet () == 1)
1202  {
1203  state->m_channelWidth = 160;
1204  }
1205  else
1206  {
1207  state->m_channelWidth = 80;
1208  }
1209  //This is a workaround to enable users to force a 20 or 40 MHz channel for a VHT-compliant device,
1210  //since IEEE 802.11ac standard says that 20, 40 and 80 MHz channels are mandatory.
1211  if (m_wifiPhy->GetChannelWidth () < state->m_channelWidth)
1212  {
1214  }
1215  for (uint8_t i = 1; i <= m_wifiPhy->GetMaxSupportedTxSpatialStreams (); i++)
1216  {
1217  for (uint8_t j = 0; j < m_wifiPhy->GetNMcs (); j++)
1218  {
1219  WifiMode mcs = m_wifiPhy->GetMcs (j);
1220  if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtCapabilities.IsSupportedMcs (mcs.GetMcsValue (), i))
1221  {
1222  AddSupportedMcs (from, mcs);
1223  }
1224  }
1225  }
1226  state->m_vhtCapabilities = Create<const VhtCapabilities> (vhtCapabilities);
1227 }
1228 
1229 void
1231 {
1232  //Used by all stations to record HE capabilities of remote stations
1233  NS_LOG_FUNCTION (this << from << heCapabilities);
1234  WifiRemoteStationState *state;
1235  state = LookupState (from);
1236  if (Is5Ghz (m_wifiPhy->GetFrequency ()))
1237  {
1238  if (heCapabilities.GetChannelWidthSet () & 0x04)
1239  {
1240  state->m_channelWidth = 160;
1241  }
1242  else if (heCapabilities.GetChannelWidthSet () & 0x02)
1243  {
1244  state->m_channelWidth = 80;
1245  }
1246  //For other cases at 5 GHz, the supported channel width is set by the VHT capabilities
1247  }
1248  else if (Is2_4Ghz (m_wifiPhy->GetFrequency ()))
1249  {
1250  if (heCapabilities.GetChannelWidthSet () & 0x01)
1251  {
1252  state->m_channelWidth = 40;
1253  }
1254  else
1255  {
1256  state->m_channelWidth = 20;
1257  }
1258  }
1259  if (heCapabilities.GetHeLtfAndGiForHePpdus () >= 2)
1260  {
1261  state->m_guardInterval = 800;
1262  }
1263  else if (heCapabilities.GetHeLtfAndGiForHePpdus () == 1)
1264  {
1265  state->m_guardInterval = 1600;
1266  }
1267  else
1268  {
1269  state->m_guardInterval = 3200;
1270  }
1271  for (uint8_t i = 1; i <= m_wifiPhy->GetMaxSupportedTxSpatialStreams (); i++)
1272  {
1273  for (uint8_t j = 0; j < m_wifiPhy->GetNMcs (); j++)
1274  {
1275  WifiMode mcs = m_wifiPhy->GetMcs (j);
1277  && heCapabilities.GetHighestNssSupported () >= i
1278  && heCapabilities.GetHighestMcsSupported () >= j)
1279  {
1280  AddSupportedMcs (from, mcs);
1281  }
1282  }
1283  }
1284  state->m_heCapabilities = Create<const HeCapabilities> (heCapabilities);
1285  SetQosSupport (from, true);
1286 }
1287 
1290 {
1291  return LookupState (from)->m_htCapabilities;
1292 }
1293 
1296 {
1297  return LookupState (from)->m_vhtCapabilities;
1298 }
1299 
1302 {
1303  return LookupState (from)->m_heCapabilities;
1304 }
1305 
1306 bool
1308 {
1310 
1311  if (!htCapabilities)
1312  {
1313  return false;
1314  }
1315  return htCapabilities->GetGreenfield ();
1316 }
1317 
1318 WifiMode
1320 {
1321  return m_defaultTxMode;
1322 }
1323 
1324 WifiMode
1326 {
1327  return m_defaultTxMcs;
1328 }
1329 
1330 void
1332 {
1333  NS_LOG_FUNCTION (this);
1334  for (StationStates::const_iterator i = m_states.begin (); i != m_states.end (); i++)
1335  {
1336  delete (*i);
1337  }
1338  m_states.clear ();
1339  for (Stations::const_iterator i = m_stations.begin (); i != m_stations.end (); i++)
1340  {
1341  delete (*i);
1342  }
1343  m_stations.clear ();
1344  m_bssBasicRateSet.clear ();
1345  m_bssBasicMcsSet.clear ();
1346 }
1347 
1348 void
1350 {
1351  NS_LOG_FUNCTION (this << mode);
1352  if (mode.GetModulationClass () >= WIFI_MOD_CLASS_HT)
1353  {
1354  NS_FATAL_ERROR ("It is not allowed to add a HT rate in the BSSBasicRateSet!");
1355  }
1356  for (uint8_t i = 0; i < GetNBasicModes (); i++)
1357  {
1358  if (GetBasicMode (i) == mode)
1359  {
1360  return;
1361  }
1362  }
1363  m_bssBasicRateSet.push_back (mode);
1364 }
1365 
1366 uint8_t
1368 {
1369  return static_cast<uint8_t> (m_bssBasicRateSet.size ());
1370 }
1371 
1372 WifiMode
1374 {
1375  NS_ASSERT (i < GetNBasicModes ());
1376  return m_bssBasicRateSet[i];
1377 }
1378 
1379 uint32_t
1381 {
1382  uint32_t size = 0;
1383  for (WifiModeListIterator i = m_bssBasicRateSet.begin (); i != m_bssBasicRateSet.end (); i++)
1384  {
1385  if (i->GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM)
1386  {
1387  continue;
1388  }
1389  size++;
1390  }
1391  return size;
1392 }
1393 
1394 WifiMode
1396 {
1398  uint32_t index = 0;
1399  bool found = false;
1400  for (WifiModeListIterator j = m_bssBasicRateSet.begin (); j != m_bssBasicRateSet.end (); )
1401  {
1402  if (i == index)
1403  {
1404  found = true;
1405  }
1406  if (j->GetModulationClass () != WIFI_MOD_CLASS_ERP_OFDM)
1407  {
1408  if (found)
1409  {
1410  break;
1411  }
1412  }
1413  index++;
1414  j++;
1415  }
1416  return m_bssBasicRateSet[index];
1417 }
1418 
1419 void
1421 {
1422  NS_LOG_FUNCTION (this << +mcs.GetMcsValue ());
1423  for (uint8_t i = 0; i < GetNBasicMcs (); i++)
1424  {
1425  if (GetBasicMcs (i) == mcs)
1426  {
1427  return;
1428  }
1429  }
1430  m_bssBasicMcsSet.push_back (mcs);
1431 }
1432 
1433 uint8_t
1435 {
1436  return static_cast<uint8_t> (m_bssBasicMcsSet.size ());
1437 }
1438 
1439 WifiMode
1441 {
1442  NS_ASSERT (i < GetNBasicMcs ());
1443  return m_bssBasicMcsSet[i];
1444 }
1445 
1446 WifiMode
1448 {
1449  if (m_nonUnicastMode == WifiMode ())
1450  {
1451  if (GetNBasicModes () > 0)
1452  {
1453  return GetBasicMode (0);
1454  }
1455  else
1456  {
1457  return GetDefaultMode ();
1458  }
1459  }
1460  else
1461  {
1462  return m_nonUnicastMode;
1463  }
1464 }
1465 
1466 bool
1468  Ptr<const Packet> packet, bool normally)
1469 {
1470  return normally;
1471 }
1472 
1473 bool
1475  Ptr<const Packet> packet, bool normally)
1476 {
1477  return normally;
1478 }
1479 
1480 bool
1482  Ptr<const Packet> packet, bool normally)
1483 {
1484  return normally;
1485 }
1486 
1487 void
1488 WifiRemoteStationManager::DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr)
1489 {
1490  NS_LOG_DEBUG ("DoReportAmpduTxStatus received but the manager does not handle A-MPDUs!");
1491 }
1492 
1493 WifiMode
1495 {
1496  NS_ASSERT (i < GetNSupported (station));
1497  return station->m_state->m_operationalRateSet[i];
1498 }
1499 
1500 WifiMode
1502 {
1503  NS_ASSERT (i < GetNMcsSupported (station));
1504  return station->m_state->m_operationalMcsSet[i];
1505 }
1506 
1507 WifiMode
1509 {
1510  NS_ASSERT (i < GetNNonErpSupported (station));
1511  //IEEE 802.11g standard defines that if the protection mechanism is enabled, Rts, Cts and Cts-To-Self
1512  //frames should select a rate in the BSSBasicRateSet that corresponds to an 802.11b basic rate.
1513  //This is a implemented here to avoid changes in every RAA, but should maybe be moved in case it breaks standard rules.
1514  uint32_t index = 0;
1515  bool found = false;
1516  for (WifiModeListIterator j = station->m_state->m_operationalRateSet.begin (); j != station->m_state->m_operationalRateSet.end (); )
1517  {
1518  if (i == index)
1519  {
1520  found = true;
1521  }
1522  if (j->GetModulationClass () != WIFI_MOD_CLASS_ERP_OFDM)
1523  {
1524  if (found)
1525  {
1526  break;
1527  }
1528  }
1529  index++;
1530  j++;
1531  }
1532  return station->m_state->m_operationalRateSet[index];
1533 }
1534 
1537 {
1538  return station->m_state->m_address;
1539 }
1540 
1541 uint16_t
1543 {
1544  return station->m_state->m_channelWidth;
1545 }
1546 
1547 bool
1549 {
1550  Ptr<const HtCapabilities> htCapabilities = station->m_state->m_htCapabilities;
1551 
1552  if (!htCapabilities)
1553  {
1554  return false;
1555  }
1556  return htCapabilities->GetShortGuardInterval20 ();
1557 }
1558 
1559 uint16_t
1561 {
1562  return station->m_state->m_guardInterval;
1563 }
1564 
1565 bool
1567 {
1568  Ptr<const HtCapabilities> htCapabilities = station->m_state->m_htCapabilities;
1569 
1570  if (!htCapabilities)
1571  {
1572  return false;
1573  }
1574  return htCapabilities->GetGreenfield ();
1575 }
1576 
1577 bool
1579 {
1580  return station->m_state->m_aggregation;
1581 }
1582 
1583 uint8_t
1585 {
1586  Ptr<const HtCapabilities> htCapabilities = station->m_state->m_htCapabilities;
1587 
1588  if (!htCapabilities)
1589  {
1590  return 1;
1591  }
1592  return htCapabilities->GetRxHighestSupportedAntennas ();
1593 }
1594 
1595 uint8_t
1597 {
1598  return station->m_state->m_ness;
1599 }
1600 
1603 {
1604  return m_wifiPhy;
1605 }
1606 
1609 {
1610  return m_wifiMac;
1611 }
1612 
1613 uint8_t
1615 {
1616  return static_cast<uint8_t> (station->m_state->m_operationalRateSet.size ());
1617 }
1618 
1619 bool
1621 {
1622  return station->m_state->m_qosSupported;
1623 }
1624 
1625 bool
1627 {
1628  return (station->m_state->m_htCapabilities != 0);
1629 }
1630 
1631 bool
1633 {
1634  return (station->m_state->m_vhtCapabilities != 0);
1635 }
1636 
1637 bool
1639 {
1640  return (station->m_state->m_heCapabilities != 0);
1641 }
1642 
1643 uint8_t
1645 {
1646  return static_cast<uint8_t> (station->m_state->m_operationalMcsSet.size ());
1647 }
1648 
1649 uint32_t
1651 {
1652  uint32_t size = 0;
1653  for (WifiModeListIterator i = station->m_state->m_operationalRateSet.begin (); i != station->m_state->m_operationalRateSet.end (); i++)
1654  {
1655  if (i->GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM)
1656  {
1657  continue;
1658  }
1659  size++;
1660  }
1661  return size;
1662 }
1663 
1664 uint16_t
1666 {
1668 }
1669 
1670 bool
1672 {
1674 
1675  if (!htCapabilities)
1676  {
1677  return false;
1678  }
1679  return htCapabilities->GetShortGuardInterval20 ();
1680 }
1681 
1682 uint8_t
1684 {
1686 
1687  if (!htCapabilities)
1688  {
1689  return 1;
1690  }
1691  return htCapabilities->GetRxHighestSupportedAntennas ();
1692 }
1693 
1694 uint8_t
1696 {
1697  return static_cast<uint8_t> (LookupState (address)->m_operationalMcsSet.size ());
1698 }
1699 
1700 bool
1702 {
1703  return (LookupState (address)->m_htCapabilities != 0);
1704 }
1705 
1706 bool
1708 {
1709  return (LookupState (address)->m_vhtCapabilities != 0);
1710 }
1711 
1712 bool
1714 {
1715  return (LookupState (address)->m_heCapabilities != 0);
1716 }
1717 
1718 void
1720 {
1721  m_defaultTxPowerLevel = txPower;
1722 }
1723 
1724 uint8_t
1726 {
1727  return m_wifiPhy->GetNumberOfAntennas ();
1728 }
1729 
1730 uint8_t
1732 {
1734 }
1735 
1736 bool
1738 {
1740 }
1741 
1742 } //namespace ns3
enum ns3::WifiRemoteStationState::@76 m_state
State of the station.
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
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:4090
#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 tranmission 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:1357
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:4084
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:37
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:1337
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
uint8_t GetNumberOfAntennas(void) const
Definition: wifi-phy.cc:1371
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:256
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:244
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:4072
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:4078
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:737
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:244
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:1390
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.