A Discrete-Event Network Simulator
API
ns3::RadioBearerStatsConnector Class Reference

This class is very useful when user needs to collect statistics from PDCP and RLC. More...

#include "radio-bearer-stats-connector.h"

+ Collaboration diagram for ns3::RadioBearerStatsConnector:

Classes

struct  CellIdRnti
 Struct used as key in m_ueManagerPathByCellIdRnti map. More...
 

Public Member Functions

 RadioBearerStatsConnector ()
 Constructor. More...
 
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. More...
 
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. More...
 
void EnablePdcpStats (Ptr< RadioBearerStatsCalculator > pdcpStats)
 Enables trace sinks for PDCP layer. More...
 
void EnableRlcStats (Ptr< RadioBearerStatsCalculator > rlcStats)
 Enables trace sinks for RLC layer. More...
 
void EnsureConnected ()
 Connects trace sinks to appropriate trace sources. More...
 

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

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. More...
 
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. More...
 
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. More...
 
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. More...
 
void StoreUeManagerPath (std::string ueManagerPath, uint16_t cellId, uint16_t rnti)
 Creates UE Manager path and stores it in m_ueManagerPathByCellIdRnti. More...
 

Private Attributes

bool m_connected
 true if traces are connected to sinks, initially set to false More...
 
Ptr< RadioBearerStatsCalculatorm_pdcpStats
 Calculator for PDCP Statistics. More...
 
Ptr< RadioBearerStatsCalculatorm_rlcStats
 Calculator for RLC Statistics. More...
 
std::map< CellIdRnti, std::string > m_ueManagerPathByCellIdRnti
 List UE Manager Paths by CellIdRnti. More...
 

Friends

bool operator< (const CellIdRnti &a, const CellIdRnti &b)
 Less than operator for CellIdRnti, because it is used as key in map. More...
 

Detailed Description

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 48 of file radio-bearer-stats-connector.h.

Constructor & Destructor Documentation

◆ RadioBearerStatsConnector()

ns3::RadioBearerStatsConnector::RadioBearerStatsConnector ( )

Constructor.

Definition at line 137 of file radio-bearer-stats-connector.cc.

Member Function Documentation

◆ ConnectTracesDrbEnb()

void ns3::RadioBearerStatsConnector::ConnectTracesDrbEnb ( std::string  context,
uint64_t  imsi,
uint16_t  cellId,
uint16_t  rnti,
uint8_t  lcid 
)
private

Connects DRB trace sources at eNB to RLC and PDCP calculators.

Parameters
context
imsi
cellId
rnti
lcid

Definition at line 329 of file radio-bearer-stats-connector.cc.

References ns3::Config::Connect(), ns3::Config::ConnectFailSafe(), ns3::DlTxPduCallback(), m_pdcpStats, m_rlcStats, ns3::MakeBoundCallback(), NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, nlohmann::to_string(), and ns3::UlRxPduCallback().

Referenced by CreatedDrbEnb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ConnectTracesDrbUe()

void ns3::RadioBearerStatsConnector::ConnectTracesDrbUe ( std::string  context,
uint64_t  imsi,
uint16_t  cellId,
uint16_t  rnti,
uint8_t  lcid 
)
private

Connects DRB trace sources at UE to RLC and PDCP calculators.

Parameters
context
imsi
cellId
rnti
lcid

Definition at line 368 of file radio-bearer-stats-connector.cc.

References ns3::Config::Connect(), ns3::Config::ConnectFailSafe(), ns3::DlRxPduCallback(), m_pdcpStats, m_rlcStats, ns3::MakeBoundCallback(), NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, nlohmann::to_string(), and ns3::UlTxPduCallback().

Referenced by CreatedDrbUe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ConnectTracesSrb0()

void ns3::RadioBearerStatsConnector::ConnectTracesSrb0 ( std::string  context,
uint64_t  imsi,
uint16_t  cellId,
uint16_t  rnti 
)
private

