diff --git a/src/lte/examples/lena-first-sim.cc b/src/lte/examples/lena-first-sim.cc index 8db46b984..75659c330 100644 --- a/src/lte/examples/lena-first-sim.cc +++ b/src/lte/examples/lena-first-sim.cc @@ -23,14 +23,14 @@ #include "ns3/network-module.h" #include "ns3/mobility-module.h" #include "ns3/lte-module.h" -#include "ns3/gtk-config-store.h" +//#include "ns3/gtk-config-store.h" using namespace ns3; int main (int argc, char *argv[]) { LenaHelper lena; - //lena.EnableLogComponents (); + lena.EnableLogComponents (); // Create Nodes: eNodeB and UE NodeContainer enbNodes; @@ -48,6 +48,8 @@ int main (int argc, char *argv[]) // Create Devices and install them in the Nodes (eNB and UE) NetDeviceContainer enbDevs; NetDeviceContainer ueDevs; + //lena.SetScheduler ("RrFfMacScheduler"); + lena.SetScheduler ("PfFfMacScheduler"); enbDevs = lena.InstallEnbDevice (enbNodes); ueDevs = lena.InstallUeDevice (ueNodes); @@ -64,8 +66,8 @@ int main (int argc, char *argv[]) Simulator::Run (); - GtkConfigStore config; - config.ConfigureAttributes (); + //GtkConfigStore config; + //config.ConfigureAttributes (); Simulator::Destroy (); return 0; diff --git a/src/lte/examples/lena-rlc-calculator.cc b/src/lte/examples/lena-rlc-calculator.cc index 0f12fefc5..6f1e553e4 100644 --- a/src/lte/examples/lena-rlc-calculator.cc +++ b/src/lte/examples/lena-rlc-calculator.cc @@ -26,7 +26,7 @@ #include "ns3/rlc-stats-calculator.h" -#include "ns3/gtk-config-store.h" +//#include "ns3/gtk-config-store.h" using namespace ns3; diff --git a/src/lte/helper/lena-helper.cc b/src/lte/helper/lena-helper.cc index 77e911494..8879ae639 100644 --- a/src/lte/helper/lena-helper.cc +++ b/src/lte/helper/lena-helper.cc @@ -38,6 +38,11 @@ #include #include +#include +#include +#include +#include +#include namespace ns3 { @@ -49,6 +54,8 @@ LenaHelper::LenaHelper (void) { Ptr model = CreateObject (); m_downlinkChannel->AddSpectrumPropagationLossModel (model); + + SetScheduler ("RrFfMacScheduler"); // default scheduler } LenaHelper::~LenaHelper (void) @@ -59,6 +66,32 @@ LenaHelper::~LenaHelper (void) + +void +LenaHelper::SetScheduler (std::string type, + std::string n0, const AttributeValue &v0, + std::string n1, const AttributeValue &v1, + std::string n2, const AttributeValue &v2, + std::string n3, const AttributeValue &v3, + std::string n4, const AttributeValue &v4, + std::string n5, const AttributeValue &v5, + std::string n6, const AttributeValue &v6, + std::string n7, const AttributeValue &v7) +{ + m_scheduler = ObjectFactory (); + m_scheduler.SetTypeId (type); + m_scheduler.Set (n0, v0); + m_scheduler.Set (n1, v1); + m_scheduler.Set (n2, v2); + m_scheduler.Set (n3, v3); + m_scheduler.Set (n4, v4); + m_scheduler.Set (n5, v5); + m_scheduler.Set (n6, v6); + m_scheduler.Set (n7, v7); +} + + + NetDeviceContainer LenaHelper::InstallEnbDevice (NodeContainer c) { @@ -122,14 +155,16 @@ LenaHelper::InstallSingleEnbDevice (Ptr n) ulPhy->SetMobility (mm); m_uplinkChannel->AddRx (ulPhy); - - Ptr dev = CreateObject (n, phy); + Ptr mac = CreateObject (); + Ptr sched = m_scheduler.Create (); + //Ptr sched = Create (); + Ptr rrc = Create (); + Ptr dev = CreateObject (n, phy, mac, sched, rrc); phy->SetDevice (dev); dlPhy->SetDevice (dev); ulPhy->SetDevice (dev); n->AddDevice (dev); - Ptr mac = dev->GetMac (); ulPhy->SetPhyMacRxEndOkCallback (MakeCallback (&LteEnbPhy::PhyPduReceived, phy)); dev->Start (); @@ -162,14 +197,15 @@ LenaHelper::InstallSingleUeDevice (Ptr n) ulPhy->SetMobility (mm); m_downlinkChannel->AddRx (dlPhy); - - Ptr dev = CreateObject (n, phy); + + Ptr mac = CreateObject (); + Ptr rrc = Create (); + Ptr dev = CreateObject (n, phy, mac, rrc); phy->SetDevice (dev); dlPhy->SetDevice (dev); ulPhy->SetDevice (dev); n->AddDevice (dev); - Ptr mac = dev->GetMac (); dlPhy->SetPhyMacRxEndOkCallback (MakeCallback (&LteUePhy::PhyPduReceived, phy)); dev->Start (); @@ -237,8 +273,8 @@ LenaHelper::EnableLogComponents (void) LogComponentEnable ("LteEnbMac", LOG_LEVEL_ALL); LogComponentEnable ("LteUeMac", LOG_LEVEL_ALL); LogComponentEnable ("LteRlc", LOG_LEVEL_ALL); - LogComponentEnable ("RrPacketScheduler", LOG_LEVEL_ALL); - LogComponentEnable ("PfPacketScheduler", LOG_LEVEL_ALL); + LogComponentEnable ("RrFfMacScheduler", LOG_LEVEL_ALL); + LogComponentEnable ("PfFfMacScheduler", LOG_LEVEL_ALL); LogComponentEnable ("LtePhy", LOG_LEVEL_ALL); LogComponentEnable ("LteEnbPhy", LOG_LEVEL_ALL); diff --git a/src/lte/helper/lena-helper.h b/src/lte/helper/lena-helper.h index 57c434d52..b5f15511b 100644 --- a/src/lte/helper/lena-helper.h +++ b/src/lte/helper/lena-helper.h @@ -116,6 +116,42 @@ public: * \param bearer the characteristics of the bearer to be activated */ void ActivateEpsBearer (Ptr ueDevice, EpsBearer bearer); + + + /** + * \param type the type of ns3::WifiRemoteStationManager to create. + * \param n0 the name of the attribute to set + * \param v0 the value of the attribute to set + * \param n1 the name of the attribute to set + * \param v1 the value of the attribute to set + * \param n2 the name of the attribute to set + * \param v2 the value of the attribute to set + * \param n3 the name of the attribute to set + * \param v3 the value of the attribute to set + * \param n4 the name of the attribute to set + * \param v4 the value of the attribute to set + * \param n5 the name of the attribute to set + * \param v5 the value of the attribute to set + * \param n6 the name of the attribute to set + * \param v6 the value of the attribute to set + * \param n7 the name of the attribute to set + * \param v7 the value of the attribute to set + * + * All the attributes specified in this method should exist + * in the requested scheduler. + */ + void SetScheduler (std::string type, + std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (), + std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (), + std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (), + std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (), + std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (), + std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (), + std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (), + std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ()); + + + /** * Enables logging for all components of the LENA architecture @@ -129,6 +165,8 @@ private: Ptr m_downlinkChannel; Ptr m_uplinkChannel; + + ObjectFactory m_scheduler; }; diff --git a/src/lte/model/lte-enb-cmac-sap.cc b/src/lte/model/lte-enb-cmac-sap.cc new file mode 100644 index 000000000..3497c6965 --- /dev/null +++ b/src/lte/model/lte-enb-cmac-sap.cc @@ -0,0 +1,36 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Marco Miozzo + */ + + +#include "lte-enb-cmac-sap.h" + + +namespace ns3 { + + +LteEnbCmacSapProvider::~LteEnbCmacSapProvider () +{ +} + +LteEnbCmacSapUser::~LteEnbCmacSapUser () +{ +} + +} // namespace ns3 diff --git a/src/lte/model/lte-enb-cmac-sap.h b/src/lte/model/lte-enb-cmac-sap.h index 45c7c16c0..0e4f479a7 100644 --- a/src/lte/model/lte-enb-cmac-sap.h +++ b/src/lte/model/lte-enb-cmac-sap.h @@ -39,6 +39,7 @@ class LteMacSapUser; class LteEnbCmacSapProvider { public: + virtual ~LteEnbCmacSapProvider (); /** * * @@ -108,6 +109,7 @@ public: class LteEnbCmacSapUser { public: + virtual ~LteEnbCmacSapUser (); /** * notify the result of the last LC config operation * diff --git a/src/lte/model/lte-enb-mac.cc b/src/lte/model/lte-enb-mac.cc index a0871738b..0f5dd3c90 100644 --- a/src/lte/model/lte-enb-mac.cc +++ b/src/lte/model/lte-enb-mac.cc @@ -471,6 +471,11 @@ LteEnbMac::DoReceiveIdealControlMessage (Ptr msg) Ptr dlcqi = DynamicCast (msg); ReceiveDlCqiIdealControlMessage (dlcqi); } + else if (msg->GetMessageType () == IdealControlMessage::UL_CQI) + { + Ptr ulcqi = DynamicCast (msg); + ReceiveUlCqiIdealControlMessage (ulcqi); + } else if (msg->GetMessageType () == IdealControlMessage::BSR) { Ptr bsr = DynamicCast (msg); @@ -495,6 +500,21 @@ LteEnbMac::ReceiveDlCqiIdealControlMessage (Ptr msg) } +void +LteEnbMac::ReceiveUlCqiIdealControlMessage (Ptr msg) +{ + NS_LOG_FUNCTION (this << msg); + + UlCqi_s ulcqi = msg->GetUlCqi (); + if (ulcqi.m_type == UlCqi_s::PUSCH) + { + NS_LOG_DEBUG(this << " eNB rxed an PUSCH UL-CQI"); + } + // TODO store UL-CQI to send them to scheduler + //m_dlCqiReceived.push_back (dlcqi); + +} + void LteEnbMac::ReceiveBsrMessage (MacCeListElement_s bsr) { diff --git a/src/lte/model/lte-enb-mac.h b/src/lte/model/lte-enb-mac.h index 4124d2f64..8f06d6bb3 100644 --- a/src/lte/model/lte-enb-mac.h +++ b/src/lte/model/lte-enb-mac.h @@ -34,6 +34,7 @@ namespace ns3 { class DlCqiIdealControlMessage; +class UlCqiIdealControlMessage; class PdcchMapIdealControlMessage; @@ -128,6 +129,11 @@ public: * \param msg the DL CQI message */ void ReceiveDlCqiIdealControlMessage (Ptr msg); + /** + * \brief Receive a UL CQI ideal control message + * \param msg the UL CQI message + */ + void ReceiveUlCqiIdealControlMessage (Ptr msg); void DoReceiveIdealControlMessage (Ptr msg); /** diff --git a/src/lte/model/lte-enb-net-device.cc b/src/lte/model/lte-enb-net-device.cc index 859fcccb9..3437eab3a 100644 --- a/src/lte/model/lte-enb-net-device.cc +++ b/src/lte/model/lte-enb-net-device.cc @@ -73,10 +73,13 @@ LteEnbNetDevice::LteEnbNetDevice (void) InitLteEnbNetDevice (); } -LteEnbNetDevice::LteEnbNetDevice (Ptr node, Ptr phy) - : m_phy (phy) +LteEnbNetDevice::LteEnbNetDevice (Ptr node, Ptr phy, Ptr mac, Ptr sched, Ptr rrc) { NS_LOG_FUNCTION (this); + m_phy = phy; + m_mac = mac; + m_scheduler = sched; + m_rrc = rrc; InitLteEnbNetDevice (); SetNode (node); } @@ -91,14 +94,14 @@ LteEnbNetDevice::DoDispose () { NS_LOG_FUNCTION (this); - m_mac->Dispose (); - m_mac = 0; - - m_rrc->Dispose (); - m_rrc = 0; - - m_phy->Dispose (); - m_phy = 0; +// m_mac->Dispose (); +// m_mac = 0; +// +// m_rrc->Dispose (); +// m_rrc = 0; +// +// m_phy->Dispose (); +// m_phy = 0; LteNetDevice::DoDispose (); } @@ -109,8 +112,6 @@ LteEnbNetDevice::InitLteEnbNetDevice (void) { NS_LOG_FUNCTION (this); - m_mac = CreateObject (); - // m_mac->SetDevice (this->GetObject ()); SetNode (0); if (GetPhy () == 0) { @@ -120,13 +121,11 @@ LteEnbNetDevice::InitLteEnbNetDevice (void) { NS_LOG_DEBUG (this << "PHY ! NULL"); } - m_rrc = CreateObject (); + m_rrc->SetLteEnbCmacSapProvider (m_mac->GetLteEnbCmacSapProvider ()); m_mac->SetLteEnbCmacSapUser (m_rrc->GetLteEnbCmacSapUser ()); m_rrc->SetLteMacSapProvider (m_mac->GetLteMacSapProvider ()); - //m_scheduler = Create (); - m_scheduler = Create (); m_mac->SetFfMacSchedSapProvider (m_scheduler->GetFfMacSchedSapProvider ()); m_mac->SetFfMacCschedSapProvider (m_scheduler->GetFfMacCschedSapProvider ()); diff --git a/src/lte/model/lte-enb-net-device.h b/src/lte/model/lte-enb-net-device.h index 1a5b13f19..f7fc5185f 100644 --- a/src/lte/model/lte-enb-net-device.h +++ b/src/lte/model/lte-enb-net-device.h @@ -55,9 +55,12 @@ public: /** * \brief Create eNB net device * \param node the network node - * \param phy the physical object attache dto it + * \param phy the physical object attached to it + * \param mac the mac layer object attached to it + * \param sched the scheduler object attached to it + * \param rrc the rrc entity object attached to it */ - LteEnbNetDevice (Ptr node, Ptr phy); + LteEnbNetDevice (Ptr node, Ptr phy, Ptr mac, Ptr sched, Ptr rrc); virtual ~LteEnbNetDevice (void); virtual void DoDispose (void); diff --git a/src/lte/model/lte-enb-phy.cc b/src/lte/model/lte-enb-phy.cc index 8e472baa1..7a6fa41ee 100644 --- a/src/lte/model/lte-enb-phy.cc +++ b/src/lte/model/lte-enb-phy.cc @@ -120,6 +120,13 @@ LteEnbPhy::~LteEnbPhy () { } +void +LteEnbPhy::DoDispose () +{ + NS_LOG_FUNCTION (this); + LtePhy::DoDispose (); +} + void LteEnbPhy::SetLteEnbPhySapUser (LteEnbPhySapUser* s) { @@ -370,6 +377,32 @@ void LteEnbPhy::GenerateCqiFeedback (const SpectrumValue& sinr) { NS_LOG_FUNCTION (this << sinr); + Ptr thisDevice = GetDevice ()->GetObject (); + Ptr msg = CreateUlCqiFeedbackMessage (sinr); + m_enbPhySapUser->ReceiveIdealControlMessage (msg); + + +} + + +Ptr +LteEnbPhy::CreateUlCqiFeedbackMessage (const SpectrumValue& sinr) +{ + NS_LOG_FUNCTION (this << sinr); + Values::const_iterator it; + UlCqi_s ulcqi; + ulcqi.m_type = UlCqi_s::PUSCH; + int i = 0; + for (it = sinr.ConstValuesBegin (); it != sinr.ConstValuesEnd (); it++) + { + ulcqi.m_sinr.push_back ((*it)); + NS_LOG_DEBUG(this << " RB " << i << " SINR " << (*it)); + i++; + } + Ptr msg = Create (); + msg->SetUlCqi (ulcqi); + return (msg); + } }; diff --git a/src/lte/model/lte-enb-phy.h b/src/lte/model/lte-enb-phy.h index 0f860ede2..53659f3e4 100644 --- a/src/lte/model/lte-enb-phy.h +++ b/src/lte/model/lte-enb-phy.h @@ -52,6 +52,7 @@ public: virtual ~LteEnbPhy (); static TypeId GetTypeId (void); + virtual void DoDispose (void); /** @@ -98,6 +99,13 @@ public: * \param msg the received message */ virtual void ReceiveIdealControlMessage (Ptr msg); + + /** + * \brief Create the UL CQI feedback from SINR values perceived at + * the physical layer with the signal received from eNB + * \param sinr SINR values vector + */ + Ptr CreateUlCqiFeedbackMessage (const SpectrumValue& sinr); void DoSendIdealControlMessage (Ptr msg); diff --git a/src/lte/model/lte-mac-sap.cc b/src/lte/model/lte-mac-sap.cc index 545d0ab4c..c095eeb65 100644 --- a/src/lte/model/lte-mac-sap.cc +++ b/src/lte/model/lte-mac-sap.cc @@ -29,4 +29,8 @@ LteMacSapProvider::~LteMacSapProvider () { } +LteMacSapUser::~LteMacSapUser () +{ +} + } // namespace ns3 diff --git a/src/lte/model/lte-mac-sap.h b/src/lte/model/lte-mac-sap.h index bd4331f24..519071af3 100644 --- a/src/lte/model/lte-mac-sap.h +++ b/src/lte/model/lte-mac-sap.h @@ -92,6 +92,7 @@ public: class LteMacSapUser { public: + virtual ~LteMacSapUser (); /** * Called by the MAC to notify the RLC that the scheduler granted a * transmission opportunity to this RLC instance. diff --git a/src/lte/model/lte-phy.cc b/src/lte/model/lte-phy.cc index 177f94148..3069b4ba3 100644 --- a/src/lte/model/lte-phy.cc +++ b/src/lte/model/lte-phy.cc @@ -84,9 +84,10 @@ LtePhy::DoDispose () m_netDevice = 0; for (int i = 0; i < m_macChTtiDelay; i++) { - m_packetBurstQueue.erase (m_packetBurstQueue.begin ()); - m_controlMessagesQueue.erase (m_controlMessagesQueue.begin ()); + m_packetBurstQueue.erase (m_packetBurstQueue.begin (), m_packetBurstQueue.end ()); + m_controlMessagesQueue.erase (m_controlMessagesQueue.begin (), m_controlMessagesQueue.end ()); } + Object::DoDispose (); } void @@ -144,15 +145,6 @@ LtePhy::SetDownlinkChannel (Ptr c) m_downlinkSpectrumPhy->SetChannel (c); } - -Ptr -LtePhy::GetDownlinkChannel () -{ - NS_LOG_FUNCTION (this); - return m_downlinkSpectrumPhy->GetChannel (); -} - - void LtePhy::SetUplinkChannel (Ptr c) { @@ -160,15 +152,6 @@ LtePhy::SetUplinkChannel (Ptr c) m_uplinkSpectrumPhy->SetChannel (c); } - -Ptr -LtePhy::GetUplinkChannel () -{ - NS_LOG_FUNCTION (this); - return m_uplinkSpectrumPhy->GetChannel (); -} - - void LtePhy::SetDownlinkSubChannels (std::vector mask ) { diff --git a/src/lte/model/lte-phy.h b/src/lte/model/lte-phy.h index 6e24114f1..af457faf4 100644 --- a/src/lte/model/lte-phy.h +++ b/src/lte/model/lte-phy.h @@ -100,24 +100,12 @@ public: */ void SetDownlinkChannel (Ptr c); - /** - * Get the downlink channel - * \return a Ptr to the downlink SpectrumChannel - */ - Ptr GetDownlinkChannel (); - /** * Set the uplink channel * \param c the uplink channel */ void SetUplinkChannel (Ptr c); - /** - * Get the uplink channel - * \return a Ptr to the uplink SpectrumChannel - */ - Ptr GetUplinkChannel (); - /** * \brief set a list of sub channel to use in the downlink. * A sub channel is composed by a couple of resource bloks (180KHz x 1 ms) diff --git a/src/lte/model/lte-sinr-chunk-processor.cc b/src/lte/model/lte-sinr-chunk-processor.cc index 5d89eb436..fb058571b 100644 --- a/src/lte/model/lte-sinr-chunk-processor.cc +++ b/src/lte/model/lte-sinr-chunk-processor.cc @@ -27,6 +27,11 @@ NS_LOG_COMPONENT_DEFINE ("LteSinrChunkProcessor"); namespace ns3 { +LteSinrChunkProcessor::~LteSinrChunkProcessor () +{ + NS_LOG_FUNCTION (this); +} + LteCqiSinrChunkProcessor::LteCqiSinrChunkProcessor (Ptr p) : m_phy (p) @@ -35,6 +40,13 @@ LteCqiSinrChunkProcessor::LteCqiSinrChunkProcessor (Ptr p) NS_ASSERT (m_phy); } + +LteCqiSinrChunkProcessor::~LteCqiSinrChunkProcessor () +{ + NS_LOG_FUNCTION (this); +} + + void LteCqiSinrChunkProcessor::Start () { diff --git a/src/lte/model/lte-sinr-chunk-processor.h b/src/lte/model/lte-sinr-chunk-processor.h index 04c7f1344..1e4e34bca 100644 --- a/src/lte/model/lte-sinr-chunk-processor.h +++ b/src/lte/model/lte-sinr-chunk-processor.h @@ -42,6 +42,7 @@ namespace ns3 { class LteSinrChunkProcessor : public SimpleRefCount { public: + virtual ~LteSinrChunkProcessor (); virtual void Start () = 0; virtual void EvaluateSinrChunk (const SpectrumValue& sinr, Time duration) = 0; virtual void End () = 0; @@ -57,6 +58,7 @@ public: class LteCqiSinrChunkProcessor : public LteSinrChunkProcessor { public: + virtual ~LteCqiSinrChunkProcessor (); LteCqiSinrChunkProcessor (Ptr p); virtual void Start (); virtual void EvaluateSinrChunk (const SpectrumValue& sinr, Time duration); diff --git a/src/lte/model/lte-spectrum-phy.cc b/src/lte/model/lte-spectrum-phy.cc index 08e49dceb..c9b3683ee 100644 --- a/src/lte/model/lte-spectrum-phy.cc +++ b/src/lte/model/lte-spectrum-phy.cc @@ -39,12 +39,9 @@ namespace ns3 { NS_OBJECT_ENSURE_REGISTERED (LteSpectrumPhy); LteSpectrumPhy::LteSpectrumPhy () - : m_mobility (0), - m_device (0), - m_channel (0), - m_txPsd (0), - m_state (IDLE) + : m_state (IDLE) { + NS_LOG_FUNCTION (this); } @@ -52,6 +49,15 @@ LteSpectrumPhy::~LteSpectrumPhy () { } +void LteSpectrumPhy::DoDispose () +{ + NS_LOG_FUNCTION (this); + m_channel = 0; + m_mobility = 0; + m_device = 0; + SpectrumPhy::DoDispose (); +} + std::ostream& operator<< (std::ostream& os, LteSpectrumPhy::State s) { switch (s) @@ -141,14 +147,6 @@ LteSpectrumPhy::SetChannel (Ptr c) m_channel = c; } - -Ptr -LteSpectrumPhy::GetChannel (void) -{ - return m_channel; -} - - Ptr LteSpectrumPhy::GetRxSpectrumModel () const { diff --git a/src/lte/model/lte-spectrum-phy.h b/src/lte/model/lte-spectrum-phy.h index abe314180..4ebe519c8 100644 --- a/src/lte/model/lte-spectrum-phy.h +++ b/src/lte/model/lte-spectrum-phy.h @@ -61,6 +61,7 @@ public: // inherited from Object static TypeId GetTypeId (void); + virtual void DoDispose (); // inherited from SpectrumPhy void SetChannel (Ptr c); @@ -72,13 +73,6 @@ public: void StartRx (Ptr pb, Ptr rxPsd, SpectrumType st, Time duration); - /** - * \brief Get the channel where the physical layer is attached - * \return a pointer to the channel - */ - Ptr GetChannel (void); - - /** * Get the SpectrumType used by this PHY * diff --git a/src/lte/model/lte-ue-cmac-sap.cc b/src/lte/model/lte-ue-cmac-sap.cc new file mode 100644 index 000000000..a8922585b --- /dev/null +++ b/src/lte/model/lte-ue-cmac-sap.cc @@ -0,0 +1,36 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Marco Miozzo + */ + + +#include "lte-ue-cmac-sap.h" + + +namespace ns3 { + + +LteUeCmacSapProvider::~LteUeCmacSapProvider () +{ +} + +LteUeCmacSapUser::~LteUeCmacSapUser () +{ +} + +} // namespace ns3 \ No newline at end of file diff --git a/src/lte/model/lte-ue-cmac-sap.h b/src/lte/model/lte-ue-cmac-sap.h index f020a6063..f563ff329 100644 --- a/src/lte/model/lte-ue-cmac-sap.h +++ b/src/lte/model/lte-ue-cmac-sap.h @@ -39,6 +39,7 @@ class LteMacSapUser; class LteUeCmacSapProvider { public: + virtual ~LteUeCmacSapProvider (); /** * called by the RRC after going to RRC connected * @@ -62,6 +63,7 @@ public: class LteUeCmacSapUser { public: + virtual ~LteUeCmacSapUser (); virtual void LcConfigCompleted () = 0; }; diff --git a/src/lte/model/lte-ue-net-device.cc b/src/lte/model/lte-ue-net-device.cc index 1a4ac238b..aed4424c9 100644 --- a/src/lte/model/lte-ue-net-device.cc +++ b/src/lte/model/lte-ue-net-device.cc @@ -66,13 +66,14 @@ LteUeNetDevice::LteUeNetDevice (void) } -LteUeNetDevice::LteUeNetDevice (Ptr node, Ptr phy) - : m_phy (phy) +LteUeNetDevice::LteUeNetDevice (Ptr node, Ptr phy, Ptr mac, Ptr rrc) { NS_LOG_FUNCTION (this); + m_phy = phy; + m_mac = mac; + m_rrc = rrc; InitLteUeNetDevice (); SetNode (node); - /** * WILD HACK * to be translated to PHY-SAP primitive @@ -90,12 +91,12 @@ LteUeNetDevice::DoDispose (void) { NS_LOG_FUNCTION (this); m_targetEnb = 0; - m_mac->Dispose (); - m_mac = 0; - m_rrc->Dispose (); - m_rrc = 0; - m_phy->Dispose (); - m_phy = 0; +// m_mac->Dispose (); +// m_mac = 0; +// m_rrc->Dispose (); +// m_rrc = 0; +// m_phy->Dispose (); +// m_phy = 0; LteNetDevice::DoDispose (); } @@ -105,8 +106,6 @@ LteUeNetDevice::InitLteUeNetDevice (void) NS_LOG_FUNCTION (this); m_targetEnb = 0; SetNode (0); - m_mac = CreateObject (); - m_rrc = CreateObject (); m_rrc->SetLteUeCmacSapProvider (m_mac->GetLteUeCmacSapProvider ()); m_mac->SetLteUeCmacSapUser (m_rrc->GetLteUeCmacSapUser ()); m_rrc->SetLteMacSapProvider (m_mac->GetLteMacSapProvider ()); diff --git a/src/lte/model/lte-ue-net-device.h b/src/lte/model/lte-ue-net-device.h index 6b0bf46e7..4f81bce85 100644 --- a/src/lte/model/lte-ue-net-device.h +++ b/src/lte/model/lte-ue-net-device.h @@ -57,7 +57,7 @@ public: * \param node * \param phy */ - LteUeNetDevice (Ptr node, Ptr phy); + LteUeNetDevice (Ptr node, Ptr phy, Ptr mac, Ptr rrc); virtual ~LteUeNetDevice (void); virtual void DoDispose (); diff --git a/src/lte/model/lte-ue-phy.cc b/src/lte/model/lte-ue-phy.cc index 49729431c..41de2de85 100644 --- a/src/lte/model/lte-ue-phy.cc +++ b/src/lte/model/lte-ue-phy.cc @@ -111,6 +111,8 @@ LteUePhy::~LteUePhy () void LteUePhy::DoDispose () { + NS_LOG_FUNCTION (this); + LtePhy::DoDispose (); } @@ -129,12 +131,14 @@ LteUePhy::GetTypeId (void) void LteUePhy::SetLteUePhySapUser (LteUePhySapUser* s) { + NS_LOG_FUNCTION (this); m_uePhySapUser = s; } LteUePhySapProvider* LteUePhy::GetLteUePhySapProvider () { + NS_LOG_FUNCTION (this); return (m_uePhySapProvider); } diff --git a/src/lte/model/pf-ff-mac-scheduler.cc b/src/lte/model/pf-ff-mac-scheduler.cc index eb8060181..3758f75fd 100644 --- a/src/lte/model/pf-ff-mac-scheduler.cc +++ b/src/lte/model/pf-ff-mac-scheduler.cc @@ -289,7 +289,7 @@ PfFfMacScheduler::DoCschedLcConfigReq (const struct FfMacCschedSapProvider::Csch NS_LOG_FUNCTION (this << " New LC, rnti: " << params.m_rnti); std::map ::iterator it; - for (uint i = 0; i < params.m_logicalChannelConfigList.size (); i++) + for (uint16_t i = 0; i < params.m_logicalChannelConfigList.size (); i++) { pfsFlowId_t flow; flow.m_rnti = params.m_rnti; @@ -304,6 +304,9 @@ PfFfMacScheduler::DoCschedLcConfigReq (const struct FfMacCschedSapProvider::Csch flowStats.totalBytesTransmitted = 0; flowStats.lastTtiBytesTrasmitted = 0; flowStats.lastAveragedThroughput = 0.0; + flowStats.rlcBufferReq.m_rlcTransmissionQueueSize = 0; + flowStats.rlcBufferReq.m_rlcRetransmissionQueueSize = 0; + flowStats.rlcBufferReq.m_rlcStatusPduSize = 0; m_flowStats.insert (std::pair (flow, flowStats)); } else diff --git a/src/lte/model/rr-ff-mac-scheduler.cc b/src/lte/model/rr-ff-mac-scheduler.cc index 60822a604..e4d64456e 100644 --- a/src/lte/model/rr-ff-mac-scheduler.cc +++ b/src/lte/model/rr-ff-mac-scheduler.cc @@ -24,7 +24,7 @@ #include "lte-amc.h" #include "rr-ff-mac-scheduler.h" -NS_LOG_COMPONENT_DEFINE ("RrPacketScheduler"); +NS_LOG_COMPONENT_DEFINE ("RrFfMacScheduler"); namespace ns3 { @@ -36,7 +36,7 @@ int Type0AllocationRbg[4] = { }; // see table 7.1.6.1-1 of 36.213 -// NS_OBJECT_ENSURE_REGISTERED (RrPacketScheduler); +NS_OBJECT_ENSURE_REGISTERED (RrFfMacScheduler); class RrSchedulerMemberCschedSapProvider : public FfMacCschedSapProvider diff --git a/src/lte/wscript b/src/lte/wscript index f6ad506e9..66e73d2be 100644 --- a/src/lte/wscript +++ b/src/lte/wscript @@ -32,6 +32,8 @@ def build(bld): 'model/ff-mac-sched-sap.cc', 'model/lte-mac-sap.cc', 'model/ff-mac-scheduler.cc', + 'model/lte-enb-cmac-sap.cc', + 'model/lte-ue-cmac-sap.cc', 'model/rr-ff-mac-scheduler.cc', 'model/lte-enb-mac.cc', 'model/lte-ue-mac.cc',