This class is very useful when user needs to collect statistics from PDCP and RLC. More...
#include "radio-bearer-stats-connector.h"
Classes | |
struct | CellIdRnti |
Struct used as key in m_ueManagerPathByCellIdRnti map. More... | |
Public Member Functions | |
RadioBearerStatsConnector () | |
Constructor. | |
void | DisconnectTracesEnb (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti) |
Disconnects all trace sources at eNB to RLC and PDCP calculators. | |
void | DisconnectTracesUe (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti) |
Disconnects all trace sources at UE to RLC and PDCP calculators. | |
void | EnablePdcpStats (Ptr< RadioBearerStatsCalculator > pdcpStats) |
Enables trace sinks for PDCP layer. | |
void | EnableRlcStats (Ptr< RadioBearerStatsCalculator > rlcStats) |
Enables trace sinks for RLC layer. | |
void | EnsureConnected () |
Connects trace sinks to appropriate trace sources. | |
Static Public Member Functions | |
static void | CreatedDrbEnb (RadioBearerStatsConnector *c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti, uint8_t lcid) |
Function hooked to DrbCreated trace source at UE manager in eNB RRC, which is fired when DRB is created, i.e. | |
static void | CreatedDrbUe (RadioBearerStatsConnector *c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti, uint8_t lcid) |
Function hooked to DrbCreated trace source at UE RRC, which is fired when DRB is created, i.e. | |
static void | CreatedSrb1Ue (RadioBearerStatsConnector *c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti) |
Function hooked to Srb1Created trace source at UE RRC, which is fired when SRB1 is created, i.e. | |
static void | NotifyNewUeContextEnb (RadioBearerStatsConnector *c, std::string context, uint16_t cellid, uint16_t rnti) |
Function hooked to NewUeContext trace source at eNB RRC, which is fired upon creation of a new UE context. | |
static void | NotifyRandomAccessSuccessfulUe (RadioBearerStatsConnector *c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti) |
Function hooked to RandomAccessSuccessful trace source at UE RRC, which is fired upon successful completion of the random access procedure. | |
Private Member Functions | |
void | ConnectTracesDrbEnb (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t lcid) |
Connects DRB trace sources at eNB to RLC and PDCP calculators. | |
void | ConnectTracesDrbUe (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t lcid) |
Connects DRB trace sources at UE to RLC and PDCP calculators. | |
void | ConnectTracesSrb0 (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
Connects SRB0 trace sources at UE and eNB to RLC and PDCP calculators. | |
void | ConnectTracesSrb1 (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
Connects SRB1 trace sources at UE and eNB to RLC and PDCP calculators. | |
void | StoreUeManagerPath (std::string ueManagerPath, uint16_t cellId, uint16_t rnti) |
Creates UE Manager path and stores it in m_ueManagerPathByCellIdRnti. | |
Private Attributes | |
bool | m_connected |
true if traces are connected to sinks, initially set to false | |
Ptr< RadioBearerStatsCalculator > | m_pdcpStats |
Calculator for PDCP Statistics. | |
Ptr< RadioBearerStatsCalculator > | m_rlcStats |
Calculator for RLC Statistics. | |
std::map< CellIdRnti, std::string > | m_ueManagerPathByCellIdRnti |
List UE Manager Paths by CellIdRnti. | |
Friends | |
bool | operator< (const CellIdRnti &a, const CellIdRnti &b) |
Less than operator for CellIdRnti, because it is used as key in map. | |
This class is very useful when user needs to collect statistics from PDCP and RLC.
It automatically connects RadioBearerStatsCalculator to appropriate trace sinks. Usually user does not use this class. All he/she needs to do is to call: LteHelper::EnablePdcpTraces() and/or LteHelper::EnableRlcTraces().
Definition at line 37 of file radio-bearer-stats-connector.h.
ns3::RadioBearerStatsConnector::RadioBearerStatsConnector | ( | ) |
Constructor.
Definition at line 126 of file radio-bearer-stats-connector.cc.
|
private |
Connects DRB trace sources at eNB to RLC and PDCP calculators.
context | |
imsi | |
cellId | |
rnti | |
lcid |
Definition at line 318 of file radio-bearer-stats-connector.cc.
References ns3::Config::Connect(), ns3::Config::ConnectFailSafe(), ns3::Create(), ns3::DlTxPduCallback(), m_pdcpStats, m_rlcStats, ns3::MakeBoundCallback(), NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, and ns3::UlRxPduCallback().
Referenced by CreatedDrbEnb().
|
private |
Connects DRB trace sources at UE to RLC and PDCP calculators.
context | |
imsi | |
cellId | |
rnti | |
lcid |
Definition at line 357 of file radio-bearer-stats-connector.cc.
References ns3::Config::Connect(), ns3::Config::ConnectFailSafe(), ns3::Create(), ns3::DlRxPduCallback(), m_pdcpStats, m_rlcStats, ns3::MakeBoundCallback(), NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, and ns3::UlTxPduCallback().
Referenced by CreatedDrbUe().
|
private |
Connects SRB0 trace sources at UE and eNB to RLC and PDCP calculators.
context | |
imsi | |
cellId | |
rnti |
Definition at line 241 of file radio-bearer-stats-connector.cc.
References ns3::RadioBearerStatsConnector::CellIdRnti::cellId, ns3::Config::Connect(), ns3::Create(), ns3::DlRxPduCallback(), ns3::DlTxPduCallback(), m_rlcStats, m_ueManagerPathByCellIdRnti, ns3::MakeBoundCallback(), NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::RadioBearerStatsConnector::CellIdRnti::rnti, ns3::UlRxPduCallback(), and ns3::UlTxPduCallback().
Referenced by NotifyRandomAccessSuccessfulUe().
|
private |
Connects SRB1 trace sources at UE and eNB to RLC and PDCP calculators.
context | |
imsi | |
cellId | |
rnti |
Definition at line 272 of file radio-bearer-stats-connector.cc.
References ns3::RadioBearerStatsConnector::CellIdRnti::cellId, ns3::Config::Connect(), ns3::Create(), ns3::DlRxPduCallback(), ns3::DlTxPduCallback(), m_pdcpStats, m_rlcStats, m_ueManagerPathByCellIdRnti, ns3::MakeBoundCallback(), NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::RadioBearerStatsConnector::CellIdRnti::rnti, ns3::UlRxPduCallback(), and ns3::UlTxPduCallback().
Referenced by CreatedSrb1Ue().
|
static |
Function hooked to DrbCreated trace source at UE manager in eNB RRC, which is fired when DRB is created, i.e.
RLC and PDCP are created for LC = lcid. It connects the callbacks for the DRB at the eNB.
c | |
context | |
imsi | |
cellid | |
rnti | |
lcid |
Definition at line 206 of file radio-bearer-stats-connector.cc.
References ConnectTracesDrbEnb(), and NS_LOG_FUNCTION.
Referenced by StoreUeManagerPath().
|
static |
Function hooked to DrbCreated trace source at UE RRC, which is fired when DRB is created, i.e.
RLC and PDCP are created for LC = lcid. It connects the callbacks for the DRB at the UE.
c | |
context | |
imsi | |
cellid | |
rnti | |
lcid |
Definition at line 229 of file radio-bearer-stats-connector.cc.
References ConnectTracesDrbUe(), and NS_LOG_FUNCTION.
Referenced by EnsureConnected().
|
static |
Function hooked to Srb1Created trace source at UE RRC, which is fired when SRB1 is created, i.e.
RLC and PDCP are created for one LC = 1. It connects the callbacks for the DRB at the eNB.
c | |
context | |
imsi | |
cellid | |
rnti |
Definition at line 218 of file radio-bearer-stats-connector.cc.
References ConnectTracesSrb1(), and NS_LOG_FUNCTION.
Referenced by EnsureConnected().
void ns3::RadioBearerStatsConnector::DisconnectTracesEnb | ( | std::string | context, |
uint64_t | imsi, | ||
uint16_t | cellid, | ||
uint16_t | rnti ) |
Disconnects all trace sources at eNB to RLC and PDCP calculators.
Function is not implemented.
context | |
imsi | |
cellid | |
rnti |
This method is left empty to be extended in future. Note: Be aware, that each of the connect method uses its own BoundCallbackArgument struct as an argument of the callback. And, if the code to disconnect the traces would also use their own struct, the traces will not disconnect, since it changes the parameter of the callback.
Definition at line 396 of file radio-bearer-stats-connector.cc.
References NS_LOG_FUNCTION.
void ns3::RadioBearerStatsConnector::DisconnectTracesUe | ( | std::string | context, |
uint64_t | imsi, | ||
uint16_t | cellid, | ||
uint16_t | rnti ) |
Disconnects all trace sources at UE to RLC and PDCP calculators.
Function is not implemented.
context | |
imsi | |
cellid | |
rnti |
This method is left empty to be extended in future. Note: Be aware, that each of the connect method uses its own BoundCallbackArgument struct as an argument of the callback. And, if the code to disconnect the traces would also use their own struct, the traces will not disconnect, since it changes the parameter of the callback.
Definition at line 414 of file radio-bearer-stats-connector.cc.
References NS_LOG_FUNCTION.
void ns3::RadioBearerStatsConnector::EnablePdcpStats | ( | Ptr< RadioBearerStatsCalculator > | pdcpStats | ) |
Enables trace sinks for PDCP layer.
Usually, this function is called by LteHelper::EnablePdcpTraces().
pdcpStats | statistics calculator for PDCP layer |
Definition at line 139 of file radio-bearer-stats-connector.cc.
References EnsureConnected(), and m_pdcpStats.
Referenced by ns3::LteHelper::EnablePdcpTraces().
void ns3::RadioBearerStatsConnector::EnableRlcStats | ( | Ptr< RadioBearerStatsCalculator > | rlcStats | ) |
Enables trace sinks for RLC layer.
Usually, this function is called by LteHelper::EnableRlcTraces().
rlcStats | statistics calculator for RLC layer |
Definition at line 132 of file radio-bearer-stats-connector.cc.
References EnsureConnected(), and m_rlcStats.
Referenced by ns3::LteHelper::EnableRlcTraces().
void ns3::RadioBearerStatsConnector::EnsureConnected | ( | ) |
Connects trace sinks to appropriate trace sources.
Definition at line 146 of file radio-bearer-stats-connector.cc.
References ns3::Config::Connect(), CreatedDrbUe(), CreatedSrb1Ue(), m_connected, ns3::MakeBoundCallback(), NotifyNewUeContextEnb(), NotifyRandomAccessSuccessfulUe(), and NS_LOG_FUNCTION.
Referenced by EnablePdcpStats(), and EnableRlcStats().
|
static |
Function hooked to NewUeContext trace source at eNB RRC, which is fired upon creation of a new UE context.
It stores the UE manager path and connects the callback that will be called when the DRB is created in the eNB.
c | |
context | |
cellid | |
rnti |
Definition at line 185 of file radio-bearer-stats-connector.cc.
References NS_LOG_FUNCTION, and StoreUeManagerPath().
Referenced by EnsureConnected().
|
static |
Function hooked to RandomAccessSuccessful trace source at UE RRC, which is fired upon successful completion of the random access procedure.
It connects the callbacks for the SRB0 at the eNB and the UE.
c | |
context | |
imsi | |
cellid | |
rnti |
Definition at line 195 of file radio-bearer-stats-connector.cc.
References ConnectTracesSrb0(), and NS_LOG_FUNCTION.
Referenced by EnsureConnected().
|
private |
Creates UE Manager path and stores it in m_ueManagerPathByCellIdRnti.
ueManagerPath | |
cellId | |
rnti |
Definition at line 169 of file radio-bearer-stats-connector.cc.
References ns3::RadioBearerStatsConnector::CellIdRnti::cellId, ns3::Config::Connect(), CreatedDrbEnb(), m_ueManagerPathByCellIdRnti, ns3::MakeBoundCallback(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::RadioBearerStatsConnector::CellIdRnti::rnti.
Referenced by NotifyNewUeContextEnb().
|
friend |
Less than operator for CellIdRnti, because it is used as key in map.
a | the lhs operand |
b | the rhs operand |
Definition at line 25 of file radio-bearer-stats-connector.cc.
|
private |
true if traces are connected to sinks, initially set to false
Definition at line 225 of file radio-bearer-stats-connector.h.
Referenced by EnsureConnected().
|
private |
Calculator for PDCP Statistics.
Definition at line 223 of file radio-bearer-stats-connector.h.
Referenced by ConnectTracesDrbEnb(), ConnectTracesDrbUe(), ConnectTracesSrb1(), and EnablePdcpStats().
|
private |
Calculator for RLC Statistics.
Definition at line 222 of file radio-bearer-stats-connector.h.
Referenced by ConnectTracesDrbEnb(), ConnectTracesDrbUe(), ConnectTracesSrb0(), ConnectTracesSrb1(), and EnableRlcStats().
|
private |
List UE Manager Paths by CellIdRnti.
Definition at line 248 of file radio-bearer-stats-connector.h.
Referenced by ConnectTracesSrb0(), ConnectTracesSrb1(), and StoreUeManagerPath().