This commit is contained in:
mrequena
2011-03-30 15:22:46 +02:00
28 changed files with 308 additions and 97 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -38,6 +38,11 @@
#include <ns3/lte-ue-net-device.h>
#include <ns3/lte-spectrum-value-helper.h>
#include <ns3/lte-enb-mac.h>
#include <ns3/pf-ff-mac-scheduler.h>
#include <ns3/lte-enb-rrc.h>
#include <ns3/lte-ue-mac.h>
#include <ns3/lte-ue-rrc.h>
namespace ns3 {
@@ -49,6 +54,8 @@ LenaHelper::LenaHelper (void)
{
Ptr<SpectrumPropagationLossModel> model = CreateObject<FriisSpectrumPropagationLossModel> ();
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<Node> n)
ulPhy->SetMobility (mm);
m_uplinkChannel->AddRx (ulPhy);
Ptr<LteEnbNetDevice> dev = CreateObject<LteEnbNetDevice> (n, phy);
Ptr<LteEnbMac> mac = CreateObject<LteEnbMac> ();
Ptr<FfMacScheduler> sched = m_scheduler.Create<FfMacScheduler> ();
//Ptr<FfMacScheduler> sched = Create<PfFfMacScheduler> ();
Ptr<LteEnbRrc> rrc = Create<LteEnbRrc> ();
Ptr<LteEnbNetDevice> dev = CreateObject<LteEnbNetDevice> (n, phy, mac, sched, rrc);
phy->SetDevice (dev);
dlPhy->SetDevice (dev);
ulPhy->SetDevice (dev);
n->AddDevice (dev);
Ptr<LteEnbMac> mac = dev->GetMac ();
ulPhy->SetPhyMacRxEndOkCallback (MakeCallback (&LteEnbPhy::PhyPduReceived, phy));
dev->Start ();
@@ -162,14 +197,15 @@ LenaHelper::InstallSingleUeDevice (Ptr<Node> n)
ulPhy->SetMobility (mm);
m_downlinkChannel->AddRx (dlPhy);
Ptr<LteUeNetDevice> dev = CreateObject<LteUeNetDevice> (n, phy);
Ptr<LteUeMac> mac = CreateObject<LteUeMac> ();
Ptr<LteUeRrc> rrc = Create<LteUeRrc> ();
Ptr<LteUeNetDevice> dev = CreateObject<LteUeNetDevice> (n, phy, mac, rrc);
phy->SetDevice (dev);
dlPhy->SetDevice (dev);
ulPhy->SetDevice (dev);
n->AddDevice (dev);
Ptr<LteUeMac> 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);

View File

@@ -116,6 +116,42 @@ public:
* \param bearer the characteristics of the bearer to be activated
*/
void ActivateEpsBearer (Ptr<NetDevice> 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<SpectrumChannel> m_downlinkChannel;
Ptr<SpectrumChannel> m_uplinkChannel;
ObjectFactory m_scheduler;
};

View File

@@ -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 <mmiozzo@cttc.es>
*/
#include "lte-enb-cmac-sap.h"
namespace ns3 {
LteEnbCmacSapProvider::~LteEnbCmacSapProvider ()
{
}
LteEnbCmacSapUser::~LteEnbCmacSapUser ()
{
}
} // namespace ns3

View File

@@ -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
*

View File