Connects SRB0 trace sources at UE and eNB to RLC and PDCP calculators.

Parameters
context
imsi
cellId
rnti

Definition at line 252 of file radio-bearer-stats-connector.cc.

References ns3::Config::Connect(), ns3::DlRxPduCallback(), ns3::DlTxPduCallback(), m_rlcStats, m_ueManagerPathByCellIdRnti, ns3::MakeBoundCallback(), NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::UlRxPduCallback(), and ns3::UlTxPduCallback().

Referenced by NotifyRandomAccessSuccessfulUe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ConnectTracesSrb1()

void ns3::RadioBearerStatsConnector::ConnectTracesSrb1 ( std::string  context,
uint64_t  imsi,
uint16_t  cellId,
uint16_t  rnti 
)
private

Connects SRB1 trace sources at UE and eNB to RLC and PDCP calculators.

Parameters
context
imsi
cellId
rnti

Definition at line 283 of file radio-bearer-stats-connector.cc.

References ns3::Config::Connect(), ns3::DlRxPduCallback(), ns3::DlTxPduCallback(), m_pdcpStats, m_rlcStats, m_ueManagerPathByCellIdRnti, ns3::MakeBoundCallback(), NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::UlRxPduCallback(), and ns3::UlTxPduCallback().

Referenced by CreatedSrb1Ue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreatedDrbEnb()

void ns3::RadioBearerStatsConnector::CreatedDrbEnb ( RadioBearerStatsConnector c,
std::string  context,
uint64_t  imsi,
uint16_t  cellid,
uint16_t  rnti,
uint8_t  lcid 
)
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.

Parameters
c
context
imsi
cellid
rnti
lcid

Definition at line 217 of file radio-bearer-stats-connector.cc.

References ConnectTracesDrbEnb(), and NS_LOG_FUNCTION.

Referenced by StoreUeManagerPath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreatedDrbUe()

void ns3::RadioBearerStatsConnector::CreatedDrbUe ( RadioBearerStatsConnector c,
std::string  context,
uint64_t  imsi,
uint16_t  cellid,
uint16_t  rnti,
uint8_t  lcid 
)
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.

Parameters
c
context
imsi
cellid
rnti
lcid

Definition at line 240 of file radio-bearer-stats-connector.cc.

References ConnectTracesDrbUe(), and NS_LOG_FUNCTION.

Referenced by EnsureConnected().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreatedSrb1Ue()

void ns3::RadioBearerStatsConnector::CreatedSrb1Ue ( RadioBearerStatsConnector c,
std::string  context,
uint64_t  imsi,
uint16_t  cellid,
uint16_t  rnti 
)
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.

Parameters
c
context
imsi
cellid
rnti

Definition at line 229 of file radio-bearer-stats-connector.cc.

References ConnectTracesSrb1(), and NS_LOG_FUNCTION.

Referenced by EnsureConnected().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DisconnectTracesEnb()

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.

Parameters
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 407 of file radio-bearer-stats-connector.cc.

References NS_LOG_FUNCTION.

◆ DisconnectTracesUe()

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.

Parameters
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 425 of file radio-bearer-stats-connector.cc.

References NS_LOG_FUNCTION.

◆ EnablePdcpStats()

void ns3::RadioBearerStatsConnector::EnablePdcpStats ( Ptr< RadioBearerStatsCalculator pdcpStats)

Enables trace sinks for PDCP layer.

Usually, this function is called by LteHelper::EnablePdcpTraces().

Parameters
pdcpStatsstatistics calculator for PDCP layer

Definition at line 150 of file radio-bearer-stats-connector.cc.

References EnsureConnected(), and m_pdcpStats.

Referenced by ns3::LteHelper::EnablePdcpTraces().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EnableRlcStats()

void ns3::RadioBearerStatsConnector::EnableRlcStats ( Ptr< RadioBearerStatsCalculator rlcStats)

Enables trace sinks for RLC layer.

