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  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
235  Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
236  if (htConfiguration)
237  {
238  return true;
239  }
240  return false;
241 }
242 
243 bool
245 {
246  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
247  Ptr<VhtConfiguration> vhtConfiguration = device->GetVhtConfiguration ();
248  if (vhtConfiguration)
249  {
250  return true;
251  }
252  return false;
253 }
254 
255 bool
257 {
258  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
259  Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration ();
260  if (heConfiguration)
261  {
262  return true;
263  }
264  return false;
265 }
266 
267 bool
269 {
270  if (GetHtSupported ())
271  {
272  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
273  Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
274  NS_ASSERT (htConfiguration); //If HT is supported, we should have a HT configuration attached
275  return htConfiguration->GetLdpcSupported ();
276  }
277  return false;
278 }
279 
280 bool
282 {
283  if (GetHtSupported ())
284  {
285  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
286  Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
287  NS_ASSERT (htConfiguration); //If HT is supported, we should have a HT configuration attached
288  if (htConfiguration->GetShortGuardIntervalSupported ())
289  {
290  return true;
291  }
292  }
293  return false;
294 }
295 
296 uint16_t
298 {
299  uint16_t gi = 0;
300  if (GetHeSupported ())
301  {
302  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
303  Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration ();
304  NS_ASSERT (heConfiguration); //If HE is supported, we should have a HE configuration attached
305  gi = static_cast<uint16_t>(heConfiguration->GetGuardInterval ().GetNanoSeconds ());
306  }
307  return gi;
308 }
309 
310 uint32_t
312 {
313  return DoGetFragmentationThreshold ();
314 }
315 
316 void
318 {
319  NS_LOG_FUNCTION (this << address << isShortPreambleSupported);
320  NS_ASSERT (!address.IsGroup ());
322  state->m_shortPreamble = isShortPreambleSupported;
323 }
324 
325 void
327 {
328  NS_LOG_FUNCTION (this << address << isShortSlotTimeSupported);
329  NS_ASSERT (!address.IsGroup ());
331  state->m_shortSlotTime = isShortSlotTimeSupported;
332 }
333 
334 void
336 {
337  NS_LOG_FUNCTION (this << address << mode);
338  NS_ASSERT (!address.IsGroup ());
340  for (WifiModeListIterator i = state->m_operationalRateSet.begin (); i != state->m_operationalRateSet.end (); i++)
341  {
342  if ((*i) == mode)
343  {
344  //already in.
345  return;
346  }
347  }
349  {
350  state->m_dsssSupported = true;
351  }
352  else if (mode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM)
353  {
354  state->m_erpOfdmSupported = true;
355  }
356  else if (mode.GetModulationClass () == WIFI_MOD_CLASS_OFDM)
357  {
358  state->m_ofdmSupported = true;
359  }
360  state->m_operationalRateSet.push_back (mode);
361 }
362 
363 void
365 {
366  NS_LOG_FUNCTION (this << address);
367  NS_ASSERT (!address.IsGroup ());
369  state->m_operationalRateSet.clear ();
370  for (const auto & mode : m_wifiPhy->GetModeList ())
371  {
372  state->m_operationalRateSet.push_back (mode);
373  if (mode.IsMandatory ())
374  {
375  AddBasicMode (mode);
376  }
377  }
378 }
379 
380 void
382 {
383  NS_LOG_FUNCTION (this << address);
384  NS_ASSERT (!address.IsGroup ());
386  state->m_operationalMcsSet.clear ();
387  for (const auto & mcs : m_wifiPhy->GetMcsList ())
388  {
389  state->m_operationalMcsSet.push_back (mcs);
390  }
391 }
392 
393 void
395 {
396  NS_LOG_FUNCTION (this << address);
397  NS_ASSERT (!address.IsGroup ());
399  state->m_operationalMcsSet.clear ();
400 }
401 
402 void
404 {
405  NS_LOG_FUNCTION (this << address << mcs);
406  NS_ASSERT (!address.IsGroup ());
408  for (WifiModeListIterator i = state->m_operationalMcsSet.begin (); i != state->m_operationalMcsSet.end (); i++)
409  {
410  if ((*i) == mcs)
411  {
412  //already in.
413  return;
414  }
415  }
416  state->m_operationalMcsSet.push_back (mcs);
417 }
418 
419 bool
421 {
423 }
424 
425 bool
427 {
429 }
430 
431 bool
433 {
435 }
436 
437 bool
439 {
440  if (address.IsGroup ())
441  {
442  return false;
443  }
445 }
446 
447 bool
449 {
450  if (address.IsGroup ())
451  {
452  return true;
453  }
455 }
456 
457 bool
459 {
460  if (address.IsGroup ())
461  {
462  return false;
463  }
465 }
466 
467 void
469 {
470  NS_ASSERT (!address.IsGroup ());
472 }
473 
474 void
476 {
477  NS_ASSERT (!address.IsGroup ());
479 }
480 
481 void
483 {
484  NS_ASSERT (!address.IsGroup ());
486 }
487 
488 void
490 {
491  NS_ASSERT (!address.IsGroup ());
493 }
494 
495 uint16_t
497 {
498  WifiRemoteStationState* state;
499  if (!remoteAddress.IsGroup ()
500  && (state = LookupState (remoteAddress))->m_state == WifiRemoteStationState::GOT_ASSOC_TX_OK)
501  {
502  return state->m_aid;
503  }
504  return SU_STA_ID;
505 }
506 
507 uint16_t
509 {
510  NS_LOG_FUNCTION (this << address << txVector);
511 
512  uint16_t staId = SU_STA_ID;
513 
514  if (txVector.IsMu ())
515  {
516  if (m_wifiMac->GetTypeOfStation () == AP)
517  {
518  staId = GetAssociationId (address);
519  }
520  else if (m_wifiMac->GetTypeOfStation () == STA)
521  {
522  Ptr<StaWifiMac> staMac = StaticCast<StaWifiMac> (m_wifiMac);
523  if (staMac->IsAssociated ())
524  {
525  staId = staMac->GetAssociationId ();
526  }
527  }
528  }
529 
530  NS_LOG_DEBUG ("Returning STAID = " << staId);
531  return staId;
532 }
533 
536 {
537  NS_LOG_FUNCTION (this << header);
538  Mac48Address address = header.GetAddr1 ();
539  if (!header.IsMgt () && address.IsGroup ())
540  {
541  WifiMode mode = GetNonUnicastMode ();
542  WifiTxVector v;
543  v.SetMode (mode);
547  v.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ())));
549  v.SetNss (1);
550  v.SetNess (0);
551  return v;
552  }
553  WifiTxVector txVector;
554  if (header.IsMgt ())
555  {
556  //Use the lowest basic rate for management frames
557  WifiMode mgtMode;
558  if (GetNBasicModes () > 0)
559  {
560  mgtMode = GetBasicMode (0);
561  }
562  else
563  {
564  mgtMode = GetDefaultMode ();
565  }
566  txVector.SetMode (mgtMode);
570  txVector.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mgtMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ())));
571  }
572  else
573  {
574  txVector = DoGetDataTxVector (Lookup (address));
576  }
577  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
578  Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration ();
579  if (heConfiguration)
580  {
581  txVector.SetBssColor (heConfiguration->GetBssColor ());
582  }
583  return txVector;
584 }
585 
588 {
589  WifiMode defaultMode = GetDefaultMode ();
590  WifiPreamble defaultPreamble;
591  if (defaultMode.GetModulationClass () == WIFI_MOD_CLASS_HE)
592  {
593  defaultPreamble = WIFI_PREAMBLE_HE_SU;
594  }
595  else if (defaultMode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
596  {
597  defaultPreamble = WIFI_PREAMBLE_VHT_SU;
598  }
599  else if (defaultMode.GetModulationClass () == WIFI_MOD_CLASS_HT)
600  {
601  defaultPreamble = WIFI_PREAMBLE_HT_MF;
602  }
603  else
604  {
605  defaultPreamble = WIFI_PREAMBLE_LONG;
606  }
607 
608  return WifiTxVector (defaultMode,
610  defaultPreamble,
611  ConvertGuardIntervalToNanoSeconds (defaultMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ())),
613  1,
614  0,
616  false);
617 }
618 
621 {
622  NS_LOG_FUNCTION (this << address);
623  if (address.IsGroup ())
624  {
625  WifiMode mode = GetNonUnicastMode ();
626  WifiTxVector v;
627  v.SetMode (mode);
631  v.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ())));
633  v.SetNss (1);
634  v.SetNess (0);
635  return v;
636  }
637  return DoGetRtsTxVector (Lookup (address));
638 }
639 
642 {
643  NS_ASSERT (!to.IsGroup ());
644  WifiMode ctsMode = GetControlAnswerMode (rtsTxMode);
645  WifiTxVector v;
646  v.SetMode (ctsMode);
650  uint16_t ctsTxGuardInterval = ConvertGuardIntervalToNanoSeconds (ctsMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ()));
651  v.SetGuardInterval (ctsTxGuardInterval);
652  v.SetNss (1);
653  return v;
654 }
655 
658 {
659  NS_ASSERT (!to.IsGroup ());
660  WifiMode ackMode = GetControlAnswerMode (dataTxVector.GetMode (GetStaId (to, dataTxVector)));
661  WifiTxVector v;
662  v.SetMode (ackMode);
666  uint16_t ackTxGuardInterval = ConvertGuardIntervalToNanoSeconds (ackMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ()));
667  v.SetGuardInterval (ackTxGuardInterval);
668  v.SetNss (1);
669  return v;
670 }
671 
674 {
675  NS_ASSERT (!to.IsGroup ());
676  WifiMode blockAckMode = GetControlAnswerMode (dataTxVector.GetMode (GetStaId (to, dataTxVector)));
677  WifiTxVector v;
678  v.SetMode (blockAckMode);
682  uint16_t blockAckTxGuardInterval = ConvertGuardIntervalToNanoSeconds (blockAckMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ()));
683  v.SetGuardInterval (blockAckTxGuardInterval);
684  v.SetNss (1);
685  return v;
686 }
687 
688 WifiMode
690 {
705  NS_LOG_FUNCTION (this << reqMode);
706  WifiMode mode = GetDefaultMode ();
707  bool found = false;
708  //First, search the BSS Basic Rate set
709  for (uint8_t i = 0; i < GetNBasicModes (); i++)
710  {
711  WifiMode testMode = GetBasicMode (i);
712  if ((!found || testMode.IsHigherDataRate (mode))
713  && (!testMode.IsHigherDataRate (reqMode))
715  {
716  mode = testMode;
717  //We've found a potentially-suitable transmit rate, but we
718  //need to continue and consider all the basic rates before
719  //we can be sure we've got the right one.
720  found = true;
721  }
722  }
723  if (GetHtSupported ())
724  {
725  if (!found)
726  {
727  mode = GetDefaultMcs ();
728  for (uint8_t i = 0; i != GetNBasicMcs (); i++)
729  {
730  WifiMode testMode = GetBasicMcs (i);
731  if ((!found || testMode.IsHigherDataRate (mode))
732  && (!testMode.IsHigherDataRate (reqMode))
733  && (testMode.GetModulationClass () == reqMode.GetModulationClass ()))
734  {
735  mode = testMode;
736  //We've found a potentially-suitable transmit rate, but we
737  //need to continue and consider all the basic rates before
738  //we can be sure we've got the right one.
739  found = true;
740  }
741  }
742  }
743  }
744  //If we found a suitable rate in the BSSBasicRateSet, then we are
745  //done and can return that mode.
746  if (found)
747  {
748  NS_LOG_DEBUG ("WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
749  return mode;
750  }
751 
769  for (const auto & thismode : m_wifiPhy->GetModeList ())
770  {
771  /* If the rate:
772  *
773  * - is a mandatory rate for the PHY, and
774  * - is equal to or faster than our current best choice, and
775  * - is less than or equal to the rate of the received frame, and
776  * - is of the same modulation class as the received frame
777  *
778  * ...then it's our best choice so far.
779  */
780  if (thismode.IsMandatory ()
781  && (!found || thismode.IsHigherDataRate (mode))
782  && (!thismode.IsHigherDataRate (reqMode))
783  && (IsAllowedControlAnswerModulationClass (reqMode.GetModulationClass (), thismode.GetModulationClass ())))
784  {
785  mode = thismode;
786  //As above; we've found a potentially-suitable transmit
787  //rate, but we need to continue and consider all the
788  //mandatory rates before we can be sure we've got the right one.
789  found = true;
790  }
791  }
792  if (GetHtSupported () )
793  {
794  for (const auto & thismode : m_wifiPhy->GetMcsList ())
795  {
796  if (thismode.IsMandatory ()
797  && (!found || thismode.IsHigherDataRate (mode))
798  && (!thismode.IsHigherCodeRate (reqMode))
799  && (thismode.GetModulationClass () == reqMode.GetModulationClass ()))
800  {
801  mode = thismode;
802  //As above; we've found a potentially-suitable transmit
803  //rate, but we need to continue and consider all the
804  //mandatory rates before we can be sure we've got the right one.
805  found = true;
806  }
807  }
808  }
809 
819  if (!found)
820  {
821  NS_FATAL_ERROR ("Can't find response rate for " << reqMode);
822  }
823 
824  NS_LOG_DEBUG ("WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
825  return mode;
826 }
827 
828 void
830 {
831  NS_LOG_FUNCTION (this << header);
832  NS_ASSERT (!header.GetAddr1 ().IsGroup ());
833  AcIndex ac = QosUtilsMapTidToAc ((header.IsQosData ()) ? header.GetQosTid () : 0);
834  m_ssrc[ac]++;
835  m_macTxRtsFailed (header.GetAddr1 ());
836  DoReportRtsFailed (Lookup (header.GetAddr1 ()));
837 }
838 
839 void
841 {
842  NS_LOG_FUNCTION (this << *mpdu);
843  NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
844  AcIndex ac = QosUtilsMapTidToAc ((mpdu->GetHeader ().IsQosData ()) ? mpdu->GetHeader ().GetQosTid () : 0);
845  bool longMpdu = (mpdu->GetSize () > m_rtsCtsThreshold);
846  if (longMpdu)
847  {
848  m_slrc[ac]++;
849  }
850  else
851  {
852  m_ssrc[ac]++;
853  }
854  m_macTxDataFailed (mpdu->GetHeader ().GetAddr1 ());
855  DoReportDataFailed (Lookup (mpdu->GetHeader ().GetAddr1 ()));
856 }
857 
858 void
860  double ctsSnr, WifiMode ctsMode, double rtsSnr)
861 {
862  NS_LOG_FUNCTION (this << header << ctsSnr << ctsMode << rtsSnr);
863  NS_ASSERT (!header.GetAddr1 ().IsGroup ());
864  WifiRemoteStation *station = Lookup (header.GetAddr1 ());
865  AcIndex ac = QosUtilsMapTidToAc ((header.IsQosData ()) ? header.GetQosTid () : 0);
866  station->m_state->m_info.NotifyTxSuccess (m_ssrc[ac]);
867  m_ssrc[ac] = 0;
868  DoReportRtsOk (station, ctsSnr, ctsMode, rtsSnr);
869 }
870 
871 void
873  WifiMode ackMode, double dataSnr, WifiTxVector dataTxVector)
874 {
875  NS_LOG_FUNCTION (this << *mpdu << ackSnr << ackMode << dataSnr << dataTxVector);
876  const WifiMacHeader& hdr = mpdu->GetHeader ();
877  NS_ASSERT (!hdr.GetAddr1 ().IsGroup ());
878  WifiRemoteStation *station = Lookup (hdr.GetAddr1 ());
879  AcIndex ac = QosUtilsMapTidToAc ((hdr.IsQosData ()) ? hdr.GetQosTid () : 0);
880  bool longMpdu = (mpdu->GetSize () > m_rtsCtsThreshold);
881  if (longMpdu)
882  {
883  station->m_state->m_info.NotifyTxSuccess (m_slrc[ac]);
884  m_slrc[ac] = 0;
885  }
886  else
887  {
888  station->m_state->m_info.NotifyTxSuccess (m_ssrc[ac]);
889  m_ssrc[ac] = 0;
890  }
891  DoReportDataOk (station, ackSnr, ackMode, dataSnr, dataTxVector.GetChannelWidth (),
892  dataTxVector.GetNss (GetStaId (hdr.GetAddr1 (), dataTxVector)));
893 }
894 
895 void
897 {
898  NS_LOG_FUNCTION (this << header);
899  NS_ASSERT (!header.GetAddr1 ().IsGroup ());
900  WifiRemoteStation *station = Lookup (header.GetAddr1 ());
901  AcIndex ac = QosUtilsMapTidToAc ((header.IsQosData ()) ? header.GetQosTid () : 0);
902  station->m_state->m_info.NotifyTxFailed ();
903  m_ssrc[ac] = 0;
904  m_macTxFinalRtsFailed (header.GetAddr1 ());
905  DoReportFinalRtsFailed (station);
906 }
907 
908 void
910 {
911  NS_LOG_FUNCTION (this << *mpdu);
912  NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
913  WifiRemoteStation *station = Lookup (mpdu->GetHeader ().GetAddr1 ());
914  AcIndex ac = QosUtilsMapTidToAc ((mpdu->GetHeader ().IsQosData ()) ? mpdu->GetHeader ().GetQosTid () : 0);
915  station->m_state->m_info.NotifyTxFailed ();
916  bool longMpdu = (mpdu->GetSize () > m_rtsCtsThreshold);
917  if (longMpdu)
918  {
919  m_slrc[ac] = 0;
920  }
921  else
922  {
923  m_ssrc[ac] = 0;
924  }
925  m_macTxFinalDataFailed (mpdu->GetHeader ().GetAddr1 ());
926  DoReportFinalDataFailed (station);
927 }
928 
929 void
931 {
932  NS_LOG_FUNCTION (this << address << rxSignalInfo << txVector);
933  if (address.IsGroup ())
934  {
935  return;
936  }
937  WifiRemoteStation *station = Lookup (address);
938  DoReportRxOk (station, rxSignalInfo.snr, txVector.GetMode (GetStaId (address, txVector)));
939  station->m_rssiAndUpdateTimePair = std::make_pair (rxSignalInfo.rssi, Simulator::Now ());
940 }
941 
942 void
944  uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus,
945  double rxSnr, double dataSnr, WifiTxVector dataTxVector)
946 {
947  NS_LOG_FUNCTION (this << address << nSuccessfulMpdus << nFailedMpdus << rxSnr << dataSnr << dataTxVector);
948  NS_ASSERT (!address.IsGroup ());
949  for (uint8_t i = 0; i < nFailedMpdus; i++)
950  {
952  }
953  DoReportAmpduTxStatus (Lookup (address), nSuccessfulMpdus, nFailedMpdus, rxSnr, dataSnr, dataTxVector.GetChannelWidth (), dataTxVector.GetNss (GetStaId (address, dataTxVector)));
954 }
955 
956 bool
957 WifiRemoteStationManager::NeedRts (const WifiMacHeader &header, uint32_t size)
958 {
959  NS_LOG_FUNCTION (this << header << size);
960  Mac48Address address = header.GetAddr1 ();
961  WifiTxVector txVector = GetDataTxVector (header);
962  WifiMode mode = txVector.GetMode ();
963  if (address.IsGroup ())
964  {
965  return false;
966  }
969  || (mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
970  || (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
971  || (mode.GetModulationClass () == WIFI_MOD_CLASS_HE))
973  {
974  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedRTS returning true to protect non-ERP stations");
975  return true;
976  }
977  else if (m_htProtectionMode == RTS_CTS
978  && ((mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
979  || (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT))
982  {
983  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedRTS returning true to protect non-HT stations");
984  return true;
985  }
986  bool normally = (size > m_rtsCtsThreshold);
987  return DoNeedRts (Lookup (address), size, normally);
988 }
989 
990 bool
992 {
993  WifiMode mode = txVector.GetMode ();
994  NS_LOG_FUNCTION (this << mode);
997  || (mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
998  || (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
999  || (mode.GetModulationClass () == WIFI_MOD_CLASS_HE))
1001  {
1002  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning true to protect non-ERP stations");
1003  return true;
1004  }
1005  else if (m_htProtectionMode == CTS_TO_SELF
1006  && ((mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
1007  || (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT))
1010  {
1011  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning true to protect non-HT stations");
1012  return true;
1013  }
1014  else if (!m_useNonErpProtection)
1015  {
1016  //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
1017  for (WifiModeListIterator i = m_bssBasicRateSet.begin (); i != m_bssBasicRateSet.end (); i++)
1018  {
1019  if (mode == *i)
1020  {
1021  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning false");
1022  return false;
1023  }
1024  }
1025  if (GetHtSupported ())
1026  {
1027  //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
1028  for (WifiModeListIterator i = m_bssBasicMcsSet.begin (); i != m_bssBasicMcsSet.end (); i++)
1029  {
1030  if (mode == *i)
1031  {
1032  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning false");
1033  return false;
1034  }
1035  }
1036  }
1037  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning true");
1038  return true;
1039  }
1040  return false;
1041 }
1042 
1043 void
1045 {
1046  NS_LOG_FUNCTION (this << enable);
1047  m_useNonErpProtection = enable;
1048 }
1049 
1050 bool
1052 {
1053  return m_useNonErpProtection;
1054 }
1055 
1056 void
1058 {
1059  NS_LOG_FUNCTION (this << enable);
1060  m_useNonHtProtection = enable;
1061 }
1062 
1063 bool
1065 {
1066  return m_useNonHtProtection;
1067 }
1068 
1069 bool
1071 {
1072  NS_LOG_FUNCTION (this << *mpdu);
1073  NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
1074  AcIndex ac = QosUtilsMapTidToAc ((mpdu->GetHeader ().IsQosData ()) ? mpdu->GetHeader ().GetQosTid () : 0);
1075  bool longMpdu = (mpdu->GetSize () > m_rtsCtsThreshold);
1076  uint32_t retryCount, maxRetryCount;
1077  if (longMpdu)
1078  {
1079  retryCount = m_slrc[ac];
1080  maxRetryCount = m_maxSlrc;
1081  }
1082  else
1083  {
1084  retryCount = m_ssrc[ac];
1085  maxRetryCount = m_maxSsrc;
1086  }
1087  bool normally = retryCount < maxRetryCount;
1088  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedRetransmission count: " << retryCount << " result: " << std::boolalpha << normally);
1089  return DoNeedRetransmission (Lookup (mpdu->GetHeader ().GetAddr1 ()), mpdu->GetPacket (), normally);
1090 }
1091 
1092 bool
1094 {
1095  NS_LOG_FUNCTION (this << *mpdu);
1096  if (mpdu->GetHeader ().GetAddr1 ().IsGroup ())
1097  {
1098  return false;
1099  }
1100  bool normally = mpdu->GetSize () > GetFragmentationThreshold ();
1101  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedFragmentation result: " << std::boolalpha << normally);
1102  return DoNeedFragmentation (Lookup (mpdu->GetHeader ().GetAddr1 ()), mpdu->GetPacket (), normally);
1103 }
1104 
1105 void
1107 {
1108  NS_LOG_FUNCTION (this << threshold);
1109  if (threshold < 256)
1110  {
1111  /*
1112  * ASN.1 encoding of the MAC and PHY MIB (256 ... 8000)
1113  */
1114  NS_LOG_WARN ("Fragmentation threshold should be larger than 256. Setting to 256.");
1116  }
1117  else
1118  {
1119  /*
1120  * The length of each fragment shall be an even number of octets, except for the last fragment if an MSDU or
1121  * MMPDU, which may be either an even or an odd number of octets.
1122  */
1123  if (threshold % 2 != 0)
1124  {
1125  NS_LOG_WARN ("Fragmentation threshold should be an even number. Setting to " << threshold - 1);
1126  m_fragmentationThreshold = threshold - 1;
1127  }
1128  else
1129  {
1130  m_fragmentationThreshold = threshold;
1131  }
1132  }
1133 }
1134 
1135 uint32_t
1137 {
1138  return m_fragmentationThreshold;
1139 }
1140 
1141 uint32_t
1143 {
1144  NS_LOG_FUNCTION (this << *mpdu);
1145  //The number of bytes a fragment can support is (Threshold - WIFI_HEADER_SIZE - WIFI_FCS).
1146  uint32_t nFragments = (mpdu->GetPacket ()->GetSize () / (GetFragmentationThreshold () - mpdu->GetHeader ().GetSize () - WIFI_MAC_FCS_LENGTH));
1147 
1148  //If the size of the last fragment is not 0.
1149  if ((mpdu->GetPacket ()->GetSize () % (GetFragmentationThreshold () - mpdu->GetHeader ().GetSize () - WIFI_MAC_FCS_LENGTH)) > 0)
1150  {
1151  nFragments++;
1152  }
1153  NS_LOG_DEBUG ("WifiRemoteStationManager::GetNFragments returning " << nFragments);
1154  return nFragments;
1155 }
1156 
1157 uint32_t
1159 {
1160  NS_LOG_FUNCTION (this << *mpdu << fragmentNumber);
1161  NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
1162  uint32_t nFragment = GetNFragments (mpdu);
1163  if (fragmentNumber >= nFragment)
1164  {
1165  NS_LOG_DEBUG ("WifiRemoteStationManager::GetFragmentSize returning 0");
1166  return 0;
1167  }
1168  //Last fragment
1169  if (fragmentNumber == nFragment - 1)
1170  {
1171  uint32_t lastFragmentSize = mpdu->GetPacket ()->GetSize () - (fragmentNumber * (GetFragmentationThreshold () - mpdu->GetHeader ().GetSize () - WIFI_MAC_FCS_LENGTH));
1172  NS_LOG_DEBUG ("WifiRemoteStationManager::GetFragmentSize returning " << lastFragmentSize);
1173  return lastFragmentSize;
1174  }
1175  //All fragments but the last, the number of bytes is (Threshold - WIFI_HEADER_SIZE - WIFI_FCS).
1176  else
1177  {
1178  uint32_t fragmentSize = GetFragmentationThreshold () - mpdu->GetHeader ().GetSize () - WIFI_MAC_FCS_LENGTH;
1179  NS_LOG_DEBUG ("WifiRemoteStationManager::GetFragmentSize returning " << fragmentSize);
1180  return fragmentSize;
1181  }
1182 }
1183 
1184 uint32_t
1186 {
1187  NS_LOG_FUNCTION (this << *mpdu << fragmentNumber);
1188  NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
1189  NS_ASSERT (fragmentNumber < GetNFragments (mpdu));
1190  uint32_t fragmentOffset = fragmentNumber * (GetFragmentationThreshold () - mpdu->GetHeader ().GetSize () - WIFI_MAC_FCS_LENGTH);
1191  NS_LOG_DEBUG ("WifiRemoteStationManager::GetFragmentOffset returning " << fragmentOffset);
1192  return fragmentOffset;
1193 }
1194 
1195 bool
1197 {
1198  NS_LOG_FUNCTION (this << *mpdu << fragmentNumber);
1199  NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
1200  bool isLast = fragmentNumber == (GetNFragments (mpdu) - 1);
1201  NS_LOG_DEBUG ("WifiRemoteStationManager::IsLastFragment returning " << std::boolalpha << isLast);
1202  return isLast;
1203 }
1204 
1205 uint8_t
1207 {
1208  return m_defaultTxPowerLevel;
1209 }
1210 
1213 {
1215  return state->m_info;
1216 }
1217 
1218 double
1220 {
1221  auto stationIt = m_stations.find (address);
1222  NS_ASSERT_MSG (stationIt != m_stations.end(), "Address: " << address << " not found");
1223  auto station = stationIt->second;
1224  auto rssi = station->m_rssiAndUpdateTimePair.first;
1225  auto ts = station->m_rssiAndUpdateTimePair.second;
1226  NS_ASSERT_MSG (ts.IsStrictlyPositive(), "address: " << address << " ts:" << ts);
1227  return rssi;
1228 }
1229 
1232 {
1233  NS_LOG_FUNCTION (this << address);
1234  auto stateIt = m_states.find (address);
1235 
1236  if (stateIt != m_states.end ())
1237  {
1238  NS_LOG_DEBUG ("WifiRemoteStationManager::LookupState returning existing state");
1239  return stateIt->second;
1240  }
1241 
1244  state->m_address = address;
1245  state->m_aid = 0;
1246  state->m_operationalRateSet.push_back (GetDefaultMode ());
1247  state->m_operationalMcsSet.push_back (GetDefaultMcs ());
1248  state->m_dsssSupported = false;
1249  state->m_erpOfdmSupported = false;
1250  state->m_ofdmSupported = false;
1251  state->m_htCapabilities = 0;
1252  state->m_vhtCapabilities = 0;
1253  state->m_heCapabilities = 0;
1255  state->m_guardInterval = GetGuardInterval ();
1256  state->m_ness = 0;
1257  state->m_aggregation = false;
1258  state->m_qosSupported = false;
1259  const_cast<WifiRemoteStationManager *> (this)->m_states.insert ({address, state});
1260  NS_LOG_DEBUG ("WifiRemoteStationManager::LookupState returning new state");
1261  return state;
1262 }
1263 
1264 WifiRemoteStation *
1265 WifiRemoteStationManager::Lookup (Mac48Address address) const
1266 {
1267  NS_LOG_FUNCTION (this << address);
1268  auto stationIt = m_stations.find (address);
1269 
1270  if (stationIt != m_stations.end ())
1271  {
1272  return stationIt->second;
1273  }
1274 
1275  WifiRemoteStationState *state = LookupState (address);
1276 
1277  WifiRemoteStation *station = DoCreateStation ();
1278  station->m_state = state;
1279  station->m_rssiAndUpdateTimePair = std::make_pair (0, Seconds (0));
1280  const_cast<WifiRemoteStationManager *> (this)->m_stations.insert ({address, station});
1281  return station;
1282 }
1283 
1284 void
1285 WifiRemoteStationManager::SetAssociationId (Mac48Address remoteAddress, uint16_t aid)
1286 {
1287  NS_LOG_FUNCTION (this << remoteAddress << aid);
1288  LookupState (remoteAddress)->m_aid = aid;
1289 }
1290 
1291 void
1292 WifiRemoteStationManager::SetQosSupport (Mac48Address from, bool qosSupported)
1293 {
1294  NS_LOG_FUNCTION (this << from << qosSupported);
1295  WifiRemoteStationState *state;
1296  state = LookupState (from);
1297  state->m_qosSupported = qosSupported;
1298 }
1299 
1300 void
1301 WifiRemoteStationManager::AddStationHtCapabilities (Mac48Address from, HtCapabilities htCapabilities)
1302 {
1303  //Used by all stations to record HT capabilities of remote stations
1304  NS_LOG_FUNCTION (this << from << htCapabilities);
1305  WifiRemoteStationState *state;
1306  state = LookupState (from);
1307  if (htCapabilities.GetSupportedChannelWidth () == 1)
1308  {
1309  state->m_channelWidth = 40;
1310  }
1311  else
1312  {
1313  state->m_channelWidth = 20;
1314  }
1315  SetQosSupport (from, true);
1316  for (const auto & mcs : m_wifiPhy->GetMcsList (WIFI_MOD_CLASS_HT))
1317  {
1318  if (htCapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
1319  {
1320  AddSupportedMcs (from, mcs);
1321  }
1322  }
1323  state->m_htCapabilities = Create<const HtCapabilities> (htCapabilities);
1324 }
1325 
1326 void
1327 WifiRemoteStationManager::AddStationVhtCapabilities (Mac48Address from, VhtCapabilities vhtCapabilities)
1328 {
1329  //Used by all stations to record VHT capabilities of remote stations
1330  NS_LOG_FUNCTION (this << from << vhtCapabilities);
1331  WifiRemoteStationState *state;
1332  state = LookupState (from);
1333  if (vhtCapabilities.GetSupportedChannelWidthSet () == 1)
1334  {
1335  state->m_channelWidth = 160;
1336  }
1337  else
1338  {
1339  state->m_channelWidth = 80;
1340  }
1341  //This is a workaround to enable users to force a 20 or 40 MHz channel for a VHT-compliant device,
1342  //since IEEE 802.11ac standard says that 20, 40 and 80 MHz channels are mandatory.
1343  if (m_wifiPhy->GetChannelWidth () < state->m_channelWidth)
1344  {
1345  state->m_channelWidth = m_wifiPhy->GetChannelWidth ();
1346  }
1347  for (uint8_t i = 1; i <= m_wifiPhy->GetMaxSupportedTxSpatialStreams (); i++)
1348  {
1349  for (const auto & mcs : m_wifiPhy->GetMcsList (WIFI_MOD_CLASS_VHT))
1350  {
1351  if (vhtCapabilities.IsSupportedMcs (mcs.GetMcsValue (), i))
1352  {
1353  AddSupportedMcs (from, mcs);
1354  }
1355  }
1356  }
1357  state->m_vhtCapabilities = Create<const VhtCapabilities> (vhtCapabilities);
1358 }
1359 
1360 void
1361 WifiRemoteStationManager::AddStationHeCapabilities (Mac48Address from, HeCapabilities heCapabilities)
1362 {
1363  //Used by all stations to record HE capabilities of remote stations
1364  NS_LOG_FUNCTION (this << from << heCapabilities);
1365  WifiRemoteStationState *state;
1366  state = LookupState (from);
1367  if ((m_wifiPhy->GetPhyBand () == WIFI_PHY_BAND_5GHZ) || (m_wifiPhy->GetPhyBand () == WIFI_PHY_BAND_6GHZ))
1368  {
1369  if (heCapabilities.GetChannelWidthSet () & 0x04)
1370  {
1371  state->m_channelWidth = 160;
1372  }
1373  else if (heCapabilities.GetChannelWidthSet () & 0x02)
1374  {
1375  state->m_channelWidth = 80;
1376  }
1377  //For other cases at 5 GHz, the supported channel width is set by the VHT capabilities
1378  }
1379  else if (m_wifiPhy->GetPhyBand () == WIFI_PHY_BAND_2_4GHZ)
1380  {
1381  if (heCapabilities.GetChannelWidthSet () & 0x01)
1382  {
1383  state->m_channelWidth = 40;
1384  }
1385  else
1386  {
1387  state->m_channelWidth = 20;
1388  }
1389  }
1390  if (heCapabilities.GetHeLtfAndGiForHePpdus () >= 2)
1391  {
1392  state->m_guardInterval = 800;
1393  }
1394  else if (heCapabilities.GetHeLtfAndGiForHePpdus () == 1)
1395  {
1396  state->m_guardInterval = 1600;
1397  }
1398  else
1399  {
1400  state->m_guardInterval = 3200;
1401  }
1402  for (uint8_t i = 1; i <= m_wifiPhy->GetMaxSupportedTxSpatialStreams (); i++)
1403  {
1404  for (const auto & mcs : m_wifiPhy->GetMcsList (WIFI_MOD_CLASS_HE))
1405  {
1406  if (heCapabilities.GetHighestNssSupported () >= i
1407  && heCapabilities.GetHighestMcsSupported () >= mcs.GetMcsValue ())
1408  {
1409  AddSupportedMcs (from, mcs);
1410  }
1411  }
1412  }
1413  state->m_heCapabilities = Create<const HeCapabilities> (heCapabilities);
1414  SetQosSupport (from, true);
1415 }
1416 
1418 WifiRemoteStationManager::GetStationHtCapabilities (Mac48Address from)
1419 {
1420  return LookupState (from)->m_htCapabilities;
1421 }
1422 
1424 WifiRemoteStationManager::GetStationVhtCapabilities (Mac48Address from)
1425 {
1426  return LookupState (from)->m_vhtCapabilities;
1427 }
1428 
1430 WifiRemoteStationManager::GetStationHeCapabilities (Mac48Address from)
1431 {
1432  return LookupState (from)->m_heCapabilities;
1433 }
1434 
1435 bool
1436 WifiRemoteStationManager::GetLdpcSupported (Mac48Address address) const
1437 {
1438  Ptr<const HtCapabilities> htCapabilities = LookupState (address)->m_htCapabilities;
1439  Ptr<const VhtCapabilities> vhtCapabilities = LookupState (address)->m_vhtCapabilities;
1440  Ptr<const HeCapabilities> heCapabilities = LookupState (address)->m_heCapabilities;
1441  bool supported = false;
1442  if (htCapabilities)
1443  {
1444  supported |= htCapabilities->GetLdpc ();
1445  }
1446  if (vhtCapabilities)
1447  {
1448  supported |= vhtCapabilities->GetRxLdpc ();
1449  }
1450  if (heCapabilities)
1451  {
1452  supported |= heCapabilities->GetLdpcCodingInPayload ();
1453  }
1454  return supported;
1455 }
1456 
1457 WifiMode
1458 WifiRemoteStationManager::GetDefaultMode (void) const
1459 {
1460  return m_defaultTxMode;
1461 }
1462 
1463 WifiMode
1464 WifiRemoteStationManager::GetDefaultMcs (void) const
1465 {
1466  return m_defaultTxMcs;
1467 }
1468 
1469 void
1471 {
1472  NS_LOG_FUNCTION (this);
1473  for (auto& state : m_states)
1474  {
1475  delete (state.second);
1476  }
1477  m_states.clear ();
1478  for (auto& state: m_stations)
1479  {
1480  delete (state.second);
1481  }
1482  m_stations.clear ();
1483  m_bssBasicRateSet.clear ();
1484  m_bssBasicMcsSet.clear ();
1485  m_ssrc.fill (0);
1486  m_slrc.fill (0);
1487 }
1488 
1489 void
1490 WifiRemoteStationManager::AddBasicMode (WifiMode mode)
1491 {
1492  NS_LOG_FUNCTION (this << mode);
1493  if (mode.GetModulationClass () >= WIFI_MOD_CLASS_HT)
1494  {
1495  NS_FATAL_ERROR ("It is not allowed to add a HT rate in the BSSBasicRateSet!");
1496  }
1497  for (uint8_t i = 0; i < GetNBasicModes (); i++)
1498  {
1499  if (GetBasicMode (i) == mode)
1500  {
1501  return;
1502  }
1503  }
1504  m_bssBasicRateSet.push_back (mode);
1505 }
1506 
1507 uint8_t
1508 WifiRemoteStationManager::GetNBasicModes (void) const
1509 {
1510  return static_cast<uint8_t> (m_bssBasicRateSet.size ());
1511 }
1512 
1513 WifiMode
1514 WifiRemoteStationManager::GetBasicMode (uint8_t i) const
1515 {
1516  NS_ASSERT (i < GetNBasicModes ());
1517  return m_bssBasicRateSet[i];
1518 }
1519 
1520 uint32_t
1521 WifiRemoteStationManager::GetNNonErpBasicModes (void) const
1522 {
1523  uint32_t size = 0;
1524  for (WifiModeListIterator i = m_bssBasicRateSet.begin (); i != m_bssBasicRateSet.end (); i++)
1525  {
1526  if (i->GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM)
1527  {
1528  continue;
1529  }
1530  size++;
1531  }
1532  return size;
1533 }
1534 
1535 WifiMode
1536 WifiRemoteStationManager::GetNonErpBasicMode (uint8_t i) const
1537 {
1538  NS_ASSERT (i < GetNNonErpBasicModes ());
1539  uint32_t index = 0;
1540  bool found = false;
1541  for (WifiModeListIterator j = m_bssBasicRateSet.begin (); j != m_bssBasicRateSet.end (); )
1542  {
1543  if (i == index)
1544  {
1545  found = true;
1546  }
1547  if (j->GetModulationClass () != WIFI_MOD_CLASS_ERP_OFDM)
1548  {
1549  if (found)
1550  {
1551  break;
1552  }
1553  }
1554  index++;
1555  j++;
1556  }
1557  return m_bssBasicRateSet[index];
1558 }
1559 
1560 void
1561 WifiRemoteStationManager::AddBasicMcs (WifiMode mcs)
1562 {
1563  NS_LOG_FUNCTION (this << +mcs.GetMcsValue ());
1564  for (uint8_t i = 0; i < GetNBasicMcs (); i++)
1565  {
1566  if (GetBasicMcs (i) == mcs)
1567  {
1568  return;
1569  }
1570  }
1571  m_bssBasicMcsSet.push_back (mcs);
1572 }
1573 
1574 uint8_t
1575 WifiRemoteStationManager::GetNBasicMcs (void) const
1576 {
1577  return static_cast<uint8_t> (m_bssBasicMcsSet.size ());
1578 }
1579 
1580 WifiMode
1581 WifiRemoteStationManager::GetBasicMcs (uint8_t i) const
1582 {
1583  NS_ASSERT (i < GetNBasicMcs ());
1584  return m_bssBasicMcsSet[i];
1585 }
1586 
1587 WifiMode
1588 WifiRemoteStationManager::GetNonUnicastMode (void) const
1589 {
1590  if (m_nonUnicastMode == WifiMode ())
1591  {
1592  if (GetNBasicModes () > 0)
1593  {
1594  return GetBasicMode (0);
1595  }
1596  else
1597  {
1598  return GetDefaultMode ();
1599  }
1600  }
1601  else
1602  {
1603  return m_nonUnicastMode;
1604  }
1605 }
1606 
1607 bool
1608 WifiRemoteStationManager::DoNeedRts (WifiRemoteStation *station,
1609  uint32_t size, bool normally)
1610 {
1611  return normally;
1612 }
1613 
1614 bool
1615 WifiRemoteStationManager::DoNeedRetransmission (WifiRemoteStation *station,
1616  Ptr<const Packet> packet, bool normally)
1617 {
1618  return normally;
1619 }
1620 
1621 bool
1622 WifiRemoteStationManager::DoNeedFragmentation (WifiRemoteStation *station,
1623  Ptr<const Packet> packet, bool normally)
1624 {
1625  return normally;
1626 }
1627 
1628 void
1629 WifiRemoteStationManager::DoReportAmpduTxStatus (WifiRemoteStation *station, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus, double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)
1630 {
1631  NS_LOG_DEBUG ("DoReportAmpduTxStatus received but the manager does not handle A-MPDUs!");
1632 }
1633 
1634 WifiMode
1635 WifiRemoteStationManager::GetSupported (const WifiRemoteStation *station, uint8_t i) const
1636 {
1637  NS_ASSERT (i < GetNSupported (station));
1638  return station->m_state->m_operationalRateSet[i];
1639 }
1640 
1641 WifiMode
1642 WifiRemoteStationManager::GetMcsSupported (const WifiRemoteStation *station, uint8_t i) const
1643 {
1644  NS_ASSERT (i < GetNMcsSupported (station));
1645  return station->m_state->m_operationalMcsSet[i];
1646 }
1647 
1648 WifiMode
1649 WifiRemoteStationManager::GetNonErpSupported (const WifiRemoteStation *station, uint8_t i) const
1650 {
1651  NS_ASSERT (i < GetNNonErpSupported (station));
1652  //IEEE 802.11g standard defines that if the protection mechanism is enabled, RTS, CTS and CTS-To-Self
1653  //frames should select a rate in the BSSBasicRateSet that corresponds to an 802.11b basic rate.
1654  //This is a implemented here to avoid changes in every RAA, but should maybe be moved in case it breaks standard rules.
1655  uint32_t index = 0;
1656  bool found = false;
1657  for (WifiModeListIterator j = station->m_state->m_operationalRateSet.begin (); j != station->m_state->m_operationalRateSet.end (); )
1658  {
1659  if (i == index)
1660  {
1661  found = true;
1662  }
1663  if (j->GetModulationClass () != WIFI_MOD_CLASS_ERP_OFDM)
1664  {
1665  if (found)
1666  {
1667  break;
1668  }
1669  }
1670  index++;
1671  j++;
1672  }
1673  return station->m_state->m_operationalRateSet[index];
1674 }
1675 
1677 WifiRemoteStationManager::GetAddress (const WifiRemoteStation *station) const
1678 {
1679  return station->m_state->m_address;
1680 }
1681 
1682 uint16_t
1683 WifiRemoteStationManager::GetChannelWidth (const WifiRemoteStation *station) const
1684 {
1685  return station->m_state->m_channelWidth;
1686 }
1687 
1688 bool
1689 WifiRemoteStationManager::GetShortGuardIntervalSupported (const WifiRemoteStation *station) const
1690 {
1691  Ptr<const HtCapabilities> htCapabilities = station->m_state->m_htCapabilities;
1692 
1693  if (!htCapabilities)
1694  {
1695  return false;
1696  }
1697  return htCapabilities->GetShortGuardInterval20 ();
1698 }
1699 
1700 uint16_t
1701 WifiRemoteStationManager::GetGuardInterval (const WifiRemoteStation *station) const
1702 {
1703  return station->m_state->m_guardInterval;
1704 }
1705 
1706 bool
1707 WifiRemoteStationManager::GetAggregation (const WifiRemoteStation *station) const
1708 {
1709  return station->m_state->m_aggregation;
1710 }
1711 
1712 uint8_t
1713 WifiRemoteStationManager::GetNumberOfSupportedStreams (const WifiRemoteStation *station) const
1714 {
1715  Ptr<const HtCapabilities> htCapabilities = station->m_state->m_htCapabilities;
1716 
1717  if (!htCapabilities)
1718  {
1719  return 1;
1720  }
1721  return htCapabilities->GetRxHighestSupportedAntennas ();
1722 }
1723 
1724 uint8_t
1725 WifiRemoteStationManager::GetNess (const WifiRemoteStation *station) const
1726 {
1727  return station->m_state->m_ness;
1728 }
1729 
1731 WifiRemoteStationManager::GetPhy (void) const
1732 {
1733  return m_wifiPhy;
1734 }
1735 
1737 WifiRemoteStationManager::GetMac (void) const
1738 {
1739  return m_wifiMac;
1740 }
1741 
1742 uint8_t
1743 WifiRemoteStationManager::GetNSupported (const WifiRemoteStation *station) const
1744 {
1745  return static_cast<uint8_t> (station->m_state->m_operationalRateSet.size ());
1746 }
1747 
1748 bool
1749 WifiRemoteStationManager::GetQosSupported (const WifiRemoteStation *station) const
1750 {
1751  return station->m_state->m_qosSupported;
1752 }
1753 
1754 bool
1755 WifiRemoteStationManager::GetHtSupported (const WifiRemoteStation *station) const
1756 {
1757  return (station->m_state->m_htCapabilities != 0);
1758 }
1759 
1760 bool
1761 WifiRemoteStationManager::GetVhtSupported (const WifiRemoteStation *station) const
1762 {
1763  return (station->m_state->m_vhtCapabilities != 0);
1764 }
1765 
1766 bool
1767 WifiRemoteStationManager::GetHeSupported (const WifiRemoteStation *station) const
1768 {
1769  return (station->m_state->m_heCapabilities != 0);
1770 }
1771 
1772 uint8_t
1773 WifiRemoteStationManager::GetNMcsSupported (const WifiRemoteStation *station) const
1774 {
1775  return static_cast<uint8_t> (station->m_state->m_operationalMcsSet.size ());
1776 }
1777 
1778 uint32_t
1779 WifiRemoteStationManager::GetNNonErpSupported (const WifiRemoteStation *station) const
1780 {
1781  uint32_t size = 0;
1782  for (WifiModeListIterator i = station->m_state->m_operationalRateSet.begin (); i != station->m_state->m_operationalRateSet.end (); i++)
1783  {
1784  if (i->GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM)
1785  {
1786  continue;
1787  }
1788  size++;
1789  }
1790  return size;
1791 }
1792 
1793 uint16_t
1794 WifiRemoteStationManager::GetChannelWidthSupported (Mac48Address address) const
1795 {
1796  return LookupState (address)->m_channelWidth;
1797 }
1798 
1799 bool
1800 WifiRemoteStationManager::GetShortGuardIntervalSupported (Mac48Address address) const
1801 {
1802  Ptr<const HtCapabilities> htCapabilities = LookupState (address)->m_htCapabilities;
1803 
1804  if (!htCapabilities)
1805  {
1806  return false;
1807  }
1808  return htCapabilities->GetShortGuardInterval20 ();
1809 }
1810 
1811 uint8_t
1812 WifiRemoteStationManager::GetNumberOfSupportedStreams (Mac48Address address) const
1813 {
1814  Ptr<const HtCapabilities> htCapabilities = LookupState (address)->m_htCapabilities;
1815 
1816  if (!htCapabilities)
1817  {
1818  return 1;
1819  }
1820  return htCapabilities->GetRxHighestSupportedAntennas ();
1821 }
1822 
1823 uint8_t
1824 WifiRemoteStationManager::GetNMcsSupported (Mac48Address address) const
1825 {
1826  return static_cast<uint8_t> (LookupState (address)->m_operationalMcsSet.size ());
1827 }
1828 
1829 bool
1830 WifiRemoteStationManager::GetDsssSupported (const Mac48Address& address) const
1831 {
1832  return (LookupState (address)->m_dsssSupported);
1833 }
1834 
1835 bool
1836 WifiRemoteStationManager::GetErpOfdmSupported (const Mac48Address& address) const
1837 {
1838  return (LookupState (address)->m_erpOfdmSupported);
1839 }
1840 
1841 bool
1842 WifiRemoteStationManager::GetOfdmSupported (const Mac48Address& address) const
1843 {
1844  return (LookupState (address)->m_ofdmSupported);
1845 }
1846 
1847 bool
1848 WifiRemoteStationManager::GetHtSupported (Mac48Address address) const
1849 {
1850  return (LookupState (address)->m_htCapabilities != 0);
1851 }
1852 
1853 bool
1854 WifiRemoteStationManager::GetVhtSupported (Mac48Address address) const
1855 {
1856  return (LookupState (address)->m_vhtCapabilities != 0);
1857 }
1858 
1859 bool
1860 WifiRemoteStationManager::GetHeSupported (Mac48Address address) const
1861 {
1862  return (LookupState (address)->m_heCapabilities != 0);
1863 }
1864 
1865 void
1866 WifiRemoteStationManager::SetDefaultTxPowerLevel (uint8_t txPower)
1867 {
1868  m_defaultTxPowerLevel = txPower;
1869 }
1870 
1871 uint8_t
1872 WifiRemoteStationManager::GetNumberOfAntennas (void) const
1873 {
1874  return m_wifiPhy->GetNumberOfAntennas ();
1875 }
1876 
1877 uint8_t
1878 WifiRemoteStationManager::GetMaxNumberOfTransmitStreams (void) const
1879 {
1880  return m_wifiPhy->GetMaxSupportedTxSpatialStreams ();
1881 }
1882 
1883 bool
1884 WifiRemoteStationManager::UseLdpcForDestination (Mac48Address dest) const
1885 {
1886  return (GetLdpcSupported () && GetLdpcSupported (dest));
1887 }
1888 
1889 } //namespace ns3
ns3::WifiRemoteStationManager::IsAssociated
bool IsAssociated(Mac48Address address) const
Return whether the station associated.
Definition: wifi-remote-station-manager.cc:448
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:1206
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
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:1575
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:1464
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:1051
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:943
ns3::WifiMode::IsMandatory
bool IsMandatory(void) const
Definition: wifi-mode.cc:130
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:281
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:1265
ns3::WifiMode::IsHigherDataRate
bool IsHigherDataRate(WifiMode mode) const
Definition: wifi-mode.cc:181
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:1884
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:673
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:829
ns3::WIFI_PHY_BAND_5GHZ
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Definition: wifi-phy-band.h:37
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:235
ns3::WifiRemoteStationManager::NeedFragmentation
bool NeedFragmentation(Ptr< const WifiMacQueueItem > mpdu)
Definition: wifi-remote-station-manager.cc:1093
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:159
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:689
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:482
ns3::WifiRemoteStationManager::GetNBasicModes
uint8_t GetNBasicModes(void) const
Return the number of basic modes we support.
Definition: wifi-remote-station-manager.cc:1508
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:244
ns3::WifiRemoteStationManager::GetGuardInterval
uint16_t GetGuardInterval(void) const
Return the supported HE guard interval duration (in nanoseconds).
Definition: wifi-remote-station-manager.cc:297
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:246
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:930
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:364
ns3::WifiRemoteStationManager::GetShortPreambleSupported
bool GetShortPreambleSupported(Mac48Address address) const
Return whether the station supports short PHY preamble or not.
Definition: wifi-remote-station-manager.cc:420
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:381
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:1142
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:335
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:1136
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:1588
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:1106
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:432
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:394
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:957
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:326
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:1470
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:426
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:471
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:859
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:1490
sta-wifi-mac.h
ns3::HeCapabilities::GetHighestMcsSupported
uint8_t GetHighestMcsSupported(void) const
Get highest MCS supported.
Definition: he-capabilities.cc:489
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:991
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:1629
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:1064
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:508
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:1185
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:1458
ns3::WifiRemoteStationManager::IsBrandNew
bool IsBrandNew(Mac48Address address) const
Return whether the station state is brand new.
Definition: wifi-remote-station-manager.cc:438
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:317
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:268
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:1581
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:468
ns3::WifiRemoteStationManager::IsLastFragment
bool IsLastFragment(Ptr< const WifiMacQueueItem > mpdu, uint32_t fragmentNumber)
Definition: wifi-remote-station-manager.cc:1196
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:535
ns3::WifiPhy::GetDevice
Ptr< NetDevice > GetDevice(void) const
Return the device this PHY is associated with.
Definition: wifi-phy.cc:783
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:657
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:840
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:489
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:1615
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:495
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:1872
ns3::WifiRemoteStationManager::GetFragmentationThreshold
uint32_t GetFragmentationThreshold(void) const
Return the fragmentation threshold.
Definition: wifi-remote-station-manager.cc:311
ns3::WifiRemoteStationManager::GetFragmentSize
uint32_t GetFragmentSize(Ptr< const WifiMacQueueItem > mpdu, uint32_t fragmentNumber)
Definition: wifi-remote-station-manager.cc:1158
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:414
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:475
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:1233
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:1608
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:2015
ns3::WifiRemoteStationManager::NeedRetransmission
bool NeedRetransmission(Ptr< const WifiMacQueueItem > mpdu)
Definition: wifi-remote-station-manager.cc:1070
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:1044
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:1219
ns3::WifiRemoteStationManager::SetUseNonHtProtection
void SetUseNonHtProtection(bool enable)
Enable or disable protection for non-HT stations.
Definition: wifi-remote-station-manager.cc:1057
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:1212
ns3::WifiRemoteStationManager::AddSupportedMcs
void AddSupportedMcs(Mac48Address address, WifiMode mcs)
Record the MCS index supported by the station.
Definition: wifi-remote-station-manager.cc:403
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:872
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:896
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:1514
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:1231
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:496
ns3::WifiRemoteStationManager::DoNeedFragmentation
virtual bool DoNeedFragmentation(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
Definition: wifi-remote-station-manager.cc:1622
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:458
ns3::WifiRemoteStationManager::GetRtsTxVector
WifiTxVector GetRtsTxVector(Mac48Address address)
Definition: wifi-remote-station-manager.cc:620
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:2064
ns3::HeCapabilities::GetHeLtfAndGiForHePpdus
uint8_t GetHeLtfAndGiForHePpdus(void) const
Get HE LTF and GI for HE PDPUs.
Definition: he-capabilities.cc:483
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:258
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:909
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:641
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:256
ns3::WifiModeValue
AttributeValue implementation for WifiMode.
Definition: wifi-mode.h:246
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:137
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:587