@@ -471,6 +471,11 @@ LteEnbMac::DoReceiveIdealControlMessage (Ptr<IdealControlMessage> msg)
Ptr<DlCqiIdealControlMessage> dlcqi = DynamicCast<DlCqiIdealControlMessage> (msg);
ReceiveDlCqiIdealControlMessage (dlcqi);
}
else if (msg->GetMessageType () == IdealControlMessage::UL_CQI)
{
Ptr<UlCqiIdealControlMessage> ulcqi = DynamicCast<UlCqiIdealControlMessage> (msg);
ReceiveUlCqiIdealControlMessage (ulcqi);
}
else if (msg->GetMessageType () == IdealControlMessage::BSR)
{
Ptr<BsrIdealControlMessage> bsr = DynamicCast<BsrIdealControlMessage> (msg);
@@ -495,6 +500,21 @@ LteEnbMac::ReceiveDlCqiIdealControlMessage (Ptr<DlCqiIdealControlMessage> msg)
}
void
LteEnbMac::ReceiveUlCqiIdealControlMessage (Ptr<UlCqiIdealControlMessage> 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)
{

View File

@@ -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<DlCqiIdealControlMessage> msg);
/**
* \brief Receive a UL CQI ideal control message
* \param msg the UL CQI message
*/
void ReceiveUlCqiIdealControlMessage (Ptr<UlCqiIdealControlMessage> msg);
void DoReceiveIdealControlMessage (Ptr<IdealControlMessage> msg);
/**

View File

@@ -73,10 +73,13 @@ LteEnbNetDevice::LteEnbNetDevice (void)
InitLteEnbNetDevice ();
}
LteEnbNetDevice::LteEnbNetDevice (Ptr<Node> node, Ptr<LteEnbPhy> phy)
: m_phy (phy)
LteEnbNetDevice::LteEnbNetDevice (Ptr<Node> node, Ptr<LteEnbPhy> phy, Ptr<LteEnbMac> mac, Ptr<FfMacScheduler> sched, Ptr<LteEnbRrc> 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<LteEnbMac> ();
// m_mac->SetDevice (this->GetObject<LteNetDevice> ());
SetNode (0);
if (GetPhy () == 0)
{
@@ -120,13 +121,11 @@ LteEnbNetDevice::InitLteEnbNetDevice (void)
{
NS_LOG_DEBUG (this << "PHY ! NULL");
}
m_rrc = CreateObject<LteEnbRrc> ();
m_rrc->SetLteEnbCmacSapProvider (m_mac->GetLteEnbCmacSapProvider ());
m_mac->SetLteEnbCmacSapUser (m_rrc->GetLteEnbCmacSapUser ());
m_rrc->SetLteMacSapProvider (m_mac->GetLteMacSapProvider ());
//m_scheduler = Create<RrFfMacScheduler> ();
m_scheduler = Create<PfFfMacScheduler> ();
m_mac->SetFfMacSchedSapProvider (m_scheduler->GetFfMacSchedSapProvider ());
m_mac->SetFfMacCschedSapProvider (m_scheduler->GetFfMacCschedSapProvider ());

View File

@@ -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> node, Ptr<LteEnbPhy> phy);
LteEnbNetDevice (Ptr<Node> node, Ptr<LteEnbPhy> phy, Ptr<LteEnbMac> mac, Ptr<FfMacScheduler> sched, Ptr<LteEnbRrc> rrc);
virtual ~LteEnbNetDevice (void);
virtual void DoDispose (void);

View File

@@ -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<LteEnbNetDevice> thisDevice = GetDevice ()->GetObject<LteEnbNetDevice> ();
Ptr<UlCqiIdealControlMessage> msg = CreateUlCqiFeedbackMessage (sinr);
m_enbPhySapUser->ReceiveIdealControlMessage (msg);
}
Ptr<UlCqiIdealControlMessage>
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<UlCqiIdealControlMessage> msg = Create<UlCqiIdealControlMessage> ();
msg->SetUlCqi (ulcqi);
return (msg);
}
};

View File

@@ -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<IdealControlMessage> 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<UlCqiIdealControlMessage> CreateUlCqiFeedbackMessage (const SpectrumValue& sinr);
void DoSendIdealControlMessage (Ptr<IdealControlMessage> msg);

View File

@@ -29,4 +29,8 @@ LteMacSapProvider::~LteMacSapProvider ()
{
}
LteMacSapUser::~LteMacSapUser ()
{
}
} // namespace ns3

View File

@@ -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.

View File

@@ -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<SpectrumChannel> c)
m_downlinkSpectrumPhy->SetChannel (c);
}
Ptr<SpectrumChannel>
LtePhy::GetDownlinkChannel ()
{
NS_LOG_FUNCTION (this);
return m_downlinkSpectrumPhy->GetChannel ();
}
void
LtePhy::SetUplinkChannel (Ptr<SpectrumChannel> c)
{
@@ -160,15 +152,6 @@ LtePhy::SetUplinkChannel (Ptr<SpectrumChannel> c)
m_uplinkSpectrumPhy->SetChannel (c);
}
Ptr<SpectrumChannel>
LtePhy::GetUplinkChannel ()
{
NS_LOG_FUNCTION (this);
return m_uplinkSpectrumPhy->GetChannel ();
}
void
LtePhy::SetDownlinkSubChannels (std::vector<int> mask )
{

View File

@@ -100,24 +100,12 @@ public:
*/
void SetDownlinkChannel (Ptr<SpectrumChannel> c);
/**
* Get the downlink channel
* \return a Ptr to the downlink SpectrumChannel
*/
Ptr<SpectrumChannel> GetDownlinkChannel ();
/**
* Set the uplink channel
* \param c the uplink channel
*/
void SetUplinkChannel (Ptr<SpectrumChannel> c);
/**
* Get the uplink channel
* \return a Ptr to the uplink SpectrumChannel
*/
Ptr<SpectrumChannel> 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)