Usually, this function is called by LteHelper::EnableRlcTraces().

Parameters
rlcStatsstatistics calculator for RLC layer

Definition at line 143 of file radio-bearer-stats-connector.cc.

References EnsureConnected(), and m_rlcStats.

Referenced by ns3::LteHelper::EnableRlcTraces().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EnsureConnected()

void ns3::RadioBearerStatsConnector::EnsureConnected ( )

Connects trace sinks to appropriate trace sources.

Definition at line 157 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NotifyNewUeContextEnb()

void ns3::RadioBearerStatsConnector::NotifyNewUeContextEnb ( RadioBearerStatsConnector c,
std::string  context,
uint16_t  cellid,
uint16_t  rnti 
)
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.

Parameters
c
context
cellid
rnti

Definition at line 196 of file radio-bearer-stats-connector.cc.

References NS_LOG_FUNCTION, and StoreUeManagerPath().

Referenced by EnsureConnected().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NotifyRandomAccessSuccessfulUe()

void ns3::RadioBearerStatsConnector::NotifyRandomAccessSuccessfulUe ( RadioBearerStatsConnector c,
std::string  context,
uint64_t  imsi,
uint16_t  cellid,
uint16_t  rnti 
)
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.

Parameters
c
context
imsi
cellid
rnti

Definition at line 206 of file radio-bearer-stats-connector.cc.

References ConnectTracesSrb0(), and NS_LOG_FUNCTION.

Referenced by EnsureConnected().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StoreUeManagerPath()

void ns3::RadioBearerStatsConnector::StoreUeManagerPath ( std::string  ueManagerPath,
uint16_t  cellId,
uint16_t  rnti 
)
private

Creates UE Manager path and stores it in m_ueManagerPathByCellIdRnti.

Parameters
ueManagerPath
cellId
rnti

Definition at line 180 of file radio-bearer-stats-connector.cc.

References ns3::Config::Connect(), CreatedDrbEnb(), m_ueManagerPathByCellIdRnti, ns3::MakeBoundCallback(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and nlohmann::to_string().

Referenced by NotifyNewUeContextEnb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<

bool operator< ( const CellIdRnti a,
const CellIdRnti b 
)
friend

Less than operator for CellIdRnti, because it is used as key in map.

Parameters
athe lhs operand
bthe rhs operand
Returns
true if less than

Definition at line 36 of file radio-bearer-stats-connector.cc.

Member Data Documentation

◆ m_connected

bool ns3::RadioBearerStatsConnector::m_connected
private

true if traces are connected to sinks, initially set to false

Definition at line 236 of file radio-bearer-stats-connector.h.

Referenced by EnsureConnected().

◆ m_pdcpStats

Ptr<RadioBearerStatsCalculator> ns3::RadioBearerStatsConnector::m_pdcpStats
private

Calculator for PDCP Statistics.

Definition at line 234 of file radio-bearer-stats-connector.h.

Referenced by ConnectTracesDrbEnb(), ConnectTracesDrbUe(), ConnectTracesSrb1(), and EnablePdcpStats().

◆ m_rlcStats

Ptr<RadioBearerStatsCalculator> ns3::RadioBearerStatsConnector::m_rlcStats
private

Calculator for RLC Statistics.

Definition at line 233 of file radio-bearer-stats-connector.h.

Referenced by ConnectTracesDrbEnb(), ConnectTracesDrbUe(), ConnectTracesSrb0(), ConnectTracesSrb1(), and EnableRlcStats().

◆ m_ueManagerPathByCellIdRnti

std::map<CellIdRnti, std::string> ns3::RadioBearerStatsConnector::m_ueManagerPathByCellIdRnti
private

List UE Manager Paths by CellIdRnti.

Definition at line 259 of file radio-bearer-stats-connector.h.

Referenced by ConnectTracesSrb0(), ConnectTracesSrb1(), and StoreUeManagerPath().


The documentation for this class was generated from the following files: