A Discrete-Event Network Simulator
API
tx-duration-test.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 CTTC
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Authors: Nicola Baldo <nbaldo@cttc.es>
19  * Sébastien Deronne <sebastien.deronne@gmail.com>
20  */
21 
22 #include "ns3/log.h"
23 #include "ns3/simulator.h"
24 #include "ns3/test.h"
25 #include "ns3/yans-wifi-phy.h"
26 #include "ns3/he-ru.h"
27 #include "ns3/wifi-psdu.h"
28 #include "ns3/packet.h"
29 #include <numeric>
30 
31 using namespace ns3;
32 
33 NS_LOG_COMPONENT_DEFINE ("InterferenceHelperTxDurationTest");
34 
41 class TxDurationTest : public TestCase
42 {
43 public:
44  TxDurationTest ();
45  virtual ~TxDurationTest ();
46  virtual void DoRun (void);
47 
48 
49 private:
63  bool CheckPayloadDuration (uint32_t size, WifiMode payloadMode, uint16_t channelWidth, uint16_t guardInterval, WifiPreamble preamble, Time knownDuration);
64 
78  bool CheckTxDuration (uint32_t size, WifiMode payloadMode, uint16_t channelWidth, uint16_t guardInterval, WifiPreamble preamble, Time knownDuration);
79 
92  static bool CheckHeMuTxDuration (std::list<uint32_t> sizes, std::list<HeMuUserInfo> userInfos,
93  uint16_t channelWidth, uint16_t guardInterval,
94  Time knownDuration);
95 
110  static Time CalculateTxDurationUsingList (std::list<uint32_t> sizes, std::list<uint16_t> staIds,
111  WifiTxVector txVector, WifiPhyBand band);
112 };
113 
115  : TestCase ("Wifi TX Duration")
116 {
117 }
118 
120 {
121 }
122 
123 bool
124 TxDurationTest::CheckPayloadDuration (uint32_t size, WifiMode payloadMode, uint16_t channelWidth, uint16_t guardInterval, WifiPreamble preamble, Time knownDuration)
125 {
126  WifiTxVector txVector;
127  txVector.SetMode (payloadMode);
128  txVector.SetPreambleType (preamble);
129  txVector.SetChannelWidth (channelWidth);
130  txVector.SetGuardInterval (guardInterval);
131  txVector.SetNss (1);
132  txVector.SetStbc (0);
133  txVector.SetNess (0);
135  Ptr<YansWifiPhy> phy = CreateObject<YansWifiPhy> ();
136  if (payloadMode.GetModulationClass () == WIFI_MOD_CLASS_OFDM
137  || payloadMode.GetModulationClass () == WIFI_MOD_CLASS_HT
138  || payloadMode.GetModulationClass () == WIFI_MOD_CLASS_VHT
139  || payloadMode.GetModulationClass () == WIFI_MOD_CLASS_HE)
140  {
141  band = WIFI_PHY_BAND_5GHZ;
142  }
143  Time calculatedDuration = phy->GetPayloadDuration (size, txVector, band);
144  if (calculatedDuration != knownDuration)
145  {
146  std::cerr << "size=" << size
147  << " mode=" << payloadMode
148  << " channelWidth=" << channelWidth
149  << " guardInterval=" << guardInterval
150  << " datarate=" << payloadMode.GetDataRate (channelWidth, guardInterval, 1)
151  << " known=" << knownDuration
152  << " calculated=" << calculatedDuration
153  << std::endl;
154  return false;
155  }
156  if (payloadMode.GetModulationClass () == WIFI_MOD_CLASS_HT || payloadMode.GetModulationClass () == WIFI_MOD_CLASS_HE)
157  {
158  //Durations vary depending on frequency; test also 2.4 GHz (bug 1971)
159  band = WIFI_PHY_BAND_2_4GHZ;
160  calculatedDuration = phy->GetPayloadDuration (size, txVector, band);
161  knownDuration += MicroSeconds (6);
162  if (calculatedDuration != knownDuration)
163  {
164  std::cerr << "size=" << size
165  << " mode=" << payloadMode
166  << " channelWidth=" << channelWidth
167  << " guardInterval=" << guardInterval
168  << " datarate=" << payloadMode.GetDataRate (channelWidth, guardInterval, 1)
169  << " known=" << knownDuration
170  << " calculated=" << calculatedDuration
171  << std::endl;
172  return false;
173  }
174  }
175  return true;
176 }
177 
178 bool
179 TxDurationTest::CheckTxDuration (uint32_t size, WifiMode payloadMode, uint16_t channelWidth, uint16_t guardInterval, WifiPreamble preamble, Time knownDuration)
180 {
181  WifiTxVector txVector;
182  txVector.SetMode (payloadMode);
183  txVector.SetPreambleType (preamble);
184  txVector.SetChannelWidth (channelWidth);
185  txVector.SetGuardInterval (guardInterval);
186  txVector.SetNss (1);
187  txVector.SetStbc (0);
188  txVector.SetNess (0);
190  Ptr<YansWifiPhy> phy = CreateObject<YansWifiPhy> ();
191  if (payloadMode.GetModulationClass () == WIFI_MOD_CLASS_OFDM
192  || payloadMode.GetModulationClass () == WIFI_MOD_CLASS_HT
193  || payloadMode.GetModulationClass () == WIFI_MOD_CLASS_VHT
194  || payloadMode.GetModulationClass () == WIFI_MOD_CLASS_HE)
195  {
196  band = WIFI_PHY_BAND_5GHZ;
197  }
198  Time calculatedDuration = phy->CalculateTxDuration (size, txVector, band);
199  Time calculatedDurationUsingList = CalculateTxDurationUsingList (std::list<uint32_t> {size}, std::list<uint16_t> {SU_STA_ID},
200  txVector, band);
201  if (calculatedDuration != knownDuration || calculatedDuration != calculatedDurationUsingList)
202  {
203  std::cerr << "size=" << size
204  << " mode=" << payloadMode
205  << " channelWidth=" << +channelWidth
206  << " guardInterval=" << guardInterval
207  << " datarate=" << payloadMode.GetDataRate (channelWidth, guardInterval, 1)
208  << " preamble=" << preamble
209  << " known=" << knownDuration
210  << " calculated=" << calculatedDuration
211  << " calculatedUsingList=" << calculatedDurationUsingList
212  << std::endl;
213  return false;
214  }
215  if (payloadMode.GetModulationClass () == WIFI_MOD_CLASS_HT || payloadMode.GetModulationClass () == WIFI_MOD_CLASS_HE)
216  {
217  //Durations vary depending on frequency; test also 2.4 GHz (bug 1971)
218  band = WIFI_PHY_BAND_2_4GHZ;
219  calculatedDuration = phy->CalculateTxDuration (size, txVector, band);
220  calculatedDurationUsingList = CalculateTxDurationUsingList (std::list<uint32_t> {size}, std::list<uint16_t> {SU_STA_ID},
221  txVector, band);
222  knownDuration += MicroSeconds (6);
223  if (calculatedDuration != knownDuration || calculatedDuration != calculatedDurationUsingList)
224  {
225  std::cerr << "size=" << size
226  << " mode=" << payloadMode
227  << " channelWidth=" << channelWidth
228  << " guardInterval=" << guardInterval
229  << " datarate=" << payloadMode.GetDataRate (channelWidth, guardInterval, 1)
230  << " preamble=" << preamble
231  << " known=" << knownDuration
232  << " calculated=" << calculatedDuration
233  << " calculatedUsingList=" << calculatedDurationUsingList
234  << std::endl;
235  return false;
236  }
237  }
238  return true;
239 }
240 
241 bool
242 TxDurationTest::CheckHeMuTxDuration (std::list<uint32_t> sizes, std::list<HeMuUserInfo> userInfos,
243  uint16_t channelWidth, uint16_t guardInterval,
244  Time knownDuration)
245 {
246  NS_ASSERT (sizes.size () == userInfos.size () && sizes.size () > 1);
247  NS_ABORT_MSG_IF (channelWidth < std::accumulate (std::begin (userInfos), std::end (userInfos), 0,
248  [](const uint16_t prevBw, const HeMuUserInfo &info)
249  { return prevBw + HeRu::GetBandwidth (info.ru.ruType); }),
250  "Cannot accommodate all the RUs in the provided band"); //MU-MIMO (for which allocations use the same RU) is not supported
251  WifiTxVector txVector;
253  txVector.SetChannelWidth (channelWidth);
254  txVector.SetGuardInterval (guardInterval);
255  txVector.SetStbc (0);
256  txVector.SetNess (0);
257  std::list<uint16_t> staIds;
258  uint16_t staId = 1;
259  for (const auto & userInfo : userInfos)
260  {
261  txVector.SetHeMuUserInfo (staId, userInfo);
262  staIds.push_back (staId++);
263  }
264  Ptr<YansWifiPhy> phy = CreateObject<YansWifiPhy> ();
265  std::list<WifiPhyBand> testedBands {WIFI_PHY_BAND_5GHZ, WIFI_PHY_BAND_2_4GHZ}; //Durations vary depending on frequency; test also 2.4 GHz (bug 1971)
266  for (auto & testedBand : testedBands)
267  {
268  if (testedBand == WIFI_PHY_BAND_2_4GHZ)
269  {
270  knownDuration += MicroSeconds (6);
271  }
272  Time calculatedDuration = NanoSeconds (0);
273  uint32_t longuestSize = 0;
274  auto iterStaId = staIds.begin ();
275  for (auto & size : sizes)
276  {
277  Time ppduDurationForSta = phy->CalculateTxDuration (size, txVector, testedBand, *iterStaId);
278  if (ppduDurationForSta > calculatedDuration)
279  {
280  calculatedDuration = ppduDurationForSta;
281  staId = *iterStaId;
282  longuestSize = size;
283  }
284  ++iterStaId;
285  }
286  Time calculatedDurationUsingList = CalculateTxDurationUsingList (sizes, staIds, txVector, testedBand);
287  if (calculatedDuration != knownDuration || calculatedDuration != calculatedDurationUsingList)
288  {
289  std::cerr << "size=" << longuestSize
290  << " band=" << testedBand
291  << " staId=" << staId
292  << " nss=" << +txVector.GetNss (staId)
293  << " mode=" << txVector.GetMode (staId)
294  << " channelWidth=" << channelWidth
295  << " guardInterval=" << guardInterval
296  << " datarate=" << txVector.GetMode (staId).GetDataRate (channelWidth, guardInterval, txVector.GetNss (staId))
297  << " known=" << knownDuration
298  << " calculated=" << calculatedDuration
299  << " calculatedUsingList=" << calculatedDurationUsingList
300  << std::endl;
301  return false;
302  }
303  }
304  return true;
305 }
306 
307 Time
308 TxDurationTest::CalculateTxDurationUsingList (std::list<uint32_t> sizes, std::list<uint16_t> staIds,
309  WifiTxVector txVector, WifiPhyBand band)
310 {
311  NS_ASSERT (sizes.size () == staIds.size ());
312  WifiConstPsduMap psduMap;
313  auto itStaId = staIds.begin ();
314  WifiMacHeader hdr;
315  hdr.SetType (WIFI_MAC_CTL_ACK); //so that size may not be empty while being as short as possible
316  for (auto & size : sizes)
317  {
318  // MAC header and FCS are to deduce from size
319  psduMap[*itStaId++] = Create<WifiPsdu> (Create<Packet> (size - hdr.GetSerializedSize () - 4), hdr);
320  }
321  return WifiPhy::CalculateTxDuration (psduMap, txVector, band);
322 }
323 
324 void
326 {
327  bool retval = true;
328 
329  //IEEE Std 802.11-2007 Table 18-2 "Example of LENGTH calculations for CCK"
330  retval = retval
331  && CheckPayloadDuration (1023, WifiPhy::GetDsssRate11Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (744))
332  && CheckPayloadDuration (1024, WifiPhy::GetDsssRate11Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (745))
333  && CheckPayloadDuration (1025, WifiPhy::GetDsssRate11Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (746))
334  && CheckPayloadDuration (1026, WifiPhy::GetDsssRate11Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (747));
335 
336  NS_TEST_EXPECT_MSG_EQ (retval, true, "an 802.11b CCK duration failed");
337 
338  //Similar, but we add PHY preamble and header durations
339  //and we test different rates.
340  //The payload durations for modes other than 11mbb have been
341  //calculated by hand according to IEEE Std 802.11-2007 18.2.3.5
342  retval = retval
343  && CheckTxDuration (1023, WifiPhy::GetDsssRate11Mbps (), 22, 800, WIFI_PREAMBLE_SHORT, MicroSeconds (744 + 96))
344  && CheckTxDuration (1024, WifiPhy::GetDsssRate11Mbps (), 22, 800, WIFI_PREAMBLE_SHORT, MicroSeconds (745 + 96))
345  && CheckTxDuration (1025, WifiPhy::GetDsssRate11Mbps (), 22, 800, WIFI_PREAMBLE_SHORT, MicroSeconds (746 + 96))
346  && CheckTxDuration (1026, WifiPhy::GetDsssRate11Mbps (), 22, 800, WIFI_PREAMBLE_SHORT, MicroSeconds (747 + 96))
347  && CheckTxDuration (1023, WifiPhy::GetDsssRate11Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (744 + 192))
348  && CheckTxDuration (1024, WifiPhy::GetDsssRate11Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (745 + 192))
349  && CheckTxDuration (1025, WifiPhy::GetDsssRate11Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (746 + 192))
350  && CheckTxDuration (1026, WifiPhy::GetDsssRate11Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (747 + 192))
351  && CheckTxDuration (1023, WifiPhy::GetDsssRate5_5Mbps (), 22, 800, WIFI_PREAMBLE_SHORT, MicroSeconds (1488 + 96))
352  && CheckTxDuration (1024, WifiPhy::GetDsssRate5_5Mbps (), 22, 800, WIFI_PREAMBLE_SHORT, MicroSeconds (1490 + 96))
353  && CheckTxDuration (1025, WifiPhy::GetDsssRate5_5Mbps (), 22, 800, WIFI_PREAMBLE_SHORT, MicroSeconds (1491 + 96))
354  && CheckTxDuration (1026, WifiPhy::GetDsssRate5_5Mbps (), 22, 800, WIFI_PREAMBLE_SHORT, MicroSeconds (1493 + 96))
355  && CheckTxDuration (1023, WifiPhy::GetDsssRate5_5Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (1488 + 192))
356  && CheckTxDuration (1024, WifiPhy::GetDsssRate5_5Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (1490 + 192))
357  && CheckTxDuration (1025, WifiPhy::GetDsssRate5_5Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (1491 + 192))
358  && CheckTxDuration (1026, WifiPhy::GetDsssRate5_5Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (1493 + 192))
359  && CheckTxDuration (1023, WifiPhy::GetDsssRate2Mbps (), 22, 800, WIFI_PREAMBLE_SHORT, MicroSeconds (4092 + 96))
360  && CheckTxDuration (1024, WifiPhy::GetDsssRate2Mbps (), 22, 800, WIFI_PREAMBLE_SHORT, MicroSeconds (4096 + 96))
361  && CheckTxDuration (1025, WifiPhy::GetDsssRate2Mbps (), 22, 800, WIFI_PREAMBLE_SHORT, MicroSeconds (4100 + 96))
362  && CheckTxDuration (1026, WifiPhy::GetDsssRate2Mbps (), 22, 800, WIFI_PREAMBLE_SHORT, MicroSeconds (4104 + 96))
363  && CheckTxDuration (1023, WifiPhy::GetDsssRate2Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (4092 + 192))
364  && CheckTxDuration (1024, WifiPhy::GetDsssRate2Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (4096 + 192))
365  && CheckTxDuration (1025, WifiPhy::GetDsssRate2Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (4100 + 192))
366  && CheckTxDuration (1026, WifiPhy::GetDsssRate2Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (4104 + 192))
367  && CheckTxDuration (1023, WifiPhy::GetDsssRate1Mbps (), 22, 800, WIFI_PREAMBLE_SHORT, MicroSeconds (8184 + 192))
368  && CheckTxDuration (1024, WifiPhy::GetDsssRate1Mbps (), 22, 800, WIFI_PREAMBLE_SHORT, MicroSeconds (8192 + 192))
369  && CheckTxDuration (1025, WifiPhy::GetDsssRate1Mbps (), 22, 800, WIFI_PREAMBLE_SHORT, MicroSeconds (8200 + 192))
370  && CheckTxDuration (1026, WifiPhy::GetDsssRate1Mbps (), 22, 800, WIFI_PREAMBLE_SHORT, MicroSeconds (8208 + 192))
371  && CheckTxDuration (1023, WifiPhy::GetDsssRate1Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (8184 + 192))
372  && CheckTxDuration (1024, WifiPhy::GetDsssRate1Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (8192 + 192))
373  && CheckTxDuration (1025, WifiPhy::GetDsssRate1Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (8200 + 192))
374  && CheckTxDuration (1026, WifiPhy::GetDsssRate1Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (8208 + 192));
375 
376  //values from http://mailman.isi.edu/pipermail/ns-developers/2009-July/006226.html
377  retval = retval && CheckTxDuration (14, WifiPhy::GetDsssRate1Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (304));
378 
379  //values from http://www.oreillynet.com/pub/a/wireless/2003/08/08/wireless_throughput.html
380  retval = retval
381  && CheckTxDuration (1536, WifiPhy::GetDsssRate11Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (1310))
382  && CheckTxDuration (76, WifiPhy::GetDsssRate11Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (248))
383  && CheckTxDuration (14, WifiPhy::GetDsssRate11Mbps (), 22, 800, WIFI_PREAMBLE_LONG, MicroSeconds (203));
384 
385  NS_TEST_EXPECT_MSG_EQ (retval, true, "an 802.11b duration failed");
386 
387  //802.11a durations
388  //values from http://www.oreillynet.com/pub/a/wireless/2003/08/08/wireless_throughput.html
389  retval = retval
390  && CheckTxDuration (1536, WifiPhy::GetOfdmRate54Mbps (), 20, 800, WIFI_PREAMBLE_LONG, MicroSeconds (248))
391  && CheckTxDuration (76, WifiPhy::GetOfdmRate54Mbps (), 20, 800, WIFI_PREAMBLE_LONG, MicroSeconds (32))
392  && CheckTxDuration (14, WifiPhy::GetOfdmRate54Mbps (), 20, 800, WIFI_PREAMBLE_LONG, MicroSeconds (24));
393 
394  NS_TEST_EXPECT_MSG_EQ (retval, true, "an 802.11a duration failed");
395 
396  //802.11g durations are same as 802.11a durations but with 6 us signal extension
397  retval = retval
398  && CheckTxDuration (1536, WifiPhy::GetErpOfdmRate54Mbps (), 20, 800, WIFI_PREAMBLE_LONG, MicroSeconds (254))
399  && CheckTxDuration (76, WifiPhy::GetErpOfdmRate54Mbps (), 20, 800, WIFI_PREAMBLE_LONG, MicroSeconds (38))
400  && CheckTxDuration (14, WifiPhy::GetErpOfdmRate54Mbps (), 20, 800, WIFI_PREAMBLE_LONG, MicroSeconds (30));
401 
402  NS_TEST_EXPECT_MSG_EQ (retval, true, "an 802.11g duration failed");
403 
404  //802.11n durations
405  retval = retval
406  && CheckTxDuration (1536, WifiPhy::GetHtMcs7 (), 20, 800, WIFI_PREAMBLE_HT_MF, MicroSeconds (228))
407  && CheckTxDuration (76, WifiPhy::GetHtMcs7 (), 20, 800, WIFI_PREAMBLE_HT_MF, MicroSeconds (48))
408  && CheckTxDuration (14, WifiPhy::GetHtMcs7 (), 20, 800, WIFI_PREAMBLE_HT_MF, MicroSeconds (40))
409  && CheckTxDuration (1536, WifiPhy::GetHtMcs7 (), 20, 800, WIFI_PREAMBLE_HT_GF, MicroSeconds (220))
410  && CheckTxDuration (76, WifiPhy::GetHtMcs7 (), 20, 800, WIFI_PREAMBLE_HT_GF, MicroSeconds (40))
411  && CheckTxDuration (14, WifiPhy::GetHtMcs7 (), 20, 800, WIFI_PREAMBLE_HT_GF, MicroSeconds (32))
412  && CheckTxDuration (1536, WifiPhy::GetHtMcs0 (), 20, 400, WIFI_PREAMBLE_HT_MF, NanoSeconds (1742400))
413  && CheckTxDuration (76, WifiPhy::GetHtMcs0 (), 20, 400, WIFI_PREAMBLE_HT_MF, MicroSeconds (126))
414  && CheckTxDuration (14, WifiPhy::GetHtMcs0 (), 20, 400, WIFI_PREAMBLE_HT_MF, NanoSeconds (57600))
415  && CheckTxDuration (1536,WifiPhy::GetHtMcs0 (), 20, 400, WIFI_PREAMBLE_HT_GF, NanoSeconds (1734400))
416  && CheckTxDuration (76, WifiPhy::GetHtMcs0 (), 20, 400, WIFI_PREAMBLE_HT_GF, MicroSeconds (118))
417  && CheckTxDuration (14, WifiPhy::GetHtMcs0 (), 20, 400, WIFI_PREAMBLE_HT_GF, NanoSeconds (49600))
418  && CheckTxDuration (1536, WifiPhy::GetHtMcs6 (), 20, 400, WIFI_PREAMBLE_HT_MF, NanoSeconds (226800))
419  && CheckTxDuration (76, WifiPhy::GetHtMcs6 (), 20, 400, WIFI_PREAMBLE_HT_MF, NanoSeconds (46800))
420  && CheckTxDuration (14, WifiPhy::GetHtMcs6 (), 20, 400, WIFI_PREAMBLE_HT_MF, NanoSeconds (39600))
421  && CheckTxDuration (1536, WifiPhy::GetHtMcs6 (), 20, 400, WIFI_PREAMBLE_HT_GF, NanoSeconds (218800))
422  && CheckTxDuration (76, WifiPhy::GetHtMcs6 (), 20, 400, WIFI_PREAMBLE_HT_GF, NanoSeconds (38800))
423  && CheckTxDuration (14, WifiPhy::GetHtMcs6 (), 20, 400, WIFI_PREAMBLE_HT_GF, NanoSeconds (31600))
424  && CheckTxDuration (1536, WifiPhy::GetHtMcs7 (), 40, 800, WIFI_PREAMBLE_HT_MF, MicroSeconds (128))
425  && CheckTxDuration (76, WifiPhy::GetHtMcs7 (), 40, 800, WIFI_PREAMBLE_HT_MF, MicroSeconds (44))
426  && CheckTxDuration (14, WifiPhy::GetHtMcs7 (), 40, 800, WIFI_PREAMBLE_HT_MF, MicroSeconds (40))
427  && CheckTxDuration (1536, WifiPhy::GetHtMcs7 (), 40, 800, WIFI_PREAMBLE_HT_GF, MicroSeconds (120))
428  && CheckTxDuration (76, WifiPhy::GetHtMcs7 (), 40, 800, WIFI_PREAMBLE_HT_GF, MicroSeconds (36))
429  && CheckTxDuration (14, WifiPhy::GetHtMcs7 (), 40, 800, WIFI_PREAMBLE_HT_GF, MicroSeconds (32))
430  && CheckTxDuration (1536, WifiPhy::GetHtMcs7 (), 40, 400, WIFI_PREAMBLE_HT_MF, NanoSeconds (118800))
431  && CheckTxDuration (76, WifiPhy::GetHtMcs7 (), 40, 400, WIFI_PREAMBLE_HT_MF, NanoSeconds (43200))
432  && CheckTxDuration (14, WifiPhy::GetHtMcs7 (), 40, 400, WIFI_PREAMBLE_HT_MF, NanoSeconds (39600))
433  && CheckTxDuration (1536, WifiPhy::GetHtMcs7 (), 40, 400, WIFI_PREAMBLE_HT_GF, NanoSeconds (110800))
434  && CheckTxDuration (76, WifiPhy::GetHtMcs7 (), 40, 400, WIFI_PREAMBLE_HT_GF, NanoSeconds (35200))
435  && CheckTxDuration (14, WifiPhy::GetHtMcs7 (), 40, 400, WIFI_PREAMBLE_HT_GF, NanoSeconds (31600));
436 
437  NS_TEST_EXPECT_MSG_EQ (retval, true, "an 802.11n duration failed");
438 
439  //802.11ac durations
440  retval = retval
441  && CheckTxDuration (1536, WifiPhy::GetVhtMcs8 (), 20, 800, WIFI_PREAMBLE_VHT_SU, MicroSeconds (196))
442  && CheckTxDuration (76, WifiPhy::GetVhtMcs8 (), 20, 800, WIFI_PREAMBLE_VHT_SU, MicroSeconds (48))
443  && CheckTxDuration (14, WifiPhy::GetVhtMcs8 (), 20, 800, WIFI_PREAMBLE_VHT_SU, MicroSeconds (40))
444  && CheckTxDuration (1536, WifiPhy::GetVhtMcs8 (), 20, 400, WIFI_PREAMBLE_VHT_SU, MicroSeconds (180))
445  && CheckTxDuration (76, WifiPhy::GetVhtMcs8 (), 20, 400, WIFI_PREAMBLE_VHT_SU, NanoSeconds (46800))
446  && CheckTxDuration (14, WifiPhy::GetVhtMcs8 (), 20, 400, WIFI_PREAMBLE_VHT_SU, NanoSeconds (39600))
447  && CheckTxDuration (1536, WifiPhy::GetVhtMcs9 (), 40, 800, WIFI_PREAMBLE_VHT_SU, MicroSeconds (108))
448  && CheckTxDuration (76, WifiPhy::GetVhtMcs9 (), 40, 800, WIFI_PREAMBLE_VHT_SU, MicroSeconds (40))
449  && CheckTxDuration (14, WifiPhy::GetVhtMcs9 (), 40, 800, WIFI_PREAMBLE_VHT_SU, MicroSeconds (40))
450  && CheckTxDuration (1536, WifiPhy::GetVhtMcs9 (), 40, 400, WIFI_PREAMBLE_VHT_SU, NanoSeconds (100800))
451  && CheckTxDuration (76, WifiPhy::GetVhtMcs9 (), 40, 400, WIFI_PREAMBLE_VHT_SU, NanoSeconds (39600))
452  && CheckTxDuration (14, WifiPhy::GetVhtMcs9 (), 40, 400, WIFI_PREAMBLE_VHT_SU, NanoSeconds (39600))
453  && CheckTxDuration (1536, WifiPhy::GetVhtMcs0 (), 80, 800, WIFI_PREAMBLE_VHT_SU, MicroSeconds (460))
454  && CheckTxDuration (76, WifiPhy::GetVhtMcs0 (), 80, 800, WIFI_PREAMBLE_VHT_SU, MicroSeconds (60))
455  && CheckTxDuration (14, WifiPhy::GetVhtMcs0 (), 80, 800, WIFI_PREAMBLE_VHT_SU, MicroSeconds (44))
456  && CheckTxDuration (1536, WifiPhy::GetVhtMcs0 (), 80, 400, WIFI_PREAMBLE_VHT_SU, NanoSeconds (417600))
457  && CheckTxDuration (76, WifiPhy::GetVhtMcs0 (), 80, 400, WIFI_PREAMBLE_VHT_SU, NanoSeconds (57600))
458  && CheckTxDuration (14, WifiPhy::GetVhtMcs0 (), 80, 400, WIFI_PREAMBLE_VHT_SU, NanoSeconds (43200))
459  && CheckTxDuration (1536, WifiPhy::GetVhtMcs9 (), 80, 800, WIFI_PREAMBLE_VHT_SU, MicroSeconds (68))
460  && CheckTxDuration (76, WifiPhy::GetVhtMcs9 (), 80, 800, WIFI_PREAMBLE_VHT_SU, MicroSeconds (40))
461  && CheckTxDuration (14, WifiPhy::GetVhtMcs9 (), 80, 800, WIFI_PREAMBLE_VHT_SU, MicroSeconds (40))
462  && CheckTxDuration (1536, WifiPhy::GetVhtMcs9 (), 80, 400, WIFI_PREAMBLE_VHT_SU, NanoSeconds (64800))
463  && CheckTxDuration (76, WifiPhy::GetVhtMcs9 (), 80, 400, WIFI_PREAMBLE_VHT_SU, NanoSeconds (39600))
464  && CheckTxDuration (14, WifiPhy::GetVhtMcs9 (), 80, 400, WIFI_PREAMBLE_VHT_SU, NanoSeconds (39600))
465  && CheckTxDuration (1536, WifiPhy::GetVhtMcs8 (), 160, 800, WIFI_PREAMBLE_VHT_SU, MicroSeconds (56))
466  && CheckTxDuration (76, WifiPhy::GetVhtMcs8 (), 160, 800, WIFI_PREAMBLE_VHT_SU, MicroSeconds (40))
467  && CheckTxDuration (14, WifiPhy::GetVhtMcs8 (), 160, 800, WIFI_PREAMBLE_VHT_SU, MicroSeconds (40))
468  && CheckTxDuration (1536, WifiPhy::GetVhtMcs8 (), 160, 400, WIFI_PREAMBLE_VHT_SU, MicroSeconds (54))
469  && CheckTxDuration (76, WifiPhy::GetVhtMcs8 (), 160, 400, WIFI_PREAMBLE_VHT_SU, NanoSeconds (39600))
470  && CheckTxDuration (14, WifiPhy::GetVhtMcs8 (), 160, 400, WIFI_PREAMBLE_VHT_SU, NanoSeconds (39600));
471 
472  NS_TEST_EXPECT_MSG_EQ (retval, true, "an 802.11ac duration failed");
473 
474  //802.11ax SU durations
475  retval = retval
476  && CheckTxDuration (1536, WifiPhy::GetHeMcs0 (), 20, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (1485600))
477  && CheckTxDuration (76, WifiPhy::GetHeMcs0 (), 20, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (125600))
478  && CheckTxDuration (14, WifiPhy::GetHeMcs0 (), 20, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (71200))
479  && CheckTxDuration (1536, WifiPhy::GetHeMcs0 (), 40, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (764800))
480  && CheckTxDuration (76, WifiPhy::GetHeMcs0 (), 40, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (84800))
481  && CheckTxDuration (14, WifiPhy::GetHeMcs0 (), 40, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (57600))
482  && CheckTxDuration (1536, WifiPhy::GetHeMcs0 (), 80, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (397600))
483  && CheckTxDuration (76, WifiPhy::GetHeMcs0 (), 80, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (71200))
484  && CheckTxDuration (14, WifiPhy::GetHeMcs0 (), 80, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (57600))
485  && CheckTxDuration (1536, WifiPhy::GetHeMcs0 (), 160, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (220800))
486  && CheckTxDuration (76, WifiPhy::GetHeMcs0 (), 160, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (57600))
487  && CheckTxDuration (14, WifiPhy::GetHeMcs0 (), 160, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (57600))
488  && CheckTxDuration (1536, WifiPhy::GetHeMcs0 (), 20, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (1570400))
489  && CheckTxDuration (76, WifiPhy::GetHeMcs0 (), 20, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (130400))
490  && CheckTxDuration (14, WifiPhy::GetHeMcs0 (), 20, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (72800))
491  && CheckTxDuration (1536, WifiPhy::GetHeMcs0 (), 40, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (807200))
492  && CheckTxDuration (76, WifiPhy::GetHeMcs0 (), 40, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (87200))
493  && CheckTxDuration (14, WifiPhy::GetHeMcs0 (), 40, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (58400))
494  && CheckTxDuration (1536, WifiPhy::GetHeMcs0 (), 80, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (418400))
495  && CheckTxDuration (76, WifiPhy::GetHeMcs0 (), 80, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (72800))
496  && CheckTxDuration (14, WifiPhy::GetHeMcs0 (), 80, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (58400))
497  && CheckTxDuration (1536, WifiPhy::GetHeMcs0 (), 160, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (231200))
498  && CheckTxDuration (76, WifiPhy::GetHeMcs0 (), 160, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (58400))
499  && CheckTxDuration (14, WifiPhy::GetHeMcs0 (), 160, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (58400))
500  && CheckTxDuration (1536, WifiPhy::GetHeMcs0 (), 20, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (1740))
501  && CheckTxDuration (76, WifiPhy::GetHeMcs0 (), 20, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (140))
502  && CheckTxDuration (14, WifiPhy::GetHeMcs0 (), 20, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (76))
503  && CheckTxDuration (1536, WifiPhy::GetHeMcs0 (), 40, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (892))
504  && CheckTxDuration (76, WifiPhy::GetHeMcs0 (), 40, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (92))
505  && CheckTxDuration (14, WifiPhy::GetHeMcs0 (), 40, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (60))
506  && CheckTxDuration (1536, WifiPhy::GetHeMcs0 (), 80, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (460))
507  && CheckTxDuration (76, WifiPhy::GetHeMcs0 (), 80, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (76))
508  && CheckTxDuration (14, WifiPhy::GetHeMcs0 (), 80, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (60))
509  && CheckTxDuration (1536, WifiPhy::GetHeMcs0 (), 160, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (252))
510  && CheckTxDuration (76, WifiPhy::GetHeMcs0 (), 160, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (60))
511  && CheckTxDuration (14, WifiPhy::GetHeMcs0 (), 160, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (60))
512  && CheckTxDuration (1536, WifiPhy::GetHeMcs11 (), 20, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (139200))
513  && CheckTxDuration (76, WifiPhy::GetHeMcs11 (), 20, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (57600))
514  && CheckTxDuration (14, WifiPhy::GetHeMcs11 (), 20, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (57600))
515  && CheckTxDuration (1536, WifiPhy::GetHeMcs11 (), 40, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (98400))
516  && CheckTxDuration (76, WifiPhy::GetHeMcs11 (), 40, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (57600))
517  && CheckTxDuration (14, WifiPhy::GetHeMcs11 (), 40, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (57600))
518  && CheckTxDuration (1536, WifiPhy::GetHeMcs11 (), 80, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (71200))
519  && CheckTxDuration (76, WifiPhy::GetHeMcs11 (), 80, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (57600))
520  && CheckTxDuration (14, WifiPhy::GetHeMcs11 (), 80, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (57600))
521  && CheckTxDuration (1536, WifiPhy::GetHeMcs11 (), 160, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (57600))
522  && CheckTxDuration (76, WifiPhy::GetHeMcs11 (), 160, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (57600))
523  && CheckTxDuration (14, WifiPhy::GetHeMcs11 (), 160, 800, WIFI_PREAMBLE_HE_SU, NanoSeconds (57600))
524  && CheckTxDuration (1536, WifiPhy::GetHeMcs11 (), 20, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (144800))
525  && CheckTxDuration (76, WifiPhy::GetHeMcs11 (), 20, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (58400))
526  && CheckTxDuration (14, WifiPhy::GetHeMcs11 (), 20, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (58400))
527  && CheckTxDuration (1536, WifiPhy::GetHeMcs11 (), 40, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (101600))
528  && CheckTxDuration (76, WifiPhy::GetHeMcs11 (), 40, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (58400))
529  && CheckTxDuration (14, WifiPhy::GetHeMcs11 (), 40, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (58400))
530  && CheckTxDuration (1536, WifiPhy::GetHeMcs11 (), 80, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (72800))
531  && CheckTxDuration (76, WifiPhy::GetHeMcs11 (), 80, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (58400))
532  && CheckTxDuration (14, WifiPhy::GetHeMcs11 (), 80, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (58400))
533  && CheckTxDuration (1536, WifiPhy::GetHeMcs11 (), 160, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (58400))
534  && CheckTxDuration (76, WifiPhy::GetHeMcs11 (), 160, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (58400))
535  && CheckTxDuration (14, WifiPhy::GetHeMcs11 (), 160, 1600, WIFI_PREAMBLE_HE_SU, NanoSeconds (58400))
536  && CheckTxDuration (1536, WifiPhy::GetHeMcs11 (), 20, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (156))
537  && CheckTxDuration (76, WifiPhy::GetHeMcs11 (), 20, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (60))
538  && CheckTxDuration (14, WifiPhy::GetHeMcs11 (), 20, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (60))
539  && CheckTxDuration (1536, WifiPhy::GetHeMcs11 (), 40, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (108))
540  && CheckTxDuration (76, WifiPhy::GetHeMcs11 (), 40, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (60))
541  && CheckTxDuration (14, WifiPhy::GetHeMcs11 (), 40, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (60))
542  && CheckTxDuration (1536, WifiPhy::GetHeMcs11 (), 80, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (76))
543  && CheckTxDuration (76, WifiPhy::GetHeMcs11 (), 80, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (60))
544  && CheckTxDuration (14, WifiPhy::GetHeMcs11 (), 80, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (60))
545  && CheckTxDuration (1536, WifiPhy::GetHeMcs11 (), 160, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (60))
546  && CheckTxDuration (76, WifiPhy::GetHeMcs11 (), 160, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (60))
547  && CheckTxDuration (14, WifiPhy::GetHeMcs11 (), 160, 3200, WIFI_PREAMBLE_HE_SU, MicroSeconds (60));
548 
549  NS_TEST_EXPECT_MSG_EQ (retval, true, "an 802.11ax SU duration failed");
550 
551  //802.11ax MU durations
552  retval = retval
553  && CheckHeMuTxDuration (std::list<uint32_t> {1536,
554  1536},
555  std::list<HeMuUserInfo> { {{true, HeRu::RU_242_TONE, 1}, WifiPhy::GetHeMcs0 (), 1},
556  {{true, HeRu::RU_242_TONE, 2}, WifiPhy::GetHeMcs0 (), 1} },
557  40, 800, NanoSeconds (1489600)) //equivalent to HE_SU for 20 MHz with extra HE-SIG-B (i.e. 4 us)
558  && CheckHeMuTxDuration (std::list<uint32_t> {1536,
559  1536},
560  std::list<HeMuUserInfo> { {{true, HeRu::RU_242_TONE, 1}, WifiPhy::GetHeMcs1 (), 1},
561  {{true, HeRu::RU_242_TONE, 2}, WifiPhy::GetHeMcs0 (), 1} },
562  40, 800, NanoSeconds (1489600)) //shouldn't change if first PSDU is shorter
563  && CheckHeMuTxDuration (std::list<uint32_t> {1536,
564  76},
565  std::list<HeMuUserInfo> { {{true, HeRu::RU_242_TONE, 1}, WifiPhy::GetHeMcs0 (), 1},
566  {{true, HeRu::RU_242_TONE, 2}, WifiPhy::GetHeMcs0 (), 1} },
567  40, 800, NanoSeconds (1489600));
568 
569  NS_TEST_EXPECT_MSG_EQ (retval, true, "an 802.11ax MU duration failed");
570 
571  Simulator::Destroy ();
572 }
573 
581 {
582 public:
584 };
585 
587  : TestSuite ("wifi-devices-tx-duration", UNIT)
588 {
589  AddTestCase (new TxDurationTest, TestCase::QUICK);
590 }
591 
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
RuType ruType
RU type.
Definition: he-ru.h:67
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
static TxDurationTestSuite g_txDurationTestSuite
the test suite
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Definition: wifi-ppdu.h:33
A suite of tests to run.
Definition: test.h:1343
#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
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
void SetStbc(bool stbc)
Sets if STBC is being used.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
Definition: test.h:283
VHT PHY (Clause 22)
Definition: wifi-mode.h:62
The 5 GHz band.
Definition: wifi-phy-band.h:35
encapsulates test code
Definition: test.h:1153
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.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:99
virtual void DoRun(void)
Implementation to actually run this TestCase.
static Time CalculateTxDurationUsingList(std::list< uint32_t > sizes, std::list< uint16_t > staIds, WifiTxVector txVector, WifiPhyBand band)
Calculate the overall Tx duration returned by WifiPhy for list of sizes.
phy
Definition: third.py:93
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...
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition: wifi-preamble.h:32
virtual ~TxDurationTest()
bool CheckTxDuration(uint32_t size, WifiMode payloadMode, uint16_t channelWidth, uint16_t guardInterval, WifiPreamble preamble, Time knownDuration)
Check if the overall tx duration returned by InterferenceHelper corresponds to a known value of the p...
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:299
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1313
void SetGuardInterval(uint16_t guardInterval)
Sets the guard interval duration (in nanoseconds)
HT PHY (Clause 20)
Definition: wifi-mode.h:60
WifiModulationClass GetModulationClass() const
Definition: wifi-mode.cc:480
void SetHeMuUserInfo(uint16_t staId, HeMuUserInfo userInfo)
Set the HE MU user-specific transmission information for the given STA-ID.
void SetNss(uint8_t nss)
Sets the number of Nss.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
HeRu::RuSpec ru
RU specification.
The 2.4 GHz band.
Definition: wifi-phy-band.h:33
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:30
void SetType(WifiMacType type, bool resetToDsFromDs=true)
Set Type/Subtype values with the correct values depending on the given type.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition: abort.h:108
OFDM PHY (Clause 17)
Definition: wifi-mode.h:58
uint32_t GetSerializedSize(void) const
Tx Duration Test Suite.
void SetNess(uint8_t ness)
Sets the Ness number.
static bool CheckHeMuTxDuration(std::list< uint32_t > sizes, std::list< HeMuUserInfo > userInfos, uint16_t channelWidth, uint16_t guardInterval, Time knownDuration)
Check if the overall Tx duration returned by WifiPhy for a HE MU PPDU corresponds to a known value...
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1305
Tx Duration Test.
HE MU specific user transmission parameters.
#define SU_STA_ID
Definition: wifi-mode.h:30
HE PHY (Clause 26)
Definition: wifi-mode.h:64
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
Definition: wifi-mode.cc:127
Implements the IEEE 802.11 MAC header.
bool CheckPayloadDuration(uint32_t size, WifiMode payloadMode, uint16_t channelWidth, uint16_t guardInterval, WifiPreamble preamble, Time knownDuration)
Check if the payload tx duration returned by InterferenceHelper corresponds to a known value of the p...