View File

@@ -27,6 +27,11 @@ NS_LOG_COMPONENT_DEFINE ("LteSinrChunkProcessor");
namespace ns3 {
LteSinrChunkProcessor::~LteSinrChunkProcessor ()
{
NS_LOG_FUNCTION (this);
}
LteCqiSinrChunkProcessor::LteCqiSinrChunkProcessor (Ptr<LtePhy> p)
: m_phy (p)
@@ -35,6 +40,13 @@ LteCqiSinrChunkProcessor::LteCqiSinrChunkProcessor (Ptr<LtePhy> p)
NS_ASSERT (m_phy);
}
LteCqiSinrChunkProcessor::~LteCqiSinrChunkProcessor ()
{
NS_LOG_FUNCTION (this);
}
void
LteCqiSinrChunkProcessor::Start ()
{

View File

@@ -42,6 +42,7 @@ namespace ns3 {
class LteSinrChunkProcessor : public SimpleRefCount<LteSinrChunkProcessor>
{
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<LtePhy> p);
virtual void Start ();
virtual void EvaluateSinrChunk (const SpectrumValue& sinr, Time duration);

View File

@@ -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<SpectrumChannel> c)
m_channel = c;
}
Ptr<SpectrumChannel>
LteSpectrumPhy::GetChannel (void)
{
return m_channel;
}
Ptr<const SpectrumModel>
LteSpectrumPhy::GetRxSpectrumModel () const
{

View File

@@ -61,6 +61,7 @@ public:
// inherited from Object
static TypeId GetTypeId (void);
virtual void DoDispose ();
// inherited from SpectrumPhy
void SetChannel (Ptr<SpectrumChannel> c);
@@ -72,13 +73,6 @@ public:
void StartRx (Ptr<PacketBurst> pb, Ptr <const SpectrumValue> rxPsd, SpectrumType st, Time duration);
/**
* \brief Get the channel where the physical layer is attached
* \return a pointer to the channel
*/
Ptr<SpectrumChannel> GetChannel (void);
/**
* Get the SpectrumType used by this PHY
*

View File

@@ -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 <mmiozzo@cttc.es>
*/
#include "lte-ue-cmac-sap.h"
namespace ns3 {
LteUeCmacSapProvider::~LteUeCmacSapProvider ()
{
}
LteUeCmacSapUser::~LteUeCmacSapUser ()
{
}
} // namespace ns3

View File

@@ -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;
};

View File

@@ -66,13 +66,14 @@ LteUeNetDevice::LteUeNetDevice (void)
}
LteUeNetDevice::LteUeNetDevice (Ptr<Node> node, Ptr<LteUePhy> phy)
: m_phy (phy)
LteUeNetDevice::LteUeNetDevice (Ptr<Node> node, Ptr<LteUePhy> phy, Ptr<LteUeMac> mac, Ptr<LteUeRrc> 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<LteUeMac> ();
m_rrc = CreateObject<LteUeRrc> ();
m_rrc->SetLteUeCmacSapProvider (m_mac->GetLteUeCmacSapProvider ());
m_mac->SetLteUeCmacSapUser (m_rrc->GetLteUeCmacSapUser ());
m_rrc->SetLteMacSapProvider (m_mac->GetLteMacSapProvider ());

View File

@@ -57,7 +57,7 @@ public:
* \param node
* \param phy
*/
LteUeNetDevice (Ptr<Node> node, Ptr<LteUePhy> phy);
LteUeNetDevice (Ptr<Node> node, Ptr<LteUePhy> phy, Ptr<LteUeMac> mac, Ptr<LteUeRrc> rrc);
virtual ~LteUeNetDevice (void);
virtual void DoDispose ();

View File

@@ -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);
}

View File

@@ -289,7 +289,7 @@ PfFfMacScheduler::DoCschedLcConfigReq (const struct FfMacCschedSapProvider::Csch
NS_LOG_FUNCTION (this << " New LC, rnti: " << params.m_rnti);
std::map <pfsFlowId_t, pfsFlowPerf_t>::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<pfsFlowId_t, pfsFlowPerf_t> (flow, flowStats));
}
else

View File

@@ -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

View File

@@ -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',