Merge with 77acd352e7e6a4f482edfbd6982b06cd4dae2e72

This commit is contained in:
jnin
2011-05-16 12:21:56 +02:00
20 changed files with 1252 additions and 815 deletions

View File

@@ -48,5 +48,45 @@ Adaptive Modulation and Coding
Round Robin scheduler performance
---------------------------------
This system test program creates different test cases with a single eNB and several UEs, all having the same Radio Bearer specification. In each test case, the UEs see the same SINR from the eNB; different test cases are implemented by using different distance among UEs and the eNB (i.e., therefore having different SINR values) and different numbers of UEs. The test consists on checking that the obtained throughput performance is equal among users and matches a reference throughput value obtained according to the SINR perceived within a given tolerance.
The test vector is obtained according to the values of transport block size reported in table 7.1.7.2.1-1 of [TS36.213]_, considering an equal distribution of the physical resource block among the users using Resource Allocation Type 0 as defined in Section 7.1.6.1 of [TS36.213]_. Let :math:`\tau` be the TTI duration, :math:`N` be the number of UEs, :math:`B` the transmission bandwidth configuration in number of RBs, :math:`G` the RBG size, :math:`M` the modulation and coding scheme in use at the given SINR and :math:`S(M, B)` be the transport block size in bits as defined by 3GPP TS 36.213. We first calculate the number :math:`L` of RBGs allocated to each user as
.. math::
L = \left\lfloor \frac{B}{NG} \right\rfloor
The reference throughput (in bytes per second) :math:`T` in bps achieved by each UE is then calculated as
.. math::
T = \frac{S(M, L G)}{8 \; \tau}
Proportional Fair scheduler performance
---------------------------------------
This system test program creates different test cases with a single eNB, using the Proportional Fair (PF) scheduler, and several UEs, all having the same Radio Bearer specification. The test cases are grouped in two categories in order to evaluate both the performance in terms of adaptation to channel condition and from fairness perspective.
In the first category of test cases, the UEs are all placed at the same distance from the eNB, and hence all placed in order to have the same SINR. Different test cases are implemented by using a different SINR value and a different number of UEs. The test consists on checking that the obtained throughput performance matches with the known reference throughput up to a given tolerance. The expected behavior of the PF scheduler when all UEs have the same SNR is that each UE should get an equal fraction of the throughput obtainable by a single UE when using all the resources. We calculate the reference throughput value by dividing the throughput achievable by a single UE at the given SNR by the total number of UEs. Let :math:`\tau` be the TTI duration, :math:`B` the transmission bandwidth configuration in number of RBs, :math:`M` the modulation and coding scheme in use at the given SINR and :math:`S(M, B)` be the transport block size as defined in [TS36.213]_. The reference throughput :math:`T` achieved by each UE is calculated as
.. math::
T = \frac{S(M,B)}{\tau N}
The second category of tests is aimed at verify the fairness behavior in presence of UEs with different SINRs (and therefore different estimated throughput from PFS). The test consists of checking whether the throughput obtained by each UE over the whole simulation matches with the steady-state throughput expected by the PF scheduler according to the theory (see for instance [Kushner2004cpfsa]_).
Let :math:`Ri` the estimation done by PFS of the throughput of the :math:`i` UE for the next TTI according to the CQIs received and :math:`Ti` the throughput preceived by the :math:`i` UE . The test verifies that the ratio of the obtained throughput value respect to the global one (i.e. the sum of the ones of all users) is equal to the steady-state throughput of the PFS, that is
.. math::
K = \frac{Ri}{\sum_{k=1}^N Ri} = \frac{Ti}{\sum_{k=1}^N Ti}
References
**********
.. [TS36.213] 3GPP TS 36.213 "LTE Physical layer procedures"
.. [Kushner2004cpfsa] H.J. Kushner and P.A. Whiting, "Convergence of proportional-fair sharing algorithms under general conditions", IEEE Trans. on Wireless Communications, July 2004

View File

