From ac9541236d37c9dc95356477430f921bead03398 Mon Sep 17 00:00:00 2001 From: Nicola Baldo Date: Wed, 23 Jan 2013 17:17:16 +0100 Subject: [PATCH 1/5] make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3 --- src/lte/model/lte-enb-phy.cc | 14 ++++++++++++-- src/lte/model/lte-enb-phy.h | 11 +++++++++++ src/lte/model/lte-ue-phy.cc | 16 ++++++++++++++-- src/lte/model/lte-ue-phy.h | 10 ++++++++++ 4 files changed, 47 insertions(+), 4 deletions(-) diff --git a/src/lte/model/lte-enb-phy.cc b/src/lte/model/lte-enb-phy.cc index d52c28344..43c2d36ef 100644 --- a/src/lte/model/lte-enb-phy.cc +++ b/src/lte/model/lte-enb-phy.cc @@ -200,13 +200,13 @@ LteEnbPhy::GetTypeId (void) "The downlink LteSpectrumPhy associated to this LtePhy", TypeId::ATTR_GET, PointerValue (), - MakePointerAccessor (&LteEnbPhy::m_downlinkSpectrumPhy), + MakePointerAccessor (&LteEnbPhy::GetDlSpectrumPhy), MakePointerChecker ()) .AddAttribute ("UlSpectrumPhy", "The uplink LteSpectrumPhy associated to this LtePhy", TypeId::ATTR_GET, PointerValue (), - MakePointerAccessor (&LteEnbPhy::m_uplinkSpectrumPhy), + MakePointerAccessor (&LteEnbPhy::GetUlSpectrumPhy), MakePointerChecker ()) ; return tid; @@ -319,7 +319,17 @@ LteEnbPhy::GetMacChDelay (void) const return (m_macChTtiDelay); } +Ptr +LteEnbPhy::GetDlSpectrumPhy () const +{ + return m_downlinkSpectrumPhy; +} +Ptr +LteEnbPhy::GetUlSpectrumPhy () const +{ + return m_uplinkSpectrumPhy; +} bool LteEnbPhy::AddUePhy (uint16_t rnti) diff --git a/src/lte/model/lte-enb-phy.h b/src/lte/model/lte-enb-phy.h index d630cc91b..5a1c5ad92 100644 --- a/src/lte/model/lte-enb-phy.h +++ b/src/lte/model/lte-enb-phy.h @@ -125,6 +125,17 @@ public: */ uint8_t GetMacChDelay (void) const; + /** + * \return a pointer to the LteSpectrumPhy instance relative to the downlink + */ + Ptr GetDlSpectrumPhy () const; + + /** + * \return a pointer to the LteSpectrumPhy instance relative to the uplink + */ + Ptr GetUlSpectrumPhy () const; + + /** * \brief set the resource blocks (a.k.a. sub channels) to be used in the downlink for transmission * diff --git a/src/lte/model/lte-ue-phy.cc b/src/lte/model/lte-ue-phy.cc index b80f6837f..cedd1f080 100644 --- a/src/lte/model/lte-ue-phy.cc +++ b/src/lte/model/lte-ue-phy.cc @@ -227,13 +227,13 @@ LteUePhy::GetTypeId (void) "The downlink LteSpectrumPhy associated to this LtePhy", TypeId::ATTR_GET, PointerValue (), - MakePointerAccessor (&LteUePhy::m_downlinkSpectrumPhy), + MakePointerAccessor (&LteUePhy::GetDlSpectrumPhy), MakePointerChecker ()) .AddAttribute ("UlSpectrumPhy", "The uplink LteSpectrumPhy associated to this LtePhy", TypeId::ATTR_GET, PointerValue (), - MakePointerAccessor (&LteUePhy::m_uplinkSpectrumPhy), + MakePointerAccessor (&LteUePhy::GetUlSpectrumPhy), MakePointerChecker ()) ; return tid; @@ -310,6 +310,18 @@ LteUePhy::GetMacChDelay (void) const return (m_macChTtiDelay); } +Ptr +LteUePhy::GetDlSpectrumPhy () const +{ + return m_downlinkSpectrumPhy; +} + +Ptr +LteUePhy::GetUlSpectrumPhy () const +{ + return m_uplinkSpectrumPhy; +} + void LteUePhy::DoSendMacPdu (Ptr p) { diff --git a/src/lte/model/lte-ue-phy.h b/src/lte/model/lte-ue-phy.h index 3f1e96a30..f0ce6d6f6 100644 --- a/src/lte/model/lte-ue-phy.h +++ b/src/lte/model/lte-ue-phy.h @@ -120,6 +120,16 @@ public: */ uint8_t GetMacChDelay (void) const; + /** + * \return a pointer to the LteSpectrumPhy instance relative to the downlink + */ + Ptr GetDlSpectrumPhy () const; + + /** + * \return a pointer to the LteSpectrumPhy instance relative to the uplink + */ + Ptr GetUlSpectrumPhy () const; + /** * \brief Create the PSD for the TX From c27057c920bf3960db31815f712db869863191fe Mon Sep 17 00:00:00 2001 From: Nicola Baldo Date: Wed, 23 Jan 2013 18:54:03 +0100 Subject: [PATCH 2/5] fixed too large integer constant error in test-asn1-encoding that showed up on 32bit systems --- src/lte/test/test-asn1-encoding.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lte/test/test-asn1-encoding.cc b/src/lte/test/test-asn1-encoding.cc index 42e92833b..dc2017392 100644 --- a/src/lte/test/test-asn1-encoding.cc +++ b/src/lte/test/test-asn1-encoding.cc @@ -258,7 +258,7 @@ RrcConnectionRequestTestCase::DoRun (void) NS_LOG_DEBUG ("============= RrcConnectionRequestTestCase ==========="); LteRrcSap::RrcConnectionRequest msg; - msg.ueIdentity = 0x83fecafeca; + msg.ueIdentity = 0x83fecafecaULL; RrcConnectionRequestHeader source; source.SetMessage (msg); From 639c3d29319d7a020a27f3cd8464c3bf28bd6d0f Mon Sep 17 00:00:00 2001 From: Marco Miozzo Date: Thu, 24 Jan 2013 13:57:59 +0100 Subject: [PATCH 3/5] Bug-fix in LteAmc::CreateCqiFeedbacks Vienna model and correspondent update of the RR and PF scheduler tests --- src/lte/model/lte-amc.cc | 8 ++++-- src/lte/test/lte-test-pf-ff-mac-scheduler.cc | 22 ++++++++--------- src/lte/test/lte-test-rr-ff-mac-scheduler.cc | 26 ++++++++++---------- 3 files changed, 30 insertions(+), 26 deletions(-) diff --git a/src/lte/model/lte-amc.cc b/src/lte/model/lte-amc.cc index 8b3cb5b7b..bf10d7fe0 100644 --- a/src/lte/model/lte-amc.cc +++ b/src/lte/model/lte-amc.cc @@ -346,7 +346,7 @@ LteAmc::CreateCqiFeedbacks (const SpectrumValue& sinr, uint8_t rbgSize) { uint8_t mcs = 0; TbStats_t tbStats; - while (mcs < 28) + while (mcs <= 28) { HarqProcessInfoList_t harqInfoList; tbStats = LteMiErrorModel::GetTbDecodificationStats (sinr, rbgMap, (uint16_t)GetTbSizeFromMcs (mcs, rbgSize) / 8, mcs, harqInfoList); @@ -357,6 +357,10 @@ LteAmc::CreateCqiFeedbacks (const SpectrumValue& sinr, uint8_t rbgSize) mcs++; } + if (mcs > 0) + { + mcs--; + } NS_LOG_DEBUG (this << "\t RBG " << rbId << " MCS " << (uint16_t)mcs << " TBLER " << tbStats.tbler); int rbgCqi = 0; if ((tbStats.tbler > 0.1)&&(mcs==0)) @@ -376,7 +380,7 @@ LteAmc::CreateCqiFeedbacks (const SpectrumValue& sinr, uint8_t rbgSize) ++rbgCqi; } } - NS_LOG_DEBUG (this << "\t CQI " << rbgCqi); + NS_LOG_DEBUG (this << "\t MCS " << (uint16_t)mcs << "-> CQI " << rbgCqi); // fill the cqi vector (per RB basis) for (uint8_t j = 0; j < rbgSize; j++) { diff --git a/src/lte/test/lte-test-pf-ff-mac-scheduler.cc b/src/lte/test/lte-test-pf-ff-mac-scheduler.cc index d80a235c0..83dd37fbd 100644 --- a/src/lte/test/lte-test-pf-ff-mac-scheduler.cc +++ b/src/lte/test/lte-test-pf-ff-mac-scheduler.cc @@ -103,12 +103,12 @@ LenaTestPfFfMacSchedulerSuite::LenaTestPfFfMacSchedulerSuite () AddTestCase (new LenaPfFfMacSchedulerTestCase1 (12,0,4800,75250,62000,errorModel)); AddTestCase (new LenaPfFfMacSchedulerTestCase1 (15,0,4800,60200,49600,errorModel)); - // DOWNLINK - 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 + // DOWNLINK - DISTANCE 6000 -> MCS 14 -> Itbs 13 (from table 7.1.7.2.1-1 of 36.213) + // 1 user -> 24 PRB at Itbs 15 -> 775 -> 775000 bytes/sec + // 3 users -> 775000 among 3 users -> 258000 bytes/sec + // 6 users -> 775000 among 6 users -> 129200 bytes/sec + // 12 users -> 775000 among 12 users -> 64590 bytes/sec + // 15 users -> 775000 among 15 users -> 51700 bytes/sec // UPLINK - DISTANCE 6000 -> MCS 12 -> Itbs 11 (from table 7.1.7.2.1-1 of 36.213) // 1 user -> 25 PRB at Itbs 11 -> 621 -> 621000 bytes/sec // 3 users -> 8 PRB at Itbs 11 -> 201 -> 201000 bytes/sec @@ -116,11 +116,11 @@ LenaTestPfFfMacSchedulerSuite::LenaTestPfFfMacSchedulerSuite () // after the patch enforcing min 3 PRBs per UE: // 12 users -> 3 PRB at Itbs 11 -> 73 bytes * 8/12 UE/TTI -> 48667 bytes/sec // 15 users -> 3 PRB at Itbs 11 -> 73 bytes * 8/15 UE/TTI -> 38993 bytes/sec - AddTestCase (new LenaPfFfMacSchedulerTestCase1 (1,0,6000,903000,621000,errorModel)); - AddTestCase (new LenaPfFfMacSchedulerTestCase1 (3,0,6000,301000,201000,errorModel)); - AddTestCase (new LenaPfFfMacSchedulerTestCase1 (6,0,6000,150500,97000,errorModel)); - AddTestCase (new LenaPfFfMacSchedulerTestCase1 (12,0,6000,75250,48667,errorModel)); - AddTestCase (new LenaPfFfMacSchedulerTestCase1 (15,0,6000,60200,38993,errorModel)); + AddTestCase (new LenaPfFfMacSchedulerTestCase1 (1,0,6000,775000,621000,errorModel)); + AddTestCase (new LenaPfFfMacSchedulerTestCase1 (3,0,6000,258000,201000,errorModel)); + AddTestCase (new LenaPfFfMacSchedulerTestCase1 (6,0,6000,129200,97000,errorModel)); + AddTestCase (new LenaPfFfMacSchedulerTestCase1 (12,0,6000,64590,48667,errorModel)); + AddTestCase (new LenaPfFfMacSchedulerTestCase1 (15,0,6000,51700,38993,errorModel)); // DOWNLINK - DISTANCE 10000 -> MCS 8 -> Itbs 8 (from table 7.1.7.2.1-1 of 36.213) // 1 user -> 24 PRB at Itbs 8 -> 421 -> 421000 bytes/sec diff --git a/src/lte/test/lte-test-rr-ff-mac-scheduler.cc b/src/lte/test/lte-test-rr-ff-mac-scheduler.cc index 9455b4ff2..14d728ece 100644 --- a/src/lte/test/lte-test-rr-ff-mac-scheduler.cc +++ b/src/lte/test/lte-test-rr-ff-mac-scheduler.cc @@ -105,13 +105,13 @@ LenaTestRrFfMacSchedulerSuite::LenaTestRrFfMacSchedulerSuite () AddTestCase (new LenaRrFfMacSchedulerTestCase (12,0,4800,113000,62000,errorModel)); AddTestCase (new LenaRrFfMacSchedulerTestCase (15,0,4800,90400,49600,errorModel)); - // DOWNLINK - 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 + // DOWNLINK - DISTANCE 6000 -> MCS 14 -> Itbs 13 (from table 7.1.7.2.1-1 of 36.213) + // 1 user -> 24 PRB at Itbs 15 -> 775 -> 775000 bytes/sec + // 3 users -> 8 PRB at Itbs 15 -> 253 -> 253000 bytes/sec + // 6 users -> 4 PRB at Itbs 15 -> 125 -> 125000 bytes/sec + // 9 user -> 2 PRB at Itbs 15 -> 61 -> 61000 bytes/sec + // 12 users -> 2 PRB at Itbs 15 -> 61 -> 61000 bytes/sec + // 15 users -> 2 PRB at Itbs 15 * 0.8 -> 48.8 -> 48800 bytes/sec // UPLINK - DISTANCE 6000 -> MCS 12 -> Itbs 11 (from table 7.1.7.2.1-1 of 36.213) // 1 user -> 25 PRB at Itbs 11 -> 621 -> 621000 bytes/sec // 3 users -> 8 PRB at Itbs 11 -> 201 -> 201000 bytes/sec @@ -119,12 +119,12 @@ LenaTestRrFfMacSchedulerSuite::LenaTestRrFfMacSchedulerSuite () // 9 users -> 3 PRB at Itbs 11 -> 73 bytes * 8/9 UE/TTI -> 64889 bytes/sec // 12 users -> 3 PRB at Itbs 11 -> 73 bytes * 8/12 UE/TTI -> 48667 bytes/sec // 15 users -> 3 PRB at Itbs 11 -> 73 bytes * 8/15 UE/TTI -> 38993 bytes/sec - AddTestCase (new LenaRrFfMacSchedulerTestCase (1,0,6000,903000,621000,errorModel)); - AddTestCase (new LenaRrFfMacSchedulerTestCase (3,0,6000,309000,201000,errorModel)); - AddTestCase (new LenaRrFfMacSchedulerTestCase (6,0,6000,153000,97000,errorModel)); - AddTestCase (new LenaRrFfMacSchedulerTestCase (9,0,6000,75000,64889,errorModel)); - AddTestCase (new LenaRrFfMacSchedulerTestCase (12,0,6000,75000,48667,errorModel)); - AddTestCase (new LenaRrFfMacSchedulerTestCase (15,0,6000,60000,38993,errorModel)); + AddTestCase (new LenaRrFfMacSchedulerTestCase (1,0,6000,775000,621000,errorModel)); + AddTestCase (new LenaRrFfMacSchedulerTestCase (3,0,6000,253000,201000,errorModel)); + AddTestCase (new LenaRrFfMacSchedulerTestCase (6,0,6000,125000,97000,errorModel)); + AddTestCase (new LenaRrFfMacSchedulerTestCase (9,0,6000,61000,64889,errorModel)); + AddTestCase (new LenaRrFfMacSchedulerTestCase (12,0,6000,61000,48667,errorModel)); + AddTestCase (new LenaRrFfMacSchedulerTestCase (15,0,6000,48800,38993,errorModel)); // DOWNLINK - DISTANCE 10000 -> MCS 8 -> Itbs 8 (from table 7.1.7.2.1-1 of 36.213) // 1 user -> 24 PRB at Itbs 8 -> 437 -> 437000 bytes/sec From e036dd6f52274b967edfb3aa4d7dc4e30297df2a Mon Sep 17 00:00:00 2001 From: Marco Miozzo Date: Fri, 25 Jan 2013 15:32:33 +0100 Subject: [PATCH 4/5] Avoid generation of DL-CQI with RNTI = 0 when UEs are not connected --- src/lte/model/lte-ue-phy.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/lte/model/lte-ue-phy.cc b/src/lte/model/lte-ue-phy.cc index cedd1f080..965268ead 100644 --- a/src/lte/model/lte-ue-phy.cc +++ b/src/lte/model/lte-ue-phy.cc @@ -398,7 +398,10 @@ LteUePhy::GenerateCtrlCqiReport (const SpectrumValue& sinr) { Ptr thisDevice = GetDevice ()->GetObject (); Ptr msg = CreateDlCqiFeedbackMessage (sinr); - DoSendLteControlMessage (msg); + if (msg) + { + DoSendLteControlMessage (msg); + } m_p10CqiLast = Simulator::Now (); } // check aperiodic high-layer configured subband CQI @@ -406,7 +409,10 @@ LteUePhy::GenerateCtrlCqiReport (const SpectrumValue& sinr) { Ptr thisDevice = GetDevice ()->GetObject (); Ptr msg = CreateDlCqiFeedbackMessage (sinr); - DoSendLteControlMessage (msg); + if (msg) + { + DoSendLteControlMessage (msg); + } m_a30CqiLast = Simulator::Now (); } } @@ -437,6 +443,12 @@ Ptr LteUePhy::CreateDlCqiFeedbackMessage (const SpectrumValue& sinr) { NS_LOG_FUNCTION (this); + + if (m_rnti == 0) + { + // abort method, the UE is still not registered + return (0); + } // apply transmission mode gain NS_ASSERT (m_transmissionMode < m_txModeGain.size ()); From fd1052e567627dd23ee5d63f329b85f1561f9cb1 Mon Sep 17 00:00:00 2001 From: Nicola Baldo Date: Fri, 25 Jan 2013 15:57:13 +0100 Subject: [PATCH 5/5] added sanity check in LteEnbMac::ReceiveDlCqiLteControlMessage () --- src/lte/model/lte-enb-mac.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lte/model/lte-enb-mac.cc b/src/lte/model/lte-enb-mac.cc index 2ef62c9be..5ed55eda2 100644 --- a/src/lte/model/lte-enb-mac.cc +++ b/src/lte/model/lte-enb-mac.cc @@ -647,6 +647,7 @@ LteEnbMac::ReceiveDlCqiLteControlMessage (Ptr msg) CqiListElement_s dlcqi = msg->GetDlCqi (); NS_LOG_LOGIC (this << "Enb Received DL-CQI rnti" << dlcqi.m_rnti); + NS_ASSERT (dlcqi.m_rnti != 0); m_dlCqiReceived.push_back (dlcqi); }