RLC and PDCP stats for SRBs
This commit is contained in:
@@ -149,6 +149,7 @@ main (int argc, char *argv[])
|
||||
// arguments, so that the user is allowed to override these settings
|
||||
Config::SetDefault ("ns3::UdpClient::Interval", TimeValue (MilliSeconds(10)));
|
||||
Config::SetDefault ("ns3::UdpClient::MaxPackets", UintegerValue(1000000));
|
||||
Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue(false));
|
||||
|
||||
// Command line arguments
|
||||
CommandLine cmd;
|
||||
|
||||
@@ -36,6 +36,12 @@ namespace ns3 {
|
||||
|
||||
|
||||
|
||||
bool
|
||||
operator < (const RadioBearerStatsConnector::CellIdRnti& a, const RadioBearerStatsConnector::CellIdRnti& b)
|
||||
{
|
||||
return ( (a.cellId < b.cellId) || ( (a.cellId == b.cellId) && (a.rnti < b.rnti) ) );
|
||||
}
|
||||
|
||||
struct BoundCallbackArgument : public SimpleRefCount<BoundCallbackArgument>
|
||||
{
|
||||
public:
|
||||
@@ -108,6 +114,10 @@ RadioBearerStatsConnector::EnsureConnected ()
|
||||
NS_LOG_FUNCTION (this);
|
||||
if (!m_connected)
|
||||
{
|
||||
Config::Connect ("/NodeList/*/DeviceList/*/LteEnbRrc/NewUeContext",
|
||||
MakeBoundCallback (&RadioBearerStatsConnector::NotifyNewUeContextEnb, this));
|
||||
Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/RandomAccessSuccessful",
|
||||
MakeBoundCallback (&RadioBearerStatsConnector::NotifyRandomAccessSuccessfulUe, this));
|
||||
Config::Connect ("/NodeList/*/DeviceList/*/LteEnbRrc/ConnectionReconfiguration",
|
||||
MakeBoundCallback (&RadioBearerStatsConnector::NotifyConnectionReconfigurationEnb, this));
|
||||
Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/ConnectionReconfiguration",
|
||||
@@ -120,69 +130,190 @@ RadioBearerStatsConnector::EnsureConnected ()
|
||||
MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverEndOkEnb, this));
|
||||
Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/HandoverEndOk",
|
||||
MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverEndOkUe, this));
|
||||
m_connected = true;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
RadioBearerStatsConnector::NotifyConnectionReconfigurationUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti)
|
||||
RadioBearerStatsConnector::NotifyRandomAccessSuccessfulUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
|
||||
{
|
||||
c->ConnectTracesUeIfFirstTime (context, imsi, cellid, rnti);
|
||||
c->ConnectSrb0Traces (context, imsi, cellId, rnti);
|
||||
}
|
||||
|
||||
void
|
||||
RadioBearerStatsConnector::NotifyHandoverStartUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti, uint16_t targetCellId)
|
||||
RadioBearerStatsConnector::NotifyConnectionSetupUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
|
||||
{
|
||||
c->DisconnectTracesUe (context, imsi, cellid, rnti);
|
||||
c->ConnectSrb1TracesUe (context, imsi, cellId, rnti);
|
||||
}
|
||||
|
||||
void
|
||||
RadioBearerStatsConnector::NotifyHandoverEndOkUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti)
|
||||
RadioBearerStatsConnector::NotifyConnectionReconfigurationUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
|
||||
{
|
||||
c->ConnectTracesUe (context, imsi, cellid, rnti);
|
||||
c->ConnectTracesUeIfFirstTime (context, imsi, cellId, rnti);
|
||||
}
|
||||
|
||||
void
|
||||
RadioBearerStatsConnector::NotifyConnectionReconfigurationEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti)
|
||||
RadioBearerStatsConnector::NotifyHandoverStartUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint16_t targetCellId)
|
||||
{
|
||||
c->ConnectTracesEnbIfFirstTime (context, imsi, cellid, rnti);
|
||||
c->DisconnectTracesUe (context, imsi, cellId, rnti);
|
||||
}
|
||||
|
||||
void
|
||||
RadioBearerStatsConnector::NotifyHandoverStartEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti, uint16_t targetCellId)
|
||||
RadioBearerStatsConnector::NotifyHandoverEndOkUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
|
||||
{
|
||||
c->DisconnectTracesEnb (context, imsi, cellid, rnti);
|
||||
c->ConnectTracesUe (context, imsi, cellId, rnti);
|
||||
}
|
||||
|
||||
void
|
||||
RadioBearerStatsConnector::NotifyHandoverEndOkEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti)
|
||||
RadioBearerStatsConnector::NotifyNewUeContextEnb (RadioBearerStatsConnector* c, std::string context, uint16_t cellId, uint16_t rnti)
|
||||
{
|
||||
c->ConnectTracesEnb (context, imsi, cellid, rnti);
|
||||
c->StoreUeManagerPath (context, cellId, rnti);
|
||||
}
|
||||
|
||||
void
|
||||
RadioBearerStatsConnector::NotifyConnectionReconfigurationEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
|
||||
{
|
||||
c->ConnectTracesEnbIfFirstTime (context, imsi, cellId, rnti);
|
||||
}
|
||||
|
||||
void
|
||||
RadioBearerStatsConnector::NotifyHandoverStartEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint16_t targetCellId)
|
||||
{
|
||||
c->DisconnectTracesEnb (context, imsi, cellId, rnti);
|
||||
}
|
||||
|
||||
void
|
||||
RadioBearerStatsConnector::NotifyHandoverEndOkEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
|
||||
{
|
||||
c->ConnectTracesEnb (context, imsi, cellId, rnti);
|
||||
}
|
||||
|
||||
void
|
||||
RadioBearerStatsConnector::StoreUeManagerPath (std::string context, uint16_t cellId, uint16_t rnti)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << context << cellId << rnti);
|
||||
std::ostringstream ueManagerPath;
|
||||
ueManagerPath << context.substr (0, context.rfind ("/")) << "/UeMap/" << (uint32_t) rnti;
|
||||
CellIdRnti key;
|
||||
key.cellId = cellId;
|
||||
key.rnti = rnti;
|
||||
m_ueManagerPathByCellIdRnti[key] = ueManagerPath.str ();
|
||||
}
|
||||
|
||||
void
|
||||
RadioBearerStatsConnector::ConnectSrb0Traces (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << imsi << cellId << rnti);
|
||||
std::string ueRrcPath = context.substr (0, context.rfind ("/"));
|
||||
CellIdRnti key;
|
||||
key.cellId = cellId;
|
||||
key.rnti = rnti;
|
||||
std::map<CellIdRnti, std::string>::iterator it = m_ueManagerPathByCellIdRnti.find (key);
|
||||
NS_ASSERT (it != m_ueManagerPathByCellIdRnti.end ());
|
||||
std::string ueManagerPath = it->second;
|
||||
NS_LOG_LOGIC (this << " ueManagerPath: " << ueManagerPath);
|
||||
m_ueManagerPathByCellIdRnti.erase (it);
|
||||
|
||||
if (m_rlcStats)
|
||||
{
|
||||
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> ();
|
||||
arg->imsi = imsi;
|
||||
arg->cellId = cellId;
|
||||
arg->stats = m_rlcStats;
|
||||
|
||||
// diconnect eventually previously connected SRB0 both at UE and eNB
|
||||
Config::Disconnect (ueRrcPath + "/Srb0/LteRlc/TxPDU",
|
||||
MakeBoundCallback (&UlTxPduCallback, arg));
|
||||
Config::Disconnect (ueRrcPath + "/Srb0/LteRlc/RxPDU",
|
||||
MakeBoundCallback (&DlRxPduCallback, arg));
|
||||
Config::Disconnect (ueManagerPath + "/Srb0/LteRlc/TxPDU",
|
||||
MakeBoundCallback (&DlTxPduCallback, arg));
|
||||
Config::Disconnect (ueManagerPath + "/Srb0/LteRlc/RxPDU",
|
||||
MakeBoundCallback (&UlRxPduCallback, arg));
|
||||
|
||||
// connect SRB0 both at UE and eNB
|
||||
Config::Connect (ueRrcPath + "/Srb0/LteRlc/TxPDU",
|
||||
MakeBoundCallback (&UlTxPduCallback, arg));
|
||||
Config::Connect (ueRrcPath + "/Srb0/LteRlc/RxPDU",
|
||||
MakeBoundCallback (&DlRxPduCallback, arg));
|
||||
Config::Connect (ueManagerPath + "/Srb0/LteRlc/TxPDU",
|
||||
MakeBoundCallback (&DlTxPduCallback, arg));
|
||||
Config::Connect (ueManagerPath + "/Srb0/LteRlc/RxPDU",
|
||||
MakeBoundCallback (&UlRxPduCallback, arg));
|
||||
|
||||
// connect SRB1 at eNB only (at UE SRB1 will be setup later)
|
||||
Config::Connect (ueManagerPath + "/Srb1/LteRlc/TxPDU",
|
||||
MakeBoundCallback (&DlTxPduCallback, arg));
|
||||
Config::Connect (ueManagerPath + "/Srb1/LteRlc/RxPDU",
|
||||
MakeBoundCallback (&UlRxPduCallback, arg));
|
||||
}
|
||||
if (m_pdcpStats)
|
||||
{
|
||||
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> ();
|
||||
arg->imsi = imsi;
|
||||
arg->cellId = cellId;
|
||||
arg->stats = m_pdcpStats;
|
||||
|
||||
// connect SRB1 at eNB only (at UE SRB1 will be setup later)
|
||||
Config::Connect (ueManagerPath + "/Srb1/LtePdcp/RxPDU",
|
||||
MakeBoundCallback (&UlRxPduCallback, arg));
|
||||
Config::Connect (ueManagerPath + "/Srb1/LtePdcp/TxPDU",
|
||||
MakeBoundCallback (&DlTxPduCallback, arg));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
RadioBearerStatsConnector::ConnectSrb1TracesUe (std::string ueRrcPath, uint64_t imsi, uint16_t cellId, uint16_t rnti)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << imsi << cellId << rnti);
|
||||
if (m_rlcStats)
|
||||
{
|
||||
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> ();
|
||||
arg->imsi = imsi;
|
||||
arg->cellId = cellId;
|
||||
arg->stats = m_rlcStats;
|
||||
Config::Connect (ueRrcPath + "/Srb1/LteRlc/TxPDU",
|
||||
MakeBoundCallback (&UlTxPduCallback, arg));
|
||||
Config::Connect (ueRrcPath + "/Srb1/LteRlc/RxPDU",
|
||||
MakeBoundCallback (&DlRxPduCallback, arg));
|
||||
}
|
||||
if (m_pdcpStats)
|
||||
{
|
||||
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> ();
|
||||
arg->imsi = imsi;
|
||||
arg->cellId = cellId;
|
||||
arg->stats = m_pdcpStats;
|
||||
Config::Connect (ueRrcPath + "/Srb1/LtePdcp/RxPDU",
|
||||
MakeBoundCallback (&DlRxPduCallback, arg));
|
||||
Config::Connect (ueRrcPath + "/Srb1/LtePdcp/TxPDU",
|
||||
MakeBoundCallback (&UlTxPduCallback, arg));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
RadioBearerStatsConnector::ConnectTracesUeIfFirstTime (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti)
|
||||
RadioBearerStatsConnector::ConnectTracesUeIfFirstTime (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << context);
|
||||
if (m_imsiSeenUe.find (imsi) == m_imsiSeenUe.end ())
|
||||
{
|
||||
m_imsiSeenUe.insert (imsi);
|
||||
ConnectTracesUe (context, imsi, cellid, rnti);
|
||||
ConnectTracesUe (context, imsi, cellId, rnti);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
RadioBearerStatsConnector::ConnectTracesEnbIfFirstTime (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti)
|
||||
RadioBearerStatsConnector::ConnectTracesEnbIfFirstTime (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << context);
|
||||
if (m_imsiSeenEnb.find (imsi) == m_imsiSeenEnb.end ())
|
||||
{
|
||||
m_imsiSeenEnb.insert (imsi);
|
||||
ConnectTracesEnb (context, imsi, cellid, rnti);
|
||||
ConnectTracesEnb (context, imsi, cellId, rnti);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
RadioBearerStatsConnector::ConnectTracesUe (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti)
|
||||
RadioBearerStatsConnector::ConnectTracesUe (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << context);
|
||||
NS_LOG_LOGIC (this << "expected context should match /NodeList/*/DeviceList/*/LteUeRrc/");
|
||||
@@ -191,66 +322,87 @@ RadioBearerStatsConnector::ConnectTracesUe (std::string context, uint64_t imsi,
|
||||
{
|
||||
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> ();
|
||||
arg->imsi = imsi;
|
||||
arg->cellId = cellid;
|
||||
arg->cellId = cellId;
|
||||
arg->stats = m_rlcStats;
|
||||
Config::Connect (basePath + "/DataRadioBearerMap/*/LteRlc/TxPDU",
|
||||
MakeBoundCallback (&UlTxPduCallback, arg));
|
||||
Config::Connect (basePath + "/DataRadioBearerMap/*/LteRlc/RxPDU",
|
||||
MakeBoundCallback (&DlRxPduCallback, arg));
|
||||
Config::Connect (basePath + "/Srb1/LteRlc/TxPDU",
|
||||
MakeBoundCallback (&UlTxPduCallback, arg));
|
||||
Config::Connect (basePath + "/Srb1/LteRlc/RxPDU",
|
||||
MakeBoundCallback (&DlRxPduCallback, arg));
|
||||
|
||||
}
|
||||
if (m_pdcpStats)
|
||||
{
|
||||
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> ();
|
||||
arg->imsi = imsi;
|
||||
arg->cellId = cellid;
|
||||
arg->cellId = cellId;
|
||||
arg->stats = m_pdcpStats;
|
||||
Config::Connect (basePath + "/DataRadioBearerMap/*/LtePdcp/RxPDU",
|
||||
MakeBoundCallback (&DlRxPduCallback, arg));
|
||||
Config::Connect (basePath + "/DataRadioBearerMap/*/LtePdcp/TxPDU",
|
||||
MakeBoundCallback (&UlTxPduCallback, arg));
|
||||
Config::Connect (basePath + "/Srb1/LtePdcp/RxPDU",
|
||||
MakeBoundCallback (&DlRxPduCallback, arg));
|
||||
Config::Connect (basePath + "/Srb1/LtePdcp/TxPDU",
|
||||
MakeBoundCallback (&UlTxPduCallback, arg));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
RadioBearerStatsConnector::ConnectTracesEnb (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti)
|
||||
RadioBearerStatsConnector::ConnectTracesEnb (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << context);
|
||||
NS_LOG_LOGIC (this << "expected context should match /NodeList/*/DeviceList/*/LteEnbRrc/");
|
||||
std::ostringstream basePath;
|
||||
basePath << context.substr (0, context.rfind ("/")) << "/UeMap/" << (uint32_t) rnti << "/DataRadioBearerMap/*/";
|
||||
basePath << context.substr (0, context.rfind ("/")) << "/UeMap/" << (uint32_t) rnti;
|
||||
if (m_rlcStats)
|
||||
{
|
||||
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> ();
|
||||
arg->imsi = imsi;
|
||||
arg->cellId = cellid;
|
||||
arg->cellId = cellId;
|
||||
arg->stats = m_rlcStats;
|
||||
Config::Connect (basePath.str () + "LteRlc/RxPDU",
|
||||
Config::Connect (basePath.str () + "/DataRadioBearerMap/*/LteRlc/RxPDU",
|
||||
MakeBoundCallback (&UlRxPduCallback, arg));
|
||||
Config::Connect (basePath.str () + "LteRlc/TxPDU",
|
||||
Config::Connect (basePath.str () + "/DataRadioBearerMap/*/LteRlc/TxPDU",
|
||||
MakeBoundCallback (&DlTxPduCallback, arg));
|
||||
Config::Connect (basePath.str () + "/Srb0/LteRlc/RxPDU",
|
||||
MakeBoundCallback (&UlRxPduCallback, arg));
|
||||
Config::Connect (basePath.str () + "/Srb0/LteRlc/TxPDU",
|
||||
MakeBoundCallback (&DlTxPduCallback, arg));
|
||||
Config::Connect (basePath.str () + "/Srb1/LteRlc/RxPDU",
|
||||
MakeBoundCallback (&UlRxPduCallback, arg));
|
||||
Config::Connect (basePath.str () + "/Srb1/LteRlc/TxPDU",
|
||||
MakeBoundCallback (&DlTxPduCallback, arg));
|
||||
}
|
||||
if (m_pdcpStats)
|
||||
{
|
||||
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> ();
|
||||
arg->imsi = imsi;
|
||||
arg->cellId = cellid;
|
||||
arg->cellId = cellId;
|
||||
arg->stats = m_pdcpStats;
|
||||
Config::Connect (basePath.str () + "LtePdcp/TxPDU",
|
||||
Config::Connect (basePath.str () + "/DataRadioBearerMap/*/LtePdcp/TxPDU",
|
||||
MakeBoundCallback (&DlTxPduCallback, arg));
|
||||
Config::Connect (basePath.str () + "LtePdcp/RxPDU",
|
||||
Config::Connect (basePath.str () + "/DataRadioBearerMap/*/LtePdcp/RxPDU",
|
||||
MakeBoundCallback (&UlRxPduCallback, arg));
|
||||
Config::Connect (basePath.str () + "/Srb1/LtePdcp/TxPDU",
|
||||
MakeBoundCallback (&DlTxPduCallback, arg));
|
||||
Config::Connect (basePath.str () + "/Srb1/LtePdcp/RxPDU",
|
||||
MakeBoundCallback (&UlRxPduCallback, arg));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
RadioBearerStatsConnector::DisconnectTracesUe (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti)
|
||||
RadioBearerStatsConnector::DisconnectTracesUe (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
RadioBearerStatsConnector::DisconnectTracesEnb (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti)
|
||||
RadioBearerStatsConnector::DisconnectTracesEnb (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <ns3/ptr.h>
|
||||
|
||||
#include <set>
|
||||
#include <map>
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
@@ -51,14 +52,21 @@ public:
|
||||
void EnsureConnected ();
|
||||
|
||||
// trace sinks, to be used with MakeBoundCallback
|
||||
static void NotifyRandomAccessSuccessfulUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
|
||||
static void NotifyConnectionSetupUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
|
||||
static void NotifyConnectionReconfigurationUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
|
||||
static void NotifyHandoverStartUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti, uint16_t targetCellId);
|
||||
static void NotifyHandoverEndOkUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
|
||||
static void NotifyNewUeContextEnb (RadioBearerStatsConnector* c, std::string context, uint16_t cellid, uint16_t rnti);
|
||||
static void NotifyConnectionReconfigurationEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
|
||||
static void NotifyHandoverStartEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti, uint16_t targetCellId);
|
||||
static void NotifyHandoverEndOkEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
|
||||
|
||||
private:
|
||||
|
||||
void StoreUeManagerPath (std::string ueManagerPath, uint16_t cellId, uint16_t rnti);
|
||||
void ConnectSrb0Traces (std::string ueRrcPath, uint64_t imsi, uint16_t cellId, uint16_t rnti);
|
||||
void ConnectSrb1TracesUe (std::string ueRrcPath, uint64_t imsi, uint16_t cellId, uint16_t rnti);
|
||||
void ConnectTracesUeIfFirstTime (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
|
||||
void ConnectTracesEnbIfFirstTime (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
|
||||
void ConnectTracesUe (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
|
||||
@@ -73,6 +81,14 @@ private:
|
||||
bool m_connected;
|
||||
std::set<uint64_t> m_imsiSeenUe;
|
||||
std::set<uint64_t> m_imsiSeenEnb;
|
||||
|
||||
struct CellIdRnti
|
||||
{
|
||||
uint16_t cellId;
|
||||
uint16_t rnti;
|
||||
};
|
||||
friend bool operator < (const CellIdRnti &a, const CellIdRnti &b);
|
||||
std::map<CellIdRnti, std::string> m_ueManagerPathByCellIdRnti;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -287,10 +287,24 @@ TypeId UeManager::GetTypeId (void)
|
||||
static TypeId tid = TypeId ("ns3::UeManager")
|
||||
.SetParent<Object> ()
|
||||
.AddConstructor<UeManager> ()
|
||||
.AddAttribute ("DataRadioBearerMap", "List of UE RadioBearerInfo by DRBID.",
|
||||
.AddAttribute ("DataRadioBearerMap", "List of UE DataRadioBearerInfo by DRBID.",
|
||||
ObjectMapValue (),
|
||||
MakeObjectMapAccessor (&UeManager::m_drbMap),
|
||||
MakeObjectMapChecker<LteDataRadioBearerInfo> ())
|
||||
.AddAttribute ("Srb0", "SignalingRadioBearerInfo for SRB0",
|
||||
PointerValue (),
|
||||
MakePointerAccessor (&UeManager::m_srb0),
|
||||
MakePointerChecker<LteSignalingRadioBearerInfo> ())
|
||||
.AddAttribute ("Srb1", "SignalingRadioBearerInfo for SRB1",
|
||||
PointerValue (),
|
||||
MakePointerAccessor (&UeManager::m_srb1),
|
||||
MakePointerChecker<LteSignalingRadioBearerInfo> ())
|
||||
.AddAttribute ("C-RNTI",
|
||||
"Cell Radio Network Temporary Identifier",
|
||||
TypeId::ATTR_GET, // read-only attribute
|
||||
UintegerValue (0), // unused, read-only attribute
|
||||
MakeUintegerAccessor (&UeManager::m_rnti),
|
||||
MakeUintegerChecker<uint16_t> ())
|
||||
.AddTraceSource ("StateTransition",
|
||||
"fired upon every UE state transition seen by the UeManager at the eNB RRC",
|
||||
MakeTraceSourceAccessor (&UeManager::m_stateTransitionTrace))
|
||||
@@ -1226,6 +1240,9 @@ LteEnbRrc::GetTypeId (void)
|
||||
BooleanValue (true),
|
||||
MakeBooleanAccessor (&LteEnbRrc::m_admitRrcConnectionRequest),
|
||||
MakeBooleanChecker ())
|
||||
.AddTraceSource ("NewUeContext",
|
||||
"trace fired upon creation of a new UE context",
|
||||
MakeTraceSourceAccessor (&LteEnbRrc::m_newUeContextTrace))
|
||||
.AddTraceSource ("ConnectionEstablished",
|
||||
"trace fired upon successful RRC connection establishment",
|
||||
MakeTraceSourceAccessor (&LteEnbRrc::m_connectionEstablishedTrace))
|
||||
@@ -1705,7 +1722,8 @@ LteEnbRrc::AddUe (UeManager::State state)
|
||||
Ptr<UeManager> ueManager = CreateObject<UeManager> (this, rnti, state);
|
||||
m_ueMap.insert (std::pair<uint16_t, Ptr<UeManager> > (rnti, ueManager));
|
||||
ueManager->Start ();
|
||||
NS_LOG_DEBUG (this << " New UE RNTI " << rnti << " cellId " << m_cellId << " srs CI " << ueManager->GetSrsConfigurationIndex ());
|
||||
NS_LOG_DEBUG (this << " New UE RNTI " << rnti << " cellId " << m_cellId << " srs CI " << ueManager->GetSrsConfigurationIndex ());
|
||||
m_newUeContextTrace (m_cellId, rnti);
|
||||
return rnti;
|
||||
}
|
||||
|
||||
|
||||
@@ -768,6 +768,8 @@ private:
|
||||
bool m_admitHandoverRequest;
|
||||
bool m_admitRrcConnectionRequest;
|
||||
|
||||
// cellid rnti
|
||||
TracedCallback<uint16_t, uint16_t> m_newUeContextTrace;
|
||||
// imsi cellid rnti
|
||||
TracedCallback<uint64_t, uint16_t, uint16_t> m_connectionEstablishedTrace;
|
||||
// imsi cellid rnti
|
||||
|
||||
@@ -167,6 +167,14 @@ LteUeRrc::GetTypeId (void)
|
||||
ObjectMapValue (),
|
||||
MakeObjectMapAccessor (&LteUeRrc::m_drbMap),
|
||||
MakeObjectMapChecker<LteDataRadioBearerInfo> ())
|
||||
.AddAttribute ("Srb0", "SignalingRadioBearerInfo for SRB0",
|
||||
PointerValue (),
|
||||
MakePointerAccessor (&LteUeRrc::m_srb0),
|
||||
MakePointerChecker<LteSignalingRadioBearerInfo> ())
|
||||
.AddAttribute ("Srb1", "SignalingRadioBearerInfo for SRB1",
|
||||
PointerValue (),
|
||||
MakePointerAccessor (&LteUeRrc::m_srb1),
|
||||
MakePointerChecker<LteSignalingRadioBearerInfo> ())
|
||||
.AddAttribute ("CellId",
|
||||
"Serving cell identifier",
|
||||
UintegerValue (0), // unused, read-only attribute
|
||||
@@ -180,6 +188,9 @@ LteUeRrc::GetTypeId (void)
|
||||
.AddTraceSource ("StateTransition",
|
||||
"trace fired upon every UE RRC state transition",
|
||||
MakeTraceSourceAccessor (&LteUeRrc::m_stateTransitionTrace))
|
||||
.AddTraceSource ("RandomAccessSuccessful",
|
||||
"trace fired upon successful completion of the random access procedure",
|
||||
MakeTraceSourceAccessor (&LteUeRrc::m_randomAccessSuccessfulTrace))
|
||||
.AddTraceSource ("ConnectionEstablished",
|
||||
"trace fired upon successful RRC connection establishment",
|
||||
MakeTraceSourceAccessor (&LteUeRrc::m_connectionEstablishedTrace))
|
||||
@@ -433,6 +444,7 @@ void
|
||||
LteUeRrc::DoNotifyRandomAccessSuccessful ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this << m_imsi << ToString (m_state));
|
||||
m_randomAccessSuccessfulTrace (m_imsi, m_cellId, m_rnti);
|
||||
switch (m_state)
|
||||
{
|
||||
case IDLE_RANDOM_ACCESS:
|
||||
|
||||
@@ -305,6 +305,8 @@ private:
|
||||
// imsi cellid rnti
|
||||
TracedCallback<uint64_t, uint16_t, uint16_t, State, State> m_stateTransitionTrace;
|
||||
// imsi cellid rnti
|
||||
TracedCallback<uint64_t, uint16_t, uint16_t> m_randomAccessSuccessfulTrace;
|
||||
// imsi cellid rnti
|
||||
TracedCallback<uint64_t, uint16_t, uint16_t> m_connectionEstablishedTrace;
|
||||
// imsi cellid rnti
|
||||
TracedCallback<uint64_t, uint16_t, uint16_t> m_connectionReconfigurationTrace;
|
||||
|
||||
Reference in New Issue
Block a user