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 "ap-wifi-mac.h"
29 #include "sta-wifi-mac.h"
30 #include "wifi-mac-header.h"
31 #include "wifi-mac-queue-item.h"
32 #include "wifi-mac-trailer.h"
33 #include "ns3/ht-configuration.h"
34 #include "ns3/ht-phy.h"
35 #include "ns3/vht-configuration.h"
36 #include "ns3/he-configuration.h"
37 #include "wifi-net-device.h"
38 
39 namespace ns3 {
40 
41 NS_LOG_COMPONENT_DEFINE ("WifiRemoteStationManager");
42 
43 NS_OBJECT_ENSURE_REGISTERED (WifiRemoteStationManager);
44 
45 TypeId
47 {
48  static TypeId tid = TypeId ("ns3::WifiRemoteStationManager")
49  .SetParent<Object> ()
50  .SetGroupName ("Wifi")
51  .AddAttribute ("MaxSsrc",
52  "The maximum number of retransmission attempts for any packet with size <= RtsCtsThreshold. "
53  "This value will not have any effect on some rate control algorithms.",
54  UintegerValue (7),
56  MakeUintegerChecker<uint32_t> ())
57  .AddAttribute ("MaxSlrc",
58  "The maximum number of retransmission attempts for any packet with size > RtsCtsThreshold. "
59  "This value will not have any effect on some rate control algorithms.",
60  UintegerValue (4),
62  MakeUintegerChecker<uint32_t> ())
63  .AddAttribute ("RtsCtsThreshold",
64  "If the size of the PSDU is bigger than this value, we use an RTS/CTS handshake before sending the data frame."
65  "This value will not have any effect on some rate control algorithms.",
66  UintegerValue (65535),
68  MakeUintegerChecker<uint32_t> ())
69  .AddAttribute ("FragmentationThreshold",
70  "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. "
71  "This value does not apply when it is carried in an A-MPDU. "
72  "This value will not have any effect on some rate control algorithms.",
73  UintegerValue (65535),
76  MakeUintegerChecker<uint32_t> ())
77  .AddAttribute ("NonUnicastMode",
78  "Wifi mode used for non-unicast transmissions.",
79  WifiModeValue (),
82  .AddAttribute ("DefaultTxPowerLevel",
83  "Default power level to be used for transmissions. "
84  "This is the power level that is used by all those WifiManagers that do not implement TX power control.",
85  UintegerValue (0),
87  MakeUintegerChecker<uint8_t> ())
88  .AddAttribute ("ErpProtectionMode",
89  "Protection mode used when non-ERP STAs are connected to an ERP AP: Rts-Cts or Cts-To-Self",
94  .AddAttribute ("HtProtectionMode",
95  "Protection mode used when non-HT STAs are connected to a HT AP: Rts-Cts or Cts-To-Self",
100  .AddTraceSource ("MacTxRtsFailed",
101  "The transmission of a RTS by the MAC layer has failed",
103  "ns3::Mac48Address::TracedCallback")
104  .AddTraceSource ("MacTxDataFailed",
105  "The transmission of a data packet by the MAC layer has failed",
107  "ns3::Mac48Address::TracedCallback")
108  .AddTraceSource ("MacTxFinalRtsFailed",
109  "The transmission of a RTS has exceeded the maximum number of attempts",
111  "ns3::Mac48Address::TracedCallback")
112  .AddTraceSource ("MacTxFinalDataFailed",
113  "The transmission of a data packet has exceeded the maximum number of attempts",
115  "ns3::Mac48Address::TracedCallback")
116  ;
117  return tid;
118 }
119 
121  : m_useNonErpProtection (false),
122  m_useNonHtProtection (false),
123  m_shortPreambleEnabled (false),
124  m_shortSlotTimeEnabled (false)
125 {
126  NS_LOG_FUNCTION (this);
127 }
128 
130 {
131  NS_LOG_FUNCTION (this);
132 }
133 
134 void
136 {
137  NS_LOG_FUNCTION (this);
138  Reset ();
139 }
140 
141 void
143 {
144  NS_LOG_FUNCTION (this << phy);
145  //We need to track our PHY because it is the object that knows the
146  //full set of transmit rates that are supported. We need to know
147  //this in order to find the relevant mandatory rates when choosing a
148  //transmit rate for automatic control responses like
149  //acknowledgments.
150  m_wifiPhy = phy;
151  m_defaultTxMode = phy->GetDefaultMode ();
153  if (GetHtSupported ())
154  {
156  }
157  Reset ();
158 }
159 
160 void
162 {
163  NS_LOG_FUNCTION (this << mac);
164  //We need to track our MAC because it is the object that knows the
165  //full set of interframe spaces.
166  m_wifiMac = mac;
167  Reset ();
168 }
169 
170 int64_t
172 {
173  NS_LOG_FUNCTION (this << stream);
174  return 0;
175 }
176 
177 void
179 {
180  NS_LOG_FUNCTION (this << maxSsrc);
181  m_maxSsrc = maxSsrc;
182 }
183 
184 void
186 {
187  NS_LOG_FUNCTION (this << maxSlrc);
188  m_maxSlrc = maxSlrc;
189 }
190 
191 void
193 {
194  NS_LOG_FUNCTION (this << threshold);
195  m_rtsCtsThreshold = threshold;
196 }
197 
198 void
200 {
201  NS_LOG_FUNCTION (this << threshold);
202  DoSetFragmentationThreshold (threshold);
203 }
204 
205 void
207 {
208  NS_LOG_FUNCTION (this << enable);
209  m_shortPreambleEnabled = enable;
210 }
211 
212 void
214 {
215  NS_LOG_FUNCTION (this << enable);
216  m_shortSlotTimeEnabled = enable;
217 }
218 
219 bool
221 {
222  return m_shortSlotTimeEnabled;
223 }
224 
225 bool
227 {
228  return m_shortPreambleEnabled;
229 }
230 
231 bool
233 {
234  return m_wifiPhy->GetDevice ()->GetHtConfiguration () != nullptr;
235 }
236 
237 bool
239 {
240  return m_wifiPhy->GetDevice ()->GetVhtConfiguration () != nullptr;
241 }
242 
243 bool
245 {
246  return m_wifiPhy->GetDevice ()->GetHeConfiguration () != nullptr;
247 }
248 
249 bool
251 {
252  if (GetHtSupported ())
253  {
255  NS_ASSERT (htConfiguration); //If HT is supported, we should have a HT configuration attached
256  return htConfiguration->GetLdpcSupported ();
257  }
258  return false;
259 }
260 
261 bool
263 {
264  if (GetHtSupported ())
265  {
267  NS_ASSERT (htConfiguration); //If HT is supported, we should have a HT configuration attached
268  if (htConfiguration->GetShortGuardIntervalSupported ())
269  {
270  return true;
271  }
272  }
273  return false;
274 }
275 
276 uint16_t
278 {
279  uint16_t gi = 0;
280  if (GetHeSupported ())
281  {
283  NS_ASSERT (heConfiguration); //If HE is supported, we should have a HE configuration attached
284  gi = static_cast<uint16_t>(heConfiguration->GetGuardInterval ().GetNanoSeconds ());
285  }
286  return gi;
287 }
288 
289 uint32_t
291 {
292  return DoGetFragmentationThreshold ();
293 }
294 
295 void
297 {
298  NS_LOG_FUNCTION (this << address << isShortPreambleSupported);
299  NS_ASSERT (!address.IsGroup ());
301  state->m_shortPreamble = isShortPreambleSupported;
302 }
303 
304 void
306 {
307  NS_LOG_FUNCTION (this << address << isShortSlotTimeSupported);
308  NS_ASSERT (!address.IsGroup ());
310  state->m_shortSlotTime = isShortSlotTimeSupported;
311 }
312 
313 void
315 {
316  NS_LOG_FUNCTION (this << address << mode);
317  NS_ASSERT (!address.IsGroup ());
319  for (WifiModeListIterator i = state->m_operationalRateSet.begin (); i != state->m_operationalRateSet.end (); i++)
320  {
321  if ((*i) == mode)
322  {
323  //already in.
324  return;
325  }
326  }
328  {
329  state->m_dsssSupported = true;
330  }
331  else if (mode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM)
332  {
333  state->m_erpOfdmSupported = true;
334  }
335  else if (mode.GetModulationClass () == WIFI_MOD_CLASS_OFDM)
336  {
337  state->m_ofdmSupported = true;
338  }
339  state->m_operationalRateSet.push_back (mode);
340 }
341 
342 void
344 {
345  NS_LOG_FUNCTION (this << address);
346  NS_ASSERT (!address.IsGroup ());
348  state->m_operationalRateSet.clear ();
349  for (const auto & mode : m_wifiPhy->GetModeList ())
350  {
351  state->m_operationalRateSet.push_back (mode);
352  if (mode.IsMandatory ())
353  {
354  AddBasicMode (mode);
355  }
356  }
357 }
358 
359 void
361 {
362  NS_LOG_FUNCTION (this << address);
363  NS_ASSERT (!address.IsGroup ());
365  state->m_operationalMcsSet.clear ();
366  for (const auto & mcs : m_wifiPhy->GetMcsList ())
367  {
368  state->m_operationalMcsSet.push_back (mcs);
369  }
370 }
371 
372 void
374 {
375  NS_LOG_FUNCTION (this << address);
376  NS_ASSERT (!address.IsGroup ());
378  state->m_operationalMcsSet.clear ();
379 }
380 
381 void
383 {
384  NS_LOG_FUNCTION (this << address << mcs);
385  NS_ASSERT (!address.IsGroup ());
387  for (WifiModeListIterator i = state->m_operationalMcsSet.begin (); i != state->m_operationalMcsSet.end (); i++)
388  {
389  if ((*i) == mcs)
390  {
391  //already in.
392  return;
393  }
394  }
395  state->m_operationalMcsSet.push_back (mcs);
396 }
397 
398 bool
400 {
402 }
403 
404 bool
406 {
408 }
409 
410 bool
412 {
414 }
415 
416 bool
418 {
419  if (address.IsGroup ())
420  {
421  return false;
422  }
424 }
425 
426 bool
428 {
429  if (address.IsGroup ())
430  {
431  return true;
432  }
434 }
435 
436 bool
438 {
439  if (address.IsGroup ())
440  {
441  return false;
442  }
444 }
445 
446 void
448 {
449  NS_ASSERT (!address.IsGroup ());
451 }
452 
453 void
455 {
456  NS_ASSERT (!address.IsGroup ());
458 }
459 
460 void
462 {
463  NS_ASSERT (!address.IsGroup ());
465 }
466 
467 void
469 {
470  NS_ASSERT (!address.IsGroup ());
472 }
473 
474 uint16_t
476 {
477  WifiRemoteStationState* state;
478  if (!remoteAddress.IsGroup ()
479  && (state = LookupState (remoteAddress))->m_state == WifiRemoteStationState::GOT_ASSOC_TX_OK)
480  {
481  return state->m_aid;
482  }
483  return SU_STA_ID;
484 }
485 
486 uint16_t
488 {
489  NS_LOG_FUNCTION (this << address << txVector);
490 
491  uint16_t staId = SU_STA_ID;
492 
493  if (txVector.IsMu ())
494  {
495  if (m_wifiMac->GetTypeOfStation () == AP)
496  {
497  staId = GetAssociationId (address);
498  }
499  else if (m_wifiMac->GetTypeOfStation () == STA)
500  {
501  Ptr<StaWifiMac> staMac = StaticCast<StaWifiMac> (m_wifiMac);
502  if (staMac->IsAssociated ())
503  {
504  staId = staMac->GetAssociationId ();
505  }
506  }
507  }
508 
509  NS_LOG_DEBUG ("Returning STAID = " << staId);
510  return staId;
511 }
512 
515 {
516  NS_LOG_FUNCTION (this << header);
517  Mac48Address address = header.GetAddr1 ();
518  if (!header.IsMgt () && address.IsGroup ())
519  {
520  WifiMode mode = GetNonUnicastMode ();
521  WifiTxVector v;
522  v.SetMode (mode);
528  v.SetNss (1);
529  v.SetNess (0);
530  return v;
531  }
532  WifiTxVector txVector;
533  if (header.IsMgt ())
534  {
535  //Use the lowest basic rate for management frames
536  WifiMode mgtMode;
537  if (GetNBasicModes () > 0)
538  {
539  mgtMode = GetBasicMode (0);
540  }
541  else
542  {
543  mgtMode = GetDefaultMode ();
544  }
545  txVector.SetMode (mgtMode);
550  }
551  else
552  {
553  txVector = DoGetDataTxVector (Lookup (address));
555  }
557  if (heConfiguration)
558  {
559  txVector.SetBssColor (heConfiguration->GetBssColor ());
560  }
561  return txVector;
562 }
563 
566 {
567  WifiMode defaultMode = GetDefaultMode ();
568  WifiPreamble defaultPreamble;
569  if (defaultMode.GetModulationClass () == WIFI_MOD_CLASS_HE)
570  {
571  defaultPreamble = WIFI_PREAMBLE_HE_SU;
572  }
573  else if (defaultMode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
574  {
575  defaultPreamble = WIFI_PREAMBLE_VHT_SU;
576  }
577  else if (defaultMode.GetModulationClass () == WIFI_MOD_CLASS_HT)
578  {
579  defaultPreamble = WIFI_PREAMBLE_HT_MF;
580  }
581  else
582  {
583  defaultPreamble = WIFI_PREAMBLE_LONG;
584  }
585 
586  return WifiTxVector (defaultMode,
588  defaultPreamble,
591  1,
592  0,
594  false);
595 }
596 
599 {
600  NS_LOG_FUNCTION (this << address);
601  if (address.IsGroup ())
602  {
603  WifiMode mode = GetNonUnicastMode ();
604  WifiTxVector v;
605  v.SetMode (mode);
611  v.SetNss (1);
612  v.SetNess (0);
613  return v;
614  }
615  return DoGetRtsTxVector (Lookup (address));
616 }
617 
620 {
621  NS_ASSERT (!to.IsGroup ());
622  WifiMode ctsMode = GetControlAnswerMode (rtsTxMode);
623  WifiTxVector v;
624  v.SetMode (ctsMode);
628  uint16_t ctsTxGuardInterval = ConvertGuardIntervalToNanoSeconds (ctsMode, m_wifiPhy->GetDevice ());
629  v.SetGuardInterval (ctsTxGuardInterval);
630  v.SetNss (1);
631  return v;
632 }
633 
636 {
637  NS_ASSERT (!to.IsGroup ());
638  WifiMode ackMode = GetControlAnswerMode (dataTxVector.GetMode (GetStaId (to, dataTxVector)));
639  WifiTxVector v;
640  v.SetMode (ackMode);
644  uint16_t ackTxGuardInterval = ConvertGuardIntervalToNanoSeconds (ackMode, m_wifiPhy->GetDevice ());
645  v.SetGuardInterval (ackTxGuardInterval);
646  v.SetNss (1);
647  return v;
648 }
649 
652 {
653  NS_ASSERT (!to.IsGroup ());
654  WifiMode blockAckMode = GetControlAnswerMode (dataTxVector.GetMode (GetStaId (to, dataTxVector)));
655  WifiTxVector v;
656  v.SetMode (blockAckMode);
660  uint16_t blockAckTxGuardInterval = ConvertGuardIntervalToNanoSeconds (blockAckMode, m_wifiPhy->GetDevice ());
661  v.SetGuardInterval (blockAckTxGuardInterval);
662  v.SetNss (1);
663  return v;
664 }
665 
666 WifiMode
668 {
683  NS_LOG_FUNCTION (this << reqMode);
684  WifiMode mode = GetDefaultMode ();
685  bool found = false;
686  //First, search the BSS Basic Rate set
687  for (uint8_t i = 0; i < GetNBasicModes (); i++)
688  {
689  WifiMode testMode = GetBasicMode (i);
690  if ((!found || testMode.IsHigherDataRate (mode))
691  && (!testMode.IsHigherDataRate (reqMode))
693  {
694  mode = testMode;
695  //We've found a potentially-suitable transmit rate, but we
696  //need to continue and consider all the basic rates before
697  //we can be sure we've got the right one.
698  found = true;
699  }
700  }
701  if (GetHtSupported ())
702  {
703  if (!found)
704  {
705  mode = GetDefaultMcs ();
706  for (uint8_t i = 0; i != GetNBasicMcs (); i++)
707  {
708  WifiMode testMode = GetBasicMcs (i);
709  if ((!found || testMode.IsHigherDataRate (mode))
710  && (!testMode.IsHigherDataRate (reqMode))
711  && (testMode.GetModulationClass () == reqMode.GetModulationClass ()))
712  {
713  mode = testMode;
714  //We've found a potentially-suitable transmit rate, but we
715  //need to continue and consider all the basic rates before
716  //we can be sure we've got the right one.
717  found = true;
718  }
719  }
720  }
721  }
722  //If we found a suitable rate in the BSSBasicRateSet, then we are
723  //done and can return that mode.
724  if (found)
725  {
726  NS_LOG_DEBUG ("WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
727  return mode;
728  }
729 
747  for (const auto & thismode : m_wifiPhy->GetModeList ())
748  {
749  /* If the rate:
750  *
751  * - is a mandatory rate for the PHY, and
752  * - is equal to or faster than our current best choice, and
753  * - is less than or equal to the rate of the received frame, and
754  * - is of the same modulation class as the received frame
755  *
756  * ...then it's our best choice so far.
757  */
758  if (thismode.IsMandatory ()
759  && (!found || thismode.IsHigherDataRate (mode))
760  && (!thismode.IsHigherDataRate (reqMode))
761  && (IsAllowedControlAnswerModulationClass (reqMode.GetModulationClass (), thismode.GetModulationClass ())))
762  {
763  mode = thismode;
764  //As above; we've found a potentially-suitable transmit
765  //rate, but we need to continue and consider all the
766  //mandatory rates before we can be sure we've got the right one.
767  found = true;
768  }
769  }
770  if (GetHtSupported () )
771  {
772  for (const auto & thismode : m_wifiPhy->GetMcsList ())
773  {
774  if (thismode.IsMandatory ()
775  && (!found || thismode.IsHigherDataRate (mode))
776  && (!thismode.IsHigherCodeRate (reqMode))
777  && (thismode.GetModulationClass () == reqMode.GetModulationClass ()))
778  {
779  mode = thismode;
780  //As above; we've found a potentially-suitable transmit
781  //rate, but we need to continue and consider all the
782  //mandatory rates before we can be sure we've got the right one.
783  found = true;
784  }
785  }
786  }
787 
797  if (!found)
798  {
799  NS_FATAL_ERROR ("Can't find response rate for " << reqMode);
800  }
801 
802  NS_LOG_DEBUG ("WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
803  return mode;
804 }
805 
806 void
808 {
809  NS_LOG_FUNCTION (this << header);
810  NS_ASSERT (!header.GetAddr1 ().IsGroup ());
811  AcIndex ac = QosUtilsMapTidToAc ((header.IsQosData ()) ? header.GetQosTid () : 0);
812  m_ssrc[ac]++;
813  m_macTxRtsFailed (header.GetAddr1 ());
814  DoReportRtsFailed (Lookup (header.GetAddr1 ()));
815 }
816 
817 void
819 {
820  NS_LOG_FUNCTION (this << *mpdu);
821  NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
822  AcIndex ac = QosUtilsMapTidToAc ((mpdu->GetHeader ().IsQosData ()) ? mpdu->GetHeader ().GetQosTid () : 0);
823  bool longMpdu = (mpdu->GetSize () > m_rtsCtsThreshold);
824  if (longMpdu)
825  {
826  m_slrc[ac]++;
827  }
828  else
829  {
830  m_ssrc[ac]++;
831  }
832  m_macTxDataFailed (mpdu->GetHeader ().GetAddr1 ());
833  DoReportDataFailed (Lookup (mpdu->GetHeader ().GetAddr1 ()));
834 }
835 
836 void
838  double ctsSnr, WifiMode ctsMode, double rtsSnr)
839 {
840  NS_LOG_FUNCTION (this << header << ctsSnr << ctsMode << rtsSnr);
841  NS_ASSERT (!header.GetAddr1 ().IsGroup ());
842  WifiRemoteStation *station = Lookup (header.GetAddr1 ());
843  AcIndex ac = QosUtilsMapTidToAc ((header.IsQosData ()) ? header.GetQosTid () : 0);
844  station->m_state->m_info.NotifyTxSuccess (m_ssrc[ac]);
845  m_ssrc[ac] = 0;
846  DoReportRtsOk (station, ctsSnr, ctsMode, rtsSnr);
847 }
848 
849 void
851  WifiMode ackMode, double dataSnr, WifiTxVector dataTxVector)
852 {
853  NS_LOG_FUNCTION (this << *mpdu << ackSnr << ackMode << dataSnr << dataTxVector);
854  const WifiMacHeader& hdr = mpdu->GetHeader ();
855  NS_ASSERT (!hdr.GetAddr1 ().IsGroup ());
856  WifiRemoteStation *station = Lookup (hdr.GetAddr1 ());
857  AcIndex ac = QosUtilsMapTidToAc ((hdr.IsQosData ()) ? hdr.GetQosTid () : 0);
858  bool longMpdu = (mpdu->GetSize () > m_rtsCtsThreshold);
859  if (longMpdu)
860  {
861  station->m_state->m_info.NotifyTxSuccess (m_slrc[ac]);
862  m_slrc[ac] = 0;
863  }
864  else
865  {
866  station->m_state->m_info.NotifyTxSuccess (m_ssrc[ac]);
867  m_ssrc[ac] = 0;
868  }
869  DoReportDataOk (station, ackSnr, ackMode, dataSnr, dataTxVector.GetChannelWidth (),
870  dataTxVector.GetNss (GetStaId (hdr.GetAddr1 (), dataTxVector)));
871 }
872 
873 void
875 {
876  NS_LOG_FUNCTION (this << header);
877  NS_ASSERT (!header.GetAddr1 ().IsGroup ());
878  WifiRemoteStation *station = Lookup (header.GetAddr1 ());
879  AcIndex ac = QosUtilsMapTidToAc ((header.IsQosData ()) ? header.GetQosTid () : 0);
880  station->m_state->m_info.NotifyTxFailed ();
881  m_ssrc[ac] = 0;
882  m_macTxFinalRtsFailed (header.GetAddr1 ());
883  DoReportFinalRtsFailed (station);
884 }
885 
886 void
888 {
889  NS_LOG_FUNCTION (this << *mpdu);
890  NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
891  WifiRemoteStation *station = Lookup (mpdu->GetHeader ().GetAddr1 ());
892  AcIndex ac = QosUtilsMapTidToAc ((mpdu->GetHeader ().IsQosData ()) ? mpdu->GetHeader ().GetQosTid () : 0);
893  station->m_state->m_info.NotifyTxFailed ();
894  bool longMpdu = (mpdu->GetSize () > m_rtsCtsThreshold);
895  if (longMpdu)
896  {
897  m_slrc[ac] = 0;
898  }
899  else
900  {
901  m_ssrc[ac] = 0;
902  }
903  m_macTxFinalDataFailed (mpdu->GetHeader ().GetAddr1 ());
904  DoReportFinalDataFailed (station);
905 }
906 
907 void
909 {
910  NS_LOG_FUNCTION (this << address << rxSignalInfo << txVector);
911  if (address.IsGroup ())
912  {
913  return;
914  }
915  WifiRemoteStation *station = Lookup (address);
916  DoReportRxOk (station, rxSignalInfo.snr, txVector.GetMode (GetStaId (address, txVector)));
917  station->m_rssiAndUpdateTimePair = std::make_pair (rxSignalInfo.rssi, Simulator::Now ());
918 }
919 
920 void
922  uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus,
923  double rxSnr, double dataSnr, WifiTxVector dataTxVector)
924 {
925  NS_LOG_FUNCTION (this << address << nSuccessfulMpdus << nFailedMpdus << rxSnr << dataSnr << dataTxVector);
926  NS_ASSERT (!address.IsGroup ());
927  for (uint8_t i = 0; i < nFailedMpdus; i++)
928  {
930  }
931  DoReportAmpduTxStatus (Lookup (address), nSuccessfulMpdus, nFailedMpdus, rxSnr, dataSnr, dataTxVector.GetChannelWidth (), dataTxVector.GetNss (GetStaId (address, dataTxVector)));
932 }
933 
934 bool
935 WifiRemoteStationManager::NeedRts (const WifiMacHeader &header, uint32_t size)
936 {
937  NS_LOG_FUNCTION (this << header << size);
938  Mac48Address address = header.GetAddr1 ();
939  WifiTxVector txVector = GetDataTxVector (header);
940  WifiMode mode = txVector.GetMode ();
941  if (address.IsGroup ())
942  {
943  return false;
944  }
947  || (mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
948  || (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
949  || (mode.GetModulationClass () == WIFI_MOD_CLASS_HE))
951  {
952  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedRTS returning true to protect non-ERP stations");
953  return true;
954  }
955  else if (m_htProtectionMode == RTS_CTS
956  && ((mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
957  || (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT))
960  {
961  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedRTS returning true to protect non-HT stations");
962  return true;
963  }
964  bool normally = (size > m_rtsCtsThreshold);
965  return DoNeedRts (Lookup (address), size, normally);
966 }
967 
968 bool
970 {
971  WifiMode mode = txVector.GetMode ();
972  NS_LOG_FUNCTION (this << mode);
975  || (mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
976  || (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
977  || (mode.GetModulationClass () == WIFI_MOD_CLASS_HE))
979  {
980  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning true to protect non-ERP stations");
981  return true;
982  }
983  else if (m_htProtectionMode == CTS_TO_SELF
984  && ((mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
985  || (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT))
988  {
989  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning true to protect non-HT stations");
990  return true;
991  }
992  else if (!m_useNonErpProtection)
993  {
994  //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
995  for (WifiModeListIterator i = m_bssBasicRateSet.begin (); i != m_bssBasicRateSet.end (); i++)
996  {
997  if (mode == *i)
998  {
999  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning false");
1000  return false;
1001  }
1002  }
1003  if (GetHtSupported ())
1004  {
1005  //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
1006  for (WifiModeListIterator i = m_bssBasicMcsSet.begin (); i != m_bssBasicMcsSet.end (); i++)
1007  {
1008  if (mode == *i)
1009  {
1010  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning false");
1011  return false;
1012  }
1013  }
1014  }
1015  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning true");
1016  return true;
1017  }
1018  return false;
1019 }
1020 
1021 void
1023 {
1024  NS_LOG_FUNCTION (this << enable);
1025  m_useNonErpProtection = enable;
1026 }
1027 
1028 bool
1030 {
1031  return m_useNonErpProtection;
1032 }
1033 
1034 void
1036 {
1037  NS_LOG_FUNCTION (this << enable);
1038  m_useNonHtProtection = enable;
1039 }
1040 
1041 bool
1043 {
1044  return m_useNonHtProtection;
1045 }
1046 
1047 bool
1049 {
1050  NS_LOG_FUNCTION (this << *mpdu);
1051  NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
1052  AcIndex ac = QosUtilsMapTidToAc ((mpdu->GetHeader ().IsQosData ()) ? mpdu->GetHeader ().GetQosTid () : 0);
1053  bool longMpdu = (mpdu->GetSize () > m_rtsCtsThreshold);
1054  uint32_t retryCount, maxRetryCount;
1055  if (longMpdu)
1056  {
1057  retryCount = m_slrc[ac];
1058  maxRetryCount = m_maxSlrc;
1059  }
1060  else
1061  {
1062  retryCount = m_ssrc[ac];
1063  maxRetryCount = m_maxSsrc;
1064  }
1065  bool normally = retryCount < maxRetryCount;
1066  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedRetransmission count: " << retryCount << " result: " << std::boolalpha << normally);
1067  return DoNeedRetransmission (Lookup (mpdu->GetHeader ().GetAddr1 ()), mpdu->GetPacket (), normally);
1068 }
1069 
1070 bool
1072 {
1073  NS_LOG_FUNCTION (this << *mpdu);
1074  if (mpdu->GetHeader ().GetAddr1 ().IsGroup ())
1075  {
1076  return false;
1077  }
1078  bool normally = mpdu->GetSize () > GetFragmentationThreshold ();
1079  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedFragmentation result: " << std::boolalpha << normally);
1080  return DoNeedFragmentation (Lookup (mpdu->GetHeader ().GetAddr1 ()), mpdu->GetPacket (), normally);
1081 }
1082 
1083 void
1085 {
1086  NS_LOG_FUNCTION (this << threshold);
1087  if (threshold < 256)
1088  {
1089  /*
1090  * ASN.1 encoding of the MAC and PHY MIB (256 ... 8000)
1091  */
1092  NS_LOG_WARN ("Fragmentation threshold should be larger than 256. Setting to 256.");
1094  }
1095  else
1096  {
1097  /*
1098  * The length of each fragment shall be an even number of octets, except for the last fragment if an MSDU or
1099  * MMPDU, which may be either an even or an odd number of octets.
1100  */
1101  if (threshold % 2 != 0)
1102  {
1103  NS_LOG_WARN ("Fragmentation threshold should be an even number. Setting to " << threshold - 1);
1104  m_fragmentationThreshold = threshold - 1;
1105  }
1106  else
1107  {
1108  m_fragmentationThreshold = threshold;
1109  }
1110  }
1111 }
1112 
1113 uint32_t
1115 {
1116  return m_fragmentationThreshold;
1117 }
1118 
1119 uint32_t
1121 {
1122  NS_LOG_FUNCTION (this << *mpdu);
1123  //The number of bytes a fragment can support is (Threshold - WIFI_HEADER_SIZE - WIFI_FCS).
1124  uint32_t nFragments = (mpdu->GetPacket ()->GetSize () / (GetFragmentationThreshold () - mpdu->GetHeader ().GetSize () - WIFI_MAC_FCS_LENGTH));
1125 
1126  //If the size of the last fragment is not 0.
1127  if ((mpdu->GetPacket ()->GetSize () % (GetFragmentationThreshold () - mpdu->GetHeader ().GetSize () - WIFI_MAC_FCS_LENGTH)) > 0)
1128  {
1129  nFragments++;
1130  }
1131  NS_LOG_DEBUG ("WifiRemoteStationManager::GetNFragments returning " << nFragments);
1132  return nFragments;
1133 }
1134 
1135 uint32_t
1137 {
1138  NS_LOG_FUNCTION (this << *mpdu << fragmentNumber);
1139  NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
1140  uint32_t nFragment = GetNFragments (mpdu);
1141  if (fragmentNumber >= nFragment)
1142  {
1143  NS_LOG_DEBUG ("WifiRemoteStationManager::GetFragmentSize returning 0");
1144  return 0;
1145  }
1146  //Last fragment
1147  if (fragmentNumber == nFragment - 1)
1148  {
1149  uint32_t lastFragmentSize = mpdu->GetPacket ()->GetSize () - (fragmentNumber * (GetFragmentationThreshold () - mpdu->GetHeader ().GetSize () - WIFI_MAC_FCS_LENGTH));
1150  NS_LOG_DEBUG ("WifiRemoteStationManager::GetFragmentSize returning " << lastFragmentSize);
1151  return lastFragmentSize;
1152  }
1153  //All fragments but the last, the number of bytes is (Threshold - WIFI_HEADER_SIZE - WIFI_FCS).
1154  else
1155  {
1156  uint32_t fragmentSize = GetFragmentationThreshold () - mpdu->GetHeader ().GetSize () - WIFI_MAC_FCS_LENGTH;
1157  NS_LOG_DEBUG ("WifiRemoteStationManager::GetFragmentSize returning " << fragmentSize);
1158  return fragmentSize;
1159  }
1160 }
1161 
1162 uint32_t
1164 {
1165  NS_LOG_FUNCTION (this << *mpdu << fragmentNumber);
1166  NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
1167  NS_ASSERT (fragmentNumber < GetNFragments (mpdu));
1168  uint32_t fragmentOffset = fragmentNumber * (GetFragmentationThreshold () - mpdu->GetHeader ().GetSize () - WIFI_MAC_FCS_LENGTH);
1169  NS_LOG_DEBUG ("WifiRemoteStationManager::GetFragmentOffset returning " << fragmentOffset);
1170  return fragmentOffset;
1171 }
1172 
1173 bool
1175 {
1176  NS_LOG_FUNCTION (this << *mpdu << fragmentNumber);
1177  NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
1178  bool isLast = fragmentNumber == (GetNFragments (mpdu) - 1);
1179  NS_LOG_DEBUG ("WifiRemoteStationManager::IsLastFragment returning " << std::boolalpha << isLast);
1180  return isLast;
1181 }
1182 
1183 uint8_t
1185 {
1186  return m_defaultTxPowerLevel;
1187 }
1188 
1191 {
1193  return state->m_info;
1194 }
1195 
1196 double
1198 {
1199  auto stationIt = m_stations.find (address);
1200  NS_ASSERT_MSG (stationIt != m_stations.end(), "Address: " << address << " not found");
1201  auto station = stationIt->second;
1202  auto rssi = station->m_rssiAndUpdateTimePair.first;
1203  auto ts = station->m_rssiAndUpdateTimePair.second;
1204  NS_ASSERT_MSG (ts.IsStrictlyPositive(), "address: " << address << " ts:" << ts);
1205  return rssi;
1206 }
1207 
1210 {
1211  NS_LOG_FUNCTION (this << address);
1212  auto stateIt = m_states.find (address);
1213 
1214  if (stateIt != m_states.end ())
1215  {
1216  NS_LOG_DEBUG ("WifiRemoteStationManager::LookupState returning existing state");
1217  return stateIt->second;
1218  }
1219 
1222  state->m_address = address;
1223  state->m_aid = 0;
1224  state->m_operationalRateSet.push_back (GetDefaultMode ());
1225  state->m_operationalMcsSet.push_back (GetDefaultMcs ());
1226  state->m_dsssSupported = false;
1227  state->m_erpOfdmSupported = false;
1228  state->m_ofdmSupported = false;
1229  state->m_htCapabilities = 0;
1230  state->m_vhtCapabilities = 0;
1231  state->m_heCapabilities = 0;
1233  state->m_guardInterval = GetGuardInterval ();
1234  state->m_ness = 0;
1235  state->m_aggregation = false;
1236  state->m_qosSupported = false;
1237  const_cast<WifiRemoteStationManager *> (this)->m_states.insert ({address, state});
1238  NS_LOG_DEBUG ("WifiRemoteStationManager::LookupState returning new state");
1239  return state;
1240 }
1241 
1242 WifiRemoteStation *
1243 WifiRemoteStationManager::Lookup (Mac48Address address) const
1244 {
1245  NS_LOG_FUNCTION (this << address);
1246  auto stationIt = m_stations.find (address);
1247 
1248  if (stationIt != m_stations.end ())
1249  {
1250  return stationIt->second;
1251  }
1252 
1253  WifiRemoteStationState *state = LookupState (address);
1254 
1255  WifiRemoteStation *station = DoCreateStation ();
1256  station->m_state = state;
1257  station->m_rssiAndUpdateTimePair = std::make_pair (0, Seconds (0));
1258  const_cast<WifiRemoteStationManager *> (this)->m_stations.insert ({address, station});
1259  return station;
1260 }
1261 
1262 void
1263 WifiRemoteStationManager::SetAssociationId (Mac48Address remoteAddress, uint16_t aid)
1264 {
1265  NS_LOG_FUNCTION (this << remoteAddress << aid);
1266  LookupState (remoteAddress)->m_aid = aid;
1267 }
1268 
1269 void
1270 WifiRemoteStationManager::SetQosSupport (Mac48Address from, bool qosSupported)
1271 {
1272  NS_LOG_FUNCTION (this << from << qosSupported);
1273  WifiRemoteStationState *state;
1274  state = LookupState (from);
1275  state->m_qosSupported = qosSupported;
1276 }
1277 
1278 void
1279 WifiRemoteStationManager::AddStationHtCapabilities (Mac48Address from, HtCapabilities htCapabilities)
1280 {
1281  //Used by all stations to record HT capabilities of remote stations
1282  NS_LOG_FUNCTION (this << from << htCapabilities);
1283  WifiRemoteStationState *state;
1284  state = LookupState (from);
1285  if (htCapabilities.GetSupportedChannelWidth () == 1)
1286  {
1287  state->m_channelWidth = 40;
1288  }
1289  else
1290  {
1291  state->m_channelWidth = 20;
1292  }
1293  SetQosSupport (from, true);
1294  for (const auto & mcs : m_wifiPhy->GetMcsList (WIFI_MOD_CLASS_HT))
1295  {
1296  if (htCapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
1297  {
1298  AddSupportedMcs (from, mcs);
1299  }
1300  }
1301  state->m_htCapabilities = Create<const HtCapabilities> (htCapabilities);
1302 }
1303 
1304 void
1305 WifiRemoteStationManager::AddStationVhtCapabilities (Mac48Address from, VhtCapabilities vhtCapabilities)
1306 {
1307  //Used by all stations to record VHT capabilities of remote stations
1308  NS_LOG_FUNCTION (this << from << vhtCapabilities);
1309  WifiRemoteStationState *state;
1310  state = LookupState (from);
1311  if (vhtCapabilities.GetSupportedChannelWidthSet () == 1)
1312  {
1313  state->m_channelWidth = 160;
1314  }
1315  else
1316  {
1317  state->m_channelWidth = 80;
1318  }
1319  //This is a workaround to enable users to force a 20 or 40 MHz channel for a VHT-compliant device,
1320  //since IEEE 802.11ac standard says that 20, 40 and 80 MHz channels are mandatory.
1321  if (m_wifiPhy->GetChannelWidth () < state->m_channelWidth)
1322  {
1323  state->m_channelWidth = m_wifiPhy->GetChannelWidth ();
1324  }
1325  for (uint8_t i = 1; i <= m_wifiPhy->GetMaxSupportedTxSpatialStreams (); i++)
1326  {
1327  for (const auto & mcs : m_wifiPhy->GetMcsList (WIFI_MOD_CLASS_VHT))
1328  {
1329  if (vhtCapabilities.IsSupportedMcs (mcs.GetMcsValue (), i))
1330  {
1331  AddSupportedMcs (from, mcs);
1332  }
1333  }
1334  }
1335  state->m_vhtCapabilities = Create<const VhtCapabilities> (vhtCapabilities);
1336 }
1337 
1338 void
1339 WifiRemoteStationManager::AddStationHeCapabilities (Mac48Address from, HeCapabilities heCapabilities)
1340 {
1341  //Used by all stations to record HE capabilities of remote stations
1342  NS_LOG_FUNCTION (this << from << heCapabilities);
1343  WifiRemoteStationState *state;
1344  state = LookupState (from);
1345  if ((m_wifiPhy->GetPhyBand () == WIFI_PHY_BAND_5GHZ) || (m_wifiPhy->GetPhyBand () == WIFI_PHY_BAND_6GHZ))
1346  {
1347  if (heCapabilities.GetChannelWidthSet () & 0x04)
1348  {
1349  state->m_channelWidth = 160;
1350  }
1351  else if (heCapabilities.GetChannelWidthSet () & 0x02)
1352  {
1353  state->m_channelWidth = 80;
1354  }
1355  //For other cases at 5 GHz, the supported channel width is set by the VHT capabilities
1356  }
1357  else if (m_wifiPhy->GetPhyBand () == WIFI_PHY_BAND_2_4GHZ)
1358  {
1359  if (heCapabilities.GetChannelWidthSet () & 0x01)
1360  {
1361  state->m_channelWidth = 40;
1362  }
1363  else
1364  {
1365  state->m_channelWidth = 20;
1366  }
1367  }
1368  if (heCapabilities.GetHeSuPpdu1xHeLtf800nsGi () == 1)
1369  {
1370  state->m_guardInterval = 800;
1371  }
1372  else
1373  {
1374  //todo: Using 3200ns, default value for HeConfiguration::GuardInterval
1375  state->m_guardInterval = 3200;
1376  }
1377  for (uint8_t i = 1; i <= m_wifiPhy->GetMaxSupportedTxSpatialStreams (); i++)
1378  {
1379  for (const auto & mcs : m_wifiPhy->GetMcsList (WIFI_MOD_CLASS_HE))
1380  {
1381  if (heCapabilities.GetHighestNssSupported () >= i
1382  && heCapabilities.GetHighestMcsSupported () >= mcs.GetMcsValue ())
1383  {
1384  AddSupportedMcs (from, mcs);
1385  }
1386  }
1387  }
1388  state->m_heCapabilities = Create<const HeCapabilities> (heCapabilities);
1389  SetQosSupport (from, true);
1390 }
1391 
1393 WifiRemoteStationManager::GetStationHtCapabilities (Mac48Address from)
1394 {
1395  return LookupState (from)->m_htCapabilities;
1396 }
1397 
1399 WifiRemoteStationManager::GetStationVhtCapabilities (Mac48Address from)
1400 {
1401  return LookupState (from)->m_vhtCapabilities;
1402 }
1403 
1405 WifiRemoteStationManager::GetStationHeCapabilities (Mac48Address from)
1406 {
1407  return LookupState (from)->m_heCapabilities;
1408 }
1409 
1410 bool
1411 WifiRemoteStationManager::GetLdpcSupported (Mac48Address address) const
1412 {
1413  Ptr<const HtCapabilities> htCapabilities = LookupState (address)->m_htCapabilities;
1414  Ptr<const VhtCapabilities> vhtCapabilities = LookupState (address)->m_vhtCapabilities;
1415  Ptr<const HeCapabilities> heCapabilities = LookupState (address)->m_heCapabilities;
1416  bool supported = false;
1417  if (htCapabilities)
1418  {
1419  supported |= htCapabilities->GetLdpc ();
1420  }
1421  if (vhtCapabilities)
1422  {
1423  supported |= vhtCapabilities->GetRxLdpc ();
1424  }
1425  if (heCapabilities)
1426  {
1427  supported |= heCapabilities->GetLdpcCodingInPayload ();
1428  }
1429  return supported;
1430 }
1431 
1432 WifiMode
1433 WifiRemoteStationManager::GetDefaultMode (void) const
1434 {
1435  return m_defaultTxMode;
1436 }
1437 
1438 WifiMode
1439 WifiRemoteStationManager::GetDefaultMcs (void) const
1440 {
1441  return m_defaultTxMcs;
1442 }
1443 
1444 void
1446 {
1447  NS_LOG_FUNCTION (this);
1448  for (auto& state : m_states)
1449  {
1450  delete (state.second);
1451  }
1452  m_states.clear ();
1453  for (auto& state: m_stations)
1454  {
1455  delete (state.second);
1456  }
1457  m_stations.clear ();
1458  m_bssBasicRateSet.clear ();
1459  m_bssBasicMcsSet.clear ();
1460  m_ssrc.fill (0);
1461  m_slrc.fill (0);
1462 }
1463 
1464 void
1465 WifiRemoteStationManager::AddBasicMode (WifiMode mode)
1466 {
1467  NS_LOG_FUNCTION (this << mode);
1468  if (mode.GetModulationClass () >= WIFI_MOD_CLASS_HT)
1469  {
1470  NS_FATAL_ERROR ("It is not allowed to add a HT rate in the BSSBasicRateSet!");
1471  }
1472  for (uint8_t i = 0; i < GetNBasicModes (); i++)
1473  {
1474  if (GetBasicMode (i) == mode)
1475  {
1476  return;
1477  }
1478  }
1479  m_bssBasicRateSet.push_back (mode);
1480 }
1481 
1482 uint8_t
1483 WifiRemoteStationManager::GetNBasicModes (void) const
1484 {
1485  return static_cast<uint8_t> (m_bssBasicRateSet.size ());
1486 }
1487 
1488 WifiMode
1489 WifiRemoteStationManager::GetBasicMode (uint8_t i) const
1490 {
1491  NS_ASSERT (i < GetNBasicModes ());
1492  return m_bssBasicRateSet[i];
1493 }
1494 
1495 uint32_t
1496 WifiRemoteStationManager::GetNNonErpBasicModes (void) const
1497 {
1498  uint32_t size = 0;
1499  for (WifiModeListIterator i = m_bssBasicRateSet.begin (); i != m_bssBasicRateSet.end (); i++)
1500  {
1501  if (i->GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM)
1502  {
1503  continue;
1504  }
1505  size++;
1506  }
1507  return size;
1508 }
1509 
1510 WifiMode
1511 WifiRemoteStationManager::GetNonErpBasicMode (uint8_t i) const
1512 {
1513  NS_ASSERT (i < GetNNonErpBasicModes ());
1514  uint32_t index = 0;
1515  bool found = false;
1516  for (WifiModeListIterator j = m_bssBasicRateSet.begin (); j != m_bssBasicRateSet.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 m_bssBasicRateSet[index];
1533 }
1534 
1535 void
1536 WifiRemoteStationManager::AddBasicMcs (WifiMode mcs)
1537 {
1538  NS_LOG_FUNCTION (this << +mcs.GetMcsValue ());
1539  for (uint8_t i = 0; i < GetNBasicMcs (); i++)
1540  {
1541  if (GetBasicMcs (i) == mcs)
1542  {
1543  return;
1544  }
1545  }
1546  m_bssBasicMcsSet.push_back (mcs);
1547 }
1548 
1549 uint8_t
1550 WifiRemoteStationManager::GetNBasicMcs (void) const
1551 {
1552  return static_cast<uint8_t> (m_bssBasicMcsSet.size ());
1553 }
1554 
1555 WifiMode
1556 WifiRemoteStationManager::GetBasicMcs (uint8_t i) const
1557 {
1558  NS_ASSERT (i < GetNBasicMcs ());
1559  return m_bssBasicMcsSet[i];
1560 }
1561 
1562 WifiMode
1563 WifiRemoteStationManager::GetNonUnicastMode (void) const
1564 {
1565  if (m_nonUnicastMode == WifiMode ())
1566  {
1567  if (GetNBasicModes () > 0)
1568  {
1569  return GetBasicMode (0);
1570  }
1571  else
1572  {
1573  return GetDefaultMode ();
1574  }
1575  }
1576  else
1577  {
1578  return m_nonUnicastMode;
1579  }
1580 }
1581 
1582 bool
1583 WifiRemoteStationManager::DoNeedRts (WifiRemoteStation *station,
1584  uint32_t size, bool normally)
1585 {
1586  return normally;
1587 }
1588 
1589 bool
1590 WifiRemoteStationManager::DoNeedRetransmission (WifiRemoteStation *station,
1591  Ptr<const Packet> packet, bool normally)
1592 {
1593  return normally;
1594 }
1595 
1596 bool
1597 WifiRemoteStationManager::DoNeedFragmentation (WifiRemoteStation *station,
1598  Ptr<const Packet> packet, bool normally)
1599 {
1600  return normally;
1601 }
1602 
1603 void
1604 WifiRemoteStationManager::DoReportAmpduTxStatus (WifiRemoteStation *station, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus, double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)
1605 {
1606  NS_LOG_DEBUG ("DoReportAmpduTxStatus received but the manager does not handle A-MPDUs!");
1607 }
1608 
1609 WifiMode
1610 WifiRemoteStationManager::GetSupported (const WifiRemoteStation *station, uint8_t i) const
1611 {
1612  NS_ASSERT (i < GetNSupported (station));
1613  return station->m_state->m_operationalRateSet[i];
1614 }
1615 
1616 WifiMode
1617 WifiRemoteStationManager::GetMcsSupported (const WifiRemoteStation *station, uint8_t i) const
1618 {
1619  NS_ASSERT (i < GetNMcsSupported (station));
1620  return station->m_state->m_operationalMcsSet[i];
1621 }
1622 
1623 WifiMode
1624 WifiRemoteStationManager::GetNonErpSupported (const WifiRemoteStation *station, uint8_t i) const
1625 {
1626  NS_ASSERT (i < GetNNonErpSupported (station));
1627  //IEEE 802.11g standard defines that if the protection mechanism is enabled, RTS, CTS and CTS-To-Self
1628  //frames should select a rate in the BSSBasicRateSet that corresponds to an 802.11b basic rate.
1629  //This is a implemented here to avoid changes in every RAA, but should maybe be moved in case it breaks standard rules.
1630  uint32_t index = 0;
1631  bool found = false;
1632  for (WifiModeListIterator j = station->m_state->m_operationalRateSet.begin (); j != station->m_state->m_operationalRateSet.end (); )
1633  {
1634  if (i == index)
1635  {
1636  found = true;
1637  }
1638  if (j->GetModulationClass () != WIFI_MOD_CLASS_ERP_OFDM)
1639  {
1640  if (found)
1641  {
1642  break;
1643  }
1644  }
1645  index++;
1646  j++;
1647  }
1648  return station->m_state->m_operationalRateSet[index];
1649 }
1650 
1652 WifiRemoteStationManager::GetAddress (const WifiRemoteStation *station) const
1653 {
1654  return station->m_state->m_address;
1655 }
1656 
1657 uint16_t
1658 WifiRemoteStationManager::GetChannelWidth (const WifiRemoteStation *station) const
1659 {
1660  return station->m_state->m_channelWidth;
1661 }
1662 
1663 bool
1664 WifiRemoteStationManager::GetShortGuardIntervalSupported (const WifiRemoteStation *station) const
1665 {
1666  Ptr<const HtCapabilities> htCapabilities = station->m_state->m_htCapabilities;
1667 
1668  if (!htCapabilities)
1669  {
1670  return false;
1671  }
1672  return htCapabilities->GetShortGuardInterval20 ();
1673 }
1674 
1675 uint16_t
1676 WifiRemoteStationManager::GetGuardInterval (const WifiRemoteStation *station) const
1677 {
1678  return station->m_state->m_guardInterval;
1679 }
1680 
1681 bool
1682 WifiRemoteStationManager::GetAggregation (const WifiRemoteStation *station) const
1683 {
1684  return station->m_state->m_aggregation;
1685 }
1686 
1687 uint8_t
1688 WifiRemoteStationManager::GetNumberOfSupportedStreams (const WifiRemoteStation *station) const
1689 {
1690  Ptr<const HtCapabilities> htCapabilities = station->m_state->m_htCapabilities;
1691 
1692  if (!htCapabilities)
1693  {
1694  return 1;
1695  }
1696  return htCapabilities->GetRxHighestSupportedAntennas ();
1697 }
1698 
1699 uint8_t
1700 WifiRemoteStationManager::GetNess (const WifiRemoteStation *station) const
1701 {
1702  return station->m_state->m_ness;
1703 }
1704 
1706 WifiRemoteStationManager::GetPhy (void) const
1707 {
1708  return m_wifiPhy;
1709 }
1710 
1712 WifiRemoteStationManager::GetMac (void) const
1713 {
1714  return m_wifiMac;
1715 }
1716 
1717 uint8_t
1718 WifiRemoteStationManager::GetNSupported (const WifiRemoteStation *station) const
1719 {
1720  return static_cast<uint8_t> (station->m_state->m_operationalRateSet.size ());
1721 }
1722 
1723 bool
1724 WifiRemoteStationManager::GetQosSupported (const WifiRemoteStation *station) const
1725 {
1726  return station->m_state->m_qosSupported;
1727 }
1728 
1729 bool
1730 WifiRemoteStationManager::GetHtSupported (const WifiRemoteStation *station) const
1731 {
1732  return (station->m_state->m_htCapabilities != 0);
1733 }
1734 
1735 bool
1736 WifiRemoteStationManager::GetVhtSupported (const WifiRemoteStation *station) const
1737 {
1738  return (station->m_state->m_vhtCapabilities != 0);
1739 }
1740 
1741 bool
1742 WifiRemoteStationManager::GetHeSupported (const WifiRemoteStation *station) const
1743 {
1744  return (station->m_state->m_heCapabilities != 0);
1745 }
1746 
1747 uint8_t
1748 WifiRemoteStationManager::GetNMcsSupported (const WifiRemoteStation *station) const
1749 {
1750  return static_cast<uint8_t> (station->m_state->m_operationalMcsSet.size ());
1751 }
1752 
1753 uint32_t
1754 WifiRemoteStationManager::GetNNonErpSupported (const WifiRemoteStation *station) const
1755 {
1756  uint32_t size = 0;
1757  for (WifiModeListIterator i = station->m_state->m_operationalRateSet.begin (); i != station->m_state->m_operationalRateSet.end (); i++)
1758  {
1759  if (i->GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM)
1760  {
1761  continue;
1762  }
1763  size++;
1764  }
1765  return size;
1766 }
1767 
1768 uint16_t
1769 WifiRemoteStationManager::GetChannelWidthSupported (Mac48Address address) const
1770 {
1771  return LookupState (address)->m_channelWidth;
1772 }
1773 
1774 bool
1775 WifiRemoteStationManager::GetShortGuardIntervalSupported (Mac48Address address) const
1776 {
1777  Ptr<const HtCapabilities> htCapabilities = LookupState (address)->m_htCapabilities;
1778 
1779  if (!htCapabilities)
1780  {
1781  return false;
1782  }
1783  return htCapabilities->GetShortGuardInterval20 ();
1784 }
1785 
1786 uint8_t
1787 WifiRemoteStationManager::GetNumberOfSupportedStreams (Mac48Address address) const
1788 {
1789  Ptr<const HtCapabilities> htCapabilities = LookupState (address)->m_htCapabilities;
1790 
1791  if (!htCapabilities)
1792  {
1793  return 1;
1794  }
1795  return htCapabilities->GetRxHighestSupportedAntennas ();
1796 }
1797 
1798 uint8_t
1799 WifiRemoteStationManager::GetNMcsSupported (Mac48Address address) const
1800 {
1801  return static_cast<uint8_t> (LookupState (address)->m_operationalMcsSet.size ());
1802 }
1803 
1804 bool
1805 WifiRemoteStationManager::GetDsssSupported (const Mac48Address& address) const
1806 {
1807  return (LookupState (address)->m_dsssSupported);
1808 }
1809 
1810 bool
1811 WifiRemoteStationManager::GetErpOfdmSupported (const Mac48Address& address) const
1812 {
1813  return (LookupState (address)->m_erpOfdmSupported);
1814 }
1815 
1816 bool
1817 WifiRemoteStationManager::GetOfdmSupported (const Mac48Address& address) const
1818 {
1819  return (LookupState (address)->m_ofdmSupported);
1820 }
1821 
1822 bool
1823 WifiRemoteStationManager::GetHtSupported (Mac48Address address) const
1824 {
1825  return (LookupState (address)->m_htCapabilities != 0);
1826 }
1827 
1828 bool
1829 WifiRemoteStationManager::GetVhtSupported (Mac48Address address) const
1830 {
1831  return (LookupState (address)->m_vhtCapabilities != 0);
1832 }
1833 
1834 bool
1835 WifiRemoteStationManager::GetHeSupported (Mac48Address address) const
1836 {
1837  return (LookupState (address)->m_heCapabilities != 0);
1838 }
1839 
1840 void
1841 WifiRemoteStationManager::SetDefaultTxPowerLevel (uint8_t txPower)
1842 {
1843  m_defaultTxPowerLevel = txPower;
1844 }
1845 
1846 uint8_t
1847 WifiRemoteStationManager::GetNumberOfAntennas (void) const
1848 {
1849  return m_wifiPhy->GetNumberOfAntennas ();
1850 }
1851 
1852 uint8_t
1853 WifiRemoteStationManager::GetMaxNumberOfTransmitStreams (void) const
1854 {
1855  return m_wifiPhy->GetMaxSupportedTxSpatialStreams ();
1856 }
1857 
1858 bool
1859 WifiRemoteStationManager::UseLdpcForDestination (Mac48Address dest) const
1860 {
1861  return (GetLdpcSupported () && GetLdpcSupported (dest));
1862 }
1863 
1864 } //namespace ns3
ns3::WifiRemoteStationManager::IsAssociated
bool IsAssociated(Mac48Address address) const
Return whether the station associated.
Definition: wifi-remote-station-manager.cc:427
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::WifiRemoteStationManager::GetDefaultTxPowerLevel
uint8_t GetDefaultTxPowerLevel(void) const
Definition: wifi-remote-station-manager.cc:1184
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
ns3::HeCapabilities::GetHeSuPpdu1xHeLtf800nsGi
bool GetHeSuPpdu1xHeLtf800nsGi(void) const
Get 1xHE-LTF and 800ns GI in HE SU PPDU reception support.
Definition: he-capabilities.cc:613
ns3::VhtCapabilities
The IEEE 802.11ac VHT Capabilities.
Definition: vht-capabilities.h:35
ns3::WifiRemoteStationManager::GetNBasicMcs
uint8_t GetNBasicMcs(void) const
Return the number of basic MCS index.
Definition: wifi-remote-station-manager.cc:1550
ns3::WifiTxVector::SetTxPowerLevel
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
Definition: wifi-tx-vector.cc:242
ns3::WifiRemoteStationManager::m_bssBasicRateSet
WifiModeList m_bssBasicRateSet
This member is the list of WifiMode objects that comprise the BSSBasicRateSet parameter.
Definition: wifi-remote-station-manager.h:1302
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
NS_ASSERT
#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
ns3::WIFI_MOD_CLASS_ERP_OFDM
@ WIFI_MOD_CLASS_ERP_OFDM
ERP-OFDM (18.4)
Definition: wifi-phy-common.h:128
ns3::WifiRemoteStationManager::m_shortPreambleEnabled
bool m_shortPreambleEnabled
flag if short PHY preamble is enabled
Definition: wifi-remote-station-manager.h:1319
ns3::WifiRemoteStationManager::SetMaxSsrc
void SetMaxSsrc(uint32_t maxSsrc)
Sets the maximum STA short retry count (SSRC).
Definition: wifi-remote-station-manager.cc:178
ns3::WifiRemoteStationManager::GetDefaultMcs
WifiMode GetDefaultMcs(void) const
Return the default Modulation and Coding Scheme (MCS) index.
Definition: wifi-remote-station-manager.cc:1439
ap-wifi-mac.h
ns3::WifiNetDevice::GetHtConfiguration
Ptr< HtConfiguration > GetHtConfiguration(void) const
Definition: wifi-net-device.cc:456
ns3::WifiRemoteStationManager::GetUseNonErpProtection
bool GetUseNonErpProtection(void) const
Return whether the device supports protection of non-ERP stations.
Definition: wifi-remote-station-manager.cc:1029
ns3::WifiRemoteStationState::m_aid
uint16_t m_aid
AID of the remote station (unused if this object is installed on a non-AP station)
Definition: wifi-remote-station-manager.h:96
ns3::Mac48Address::IsGroup
bool IsGroup(void) const
Definition: mac48-address.cc:164
ns3::WifiRemoteStationManager::ReportAmpduTxStatus
void ReportAmpduTxStatus(Mac48Address address, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus, double rxSnr, double dataSnr, WifiTxVector dataTxVector)
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
Definition: wifi-remote-station-manager.cc:921
ns3::WifiMode::IsMandatory
bool IsMandatory(void) const
Definition: wifi-mode.cc:148
ns3::WifiRemoteStationState::m_vhtCapabilities
Ptr< const VhtCapabilities > m_vhtCapabilities
remote station VHT capabilities
Definition: wifi-remote-station-manager.h:103
ns3::WifiRemoteStationManager::CTS_TO_SELF
@ CTS_TO_SELF
Definition: wifi-remote-station-manager.h:136
ns3::Simulator::Now
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:195
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiRemoteStationState::WAIT_ASSOC_TX_OK
@ WAIT_ASSOC_TX_OK
Definition: wifi-remote-station-manager.h:80
ns3::WifiRemoteStationManager::SetShortSlotTimeEnabled
void SetShortSlotTimeEnabled(bool enable)
Enable or disable short slot time.
Definition: wifi-remote-station-manager.cc:213
ns3::WifiRemoteStationManager::RTS_CTS
@ RTS_CTS
Definition: wifi-remote-station-manager.h:135
ns3::WIFI_MAC_FCS_LENGTH
static const uint16_t WIFI_MAC_FCS_LENGTH
The length in octects of the IEEE 802.11 MAC FCS field.
Definition: wifi-mac-trailer.h:31
ns3::WifiRemoteStationManager::GetShortGuardIntervalSupported
bool GetShortGuardIntervalSupported(void) const
Return whether the device has SGI support enabled.
Definition: wifi-remote-station-manager.cc:262
ns3::WIFI_MOD_CLASS_HT
@ WIFI_MOD_CLASS_HT
HT (Clause 19)
Definition: wifi-phy-common.h:130
ns3::WIFI_MOD_CLASS_HE
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
Definition: wifi-phy-common.h:132
ns3::MakeEnumChecker
Ptr< const AttributeChecker > MakeEnumChecker(int v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
Definition: enum.h:161
ns3::WifiRemoteStationManager::Lookup
WifiRemoteStation * Lookup(Mac48Address address) const
Return the station associated with the given address.
Definition: wifi-remote-station-manager.cc:1243
ns3::WifiMode::IsHigherDataRate
bool IsHigherDataRate(WifiMode mode) const
Definition: wifi-mode.cc:199
ns3::WifiRemoteStationManager::SetRtsCtsThreshold
void SetRtsCtsThreshold(uint32_t threshold)
Sets the RTS threshold.
Definition: wifi-remote-station-manager.cc:192
ns3::WifiRemoteStationManager::UseLdpcForDestination
bool UseLdpcForDestination(Mac48Address dest) const
Definition: wifi-remote-station-manager.cc:1859
ns3::WifiRemoteStationManager::GetBlockAckTxVector
WifiTxVector GetBlockAckTxVector(Mac48Address to, const WifiTxVector &dataTxVector) const
Return a TXVECTOR for the BlockAck frame given the destination and the mode of the Data used by the s...
Definition: wifi-remote-station-manager.cc:651
ns3::WifiTxVector::SetGuardInterval
void SetGuardInterval(uint16_t guardInterval)
Sets the guard interval duration (in nanoseconds)
Definition: wifi-tx-vector.cc:260
ns3::WifiRemoteStationManager::ReportRtsFailed
void ReportRtsFailed(const WifiMacHeader &header)
Should be invoked whenever the RtsTimeout associated to a transmission attempt expires.
Definition: wifi-remote-station-manager.cc:807
ns3::WIFI_PHY_BAND_5GHZ
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Definition: wifi-phy-band.h:37
ns3::WifiPhy::GetDevice
Ptr< WifiNetDevice > GetDevice(void) const
Return the device this PHY is associated with.
Definition: wifi-phy.cc:784
ns3::WIFI_PREAMBLE_VHT_SU
@ WIFI_PREAMBLE_VHT_SU
Definition: wifi-phy-common.h:72
wifi-remote-station-manager.h
ns3::MakeWifiModeChecker
Ptr< const AttributeChecker > MakeWifiModeChecker(void)
Definition: wifi-mode.cc:253
ns3::WifiRemoteStationManager::NeedFragmentation
bool NeedFragmentation(Ptr< const WifiMacQueueItem > mpdu)
Definition: wifi-remote-station-manager.cc:1071
NS_LOG_WARN
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:265
ns3::WifiRemoteStationManager::m_ssrc
std::array< uint32_t, AC_BE_NQOS > m_ssrc
short retry count per AC
Definition: wifi-remote-station-manager.h:1324
ns3::WifiMode::GetModulationClass
WifiModulationClass GetModulationClass() const
Definition: wifi-mode.cc:177
ns3::HeCapabilities
The IEEE 802.11ax HE Capabilities.
Definition: he-capabilities.h:34
ns3::WifiTxVector::SetNss
void SetNss(uint8_t nss)
Sets the number of Nss.
Definition: wifi-tx-vector.cc:272
ns3::WifiRemoteStationManager::GetControlAnswerMode
WifiMode GetControlAnswerMode(WifiMode reqMode) const
Get control answer mode function.
Definition: wifi-remote-station-manager.cc:667
ns3::WifiRemoteStationManager::RecordGotAssocTxFailed
void RecordGotAssocTxFailed(Mac48Address address)
Records that we missed an ACK for the association response we sent.
Definition: wifi-remote-station-manager.cc:461
ns3::WifiRemoteStationManager::GetNBasicModes
uint8_t GetNBasicModes(void) const
Return the number of basic modes we support.
Definition: wifi-remote-station-manager.cc:1483
ns3::WifiRemoteStationManager
hold a list of per-remote-station state.
Definition: wifi-remote-station-manager.h:121
ns3::Config::Reset
void Reset(void)
Reset the initial value of every attribute as well as the value of every global to what they were bef...
Definition: config.cc:820
ns3::WifiRemoteStationManager::GetHtSupported
bool GetHtSupported(void) const
Return whether the device has HT capability support enabled.
Definition: wifi-remote-station-manager.cc:232
ns3::Mac48Address
an EUI-48 address
Definition: mac48-address.h:44
ns3::WifiRemoteStationManager::GetVhtSupported
bool GetVhtSupported(void) const
Return whether the device has VHT capability support enabled.
Definition: wifi-remote-station-manager.cc:238
ns3::WifiRemoteStationManager::GetGuardInterval
uint16_t GetGuardInterval(void) const
Return the supported HE guard interval duration (in nanoseconds).
Definition: wifi-remote-station-manager.cc:277
ns3::WifiTxVector::SetMode
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
Definition: wifi-tx-vector.cc:226
ns3::WIFI_MOD_CLASS_OFDM
@ WIFI_MOD_CLASS_OFDM
OFDM (Clause 17)
Definition: wifi-phy-common.h:129
ns3::WifiTxVector
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Definition: wifi-tx-vector.h:71
ns3::WifiRemoteStationManager::m_wifiMac
Ptr< WifiMac > m_wifiMac
This is a pointer to the WifiMac associated with this WifiRemoteStationManager that is set on call to...
Definition: wifi-remote-station-manager.h:1292
wifi-phy.h
wifi-mac-queue-item.h
ns3::WifiRemoteStationManager::DoReportFinalRtsFailed
virtual void DoReportFinalRtsFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
ns3::WifiMacHeader::GetAddr1
Mac48Address GetAddr1(void) const
Return the address in the Address 1 field.
Definition: wifi-mac-header.cc:424
third.mac
mac
Definition: third.py:99
ns3::MakeWifiModeAccessor
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:252
ns3::WifiRemoteStationManager::DoReportRxOk
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.
ns3::WifiRemoteStationManager::ReportRxOk
void ReportRxOk(Mac48Address address, RxSignalInfo rxSignalInfo, WifiTxVector txVector)
Definition: wifi-remote-station-manager.cc:908
ns3::WIFI_PREAMBLE_HE_SU
@ WIFI_PREAMBLE_HE_SU
Definition: wifi-phy-common.h:74
ns3::WifiRemoteStationState::m_state
enum ns3::WifiRemoteStationState::@0 m_state
State of the station.
ns3::WifiRemoteStationManager::AddAllSupportedModes
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...
Definition: wifi-remote-station-manager.cc:343
ns3::WifiRemoteStationManager::GetShortPreambleSupported
bool GetShortPreambleSupported(Mac48Address address) const
Return whether the station supports short PHY preamble or not.
Definition: wifi-remote-station-manager.cc:399
ns3::WifiRemoteStationManager::AddAllSupportedMcs
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...
Definition: wifi-remote-station-manager.cc:360
ns3::WifiRemoteStationManager::m_useNonErpProtection
bool m_useNonErpProtection
flag if protection for non-ERP stations against ERP transmissions is enabled
Definition: wifi-remote-station-manager.h:1317
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
ns3::AP
@ AP
Definition: wifi-mac.h:43
ns3::WifiRemoteStationManager::GetShortPreambleEnabled
bool GetShortPreambleEnabled(void) const
Return whether the device uses short PHY preambles.
Definition: wifi-remote-station-manager.cc:226
ns3::EnumValue
Hold variables of type enum.
Definition: enum.h:55
ns3::MakeTraceSourceAccessor
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Definition: trace-source-accessor.h:202
ns3::WifiNetDevice::GetHeConfiguration
Ptr< HeConfiguration > GetHeConfiguration(void) const
Definition: wifi-net-device.cc:480
ns3::WifiRemoteStationManager::GetNFragments
uint32_t GetNFragments(Ptr< const WifiMacQueueItem > mpdu)
Return the number of fragments needed for the given packet.
Definition: wifi-remote-station-manager.cc:1120
ns3::WifiRemoteStationManager::m_macTxFinalRtsFailed
TracedCallback< Mac48Address > m_macTxFinalRtsFailed
The trace source fired when the transmission of a RTS has exceeded the maximum number of attempts.
Definition: wifi-remote-station-manager.h:1339
wifi-mac-header.h
ns3::WifiRemoteStationManager::m_maxSlrc
uint32_t m_maxSlrc
Maximum STA long retry count (SLRC)
Definition: wifi-remote-station-manager.h:1312
ns3::WifiRemoteStationManager::m_macTxDataFailed
TracedCallback< Mac48Address > m_macTxDataFailed
The trace source fired when the transmission of a single data packet has failed.
Definition: wifi-remote-station-manager.h:1334
ns3::WifiMacHeader
Implements the IEEE 802.11 MAC header.
Definition: wifi-mac-header.h:85
ns3::WifiRemoteStationManager::AddSupportedMode
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...
Definition: wifi-remote-station-manager.cc:314
ns3::WIFI_MOD_CLASS_HR_DSSS
@ WIFI_MOD_CLASS_HR_DSSS
HR/DSSS (Clause 16)
Definition: wifi-phy-common.h:127
ns3::WifiRemoteStationState::m_operationalMcsSet
WifiModeList m_operationalMcsSet
operational MCS set
Definition: wifi-remote-station-manager.h:94
ns3::HtPhy::GetHtMcs
static WifiMode GetHtMcs(uint8_t index)
Return the HT MCS corresponding to the provided index.
Definition: ht-phy.cc:456
ns3::WifiRemoteStationManager::DoGetFragmentationThreshold
uint32_t DoGetFragmentationThreshold(void) const
Return the current fragmentation threshold.
Definition: wifi-remote-station-manager.cc:1114
ns3::Ptr< WifiPhy >
ns3::WifiRemoteStationState::BRAND_NEW
@ BRAND_NEW
Definition: wifi-remote-station-manager.h:78
ns3::WifiRemoteStationState::GOT_ASSOC_TX_OK
@ GOT_ASSOC_TX_OK
Definition: wifi-remote-station-manager.h:81
ns3::WifiRemoteStationManager::m_erpProtectionMode
ProtectionMode m_erpProtectionMode
Protection mode for ERP stations when non-ERP stations are detected.
Definition: wifi-remote-station-manager.h:1321
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
ns3::WifiRemoteStationManager::GetNonUnicastMode
WifiMode GetNonUnicastMode(void) const
Return a mode for non-unicast packets.
Definition: wifi-remote-station-manager.cc:1563
ns3::WifiRemoteStationState::m_channelWidth
uint16_t m_channelWidth
Channel width (in MHz) supported by the remote station.
Definition: wifi-remote-station-manager.h:105
ns3::WifiRemoteStationManager::DoSetFragmentationThreshold
void DoSetFragmentationThreshold(uint32_t threshold)
Actually sets the fragmentation threshold, it also checks the validity of the given threshold.
Definition: wifi-remote-station-manager.cc:1084
ns3::WifiRemoteStationManager::DoReportRtsOk
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.
ns3::WifiRemoteStationManager::GetQosSupported
bool GetQosSupported(Mac48Address address) const
Return whether the given station is QoS capable.
Definition: wifi-remote-station-manager.cc:411
ns3::WifiRemoteStationManager::m_slrc
std::array< uint32_t, AC_BE_NQOS > m_slrc
long retry count per AC
Definition: wifi-remote-station-manager.h:1325
ns3::WifiRemoteStationManager::RemoveAllSupportedMcs
void RemoveAllSupportedMcs(Mac48Address address)
Invoked in a STA or AP to delete all of the supported MCS by a destination.
Definition: wifi-remote-station-manager.cc:373
ns3::WifiMode
represent a single transmission mode
Definition: wifi-mode.h:48
ns3::WifiTxVector::SetNess
void SetNess(uint8_t ness)
Sets the Ness number.
Definition: wifi-tx-vector.cc:286
ns3::WifiRemoteStationManager::NeedRts
bool NeedRts(const WifiMacHeader &header, uint32_t size)
Definition: wifi-remote-station-manager.cc:935
ns3::WifiRemoteStationManager::DoReportDataFailed
virtual void DoReportDataFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
ns3::WifiRemoteStationManager::m_stations
Stations m_stations
Information for each known stations.
Definition: wifi-remote-station-manager.h:1306
ns3::WifiRemoteStationManager::m_defaultTxMode
WifiMode m_defaultTxMode
The default transmission mode.
Definition: wifi-remote-station-manager.h:1308
ns3::WifiRemoteStationManager::AddSupportedErpSlotTime
void AddSupportedErpSlotTime(Mac48Address address, bool isShortSlotTimeSupported)
Record whether the short ERP slot time is supported by the station.
Definition: wifi-remote-station-manager.cc:305
ns3::Object
A base class which provides memory management and object aggregation.
Definition: object.h:88
ns3::WifiRemoteStationInfo::NotifyTxSuccess
void NotifyTxSuccess(uint32_t retryCounter)
Updates average frame error rate when data or RTS was transmitted successfully.
Definition: wifi-remote-station-info.cc:46
ns3::WifiRemoteStationManager::Reset
void Reset(void)
Reset the station, invoked in a STA upon dis-association or in an AP upon reboot.
Definition: wifi-remote-station-manager.cc:1445
ns3::WifiRemoteStationManager::GetShortSlotTimeSupported
bool GetShortSlotTimeSupported(Mac48Address address) const
Return whether the station supports short ERP slot time or not.
Definition: wifi-remote-station-manager.cc:405
wifi-net-device.h
ns3::HtCapabilities
The HT Capabilities Information Element.
Definition: ht-capabilities.h:42
ns3::HeCapabilities::GetChannelWidthSet
uint8_t GetChannelWidthSet(void) const
Get channel width set.
Definition: he-capabilities.cc:601
ns3::QosUtilsMapTidToAc
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
Definition: qos-utils.cc:126
ns3::WifiRemoteStationManager::m_defaultTxMcs
WifiMode m_defaultTxMcs
The default transmission modulation-coding scheme (MCS)
Definition: wifi-remote-station-manager.h:1309
ns3::WifiRemoteStationState::m_ness
uint8_t m_ness
Number of extended spatial streams of the remote station.
Definition: wifi-remote-station-manager.h:107
ns3::WifiRemoteStationManager::m_defaultTxPowerLevel
uint8_t m_defaultTxPowerLevel
Default transmission power level.
Definition: wifi-remote-station-manager.h:1315
ns3::WifiNetDevice::GetVhtConfiguration
Ptr< VhtConfiguration > GetVhtConfiguration(void) const
Definition: wifi-net-device.cc:468
ns3::ConvertGuardIntervalToNanoSeconds
uint16_t ConvertGuardIntervalToNanoSeconds(WifiMode mode, const Ptr< WifiNetDevice > device)
Convert the guard interval to nanoseconds based on the WifiMode.
Definition: wifi-phy-common.cc:30
ns3::WifiRemoteStationManager::ReportRtsOk
void ReportRtsOk(const WifiMacHeader &header, double ctsSnr, WifiMode ctsMode, double rtsSnr)
Should be invoked whenever we receive the CTS associated to an RTS we just sent.
Definition: wifi-remote-station-manager.cc:837
ns3::WifiRemoteStationManager::AddBasicMode
void AddBasicMode(WifiMode mode)
Invoked in a STA upon association to store the set of rates which belong to the BSSBasicRateSet of th...
Definition: wifi-remote-station-manager.cc:1465
sta-wifi-mac.h
ns3::HeCapabilities::GetHighestMcsSupported
uint8_t GetHighestMcsSupported(void) const
Get highest MCS supported.
Definition: he-capabilities.cc:626
ns3::WifiRemoteStationManager::NeedCtsToSelf
bool NeedCtsToSelf(WifiTxVector txVector)
Return if we need to do CTS-to-self before sending a DATA.
Definition: wifi-remote-station-manager.cc:969
ns3::WifiRemoteStationManager::m_useNonHtProtection
bool m_useNonHtProtection
flag if protection for non-HT stations against HT transmissions is enabled
Definition: wifi-remote-station-manager.h:1318
ns3::WifiRemoteStationInfo::NotifyTxFailed
void NotifyTxFailed()
Updates average frame error rate when final data or RTS has failed.
Definition: wifi-remote-station-info.cc:53
ns3::WifiRemoteStationState::m_ofdmSupported
bool m_ofdmSupported
Flag if OFDM is supported by the remote station.
Definition: wifi-remote-station-manager.h:101
ns3::WifiRemoteStationManager::m_macTxFinalDataFailed
TracedCallback< Mac48Address > m_macTxFinalDataFailed
The trace source fired when the transmission of a data packet has exceeded the maximum number of atte...
Definition: wifi-remote-station-manager.h:1344
ns3::HtCapabilities::GetSupportedChannelWidth
uint8_t GetSupportedChannelWidth(void) const
Return the supported channel width.
Definition: ht-capabilities.cc:202
ns3::WifiRemoteStationManager::DoReportAmpduTxStatus
virtual void DoReportAmpduTxStatus(WifiRemoteStation *station, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus, double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
Definition: wifi-remote-station-manager.cc:1604
ns3::RxSignalInfo::rssi
double rssi
RSSI in dBm.
Definition: phy-entity.h:69
SU_STA_ID
#define SU_STA_ID
Definition: wifi-mode.h:32
ns3::WifiRemoteStationManager::GetUseNonHtProtection
bool GetUseNonHtProtection(void) const
Return whether the device supports protection of non-HT stations.
Definition: wifi-remote-station-manager.cc:1042
ns3::WifiRemoteStationState::m_shortSlotTime
bool m_shortSlotTime
Flag if short ERP slot time is supported by the remote station.
Definition: wifi-remote-station-manager.h:110
ns3::WifiRemoteStationManager::GetStaId
uint16_t GetStaId(Mac48Address address, const WifiTxVector &txVector) const
If the given TXVECTOR is used for a MU transmission, return the STAID of the station with the given a...
Definition: wifi-remote-station-manager.cc:487
ns3::WifiRemoteStationManager::WifiRemoteStationManager
WifiRemoteStationManager()
Definition: wifi-remote-station-manager.cc:120
ns3::WifiRemoteStationManager::GetFragmentOffset
uint32_t GetFragmentOffset(Ptr< const WifiMacQueueItem > mpdu, uint32_t fragmentNumber)
Definition: wifi-remote-station-manager.cc:1163
ns3::WifiMacHeader::IsQosData
bool IsQosData(void) const
Return true if the Type is DATA and Subtype is one of the possible values for QoS Data.
Definition: wifi-mac-header.cc:565
first.address
address
Definition: first.py:44
ns3::WifiRemoteStationManager::GetDefaultMode
WifiMode GetDefaultMode(void) const
Return the default transmission mode.
Definition: wifi-remote-station-manager.cc:1433
ns3::WifiRemoteStationManager::IsBrandNew
bool IsBrandNew(Mac48Address address) const
Return whether the station state is brand new.
Definition: wifi-remote-station-manager.cc:417
ns3::WifiRemoteStationManager::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: wifi-remote-station-manager.cc:46
ns3::GetChannelWidthForTransmission
uint16_t GetChannelWidthForTransmission(WifiMode mode, uint16_t maxSupportedChannelWidth)
Return the channel width that corresponds to the selected mode (instead of letting the PHY's default ...
Definition: wifi-phy-common.cc:68
ns3::WifiTxVector::SetChannelWidth
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
Definition: wifi-tx-vector.cc:254
ns3::WifiRemoteStationManager::m_htProtectionMode
ProtectionMode m_htProtectionMode
Protection mode for HT stations when non-HT stations are detected.
Definition: wifi-remote-station-manager.h:1322
ns3::WifiRemoteStationManager::m_rtsCtsThreshold
uint32_t m_rtsCtsThreshold
Threshold for RTS/CTS.
Definition: wifi-remote-station-manager.h:1313
ns3::WifiRemoteStationManager::m_shortSlotTimeEnabled
bool m_shortSlotTimeEnabled
flag if short slot time is enabled
Definition: wifi-remote-station-manager.h:1320
ns3::WifiRemoteStationManager::SetupPhy
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...
Definition: wifi-remote-station-manager.cc:142
NS_ASSERT_MSG
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:88
ns3::WifiRemoteStationManager::AddSupportedPhyPreamble
void AddSupportedPhyPreamble(Mac48Address address, bool isShortPreambleSupported)
Record whether the short PHY preamble is supported by the station.
Definition: wifi-remote-station-manager.cc:296
ns3::WifiRemoteStationManager::GetShortSlotTimeEnabled
bool GetShortSlotTimeEnabled(void) const
Return whether the device uses short slot time.
Definition: wifi-remote-station-manager.cc:220
ns3::WifiRemoteStationManager::GetLdpcSupported
bool GetLdpcSupported(void) const
Return whether the device has LDPC support enabled.
Definition: wifi-remote-station-manager.cc:250
ns3::WifiRemoteStationManager::SetShortPreambleEnabled
void SetShortPreambleEnabled(bool enable)
Enable or disable short PHY preambles.
Definition: wifi-remote-station-manager.cc:206
ns3::WifiRemoteStationManager::GetBasicMcs
WifiMode GetBasicMcs(uint8_t i) const
Return the MCS at the given list index.
Definition: wifi-remote-station-manager.cc:1556
ns3::WifiTxVector::GetChannelWidth
uint16_t GetChannelWidth(void) const
Definition: wifi-tx-vector.cc:154
ns3::WifiRemoteStationManager::m_macTxRtsFailed
TracedCallback< Mac48Address > m_macTxRtsFailed
The trace source fired when the transmission of a single RTS has failed.
Definition: wifi-remote-station-manager.h:1330
ns3::WifiRemoteStationManager::RecordWaitAssocTxOk
void RecordWaitAssocTxOk(Mac48Address address)
Records that we are waiting for an ACK for the association response we sent.
Definition: wifi-remote-station-manager.cc:447
ns3::WifiRemoteStationManager::IsLastFragment
bool IsLastFragment(Ptr< const WifiMacQueueItem > mpdu, uint32_t fragmentNumber)
Definition: wifi-remote-station-manager.cc:1174
ns3::WifiTxVector::IsMu
bool IsMu(void) const
Return true if this TX vector is used for a multi-user transmission.
Definition: wifi-tx-vector.cc:370
ns3::WifiMacHeader::IsMgt
bool IsMgt(void) const
Return true if the Type is Management.
Definition: wifi-mac-header.cc:577
ns3::WifiRemoteStationManager::GetDataTxVector
WifiTxVector GetDataTxVector(const WifiMacHeader &header)
Definition: wifi-remote-station-manager.cc:514
ns3::WifiRemoteStationState::m_qosSupported
bool m_qosSupported
Flag if QoS is supported by the station.
Definition: wifi-remote-station-manager.h:111
ns3::WifiPreamble
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition: wifi-phy-common.h:68
ns3::GetPreambleForTransmission
WifiPreamble GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble)
Return the preamble to be used for the transmission.
Definition: wifi-phy-common.cc:87
ns3::WIFI_PREAMBLE_LONG
@ WIFI_PREAMBLE_LONG
Definition: wifi-phy-common.h:69
ns3::WifiMacHeader::GetQosTid
uint8_t GetQosTid(void) const
Return the Traffic ID of a QoS header.
Definition: wifi-mac-header.cc:862
ns3::WifiRemoteStationState::m_shortPreamble
bool m_shortPreamble
Flag if short PHY preamble is supported by the remote station.
Definition: wifi-remote-station-manager.h:109
ns3::WifiRemoteStationManager::GetAckTxVector
WifiTxVector GetAckTxVector(Mac48Address to, const WifiTxVector &dataTxVector) const
Return a TXVECTOR for the Ack frame given the destination and the mode of the Data used by the sender...
Definition: wifi-remote-station-manager.cc:635
ns3::WifiRemoteStation
hold per-remote-station state.
Definition: wifi-remote-station-manager.h:62
ns3::WifiRemoteStationManager::ReportDataFailed
void ReportDataFailed(Ptr< const WifiMacQueueItem > mpdu)
Should be invoked whenever the AckTimeout associated to a transmission attempt expires.
Definition: wifi-remote-station-manager.cc:818
ns3::STA
@ STA
Definition: wifi-mac.h:42
ns3::WifiRemoteStationManager::~WifiRemoteStationManager
virtual ~WifiRemoteStationManager()
Definition: wifi-remote-station-manager.cc:129
ns3::WifiRemoteStationManager::RecordDisassociated
void RecordDisassociated(Mac48Address address)
Records that the STA was disassociated.
Definition: wifi-remote-station-manager.cc:468
ns3::WIFI_PHY_BAND_2_4GHZ
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
Definition: wifi-phy-band.h:35
ns3::WifiRemoteStationManager::DoNeedRetransmission
virtual bool DoNeedRetransmission(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
Definition: wifi-remote-station-manager.cc:1590
ns3::WifiTxVector::GetNss
uint8_t GetNss(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the number of spatial streams.
Definition: wifi-tx-vector.cc:172
ns3::RxSignalInfo::snr
double snr
SNR in linear scale.
Definition: phy-entity.h:68
NS_LOG_DEBUG
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
ns3::HeCapabilities::GetHighestNssSupported
uint8_t GetHighestNssSupported(void) const
Get highest NSS supported.
Definition: he-capabilities.cc:632
ns3::WifiRemoteStationState::m_info
WifiRemoteStationInfo m_info
remote station info
Definition: wifi-remote-station-manager.h:98
ns3::WifiRemoteStationState::m_dsssSupported
bool m_dsssSupported
Flag if DSSS is supported by the remote station.
Definition: wifi-remote-station-manager.h:99
ns3::WifiRemoteStationManager::GetNumberOfAntennas
uint8_t GetNumberOfAntennas(void) const
Definition: wifi-remote-station-manager.cc:1847
ns3::WifiRemoteStationManager::GetFragmentationThreshold
uint32_t GetFragmentationThreshold(void) const
Return the fragmentation threshold.
Definition: wifi-remote-station-manager.cc:290
ns3::WifiRemoteStationManager::GetFragmentSize
uint32_t GetFragmentSize(Ptr< const WifiMacQueueItem > mpdu, uint32_t fragmentNumber)
Definition: wifi-remote-station-manager.cc:1136
ns3::RxSignalInfo
RxSignalInfo structure containing info on the received signal.
Definition: phy-entity.h:67
ns3::WifiRemoteStation::m_state
WifiRemoteStationState * m_state
Remote station state.
Definition: wifi-remote-station-manager.h:63
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
ns3::WifiRemoteStationState::m_htCapabilities
Ptr< const HtCapabilities > m_htCapabilities
remote station HT capabilities
Definition: wifi-remote-station-manager.h:102
ns3::WifiRemoteStationManager::DoReportRtsFailed
virtual void DoReportRtsFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
ns3::WifiRemoteStationState::m_guardInterval
uint16_t m_guardInterval
HE Guard interval duration (in nanoseconds) supported by the remote station.
Definition: wifi-remote-station-manager.h:106
ns3::MakeEnumAccessor
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:203
ns3::VhtCapabilities::GetSupportedChannelWidthSet
uint8_t GetSupportedChannelWidthSet() const
Get the supported channel width set.
Definition: vht-capabilities.cc:364
ns3::StaWifiMac::IsAssociated
bool IsAssociated(void) const
Return whether we are associated with an AP.
Definition: sta-wifi-mac.cc:438
ns3::WifiRemoteStationManager::RecordGotAssocTxOk
void RecordGotAssocTxOk(Mac48Address address)
Records that we got an ACK for the association response we sent.
Definition: wifi-remote-station-manager.cc:454
ns3::WifiRemoteStationManager::AssignStreams
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition: wifi-remote-station-manager.cc:171
ns3::WifiPhy::GetChannelWidth
uint16_t GetChannelWidth(void) const
Definition: wifi-phy.cc:1234
ns3::AcIndex
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:71
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition: log-macros-enabled.h:244
ns3::WifiTxVector::SetNTx
void SetNTx(uint8_t nTx)
Sets the number of TX antennas.
Definition: wifi-tx-vector.cc:266
ns3::VhtCapabilities::IsSupportedMcs
bool IsSupportedMcs(uint8_t mcs, uint8_t nss) const
Get the is MCS supported.
Definition: vht-capabilities.cc:394
ns3::WifiRemoteStationManager::DoNeedRts
virtual bool DoNeedRts(WifiRemoteStation *station, uint32_t size, bool normally)
Definition: wifi-remote-station-manager.cc:1583
ns3::WifiRemoteStationManager::SetFragmentationThreshold
void SetFragmentationThreshold(uint32_t threshold)
Sets a fragmentation threshold.
Definition: wifi-remote-station-manager.cc:199
ns3::WIFI_PHY_BAND_6GHZ
@ WIFI_PHY_BAND_6GHZ
The 6 GHz band.
Definition: wifi-phy-band.h:39
ns3::WifiRemoteStationManager::m_fragmentationThreshold
uint32_t m_fragmentationThreshold
Current threshold for fragmentation.
Definition: wifi-remote-station-manager.h:1314
ns3::WifiRemoteStationState
A struct that holds information about each remote station.
Definition: wifi-remote-station-manager.h:72
ns3::WifiRemoteStationManager::SetMaxSlrc
void SetMaxSlrc(uint32_t maxSlrc)
Sets the maximum STA long retry count (SLRC).
Definition: wifi-remote-station-manager.cc:185
ns3::WifiPhy::GetModeList
std::list< WifiMode > GetModeList(void) const
The WifiPhy::GetModeList() method is used (e.g., by a WifiRemoteStationManager) to determine the set ...
Definition: wifi-phy.cc:2016
ns3::WifiRemoteStationManager::NeedRetransmission
bool NeedRetransmission(Ptr< const WifiMacQueueItem > mpdu)
Definition: wifi-remote-station-manager.cc:1048
ns3::WifiRemoteStationState::m_erpOfdmSupported
bool m_erpOfdmSupported
Flag if ERP OFDM is supported by the remote station.
Definition: wifi-remote-station-manager.h:100
ns3::WifiRemoteStationState::m_heCapabilities
Ptr< const HeCapabilities > m_heCapabilities
remote station HE capabilities
Definition: wifi-remote-station-manager.h:104
ns3::WifiRemoteStationManager::SetUseNonErpProtection
void SetUseNonErpProtection(bool enable)
Enable or disable protection for non-ERP stations.
Definition: wifi-remote-station-manager.cc:1022
ns3::WifiRemoteStationManager::m_states
StationStates m_states
States of known stations.
Definition: wifi-remote-station-manager.h:1305
ns3::WifiRemoteStationManager::GetMostRecentRssi
double GetMostRecentRssi(Mac48Address address) const
Definition: wifi-remote-station-manager.cc:1197
ns3::WifiRemoteStationManager::SetUseNonHtProtection
void SetUseNonHtProtection(bool enable)
Enable or disable protection for non-HT stations.
Definition: wifi-remote-station-manager.cc:1035
ns3::WifiRemoteStationManager::m_nonUnicastMode
WifiMode m_nonUnicastMode
Transmission mode for non-unicast Data frames.
Definition: wifi-remote-station-manager.h:1316
ns3::WifiRemoteStationManager::DoReportDataOk
virtual void DoReportDataOk(WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)=0
This method is a pure virtual method that must be implemented by the sub-class.
ns3::WifiRemoteStationManager::GetInfo
WifiRemoteStationInfo GetInfo(Mac48Address address)
Definition: wifi-remote-station-manager.cc:1190
ns3::WifiRemoteStationManager::AddSupportedMcs
void AddSupportedMcs(Mac48Address address, WifiMode mcs)
Record the MCS index supported by the station.
Definition: wifi-remote-station-manager.cc:382
ns3::UintegerValue
Hold an unsigned integer type.
Definition: uinteger.h:44
ns3::WifiRemoteStationState::m_operationalRateSet
WifiModeList m_operationalRateSet
This member is the list of WifiMode objects that comprise the OperationalRateSet parameter for this r...
Definition: wifi-remote-station-manager.h:93
ns3::WifiRemoteStationManager::ReportDataOk
void ReportDataOk(Ptr< const WifiMacQueueItem > mpdu, double ackSnr, WifiMode ackMode, double dataSnr, WifiTxVector dataTxVector)
Should be invoked whenever we receive the ACK associated to a data packet we just sent.
Definition: wifi-remote-station-manager.cc:850
ns3::WifiRemoteStationManager::m_bssBasicMcsSet
WifiModeList m_bssBasicMcsSet
basic MCS set
Definition: wifi-remote-station-manager.h:1303
ns3::WifiRemoteStationManager::m_wifiPhy
Ptr< WifiPhy > m_wifiPhy
This is a pointer to the WifiPhy associated with this WifiRemoteStationManager that is set on call to...
Definition: wifi-remote-station-manager.h:1284
ns3::WifiRemoteStationState::m_address
Mac48Address m_address
Mac48Address of the remote station.
Definition: wifi-remote-station-manager.h:95
ns3::IsAllowedControlAnswerModulationClass
bool IsAllowedControlAnswerModulationClass(WifiModulationClass modClassReq, WifiModulationClass modClassAnswer)
Return whether the modulation class of the selected mode for the control answer frame is allowed.
Definition: wifi-phy-common.cc:112
ns3::WifiRemoteStation::m_rssiAndUpdateTimePair
std::pair< double, Time > m_rssiAndUpdateTimePair
RSSI (in dBm) of the most recent packet received from the remote station along with update time.
Definition: wifi-remote-station-manager.h:65
ns3::WifiRemoteStationManager::ReportFinalRtsFailed
void ReportFinalRtsFailed(const WifiMacHeader &header)
Should be invoked after calling ReportRtsFailed if NeedRetransmission returns false.
Definition: wifi-remote-station-manager.cc:874
ns3::WifiTxVector::SetBssColor
void SetBssColor(uint8_t color)
Set the BSS color.
Definition: wifi-tx-vector.cc:310
ns3::WifiRemoteStationManager::GetBasicMode
WifiMode GetBasicMode(uint8_t i) const
Return a basic mode from the set of basic modes.
Definition: wifi-remote-station-manager.cc:1489
ns3::WifiRemoteStationManager::m_maxSsrc
uint32_t m_maxSsrc
Maximum STA short retry count (SSRC)
Definition: wifi-remote-station-manager.h:1311
ns3::MakeUintegerAccessor
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
ns3::WIFI_MOD_CLASS_VHT
@ WIFI_MOD_CLASS_VHT
VHT (Clause 22)
Definition: wifi-phy-common.h:131
ns3::HtCapabilities::IsSupportedMcs
bool IsSupportedMcs(uint8_t mcs) const
Return the is MCS supported flag.
Definition: ht-capabilities.cc:230
ns3::WifiRemoteStationManager::LookupState
WifiRemoteStationState * LookupState(Mac48Address address) const
Return the state of the station associated with the given address.
Definition: wifi-remote-station-manager.cc:1209
ns3::WifiRemoteStationManager::DoGetRtsTxVector
virtual WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)=0
ns3::WifiRemoteStationManager::GetAssociationId
uint16_t GetAssociationId(Mac48Address remoteAddress) const
Get the AID of a remote station.
Definition: wifi-remote-station-manager.cc:475
ns3::WifiRemoteStationManager::DoNeedFragmentation
virtual bool DoNeedFragmentation(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
Definition: wifi-remote-station-manager.cc:1597
ns3::WifiRemoteStationManager::IsWaitAssocTxOk
bool IsWaitAssocTxOk(Mac48Address address) const
Return whether we are waiting for an ACK for the association response we sent.
Definition: wifi-remote-station-manager.cc:437
ns3::WifiRemoteStationManager::GetRtsTxVector
WifiTxVector GetRtsTxVector(Mac48Address address)
Definition: wifi-remote-station-manager.cc:598
ns3::WifiPhy::GetMcsList
std::list< WifiMode > GetMcsList(void) const
The WifiPhy::GetMcsList() method is used (e.g., by a WifiRemoteStationManager) to determine the set o...
Definition: wifi-phy.cc:2065
ns3::WifiRemoteStationManager::SetupMac
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...
Definition: wifi-remote-station-manager.cc:161
ns3::WifiRemoteStationInfo
TID independent remote station statistics.
Definition: wifi-remote-station-info.h:36
ns3::WifiModeListIterator
WifiModeList::const_iterator WifiModeListIterator
An iterator for WifiModeList vector.
Definition: wifi-mode.h:264
wifi-mac-trailer.h
ns3::WIFI_PREAMBLE_HT_MF
@ WIFI_PREAMBLE_HT_MF
Definition: wifi-phy-common.h:71
ns3::WifiTxVector::SetPreambleType
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
Definition: wifi-tx-vector.cc:248
ns3::WifiRemoteStationManager::DoReportFinalDataFailed
virtual void DoReportFinalDataFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
ns3::WifiRemoteStationManager::ReportFinalDataFailed
void ReportFinalDataFailed(Ptr< const WifiMacQueueItem > mpdu)
Should be invoked after calling ReportDataFailed if NeedRetransmission returns false.
Definition: wifi-remote-station-manager.cc:887
ns3::StaWifiMac::GetAssociationId
uint16_t GetAssociationId(void) const
Return the association ID.
Definition: sta-wifi-mac.cc:116
ns3::WifiRemoteStationState::m_aggregation
bool m_aggregation
Flag if MPDU aggregation is used by the remote station.
Definition: wifi-remote-station-manager.h:108
ns3::WifiRemoteStationManager::GetCtsTxVector
WifiTxVector GetCtsTxVector(Mac48Address to, WifiMode rtsTxMode) const
Return a TXVECTOR for the CTS frame given the destination and the mode of the RTS used by the sender.
Definition: wifi-remote-station-manager.cc:619
ns3::WIFI_MOD_CLASS_DSSS
@ WIFI_MOD_CLASS_DSSS
DSSS (Clause 15)
Definition: wifi-phy-common.h:126
ns3::WifiTxVector::GetMode
WifiMode GetMode(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the selected payload transmission mode.
Definition: wifi-tx-vector.cc:112
ns3::WifiRemoteStationManager::GetHeSupported
bool GetHeSupported(void) const
Return whether the device has HE capability support enabled.
Definition: wifi-remote-station-manager.cc:244
ns3::WifiModeValue
AttributeValue implementation for WifiMode.
Definition: wifi-mode.h:252
third.phy
phy
Definition: third.py:93
ns3::WifiRemoteStationState::DISASSOC
@ DISASSOC
Definition: wifi-remote-station-manager.h:79
ns3::WifiTxVector::SetLdpc
void SetLdpc(bool ldpc)
Sets if LDPC FEC coding is being used.
Definition: wifi-tx-vector.cc:304
ns3::WifiRemoteStationManager::DoGetDataTxVector
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)=0
ns3::WifiMode::GetMcsValue
uint8_t GetMcsValue(void) const
Definition: wifi-mode.cc:155
ns3::WifiRemoteStationManager::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition: wifi-remote-station-manager.cc:135
ns3::WifiRemoteStationManager::GetCtsToSelfTxVector
WifiTxVector GetCtsToSelfTxVector(void)
Since CTS-to-self parameters are not dependent on the station, it is implemented in wifi remote stati...
Definition: wifi-remote-station-manager.cc:565