21 #include <ns3/object.h>
22 #include <ns3/spectrum-interference.h>
23 #include <ns3/spectrum-error-model.h>
26 #include <ns3/simulator.h>
27 #include <ns3/packet.h>
30 #include <ns3/radio-bearer-stats-calculator.h>
31 #include <ns3/buildings-mobility-model.h>
32 #include <ns3/hybrid-buildings-propagation-loss-model.h>
33 #include <ns3/eps-bearer.h>
34 #include <ns3/node-container.h>
35 #include <ns3/mobility-helper.h>
36 #include <ns3/net-device-container.h>
37 #include <ns3/lte-ue-net-device.h>
38 #include <ns3/lte-enb-net-device.h>
39 #include <ns3/lte-ue-rrc.h>
40 #include <ns3/lte-helper.h>
41 #include <ns3/string.h>
42 #include <ns3/double.h>
43 #include <ns3/lte-enb-phy.h>
44 #include <ns3/lte-ue-phy.h>
45 #include <ns3/config.h>
46 #include <ns3/boolean.h>
48 #include <ns3/unused.h>
49 #include <ns3/ff-mac-scheduler.h>
59 :
TestSuite (
"lte-phy-error-model", SYSTEM)
61 NS_LOG_INFO (
"creating LenaTestPhyErrorModelTestCase");
98 std::ostringstream oss;
99 oss << nUser <<
" UEs, distance " << dist <<
" m";
104 :
TestCase (BuildNameString (nUser, dist)),
109 m_bernQuantile (bernQuantile)
217 enbPhy->SetAttribute (
"NoiseFigure",
DoubleValue (5.0));
223 for (
int i = 0; i <
m_nUser; i++)
229 uePhy->SetAttribute (
"TxPower",
DoubleValue (23.0));
230 uePhy->SetAttribute (
"NoiseFigure",
DoubleValue (9.0));
234 double simulationTime = 1.000;
247 NS_LOG_INFO (
"\tTest downlink/uplink data shared channels (PDSCH and PUSCH)");
249 std::vector <uint64_t> dlDataRxed;
250 for (
int i = 0; i <
m_nUser; i++)
256 dlDataRxed.push_back (rlcStats->
GetDlRxData (imsi, lcId));
259 int lambda = (double)dlDataRxed.at (i) /
m_tbSize;
260 double ber = 1.0 - ((double)dlDataRxed.at (i)/txed);
262 NS_LOG_INFO (
"\tUser " << i <<
" imsi " << imsi <<
" bytes rxed " << (
double)dlDataRxed.at (i) <<
" txed " << txed
263 <<
" BER " << ber <<
" Err " << std::fabs (m_berRef - ber) <<
" lambda " << lambda
264 <<
" np " << np <<
" difference " << std::abs (lambda - np) <<
" quantile " <<
m_bernQuantile);
282 std::ostringstream oss;
283 oss << nEnb <<
" eNBs, distance " << dist <<
" m";
289 :
TestCase (BuildNameString (nEnb, dist)),
398 for (
int i = 0; i <
m_nEnb; i++)
406 enbPhy->SetAttribute (
"NoiseFigure",
DoubleValue (5.0));
414 uePhy->SetAttribute (
"TxPower",
DoubleValue (23.0));
415 uePhy->SetAttribute (
"NoiseFigure",
DoubleValue (9.0));
419 double simulationTime = 1.000;
432 NS_LOG_INFO (
"\tTest downlink control channels (PCFICH+PDCCH)");
434 std::vector <uint64_t> dlDataRxed;
436 for (
int i = 0; i < nUser; i++)
442 dlDataRxed.push_back (rlcStats->
GetDlRxData (imsi, lcId));
444 double ber = 1.0 - ((double)dlDataRxed.at (i)/txed);
445 NS_LOG_INFO (
"\tUser " << i <<
" imsi " << imsi <<
" bytes rxed " << (
double)dlDataRxed.at (i) <<
" txed " << txed
446 <<
" BER " << ber <<
" Err " << fabs (
m_berRef - ber));