@@ -80,9 +80,11 @@ int McsToItbs[29] = {
// 3GPP TS 36.213 v8.8.0 Table 7.1.7.2.1-1: Transport block size table (dimension 27×110)
// for NPRB = 1 and Itbs = 6 the stadard returns 328, but it not consisent with the
// other values, therefore we used 88 obtained following the sequence of NPRB = 1 values
int TransportBlockSizeTable [110][27] = {
/* NPRB 001*/ { 16, 24, 32, 40, 56, 72, 328, 104, 120, 136, 144, 176, 208, 224, 256, 280, 328, 336, 376, 408, 440, 488, 520, 552, 584, 616, 712},
/* NPRB 001*/ { 16, 24, 32, 40, 56, 72, 88, 104, 120, 136, 144, 176, 208, 224, 256, 280, 328, 336, 376, 408, 440, 488, 520, 552, 584, 616, 712},
/* NPRB 002*/ { 32, 56, 72, 104, 120, 144, 176, 224, 256, 296, 328, 376, 440, 488, 552, 600, 632, 696, 776, 840, 904, 1000, 1064, 1128, 1192, 1256, 1480},
/* NPRB 003*/ { 56, 88, 144, 176, 208, 224, 256, 328, 392, 456, 504, 584, 680, 744, 840, 904, 968, 1064, 1160, 1288, 1384, 1480, 1608, 1736, 1800, 1864, 2216},
/* NPRB 004*/ { 88, 144, 176, 208, 256, 328, 392, 472, 536, 616, 680, 776, 904, 1000, 1128, 1224, 1288, 1416, 1544, 1736, 1864, 1992, 2152, 2280, 2408, 2536, 2984},

View File

@@ -145,6 +145,8 @@ LteInterference::ConditionallyEvaluateChunk ()
NS_LOG_DEBUG (this << " now " << Now () << " last " << m_lastChangeTime);
if (m_receiving && (Now () > m_lastChangeTime))
{
NS_LOG_LOGIC (this << " signal = " << *m_rxSignal << " allSignals = " << *m_allSignals << " noise = " << *m_noise);
SpectrumValue sinr = (*m_rxSignal) / ((*m_allSignals) - (*m_rxSignal) + (*m_noise));
Time duration = Now () - m_lastChangeTime;
for (std::list<Ptr<LteSinrChunkProcessor> >::const_iterator it = m_sinrChunkProcessorList.begin (); it != m_sinrChunkProcessorList.end (); ++it)
@@ -161,7 +163,7 @@ LteInterference::ConditionallyEvaluateChunk ()
void
LteInterference::SetNoisePowerSpectralDensity (Ptr<const SpectrumValue> noisePsd)
{
NS_LOG_FUNCTION (this << noisePsd);
NS_LOG_FUNCTION (this << *noisePsd);
m_noise = noisePsd;
// we can initialize m_allSignal only now, because earlier we
// didn't know what spectrum model was going to be used.

View File

@@ -107,6 +107,18 @@ LtePhy::GetDevice ()
NS_LOG_FUNCTION (this);
return m_netDevice;
}
Ptr<LteSpectrumPhy>
LtePhy::GetDownlinkSpectrumPhy ()
{
return m_downlinkSpectrumPhy;
}
Ptr<LteSpectrumPhy>
LtePhy::GetUplinkSpectrumPhy ()
{
return m_uplinkSpectrumPhy;
}
void

View File

@@ -75,6 +75,19 @@ public:
*/
Ptr<LteNetDevice> GetDevice ();
/**
*
* \return a pointer to the LteSpectrumPhy instance that manages the downlink
*/
Ptr<LteSpectrumPhy> GetDownlinkSpectrumPhy ();
/**
*
* \return a pointer to the LteSpectrumPhy instance that manages the uplink
*/
Ptr<LteSpectrumPhy> GetUplinkSpectrumPhy ();
/**
* \brief Queue the MAC PDU to be sent (according to m_macChTtiDelay)
* \param p the MAC PDU to sent

View File

@@ -237,7 +237,7 @@ LteSpectrumValueHelper::CreateTxPowerSpectralDensity (uint16_t earfcn, uint8_t t
// powerTx is expressed in dBm. We must convert it into natural unit.
double powerTxW = pow (10., (powerTx - 30) / 10);
double txPowerDensity = (powerTxW / GetChannelBandwidth (txBandwidthConfiguration));
double txPowerDensity = (powerTxW / (txBandwidthConfiguration * 180000));
for (std::vector <int>::iterator it = activeRbs.begin (); it != activeRbs.end (); it++)
{
@@ -263,10 +263,14 @@ Ptr<SpectrumValue>
LteSpectrumValueHelper::CreateNoisePowerSpectralDensity (double noiseFigureDb, Ptr<SpectrumModel> spectrumModel)
{
NS_LOG_FUNCTION (noiseFigureDb << spectrumModel);
double noiseFigureLinear = pow (10.0, noiseFigureDb / 10.0);
static const double BOLTZMANN = 1.3803e-23;
static const double ROOM_TEMPERATURE = 290.0;
double noisePowerSpectralDensity = noiseFigureLinear * BOLTZMANN * ROOM_TEMPERATURE; // W/Hz
// see "LTE - From theory to practice"
// Section 22.4.4.2 Thermal Noise and Receiver Noise Figure
const double kT_dBm_Hz = -174.0; // dBm/Hz
double kT_W_Hz = pow (10.0, (kT_dBm_Hz - 30)/10.0);
double noiseFigureLinear = pow (10.0, noiseFigureDb / 10.0);
double noisePowerSpectralDensity = kT_W_Hz * noiseFigureLinear;
Ptr<SpectrumValue> noisePsd = Create <SpectrumValue> (spectrumModel);
(*noisePsd) = noisePowerSpectralDensity;

View File

@@ -480,7 +480,7 @@ RrFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::Sched
std::vector <struct RlcPduListElement_s> newRlcPduLe;
int totRbg = lcNum * rbgPerFlow;
int tbSize = (LteAmc::GetTbSizeFromMcs (newDci.m_mcs.at (0), totRbg * rbgSize) / 8);
//NS_LOG_DEBUG (this << "Allocate user " << newEl.m_rnti << " LCs " << (uint16_t)(*itLcRnti).second << " bytes " << tbSize << " PRBs " << totRbg * rbgSize << " mcs " << (uint16_t) newDci.m_mcs.at (0));
NS_LOG_DEBUG (this << "Allocate user " << newEl.m_rnti << " LCs " << (uint16_t)(*itLcRnti).second << " bytes " << tbSize << " PRBs " << totRbg * rbgSize << " mcs " << (uint16_t) newDci.m_mcs.at (0));
uint16_t rlcPduSize = tbSize / lcNum;
for (int i = 0; i < lcNum ; i++)
{

View File

@@ -26,8 +26,13 @@
#include "ns3/mobility-helper.h"
#include "ns3/lena-helper.h"
#include "ns3/lte-ue-phy.h"
#include "ns3/lte-ue-net-device.h"
#include "ns3/lte-test-link-adaptation.h"
#include "lte-test-sinr-chunk-processor.h"
NS_LOG_COMPONENT_DEFINE ("LteLinkAdaptationTest");
using namespace ns3;
@@ -89,19 +94,19 @@ LteLinkAdaptationTestSuite::LteLinkAdaptationTestSuite ()
struct SnrEfficiencyMcs
{
double snr;
double snrDb;
double efficiency;
int mcsIndex;
};
/**
* Test vectors: SNR, Spectral Efficiency, MCS index
* Test vectors: SNRDB, Spectral Efficiency, MCS index
* From XXX
*/
SnrEfficiencyMcs snrEfficiencyMcs[] = {
// {-5.00000, 0.08024, -1},
// {-4.00000, 0.10030, -1},
// {-3.00000, 0.12518, -1},
{-5.00000, 0.08024, -1},
{-4.00000, 0.10030, -1},
{-3.00000, 0.12518, -1},
{-2.00000, 0.15589, 0},
{-1.00000, 0.19365, 0},
{0.00000, 0.23983, 2},
@@ -139,30 +144,21 @@ LteLinkAdaptationTestSuite::LteLinkAdaptationTestSuite ()
int numOfTests = sizeof (snrEfficiencyMcs) / sizeof (SnrEfficiencyMcs);
double txPowerDbm = 30; // default eNB TX power over whole bandwdith
double ktDbm = -174; // reference LTE noise PSD
double noisePowerDbm = ktDbm + 10*log10(25*180000); // corresponds to kT*bandwidth in linear units
double receiverNoiseFigureDb = 9.0; // default UE noise figure
for ( int i = 0 ; i < numOfTests; i++ )
{
/**
* SNR (in dB)
*
* SNR = P_tx - loss - noise - receiverNoiseFigure
*
* loss = P_tx - SNR - noise - receiverNoiseFigure
*
* where: P_tx is transmission power
* loss in (dB)
* noise
*/
double noiseDb = -107.5;
double receiverNoiseFigureDb = 5.0;
double lossDb = 30.0 - snrEfficiencyMcs[i].snr - noiseDb - receiverNoiseFigureDb;
{
double lossDb = txPowerDbm - snrEfficiencyMcs[i].snrDb - noisePowerDbm - receiverNoiseFigureDb;
double lossLinear = pow (10, lossDb / 10);
double distance = ( ( 3e8 * sqrt ( lossLinear ) ) / ( 4.0 * M_PI * 2.160e9 ) );
std::ostringstream name;
name << "link adaptation"
<< " snr= " << snrEfficiencyMcs[i].snr
name << " snr= " << snrEfficiencyMcs[i].snrDb << " dB, "
<< " mcs= " << snrEfficiencyMcs[i].mcsIndex;
AddTestCase (new LteLinkAdaptationTestCase (name.str (), snrEfficiencyMcs[i].snr, lossDb, distance, snrEfficiencyMcs[i].mcsIndex));
AddTestCase (new LteLinkAdaptationTestCase (name.str (), snrEfficiencyMcs[i].snrDb, lossDb, distance, snrEfficiencyMcs[i].mcsIndex));
}
}
@@ -174,15 +170,15 @@ static LteLinkAdaptationTestSuite lteLinkAdaptationTestSuite;
* TestCase
*/
LteLinkAdaptationTestCase::LteLinkAdaptationTestCase (std::string name, double snr, double loss, double distance, uint16_t mcsIndex)
LteLinkAdaptationTestCase::LteLinkAdaptationTestCase (std::string name, double snrDb, double loss, double distance, uint16_t mcsIndex)
: TestCase (name),
m_snr (snr),
m_snrDb (snrDb),
m_loss (loss),
m_distance (distance),
m_mcsIndex (mcsIndex)
{
std::ostringstream sstream1, sstream2;
sstream1 << " snr=" << snr
sstream1 << " snr=" << snrDb
<< " mcs=" << mcsIndex;
NS_LOG_UNCOND ("Creating LteLinkAdaptationTestCase: " + sstream1.str ());
@@ -195,44 +191,46 @@ LteLinkAdaptationTestCase::~LteLinkAdaptationTestCase ()
void
LteLinkAdaptationTestCase::DoRun (void)
{
LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL_ALL);
LogComponentEnable ("LteAmc", logLevel);
LogComponentEnable ("LteLinkAdaptationTest", logLevel);
// LogComponentEnable ("LteEnbRrc", logLevel);
// LogComponentEnable ("LteUeRrc", logLevel);
// LogComponentEnable ("LteEnbMac", logLevel);
// LogComponentEnable ("LteUeMac", logLevel);
// LogComponentEnable ("LteRlc", logLevel);
// LogComponentEnable ("RrPacketScheduler", logLevel);
// LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL_ALL);
// LogComponentEnable ("LteAmc", logLevel);
// LogComponentEnable ("LteLinkAdaptationTest", logLevel);
// LogComponentEnable ("LteEnbRrc", logLevel);
// LogComponentEnable ("LteUeRrc", logLevel);
// LogComponentEnable ("LteEnbMac", logLevel);
// LogComponentEnable ("LteUeMac", logLevel);
// LogComponentEnable ("LteRlc", logLevel);
// LogComponentEnable ("RrPacketScheduler", logLevel);
// LogComponentEnable ("RrFfMacScheduler", logLevel);
// LogComponentEnable ("RrFfMacScheduler", logLevel);
// LogComponentEnable ("LtePhy", logLevel);
// LogComponentEnable ("LteEnbPhy", logLevel);
// LogComponentEnable ("LteUePhy", logLevel);
// LogComponentEnable ("LtePhy", logLevel);
// LogComponentEnable ("LteEnbPhy", logLevel);
// LogComponentEnable ("LteUePhy", logLevel);
// LogComponentEnable ("LteSpectrumValueHelper", logLevel);
// LogComponentEnable ("LteSpectrumPhy", logLevel);
// LogComponentEnable ("LteInterference", logLevel);
// LogComponentEnable ("LteSinrChunkProcessor", logLevel);
// LogComponentEnable ("LteSpectrumValueHelper", logLevel);
// LogComponentEnable ("LteSpectrumPhy", logLevel);
// LogComponentEnable ("LteInterference", logLevel);
// LogComponentEnable ("LteSinrChunkProcessor", logLevel);
// LogComponentEnable ("LteTestSinrChunkProcessor", logLevel);
// LogComponentEnable ("LtePropagationLossModel", logLevel);
// LogComponentEnable ("LossModel", logLevel);
// LogComponentEnable ("ShadowingLossModel", logLevel);
// LogComponentEnable ("PenetrationLossModel", logLevel);
// LogComponentEnable ("MultipathLossModel", logLevel);
// LogComponentEnable ("PathLossModel", logLevel);
// LogComponentEnable ("FriisSpectrumPropagationLossModel", logLevel);
// LogComponentEnable ("ConstantSpectrumPropagationLossModel", logLevel);
// LogComponentEnable ("LtePropagationLossModel", logLevel);
// LogComponentEnable ("LossModel", logLevel);
// LogComponentEnable ("ShadowingLossModel", logLevel);
// LogComponentEnable ("PenetrationLossModel", logLevel);
// LogComponentEnable ("MultipathLossModel", logLevel);
// LogComponentEnable ("PathLossModel", logLevel);
// LogComponentEnable ("FriisSpectrumPropagationLossModel", logLevel);
// LogComponentEnable ("ConstantSpectrumPropagationLossModel", logLevel);
// LogComponentEnable ("LteNetDevice", logLevel);
// LogComponentEnable ("LteUeNetDevice", logLevel);
// LogComponentEnable ("LteEnbNetDevice", logLevel);
// LogComponentEnable ("LteNetDevice", logLevel);
// LogComponentEnable ("LteUeNetDevice", logLevel);
// LogComponentEnable ("LteEnbNetDevice", logLevel);
// LogComponentEnable ("MobilityModel", logLevel);
// LogComponentEnable ("ConstantPositionMobilityModel", logLevel);
// LogComponentEnable ("MultiModelSpectrumChannel", logLevel);
// LogComponentEnable ("SingleModelSpectrumChannel", logLevel);
// LogComponentEnable ("MobilityModel", logLevel);
// LogComponentEnable ("ConstantPositionMobilityModel", logLevel);
// LogComponentEnable ("MultiModelSpectrumChannel", logLevel);
// LogComponentEnable ("SingleModelSpectrumChannel", logLevel);
/**
* Simulation Topology
@@ -243,7 +241,7 @@ LteLinkAdaptationTestCase::DoRun (void)
lena->EnableMacTraces ();
lena->EnableRlcTraces ();
lena->SetAttribute ("PropagationModel", StringValue ("ns3::ConstantSpectrumPropagationLossModel"));
NS_LOG_INFO ("SNR = " << m_snr << " LOSS = " << m_loss);
NS_LOG_INFO ("SNR = " << m_snrDb << " LOSS = " << m_loss);
lena->SetPropagationModelAttribute ("Loss", DoubleValue (m_loss));
// Create Nodes: eNodeB and UE
@@ -280,15 +278,24 @@ LteLinkAdaptationTestCase::DoRun (void)
lena->ActivateEpsBearer (ueDevs, bearer);
// this is to test that the SNR is as intended
Ptr<LtePhy> uePhy = ueDevs.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
Ptr<LteTestSinrChunkProcessor> testSinr = Create<LteTestSinrChunkProcessor> (uePhy);
uePhy->GetDownlinkSpectrumPhy ()->AddSinrChunkProcessor (testSinr);
Config::Connect ("/NodeList/0/DeviceList/0/LteEnbMac/DlScheduling",
MakeBoundCallback(&LteTestDlSchedulingCallback, this));
Simulator::Stop (Seconds (0.005));
//Simulator::Stop (Seconds (0.01));
Simulator::Stop (Seconds (0.005));
//Simulator::Stop (Seconds (0.01));
// Simulator::Stop (Seconds (0.1));
/* Simulator::Stop (Seconds (2.0));*/
// Simulator::Stop (Seconds (10.0));
Simulator::Run ();
double calculatedSinrDb = 10.0 * log10 (testSinr->GetSinr ()[0]);
NS_TEST_ASSERT_MSG_EQ_TOL (calculatedSinrDb, m_snrDb, 0.0000001, "Wrong SINR !");
Simulator::Destroy ();
}
@@ -318,7 +325,7 @@ LteLinkAdaptationTestCase::DlScheduling (uint32_t frameNo, uint32_t subframeNo,
// << (uint16_t)mcsTb1 << "\t" << sizeTb1 << "\t"
// << (uint16_t)mcsTb2 << "\t" << sizeTb2);
NS_LOG_UNCOND (m_snr << "\t" << m_mcsIndex << "\t" << (uint16_t)mcsTb1);
NS_LOG_UNCOND (m_snrDb << "\t" << m_mcsIndex << "\t" << (uint16_t)mcsTb1);
NS_TEST_ASSERT_MSG_EQ ((uint16_t)mcsTb1, m_mcsIndex, "Wrong MCS index");
}

View File

@@ -40,7 +40,7 @@ public:
class LteLinkAdaptationTestCase : public TestCase
{
public:
LteLinkAdaptationTestCase (std::string name, double snr, double loss, double distance, uint16_t mcsIndex);
LteLinkAdaptationTestCase (std::string name, double snrDb, double loss, double distance, uint16_t mcsIndex);
LteLinkAdaptationTestCase ();
virtual ~LteLinkAdaptationTestCase ();
@@ -50,7 +50,7 @@ class LteLinkAdaptationTestCase : public TestCase
private:
virtual void DoRun (void);
double m_snr;
double m_snrDb;
double m_loss;
double m_distance;
uint16_t m_mcsIndex;

View File

@@ -49,8 +49,15 @@ LenaTestPfFfMacSchedulerSuite::LenaTestPfFfMacSchedulerSuite ()
: TestSuite ("lte-test-pf-ff-mac-scheduler", SYSTEM)
{
SetVerbose (true);
NS_LOG_INFO ("creating LenaPfFfMacSchedulerTestCase");
NS_LOG_INFO ("creating LenaTestPfFfMacSchedulerSuite");
// 0 mt -> mcs 28
// 3000 mt -> mcs 22
// 6000 mt -> mcs 16
// 9000 mt -> mcs 12
// 15000 mt -> mcs 6
//Test Case 1: AMC works in PF
// DISTANCE 0 -> MCS 28 -> Itbs 26 (from table 7.1.7.2.1-1 of 36.213)
// 1 user -> 24 PRB at Itbs 26 -> 2196 -> 2196000 bytes/sec
@@ -58,82 +65,101 @@ LenaTestPfFfMacSchedulerSuite::LenaTestPfFfMacSchedulerSuite ()
// 6 users -> 2196000 among 6 users -> 366000 bytes/sec
// 12 users -> 2196000 among 12 users -> 183000 bytes/sec
// 15 users -> 2196000 among 15 users -> 146400 bytes/sec
AddTestCase (new LenaPfFfMacSchedulerTestCase (1,0,0,2196000));
AddTestCase (new LenaPfFfMacSchedulerTestCase (3,0,0,732000));
AddTestCase (new LenaPfFfMacSchedulerTestCase (6,0,0,366000));
AddTestCase (new LenaPfFfMacSchedulerTestCase (12,0,0,183000));
AddTestCase (new LenaPfFfMacSchedulerTestCase (15,0,0,146400));
// DISTANCE 6000 -> MCS 24 -> Itbs 22 (from table 7.1.7.2.1-1 of 36.213)
// 1 user -> 24 PRB at Itbs 22 -> 1572 -> 1572000 bytes/sec
// 3 users -> 1572000 among 3 users -> 524000 bytes/sec
// 6 users -> 1572000 among 6 users -> 262000 bytes/sec
// 12 users -> 1572000 among 12 users -> 131000 bytes/sec
// 15 users -> 1572000 among 15 users -> 104800 bytes/sec
AddTestCase (new LenaPfFfMacSchedulerTestCase (1,0,6000,1572000));
AddTestCase (new LenaPfFfMacSchedulerTestCase (3,0,6000,524000));
AddTestCase (new LenaPfFfMacSchedulerTestCase (6,0,6000,262000));
AddTestCase (new LenaPfFfMacSchedulerTestCase (12,0,6000,131000));
AddTestCase (new LenaPfFfMacSchedulerTestCase (15,0,6000,104800));
// DISTANCE 9000 -> MCS 10 -> Itbs 9 (from table 7.1.7.2.1-1 of 36.213)
// 1 user -> 24 PRB at Itbs 9 -> 469 -> 469000 bytes/sec
// 3 users -> 469000 among 3 users -> 156333 bytes/sec
// 6 users -> 469000 among 6 users -> 78166 bytes/sec
// 12 users -> 469000 among 12 users -> 39083 bytes/sec
// 15 users -> 469000 among 15 users -> 31266 bytes/sec
AddTestCase (new LenaPfFfMacSchedulerTestCase (1,0,9000,469000));
AddTestCase (new LenaPfFfMacSchedulerTestCase (3,0,9000,156333));
AddTestCase (new LenaPfFfMacSchedulerTestCase (6,0,9000,78166));
AddTestCase (new LenaPfFfMacSchedulerTestCase (12,0,9000,39083));
AddTestCase (new LenaPfFfMacSchedulerTestCase (15,0,9000,31266));
// DISTANCE 15000 -> MCS 4 -> Itbs 4 (from table 7.1.7.2.1-1 of 36.213)
// 1 user -> 24 PRB at Itbs 4 -> 217 -> 217000 bytes/sec
// 3 users -> 217000 among 3 users -> 72333 bytes/sec
// 6 users -> 217000 among 6 users -> 36166 bytes/sec
// 12 users -> 217000 among 12 users -> 18083 bytes/sec
// 15 users -> 217000 among 15 users -> 14466 bytes/sec
AddTestCase (new LenaPfFfMacSchedulerTestCase (1,0,15000,217000));
AddTestCase (new LenaPfFfMacSchedulerTestCase (3,0,15000,72333));
AddTestCase (new LenaPfFfMacSchedulerTestCase (6,0,15000,36166));
AddTestCase (new LenaPfFfMacSchedulerTestCase (12,0,15000,18083));
AddTestCase (new LenaPfFfMacSchedulerTestCase (15,0,15000,14466));
// DISTANCE 20000 -> MCS 2 -> Itbs 2 (from table 7.1.7.2.1-1 of 36.213)
// 1 user -> 24 PRB at Itbs 2 -> 133 -> 133000 bytes/sec
// 3 users -> 217000 among 3 users -> 44333 bytes/sec
// 6 users -> 217000 among 6 users -> 22166 bytes/sec
// 12 users -> 217000 among 12 users -> 11083 bytes/sec
// 15 users -> 217000 among 15 users -> 8866 bytes/sec
AddTestCase (new LenaPfFfMacSchedulerTestCase (1,0,20000,133000));
AddTestCase (new LenaPfFfMacSchedulerTestCase (3,0,20000,44333));
AddTestCase (new LenaPfFfMacSchedulerTestCase (6,0,20000,22166));
AddTestCase (new LenaPfFfMacSchedulerTestCase (12,0,20000,11083));
AddTestCase (new LenaPfFfMacSchedulerTestCase (15,0,20000,8866));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (1,0,0,2196000));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (3,0,0,732000));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (6,0,0,366000));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (12,0,0,183000));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (15,0,0,146400));
// DISTANCE 3000 -> MCS 24 -> Itbs 30 (from table 7.1.7.2.1-1 of 36.213)
// 1 user -> 24 PRB at Itbs 20 -> 1383 -> 1383000 bytes/sec
// 3 users -> 1383000 among 3 users -> 461000 bytes/sec
// 6 users -> 1383000 among 6 users -> 230500 bytes/sec
// 12 users -> 1383000 among 12 users -> 115250 bytes/sec
// 15 users -> 1383000 among 15 users -> 92200 bytes/sec
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (1,0,3000,1383000));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (3,0,3000,461000));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (6,0,3000,230500));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (12,0,3000,115250));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (15,0,3000,92200));
// DISTANCE 6000 -> MCS 16 -> Itbs 15 (from table 7.1.7.2.1-1 of 36.213)
// 1 user -> 24 PRB at Itbs 15 -> 903 -> 903000 bytes/sec
// 3 users -> 903000 among 3 users -> 301000 bytes/sec
// 6 users -> 903000 among 6 users -> 150500 bytes/sec
// 12 users -> 903000 among 12 users -> 75250 bytes/sec
// 15 users -> 903000 among 15 users -> 60200 bytes/sec
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (1,0,6000,903000));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (3,0,6000,301000));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (6,0,6000,150500));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (12,0,6000,75250));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (15,0,6000,60200));
// DISTANCE 9000 -> MCS 12 -> Itbs 11 (from table 7.1.7.2.1-1 of 36.213)
// 1 user -> 24 PRB at Itbs 11 -> 597 -> 597000 bytes/sec
// 3 users -> 597000 among 3 users -> 199000 bytes/sec
// 6 users -> 597000 among 6 users -> 99500 bytes/sec
// 12 users -> 597000 among 12 users -> 49750 bytes/sec
// 15 users -> 597000 among 15 users -> 39800 bytes/sec
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (1,0,9000,597000));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (3,0,9000,199000));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (6,0,9000,99500));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (12,0,9000,49750));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (15,0,9000,39800));
// DISTANCE 15000 -> MCS 6 -> Itbs 6 (from table 7.1.7.2.1-1 of 36.213)
// 1 user -> 24 PRB at Itbs 6 -> 309 -> 309000 bytes/sec
// 3 users -> 309000 among 3 users -> 103000 bytes/sec
// 6 users -> 309000 among 6 users -> 51500 bytes/sec
// 12 users -> 309000 among 12 users -> 25750 bytes/sec
// 15 users -> 309000 among 15 users -> 20600 bytes/sec
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (1,0,15000,309000));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (3,0,15000,103000));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (6,0,15000,51500));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (12,0,15000,25750));
AddTestCase (new LenaPfFfMacSchedulerTestCase1 (15,0,15000,20600));
// Test Case 2: fairness check
std::vector<uint16_t> dist;
dist.push_back (0); // User 0 distance
dist.push_back (3000); // User 1 distance
dist.push_back (6000); // User 2 distance
dist.push_back (9000); // User 3 distance
dist.push_back (15000); // User 4 distance
std::vector<uint32_t> estThrPf;
estThrPf.push_back (89000); // User 0 estimated TTI throughput from PF
estThrPf.push_back (55000); // User 1 estimated TTI throughput from PF
estThrPf.push_back (35000); // User 2 estimated TTI throughput from PF
estThrPf.push_back (22000); // User 3 estimated TTI throughput from PF
estThrPf.push_back (11000); // User 4 estimated TTI throughput from PF
AddTestCase (new LenaPfFfMacSchedulerTestCase2 (5,dist,estThrPf));
}
static LenaTestPfFfMacSchedulerSuite lenaTestPfFfMacSchedulerSuite;
LenaPfFfMacSchedulerTestCase::LenaPfFfMacSchedulerTestCase (uint16_t nUser, uint16_t nLc, uint16_t dist, double thrRef)
// --------------- T E S T - C A S E # 1 ------------------------------
LenaPfFfMacSchedulerTestCase1::LenaPfFfMacSchedulerTestCase1 (uint16_t nUser, uint16_t nLc, uint16_t dist, double thrRef)
: TestCase ("Proportional Fair (PF) Mac Scheduler Test Case"),
m_nUser (nUser),
m_nLc (nLc),
m_dist (dist),
m_thrRef (thrRef)
{
}
LenaPfFfMacSchedulerTestCase::~LenaPfFfMacSchedulerTestCase ()
LenaPfFfMacSchedulerTestCase1::~LenaPfFfMacSchedulerTestCase1 ()
{
}
void
LenaPfFfMacSchedulerTestCase::DoRun (void)
LenaPfFfMacSchedulerTestCase1::DoRun (void)
{
// LogComponentEnable ("LteEnbRrc", LOG_LEVEL_ALL);
// LogComponentEnable ("LteUeRrc", LOG_LEVEL_ALL);
@@ -160,7 +186,7 @@ LenaPfFfMacSchedulerTestCase::DoRun (void)
// LogComponentEnable ("LteUeNetDevice", LOG_LEVEL_ALL);
// LogComponentEnable ("LteEnbNetDevice", LOG_LEVEL_ALL);
// LogComponentEnable ("PfFfMacScheduler", LOG_LEVEL_ALL);
// LogComponentEnable ("PfFfMacScheduler", LOG_LEVEL_ALL);
LogComponentEnable ("LenaTestPfFfMacCheduler", LOG_LEVEL_ALL);
// LogComponentEnable ("LteAmc", LOG_LEVEL_ALL);
// LogComponentEnable ("RlcStatsCalculator", LOG_LEVEL_ALL);
@@ -232,7 +258,12 @@ LenaPfFfMacSchedulerTestCase::DoRun (void)
dlDataRxed.push_back (rlcStats->GetDlRxData (imsi, lcId));
NS_LOG_INFO ("\tUser " << i << " imsi " << imsi << " bytes rxed " << (double)dlDataRxed.at (i) << " thr " << (double)dlDataRxed.at (i) / simulationTime << " ref " << m_thrRef);
}
/**
* Check that the assignation is done in a "proportional fair" manner among users
* with equal SINRs: the bandwidht should be distributed according to the
* ratio of the estimated throughput per TTI of each user; therefore equally
* partitioning the whole bandwidth achievable from a single users in a TTI
*/
for (int i = 0; i < m_nUser; i++)
{
NS_TEST_ASSERT_MSG_EQ_TOL ((double)dlDataRxed.at (i) / simulationTime, m_thrRef, m_thrRef * tolerance, " Unfair Throughput!");
@@ -243,3 +274,143 @@ LenaPfFfMacSchedulerTestCase::DoRun (void)
}
// --------------- T E S T - C A S E # 2 ------------------------------
LenaPfFfMacSchedulerTestCase2::LenaPfFfMacSchedulerTestCase2 (uint16_t nUser, std::vector<uint16_t> dist, std::vector<uint32_t> estThrPf)
: TestCase ("Proportional Fair (PF) Mac Scheduler Test Case"),
m_nUser (nUser),
m_dist (dist),
m_estThrPf (estThrPf)
{
}
LenaPfFfMacSchedulerTestCase2::~LenaPfFfMacSchedulerTestCase2 ()
{
}
void
LenaPfFfMacSchedulerTestCase2::DoRun (void)
{
// LogComponentEnable ("LteEnbRrc", LOG_LEVEL_ALL);
// LogComponentEnable ("LteUeRrc", LOG_LEVEL_ALL);
// LogComponentEnable ("LteEnbMac", LOG_LEVEL_ALL);
// LogComponentEnable ("LteUeMac", LOG_LEVEL_ALL);
// LogComponentEnable ("LteRlc", LOG_LEVEL_ALL);
//
// LogComponentEnable ("LtePhy", LOG_LEVEL_ALL);
// LogComponentEnable ("LteEnbPhy", LOG_LEVEL_ALL);
// LogComponentEnable ("LteUePhy", LOG_LEVEL_ALL);
// LogComponentEnable ("LteSpectrumPhy", LOG_LEVEL_ALL);
// LogComponentEnable ("LteInterference", LOG_LEVEL_ALL);
// LogComponentEnable ("LteSinrChunkProcessor", LOG_LEVEL_ALL);
//
// LogComponentEnable ("LtePropagationLossModel", LOG_LEVEL_ALL);
// LogComponentEnable ("LossModel", LOG_LEVEL_ALL);
// LogComponentEnable ("ShadowingLossModel", LOG_LEVEL_ALL);
// LogComponentEnable ("PenetrationLossModel", LOG_LEVEL_ALL);
// LogComponentEnable ("MultipathLossModel", LOG_LEVEL_ALL);
// LogComponentEnable ("PathLossModel", LOG_LEVEL_ALL);
//
// LogComponentEnable ("LteNetDevice", LOG_LEVEL_ALL);
// LogComponentEnable ("LteUeNetDevice", LOG_LEVEL_ALL);
// LogComponentEnable ("LteEnbNetDevice", LOG_LEVEL_ALL);
// LogComponentEnable ("PfFfMacScheduler", LOG_LEVEL_ALL);
LogComponentEnable ("LenaTestPfFfMacCheduler", LOG_LEVEL_ALL);
// LogComponentEnable ("LteAmc", LOG_LEVEL_ALL);
// LogComponentEnable ("RlcStatsCalculator", LOG_LEVEL_ALL);
/**
* Initialize Simulation Scenario: 1 eNB and m_nUser UEs
*/
SetVerbose (true);
Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
// Create Nodes: eNodeB and UE
NodeContainer enbNodes;
NodeContainer ueNodes;
enbNodes.Create (1);
ueNodes.Create (m_nUser);
// Install Mobility Model
MobilityHelper mobility;
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (enbNodes);
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (ueNodes);
// Create Devices and install them in the Nodes (eNB and UE)
NetDeviceContainer enbDevs;
NetDeviceContainer ueDevs;
lena->SetSchedulerType ("ns3::PfFfMacScheduler");
enbDevs = lena->InstallEnbDevice (enbNodes);
ueDevs = lena->InstallUeDevice (ueNodes);
// Attach a UE to a eNB
lena->Attach (ueDevs, enbDevs.Get (0));
// Activate an EPS bearer
enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
EpsBearer bearer (q);
lena->ActivateEpsBearer (ueDevs, bearer);
// position nodes
for (int i = 0; i < m_nUser; i++)
{
Ptr<ConstantPositionMobilityModel> mm = ueNodes.Get (i)->GetObject<ConstantPositionMobilityModel> ();
mm->SetPosition (Vector (m_dist.at (i), 0.0, 0.0));
}
lena->EnableDlRlcTraces();
double simulationTime = 0.4;
double tolerance = 0.1;
Simulator::Stop (Seconds (simulationTime));
Ptr<RlcStatsCalculator> rlcStats = lena->GetRlcStats ();
rlcStats->SetAttribute("EpochDuration", TimeValue(Seconds(simulationTime)));
Simulator::Run ();
NS_LOG_INFO("Test with " << m_nUser << " user(s)");
std::vector <uint64_t> dlDataRxed;
double totalData = 0;
double totalEstThrPf = 0;
for (int i = 0; i < m_nUser; i++)
{
// get the imsi
uint64_t imsi = ueDevs.Get (i)-> GetObject<LteUeNetDevice> ()->GetImsi ();
// get the lcId
uint8_t lcId = ueDevs.Get (i)-> GetObject<LteUeNetDevice> ()->GetRrc ()->GetLcIdVector ().at(0);
dlDataRxed.push_back (rlcStats->GetDlRxData (imsi, lcId));
totalData += (double)dlDataRxed.at (i);
NS_LOG_INFO ("\tUser " << i << " dist " << m_dist.at (i) << " imsi " << imsi << " bytes rxed " << (double)dlDataRxed.at (i) << " thr " << (double)dlDataRxed.at (i) / simulationTime << " ref " << m_nUser);
totalEstThrPf += m_estThrPf.at (i);
}
/**
* Check that the assignation is done in a "proportional fair" manner among users
* with different SINRs: the bandwidht should be distributed according to the
* ratio of the estimated throughput per TTI of each user.
*/
for (int i = 0; i < m_nUser; i++)
{
double thrRatio = (double)dlDataRxed.at (i) / totalData;
double estThrRatio = (double)m_estThrPf.at (i) / totalEstThrPf;
NS_LOG_INFO ("User " << i << " thrRatio " << thrRatio << " estThrRatio " << estThrRatio);
NS_TEST_ASSERT_MSG_EQ_TOL (estThrRatio, thrRatio, tolerance, " Unfair Throughput!");
}
Simulator::Destroy ();
}

