21#include "ns3/dsss-error-rate-model.h"
22#include "ns3/he-phy.h"
23#include "ns3/interference-helper.h"
25#include "ns3/nist-error-rate-model.h"
26#include "ns3/table-based-error-rate-model.h"
28#include "ns3/wifi-phy.h"
29#include "ns3/wifi-utils.h"
30#include "ns3/yans-error-rate-model.h"
41 double noisePowerDbw = -100.5522786 + 7;
43 double sinrDb = rssDbw - noisePowerDbw;
45 return pow(10.0, sinrDb / 10.0);
61 void DoRun()
override;
65 :
TestCase(
"WifiErrorRateModel test case DSSS")
77 uint64_t size = (1024 + 40 + 14) * 8;
82 value = DsssErrorRateModel::GetDsssDbpskSuccessRate(
FromRss(-105.0), size);
84 value = DsssErrorRateModel::GetDsssDbpskSuccessRate(
FromRss(-100.0), size);
86 value = DsssErrorRateModel::GetDsssDbpskSuccessRate(
FromRss(-99.0), size);
88 value = DsssErrorRateModel::GetDsssDbpskSuccessRate(
FromRss(-98.0), size);
90 value = DsssErrorRateModel::GetDsssDbpskSuccessRate(
FromRss(-97.0), size);
92 value = DsssErrorRateModel::GetDsssDbpskSuccessRate(
FromRss(-96.0), size);
94 value = DsssErrorRateModel::GetDsssDbpskSuccessRate(
FromRss(-95.0), size);
96 value = DsssErrorRateModel::GetDsssDbpskSuccessRate(
FromRss(-90.0), size);
101 value = DsssErrorRateModel::GetDsssDqpskSuccessRate(
FromRss(-96.0), size);
103 value = DsssErrorRateModel::GetDsssDqpskSuccessRate(
FromRss(-95.0), size);
105 value = DsssErrorRateModel::GetDsssDqpskSuccessRate(
FromRss(-94.0), size);
107 value = DsssErrorRateModel::GetDsssDqpskSuccessRate(
FromRss(-93.0), size);
109 value = DsssErrorRateModel::GetDsssDqpskSuccessRate(
FromRss(-92.0), size);
111 value = DsssErrorRateModel::GetDsssDqpskSuccessRate(
FromRss(-91.0), size);
113 value = DsssErrorRateModel::GetDsssDqpskSuccessRate(
FromRss(-90.0), size);
115 value = DsssErrorRateModel::GetDsssDqpskSuccessRate(
FromRss(-89.0), size);
120 value = DsssErrorRateModel::GetDsssDqpskCck5_5SuccessRate(
FromRss(-94.0), size);
122 value = DsssErrorRateModel::GetDsssDqpskCck5_5SuccessRate(
FromRss(-93.0), size);
124 value = DsssErrorRateModel::GetDsssDqpskCck5_5SuccessRate(
FromRss(-92.0), size);
126 value = DsssErrorRateModel::GetDsssDqpskCck5_5SuccessRate(
FromRss(-91.0), size);
128 value = DsssErrorRateModel::GetDsssDqpskCck5_5SuccessRate(
FromRss(-90.0), size);
130 value = DsssErrorRateModel::GetDsssDqpskCck5_5SuccessRate(
FromRss(-89.0), size);
132 value = DsssErrorRateModel::GetDsssDqpskCck5_5SuccessRate(
FromRss(-88.0), size);
134 value = DsssErrorRateModel::GetDsssDqpskCck5_5SuccessRate(
FromRss(-87.0), size);
138 value = DsssErrorRateModel::GetDsssDqpskCck11SuccessRate(
FromRss(-91.0), size);
140 value = DsssErrorRateModel::GetDsssDqpskCck11SuccessRate(
FromRss(-90.0), size);
142 value = DsssErrorRateModel::GetDsssDqpskCck11SuccessRate(
FromRss(-89.0), size);
144 value = DsssErrorRateModel::GetDsssDqpskCck11SuccessRate(
FromRss(-88.0), size);
146 value = DsssErrorRateModel::GetDsssDqpskCck11SuccessRate(
FromRss(-87.0), size);
148 value = DsssErrorRateModel::GetDsssDqpskCck11SuccessRate(
FromRss(-86.0), size);
150 value = DsssErrorRateModel::GetDsssDqpskCck11SuccessRate(
FromRss(-85.0), size);
152 value = DsssErrorRateModel::GetDsssDqpskCck11SuccessRate(
FromRss(-84.0), size);
170 void DoRun()
override;
174 :
TestCase(
"WifiErrorRateModel test case NIST")
195 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate6Mbps"),
197 std::pow(10.0, snr / 10.0),
201 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate6Mbps"),
203 std::pow(10.0, snr / 10.0),
207 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate6Mbps"),
209 std::pow(10.0, snr / 10.0),
213 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate6Mbps"),
215 std::pow(10.0, snr / 10.0),
220 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate9Mbps"),
222 std::pow(10.0, snr / 10.0),
226 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate9Mbps"),
228 std::pow(10.0, snr / 10.0),
232 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate9Mbps"),
234 std::pow(10.0, snr / 10.0),
238 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate9Mbps"),
240 std::pow(10.0, snr / 10.0),
245 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate12Mbps"),
247 std::pow(10.0, snr / 10.0),
251 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate12Mbps"),
253 std::pow(10.0, snr / 10.0),
257 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate12Mbps"),
259 std::pow(10.0, snr / 10.0),
263 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate12Mbps"),
265 std::pow(10.0, snr / 10.0),
270 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate18Mbps"),
272 std::pow(10.0, snr / 10.0),
276 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate18Mbps"),
278 std::pow(10.0, snr / 10.0),
282 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate18Mbps"),
284 std::pow(10.0, snr / 10.0),
288 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate18Mbps"),
290 std::pow(10.0, snr / 10.0),
295 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate24Mbps"),
297 std::pow(10.0, snr / 10.0),
301 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate24Mbps"),
303 std::pow(10.0, snr / 10.0),
307 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate24Mbps"),
309 std::pow(10.0, snr / 10.0),
313 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate24Mbps"),
315 std::pow(10.0, snr / 10.0),
320 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate36Mbps"),
322 std::pow(10.0, snr / 10.0),
326 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate36Mbps"),
328 std::pow(10.0, snr / 10.0),
332 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate36Mbps"),
334 std::pow(10.0, snr / 10.0),
338 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate36Mbps"),
340 std::pow(10.0, snr / 10.0),
345 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate48Mbps"),
347 std::pow(10.0, snr / 10.0),
351 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate48Mbps"),
353 std::pow(10.0, snr / 10.0),
357 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate48Mbps"),
359 std::pow(10.0, snr / 10.0),
363 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate48Mbps"),
365 std::pow(10.0, snr / 10.0),
370 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate54Mbps"),
372 std::pow(10.0, snr / 10.0),
376 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate54Mbps"),
378 std::pow(10.0, snr / 10.0),
382 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate54Mbps"),
384 std::pow(10.0, snr / 10.0),
388 ps = nist->GetChunkSuccessRate(
WifiMode(
"OfdmRate54Mbps"),
390 std::pow(10.0, snr / 10.0),
398 using InterferenceHelper::CalculatePayloadChunkSuccessRate;
399 using InterferenceHelper::CalculateSnr;
400 using InterferenceHelper::InterferenceHelper;
416 void DoRun()
override;
420 :
TestCase(
"WifiErrorRateModel test case MIMO")
447 double initialSnr = 4.0;
455 "Attempt to set initial SNR to known value failed");
461 "CSR not within tolerance for SISO");
462 double sisoChunkSuccess = chunkSuccess;
474 "SNR not within tolerance for 2x1:2 MIMO");
479 "CSR not within tolerance for SISO");
493 "SNR not within tolerance for 1x2:1 MIMO");
497 "CSR not within tolerance for 1x2:1 MIMO");
511 "SNR not equal within tolerance for 2x2:1 MIMO");
515 "CSR not within tolerance for 2x2:1 MIMO");
528 "SNR not equal within tolerance for 2x2:2 MIMO");
533 "CSR not within tolerance for 2x2:2 MIMO");
547 "SNR not within tolerance for 3x3:1 MIMO");
551 "CSR not within tolerance for 3x3:1 MIMO");
565 "SNR not within tolerance for 3x3:2 MIMO");
569 "CSR not within tolerance for 3x3:2 MIMO");
582 "SNR not within tolerance for 3x3:3 MIMO");
587 "CSR not equal within tolerance for 3x3:3 MIMO");
601 "SNR not within tolerance for 4x4:1 MIMO");
605 "CSR not within tolerance for 4x4:1 MIMO");
619 "SNR not within tolerance for 4x4:2 MIMO");
623 "CSR not within tolerance for 4x4:2 MIMO");
637 "SNR not within tolerance for 4x4:3 MIMO");
641 "CSR not within tolerance for 4x4:1 MIMO");
654 "SNR not within tolerance for 4x4:4 MIMO");
659 "CSR not within tolerance for 4x4:4 MIMO");
666std::map<std::pair<uint8_t ,
uint32_t >,
667 std::map<
double ,
double >>
670 {std::make_pair(0, 1458),
672 {-4.00, 1.00000}, {-3.75, 1.00000}, {-3.50, 1.00000}, {-3.25, 1.00000},
673 {-3.00, 1.00000}, {-2.75, 1.00000}, {-2.50, 1.00000}, {-2.25, 1.00000},
674 {-2.00, 1.00000}, {-1.75, 1.00000}, {-1.50, 1.00000}, {-1.25, 1.00000},
675 {-1.00, 1.00000}, {-0.75, 0.99700}, {-0.50, 0.99400}, {-0.25, 0.90625},
676 {0.00, 0.81850}, {0.25, 0.55465}, {0.50, 0.29080}, {0.75, 0.17855},
677 {1.00, 0.06630}, {1.25, 0.03875}, {1.50, 0.01120}, {1.75, 0.00635},
678 {2.00, 0.00150}, {2.25, 0.00083}, {2.50, 0.00015}, {2.75, 0.00008},
679 {3.00, 0.00001}, {3.25, 0.00000}, {3.50, 0.00000}, {3.75, 0.00000},
680 {4.00, 0.00000}, {4.25, 0.00000}, {4.50, 0.00000}, {4.75, 0.00000},
681 {5.00, 0.00000}, {5.25, 0.00000}, {5.50, 0.00000}, {5.75, 0.00000},
682 {6.00, 0.00000}, {6.25, 0.00000}, {6.50, 0.00000}, {6.75, 0.00000},
683 {7.00, 0.00000}, {7.25, 0.00000}, {7.50, 0.00000}, {7.75, 0.00000},
684 {8.00, 0.00000}, {8.25, 0.00000}, {8.50, 0.00000}, {8.75, 0.00000},
685 {9.00, 0.00000}, {9.25, 0.00000}, {9.50, 0.00000}, {9.75, 0.00000},
686 {10.00, 0.00000}, {10.25, 0.00000}, {10.50, 0.00000}, {10.75, 0.00000},
687 {11.00, 0.00000}, {11.25, 0.00000}, {11.50, 0.00000}, {11.75, 0.00000},
688 {12.00, 0.00000}, {12.25, 0.00000}, {12.50, 0.00000}, {12.75, 0.00000},
689 {13.00, 0.00000}, {13.25, 0.00000}, {13.50, 0.00000}, {13.75, 0.00000},
690 {14.00, 0.00000}, {14.25, 0.00000}, {14.50, 0.00000}, {14.75, 0.00000},
691 {15.00, 0.00000}, {15.25, 0.00000}, {15.50, 0.00000}, {15.75, 0.00000},
692 {16.00, 0.00000}, {16.25, 0.00000}, {16.50, 0.00000}, {16.75, 0.00000},
693 {17.00, 0.00000}, {17.25, 0.00000}, {17.50, 0.00000}, {17.75, 0.00000},
694 {18.00, 0.00000}, {18.25, 0.00000}, {18.50, 0.00000}, {18.75, 0.00000},
695 {19.00, 0.00000}, {19.25, 0.00000}, {19.50, 0.00000}, {19.75, 0.00000},
696 {20.00, 0.00000}, {20.25, 0.00000}, {20.50, 0.00000}, {20.75, 0.00000},
697 {21.00, 0.00000}, {21.25, 0.00000}, {21.50, 0.00000}, {21.75, 0.00000},
698 {22.00, 0.00000}, {22.25, 0.00000}, {22.50, 0.00000}, {22.75, 0.00000},
699 {23.00, 0.00000}, {23.25, 0.00000}, {23.50, 0.00000}, {23.75, 0.00000},
700 {24.00, 0.00000}, {24.25, 0.00000}, {24.50, 0.00000}, {24.75, 0.00000},
701 {25.00, 0.00000}, {25.25, 0.00000}, {25.50, 0.00000}, {25.75, 0.00000},
702 {26.00, 0.00000}, {26.25, 0.00000}, {26.50, 0.00000}, {26.75, 0.00000},
703 {27.00, 0.00000}, {27.25, 0.00000}, {27.50, 0.00000}, {27.75, 0.00000},
704 {28.00, 0.00000}, {28.25, 0.00000}, {28.50, 0.00000}, {28.75, 0.00000},
705 {29.00, 0.00000}, {29.25, 0.00000}, {29.50, 0.00000}, {29.75, 0.00000},
709 {std::make_pair(0, 32),
711 {-4.00, 1.00000}, {-3.75, 1.00000}, {-3.50, 1.00000}, {-3.25, 0.99750},
712 {-3.00, 0.99500}, {-2.75, 0.96790}, {-2.50, 0.94080}, {-2.25, 0.88335},
713 {-2.00, 0.82590}, {-1.75, 0.70770}, {-1.50, 0.58950}, {-1.25, 0.44890},
714 {-1.00, 0.30830}, {-0.75, 0.21685}, {-0.50, 0.12540}, {-0.25, 0.07990},
715 {0.00, 0.03440}, {0.25, 0.02145}, {0.50, 0.00850}, {0.75, 0.00500},
716 {1.00, 0.00150}, {1.25, 0.00087}, {1.50, 0.00024}, {1.75, 0.00017},
717 {2.00, 0.00009}, {2.25, 0.00005}, {2.50, 0.00000}, {2.75, 0.00000},
718 {3.00, 0.00000}, {3.25, 0.00000}, {3.50, 0.00000}, {3.75, 0.00000},
719 {4.00, 0.00000}, {4.25, 0.00000}, {4.50, 0.00000}, {4.75, 0.00000},
720 {5.00, 0.00000}, {5.25, 0.00000}, {5.50, 0.00000}, {5.75, 0.00000},
721 {6.00, 0.00000}, {6.25, 0.00000}, {6.50, 0.00000}, {6.75, 0.00000},
722 {7.00, 0.00000}, {7.25, 0.00000}, {7.50, 0.00000}, {7.75, 0.00000},
723 {8.00, 0.00000}, {8.25, 0.00000}, {8.50, 0.00000}, {8.75, 0.00000},
724 {9.00, 0.00000}, {9.25, 0.00000}, {9.50, 0.00000}, {9.75, 0.00000},
725 {10.00, 0.00000}, {10.25, 0.00000}, {10.50, 0.00000}, {10.75, 0.00000},
726 {11.00, 0.00000}, {11.25, 0.00000}, {11.50, 0.00000}, {11.75, 0.00000},
727 {12.00, 0.00000}, {12.25, 0.00000}, {12.50, 0.00000}, {12.75, 0.00000},
728 {13.00, 0.00000}, {13.25, 0.00000}, {13.50, 0.00000}, {13.75, 0.00000},
729 {14.00, 0.00000}, {14.25, 0.00000}, {14.50, 0.00000}, {14.75, 0.00000},
730 {15.00, 0.00000}, {15.25, 0.00000}, {15.50, 0.00000}, {15.75, 0.00000},
731 {16.00, 0.00000}, {16.25, 0.00000}, {16.50, 0.00000}, {16.75, 0.00000},
732 {17.00, 0.00000}, {17.25, 0.00000}, {17.50, 0.00000}, {17.75, 0.00000},
733 {18.00, 0.00000}, {18.25, 0.00000}, {18.50, 0.00000}, {18.75, 0.00000},
734 {19.00, 0.00000}, {19.25, 0.00000}, {19.50, 0.00000}, {19.75, 0.00000},
735 {20.00, 0.00000}, {20.25, 0.00000}, {20.50, 0.00000}, {20.75, 0.00000},
736 {21.00, 0.00000}, {21.25, 0.00000}, {21.50, 0.00000}, {21.75, 0.00000},
737 {22.00, 0.00000}, {22.25, 0.00000}, {22.50, 0.00000}, {22.75, 0.00000},
738 {23.00, 0.00000}, {23.25, 0.00000}, {23.50, 0.00000}, {23.75, 0.00000},
739 {24.00, 0.00000}, {24.25, 0.00000}, {24.50, 0.00000}, {24.75, 0.00000},
740 {25.00, 0.00000}, {25.25, 0.00000}, {25.50, 0.00000}, {25.75, 0.00000},
741 {26.00, 0.00000}, {26.25, 0.00000}, {26.50, 0.00000}, {26.75, 0.00000},
742 {27.00, 0.00000}, {27.25, 0.00000}, {27.50, 0.00000}, {27.75, 0.00000},
743 {28.00, 0.00000}, {28.25, 0.00000}, {28.50, 0.00000}, {28.75, 0.00000},
744 {29.00, 0.00000}, {29.25, 0.00000}, {29.50, 0.00000}, {29.75, 0.00000},
748 {std::make_pair(0, 1000),
750 {-4.00, 1.00000}, {-3.75, 1.00000}, {-3.50, 1.00000}, {-3.25, 1.00000},
751 {-3.00, 1.00000}, {-2.75, 1.00000}, {-2.50, 1.00000}, {-2.25, 1.00000},
752 {-2.00, 1.00000}, {-1.75, 1.00000}, {-1.50, 1.00000}, {-1.25, 1.00000},
753 {-1.00, 1.00000}, {-0.75, 0.98140}, {-0.50, 0.97007}, {-0.25, 0.80280},
754 {0.00, 0.68977}, {0.25, 0.42581}, {0.50, 0.20997}, {0.75, 0.12620},
755 {1.00, 0.04596}, {1.25, 0.02674}, {1.50, 0.00770}, {1.75, 0.00436},
756 {2.00, 0.00103}, {2.25, 0.00057}, {2.50, 0.00010}, {2.75, 0.00005},
757 {3.00, 0.00001}, {3.25, 0.00000}, {3.50, 0.00000}, {3.75, 0.00000},
758 {4.00, 0.00000}, {4.25, 0.00000}, {4.50, 0.00000}, {4.75, 0.00000},
759 {5.00, 0.00000}, {5.25, 0.00000}, {5.50, 0.00000}, {5.75, 0.00000},
760 {6.00, 0.00000}, {6.25, 0.00000}, {6.50, 0.00000}, {6.75, 0.00000},
761 {7.00, 0.00000}, {7.25, 0.00000}, {7.50, 0.00000}, {7.75, 0.00000},
762 {8.00, 0.00000}, {8.25, 0.00000}, {8.50, 0.00000}, {8.75, 0.00000},
763 {9.00, 0.00000}, {9.25, 0.00000}, {9.50, 0.00000}, {9.75, 0.00000},
764 {10.00, 0.00000}, {10.25, 0.00000}, {10.50, 0.00000}, {10.75, 0.00000},
765 {11.00, 0.00000}, {11.25, 0.00000}, {11.50, 0.00000}, {11.75, 0.00000},
766 {12.00, 0.00000}, {12.25, 0.00000}, {12.50, 0.00000}, {12.75, 0.00000},
767 {13.00, 0.00000}, {13.25, 0.00000}, {13.50, 0.00000}, {13.75, 0.00000},
768 {14.00, 0.00000}, {14.25, 0.00000}, {14.50, 0.00000}, {14.75, 0.00000},
769 {15.00, 0.00000}, {15.25, 0.00000}, {15.50, 0.00000}, {15.75, 0.00000},
770 {16.00, 0.00000}, {16.25, 0.00000}, {16.50, 0.00000}, {16.75, 0.00000},
771 {17.00, 0.00000}, {17.25, 0.00000}, {17.50, 0.00000}, {17.75, 0.00000},
772 {18.00, 0.00000}, {18.25, 0.00000}, {18.50, 0.00000}, {18.75, 0.00000},
773 {19.00, 0.00000}, {19.25, 0.00000}, {19.50, 0.00000}, {19.75, 0.00000},
774 {20.00, 0.00000}, {20.25, 0.00000}, {20.50, 0.00000}, {20.75, 0.00000},
775 {21.00, 0.00000}, {21.25, 0.00000}, {21.50, 0.00000}, {21.75, 0.00000},
776 {22.00, 0.00000}, {22.25, 0.00000}, {22.50, 0.00000}, {22.75, 0.00000},
777 {23.00, 0.00000}, {23.25, 0.00000}, {23.50, 0.00000}, {23.75, 0.00000},
778 {24.00, 0.00000}, {24.25, 0.00000}, {24.50, 0.00000}, {24.75, 0.00000},
779 {25.00, 0.00000}, {25.25, 0.00000}, {25.50, 0.00000}, {25.75, 0.00000},
780 {26.00, 0.00000}, {26.25, 0.00000}, {26.50, 0.00000}, {26.75, 0.00000},
781 {27.00, 0.00000}, {27.25, 0.00000}, {27.50, 0.00000}, {27.75, 0.00000},
782 {28.00, 0.00000}, {28.25, 0.00000}, {28.50, 0.00000}, {28.75, 0.00000},
783 {29.00, 0.00000}, {29.25, 0.00000}, {29.50, 0.00000}, {29.75, 0.00000},
787 {std::make_pair(0, 1),
789 {-4.00, 1.00000}, {-3.75, 1.00000}, {-3.50, 1.00000}, {-3.25, 0.17075},
790 {-3.00, 0.15260}, {-2.75, 0.10190}, {-2.50, 0.08455}, {-2.25, 0.06494},
791 {-2.00, 0.05316}, {-1.75, 0.03771}, {-1.50, 0.02744}, {-1.25, 0.01845},
792 {-1.00, 0.01145}, {-0.75, 0.00761}, {-0.50, 0.00418}, {-0.25, 0.00260},
793 {0.00, 0.00110}, {0.25, 0.00068}, {0.50, 0.00027}, {0.75, 0.00016},
794 {1.00, 0.00005}, {1.25, 0.00003}, {1.50, 0.00000}, {1.75, 0.00000},
795 {2.00, 0.00000}, {2.25, 0.00000}, {2.50, 0.00000}, {2.75, 0.00000},
796 {3.00, 0.00000}, {3.25, 0.00000}, {3.50, 0.00000}, {3.75, 0.00000},
797 {4.00, 0.00000}, {4.25, 0.00000}, {4.50, 0.00000}, {4.75, 0.00000},
798 {5.00, 0.00000}, {5.25, 0.00000}, {5.50, 0.00000}, {5.75, 0.00000},
799 {6.00, 0.00000}, {6.25, 0.00000}, {6.50, 0.00000}, {6.75, 0.00000},
800 {7.00, 0.00000}, {7.25, 0.00000}, {7.50, 0.00000}, {7.75, 0.00000},
801 {8.00, 0.00000}, {8.25, 0.00000}, {8.50, 0.00000}, {8.75, 0.00000},
802 {9.00, 0.00000}, {9.25, 0.00000}, {9.50, 0.00000}, {9.75, 0.00000},
803 {10.00, 0.00000}, {10.25, 0.00000}, {10.50, 0.00000}, {10.75, 0.00000},
804 {11.00, 0.00000}, {11.25, 0.00000}, {11.50, 0.00000}, {11.75, 0.00000},
805 {12.00, 0.00000}, {12.25, 0.00000}, {12.50, 0.00000}, {12.75, 0.00000},
806 {13.00, 0.00000}, {13.25, 0.00000}, {13.50, 0.00000}, {13.75, 0.00000},
807 {14.00, 0.00000}, {14.25, 0.00000}, {14.50, 0.00000}, {14.75, 0.00000},
808 {15.00, 0.00000}, {15.25, 0.00000}, {15.50, 0.00000}, {15.75, 0.00000},
809 {16.00, 0.00000}, {16.25, 0.00000}, {16.50, 0.00000}, {16.75, 0.00000},
810 {17.00, 0.00000}, {17.25, 0.00000}, {17.50, 0.00000}, {17.75, 0.00000},
811 {18.00, 0.00000}, {18.25, 0.00000}, {18.50, 0.00000}, {18.75, 0.00000},
812 {19.00, 0.00000}, {19.25, 0.00000}, {19.50, 0.00000}, {19.75, 0.00000},
813 {20.00, 0.00000}, {20.25, 0.00000}, {20.50, 0.00000}, {20.75, 0.00000},
814 {21.00, 0.00000}, {21.25, 0.00000}, {21.50, 0.00000}, {21.75, 0.00000},
815 {22.00, 0.00000}, {22.25, 0.00000}, {22.50, 0.00000}, {22.75, 0.00000},
816 {23.00, 0.00000}, {23.25, 0.00000}, {23.50, 0.00000}, {23.75, 0.00000},
817 {24.00, 0.00000}, {24.25, 0.00000}, {24.50, 0.00000}, {24.75, 0.00000},
818 {25.00, 0.00000}, {25.25, 0.00000}, {25.50, 0.00000}, {25.75, 0.00000},
819 {26.00, 0.00000}, {26.25, 0.00000}, {26.50, 0.00000}, {26.75, 0.00000},
820 {27.00, 0.00000}, {27.25, 0.00000}, {27.50, 0.00000}, {27.75, 0.00000},
821 {28.00, 0.00000}, {28.25, 0.00000}, {28.50, 0.00000}, {28.75, 0.00000},
822 {29.00, 0.00000}, {29.25, 0.00000}, {29.50, 0.00000}, {29.75, 0.00000},
826 {std::make_pair(0, 2000),
828 {-4.00, 1.00000}, {-3.75, 1.00000}, {-3.50, 1.00000}, {-3.25, 1.00000},
829 {-3.00, 1.00000}, {-2.75, 1.00000}, {-2.50, 1.00000}, {-2.25, 1.00000},
830 {-2.00, 1.00000}, {-1.75, 1.00000}, {-1.50, 1.00000}, {-1.25, 1.00000},
831 {-1.00, 1.00000}, {-0.75, 0.99965}, {-0.50, 0.99910}, {-0.25, 0.96111},
832 {0.00, 0.90376}, {0.25, 0.67031}, {0.50, 0.37584}, {0.75, 0.23647},
833 {1.00, 0.08981}, {1.25, 0.05277}, {1.50, 0.01533}, {1.75, 0.00870},
834 {2.00, 0.00206}, {2.25, 0.00113}, {2.50, 0.00021}, {2.75, 0.00011},
835 {3.00, 0.00001}, {3.25, 0.00000}, {3.50, 0.00000}, {3.75, 0.00000},
836 {4.00, 0.00000}, {4.25, 0.00000}, {4.50, 0.00000}, {4.75, 0.00000},
837 {5.00, 0.00000}, {5.25, 0.00000}, {5.50, 0.00000}, {5.75, 0.00000},
838 {6.00, 0.00000}, {6.25, 0.00000}, {6.50, 0.00000}, {6.75, 0.00000},
839 {7.00, 0.00000}, {7.25, 0.00000}, {7.50, 0.00000}, {7.75, 0.00000},
840 {8.00, 0.00000}, {8.25, 0.00000}, {8.50, 0.00000}, {8.75, 0.00000},
841 {9.00, 0.00000}, {9.25, 0.00000}, {9.50, 0.00000}, {9.75, 0.00000},
842 {10.00, 0.00000}, {10.25, 0.00000}, {10.50, 0.00000}, {10.75, 0.00000},
843 {11.00, 0.00000}, {11.25, 0.00000}, {11.50, 0.00000}, {11.75, 0.00000},
844 {12.00, 0.00000}, {12.25, 0.00000}, {12.50, 0.00000}, {12.75, 0.00000},
845 {13.00, 0.00000}, {13.25, 0.00000}, {13.50, 0.00000}, {13.75, 0.00000},
846 {14.00, 0.00000}, {14.25, 0.00000}, {14.50, 0.00000}, {14.75, 0.00000},
847 {15.00, 0.00000}, {15.25, 0.00000}, {15.50, 0.00000}, {15.75, 0.00000},
848 {16.00, 0.00000}, {16.25, 0.00000}, {16.50, 0.00000}, {16.75, 0.00000},
849 {17.00, 0.00000}, {17.25, 0.00000}, {17.50, 0.00000}, {17.75, 0.00000},
850 {18.00, 0.00000}, {18.25, 0.00000}, {18.50, 0.00000}, {18.75, 0.00000},
851 {19.00, 0.00000}, {19.25, 0.00000}, {19.50, 0.00000}, {19.75, 0.00000},
852 {20.00, 0.00000}, {20.25, 0.00000}, {20.50, 0.00000}, {20.75, 0.00000},
853 {21.00, 0.00000}, {21.25, 0.00000}, {21.50, 0.00000}, {21.75, 0.00000},
854 {22.00, 0.00000}, {22.25, 0.00000}, {22.50, 0.00000}, {22.75, 0.00000},
855 {23.00, 0.00000}, {23.25, 0.00000}, {23.50, 0.00000}, {23.75, 0.00000},
856 {24.00, 0.00000}, {24.25, 0.00000}, {24.50, 0.00000}, {24.75, 0.00000},
857 {25.00, 0.00000}, {25.25, 0.00000}, {25.50, 0.00000}, {25.75, 0.00000},
858 {26.00, 0.00000}, {26.25, 0.00000}, {26.50, 0.00000}, {26.75, 0.00000},
859 {27.00, 0.00000}, {27.25, 0.00000}, {27.50, 0.00000}, {27.75, 0.00000},
860 {28.00, 0.00000}, {28.25, 0.00000}, {28.50, 0.00000}, {28.75, 0.00000},
861 {29.00, 0.00000}, {29.25, 0.00000}, {29.50, 0.00000}, {29.75, 0.00000},
865 {std::make_pair(7, 1500),
867 {-4.00, 1.00000}, {-3.75, 1.00000}, {-3.50, 1.00000}, {-3.25, 1.00000},
868 {-3.00, 1.00000}, {-2.75, 1.00000}, {-2.50, 1.00000}, {-2.25, 1.00000},
869 {-2.00, 1.00000}, {-1.75, 1.00000}, {-1.50, 1.00000}, {-1.25, 1.00000},
870 {-1.00, 1.00000}, {-0.75, 1.00000}, {-0.50, 1.00000}, {-0.25, 1.00000},
871 {0.00, 1.00000}, {0.25, 1.00000}, {0.50, 1.00000}, {0.75, 1.00000},
872 {1.00, 1.00000}, {1.25, 1.00000}, {1.50, 1.00000}, {1.75, 1.00000},
873 {2.00, 1.00000}, {2.25, 1.00000}, {2.50, 1.00000}, {2.75, 1.00000},
874 {3.00, 1.00000}, {3.25, 1.00000}, {3.50, 1.00000}, {3.75, 1.00000},
875 {4.00, 1.00000}, {4.25, 1.00000}, {4.50, 1.00000}, {4.75, 1.00000},
876 {5.00, 1.00000}, {5.25, 1.00000}, {5.50, 1.00000}, {5.75, 1.00000},
877 {6.00, 1.00000}, {6.25, 1.00000}, {6.50, 1.00000}, {6.75, 1.00000},
878 {7.00, 1.00000}, {7.25, 1.00000}, {7.50, 1.00000}, {7.75, 1.00000},
879 {8.00, 1.00000}, {8.25, 1.00000}, {8.50, 1.00000}, {8.75, 1.00000},
880 {9.00, 1.00000}, {9.25, 1.00000}, {9.50, 1.00000}, {9.75, 1.00000},
881 {10.00, 1.00000}, {10.25, 1.00000}, {10.50, 1.00000}, {10.75, 1.00000},
882 {11.00, 1.00000}, {11.25, 1.00000}, {11.50, 1.00000}, {11.75, 1.00000},
883 {12.00, 1.00000}, {12.25, 1.00000}, {12.50, 1.00000}, {12.75, 1.00000},
884 {13.00, 1.00000}, {13.25, 1.00000}, {13.50, 1.00000}, {13.75, 1.00000},
885 {14.00, 1.00000}, {14.25, 1.00000}, {14.50, 1.00000}, {14.75, 1.00000},
886 {15.00, 1.00000}, {15.25, 1.00000}, {15.50, 1.00000}, {15.75, 1.00000},
887 {16.00, 1.00000}, {16.25, 1.00000}, {16.50, 1.00000}, {16.75, 1.00000},
888 {17.00, 1.00000}, {17.25, 1.00000}, {17.50, 1.00000}, {17.75, 0.99057},
889 {18.00, 0.98075}, {18.25, 0.86664}, {18.50, 0.74920}, {18.75, 0.54857},
890 {19.00, 0.34531}, {19.25, 0.23624}, {19.50, 0.12672}, {19.75, 0.08164},
891 {20.00, 0.03650}, {20.25, 0.02340}, {20.50, 0.01029}, {20.75, 0.00653},
892 {21.00, 0.00278}, {21.25, 0.00165}, {21.50, 0.00051}, {21.75, 0.00030},
893 {22.00, 0.00009}, {22.25, 0.00005}, {22.50, 0.00001}, {22.75, 0.00000},
894 {23.00, 0.00000}, {23.25, 0.00000}, {23.50, 0.00000}, {23.75, 0.00000},
895 {24.00, 0.00000}, {24.25, 0.00000}, {24.50, 0.00000}, {24.75, 0.00000},
896 {25.00, 0.00000}, {25.25, 0.00000}, {25.50, 0.00000}, {25.75, 0.00000},
897 {26.00, 0.00000}, {26.25, 0.00000}, {26.50, 0.00000}, {26.75, 0.00000},
898 {27.00, 0.00000}, {27.25, 0.00000}, {27.50, 0.00000}, {27.75, 0.00000},
899 {28.00, 0.00000}, {28.25, 0.00000}, {28.50, 0.00000}, {28.75, 0.00000},
900 {29.00, 0.00000}, {29.25, 0.00000}, {29.50, 0.00000}, {29.75, 0.00000},
904 {std::make_pair(8, 1500),
906 {-4.00, 1.00000}, {-3.75, 1.00000}, {-3.50, 1.00000}, {-3.25, 1.00000},
907 {-3.00, 1.00000}, {-2.75, 1.00000}, {-2.50, 1.00000}, {-2.25, 1.00000},
908 {-2.00, 1.00000}, {-1.75, 1.00000}, {-1.50, 1.00000}, {-1.25, 1.00000},
909 {-1.00, 1.00000}, {-0.75, 1.00000}, {-0.50, 1.00000}, {-0.25, 1.00000},
910 {0.00, 1.00000}, {0.25, 1.00000}, {0.50, 1.00000}, {0.75, 1.00000},
911 {1.00, 1.00000}, {1.25, 1.00000}, {1.50, 1.00000}, {1.75, 1.00000},
912 {2.00, 1.00000}, {2.25, 1.00000}, {2.50, 1.00000}, {2.75, 1.00000},
913 {3.00, 1.00000}, {3.25, 1.00000}, {3.50, 1.00000}, {3.75, 1.00000},
914 {4.00, 1.00000}, {4.25, 1.00000}, {4.50, 1.00000}, {4.75, 1.00000},
915 {5.00, 1.00000}, {5.25, 1.00000}, {5.50, 1.00000}, {5.75, 1.00000},
916 {6.00, 1.00000}, {6.25, 1.00000}, {6.50, 1.00000}, {6.75, 1.00000},
917 {7.00, 1.00000}, {7.25, 1.00000}, {7.50, 1.00000}, {7.75, 1.00000},
918 {8.00, 1.00000}, {8.25, 1.00000}, {8.50, 1.00000}, {8.75, 1.00000},
919 {9.00, 1.00000}, {9.25, 1.00000}, {9.50, 1.00000}, {9.75, 1.00000},
920 {10.00, 1.00000}, {10.25, 1.00000}, {10.50, 1.00000}, {10.75, 1.00000},
921 {11.00, 1.00000}, {11.25, 1.00000}, {11.50, 1.00000}, {11.75, 1.00000},
922 {12.00, 1.00000}, {12.25, 1.00000}, {12.50, 1.00000}, {12.75, 1.00000},
923 {13.00, 1.00000}, {13.25, 1.00000}, {13.50, 1.00000}, {13.75, 1.00000},
924 {14.00, 1.00000}, {14.25, 1.00000}, {14.50, 1.00000}, {14.75, 1.00000},
925 {15.00, 1.00000}, {15.25, 1.00000}, {15.50, 1.00000}, {15.75, 1.00000},
926 {16.00, 1.00000}, {16.25, 1.00000}, {16.50, 1.00000}, {16.75, 1.00000},
927 {17.00, 1.00000}, {17.25, 1.00000}, {17.50, 1.00000}, {17.75, 1.00000},
928 {18.00, 1.00000}, {18.25, 1.00000}, {18.50, 1.00000}, {18.75, 1.00000},
929 {19.00, 1.00000}, {19.25, 1.00000}, {19.50, 1.00000}, {19.75, 1.00000},
930 {20.00, 1.00000}, {20.25, 1.00000}, {20.50, 1.00000}, {20.75, 1.00000},
931 {21.00, 1.00000}, {21.25, 0.99918}, {21.50, 0.99833}, {21.75, 0.97191},
932 {22.00, 0.94458}, {22.25, 0.81436}, {22.50, 0.68127}, {22.75, 0.52168},
933 {23.00, 0.36056}, {23.25, 0.25114}, {23.50, 0.14127}, {23.75, 0.09509},
934 {24.00, 0.04883}, {24.25, 0.03234}, {24.50, 0.01584}, {24.75, 0.01060},
935 {25.00, 0.00535}, {25.25, 0.00345}, {25.50, 0.00154}, {25.75, 0.00096},
936 {26.00, 0.00037}, {26.25, 0.00022}, {26.50, 0.00007}, {26.75, 0.00004},
937 {27.00, 0.00000}, {27.25, 0.00000}, {27.50, 0.00000}, {27.75, 0.00000},
938 {28.00, 0.00000}, {28.25, 0.00000}, {28.50, 0.00000}, {28.75, 0.00000},
939 {29.00, 0.00000}, {29.25, 0.00000}, {29.50, 0.00000}, {29.75, 0.00000},
964 void DoRun()
override;
975 m_testName(testName),
997 for (
double snr = -4; snr <= 30; snr += 0.25)
999 double expectedValue = 0;
1004 1 - yans->GetChunkSuccessRate(
m_mode, txVector, std::pow(10, snr / 10),
m_size * 8);
1011 auto itValue = it->second.find(snr);
1012 if (itValue != it->second.end())
1014 expectedValue = itValue->second;
1023 NS_FATAL_ERROR(
"No expected value found for the combination MCS "
1028 1 - table->GetChunkSuccessRate(
m_mode, txVector, std::pow(10, snr / 10),
m_size * 8);
1030 <<
" expectedPER=" << expectedValue);
1048 :
TestSuite(
"wifi-error-rate-models", UNIT)
1076 VhtPhy::GetVhtMcs0(),
1080 VhtPhy::GetVhtMcs0(),
1084 VhtPhy::GetVhtMcs0(),
1091 VhtPhy::GetVhtMcs0(),
1095 VhtPhy::GetVhtMcs8(),
1099 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, WifiSpectrumBand 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