22 #include <ns3/object.h>
23 #include <ns3/spectrum-interference.h>
24 #include <ns3/spectrum-error-model.h>
27 #include <ns3/simulator.h>
28 #include <ns3/packet.h>
31 #include <ns3/radio-bearer-stats-calculator.h>
32 #include <ns3/mobility-building-info.h>
33 #include <ns3/hybrid-buildings-propagation-loss-model.h>
34 #include <ns3/eps-bearer.h>
35 #include <ns3/node-container.h>
36 #include <ns3/mobility-helper.h>
37 #include <ns3/net-device-container.h>
38 #include <ns3/lte-ue-net-device.h>
39 #include <ns3/lte-enb-net-device.h>
40 #include <ns3/lte-ue-rrc.h>
41 #include <ns3/lte-helper.h>
42 #include <ns3/string.h>
43 #include <ns3/double.h>
44 #include <ns3/lte-enb-phy.h>
45 #include <ns3/lte-ue-phy.h>
46 #include <ns3/config.h>
47 #include <ns3/boolean.h>
49 #include <ns3/unused.h>
50 #include <ns3/ff-mac-scheduler.h>
51 #include <ns3/buildings-helper.h>
61 :
TestSuite (
"lte-phy-error-model", SYSTEM)
63 NS_LOG_INFO (
"creating LenaTestPhyErrorModelTestCase");
107 std::ostringstream oss;
108 oss << nUser <<
" UEs, distance " << dist <<
" m";
113 :
TestCase (BuildNameString (nUser, dist)),
118 m_toleranceRxPackets (toleranceRxPackets)
186 enbPhy->SetAttribute (
"NoiseFigure",
DoubleValue (5.0));
192 for (
int i = 0; i <
m_nUser; i++)
198 uePhy->SetAttribute (
"TxPower",
DoubleValue (23.0));
199 uePhy->SetAttribute (
"NoiseFigure",
DoubleValue (9.0));
203 Time simulationTime = Seconds (1.000);
213 NS_LOG_INFO (
"\tTest downlink data shared channels (PDSCH)");
215 for (
int i = 0; i <
m_nUser; i++)
223 double dlBler = 1.0 - (dlRxPackets/dlTxPackets);
224 double expectedDlRxPackets = dlTxPackets -dlTxPackets*
m_blerRef;
225 NS_LOG_INFO (
"\tUser " << i <<
" imsi " << imsi <<
" DOWNLINK"
226 <<
" pkts rx " << dlRxPackets <<
" tx " << dlTxPackets
227 <<
" BLER " << dlBler <<
" Err " << std::fabs (m_blerRef - dlBler)
228 <<
" expected rx " << expectedDlRxPackets
229 <<
" difference " << std::abs (expectedDlRxPackets - dlRxPackets)
235 double expectedDlMinTxPackets = simulationTime.
GetMilliSeconds () - 50;
256 std::ostringstream oss;
257 oss << nEnb <<
" eNBs, distance " << dist <<
" m";
263 :
TestCase (BuildNameString (nEnb, dist)),
331 for (
int i = 0; i <
m_nEnb; i++)
339 enbPhy->SetAttribute (
"NoiseFigure",
DoubleValue (5.0));
347 uePhy->SetAttribute (
"TxPower",
DoubleValue (23.0));
348 uePhy->SetAttribute (
"NoiseFigure",
DoubleValue (9.0));
352 Time simulationTime = Seconds (1.000);
362 NS_LOG_INFO (
"\tTest downlink control channels (PCFICH+PDCCH)");
365 for (
int i = 0; i < nUser; i++)
372 double bler = 1.0 - (dlRxPackets/dlTxPackets);
374 <<
" pkts rx " << dlRxPackets <<
" tx " << dlTxPackets
375 <<
" BLER " << bler <<
" Err " << fabs (
m_blerRef - bler));
380 double expectedMinDlTxPackets = simulationTime.
GetMilliSeconds () - 50;