22 #include <gsl/gsl_cdf.h>
23 #include <gsl/gsl_integration.h>
24 #include <gsl/gsl_math.h>
25 #include <gsl/gsl_sf_bessel.h>
28 #include "ns3/dsss-error-rate-model.h"
29 #include "ns3/he-phy.h"
30 #include "ns3/interference-helper.h"
32 #include "ns3/nist-error-rate-model.h"
33 #include "ns3/table-based-error-rate-model.h"
35 #include "ns3/wifi-phy.h"
36 #include "ns3/wifi-utils.h"
37 #include "ns3/yans-error-rate-model.h"
48 double noisePowerDbw = -100.5522786 + 7;
50 double sinrDb = rssDbw - noisePowerDbw;
52 return pow(10.0, sinrDb / 10.0);
68 void DoRun()
override;
72 :
TestCase(
"WifiErrorRateModel test case DSSS")
84 uint64_t size = (1024 + 40 + 14) * 8;
89 value = DsssErrorRateModel::GetDsssDbpskSuccessRate(
FromRss(-105.0), size);
91 value = DsssErrorRateModel::GetDsssDbpskSuccessRate(
FromRss(-100.0), size);
93 value = DsssErrorRateModel::GetDsssDbpskSuccessRate(
FromRss(-99.0), size);
95 value = DsssErrorRateModel::GetDsssDbpskSuccessRate(
FromRss(-98.0), size);
97 value = DsssErrorRateModel::GetDsssDbpskSuccessRate(
FromRss(-97.0), size);
99 value = DsssErrorRateModel::GetDsssDbpskSuccessRate(
FromRss(-96.0), size);
101 value = DsssErrorRateModel::GetDsssDbpskSuccessRate(
FromRss(-95.0), size);
103 value = DsssErrorRateModel::GetDsssDbpskSuccessRate(
FromRss(-90.0), size);
108 value = DsssErrorRateModel::GetDsssDqpskSuccessRate(
FromRss(-96.0), size);
110 value = DsssErrorRateModel::GetDsssDqpskSuccessRate(
FromRss(-95.0), size);
112 value = DsssErrorRateModel::GetDsssDqpskSuccessRate(
FromRss(-94.0), size);
114 value = DsssErrorRateModel::GetDsssDqpskSuccessRate(
FromRss(-93.0), size);
116 value = DsssErrorRateModel::GetDsssDqpskSuccessRate(
FromRss(-92.0), size);
118 value = DsssErrorRateModel::GetDsssDqpskSuccessRate(
FromRss(-91.0), size);
120 value = DsssErrorRateModel::GetDsssDqpskSuccessRate(
FromRss(-90.0), size);
122 value = DsssErrorRateModel::GetDsssDqpskSuccessRate(
FromRss(-89.0), size);
127 value = DsssErrorRateModel::GetDsssDqpskCck5_5SuccessRate(
FromRss(-94.0), size);
129 value = DsssErrorRateModel::GetDsssDqpskCck5_5SuccessRate(
FromRss(-93.0), size);
131 value = DsssErrorRateModel::GetDsssDqpskCck5_5SuccessRate(
FromRss(-92.0), size);
133 value = DsssErrorRateModel::GetDsssDqpskCck5_5SuccessRate(
FromRss(-91.0), size);
135 value = DsssErrorRateModel::GetDsssDqpskCck5_5SuccessRate(
FromRss(-90.0), size);
137 value = DsssErrorRateModel::GetDsssDqpskCck5_5SuccessRate(
FromRss(-89.0), size);
139 value = DsssErrorRateModel::GetDsssDqpskCck5_5SuccessRate(
FromRss(-88.0), size);
141 value = DsssErrorRateModel::GetDsssDqpskCck5_5SuccessRate(
FromRss(-87.0), size);
145 value = DsssErrorRateModel::GetDsssDqpskCck11SuccessRate(
FromRss(-91.0), size);
147 value = DsssErrorRateModel::GetDsssDqpskCck11SuccessRate(
FromRss(-90.0), size);
149 value = DsssErrorRateModel::GetDsssDqpskCck11SuccessRate(
FromRss(-89.0), size);
151 value = DsssErrorRateModel::GetDsssDqpskCck11SuccessRate(
FromRss(-88.0), size);
153 value = DsssErrorRateModel::GetDsssDqpskCck11SuccessRate(
FromRss(-87.0), size);
155 value = DsssErrorRateModel::GetDsssDqpskCck11SuccessRate(
FromRss(-86.0), size);
157 value = DsssErrorRateModel::GetDsssDqpskCck11SuccessRate(
FromRss(-85.0), size);
159 value = DsssErrorRateModel::GetDsssDqpskCck11SuccessRate(
FromRss(-84.0), size);
177 void DoRun()
override;
181 :
TestCase(
"WifiErrorRateModel test case NIST")
192 uint32_t frameSize = 2000;
202 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate6Mbps"),
204 std::pow(10.0, snr / 10.0),
208 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate6Mbps"),
210 std::pow(10.0, snr / 10.0),
214 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate6Mbps"),
216 std::pow(10.0, snr / 10.0),
220 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate6Mbps"),
222 std::pow(10.0, snr / 10.0),
227 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate9Mbps"),
229 std::pow(10.0, snr / 10.0),
233 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate9Mbps"),
235 std::pow(10.0, snr / 10.0),
239 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate9Mbps"),
241 std::pow(10.0, snr / 10.0),
245 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate9Mbps"),
247 std::pow(10.0, snr / 10.0),
252 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate12Mbps"),
254 std::pow(10.0, snr / 10.0),
258 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate12Mbps"),
260 std::pow(10.0, snr / 10.0),
264 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate12Mbps"),
266 std::pow(10.0, snr / 10.0),
270 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate12Mbps"),
272 std::pow(10.0, snr / 10.0),
277 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate18Mbps"),
279 std::pow(10.0, snr / 10.0),
283 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate18Mbps"),
285 std::pow(10.0, snr / 10.0),
289 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate18Mbps"),
291 std::pow(10.0, snr / 10.0),
295 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate18Mbps"),
297 std::pow(10.0, snr / 10.0),
302 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate24Mbps"),
304 std::pow(10.0, snr / 10.0),
308 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate24Mbps"),
310 std::pow(10.0, snr / 10.0),
314 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate24Mbps"),
316 std::pow(10.0, snr / 10.0),
320 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate24Mbps"),
322 std::pow(10.0, snr / 10.0),
327 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate36Mbps"),
329 std::pow(10.0, snr / 10.0),
333 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate36Mbps"),
335 std::pow(10.0, snr / 10.0),
339 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate36Mbps"),
341 std::pow(10.0, snr / 10.0),
345 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate36Mbps"),
347 std::pow(10.0, snr / 10.0),
352 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate48Mbps"),
354 std::pow(10.0, snr / 10.0),
358 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate48Mbps"),
360 std::pow(10.0, snr / 10.0),
364 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate48Mbps"),
366 std::pow(10.0, snr / 10.0),
370 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate48Mbps"),
372 std::pow(10.0, snr / 10.0),
377 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate54Mbps"),
379 std::pow(10.0, snr / 10.0),
383 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate54Mbps"),
385 std::pow(10.0, snr / 10.0),
389 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate54Mbps"),
391 std::pow(10.0, snr / 10.0),
395 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate54Mbps"),
397 std::pow(10.0, snr / 10.0),
405 using InterferenceHelper::CalculatePayloadChunkSuccessRate;
406 using InterferenceHelper::CalculateSnr;
407 using InterferenceHelper::InterferenceHelper;
423 void DoRun()
override;
427 :
TestCase(
"WifiErrorRateModel test case MIMO")
454 double initialSnr = 4.0;
462 "Attempt to set initial SNR to known value failed");
468 "CSR not within tolerance for SISO");
469 double sisoChunkSuccess = chunkSuccess;
481 "SNR not within tolerance for 2x1:2 MIMO");
486 "CSR not within tolerance for SISO");
500 "SNR not within tolerance for 1x2:1 MIMO");
504 "CSR not within tolerance for 1x2:1 MIMO");
518 "SNR not equal within tolerance for 2x2:1 MIMO");
522 "CSR not within tolerance for 2x2:1 MIMO");
535 "SNR not equal within tolerance for 2x2:2 MIMO");
540 "CSR not within tolerance for 2x2:2 MIMO");
554 "SNR not within tolerance for 3x3:1 MIMO");
558 "CSR not within tolerance for 3x3:1 MIMO");
572 "SNR not within tolerance for 3x3:2 MIMO");
576 "CSR not within tolerance for 3x3:2 MIMO");
589 "SNR not within tolerance for 3x3:3 MIMO");
594 "CSR not equal within tolerance for 3x3:3 MIMO");
608 "SNR not within tolerance for 4x4:1 MIMO");
612 "CSR not within tolerance for 4x4:1 MIMO");
626 "SNR not within tolerance for 4x4:2 MIMO");
630 "CSR not within tolerance for 4x4:2 MIMO");
644 "SNR not within tolerance for 4x4:3 MIMO");
648 "CSR not within tolerance for 4x4:1 MIMO");
661 "SNR not within tolerance for 4x4:4 MIMO");
666 "CSR not within tolerance for 4x4:4 MIMO");
673 std::map<std::pair<uint8_t , uint32_t >,
674 std::map<
double ,
double >>
677 {std::make_pair(0, 1458),
679 {-4.00, 1.00000}, {-3.75, 1.00000}, {-3.50, 1.00000}, {-3.25, 1.00000},
680 {-3.00, 1.00000}, {-2.75, 1.00000}, {-2.50, 1.00000}, {-2.25, 1.00000},
681 {-2.00, 1.00000}, {-1.75, 1.00000}, {-1.50, 1.00000}, {-1.25, 1.00000},
682 {-1.00, 1.00000}, {-0.75, 0.99700}, {-0.50, 0.99400}, {-0.25, 0.90625},
683 {0.00, 0.81850}, {0.25, 0.55465}, {0.50, 0.29080}, {0.75, 0.17855},
684 {1.00, 0.06630}, {1.25, 0.03875}, {1.50, 0.01120}, {1.75, 0.00635},
685 {2.00, 0.00150}, {2.25, 0.00083}, {2.50, 0.00015}, {2.75, 0.00008},
686 {3.00, 0.00001}, {3.25, 0.00000}, {3.50, 0.00000}, {3.75, 0.00000},
687 {4.00, 0.00000}, {4.25, 0.00000}, {4.50, 0.00000}, {4.75, 0.00000},
688 {5.00, 0.00000}, {5.25, 0.00000}, {5.50, 0.00000}, {5.75, 0.00000},
689 {6.00, 0.00000}, {6.25, 0.00000}, {6.50, 0.00000}, {6.75, 0.00000},
690 {7.00, 0.00000}, {7.25, 0.00000}, {7.50, 0.00000}, {7.75, 0.00000},
691 {8.00, 0.00000}, {8.25, 0.00000}, {8.50, 0.00000}, {8.75, 0.00000},
692 {9.00, 0.00000}, {9.25, 0.00000}, {9.50, 0.00000}, {9.75, 0.00000},
693 {10.00, 0.00000}, {10.25, 0.00000}, {10.50, 0.00000}, {10.75, 0.00000},
694 {11.00, 0.00000}, {11.25, 0.00000}, {11.50, 0.00000}, {11.75, 0.00000},
695 {12.00, 0.00000}, {12.25, 0.00000}, {12.50, 0.00000}, {12.75, 0.00000},
696 {13.00, 0.00000}, {13.25, 0.00000}, {13.50, 0.00000}, {13.75, 0.00000},
697 {14.00, 0.00000}, {14.25, 0.00000}, {14.50, 0.00000}, {14.75, 0.00000},
698 {15.00, 0.00000}, {15.25, 0.00000}, {15.50, 0.00000}, {15.75, 0.00000},
699 {16.00, 0.00000}, {16.25, 0.00000}, {16.50, 0.00000}, {16.75, 0.00000},
700 {17.00, 0.00000}, {17.25, 0.00000}, {17.50, 0.00000}, {17.75, 0.00000},
701 {18.00, 0.00000}, {18.25, 0.00000}, {18.50, 0.00000}, {18.75, 0.00000},
702 {19.00, 0.00000}, {19.25, 0.00000}, {19.50, 0.00000}, {19.75, 0.00000},
703 {20.00, 0.00000}, {20.25, 0.00000}, {20.50, 0.00000}, {20.75, 0.00000},
704 {21.00, 0.00000}, {21.25, 0.00000}, {21.50, 0.00000}, {21.75, 0.00000},
705 {22.00, 0.00000}, {22.25, 0.00000}, {22.50, 0.00000}, {22.75, 0.00000},
706 {23.00, 0.00000}, {23.25, 0.00000}, {23.50, 0.00000}, {23.75, 0.00000},
707 {24.00, 0.00000}, {24.25, 0.00000}, {24.50, 0.00000}, {24.75, 0.00000},
708 {25.00, 0.00000}, {25.25, 0.00000}, {25.50, 0.00000}, {25.75, 0.00000},
709 {26.00, 0.00000}, {26.25, 0.00000}, {26.50, 0.00000}, {26.75, 0.00000},
710 {27.00, 0.00000}, {27.25, 0.00000}, {27.50, 0.00000}, {27.75, 0.00000},
711 {28.00, 0.00000}, {28.25, 0.00000}, {28.50, 0.00000}, {28.75, 0.00000},
712 {29.00, 0.00000}, {29.25, 0.00000}, {29.50, 0.00000}, {29.75, 0.00000},
716 {std::make_pair(0, 32),
718 {-4.00, 1.00000}, {-3.75, 1.00000}, {-3.50, 1.00000}, {-3.25, 0.99750},
719 {-3.00, 0.99500}, {-2.75, 0.96790}, {-2.50, 0.94080}, {-2.25, 0.88335},
720 {-2.00, 0.82590}, {-1.75, 0.70770}, {-1.50, 0.58950}, {-1.25, 0.44890},
721 {-1.00, 0.30830}, {-0.75, 0.21685}, {-0.50, 0.12540}, {-0.25, 0.07990},
722 {0.00, 0.03440}, {0.25, 0.02145}, {0.50, 0.00850}, {0.75, 0.00500},
723 {1.00, 0.00150}, {1.25, 0.00087}, {1.50, 0.00024}, {1.75, 0.00017},
724 {2.00, 0.00009}, {2.25, 0.00005}, {2.50, 0.00000}, {2.75, 0.00000},
725 {3.00, 0.00000}, {3.25, 0.00000}, {3.50, 0.00000}, {3.75, 0.00000},
726 {4.00, 0.00000}, {4.25, 0.00000}, {4.50, 0.00000}, {4.75, 0.00000},
727 {5.00, 0.00000}, {5.25, 0.00000}, {5.50, 0.00000}, {5.75, 0.00000},
728 {6.00, 0.00000}, {6.25, 0.00000}, {6.50, 0.00000}, {6.75, 0.00000},
729 {7.00, 0.00000}, {7.25, 0.00000}, {7.50, 0.00000}, {7.75, 0.00000},
730 {8.00, 0.00000}, {8.25, 0.00000}, {8.50, 0.00000}, {8.75, 0.00000},
731 {9.00, 0.00000}, {9.25, 0.00000}, {9.50, 0.00000}, {9.75, 0.00000},
732 {10.00, 0.00000}, {10.25, 0.00000}, {10.50, 0.00000}, {10.75, 0.00000},
733 {11.00, 0.00000}, {11.25, 0.00000}, {11.50, 0.00000}, {11.75, 0.00000},
734 {12.00, 0.00000}, {12.25, 0.00000}, {12.50, 0.00000}, {12.75, 0.00000},
735 {13.00, 0.00000}, {13.25, 0.00000}, {13.50, 0.00000}, {13.75, 0.00000},
736 {14.00, 0.00000}, {14.25, 0.00000}, {14.50, 0.00000}, {14.75, 0.00000},
737 {15.00, 0.00000}, {15.25, 0.00000}, {15.50, 0.00000}, {15.75, 0.00000},
738 {16.00, 0.00000}, {16.25, 0.00000}, {16.50, 0.00000}, {16.75, 0.00000},
739 {17.00, 0.00000}, {17.25, 0.00000}, {17.50, 0.00000}, {17.75, 0.00000},
740 {18.00, 0.00000}, {18.25, 0.00000}, {18.50, 0.00000}, {18.75, 0.00000},
741 {19.00, 0.00000}, {19.25, 0.00000}, {19.50, 0.00000}, {19.75, 0.00000},
742 {20.00, 0.00000}, {20.25, 0.00000}, {20.50, 0.00000}, {20.75, 0.00000},
743 {21.00, 0.00000}, {21.25, 0.00000}, {21.50, 0.00000}, {21.75, 0.00000},
744 {22.00, 0.00000}, {22.25, 0.00000}, {22.50, 0.00000}, {22.75, 0.00000},
745 {23.00, 0.00000}, {23.25, 0.00000}, {23.50, 0.00000}, {23.75, 0.00000},
746 {24.00, 0.00000}, {24.25, 0.00000}, {24.50, 0.00000}, {24.75, 0.00000},
747 {25.00, 0.00000}, {25.25, 0.00000}, {25.50, 0.00000}, {25.75, 0.00000},
748 {26.00, 0.00000}, {26.25, 0.00000}, {26.50, 0.00000}, {26.75, 0.00000},
749 {27.00, 0.00000}, {27.25, 0.00000}, {27.50, 0.00000}, {27.75, 0.00000},
750 {28.00, 0.00000}, {28.25, 0.00000}, {28.50, 0.00000}, {28.75, 0.00000},
751 {29.00, 0.00000}, {29.25, 0.00000}, {29.50, 0.00000}, {29.75, 0.00000},
755 {std::make_pair(0, 1000),
757 {-4.00, 1.00000}, {-3.75, 1.00000}, {-3.50, 1.00000}, {-3.25, 1.00000},
758 {-3.00, 1.00000}, {-2.75, 1.00000}, {-2.50, 1.00000}, {-2.25, 1.00000},
759 {-2.00, 1.00000}, {-1.75, 1.00000}, {-1.50, 1.00000}, {-1.25, 1.00000},
760 {-1.00, 1.00000}, {-0.75, 0.98140}, {-0.50, 0.97007}, {-0.25, 0.80280},
761 {0.00, 0.68977}, {0.25, 0.42581}, {0.50, 0.20997}, {0.75, 0.12620},
762 {1.00, 0.04596}, {1.25, 0.02674}, {1.50, 0.00770}, {1.75, 0.00436},
763 {2.00, 0.00103}, {2.25, 0.00057}, {2.50, 0.00010}, {2.75, 0.00005},
764 {3.00, 0.00001}, {3.25, 0.00000}, {3.50, 0.00000}, {3.75, 0.00000},
765 {4.00, 0.00000}, {4.25, 0.00000}, {4.50, 0.00000}, {4.75, 0.00000},
766 {5.00, 0.00000}, {5.25, 0.00000}, {5.50, 0.00000}, {5.75, 0.00000},
767 {6.00, 0.00000}, {6.25, 0.00000}, {6.50, 0.00000}, {6.75, 0.00000},
768 {7.00, 0.00000}, {7.25, 0.00000}, {7.50, 0.00000}, {7.75, 0.00000},
769 {8.00, 0.00000}, {8.25, 0.00000}, {8.50, 0.00000}, {8.75, 0.00000},
770 {9.00, 0.00000}, {9.25, 0.00000}, {9.50, 0.00000}, {9.75, 0.00000},
771 {10.00, 0.00000}, {10.25, 0.00000}, {10.50, 0.00000}, {10.75, 0.00000},
772 {11.00, 0.00000}, {11.25, 0.00000}, {11.50, 0.00000}, {11.75, 0.00000},
773 {12.00, 0.00000}, {12.25, 0.00000}, {12.50, 0.00000}, {12.75, 0.00000},
774 {13.00, 0.00000}, {13.25, 0.00000}, {13.50, 0.00000}, {13.75, 0.00000},
775 {14.00, 0.00000}, {14.25, 0.00000}, {14.50, 0.00000}, {14.75, 0.00000},
776 {15.00, 0.00000}, {15.25, 0.00000}, {15.50, 0.00000}, {15.75, 0.00000},
777 {16.00, 0.00000}, {16.25, 0.00000}, {16.50, 0.00000}, {16.75, 0.00000},
778 {17.00, 0.00000}, {17.25, 0.00000}, {17.50, 0.00000}, {17.75, 0.00000},
779 {18.00, 0.00000}, {18.25, 0.00000}, {18.50, 0.00000}, {18.75, 0.00000},
780 {19.00, 0.00000}, {19.25, 0.00000}, {19.50, 0.00000}, {19.75, 0.00000},
781 {20.00, 0.00000}, {20.25, 0.00000}, {20.50, 0.00000}, {20.75, 0.00000},
782 {21.00, 0.00000}, {21.25, 0.00000}, {21.50, 0.00000}, {21.75, 0.00000},
783 {22.00, 0.00000}, {22.25, 0.00000}, {22.50, 0.00000}, {22.75, 0.00000},
784 {23.00, 0.00000}, {23.25, 0.00000}, {23.50, 0.00000}, {23.75, 0.00000},
785 {24.00, 0.00000}, {24.25, 0.00000}, {24.50, 0.00000}, {24.75, 0.00000},
786 {25.00, 0.00000}, {25.25, 0.00000}, {25.50, 0.00000}, {25.75, 0.00000},
787 {26.00, 0.00000}, {26.25, 0.00000}, {26.50, 0.00000}, {26.75, 0.00000},
788 {27.00, 0.00000}, {27.25, 0.00000}, {27.50, 0.00000}, {27.75, 0.00000},
789 {28.00, 0.00000}, {28.25, 0.00000}, {28.50, 0.00000}, {28.75, 0.00000},
790 {29.00, 0.00000}, {29.25, 0.00000}, {29.50, 0.00000}, {29.75, 0.00000},
794 {std::make_pair(0, 1),
796 {-4.00, 1.00000}, {-3.75, 1.00000}, {-3.50, 1.00000}, {-3.25, 0.17075},
797 {-3.00, 0.15260}, {-2.75, 0.10190}, {-2.50, 0.08455}, {-2.25, 0.06494},
798 {-2.00, 0.05316}, {-1.75, 0.03771}, {-1.50, 0.02744}, {-1.25, 0.01845},
799 {-1.00, 0.01145}, {-0.75, 0.00761}, {-0.50, 0.00418}, {-0.25, 0.00260},
800 {0.00, 0.00110}, {0.25, 0.00068}, {0.50, 0.00027}, {0.75, 0.00016},
801 {1.00, 0.00005}, {1.25, 0.00003}, {1.50, 0.00000}, {1.75, 0.00000},
802 {2.00, 0.00000}, {2.25, 0.00000}, {2.50, 0.00000}, {2.75, 0.00000},
803 {3.00, 0.00000}, {3.25, 0.00000}, {3.50, 0.00000}, {3.75, 0.00000},
804 {4.00, 0.00000}, {4.25, 0.00000}, {4.50, 0.00000}, {4.75, 0.00000},
805 {5.00, 0.00000}, {5.25, 0.00000}, {5.50, 0.00000}, {5.75, 0.00000},
806 {6.00, 0.00000}, {6.25, 0.00000}, {6.50, 0.00000}, {6.75, 0.00000},
807 {7.00, 0.00000}, {7.25, 0.00000}, {7.50, 0.00000}, {7.75, 0.00000},
808 {8.00, 0.00000}, {8.25, 0.00000}, {8.50, 0.00000}, {8.75, 0.00000},
809 {9.00, 0.00000}, {9.25, 0.00000}, {9.50, 0.00000}, {9.75, 0.00000},
810 {10.00, 0.00000}, {10.25, 0.00000}, {10.50, 0.00000}, {10.75, 0.00000},
811 {11.00, 0.00000}, {11.25, 0.00000}, {11.50, 0.00000}, {11.75, 0.00000},
812 {12.00, 0.00000}, {12.25, 0.00000}, {12.50, 0.00000}, {12.75, 0.00000},
813 {13.00, 0.00000}, {13.25, 0.00000}, {13.50, 0.00000}, {13.75, 0.00000},
814 {14.00, 0.00000}, {14.25, 0.00000}, {14.50, 0.00000}, {14.75, 0.00000},
815 {15.00, 0.00000}, {15.25, 0.00000}, {15.50, 0.00000}, {15.75, 0.00000},
816 {16.00, 0.00000}, {16.25, 0.00000}, {16.50, 0.00000}, {16.75, 0.00000},
817 {17.00, 0.00000}, {17.25, 0.00000}, {17.50, 0.00000}, {17.75, 0.00000},
818 {18.00, 0.00000}, {18.25, 0.00000}, {18.50, 0.00000}, {18.75, 0.00000},
819 {19.00, 0.00000}, {19.25, 0.00000}, {19.50, 0.00000}, {19.75, 0.00000},
820 {20.00, 0.00000}, {20.25, 0.00000}, {20.50, 0.00000}, {20.75, 0.00000},
821 {21.00, 0.00000}, {21.25, 0.00000}, {21.50, 0.00000}, {21.75, 0.00000},
822 {22.00, 0.00000}, {22.25, 0.00000}, {22.50, 0.00000}, {22.75, 0.00000},
823 {23.00, 0.00000}, {23.25, 0.00000}, {23.50, 0.00000}, {23.75, 0.00000},
824 {24.00, 0.00000}, {24.25, 0.00000}, {24.50, 0.00000}, {24.75, 0.00000},
825 {25.00, 0.00000}, {25.25, 0.00000}, {25.50, 0.00000}, {25.75, 0.00000},
826 {26.00, 0.00000}, {26.25, 0.00000}, {26.50, 0.00000}, {26.75, 0.00000},
827 {27.00, 0.00000}, {27.25, 0.00000}, {27.50, 0.00000}, {27.75, 0.00000},
828 {28.00, 0.00000}, {28.25, 0.00000}, {28.50, 0.00000}, {28.75, 0.00000},
829 {29.00, 0.00000}, {29.25, 0.00000}, {29.50, 0.00000}, {29.75, 0.00000},
833 {std::make_pair(0, 2000),
835 {-4.00, 1.00000}, {-3.75, 1.00000}, {-3.50, 1.00000}, {-3.25, 1.00000},
836 {-3.00, 1.00000}, {-2.75, 1.00000}, {-2.50, 1.00000}, {-2.25, 1.00000},
837 {-2.00, 1.00000}, {-1.75, 1.00000}, {-1.50, 1.00000}, {-1.25, 1.00000},
838 {-1.00, 1.00000}, {-0.75, 0.99965}, {-0.50, 0.99910}, {-0.25, 0.96111},
839 {0.00, 0.90376}, {0.25, 0.67031}, {0.50, 0.37584}, {0.75, 0.23647},
840 {1.00, 0.08981}, {1.25, 0.05277}, {1.50, 0.01533}, {1.75, 0.00870},
841 {2.00, 0.00206}, {2.25, 0.00113}, {2.50, 0.00021}, {2.75, 0.00011},
842 {3.00, 0.00001}, {3.25, 0.00000}, {3.50, 0.00000}, {3.75, 0.00000},
843 {4.00, 0.00000}, {4.25, 0.00000}, {4.50, 0.00000}, {4.75, 0.00000},
844 {5.00, 0.00000}, {5.25, 0.00000}, {5.50, 0.00000}, {5.75, 0.00000},
845 {6.00, 0.00000}, {6.25, 0.00000}, {6.50, 0.00000}, {6.75, 0.00000},
846 {7.00, 0.00000}, {7.25, 0.00000}, {7.50, 0.00000}, {7.75, 0.00000},
847 {8.00, 0.00000}, {8.25, 0.00000}, {8.50, 0.00000}, {8.75, 0.00000},
848 {9.00, 0.00000}, {9.25, 0.00000}, {9.50, 0.00000}, {9.75, 0.00000},
849 {10.00, 0.00000}, {10.25, 0.00000}, {10.50, 0.00000}, {10.75, 0.00000},
850 {11.00, 0.00000}, {11.25, 0.00000}, {11.50, 0.00000}, {11.75, 0.00000},
851 {12.00, 0.00000}, {12.25, 0.00000}, {12.50, 0.00000}, {12.75, 0.00000},
852 {13.00, 0.00000}, {13.25, 0.00000}, {13.50, 0.00000}, {13.75, 0.00000},
853 {14.00, 0.00000}, {14.25, 0.00000}, {14.50, 0.00000}, {14.75, 0.00000},
854 {15.00, 0.00000}, {15.25, 0.00000}, {15.50, 0.00000}, {15.75, 0.00000},
855 {16.00, 0.00000}, {16.25, 0.00000}, {16.50, 0.00000}, {16.75, 0.00000},
856 {17.00, 0.00000}, {17.25, 0.00000}, {17.50, 0.00000}, {17.75, 0.00000},
857 {18.00, 0.00000}, {18.25, 0.00000}, {18.50, 0.00000}, {18.75, 0.00000},
858 {19.00, 0.00000}, {19.25, 0.00000}, {19.50, 0.00000}, {19.75, 0.00000},
859 {20.00, 0.00000}, {20.25, 0.00000}, {20.50, 0.00000}, {20.75, 0.00000},
860 {21.00, 0.00000}, {21.25, 0.00000}, {21.50, 0.00000}, {21.75, 0.00000},
861 {22.00, 0.00000}, {22.25, 0.00000}, {22.50, 0.00000}, {22.75, 0.00000},
862 {23.00, 0.00000}, {23.25, 0.00000}, {23.50, 0.00000}, {23.75, 0.00000},
863 {24.00, 0.00000}, {24.25, 0.00000}, {24.50, 0.00000}, {24.75, 0.00000},
864 {25.00, 0.00000}, {25.25, 0.00000}, {25.50, 0.00000}, {25.75, 0.00000},
865 {26.00, 0.00000}, {26.25, 0.00000}, {26.50, 0.00000}, {26.75, 0.00000},
866 {27.00, 0.00000}, {27.25, 0.00000}, {27.50, 0.00000}, {27.75, 0.00000},
867 {28.00, 0.00000}, {28.25, 0.00000}, {28.50, 0.00000}, {28.75, 0.00000},
868 {29.00, 0.00000}, {29.25, 0.00000}, {29.50, 0.00000}, {29.75, 0.00000},
872 {std::make_pair(7, 1500),
874 {-4.00, 1.00000}, {-3.75, 1.00000}, {-3.50, 1.00000}, {-3.25, 1.00000},
875 {-3.00, 1.00000}, {-2.75, 1.00000}, {-2.50, 1.00000}, {-2.25, 1.00000},
876 {-2.00, 1.00000}, {-1.75, 1.00000}, {-1.50, 1.00000}, {-1.25, 1.00000},
877 {-1.00, 1.00000}, {-0.75, 1.00000}, {-0.50, 1.00000}, {-0.25, 1.00000},
878 {0.00, 1.00000}, {0.25, 1.00000}, {0.50, 1.00000}, {0.75, 1.00000},
879 {1.00, 1.00000}, {1.25, 1.00000}, {1.50, 1.00000}, {1.75, 1.00000},
880 {2.00, 1.00000}, {2.25, 1.00000}, {2.50, 1.00000}, {2.75, 1.00000},
881 {3.00, 1.00000}, {3.25, 1.00000}, {3.50, 1.00000}, {3.75, 1.00000},
882 {4.00, 1.00000}, {4.25, 1.00000}, {4.50, 1.00000}, {4.75, 1.00000},
883 {5.00, 1.00000}, {5.25, 1.00000}, {5.50, 1.00000}, {5.75, 1.00000},
884 {6.00, 1.00000}, {6.25, 1.00000}, {6.50, 1.00000}, {6.75, 1.00000},
885 {7.00, 1.00000}, {7.25, 1.00000}, {7.50, 1.00000}, {7.75, 1.00000},
886 {8.00, 1.00000}, {8.25, 1.00000}, {8.50, 1.00000}, {8.75, 1.00000},
887 {9.00, 1.00000}, {9.25, 1.00000}, {9.50, 1.00000}, {9.75, 1.00000},
888 {10.00, 1.00000}, {10.25, 1.00000}, {10.50, 1.00000}, {10.75, 1.00000},
889 {11.00, 1.00000}, {11.25, 1.00000}, {11.50, 1.00000}, {11.75, 1.00000},
890 {12.00, 1.00000}, {12.25, 1.00000}, {12.50, 1.00000}, {12.75, 1.00000},
891 {13.00, 1.00000}, {13.25, 1.00000}, {13.50, 1.00000}, {13.75, 1.00000},
892 {14.00, 1.00000}, {14.25, 1.00000}, {14.50, 1.00000}, {14.75, 1.00000},
893 {15.00, 1.00000}, {15.25, 1.00000}, {15.50, 1.00000}, {15.75, 1.00000},
894 {16.00, 1.00000}, {16.25, 1.00000}, {16.50, 1.00000}, {16.75, 1.00000},
895 {17.00, 1.00000}, {17.25, 1.00000}, {17.50, 1.00000}, {17.75, 0.99057},
896 {18.00, 0.98075}, {18.25, 0.86664}, {18.50, 0.74920}, {18.75, 0.54857},
897 {19.00, 0.34531}, {19.25, 0.23624}, {19.50, 0.12672}, {19.75, 0.08164},
898 {20.00, 0.03650}, {20.25, 0.02340}, {20.50, 0.01029}, {20.75, 0.00653},
899 {21.00, 0.00278}, {21.25, 0.00165}, {21.50, 0.00051}, {21.75, 0.00030},
900 {22.00, 0.00009}, {22.25, 0.00005}, {22.50, 0.00001}, {22.75, 0.00000},
901 {23.00, 0.00000}, {23.25, 0.00000}, {23.50, 0.00000}, {23.75, 0.00000},
902 {24.00, 0.00000}, {24.25, 0.00000}, {24.50, 0.00000}, {24.75, 0.00000},
903 {25.00, 0.00000}, {25.25, 0.00000}, {25.50, 0.00000}, {25.75, 0.00000},
904 {26.00, 0.00000}, {26.25, 0.00000}, {26.50, 0.00000}, {26.75, 0.00000},
905 {27.00, 0.00000}, {27.25, 0.00000}, {27.50, 0.00000}, {27.75, 0.00000},
906 {28.00, 0.00000}, {28.25, 0.00000}, {28.50, 0.00000}, {28.75, 0.00000},
907 {29.00, 0.00000}, {29.25, 0.00000}, {29.50, 0.00000}, {29.75, 0.00000},
911 {std::make_pair(8, 1500),
913 {-4.00, 1.00000}, {-3.75, 1.00000}, {-3.50, 1.00000}, {-3.25, 1.00000},
914 {-3.00, 1.00000}, {-2.75, 1.00000}, {-2.50, 1.00000}, {-2.25, 1.00000},
915 {-2.00, 1.00000}, {-1.75, 1.00000}, {-1.50, 1.00000}, {-1.25, 1.00000},
916 {-1.00, 1.00000}, {-0.75, 1.00000}, {-0.50, 1.00000}, {-0.25, 1.00000},
917 {0.00, 1.00000}, {0.25, 1.00000}, {0.50, 1.00000}, {0.75, 1.00000},
918 {1.00, 1.00000}, {1.25, 1.00000}, {1.50, 1.00000}, {1.75, 1.00000},
919 {2.00, 1.00000}, {2.25, 1.00000}, {2.50, 1.00000}, {2.75, 1.00000},
920 {3.00, 1.00000}, {3.25, 1.00000}, {3.50, 1.00000}, {3.75, 1.00000},
921 {4.00, 1.00000}, {4.25, 1.00000}, {4.50, 1.00000}, {4.75, 1.00000},
922 {5.00, 1.00000}, {5.25, 1.00000}, {5.50, 1.00000}, {5.75, 1.00000},
923 {6.00, 1.00000}, {6.25, 1.00000}, {6.50, 1.00000}, {6.75, 1.00000},
924 {7.00, 1.00000}, {7.25, 1.00000}, {7.50, 1.00000}, {7.75, 1.00000},
925 {8.00, 1.00000}, {8.25, 1.00000}, {8.50, 1.00000}, {8.75, 1.00000},
926 {9.00, 1.00000}, {9.25, 1.00000}, {9.50, 1.00000}, {9.75, 1.00000},
927 {10.00, 1.00000}, {10.25, 1.00000}, {10.50, 1.00000}, {10.75, 1.00000},
928 {11.00, 1.00000}, {11.25, 1.00000}, {11.50, 1.00000}, {11.75, 1.00000},
929 {12.00, 1.00000}, {12.25, 1.00000}, {12.50, 1.00000}, {12.75, 1.00000},
930 {13.00, 1.00000}, {13.25, 1.00000}, {13.50, 1.00000}, {13.75, 1.00000},
931 {14.00, 1.00000}, {14.25, 1.00000}, {14.50, 1.00000}, {14.75, 1.00000},
932 {15.00, 1.00000}, {15.25, 1.00000}, {15.50, 1.00000}, {15.75, 1.00000},
933 {16.00, 1.00000}, {16.25, 1.00000}, {16.50, 1.00000}, {16.75, 1.00000},
934 {17.00, 1.00000}, {17.25, 1.00000}, {17.50, 1.00000}, {17.75, 1.00000},
935 {18.00, 1.00000}, {18.25, 1.00000}, {18.50, 1.00000}, {18.75, 1.00000},
936 {19.00, 1.00000}, {19.25, 1.00000}, {19.50, 1.00000}, {19.75, 1.00000},
937 {20.00, 1.00000}, {20.25, 1.00000}, {20.50, 1.00000}, {20.75, 1.00000},
938 {21.00, 1.00000}, {21.25, 0.99918}, {21.50, 0.99833}, {21.75, 0.97191},
939 {22.00, 0.94458}, {22.25, 0.81436}, {22.50, 0.68127}, {22.75, 0.52168},
940 {23.00, 0.36056}, {23.25, 0.25114}, {23.50, 0.14127}, {23.75, 0.09509},
941 {24.00, 0.04883}, {24.25, 0.03234}, {24.50, 0.01584}, {24.75, 0.01060},
942 {25.00, 0.00535}, {25.25, 0.00345}, {25.50, 0.00154}, {25.75, 0.00096},
943 {26.00, 0.00037}, {26.25, 0.00022}, {26.50, 0.00007}, {26.75, 0.00004},
944 {27.00, 0.00000}, {27.25, 0.00000}, {27.50, 0.00000}, {27.75, 0.00000},
945 {28.00, 0.00000}, {28.25, 0.00000}, {28.50, 0.00000}, {28.75, 0.00000},
946 {29.00, 0.00000}, {29.25, 0.00000}, {29.50, 0.00000}, {29.75, 0.00000},
971 void DoRun()
override;
982 m_testName(testName),
1004 for (
double snr = -4; snr <= 30; snr += 0.25)
1006 double expectedValue = 0;
1011 1 - yans->GetChunkSuccessRate(
m_mode, txVector, std::pow(10, snr / 10),
m_size * 8);
1018 auto itValue = it->second.find(snr);
1019 if (itValue != it->second.end())
1021 expectedValue = itValue->second;
1030 NS_FATAL_ERROR(
"No expected value found for the combination MCS "
1035 1 - table->GetChunkSuccessRate(
m_mode, txVector, std::pow(10, snr / 10),
m_size * 8);
1037 <<
" expectedPER=" << expectedValue);
1055 :
TestSuite(
"wifi-error-rate-models", UNIT)
1083 VhtPhy::GetVhtMcs0(),
1087 VhtPhy::GetVhtMcs0(),
1091 VhtPhy::GetVhtMcs0(),
1098 VhtPhy::GetVhtMcs0(),
1102 VhtPhy::GetVhtMcs8(),
1106 HePhy::GetHeMcs11(),
Wifi Table-based Error Rate Models Test Case.
void DoRun() override
Implementation to actually run this TestCase.
WifiMode m_mode
The WifiMode to test.
uint32_t m_size
The size (in bytes) to test.
TableBasedErrorRateTestCase(const std::string &testName, WifiMode mode, uint32_t size)
Constructor.
std::string m_testName
The name of the test to run.
~TableBasedErrorRateTestCase() override
Wifi Error Rate Models Test Case Dsss.
~WifiErrorRateModelsTestCaseDsss() override
void DoRun() override
Implementation to actually run this TestCase.
WifiErrorRateModelsTestCaseDsss()
Wifi Error Rate Models Test Case MIMO.
WifiErrorRateModelsTestCaseMimo()
void DoRun() override
Implementation to actually run this TestCase.
~WifiErrorRateModelsTestCaseMimo() override
Wifi Error Rate Models Test Case Nist.
void DoRun() override
Implementation to actually run this TestCase.
WifiErrorRateModelsTestCaseNist()
~WifiErrorRateModelsTestCaseNist() override
Wifi Error Rate Models Test Suite.
WifiErrorRateModelsTestSuite()
handles interference calculations
void SetNoiseFigure(double value)
Set the noise figure.
void SetErrorRateModel(const Ptr< ErrorRateModel > rate)
Set the error rate model for this interference helper.
double CalculatePayloadChunkSuccessRate(double snir, Time duration, const WifiTxVector &txVector, uint16_t staId=SU_STA_ID) const
Calculate the success rate of the payload chunk given the SINR, duration, and TXVECTOR.
double CalculateSnr(Ptr< Event > event, uint16_t channelWidth, uint8_t nss, const WifiSpectrumBandInfo &band) const
Calculate the SNIR for the event (starting from now until the event end).
void SetNumberOfReceiveAntennas(uint8_t rx)
Set the number of RX antennas in the receiver corresponding to this interference helper.
Smart pointer class similar to boost::intrusive_ptr.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Simulation virtual time values and global simulation resolution.
represent a single transmission mode
uint8_t GetMcsValue() const
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
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.
void SetNTx(uint8_t nTx)
Sets the number of TX antennas.
uint16_t GetChannelWidth() const
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
void SetNss(uint8_t nss)
Sets the number of Nss.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_TEST_ASSERT_MSG_GT(actual, limit, msg)
Test that an actual value is greater than a limit and report and abort if not.
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double RatioToDb(double ratio)
Convert from ratio to dB.
const uint8_t ERROR_TABLE_BCC_MAX_NUM_MCS
maximum number of MCSs for BCC
double DbToRatio(double dB)
Convert from dB to ratio.
std::map< std::pair< uint8_t, uint32_t >, std::map< double, double > > expectedTableValues
map of PER values that have been manually computed for a given MCS, size (in bytes) and SNR (in dB) i...
static double FromRss(double rssDbw)
static WifiErrorRateModelsTestSuite wifiErrorRateModelsTestSuite
the test suite