--- a/src/lte/doc/source/lte-user.rst Mon Dec 05 21:13:53 2011 +0100
+++ b/src/lte/doc/source/lte-user.rst Mon Dec 05 21:19:59 2011 +0100
@@ -209,9 +209,9 @@
RLC KPIs are calculated over a time interval and stored on two ASCII
files, one for uplink and one for downlink. The time interval duration
and the name of the files can be controlled using the attributes
-``ns3::RlcStatsCalculator::EpochDuration``,
-``ns3::RlcStatsCalculator::DlOutputFilename`` and
-``ns3::RlcStatsCalculator::UlOutputFilename``.
+``ns3::RadioBearerStatsCalculator::EpochDuration``,
+``ns3::RadioBearerStatsCalculator::DlOutputFilename`` and
+``ns3::RadioBearerStatsCalculator::UlOutputFilename``.
The content of the columns of these files is the following (the same
for uplink and downlink):
--- a/src/lte/examples/lena-intercell-interference.cc Mon Dec 05 21:13:53 2011 +0100
+++ b/src/lte/examples/lena-intercell-interference.cc Mon Dec 05 21:19:59 2011 +0100
@@ -25,7 +25,7 @@
#include "ns3/mobility-module.h"
#include "ns3/lte-module.h"
#include "ns3/config-store.h"
-#include "ns3/rlc-stats-calculator.h"
+#include "ns3/radio-bearer-stats-calculator.h"
#include <iomanip>
#include <string>
--- a/src/lte/examples/lena-pathloss-traces.cc Mon Dec 05 21:13:53 2011 +0100
+++ b/src/lte/examples/lena-pathloss-traces.cc Mon Dec 05 21:19:59 2011 +0100
@@ -25,7 +25,7 @@
#include "ns3/mobility-module.h"
#include "ns3/lte-module.h"
#include "ns3/config-store.h"
-#include "ns3/rlc-stats-calculator.h"
+#include "ns3/radio-bearer-stats-calculator.h"
#include <iomanip>
#include <string>
--- a/src/lte/helper/lte-helper.cc Mon Dec 05 21:13:53 2011 +0100
+++ b/src/lte/helper/lte-helper.cc Mon Dec 05 21:19:59 2011 +0100
@@ -109,10 +109,10 @@
m_macStats = CreateObject<MacStatsCalculator> ();
m_macStats->SetDlOutputFilename("DlMacStats.csv");
m_macStats->SetUlOutputFilename("UlMacStats.csv");
- m_rlcStats = CreateObject<RlcStatsCalculator> ();
+ m_rlcStats = CreateObject<RadioBearerStatsCalculator> ();
m_rlcStats->SetDlOutputFilename("DlRlcStats.csv");
m_rlcStats->SetUlOutputFilename("UlRlcStats.csv");
- m_pdcpStats = CreateObject<RlcStatsCalculator> ();
+ m_pdcpStats = CreateObject<RadioBearerStatsCalculator> ();
m_pdcpStats->SetDlOutputFilename("DlPdcpStats.csv");
m_pdcpStats->SetUlOutputFilename("UlPdcpStats.csv");
@@ -568,7 +568,7 @@
LogComponentEnable ("LteUeNetDevice", LOG_LEVEL_ALL);
LogComponentEnable ("LteEnbNetDevice", LOG_LEVEL_ALL);
- LogComponentEnable ("RlcStatsCalculator", LOG_LEVEL_ALL);
+ LogComponentEnable ("RadioBearerStatsCalculator", LOG_LEVEL_ALL);
LogComponentEnable ("MacStatsCalculator", LOG_LEVEL_ALL);
}
@@ -687,7 +687,7 @@
void
-DlTxPduCallback (Ptr<RlcStatsCalculator> rlcStats, std::string path,
+DlTxPduCallback (Ptr<RadioBearerStatsCalculator> rlcStats, std::string path,
uint16_t rnti, uint8_t lcid, uint32_t packetSize)
{
NS_LOG_FUNCTION (rlcStats << path << rnti << lcid << packetSize);
@@ -715,7 +715,7 @@
}
void
-DlRxPduCallback (Ptr<RlcStatsCalculator> rlcStats, std::string path,
+DlRxPduCallback (Ptr<RadioBearerStatsCalculator> rlcStats, std::string path,
uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay)
{
NS_LOG_FUNCTION (rlcStats << path << rnti << lcid << packetSize << delay);
@@ -743,7 +743,7 @@
}
void
-UlTxPduCallback (Ptr<RlcStatsCalculator> rlcStats, std::string path,
+UlTxPduCallback (Ptr<RadioBearerStatsCalculator> rlcStats, std::string path,
uint16_t rnti, uint8_t lcid, uint32_t packetSize)
{
NS_LOG_FUNCTION (rlcStats << path << rnti << lcid << packetSize);
@@ -761,7 +761,7 @@
}
void
-UlRxPduCallback (Ptr<RlcStatsCalculator> rlcStats, std::string path,
+UlRxPduCallback (Ptr<RadioBearerStatsCalculator> rlcStats, std::string path,
uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay)
{
NS_LOG_FUNCTION (rlcStats << path << rnti << lcid << packetSize << delay);
@@ -896,7 +896,7 @@
m_rlcStats->SetUlOutputFilename(path + m_rlcStats->GetUlOutputFilename());
}
-Ptr<RlcStatsCalculator>
+Ptr<RadioBearerStatsCalculator>
LteHelper::GetRlcStats (void)
{
return m_rlcStats;
@@ -928,7 +928,7 @@
MakeBoundCallback (&UlRxPduCallback, m_pdcpStats));
}
-Ptr<RlcStatsCalculator>
+Ptr<RadioBearerStatsCalculator>
LteHelper::GetPdcpStats (void)
{
return m_pdcpStats;
--- a/src/lte/helper/lte-helper.h Mon Dec 05 21:13:53 2011 +0100
+++ b/src/lte/helper/lte-helper.h Mon Dec 05 21:19:59 2011 +0100
@@ -30,7 +30,7 @@
#include <ns3/node-container.h>
#include <ns3/eps-bearer.h>
#include <ns3/mac-stats-calculator.h>
-#include <ns3/rlc-stats-calculator.h>
+#include <ns3/radio-bearer-stats-calculator.h>
#include <ns3/lte-tft.h>
#include <ns3/trace-fading-loss-model.h>
@@ -232,7 +232,7 @@
*
* \return the RLC stats calculator object
*/
- Ptr<RlcStatsCalculator> GetRlcStats (void);
+ Ptr<RadioBearerStatsCalculator> GetRlcStats (void);
/**
* Enable trace sinks for PDCP layer
@@ -253,7 +253,7 @@
*
* \return the PDCP stats calculator object
*/
- Ptr<RlcStatsCalculator> GetPdcpStats (void);
+ Ptr<RadioBearerStatsCalculator> GetPdcpStats (void);
protected:
// inherited from Object
@@ -282,8 +282,8 @@
Ptr<TraceFadingLossModel> m_fadingModule;
Ptr<MacStatsCalculator> m_macStats;
- Ptr<RlcStatsCalculator> m_rlcStats;
- Ptr<RlcStatsCalculator> m_pdcpStats;
+ Ptr<RadioBearerStatsCalculator> m_rlcStats;
+ Ptr<RadioBearerStatsCalculator> m_pdcpStats;
enum LteEpsBearerToRlcMapping_t {RLC_SM_ALWAYS = 1,
RLC_UM_ALWAYS = 2,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lte/helper/radio-bearer-stats-calculator.cc Mon Dec 05 21:19:59 2011 +0100
@@ -0,0 +1,558 @@
+/* -*- 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 <jnin@cttc.es>
+ */
+
+#include "radio-bearer-stats-calculator.h"
+#include "ns3/string.h"
+#include "ns3/nstime.h"
+#include <ns3/log.h>
+#include <vector>
+#include <algorithm>
+
+namespace ns3 {
+
+NS_LOG_COMPONENT_DEFINE ("RadioBearerStatsCalculator");
+
+NS_OBJECT_ENSURE_REGISTERED (RadioBearerStatsCalculator);
+
+RadioBearerStatsCalculator::RadioBearerStatsCalculator ()
+ : m_firstWrite (true)
+{
+ NS_LOG_FUNCTION (this);
+
+}
+
+RadioBearerStatsCalculator::~RadioBearerStatsCalculator ()
+{
+ NS_LOG_FUNCTION (this);
+ ShowResults ();
+}
+
+TypeId
+RadioBearerStatsCalculator::GetTypeId (void)
+{
+ static TypeId tid =
+ TypeId ("ns3::RadioBearerStatsCalculator")
+ .SetParent<Object> ()
+ .AddConstructor<RadioBearerStatsCalculator> ()
+ .AddAttribute ("StartTime",
+ "Start time of the on going epoch.",
+ TimeValue (Seconds (0.)),
+ MakeTimeAccessor (&RadioBearerStatsCalculator::m_startTime),
+ MakeTimeChecker ())
+ .AddAttribute ("EpochDuration",
+ "Epoch duration.",
+ TimeValue (Seconds (0.25)),
+ MakeTimeAccessor (&RadioBearerStatsCalculator::m_epochDuration),
+ MakeTimeChecker ());
+ return tid;
+}
+
+void
+RadioBearerStatsCalculator::UlTxPdu (uint64_t imsi, uint16_t rnti,
+ uint8_t lcid, uint32_t packetSize)
+{
+ NS_LOG_FUNCTION (this << "UlTxPDU" << imsi << rnti << (uint32_t) lcid << packetSize);
+ ImsiLcidPair_t p (imsi, lcid);
+ if (Simulator::Now () > m_startTime)
+ {
+ m_flowId[p] = LteFlowId_t (rnti, lcid);
+ m_ulTxPackets[p]++;
+ m_ulTxData[p] += packetSize;
+ }
+ CheckEpoch ();
+}
+
+void
+RadioBearerStatsCalculator::DlTxPdu (uint16_t cellId, uint64_t imsi, uint16_t rnti,
+ uint8_t lcid, uint32_t packetSize)
+{
+ NS_LOG_FUNCTION (this << "DlTxPDU" << imsi << rnti << (uint32_t) lcid << packetSize);
+ ImsiLcidPair_t p (imsi, lcid);
+ bool forceEpoch = false;
+ if (Simulator::Now () > m_startTime)
+ {
+
+ // If the UE hands off to another cell, restart the epoch automatically
+ if (m_dlCellId[p] != 0 && m_dlCellId[p] != cellId)
+ {
+ forceEpoch = true;
+ }
+ else
+ {
+ m_dlCellId[p] = cellId;
+ }
+ m_flowId[p] = LteFlowId_t (rnti, lcid);
+ m_dlTxPackets[p]++;
+ m_dlTxData[p] += packetSize;
+ }
+ CheckEpoch (forceEpoch);
+}
+
+void
+RadioBearerStatsCalculator::UlRxPdu (uint16_t cellId, uint64_t imsi, uint16_t rnti,
+ uint8_t lcid, uint32_t packetSize, uint64_t delay)
+{
+ NS_LOG_FUNCTION (this << "UlRxPDU" << imsi << rnti << (uint32_t) lcid << packetSize << delay);
+ ImsiLcidPair_t p (imsi, lcid);
+ bool forceEpoch = false;
+
+ if (Simulator::Now () > m_startTime)
+ {
+ // If the UE hands off to another cell, restart the epoch automatically
+ if (m_ulCellId[p] != 0 && m_ulCellId[p] != cellId)
+ {
+ forceEpoch = true;
+ }
+ else
+ {
+ m_ulCellId[p] = cellId;
+ }
+
+ m_ulRxPackets[p]++;
+ m_ulRxData[p] += packetSize;
+
+ Uint64StatsMap::iterator it = m_ulDelay.find (p);
+ if (it == m_ulDelay.end ())
+ {
+ NS_LOG_DEBUG (this << " Creating UL stats calculators for IMSI " << p.m_imsi << " and LCID " << (uint32_t) p.m_lcId );
+ m_ulDelay[p] = CreateObject<MinMaxAvgTotalCalculator<uint64_t> > ();
+ m_ulPduSize[p] = CreateObject<MinMaxAvgTotalCalculator<uint32_t> > ();
+ }
+ m_ulDelay[p]->Update (delay);
+ m_ulPduSize[p]->Update (packetSize);
+ }
+
+ CheckEpoch (forceEpoch);
+}
+
+void
+RadioBearerStatsCalculator::DlRxPdu (uint64_t imsi, uint16_t rnti,
+ uint8_t lcid, uint32_t packetSize, uint64_t delay)
+{
+ NS_LOG_FUNCTION (this << "DlRxPDU" << imsi << rnti << (uint32_t) lcid << packetSize << delay);
+ ImsiLcidPair_t p (imsi, lcid);
+ if (Simulator::Now () > m_startTime)
+ {
+ m_dlRxPackets[p]++;
+ m_dlRxData[p] += packetSize;
+
+ Uint64StatsMap::iterator it = m_dlDelay.find (p);
+ if (it == m_dlDelay.end ())
+ {
+ NS_LOG_DEBUG (this << " Creating DL stats calculators for IMSI " << p.m_imsi << " and LCID " << (uint32_t) p.m_lcId );
+ m_dlDelay[p] = CreateObject<MinMaxAvgTotalCalculator<uint64_t> > ();
+ m_dlPduSize[p] = CreateObject<MinMaxAvgTotalCalculator<uint32_t> > ();
+ }
+ m_dlDelay[p]->Update (delay);
+ m_dlPduSize[p]->Update (packetSize);
+ }
+ CheckEpoch ();
+}
+
+void
+RadioBearerStatsCalculator::ShowResults (void)
+{
+
+ NS_LOG_FUNCTION (this << GetUlOutputFilename ().c_str () << GetDlOutputFilename ().c_str () );
+ NS_LOG_INFO ("Write Rlc Stats in " << GetUlOutputFilename ().c_str () <<
+ " and in " << GetDlOutputFilename ().c_str ());
+
+ std::ofstream ulOutFile;
+ std::ofstream dlOutFile;
+
+ if (m_firstWrite == true)
+ {
+ ulOutFile.open (GetUlOutputFilename ().c_str ());
+ if (!ulOutFile.is_open ())
+ {
+ NS_LOG_ERROR ("Can't open file " << GetUlOutputFilename ().c_str ());
+ return;
+ }
+
+ dlOutFile.open (GetDlOutputFilename ().c_str ());
+ if (!dlOutFile.is_open ())
+ {
+ NS_LOG_ERROR ("Can't open file " << GetDlOutputFilename ().c_str ());
+ return;
+ }
+ m_firstWrite = false;
+ ulOutFile
+ << "% start\tend\tCellId\tIMSI\tRNTI\tLCID\tnTxPDUs\tTxBytes\tnRxPDUs\tRxBytes\t";
+ ulOutFile << "delay\tstdDev\tmin\tmax\t";
+ ulOutFile << "PduSize\tstdDev\tmin\tmax";
+ ulOutFile << std::endl;
+ dlOutFile
+ << "% start\tend\tCellId\tIMSI\tRNTI\tLCID\tnTxPDUs\tTxBytes\tnRxPDUs\tRxBytes\t";
+ dlOutFile << "delay\tstdDev\tmin\tmax\t";
+ dlOutFile << "PduSize\tstdDev\tmin\tmax";
+ dlOutFile << std::endl;
+ }
+ else
+ {
+ ulOutFile.open (GetUlOutputFilename ().c_str (), std::ios_base::app);
+ if (!ulOutFile.is_open ())
+ {
+ NS_LOG_ERROR ("Can't open file " << GetUlOutputFilename ().c_str ());
+ return;
+ }
+
+ dlOutFile.open (GetDlOutputFilename ().c_str (), std::ios_base::app);
+ if (!dlOutFile.is_open ())
+ {
+ NS_LOG_ERROR ("Can't open file " << GetDlOutputFilename ().c_str ());
+ return;
+ }
+ }
+
+ WriteUlResults (ulOutFile);
+ WriteDlResults (dlOutFile);
+
+}
+
+void
+RadioBearerStatsCalculator::WriteUlResults (std::ofstream& outFile)
+{
+ NS_LOG_FUNCTION (this);
+
+ // Get the unique IMSI / LCID list
+
+ std::vector<ImsiLcidPair_t> pairVector;
+ for (Uint32Map::iterator it = m_ulTxPackets.begin (); it
+ != m_ulTxPackets.end (); ++it)
+ {
+ if (find (pairVector.begin (), pairVector.end (), (*it).first)
+ == pairVector.end ())
+ {
+ pairVector.push_back ((*it).first);
+ }
+ }
+
+ Time endTime = m_startTime + m_epochDuration;
+ for (std::vector<ImsiLcidPair_t>::iterator it = pairVector.begin (); it
+ != pairVector.end (); ++it)
+ {
+ ImsiLcidPair_t p = *it;
+ outFile << m_startTime.GetNanoSeconds () / 1.0e9 << "\t";
+ outFile << endTime.GetNanoSeconds () / 1.0e9 << "\t";
+ outFile << GetUlCellId (p.m_imsi, p.m_lcId) << "\t";
+ outFile << p.m_imsi << "\t";
+ outFile << m_flowId[p].m_rnti << "\t";
+ outFile << (uint32_t) m_flowId[p].m_lcId << "\t";
+ outFile << GetUlTxPackets (p.m_imsi, p.m_lcId) << "\t";
+ outFile << GetUlTxData (p.m_imsi, p.m_lcId) << "\t";
+ outFile << GetUlRxPackets (p.m_imsi, p.m_lcId) << "\t";
+ outFile << GetUlRxData (p.m_imsi, p.m_lcId) << "\t";
+ std::vector<double> stats = GetUlDelayStats (p.m_imsi, p.m_lcId);
+ for (std::vector<double>::iterator it = stats.begin (); it != stats.end (); ++it)
+ {
+ outFile << (*it) * 1e-9 << "\t";
+ }
+ stats = GetUlPduSizeStats (p.m_imsi, p.m_lcId);
+ for (std::vector<double>::iterator it = stats.begin (); it != stats.end (); ++it)
+ {
+ outFile << (*it) << "\t";
+ }
+ outFile << std::endl;
+ }
+
+ outFile.close ();
+}
+
+void
+RadioBearerStatsCalculator::WriteDlResults (std::ofstream& outFile)
+{
+ NS_LOG_FUNCTION (this);
+
+ // Get the unique IMSI list
+ std::vector<ImsiLcidPair_t> pairVector;
+ for (Uint32Map::iterator it = m_dlTxPackets.begin (); it
+ != m_dlTxPackets.end (); ++it)
+ {
+ if (find (pairVector.begin (), pairVector.end (), (*it).first)
+ == pairVector.end ())
+ {
+ pairVector.push_back ((*it).first);
+ }
+ }
+
+ Time endTime = m_startTime + m_epochDuration;
+ for (std::vector<ImsiLcidPair_t>::iterator pair = pairVector.begin (); pair
+ != pairVector.end (); ++pair)
+ {
+ ImsiLcidPair_t p = *pair;
+ outFile << m_startTime.GetNanoSeconds () / 1.0e9 << "\t";
+ outFile << endTime.GetNanoSeconds () / 1.0e9 << "\t";
+ outFile << GetDlCellId (p.m_imsi, p.m_lcId) << "\t";
+ outFile << p.m_imsi << "\t";
+ outFile << m_flowId[p].m_rnti << "\t";
+ outFile << (uint32_t) m_flowId[p].m_lcId << "\t";
+ outFile << GetDlTxPackets (p.m_imsi, p.m_lcId) << "\t";
+ outFile << GetDlTxData (p.m_imsi, p.m_lcId) << "\t";
+ outFile << GetDlRxPackets (p.m_imsi, p.m_lcId) << "\t";
+ outFile << GetDlRxData (p.m_imsi, p.m_lcId) << "\t";
+ std::vector<double> stats = GetDlDelayStats (p.m_imsi, p.m_lcId);
+ for (std::vector<double>::iterator it = stats.begin (); it != stats.end (); ++it)
+ {
+ outFile << (*it) * 1e-9 << "\t";
+ }
+ stats = GetDlPduSizeStats (p.m_imsi, p.m_lcId);
+ for (std::vector<double>::iterator it = stats.begin (); it != stats.end (); ++it)
+ {
+ outFile << (*it) << "\t";
+ }
+ outFile << std::endl;
+ }
+
+ outFile.close ();
+}
+
+void
+RadioBearerStatsCalculator::ResetResults (void)
+{
+ NS_LOG_FUNCTION (this);
+
+ m_ulTxPackets.erase (m_ulTxPackets.begin (), m_ulTxPackets.end ());
+ m_ulRxPackets.erase (m_ulRxPackets.begin (), m_ulRxPackets.end ());
+ m_ulRxData.erase (m_ulRxData.begin (), m_ulRxData.end ());
+ m_ulTxData.erase (m_ulTxData.begin (), m_ulTxData.end ());
+ m_ulDelay.erase (m_ulDelay.begin (), m_ulDelay.end ());
+ m_ulPduSize.erase (m_ulPduSize.begin (), m_ulPduSize.end ());
+
+ m_dlTxPackets.erase (m_dlTxPackets.begin (), m_dlTxPackets.end ());
+ m_dlRxPackets.erase (m_dlRxPackets.begin (), m_dlRxPackets.end ());
+ m_dlRxData.erase (m_dlRxData.begin (), m_dlRxData.end ());
+ m_dlTxData.erase (m_dlTxData.begin (), m_dlTxData.end ());
+ m_dlDelay.erase (m_dlDelay.begin (), m_dlDelay.end ());
+ m_dlPduSize.erase (m_dlPduSize.begin (), m_dlPduSize.end ());
+}
+
+void
+RadioBearerStatsCalculator::CheckEpoch (bool forceEpoch)
+{
+ NS_LOG_FUNCTION (this);
+
+ if (Simulator::Now () > m_startTime + m_epochDuration /*|| forceEpoch == true*/)
+ {
+ ShowResults ();
+ ResetResults ();
+ StartEpoch ();
+ }
+
+}
+
+void
+RadioBearerStatsCalculator::StartEpoch (void)
+{
+ NS_LOG_FUNCTION (this);
+ m_startTime += m_epochDuration;
+}
+
+uint32_t
+RadioBearerStatsCalculator::GetUlTxPackets (uint64_t imsi, uint8_t lcid)
+{
+ NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
+ ImsiLcidPair_t p (imsi, lcid);
+ return m_ulTxPackets[p];
+}
+
+uint32_t
+RadioBearerStatsCalculator::GetUlRxPackets (uint64_t imsi, uint8_t lcid)
+{
+ NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
+ ImsiLcidPair_t p (imsi, lcid);
+ return m_ulRxPackets[p];
+}
+
+uint64_t
+RadioBearerStatsCalculator::GetUlTxData (uint64_t imsi, uint8_t lcid)
+{
+ NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
+ ImsiLcidPair_t p (imsi, lcid);
+ return m_ulTxData[p];
+}
+
+uint64_t
+RadioBearerStatsCalculator::GetUlRxData (uint64_t imsi, uint8_t lcid)
+{
+ NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
+ ImsiLcidPair_t p (imsi, lcid);
+ return m_ulRxData[p];
+}
+
+double
+RadioBearerStatsCalculator::GetUlDelay (uint64_t imsi, uint8_t lcid)
+{
+ NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
+ ImsiLcidPair_t p (imsi, lcid);
+ Uint64StatsMap::iterator it = m_ulDelay.find (p);
+ if (it == m_ulDelay.end ())
+ {
+ NS_LOG_ERROR ("UL delay for " << imsi << " - " << (uint16_t) lcid << " not found");
+ return 0;
+
+ }
+ return m_ulDelay[p]->getMean ();
+}
+
+std::vector<double>
+RadioBearerStatsCalculator::GetUlDelayStats (uint64_t imsi, uint8_t lcid)
+{
+ NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
+ ImsiLcidPair_t p (imsi, lcid);
+ std::vector<double> stats;
+ Uint64StatsMap::iterator it = m_ulDelay.find (p);
+ if (it == m_ulDelay.end ())
+ {
+ NS_LOG_ERROR ("UL delay for " << imsi << " - " << (uint16_t) lcid << " not found");
+ return stats;
+
+ }
+ stats.push_back (m_ulDelay[p]->getMean ());
+ stats.push_back (m_ulDelay[p]->getStddev ());
+ stats.push_back (m_ulDelay[p]->getMin ());
+ stats.push_back (m_ulDelay[p]->getMax ());
+ return stats;
+}
+
+std::vector<double>
+RadioBearerStatsCalculator::GetUlPduSizeStats (uint64_t imsi, uint8_t lcid)
+{
+ NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
+ ImsiLcidPair_t p (imsi, lcid);
+ std::vector<double> stats;
+ Uint32StatsMap::iterator it = m_ulPduSize.find (p);
+ if (it == m_ulPduSize.end ())
+ {
+ NS_LOG_ERROR ("UL PDU Size for " << imsi << " - " << (uint16_t) lcid << " not found");
+ return stats;
+
+ }
+ stats.push_back (m_ulPduSize[p]->getMean ());
+ stats.push_back (m_ulPduSize[p]->getStddev ());
+ stats.push_back (m_ulPduSize[p]->getMin ());
+ stats.push_back (m_ulPduSize[p]->getMax ());
+ return stats;
+}
+
+uint32_t
+RadioBearerStatsCalculator::GetDlTxPackets (uint64_t imsi, uint8_t lcid)
+{
+ NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
+ ImsiLcidPair_t p (imsi, lcid);
+ return m_dlTxPackets[p];
+}
+
+uint32_t
+RadioBearerStatsCalculator::GetDlRxPackets (uint64_t imsi, uint8_t lcid)
+{
+ NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
+ ImsiLcidPair_t p (imsi, lcid);
+ return m_dlRxPackets[p];
+}
+
+uint64_t
+RadioBearerStatsCalculator::GetDlTxData (uint64_t imsi, uint8_t lcid)
+{
+ NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
+ ImsiLcidPair_t p (imsi, lcid);
+ return m_dlTxData[p];
+}
+
+uint64_t
+RadioBearerStatsCalculator::GetDlRxData (uint64_t imsi, uint8_t lcid)
+{
+ NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
+ ImsiLcidPair_t p (imsi, lcid);
+ return m_dlRxData[p];
+}
+
+uint32_t
+RadioBearerStatsCalculator::GetUlCellId (uint64_t imsi, uint8_t lcid)
+{
+ NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
+ ImsiLcidPair_t p (imsi, lcid);
+ return m_ulCellId[p];
+}
+
+uint32_t
+RadioBearerStatsCalculator::GetDlCellId (uint64_t imsi, uint8_t lcid)
+{
+ NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
+ ImsiLcidPair_t p (imsi, lcid);
+ return m_dlCellId[p];
+}
+
+double
+RadioBearerStatsCalculator::GetDlDelay (uint64_t imsi, uint8_t lcid)
+{
+ NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
+ ImsiLcidPair_t p (imsi, lcid);
+ Uint64StatsMap::iterator it = m_dlDelay.find (p);
+ if (it == m_dlDelay.end ())
+ {
+ NS_LOG_ERROR ("DL delay for " << imsi << " not found");
+ return 0;
+ }
+ return m_dlDelay[p]->getMean ();
+}
+
+std::vector<double>
+RadioBearerStatsCalculator::GetDlDelayStats (uint64_t imsi, uint8_t lcid)
+{
+ NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
+ ImsiLcidPair_t p (imsi, lcid);
+ std::vector<double> stats;
+ Uint64StatsMap::iterator it = m_dlDelay.find (p);
+ if (it == m_dlDelay.end ())
+ {
+
+ NS_LOG_ERROR ("DL delay for " << imsi << " not found");
+ return stats;
+
+ }
+ stats.push_back (m_dlDelay[p]->getMean ());
+ stats.push_back (m_dlDelay[p]->getStddev ());
+ stats.push_back (m_dlDelay[p]->getMin ());
+ stats.push_back (m_dlDelay[p]->getMax ());
+ return stats;
+}
+
+std::vector<double>
+RadioBearerStatsCalculator::GetDlPduSizeStats (uint64_t imsi, uint8_t lcid)
+{
+ NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
+ ImsiLcidPair_t p (imsi, lcid);
+ std::vector<double> stats;
+ Uint32StatsMap::iterator it = m_dlPduSize.find (p);
+ if (it == m_dlPduSize.end ())
+ {
+
+ NS_LOG_ERROR ("DL delay for " << imsi << " not found");
+ return stats;
+
+ }
+ stats.push_back (m_dlPduSize[p]->getMean ());
+ stats.push_back (m_dlPduSize[p]->getStddev ());
+ stats.push_back (m_dlPduSize[p]->getMin ());
+ stats.push_back (m_dlPduSize[p]->getMax ());
+ return stats;
+}
+
+} // namespace ns3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lte/helper/radio-bearer-stats-calculator.h Mon Dec 05 21:19:59 2011 +0100
@@ -0,0 +1,284 @@
+/* -*- 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 <jnin@cttc.es>
+ */
+
+#ifndef RADIO_BEARER_STATS_CALCULATOR_H_
+#define RADIO_BEARER_STATS_CALCULATOR_H_
+
+#include "ns3/lte-stats-calculator.h"
+#include "ns3/lte-common.h"
+#include "ns3/uinteger.h"
+#include "ns3/object.h"
+#include "ns3/basic-data-calculators.h"
+#include "ns3/lte-common.h"
+#include <string>
+#include <map>
+#include <fstream>
+
+namespace ns3 {
+
+
+typedef std::map<ImsiLcidPair_t, uint32_t> Uint32Map;
+typedef std::map<ImsiLcidPair_t, uint64_t> Uint64Map;
+typedef std::map<ImsiLcidPair_t, Ptr<MinMaxAvgTotalCalculator<uint32_t> > > Uint32StatsMap;
+typedef std::map<ImsiLcidPair_t, Ptr<MinMaxAvgTotalCalculator<uint64_t> > > Uint64StatsMap;
+typedef std::map<ImsiLcidPair_t, double> DoubleMap;
+typedef std::map<ImsiLcidPair_t, LteFlowId_t> FlowIdMap;
+
+
+
+/**
+ * Calculation of statistics from the RLC layer for uplink and downlink, the data is dumped into a file periodically. Metrics considered are:
+ * - Number of transmitted PDUs
+ * - Number of received PDUs
+ * - Number of transmitted bytes
+ * - Number of received bytes
+ * - Average, min, max and standard deviation of RLC to RLC delay
+ * - Average, min, max and standard deviation of RLC PDU size
+ */
+class RadioBearerStatsCalculator : public LteStatsCalculator
+{
+public:
+ /**
+ * Class constructor
+ */
+ RadioBearerStatsCalculator ();
+
+ /**
+ * Class destructor
+ */
+ virtual ~RadioBearerStatsCalculator ();
+
+ /**
+ * Inherited from ns3::Object
+ */
+ static TypeId GetTypeId (void);
+
+ /**
+ * Notifies the stats calculator that an uplink transmission has occurred.
+ * @param imsi IMSI of the UE who transmitted the PDU
+ * @param rnti C-RNTI of the UE who transmitted the PDU
+ * @param lcid LCID through which the PDU has been transmitted
+ * @param packetSize size of the PDU in bytes
+ */
+ void UlTxPdu (uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize);
+
+ /**
+ * Notifies the stats calculator that an uplink reception has occurred.
+ * @param cellId CellId of the attached Enb
+ * @param imsi IMSI of the UE who received the PDU
+ * @param rnti C-RNTI of the UE who received the PDU
+ * @param lcid LCID through which the PDU has been received
+ * @param packetSize size of the PDU in bytes
+ * @param delay RLC to RLC delay in nanoseconds
+ */
+ void UlRxPdu (uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay);
+
+ /**
+ * Notifies the stats calculator that an downlink transmission has occurred.
+ * @param cellId CellId of the attached Enb
+ * @param imsi IMSI of the UE who is receiving the PDU
+ * @param rnti C-RNTI of the UE who is receiving the PDU
+ * @param lcid LCID through which the PDU has been transmitted
+ * @param packetSize size of the PDU in bytes
+ */
+ void DlTxPdu (uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize);
+
+ /**
+ * Notifies the stats calculator that an downlink reception has occurred.
+ * @param imsi IMSI of the UE who received the PDU
+ * @param rnti C-RNTI of the UE who received the PDU
+ * @param lcid LCID through which the PDU has been transmitted
+ * @param packetSize size of the PDU in bytes
+ * @param delay RLC to RLC delay in nanoseconds
+ */
+ void DlRxPdu (uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay);
+
+ /**
+ * Gets the number of transmitted uplink packets.
+ * @param imsi IMSI of the UE
+ * @param lcid LCID
+ * @return number of transmitted uplink packets
+ */
+ uint32_t GetUlTxPackets (uint64_t imsi, uint8_t lcid);
+
+ /**
+ * Gets the number of received uplink packets.
+ * @param imsi IMSI of the UE
+ * @param lcid LCID
+ * @return number of received uplink packets
+ */
+ uint32_t GetUlRxPackets (uint64_t imsi, uint8_t lcid);
+
+ /**
+ * Gets the number of transmitted uplink data bytes.
+ * @param imsi IMSI of the UE
+ * @param lcid LCID
+ * @return number of transmitted data bytes
+ */
+ uint64_t GetUlTxData (uint64_t imsi, uint8_t lcid);
+
+ /**
+ * Gets the number of received uplink data bytes.
+ * @param imsi IMSI of the UE
+ * @param lcid LCID
+ * @return number of received data bytes
+ */
+ uint64_t GetUlRxData (uint64_t imsi, uint8_t lcid);
+
+ /**
+ * Gets the attached Enb cellId.
+ * @param imsi IMSI of the UE
+ * @param lcid LCID
+ * @return Enb cellId
+ */
+ uint32_t GetUlCellId (uint64_t imsi, uint8_t lcid);
+
+ /**
+ * Gets the uplink RLC to RLC delay
+ * @param imsi IMSI of the UE
+ * @param lcid LCID
+ * @return RLC to RLC delay in seconds
+ */
+ double GetUlDelay (uint64_t imsi, uint8_t lcid);
+
+ /**
+ * Gets the uplink RLC to RLC statistics: average, min, max and standard deviation.
+ * @param imsi IMSI of the UE
+ * @param lcid LCID
+ * @return RLC to RLC delay statistics average, min, max and standard deviation in seconds
+ */
+ std::vector<double> GetUlDelayStats (uint64_t imsi, uint8_t lcid);
+
+ /**
+ * Gets the uplink PDU size statistics: average, min, max and standard deviation.
+ * @param imsi IMSI of the UE
+ * @param lcid LCID
+ * @return PDU size statistics average, min, max and standard deviation in seconds
+ */
+ std::vector<double> GetUlPduSizeStats (uint64_t imsi, uint8_t lcid);
+
+ /**
+ * Gets the number of transmitted downlink data bytes.
+ * @param imsi IMSI of the UE
+ * @param lcid LCID
+ * @return number of transmitted data bytes
+ */
+ uint32_t GetDlTxPackets (uint64_t imsi, uint8_t lcid);
+
+ /**
+ * Gets the number of received downlink data bytes.
+ * @param imsi IMSI of the UE
+ * @param lcid LCID
+ * @return number of received data bytes
+ */
+ uint32_t GetDlRxPackets (uint64_t imsi, uint8_t lcid);
+
+ /**
+ * Gets the number of transmitted downlink data bytes.
+ * @param imsi IMSI of the UE
+ * @param lcid LCID
+ * @return number of transmitted data bytes
+ */
+ uint64_t GetDlTxData (uint64_t imsi, uint8_t lcid);
+
+ /**
+ * Gets the number of received downlink data bytes.
+ * @param imsi IMSI of the UE
+ * @param lcid LCID
+ * @return number of received data bytes
+ */
+ uint64_t GetDlRxData (uint64_t imsi, uint8_t lcid);
+
+ /**
+ * Gets the attached Enb cellId.
+ * @param imsi IMSI of the UE
+ * @param lcid LCID
+ * @return Enb cellId
+ */
+ uint32_t GetDlCellId (uint64_t imsi, uint8_t lcid);
+
+ /**
+ * Gets the downlink RLC to RLC delay
+ * @param imsi IMSI of the UE
+ * @param lcid LCID
+ * @return RLC to RLC delay in seconds
+ */
+ double GetDlDelay (uint64_t imsi, uint8_t lcid);
+
+ /**
+ * Gets the downlink RLC to RLC statistics: average, min, max and standard deviation.
+ * @param imsi IMSI of the UE
+ * @param lcid LCID
+ * @return RLC to RLC delay statistics average, min, max and standard deviation in seconds
+ */
+ std::vector<double> GetDlDelayStats (uint64_t imsi, uint8_t lcid);
+
+ /**
+ * Gets the downlink PDU size statistics: average, min, max and standard deviation.
+ * @param imsi IMSI of the UE
+ * @param lcid LCID
+ * @return PDU size statistics average, min, max and standard deviation in seconds
+ */
+ std::vector<double> GetDlPduSizeStats (uint64_t imsi, uint8_t lcid);
+
+private:
+ void ShowResults (void);
+ void WriteUlResults (std::ofstream& outFile);
+ void WriteDlResults (std::ofstream& outFile);
+ void ResetResults (void);
+
+ void StartEpoch (void);
+ void CheckEpoch (bool forceEpoch = false);
+
+ FlowIdMap m_flowId;
+
+ Uint32Map m_dlCellId;
+ Uint32Map m_dlTxPackets;
+ Uint32Map m_dlRxPackets;
+ Uint64Map m_dlTxData;
+ Uint64Map m_dlRxData;
+ Uint64StatsMap m_dlDelay;
+ Uint32StatsMap m_dlPduSize;
+
+ Uint32Map m_ulCellId;
+ Uint32Map m_ulTxPackets;
+ Uint32Map m_ulRxPackets;
+ Uint64Map m_ulTxData;
+ Uint64Map m_ulRxData;
+ Uint64StatsMap m_ulDelay;
+ Uint32StatsMap m_ulPduSize;
+
+ /**
+ * Start time of the on going epoch
+ */
+ Time m_startTime;
+
+ /**
+ * Epoch duration
+ */
+ Time m_epochDuration;
+
+ bool m_firstWrite;
+
+};
+
+} // namespace ns3
+
+#endif /* RADIO_BEARER_STATS_CALCULATOR_H_ */
--- a/src/lte/helper/rlc-stats-calculator.cc Mon Dec 05 21:13:53 2011 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,558 +0,0 @@
-/* -*- 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 <jnin@cttc.es>
- */
-
-#include "rlc-stats-calculator.h"
-#include "ns3/string.h"
-#include "ns3/nstime.h"
-#include <ns3/log.h>
-#include <vector>
-#include <algorithm>
-
-namespace ns3 {
-
-NS_LOG_COMPONENT_DEFINE ("RlcStatsCalculator");
-
-NS_OBJECT_ENSURE_REGISTERED (RlcStatsCalculator);
-
-RlcStatsCalculator::RlcStatsCalculator ()
- : m_firstWrite (true)
-{
- NS_LOG_FUNCTION (this);
-
-}
-
-RlcStatsCalculator::~RlcStatsCalculator ()
-{
- NS_LOG_FUNCTION (this);
- ShowResults ();
-}
-
-TypeId
-RlcStatsCalculator::GetTypeId (void)
-{
- static TypeId tid =
- TypeId ("ns3::RlcStatsCalculator")
- .SetParent<Object> ()
- .AddConstructor<RlcStatsCalculator> ()
- .AddAttribute ("StartTime",
- "Start time of the on going epoch.",
- TimeValue (Seconds (0.)),
- MakeTimeAccessor (&RlcStatsCalculator::m_startTime),
- MakeTimeChecker ())
- .AddAttribute ("EpochDuration",
- "Epoch duration.",
- TimeValue (Seconds (0.25)),
- MakeTimeAccessor (&RlcStatsCalculator::m_epochDuration),
- MakeTimeChecker ());
- return tid;
-}
-
-void
-RlcStatsCalculator::UlTxPdu (uint64_t imsi, uint16_t rnti,
- uint8_t lcid, uint32_t packetSize)
-{
- NS_LOG_FUNCTION (this << "UlTxPDU" << imsi << rnti << (uint32_t) lcid << packetSize);
- ImsiLcidPair_t p (imsi, lcid);
- if (Simulator::Now () > m_startTime)
- {
- m_flowId[p] = LteFlowId_t (rnti, lcid);
- m_ulTxPackets[p]++;
- m_ulTxData[p] += packetSize;
- }
- CheckEpoch ();
-}
-
-void
-RlcStatsCalculator::DlTxPdu (uint16_t cellId, uint64_t imsi, uint16_t rnti,
- uint8_t lcid, uint32_t packetSize)
-{
- NS_LOG_FUNCTION (this << "DlTxPDU" << imsi << rnti << (uint32_t) lcid << packetSize);
- ImsiLcidPair_t p (imsi, lcid);
- bool forceEpoch = false;
- if (Simulator::Now () > m_startTime)
- {
-
- // If the UE hands off to another cell, restart the epoch automatically
- if (m_dlCellId[p] != 0 && m_dlCellId[p] != cellId)
- {
- forceEpoch = true;
- }
- else
- {
- m_dlCellId[p] = cellId;
- }
- m_flowId[p] = LteFlowId_t (rnti, lcid);
- m_dlTxPackets[p]++;
- m_dlTxData[p] += packetSize;
- }
- CheckEpoch (forceEpoch);
-}
-
-void
-RlcStatsCalculator::UlRxPdu (uint16_t cellId, uint64_t imsi, uint16_t rnti,
- uint8_t lcid, uint32_t packetSize, uint64_t delay)
-{
- NS_LOG_FUNCTION (this << "UlRxPDU" << imsi << rnti << (uint32_t) lcid << packetSize << delay);
- ImsiLcidPair_t p (imsi, lcid);
- bool forceEpoch = false;
-
- if (Simulator::Now () > m_startTime)
- {
- // If the UE hands off to another cell, restart the epoch automatically
- if (m_ulCellId[p] != 0 && m_ulCellId[p] != cellId)
- {
- forceEpoch = true;
- }
- else
- {
- m_ulCellId[p] = cellId;
- }
-
- m_ulRxPackets[p]++;
- m_ulRxData[p] += packetSize;
-
- Uint64StatsMap::iterator it = m_ulDelay.find (p);
- if (it == m_ulDelay.end ())
- {
- NS_LOG_DEBUG (this << " Creating UL stats calculators for IMSI " << p.m_imsi << " and LCID " << (uint32_t) p.m_lcId );
- m_ulDelay[p] = CreateObject<MinMaxAvgTotalCalculator<uint64_t> > ();
- m_ulPduSize[p] = CreateObject<MinMaxAvgTotalCalculator<uint32_t> > ();
- }
- m_ulDelay[p]->Update (delay);
- m_ulPduSize[p]->Update (packetSize);
- }
-
- CheckEpoch (forceEpoch);
-}
-
-void
-RlcStatsCalculator::DlRxPdu (uint64_t imsi, uint16_t rnti,
- uint8_t lcid, uint32_t packetSize, uint64_t delay)
-{
- NS_LOG_FUNCTION (this << "DlRxPDU" << imsi << rnti << (uint32_t) lcid << packetSize << delay);
- ImsiLcidPair_t p (imsi, lcid);
- if (Simulator::Now () > m_startTime)
- {
- m_dlRxPackets[p]++;
- m_dlRxData[p] += packetSize;
-
- Uint64StatsMap::iterator it = m_dlDelay.find (p);
- if (it == m_dlDelay.end ())
- {
- NS_LOG_DEBUG (this << " Creating DL stats calculators for IMSI " << p.m_imsi << " and LCID " << (uint32_t) p.m_lcId );
- m_dlDelay[p] = CreateObject<MinMaxAvgTotalCalculator<uint64_t> > ();
- m_dlPduSize[p] = CreateObject<MinMaxAvgTotalCalculator<uint32_t> > ();
- }
- m_dlDelay[p]->Update (delay);
- m_dlPduSize[p]->Update (packetSize);
- }
- CheckEpoch ();
-}
-
-void
-RlcStatsCalculator::ShowResults (void)
-{
-
- NS_LOG_FUNCTION (this << GetUlOutputFilename ().c_str () << GetDlOutputFilename ().c_str () );
- NS_LOG_INFO ("Write Rlc Stats in " << GetUlOutputFilename ().c_str () <<
- " and in " << GetDlOutputFilename ().c_str ());
-
- std::ofstream ulOutFile;
- std::ofstream dlOutFile;
-
- if (m_firstWrite == true)
- {
- ulOutFile.open (GetUlOutputFilename ().c_str ());
- if (!ulOutFile.is_open ())
- {
- NS_LOG_ERROR ("Can't open file " << GetUlOutputFilename ().c_str ());
- return;
- }
-
- dlOutFile.open (GetDlOutputFilename ().c_str ());
- if (!dlOutFile.is_open ())
- {
- NS_LOG_ERROR ("Can't open file " << GetDlOutputFilename ().c_str ());
- return;
- }
- m_firstWrite = false;
- ulOutFile
- << "% start\tend\tCellId\tIMSI\tRNTI\tLCID\tnTxPDUs\tTxBytes\tnRxPDUs\tRxBytes\t";
- ulOutFile << "delay\tstdDev\tmin\tmax\t";
- ulOutFile << "PduSize\tstdDev\tmin\tmax";
- ulOutFile << std::endl;
- dlOutFile
- << "% start\tend\tCellId\tIMSI\tRNTI\tLCID\tnTxPDUs\tTxBytes\tnRxPDUs\tRxBytes\t";
- dlOutFile << "delay\tstdDev\tmin\tmax\t";
- dlOutFile << "PduSize\tstdDev\tmin\tmax";
- dlOutFile << std::endl;
- }
- else
- {
- ulOutFile.open (GetUlOutputFilename ().c_str (), std::ios_base::app);
- if (!ulOutFile.is_open ())
- {
- NS_LOG_ERROR ("Can't open file " << GetUlOutputFilename ().c_str ());
- return;
- }
-
- dlOutFile.open (GetDlOutputFilename ().c_str (), std::ios_base::app);
- if (!dlOutFile.is_open ())
- {
- NS_LOG_ERROR ("Can't open file " << GetDlOutputFilename ().c_str ());
- return;
- }
- }
-
- WriteUlResults (ulOutFile);
- WriteDlResults (dlOutFile);
-
-}
-
-void
-RlcStatsCalculator::WriteUlResults (std::ofstream& outFile)
-{
- NS_LOG_FUNCTION (this);
-
- // Get the unique IMSI / LCID list
-
- std::vector<ImsiLcidPair_t> pairVector;
- for (Uint32Map::iterator it = m_ulTxPackets.begin (); it
- != m_ulTxPackets.end (); ++it)
- {
- if (find (pairVector.begin (), pairVector.end (), (*it).first)
- == pairVector.end ())
- {
- pairVector.push_back ((*it).first);
- }
- }
-
- Time endTime = m_startTime + m_epochDuration;
- for (std::vector<ImsiLcidPair_t>::iterator it = pairVector.begin (); it
- != pairVector.end (); ++it)
- {
- ImsiLcidPair_t p = *it;
- outFile << m_startTime.GetNanoSeconds () / 1.0e9 << "\t";
- outFile << endTime.GetNanoSeconds () / 1.0e9 << "\t";
- outFile << GetUlCellId (p.m_imsi, p.m_lcId) << "\t";
- outFile << p.m_imsi << "\t";
- outFile << m_flowId[p].m_rnti << "\t";
- outFile << (uint32_t) m_flowId[p].m_lcId << "\t";
- outFile << GetUlTxPackets (p.m_imsi, p.m_lcId) << "\t";
- outFile << GetUlTxData (p.m_imsi, p.m_lcId) << "\t";
- outFile << GetUlRxPackets (p.m_imsi, p.m_lcId) << "\t";
- outFile << GetUlRxData (p.m_imsi, p.m_lcId) << "\t";
- std::vector<double> stats = GetUlDelayStats (p.m_imsi, p.m_lcId);
- for (std::vector<double>::iterator it = stats.begin (); it != stats.end (); ++it)
- {
- outFile << (*it) * 1e-9 << "\t";
- }
- stats = GetUlPduSizeStats (p.m_imsi, p.m_lcId);
- for (std::vector<double>::iterator it = stats.begin (); it != stats.end (); ++it)
- {
- outFile << (*it) << "\t";
- }
- outFile << std::endl;
- }
-
- outFile.close ();
-}
-
-void
-RlcStatsCalculator::WriteDlResults (std::ofstream& outFile)
-{
- NS_LOG_FUNCTION (this);
-
- // Get the unique IMSI list
- std::vector<ImsiLcidPair_t> pairVector;
- for (Uint32Map::iterator it = m_dlTxPackets.begin (); it
- != m_dlTxPackets.end (); ++it)
- {
- if (find (pairVector.begin (), pairVector.end (), (*it).first)
- == pairVector.end ())
- {
- pairVector.push_back ((*it).first);
- }
- }
-
- Time endTime = m_startTime + m_epochDuration;
- for (std::vector<ImsiLcidPair_t>::iterator pair = pairVector.begin (); pair
- != pairVector.end (); ++pair)
- {
- ImsiLcidPair_t p = *pair;
- outFile << m_startTime.GetNanoSeconds () / 1.0e9 << "\t";
- outFile << endTime.GetNanoSeconds () / 1.0e9 << "\t";
- outFile << GetDlCellId (p.m_imsi, p.m_lcId) << "\t";
- outFile << p.m_imsi << "\t";
- outFile << m_flowId[p].m_rnti << "\t";
- outFile << (uint32_t) m_flowId[p].m_lcId << "\t";
- outFile << GetDlTxPackets (p.m_imsi, p.m_lcId) << "\t";
- outFile << GetDlTxData (p.m_imsi, p.m_lcId) << "\t";
- outFile << GetDlRxPackets (p.m_imsi, p.m_lcId) << "\t";
- outFile << GetDlRxData (p.m_imsi, p.m_lcId) << "\t";
- std::vector<double> stats = GetDlDelayStats (p.m_imsi, p.m_lcId);
- for (std::vector<double>::iterator it = stats.begin (); it != stats.end (); ++it)
- {
- outFile << (*it) * 1e-9 << "\t";
- }
- stats = GetDlPduSizeStats (p.m_imsi, p.m_lcId);
- for (std::vector<double>::iterator it = stats.begin (); it != stats.end (); ++it)
- {
- outFile << (*it) << "\t";
- }
- outFile << std::endl;
- }
-
- outFile.close ();
-}
-
-void
-RlcStatsCalculator::ResetResults (void)
-{
- NS_LOG_FUNCTION (this);
-
- m_ulTxPackets.erase (m_ulTxPackets.begin (), m_ulTxPackets.end ());
- m_ulRxPackets.erase (m_ulRxPackets.begin (), m_ulRxPackets.end ());
- m_ulRxData.erase (m_ulRxData.begin (), m_ulRxData.end ());
- m_ulTxData.erase (m_ulTxData.begin (), m_ulTxData.end ());
- m_ulDelay.erase (m_ulDelay.begin (), m_ulDelay.end ());
- m_ulPduSize.erase (m_ulPduSize.begin (), m_ulPduSize.end ());
-
- m_dlTxPackets.erase (m_dlTxPackets.begin (), m_dlTxPackets.end ());
- m_dlRxPackets.erase (m_dlRxPackets.begin (), m_dlRxPackets.end ());
- m_dlRxData.erase (m_dlRxData.begin (), m_dlRxData.end ());
- m_dlTxData.erase (m_dlTxData.begin (), m_dlTxData.end ());
- m_dlDelay.erase (m_dlDelay.begin (), m_dlDelay.end ());
- m_dlPduSize.erase (m_dlPduSize.begin (), m_dlPduSize.end ());
-}
-
-void
-RlcStatsCalculator::CheckEpoch (bool forceEpoch)
-{
- NS_LOG_FUNCTION (this);
-
- if (Simulator::Now () > m_startTime + m_epochDuration /*|| forceEpoch == true*/)
- {
- ShowResults ();
- ResetResults ();
- StartEpoch ();
- }
-
-}
-
-void
-RlcStatsCalculator::StartEpoch (void)
-{
- NS_LOG_FUNCTION (this);
- m_startTime += m_epochDuration;
-}
-
-uint32_t
-RlcStatsCalculator::GetUlTxPackets (uint64_t imsi, uint8_t lcid)
-{
- NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
- ImsiLcidPair_t p (imsi, lcid);
- return m_ulTxPackets[p];
-}
-
-uint32_t
-RlcStatsCalculator::GetUlRxPackets (uint64_t imsi, uint8_t lcid)
-{
- NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
- ImsiLcidPair_t p (imsi, lcid);
- return m_ulRxPackets[p];
-}
-
-uint64_t
-RlcStatsCalculator::GetUlTxData (uint64_t imsi, uint8_t lcid)
-{
- NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
- ImsiLcidPair_t p (imsi, lcid);
- return m_ulTxData[p];
-}
-
-uint64_t
-RlcStatsCalculator::GetUlRxData (uint64_t imsi, uint8_t lcid)
-{
- NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
- ImsiLcidPair_t p (imsi, lcid);
- return m_ulRxData[p];
-}
-
-double
-RlcStatsCalculator::GetUlDelay (uint64_t imsi, uint8_t lcid)
-{
- NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
- ImsiLcidPair_t p (imsi, lcid);
- Uint64StatsMap::iterator it = m_ulDelay.find (p);
- if (it == m_ulDelay.end ())
- {
- NS_LOG_ERROR ("UL delay for " << imsi << " - " << (uint16_t) lcid << " not found");
- return 0;
-
- }
- return m_ulDelay[p]->getMean ();
-}
-
-std::vector<double>
-RlcStatsCalculator::GetUlDelayStats (uint64_t imsi, uint8_t lcid)
-{
- NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
- ImsiLcidPair_t p (imsi, lcid);
- std::vector<double> stats;
- Uint64StatsMap::iterator it = m_ulDelay.find (p);
- if (it == m_ulDelay.end ())
- {
- NS_LOG_ERROR ("UL delay for " << imsi << " - " << (uint16_t) lcid << " not found");
- return stats;
-
- }
- stats.push_back (m_ulDelay[p]->getMean ());
- stats.push_back (m_ulDelay[p]->getStddev ());
- stats.push_back (m_ulDelay[p]->getMin ());
- stats.push_back (m_ulDelay[p]->getMax ());
- return stats;
-}
-
-std::vector<double>
-RlcStatsCalculator::GetUlPduSizeStats (uint64_t imsi, uint8_t lcid)
-{
- NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
- ImsiLcidPair_t p (imsi, lcid);
- std::vector<double> stats;
- Uint32StatsMap::iterator it = m_ulPduSize.find (p);
- if (it == m_ulPduSize.end ())
- {
- NS_LOG_ERROR ("UL PDU Size for " << imsi << " - " << (uint16_t) lcid << " not found");
- return stats;
-
- }
- stats.push_back (m_ulPduSize[p]->getMean ());
- stats.push_back (m_ulPduSize[p]->getStddev ());
- stats.push_back (m_ulPduSize[p]->getMin ());
- stats.push_back (m_ulPduSize[p]->getMax ());
- return stats;
-}
-
-uint32_t
-RlcStatsCalculator::GetDlTxPackets (uint64_t imsi, uint8_t lcid)
-{
- NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
- ImsiLcidPair_t p (imsi, lcid);
- return m_dlTxPackets[p];
-}
-
-uint32_t
-RlcStatsCalculator::GetDlRxPackets (uint64_t imsi, uint8_t lcid)
-{
- NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
- ImsiLcidPair_t p (imsi, lcid);
- return m_dlRxPackets[p];
-}
-
-uint64_t
-RlcStatsCalculator::GetDlTxData (uint64_t imsi, uint8_t lcid)
-{
- NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
- ImsiLcidPair_t p (imsi, lcid);
- return m_dlTxData[p];
-}
-
-uint64_t
-RlcStatsCalculator::GetDlRxData (uint64_t imsi, uint8_t lcid)
-{
- NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
- ImsiLcidPair_t p (imsi, lcid);
- return m_dlRxData[p];
-}
-
-uint32_t
-RlcStatsCalculator::GetUlCellId (uint64_t imsi, uint8_t lcid)
-{
- NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
- ImsiLcidPair_t p (imsi, lcid);
- return m_ulCellId[p];
-}
-
-uint32_t
-RlcStatsCalculator::GetDlCellId (uint64_t imsi, uint8_t lcid)
-{
- NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
- ImsiLcidPair_t p (imsi, lcid);
- return m_dlCellId[p];
-}
-
-double
-RlcStatsCalculator::GetDlDelay (uint64_t imsi, uint8_t lcid)
-{
- NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
- ImsiLcidPair_t p (imsi, lcid);
- Uint64StatsMap::iterator it = m_dlDelay.find (p);
- if (it == m_dlDelay.end ())
- {
- NS_LOG_ERROR ("DL delay for " << imsi << " not found");
- return 0;
- }
- return m_dlDelay[p]->getMean ();
-}
-
-std::vector<double>
-RlcStatsCalculator::GetDlDelayStats (uint64_t imsi, uint8_t lcid)
-{
- NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
- ImsiLcidPair_t p (imsi, lcid);
- std::vector<double> stats;
- Uint64StatsMap::iterator it = m_dlDelay.find (p);
- if (it == m_dlDelay.end ())
- {
-
- NS_LOG_ERROR ("DL delay for " << imsi << " not found");
- return stats;
-
- }
- stats.push_back (m_dlDelay[p]->getMean ());
- stats.push_back (m_dlDelay[p]->getStddev ());
- stats.push_back (m_dlDelay[p]->getMin ());
- stats.push_back (m_dlDelay[p]->getMax ());
- return stats;
-}
-
-std::vector<double>
-RlcStatsCalculator::GetDlPduSizeStats (uint64_t imsi, uint8_t lcid)
-{
- NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
- ImsiLcidPair_t p (imsi, lcid);
- std::vector<double> stats;
- Uint32StatsMap::iterator it = m_dlPduSize.find (p);
- if (it == m_dlPduSize.end ())
- {
-
- NS_LOG_ERROR ("DL delay for " << imsi << " not found");
- return stats;
-
- }
- stats.push_back (m_dlPduSize[p]->getMean ());
- stats.push_back (m_dlPduSize[p]->getStddev ());
- stats.push_back (m_dlPduSize[p]->getMin ());
- stats.push_back (m_dlPduSize[p]->getMax ());
- return stats;
-}
-
-} // namespace ns3
--- a/src/lte/helper/rlc-stats-calculator.h Mon Dec 05 21:13:53 2011 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,284 +0,0 @@
-/* -*- 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 <jnin@cttc.es>
- */
-
-#ifndef RLC_STATS_CALCULATOR_H_
-#define RLC_STATS_CALCULATOR_H_
-
-#include "ns3/lte-stats-calculator.h"
-#include "ns3/lte-common.h"
-#include "ns3/uinteger.h"
-#include "ns3/object.h"
-#include "ns3/basic-data-calculators.h"
-#include "ns3/lte-common.h"
-#include <string>
-#include <map>
-#include <fstream>
-
-namespace ns3 {
-
-
-typedef std::map<ImsiLcidPair_t, uint32_t> Uint32Map;
-typedef std::map<ImsiLcidPair_t, uint64_t> Uint64Map;
-typedef std::map<ImsiLcidPair_t, Ptr<MinMaxAvgTotalCalculator<uint32_t> > > Uint32StatsMap;
-typedef std::map<ImsiLcidPair_t, Ptr<MinMaxAvgTotalCalculator<uint64_t> > > Uint64StatsMap;
-typedef std::map<ImsiLcidPair_t, double> DoubleMap;
-typedef std::map<ImsiLcidPair_t, LteFlowId_t> FlowIdMap;
-
-
-
-/**
- * Calculation of statistics from the RLC layer for uplink and downlink, the data is dumped into a file periodically. Metrics considered are:
- * - Number of transmitted PDUs
- * - Number of received PDUs
- * - Number of transmitted bytes
- * - Number of received bytes
- * - Average, min, max and standard deviation of RLC to RLC delay
- * - Average, min, max and standard deviation of RLC PDU size
- */
-class RlcStatsCalculator : public LteStatsCalculator
-{
-public:
- /**
- * Class constructor
- */
- RlcStatsCalculator ();
-
- /**
- * Class destructor
- */
- virtual ~RlcStatsCalculator ();
-
- /**
- * Inherited from ns3::Object
- */
- static TypeId GetTypeId (void);
-
- /**
- * Notifies the stats calculator that an uplink transmission has occurred.
- * @param imsi IMSI of the UE who transmitted the PDU
- * @param rnti C-RNTI of the UE who transmitted the PDU
- * @param lcid LCID through which the PDU has been transmitted
- * @param packetSize size of the PDU in bytes
- */
- void UlTxPdu (uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize);
-
- /**
- * Notifies the stats calculator that an uplink reception has occurred.
- * @param cellId CellId of the attached Enb
- * @param imsi IMSI of the UE who received the PDU
- * @param rnti C-RNTI of the UE who received the PDU
- * @param lcid LCID through which the PDU has been received
- * @param packetSize size of the PDU in bytes
- * @param delay RLC to RLC delay in nanoseconds
- */
- void UlRxPdu (uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay);
-
- /**
- * Notifies the stats calculator that an downlink transmission has occurred.
- * @param cellId CellId of the attached Enb
- * @param imsi IMSI of the UE who is receiving the PDU
- * @param rnti C-RNTI of the UE who is receiving the PDU
- * @param lcid LCID through which the PDU has been transmitted
- * @param packetSize size of the PDU in bytes
- */
- void DlTxPdu (uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize);
-
- /**
- * Notifies the stats calculator that an downlink reception has occurred.
- * @param imsi IMSI of the UE who received the PDU
- * @param rnti C-RNTI of the UE who received the PDU
- * @param lcid LCID through which the PDU has been transmitted
- * @param packetSize size of the PDU in bytes
- * @param delay RLC to RLC delay in nanoseconds
- */
- void DlRxPdu (uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay);
-
- /**
- * Gets the number of transmitted uplink packets.
- * @param imsi IMSI of the UE
- * @param lcid LCID
- * @return number of transmitted uplink packets
- */
- uint32_t GetUlTxPackets (uint64_t imsi, uint8_t lcid);
-
- /**
- * Gets the number of received uplink packets.
- * @param imsi IMSI of the UE
- * @param lcid LCID
- * @return number of received uplink packets
- */
- uint32_t GetUlRxPackets (uint64_t imsi, uint8_t lcid);
-
- /**
- * Gets the number of transmitted uplink data bytes.
- * @param imsi IMSI of the UE
- * @param lcid LCID
- * @return number of transmitted data bytes
- */
- uint64_t GetUlTxData (uint64_t imsi, uint8_t lcid);
-
- /**
- * Gets the number of received uplink data bytes.
- * @param imsi IMSI of the UE
- * @param lcid LCID
- * @return number of received data bytes
- */
- uint64_t GetUlRxData (uint64_t imsi, uint8_t lcid);
-
- /**
- * Gets the attached Enb cellId.
- * @param imsi IMSI of the UE
- * @param lcid LCID
- * @return Enb cellId
- */
- uint32_t GetUlCellId (uint64_t imsi, uint8_t lcid);
-
- /**
- * Gets the uplink RLC to RLC delay
- * @param imsi IMSI of the UE
- * @param lcid LCID
- * @return RLC to RLC delay in seconds
- */
- double GetUlDelay (uint64_t imsi, uint8_t lcid);
-
- /**
- * Gets the uplink RLC to RLC statistics: average, min, max and standard deviation.
- * @param imsi IMSI of the UE
- * @param lcid LCID
- * @return RLC to RLC delay statistics average, min, max and standard deviation in seconds
- */
- std::vector<double> GetUlDelayStats (uint64_t imsi, uint8_t lcid);
-
- /**
- * Gets the uplink PDU size statistics: average, min, max and standard deviation.
- * @param imsi IMSI of the UE
- * @param lcid LCID
- * @return PDU size statistics average, min, max and standard deviation in seconds
- */
- std::vector<double> GetUlPduSizeStats (uint64_t imsi, uint8_t lcid);
-
- /**
- * Gets the number of transmitted downlink data bytes.
- * @param imsi IMSI of the UE
- * @param lcid LCID
- * @return number of transmitted data bytes
- */
- uint32_t GetDlTxPackets (uint64_t imsi, uint8_t lcid);
-
- /**
- * Gets the number of received downlink data bytes.
- * @param imsi IMSI of the UE
- * @param lcid LCID
- * @return number of received data bytes
- */
- uint32_t GetDlRxPackets (uint64_t imsi, uint8_t lcid);
-
- /**
- * Gets the number of transmitted downlink data bytes.
- * @param imsi IMSI of the UE
- * @param lcid LCID
- * @return number of transmitted data bytes
- */
- uint64_t GetDlTxData (uint64_t imsi, uint8_t lcid);
-
- /**
- * Gets the number of received downlink data bytes.
- * @param imsi IMSI of the UE
- * @param lcid LCID
- * @return number of received data bytes
- */
- uint64_t GetDlRxData (uint64_t imsi, uint8_t lcid);
-
- /**
- * Gets the attached Enb cellId.
- * @param imsi IMSI of the UE
- * @param lcid LCID
- * @return Enb cellId
- */
- uint32_t GetDlCellId (uint64_t imsi, uint8_t lcid);
-
- /**
- * Gets the downlink RLC to RLC delay
- * @param imsi IMSI of the UE
- * @param lcid LCID
- * @return RLC to RLC delay in seconds
- */
- double GetDlDelay (uint64_t imsi, uint8_t lcid);
-
- /**
- * Gets the downlink RLC to RLC statistics: average, min, max and standard deviation.
- * @param imsi IMSI of the UE
- * @param lcid LCID
- * @return RLC to RLC delay statistics average, min, max and standard deviation in seconds
- */
- std::vector<double> GetDlDelayStats (uint64_t imsi, uint8_t lcid);
-
- /**
- * Gets the downlink PDU size statistics: average, min, max and standard deviation.
- * @param imsi IMSI of the UE
- * @param lcid LCID
- * @return PDU size statistics average, min, max and standard deviation in seconds
- */
- std::vector<double> GetDlPduSizeStats (uint64_t imsi, uint8_t lcid);
-
-private:
- void ShowResults (void);
- void WriteUlResults (std::ofstream& outFile);
- void WriteDlResults (std::ofstream& outFile);
- void ResetResults (void);
-
- void StartEpoch (void);
- void CheckEpoch (bool forceEpoch = false);
-
- FlowIdMap m_flowId;
-
- Uint32Map m_dlCellId;
- Uint32Map m_dlTxPackets;
- Uint32Map m_dlRxPackets;
- Uint64Map m_dlTxData;
- Uint64Map m_dlRxData;
- Uint64StatsMap m_dlDelay;
- Uint32StatsMap m_dlPduSize;
-
- Uint32Map m_ulCellId;
- Uint32Map m_ulTxPackets;
- Uint32Map m_ulRxPackets;
- Uint64Map m_ulTxData;
- Uint64Map m_ulRxData;
- Uint64StatsMap m_ulDelay;
- Uint32StatsMap m_ulPduSize;
-
- /**
- * Start time of the on going epoch
- */
- Time m_startTime;
-
- /**
- * Epoch duration
- */
- Time m_epochDuration;
-
- bool m_firstWrite;
-
-};
-
-} // namespace ns3
-
-#endif /* RLC_STATS_CALCULATOR_H_ */
--- a/src/lte/test/lte-test-pf-ff-mac-scheduler.cc Mon Dec 05 21:13:53 2011 +0100
+++ b/src/lte/test/lte-test-pf-ff-mac-scheduler.cc Mon Dec 05 21:19:59 2011 +0100
@@ -31,7 +31,7 @@
#include <ns3/simulator.h>
#include <ns3/packet.h>
#include <ns3/ptr.h>
-#include "ns3/rlc-stats-calculator.h"
+#include "ns3/radio-bearer-stats-calculator.h"
#include <ns3/constant-position-mobility-model.h>
#include "ns3/lte-test-pf-ff-mac-scheduler.h"
#include <ns3/eps-bearer.h>
@@ -233,7 +233,7 @@
// LogComponentEnable ("PfFfMacScheduler", LOG_LEVEL_ALL);
LogComponentEnable ("LenaTestPfFfMacCheduler", LOG_LEVEL_ALL);
// LogComponentEnable ("LteAmc", LOG_LEVEL_ALL);
-// LogComponentEnable ("RlcStatsCalculator", LOG_LEVEL_ALL);
+// LogComponentEnable ("RadioBearerStatsCalculator", LOG_LEVEL_ALL);
/**
* Initialize Simulation Scenario: 1 eNB and m_nUser UEs
@@ -293,7 +293,7 @@
double tolerance = 0.1;
Simulator::Stop (Seconds (simulationTime));
- Ptr<RlcStatsCalculator> rlcStats = lteHelper->GetRlcStats ();
+ Ptr<RadioBearerStatsCalculator> rlcStats = lteHelper->GetRlcStats ();
rlcStats->SetAttribute ("EpochDuration", TimeValue (Seconds (simulationTime)));
Simulator::Run ();
@@ -414,7 +414,7 @@
// LogComponentEnable ("PfFfMacScheduler", LOG_LEVEL_ALL);
LogComponentEnable ("LenaTestPfFfMacCheduler", LOG_LEVEL_ALL);
// LogComponentEnable ("LteAmc", LOG_LEVEL_ALL);
- // LogComponentEnable ("RlcStatsCalculator", LOG_LEVEL_ALL);
+ // LogComponentEnable ("RadioBearerStatsCalculator", LOG_LEVEL_ALL);
/**
* Initialize Simulation Scenario: 1 eNB and m_nUser UEs
@@ -474,7 +474,7 @@
double tolerance = 0.1;
Simulator::Stop (Seconds (simulationTime));
- Ptr<RlcStatsCalculator> rlcStats = lteHelper->GetRlcStats ();
+ Ptr<RadioBearerStatsCalculator> rlcStats = lteHelper->GetRlcStats ();
rlcStats->SetAttribute ("EpochDuration", TimeValue (Seconds (simulationTime)));
Simulator::Run ();
--- a/src/lte/test/lte-test-rr-ff-mac-scheduler.cc Mon Dec 05 21:13:53 2011 +0100
+++ b/src/lte/test/lte-test-rr-ff-mac-scheduler.cc Mon Dec 05 21:19:59 2011 +0100
@@ -27,7 +27,7 @@
#include <ns3/packet.h>
#include <ns3/ptr.h>
#include <iostream>
-#include "ns3/rlc-stats-calculator.h"
+#include "ns3/radio-bearer-stats-calculator.h"
#include <ns3/constant-position-mobility-model.h>
#include "ns3/lte-test-rr-ff-mac-scheduler.h"
#include <ns3/eps-bearer.h>
@@ -219,7 +219,7 @@
// LogComponentEnable ("RrFfMacScheduler", LOG_LEVEL_ALL);
// LogComponentEnable ("LenaTestRrFfMacCheduler", LOG_LEVEL_ALL);
// LogComponentEnable ("LteHelper", LOG_LEVEL_ALL);
-// LogComponentEnable ("RlcStatsCalculator", LOG_LEVEL_ALL);
+// LogComponentEnable ("RadioBearerStatsCalculator", LOG_LEVEL_ALL);
/**
@@ -281,7 +281,7 @@
double tolerance = 0.1;
Simulator::Stop (Seconds (simulationTime));
- Ptr<RlcStatsCalculator> rlcStats = lteHelper->GetRlcStats ();
+ Ptr<RadioBearerStatsCalculator> rlcStats = lteHelper->GetRlcStats ();
rlcStats->SetAttribute ("EpochDuration", TimeValue (Seconds (simulationTime)));
--- a/src/lte/wscript Mon Dec 05 21:13:53 2011 +0100
+++ b/src/lte/wscript Mon Dec 05 21:19:59 2011 +0100
@@ -36,7 +36,7 @@
'helper/gtpu-tunnel-helper.cc',
'helper/lte-stats-calculator.cc',
'helper/epc-helper.cc',
- 'helper/rlc-stats-calculator.cc',
+ 'helper/radio-bearer-stats-calculator.cc',
'helper/mac-stats-calculator.cc',
'model/ff-mac-csched-sap.cc',
'model/ff-mac-sched-sap.cc',
@@ -123,7 +123,7 @@
'helper/lte-stats-calculator.h',
'helper/epc-helper.h',
'helper/mac-stats-calculator.h',
- 'helper/rlc-stats-calculator.h',
+ 'helper/radio-bearer-stats-calculator.h',
'model/ff-mac-common.h',
'model/ff-mac-csched-sap.h',
'model/ff-mac-sched-sap.h',