View File

@@ -37,11 +37,11 @@ using namespace ns3;
* is equal among users is consistent with the definition of proportional
* fair scheduling
*/
class LenaPfFfMacSchedulerTestCase : public TestCase
class LenaPfFfMacSchedulerTestCase1 : public TestCase
{
public:
LenaPfFfMacSchedulerTestCase (uint16_t nUser, uint16_t nLc, uint16_t dist, double thrRef);
virtual ~LenaPfFfMacSchedulerTestCase ();
LenaPfFfMacSchedulerTestCase1 (uint16_t nUser, uint16_t nLc, uint16_t dist, double thrRef);
virtual ~LenaPfFfMacSchedulerTestCase1 ();
private:
virtual void DoRun (void);
@@ -52,6 +52,21 @@ class LenaPfFfMacSchedulerTestCase : public TestCase
};
class LenaPfFfMacSchedulerTestCase2 : public TestCase
{
public:
LenaPfFfMacSchedulerTestCase2 (uint16_t nUser, std::vector<uint16_t> dist, std::vector<uint32_t> estThrPf);
virtual ~LenaPfFfMacSchedulerTestCase2 ();
private:
virtual void DoRun (void);
uint16_t m_nUser;
std::vector<uint16_t> m_dist;
std::vector<uint32_t> m_estThrPf;
};
class LenaTestPfFfMacSchedulerSuite : public TestSuite
{

View File

@@ -66,61 +66,61 @@ LenaTestRrFfMacSchedulerSuite::LenaTestRrFfMacSchedulerSuite ()
AddTestCase (new LenaRrFfMacSchedulerTestCase (12,0,0,185000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (15,0,0,148000));
// DISTANCE 6000 -> MCS 24 -> Itbs 22 (from table 7.1.7.2.1-1 of 36.213)
// 1 user -> 24 PRB at Itbs 22 -> 1572 -> 1572000 bytes/sec
// 3 users -> 8 PRB at Itbs 22 -> 533 -> 533000 bytes/sec
// 6 users -> 4 PRB at Itbs 22 -> 269 -> 269000 bytes/sec
// 9 user -> 2 PRB at Itbs 22 -> 133 -> 133000 bytes/sec
// 12 users -> 2 PRB at Itbs 22 -> 133 -> 133000 bytes/sec
// 15 users -> 2 PRB at Itbs 22 * 0.8 -> 106.4 -> 106400 bytes/sec
AddTestCase (new LenaRrFfMacSchedulerTestCase (1,0,6000,1572000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (3,0,6000,533000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (6,0,6000,269000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (9,0,6000,133000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (12,0,6000,133000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (15,0,6000,106400));
// DISTANCE 3000 -> MCS 22 -> Itbs 20 (from table 7.1.7.2.1-1 of 36.213)
// 1 user -> 24 PRB at Itbs 20 -> 1383 -> 1383000 bytes/sec
// 3 users -> 8 PRB at Itbs 20 -> 469 -> 469000 bytes/sec
// 6 users -> 4 PRB at Itbs 20 -> 233 -> 233000 bytes/sec
// 9 user -> 2 PRB at Itbs 20 -> 113 -> 113000 bytes/sec
// 12 users -> 2 PRB at Itbs 20 -> 113 -> 113000 bytes/sec
// 15 users -> 2 PRB at Itbs 20 * 0.8 -> 90.4 -> 90400 bytes/sec
AddTestCase (new LenaRrFfMacSchedulerTestCase (1,0,3000,1383000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (3,0,3000,469000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (6,0,3000,233000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (9,0,3000,113000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (12,0,3000,113000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (15,0,3000,90400));
// DISTANCE 9000 -> MCS 10 -> Itbs 9 (from table 7.1.7.2.1-1 of 36.213)
// 1 user -> 24 PRB at Itbs 9 -> 469 -> 469000 bytes/sec
// 3 users -> 8 PRB at Itbs 9 -> 157 -> 157000 bytes/sec
// 6 users -> 4 PRB at Itbs 9 -> 77 -> 77000 bytes/sec
// 9 user -> 2 PRB at Itbs 9 -> 37 -> 37000 bytes/sec
// 12 users -> 2 PRB at Itbs 9 -> 37 -> 37000 bytes/sec
// 15 users -> 2 PRB at Itbs 9 * 0.8 -> 29.6 -> 29600 bytes/sec
AddTestCase (new LenaRrFfMacSchedulerTestCase (1,0,9000,469000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (3,0,9000,157000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (6,0,9000,77000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (9,0,9000,37000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (12,0,9000,37000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (15,0,9000,29600));
// DISTANCE 6000 -> MCS 16 -> Itbs 15 (from table 7.1.7.2.1-1 of 36.213)
// 1 user -> 24 PRB at Itbs 15 -> 903 -> 903000 bytes/sec
// 3 users -> 8 PRB at Itbs 15 -> 309 -> 309000 bytes/sec
// 6 users -> 4 PRB at Itbs 15 -> 153 -> 153000 bytes/sec
// 9 user -> 2 PRB at Itbs 15 -> 75 -> 75000 bytes/sec
// 12 users -> 2 PRB at Itbs 15 -> 75 -> 75000 bytes/sec
// 15 users -> 2 PRB at Itbs 15 * 0.8 -> 60 -> 60000 bytes/sec
AddTestCase (new LenaRrFfMacSchedulerTestCase (1,0,6000,903000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (3,0,6000,309000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (6,0,6000,153000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (9,0,6000,75000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (12,0,6000,75000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (15,0,6000,60000));
// DISTANCE 15000 -> MCS 4 -> Itbs 4 (from table 7.1.7.2.1-1 of 36.213)
// 1 user -> 24 PRB at Itbs 4 -> 217 -> 217000 bytes/sec
// 3 users -> 8 PRB at Itbs 4 -> 69 -> 69000 bytes/sec
// 6 users -> 4 PRB at Itbs 4 -> 32 -> 32000 bytes/sec
// 9 user -> 2 PRB at Itbs 4 -> 15 -> 15000 bytes/sec
// 12 users -> 2 PRB at Itbs 4 -> 15 -> 15000 bytes/sec
// 15 users -> 2 PRB at Itbs 4 * 0.8 -> 12 -> 12000 bytes/sec
AddTestCase (new LenaRrFfMacSchedulerTestCase (1,0,15000,217000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (3,0,15000,69000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (6,0,15000,32000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (9,0,15000,15000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (12,0,15000,15000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (15,0,15000,12000));
// DISTANCE 9000 -> MCS 12 -> Itbs 11 (from table 7.1.7.2.1-1 of 36.213)
// 1 user -> 24 PRB at Itbs 11 -> 597 -> 597000 bytes/sec
// 3 users -> 8 PRB at Itbs 11 -> 201 -> 201000 bytes/sec
// 6 users -> 4 PRB at Itbs 11 -> 97 -> 97000 bytes/sec
// 9 user -> 2 PRB at Itbs 11 -> 47 -> 47000 bytes/sec
// 12 users -> 2 PRB at Itbs 11 -> 47 -> 47000 bytes/sec
// 15 users -> 2 PRB at Itbs 11 * 0.8 -> 37.6 -> 37600 bytes/sec
AddTestCase (new LenaRrFfMacSchedulerTestCase (1,0,9000,597000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (3,0,9000,201000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (6,0,9000,97000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (9,0,9000,47000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (12,0,9000,47000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (15,0,9000,37600));
// DISTANCE 20000 -> MCS 2 -> Itbs 2 (from table 7.1.7.2.1-1 of 36.213)
// 1 user -> 24 PRB at Itbs 2 -> 133 -> 133000 bytes/sec
// 3 users -> 8 PRB at Itbs 2 -> 41 -> 41000 bytes/sec
// 6 users -> 4 PRB at Itbs 2 -> 22 -> 22000 bytes/sec
// 9 user -> 2 PRB at Itbs 2 -> 9 -> 9000 bytes/sec
// 12 users -> 2 PRB at Itbs 2 -> 9 -> 9000 bytes/sec
// 15 users -> 2 PRB at Itbs 2 * 0.8 -> 7.2 -> 7200 bytes/sec
AddTestCase (new LenaRrFfMacSchedulerTestCase (1,0,20000,133000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (3,0,20000,41000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (6,0,20000,22000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (9,0,20000,9000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (12,0,20000,9000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (15,0,20000,7200));
// DISTANCE 15000 -> MCS 6 -> Itbs 6 (from table 7.1.7.2.1-1 of 36.213)
// 1 user -> 24 PRB at Itbs 6 -> 309 -> 309000 bytes/sec
// 3 users -> 8 PRB at Itbs 6 -> 101 -> 101000 bytes/sec
// 6 users -> 4 PRB at Itbs 6 -> 49 -> 49000 bytes/sec
// 9 user -> 2 PRB at Itbs 6 -> 22 -> 22000 bytes/sec
// 12 users -> 2 PRB at Itbs 6 -> 22 -> 22000 bytes/sec
// 15 users -> 2 PRB at Itbs 6 * 0.8 -> 17.6 -> 17600 bytes/sec
AddTestCase (new LenaRrFfMacSchedulerTestCase (1,0,15000,309000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (3,0,15000,101000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (6,0,15000,49000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (9,0,15000,22000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (12,0,15000,22000));
AddTestCase (new LenaRrFfMacSchedulerTestCase (15,0,15000,17600));
}

View File

@@ -70,7 +70,8 @@ LteTestSinrChunkProcessor::End ()
{
NS_LOG_LOGIC (this << " m_sumSinr = " << *m_sumSinr);
NS_LOG_LOGIC (this << " m_totDuration = " << m_totDuration);
NS_LOG_LOGIC (this << " m_sumSinr / m_totDuration = " << (*m_sumSinr) / m_totDuration.GetSeconds ());
m_sinr = Create<SpectrumValue> ((*m_sumSinr) / m_totDuration.GetSeconds ());
NS_LOG_LOGIC (this << " m_sumSinr / m_totDuration = " << *m_sinr);
}
else
{
@@ -83,7 +84,7 @@ LteTestSinrChunkProcessor::GetSinr ()
{
NS_LOG_FUNCTION (this);
return (*m_sumSinr) / m_totDuration.GetSeconds ();
return *m_sinr;
}
} // namespace ns3

View File

@@ -46,6 +46,7 @@ public:
private:
Ptr<SpectrumValue> m_sumSinr;
Ptr<SpectrumValue> m_sinr;
Time m_totDuration;
Ptr<LtePhy> m_phy;
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,36 @@
clear all;
close all;
for nrbs = [6 15 25 50 75 100]
## earfcn = 500;
## fcMHz = 2160;
earfcn = 19400;
fcMHz = 1730;
fc = fcMHz * 1e6;
rbbw = 180e3;
bw = rbbw * nrbs;
fcv = linspace (fc - bw/2 + rbbw/2, fc + bw/2 - rbbw/2, nrbs);
name = ["fc" num2str(fcMHz, "%d") "nrb" num2str(nrbs, "%d")];
printf("std::vector<double> %s (%s);\n", name, num2str (length(fcv)));
print_C_vector (fcv, name);
printf("AddTestCase (new LteSpectrumModelTestCase (\"%s\", %d, %d, %s));\n\n", name, earfcn, nrbs, name);
endfor

View File

@@ -0,0 +1,38 @@
clear all;
close all;
earfcn = 500;
noise_psd = 1.38e-23 * 290;
for nrbs = [6 15]
for noise_figure_dB = [0 5 10 ]
name = ["nfdB" num2str(noise_figure_dB, "%d") "earfcn" num2str(earfcn,"%d") "nrb" num2str(nrbs, "%d")];
npsdv = ones (1,nrbs) * (noise_psd * 10.^(noise_figure_dB/10));
printf("SpectrumValue %s (LteSpectrumValueHelper::GetSpectrumModel (%d, %d));\n",
name, earfcn, nrbs);
print_C_vector (npsdv, name);
printf("AddTestCase (new LteNoisePsdTestCase (\"%s\", %d, %d, %f, %s));\n\n", name, earfcn, nrbs, noise_figure_dB, name);
endfor
endfor

View File

@@ -0,0 +1,51 @@
clear all;
close all;
earfcn = 500;
for run = 1:2
for nrbs = [6 25 100]
bw = nrbs * 180000;
for txpowdBm = [10 30]
basename = ["txpowdB" num2str(txpowdBm, "%d") "nrb" num2str(nrbs, "%d") "run" num2str(run, "%d") "earfcn" num2str(earfcn,"%d")];
svname = [ "spectrumValue_" basename];
arname = [ "activeRbs_" basename];
activeRbsMask = round (rand (1,nrbs));
activeRbs = find (activeRbsMask) - 1;
txpowW = (10.^(txpowdBm/10))/1000;
txpsd = txpowW.*activeRbsMask./bw;
printf("std::vector<int> %s (%d);\n", arname, length(activeRbs));
print_C_vector (activeRbs, arname);
printf("SpectrumValue %s (LteSpectrumValueHelper::GetSpectrumModel (%d, %d));\n",
svname, earfcn, nrbs);
print_C_vector (txpsd, svname);
printf("AddTestCase (new LteTxPsdTestCase (\"%s\", %d, %d, %f, %s, %s));\n\n",
basename, earfcn, nrbs, txpowdBm, arname, svname);
endfor
endfor
endfor

View File

@@ -1,18 +1,27 @@
clear all;
close all;
## LTE from theory to practice
## Table 22.7 Reference sensitivity.
f = 2160e6; # carrier freq Hz, EARFCN = 500 (downlink)
n = -107.5 # noise power dBm, corresponds to 5 MHz BW
nrbs = 25; # tx bandwdith configuration in number of RBs
bw = nrbs * 180000; # bandwidth in Hz, note that this is smaller than
# the nominal Channel Bandwdith, see TS 36.101 fig 5.6-1
kT = -174; # noise PSD in dBm / Hz
n = kT + 10*log10(bw); # noise power dBm
p = 30; # tx power dBm
nf = 5; # receiver noise figure in dB
txPsd = p - 10*log10(bw); # power / bandwidth in linear units
nf = 9; # receiver noise figure in dB
d = logspace (0,5,100);
g = 10.*log10 (gain_freespace(d,f)); # propagation gain in dB
snr = p + g - n - nf ; #dB
snr = p + g - n - nf; # dB
##snr = txPsd + g - kT - nf ; # dB
semilogx (d, snr);
semilogx (d, snr, ";friis;");
xlabel ("distance (m)");
ylabel ("SNR (dB)");
title ("LTE link budget");

View File

@@ -0,0 +1,20 @@
function print_C_vector (x, name)
##
## print_C_vector (x)
##
## prints to screen the C code that is needed to initialize vector x
## x is the data
## name is the name of the C variable
assert (isvector(x));
for jj = 1:length(x)
printf("%s[%d] = %15.12e;\n", name, jj-1, x(jj));
endfor
endfunction