From 4a6e736f65b404de2f730903cbc31d2afb9a776c Mon Sep 17 00:00:00 2001 From: Jaume Nin Date: Tue, 6 Nov 2012 15:13:36 +0100 Subject: [PATCH] PhyStats calculator implementation. All code needed added to LteHelper. Prototype order changed in order to respect cellId,IMSI, rnti --- src/lte/examples/lena-simple.cc | 13 +- src/lte/helper/lte-helper.cc | 113 +++++++++++++ src/lte/helper/lte-helper.h | 21 ++- src/lte/helper/mac-stats-calculator.cc | 4 +- src/lte/helper/phy-stats-calculator.cc | 220 +++++++++++++++++++++++++ src/lte/helper/phy-stats-calculator.h | 146 ++++++++++++++++ src/lte/model/lte-enb-phy.cc | 6 +- src/lte/model/lte-enb-phy.h | 2 +- src/lte/model/lte-ue-phy.cc | 2 +- src/lte/model/lte-ue-phy.h | 2 +- src/lte/model/lte-ue-rrc.cc | 6 + src/lte/model/lte-ue-rrc.h | 8 +- src/lte/wscript | 2 + 13 files changed, 528 insertions(+), 17 deletions(-) create mode 100644 src/lte/helper/phy-stats-calculator.cc create mode 100644 src/lte/helper/phy-stats-calculator.h diff --git a/src/lte/examples/lena-simple.cc b/src/lte/examples/lena-simple.cc index 787563f10..d80694ca5 100644 --- a/src/lte/examples/lena-simple.cc +++ b/src/lte/examples/lena-simple.cc @@ -46,10 +46,10 @@ int main (int argc, char *argv[]) cmd.Parse (argc, argv); Ptr lteHelper = CreateObject (); - lteHelper->EnableTraces (); + // Uncomment to enable logging - //lteHelper->EnableLogComponents (); +// lteHelper->EnableLogComponents (); // Create Nodes: eNodeB and UE NodeContainer enbNodes; @@ -80,13 +80,14 @@ int main (int argc, char *argv[]) enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE; EpsBearer bearer (q); lteHelper->ActivateDataRadioBearer (ueDevs, bearer); - - Simulator::Stop (Seconds (0.010)); + // Uncomment next line to enable traces + //lteHelper->EnableTraces (); + Simulator::Stop (Seconds (1.010)); Simulator::Run (); - //GtkConfigStore config; - //config.ConfigureAttributes (); +/* GtkConfigStore config; + config.ConfigureAttributes ();*/ Simulator::Destroy (); return 0; diff --git a/src/lte/helper/lte-helper.cc b/src/lte/helper/lte-helper.cc index ae7581c41..372f7e4b3 100644 --- a/src/lte/helper/lte-helper.cc +++ b/src/lte/helper/lte-helper.cc @@ -112,6 +112,7 @@ LteHelper::DoStart (void) m_downlinkChannel->AddSpectrumPropagationLossModel (m_fadingModule); m_uplinkChannel->AddSpectrumPropagationLossModel (m_fadingModule); } + m_phyStats = CreateObject (); m_macStats = CreateObject (); m_rlcStats = CreateObject ("RLC"); m_pdcpStats = CreateObject ("PDCP"); @@ -679,11 +680,16 @@ LteHelper::EnableLogComponents (void) LogComponentEnable ("RadioBearerStatsCalculator", LOG_LEVEL_ALL); LogComponentEnable ("MacStatsCalculator", LOG_LEVEL_ALL); + LogComponentEnable ("PhyStatsCalculator", LOG_LEVEL_ALL); + LogComponentEnable ("Config", LOG_LEVEL_ALL); + + } void LteHelper::EnableTraces (void) { + EnablePhyTraces (); EnableMacTraces (); EnableRlcTraces (); EnablePdcpTraces (); @@ -747,6 +753,30 @@ FindImsiFromEnbRlcPath (std::string path) } } +uint64_t +FindImsiFromUePhy (std::string path) +{ + NS_LOG_FUNCTION (path); + // Sample path input: + // /NodeList/#NodeId/DeviceList/#DeviceId/LteUePhy + + // We retrieve the UeInfo associated to the C-RNTI and perform the IMSI lookup + std::string ueRlcPath = path.substr (0, path.find ("/LteUePhy")); + ueRlcPath += "/LteUeRrc"; + Config::MatchContainer match = Config::LookupMatches (ueRlcPath); + + if (match.GetN () != 0) + { + Ptr ueRrc = match.Get (0); + return ueRrc->GetObject ()->GetImsi (); + } + else + { + NS_FATAL_ERROR ("Lookup " << ueRlcPath << " got no matches"); + } + return 0; +} + uint16_t FindCellIdFromEnbRlcPath (std::string path) { @@ -980,6 +1010,7 @@ LteHelper::EnableMacTraces (void) void LteHelper::EnableDlMacTraces (void) { + NS_LOG_FUNCTION_NOARGS (); Config::Connect ("/NodeList/*/DeviceList/*/LteEnbMac/DlScheduling", MakeBoundCallback (&DlSchedulingCallback, m_macStats)); } @@ -1020,10 +1051,92 @@ UlSchedulingCallback (Ptr macStats, std::string path, void LteHelper::EnableUlMacTraces (void) { + NS_LOG_FUNCTION_NOARGS (); Config::Connect ("/NodeList/*/DeviceList/*/LteEnbMac/UlScheduling", MakeBoundCallback (&UlSchedulingCallback, m_macStats)); } +void +LteHelper::EnablePhyTraces (void) +{ + EnableDlPhyTraces (); + EnableUlPhyTraces (); +} + + +void +ReportCurrentCellRsrpRsrqCallback (Ptr phyStats, + std::string path, uint16_t cellId, uint16_t rnti, + double rsrp, double rsrq) +{ + NS_LOG_FUNCTION (phyStats << path); + uint64_t imsi = 0; + std::string pathUePhy = path.substr (0, path.find ("/ReportCurrentCellRsrpRsrq")); + if (phyStats->ExistsImsiPath (pathUePhy) == true) + { + imsi = phyStats->GetImsiPath (pathUePhy); + } + else + { + imsi = FindImsiFromUePhy (pathUePhy); + phyStats->SetImsiPath (pathUePhy, imsi); + } + + phyStats->ReportCurrentCellRsrpRsrq (cellId, imsi, rnti, rsrp,rsrq); +} + +void +LteHelper::EnableDlPhyTraces (void) +{ + NS_LOG_FUNCTION_NOARGS (); + Config::Connect ("/NodeList/*/DeviceList/*/LteUePhy/ReportCurrentCellRsrpRsrq", + MakeBoundCallback (&ReportCurrentCellRsrpRsrqCallback, m_phyStats)); +} + +void +ReportUeSinr (Ptr phyStats, std::string path, + uint16_t cellId, uint16_t rnti, double sinrLinear) +{ + NS_LOG_FUNCTION (phyStats << path); + + uint64_t imsi = 0; + std::ostringstream pathAndRnti; + pathAndRnti << path << "/" << rnti; + std::string pathEnbMac = path.substr (0, path.find ("LteEnbPhy/ReportUeSinr")); + pathEnbMac += "LteEnbMac/DlScheduling"; + if (phyStats->ExistsImsiPath (pathAndRnti.str ()) == true) + { + imsi = phyStats->GetImsiPath (pathAndRnti.str ()); + } + else + { + imsi = FindImsiFromEnbMac (pathEnbMac, rnti); + phyStats->SetImsiPath (pathAndRnti.str (), imsi); + } + + phyStats->ReportUeSinr (cellId, imsi, rnti, sinrLinear); +} + +void +ReportInterference (Ptr phyStats, std::string path, + uint16_t cellId, Ptr interference) +{ + NS_LOG_FUNCTION (phyStats << path); + phyStats->ReportInterference (cellId, interference); +} + +void +LteHelper::EnableUlPhyTraces (void) +{ + NS_LOG_FUNCTION_NOARGS (); + Config::Connect ("/NodeList/*/DeviceList/*/LteEnbPhy/ReportUeSinr", + MakeBoundCallback (&ReportUeSinr, m_phyStats)); + Config::Connect ("/NodeList/*/DeviceList/*/LteEnbPhy/ReportInterference", + MakeBoundCallback (&ReportInterference, m_phyStats)); +// value /$ns3::NodeListPriv/NodeList/1/$ns3::Node/DeviceList/0/$ns3::LteUeNetDevice/LteUePhy/$ns3::LteUePhy/RsrpRsrqSamplePeriod "2" + +} + Ptr LteHelper::GetRlcStats (void) { diff --git a/src/lte/helper/lte-helper.h b/src/lte/helper/lte-helper.h index 618ade09c..c09dce2db 100644 --- a/src/lte/helper/lte-helper.h +++ b/src/lte/helper/lte-helper.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -291,10 +292,27 @@ public: void EnableLogComponents (void); /** - * Enables trace sinks for MAC, RLC and PDCP + * Enables trace sinks for PHY, MAC, RLC and PDCP. To make sure all nodes are + * traced, traces should be enabled once all UEs and eNodeBs are in place and + * connected, just before starting the simulation. */ void EnableTraces (void); + /** + * Enable trace sinks for PHY layer + */ + void EnablePhyTraces (void); + + /** + * Enable trace sinks for DL PHY layer + */ + void EnableDlPhyTraces (void); + + /** + * Enable trace sinks for UL PHY layer + */ + void EnableUlPhyTraces (void); + /** * Enable trace sinks for MAC layer */ @@ -400,6 +418,7 @@ private: std::string m_fadingModelType; ObjectFactory m_fadingModelFactory; + Ptr m_phyStats; Ptr m_macStats; Ptr m_rlcStats; Ptr m_pdcpStats; diff --git a/src/lte/helper/mac-stats-calculator.cc b/src/lte/helper/mac-stats-calculator.cc index e8c303139..eb96abbaf 100644 --- a/src/lte/helper/mac-stats-calculator.cc +++ b/src/lte/helper/mac-stats-calculator.cc @@ -90,7 +90,7 @@ void MacStatsCalculator::DlScheduling (uint16_t cellId, uint64_t imsi, uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcsTb1, uint16_t sizeTb1, uint8_t mcsTb2, uint16_t sizeTb2) { - NS_LOG_FUNCTION (this << cellId << imsi << frameNo << subframeNo << rnti << mcsTb1 << sizeTb1 << mcsTb2 << sizeTb2); + NS_LOG_FUNCTION (this << cellId << imsi << frameNo << subframeNo << rnti << (uint32_t) mcsTb1 << sizeTb1 << (uint32_t) mcsTb2 << sizeTb2); NS_LOG_INFO ("Write DL Mac Stats in " << GetDlOutputFilename ().c_str ()); std::ofstream outFile; @@ -133,7 +133,7 @@ void MacStatsCalculator::UlScheduling (uint16_t cellId, uint64_t imsi, uint32_t frameNo, uint32_t subframeNo, uint16_t rnti,uint8_t mcs, uint16_t size) { - NS_LOG_FUNCTION (this << cellId << imsi << frameNo << subframeNo << rnti << mcs << size); + NS_LOG_FUNCTION (this << cellId << imsi << frameNo << subframeNo << rnti << (uint32_t) mcs << size); NS_LOG_INFO ("Write UL Mac Stats in " << GetUlOutputFilename ().c_str ()); std::ofstream outFile; diff --git a/src/lte/helper/phy-stats-calculator.cc b/src/lte/helper/phy-stats-calculator.cc new file mode 100644 index 000000000..1d93d8473 --- /dev/null +++ b/src/lte/helper/phy-stats-calculator.cc @@ -0,0 +1,220 @@ +/* -*- 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: Jaume Nin + */ + +#include "phy-stats-calculator.h" +#include "ns3/string.h" +#include +#include + +namespace ns3 { + +NS_LOG_COMPONENT_DEFINE ("PhyStatsCalculator"); + +NS_OBJECT_ENSURE_REGISTERED (PhyStatsCalculator); + +PhyStatsCalculator::PhyStatsCalculator () + : m_RsrpRsrqFirstWrite (true), + m_UeSinrFirstWrite (true), + m_InterferenceFirstWrite (true) +{ + NS_LOG_FUNCTION (this); + +} + +PhyStatsCalculator::~PhyStatsCalculator () +{ + NS_LOG_FUNCTION (this); +} + +TypeId +PhyStatsCalculator::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::PhyStatsCalculator") + .SetParent () + .AddConstructor () + .AddAttribute ("RsrpRsrqFilename", + "Name of the file where the RSRP/RSRQ statistics will be saved.", + StringValue ("DlRsrpRsrqStats.txt"), + MakeStringAccessor (&PhyStatsCalculator::SetCurrentCellRsrpRsrqFilename), + MakeStringChecker ()) + .AddAttribute ("UeSinrFilename", + "Name of the file where the UE SINR statistics will be saved.", + StringValue ("UlSinrStats.txt"), + MakeStringAccessor (&PhyStatsCalculator::SetUeSinrFilename), + MakeStringChecker ()) + .AddAttribute ("InterferenceFilename", + "Name of the file where the interference statistics will be saved.", + StringValue ("UlInterferenceStats.txt"), + MakeStringAccessor (&PhyStatsCalculator::SetInterferenceFilename), + MakeStringChecker ()) + ; + return tid; +} + +void +PhyStatsCalculator::SetCurrentCellRsrpRsrqFilename (std::string filename) +{ + m_RsrpRsrqFilename = filename; +} + +std::string +PhyStatsCalculator::GetCurrentCellRsrpRsrqFilename (void) +{ + return m_RsrpRsrqFilename; +} + +void +PhyStatsCalculator::SetUeSinrFilename (std::string filename) +{ + m_ueSinrFilename = filename; +} + +std::string +PhyStatsCalculator::GetUeSinrFilename (void) +{ + return m_ueSinrFilename; +} + +void +PhyStatsCalculator::SetInterferenceFilename (std::string filename) +{ + m_interferenceFilename = filename; +} + +std::string +PhyStatsCalculator::GetInterferenceFilename (void) +{ + return m_interferenceFilename; +} + + + +void +PhyStatsCalculator::ReportCurrentCellRsrpRsrq (uint16_t cellId, uint64_t imsi, uint16_t rnti, + double rsrp, double rsrq) +{ + NS_LOG_FUNCTION (this << cellId << imsi << rnti << rsrp << rsrq); + NS_LOG_INFO ("Write RSRP/RSRQ Phy Stats in " << GetCurrentCellRsrpRsrqFilename ().c_str ()); + + std::ofstream outFile; + if ( m_RsrpRsrqFirstWrite == true ) + { + outFile.open (GetCurrentCellRsrpRsrqFilename ().c_str ()); + if (!outFile.is_open ()) + { + NS_LOG_ERROR ("Can't open file " << GetCurrentCellRsrpRsrqFilename ().c_str ()); + return; + } + m_RsrpRsrqFirstWrite = false; + outFile << "% time\tcellId\tIMSI\tRNTI\trsrp\trsrq"; + outFile << std::endl; + } + else + { + outFile.open (GetCurrentCellRsrpRsrqFilename ().c_str (), std::ios_base::app); + if (!outFile.is_open ()) + { + NS_LOG_ERROR ("Can't open file " << GetCurrentCellRsrpRsrqFilename ().c_str ()); + return; + } + } + + outFile << Simulator::Now ().GetNanoSeconds () / (double) 1e9 << "\t"; + outFile << cellId << "\t"; + outFile << imsi << "\t"; + outFile << rnti << "\t"; + outFile << rsrp << "\t"; + outFile << rsrq << std::endl; + outFile.close (); +} + +void +PhyStatsCalculator::ReportUeSinr (uint16_t cellId, uint64_t imsi, uint16_t rnti, double sinrLinear) +{ + NS_LOG_FUNCTION (this << cellId << imsi << rnti << sinrLinear); + NS_LOG_INFO ("Write SINR Linear Phy Stats in " << GetUeSinrFilename ().c_str ()); + + std::ofstream outFile; + if ( m_UeSinrFirstWrite == true ) + { + outFile.open (GetUeSinrFilename ().c_str ()); + if (!outFile.is_open ()) + { + NS_LOG_ERROR ("Can't open file " << GetUeSinrFilename ().c_str ()); + return; + } + m_UeSinrFirstWrite = false; + outFile << "% time\tcellId\tIMSI\tRNTI\tsinrLinear"; + outFile << std::endl; + } + else + { + outFile.open (GetUeSinrFilename ().c_str (), std::ios_base::app); + if (!outFile.is_open ()) + { + NS_LOG_ERROR ("Can't open file " << GetUeSinrFilename ().c_str ()); + return; + } + } + + outFile << Simulator::Now ().GetNanoSeconds () / (double) 1e9 << "\t"; + outFile << cellId << "\t"; + outFile << imsi << "\t"; + outFile << rnti << "\t"; + outFile << sinrLinear << std::endl; + outFile.close (); +} + +void +PhyStatsCalculator::ReportInterference (uint16_t cellId, Ptr interference) +{ + NS_LOG_FUNCTION (this << cellId << interference); + NS_LOG_INFO ("Write Interference Phy Stats in " << GetInterferenceFilename ().c_str ()); + + std::ofstream outFile; + if ( m_InterferenceFirstWrite == true ) + { + outFile.open (GetInterferenceFilename ().c_str ()); + if (!outFile.is_open ()) + { + NS_LOG_ERROR ("Can't open file " << GetInterferenceFilename ().c_str ()); + return; + } + m_InterferenceFirstWrite = false; + outFile << "% time\tcellId\tInterference"; + outFile << std::endl; + } + else + { + outFile.open (GetInterferenceFilename ().c_str (), std::ios_base::app); + if (!outFile.is_open ()) + { + NS_LOG_ERROR ("Can't open file " << GetInterferenceFilename ().c_str ()); + return; + } + } + + outFile << Simulator::Now ().GetNanoSeconds () / (double) 1e9 << "\t"; + outFile << cellId << "\t"; + outFile << *interference; + outFile.close (); +} + +} // namespace ns3 diff --git a/src/lte/helper/phy-stats-calculator.h b/src/lte/helper/phy-stats-calculator.h new file mode 100644 index 000000000..aebeb322c --- /dev/null +++ b/src/lte/helper/phy-stats-calculator.h @@ -0,0 +1,146 @@ +/* -*- 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: Jaume Nin + */ + +#ifndef PHY_STATS_CALCULATOR_H_ +#define PHY_STATS_CALCULATOR_H_ + +#include "ns3/lte-stats-calculator.h" +#include "ns3/nstime.h" +#include "ns3/uinteger.h" +#include "ns3/spectrum-value.h" +#include +#include + +namespace ns3 { + +/** + * Takes care of storing the information generated at PHY layer. Metrics saved are: + * - RSRP/RSRQ for DL + * - Timestamp (in seconds) + * - IMSI + * - C-RNTI + * - RSRP + * - RSRQ + * - UE SINR + * - Timestamp (in seconds) + * - Cell ID of the reported Enb + * - IMSI + * - C-RNTI + * - measured and reported SINR value in linear + * - Interference for UL + * - Cell ID of the reported Enb + * - IMSI of the scheduled UE + * - C-RNTI scheduled + * - Measured interference for each RB + */ +class PhyStatsCalculator : public LteStatsCalculator +{ +public: + /** + * Constructor + */ + PhyStatsCalculator (); + + /** + * Destructor + */ + virtual ~PhyStatsCalculator (); + + /** + * Inherited from ns3::Object + */ + static TypeId GetTypeId (void); + + /** + * Set the name of the file where the RSRP/RSRQ statistics will be stored. + * + * \param filename string with the name of the file + */ + void SetCurrentCellRsrpRsrqFilename (std::string filename); + + /** + * Get the name of the file where the RSRP/RSRQ statistics will be stored. + */ + std::string GetCurrentCellRsrpRsrqFilename (void); + + /** + * Set the name of the file where the UE SINR statistics will be stored. + * + * @param filename string with the name of the file + */ + void SetUeSinrFilename (std::string filename); + + /** + * Get the name of the file where the UE SINR statistics will be stored. + */ + std::string GetUeSinrFilename (void); + + /** + * Set the name of the file where the interference statistics will be stored. + * + * @param filename string with the name of the file + */ + void SetInterferenceFilename (std::string filename); + + /** + * Get the name of the file where the interference statistics will be stored. + */ + std::string GetInterferenceFilename (void); + + /** + * Notifies the stats calculator that an RSRP and RSRQ report has occurred. + * @param imsi IMSI of the scheduled UE + * @param rnti C-RNTI scheduled + * @param rsrp Reference Signal Received Power + * @param rsrq Reference Signal Received Quality + */ + void ReportCurrentCellRsrpRsrq (uint16_t cellId, uint64_t imsi, uint16_t rnti, double rsrp, double rsrq); + + /** + * Notifies the stats calculator that an UE SINR report has occurred. + * @param cellId Cell ID of the reported Enb + * @param imsi IMSI of the scheduled UE + * @param rnti C-RNTI scheduled + * @param sinrLinear measured and reported SINR value in linear + */ + void ReportUeSinr (uint16_t cellId, uint64_t imsi, uint16_t rnti, double sinrLinear); + /** + * Notifies the stats calculator that an interference report has occurred. + * @param imsi IMSI of the scheduled UE + * @param rnti C-RNTI scheduled + * @param cellId Cell ID of the reported Enb + * @param interference Measured interference for each RB + */ + void ReportInterference (uint16_t cellId, Ptr interference); + +private: + bool m_RsrpRsrqFirstWrite; + bool m_UeSinrFirstWrite; + bool m_InterferenceFirstWrite; + + std::string m_RsrpRsrqFilename; + std::string m_ueSinrFilename; + std::string m_interferenceFilename; + +}; + +} // namespace ns3 + +#endif /* PHY_STATS_CALCULATOR_H_ */ diff --git a/src/lte/model/lte-enb-phy.cc b/src/lte/model/lte-enb-phy.cc index fecd15adb..6dd164e9c 100644 --- a/src/lte/model/lte-enb-phy.cc +++ b/src/lte/model/lte-enb-phy.cc @@ -47,6 +47,7 @@ NS_LOG_COMPONENT_DEFINE ("LteEnbPhy"); namespace ns3 { +NS_OBJECT_ENSURE_REGISTERED (LteEnbPhy); // duration of the data part of a subframe in DL // = 0.001 / 14 * 11 (fixed to 11 symbols) -1ns as margin to avoid overlapping simulator events @@ -135,9 +136,6 @@ EnbMemberLteEnbPhySapProvider::SetSrsConfigurationIndex (uint16_t rnti, uint16_ -NS_OBJECT_ENSURE_REGISTERED (LteEnbPhy); - - LteEnbPhy::LteEnbPhy () { NS_LOG_FUNCTION (this); @@ -768,7 +766,7 @@ LteEnbPhy::CreateSrsReport(uint16_t rnti, double srs) (*it).second++; if ((*it).second == m_srsSamplePeriod) { - m_reportUeSinr (rnti, m_cellId, srs); + m_reportUeSinr (m_cellId, rnti, srs); (*it).second = 0; } } diff --git a/src/lte/model/lte-enb-phy.h b/src/lte/model/lte-enb-phy.h index 169bdfb7b..2524cda28 100644 --- a/src/lte/model/lte-enb-phy.h +++ b/src/lte/model/lte-enb-phy.h @@ -291,7 +291,7 @@ private: /** * Trace reporting the linear average of SRS SINRs - * uint16_t rnti, uint16_t cellId, double sinrLinear + * uint16_t cellId, uint16_t rnti, double sinrLinear */ TracedCallback m_reportUeSinr; uint16_t m_srsSamplePeriod; diff --git a/src/lte/model/lte-ue-phy.cc b/src/lte/model/lte-ue-phy.cc index 2e30ba75d..30e4a3853 100644 --- a/src/lte/model/lte-ue-phy.cc +++ b/src/lte/model/lte-ue-phy.cc @@ -421,7 +421,7 @@ LteUePhy::CreateDlCqiFeedbackMessage (const SpectrumValue& sinr) // Generate RSRP and RSRQ traces (dummy values, real valeus TBD) double rsrp = 0.0; double rsrq = 0.0; - m_reportCurrentCellRsrpRsrqTrace (m_rnti, m_cellId, rsrp, rsrq); + m_reportCurrentCellRsrpRsrqTrace (m_cellId, m_rnti, rsrp, rsrq); m_rsrpRsrqSampleCounter = 0; } diff --git a/src/lte/model/lte-ue-phy.h b/src/lte/model/lte-ue-phy.h index e139d8c7f..ba7105688 100644 --- a/src/lte/model/lte-ue-phy.h +++ b/src/lte/model/lte-ue-phy.h @@ -270,7 +270,7 @@ private: /** * Trace information regarding RSRP and RSRQ (see TS 36.214) - * uint16_t rnti, uint16_t cellId, double rsrp, double rsrq + * uint16_t cellId, uint16_t rnti, double rsrp, double rsrq */ TracedCallback m_reportCurrentCellRsrpRsrqTrace; uint16_t m_rsrpRsrqSamplePeriod; diff --git a/src/lte/model/lte-ue-rrc.cc b/src/lte/model/lte-ue-rrc.cc index b8b91c527..b3e63e85d 100644 --- a/src/lte/model/lte-ue-rrc.cc +++ b/src/lte/model/lte-ue-rrc.cc @@ -185,6 +185,12 @@ LteUeRrc::SetImsi (uint64_t imsi) m_imsi = imsi; } +uint64_t +LteUeRrc::GetImsi (void) +{ + return m_imsi; +} + void LteUeRrc::SetupRadioBearer (EpsBearer bearer, TypeId rlcTypeId, uint8_t lcid) { diff --git a/src/lte/model/lte-ue-rrc.h b/src/lte/model/lte-ue-rrc.h index 44482ee6e..3137e292d 100644 --- a/src/lte/model/lte-ue-rrc.h +++ b/src/lte/model/lte-ue-rrc.h @@ -123,12 +123,18 @@ public: LteAsSapProvider* GetAsSapProvider (); /** - * * * \param imsi the unique UE identifier */ void SetImsi (uint64_t imsi); + /** + * + * \return imsi the unique UE identifier + */ + uint64_t GetImsi (void); + + /** * Set UE RRC parameters * diff --git a/src/lte/wscript b/src/lte/wscript index e422defdb..ef437a1ae 100644 --- a/src/lte/wscript +++ b/src/lte/wscript @@ -37,6 +37,7 @@ def build(bld): 'helper/lte-stats-calculator.cc', 'helper/epc-helper.cc', 'helper/radio-bearer-stats-calculator.cc', + 'helper/phy-stats-calculator.cc', 'helper/mac-stats-calculator.cc', 'helper/radio-environment-map-helper.cc', 'helper/lte-hex-grid-enb-topology-helper.cc', @@ -143,6 +144,7 @@ def build(bld): 'helper/lte-helper.h', 'helper/lte-stats-calculator.h', 'helper/epc-helper.h', + 'helper/phy-stats-calculator.h', 'helper/mac-stats-calculator.h', 'helper/radio-bearer-stats-calculator.h', 'helper/radio-environment-map-helper.h',