A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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.
 
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< RadioBearerStatsCalculatorm_pdcpStats
 Calculator for PDCP Statistics.
 
Ptr< RadioBearerStatsCalculatorm_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.
 

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

Constructor & Destructor Documentation

◆ RadioBearerStatsConnector()

ns3::RadioBearerStatsConnector::RadioBearerStatsConnector ( )

Constructor.

Definition at line 136 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 328 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, 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 367 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, 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 251 of file radio-bearer-stats-connector.cc.

References ns3::RadioBearerStatsConnector::CellIdRnti::cellId, ns3::Config::Connect(), 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().

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

References ns3::RadioBearerStatsConnector::CellIdRnti::cellId, ns3::Config::Connect(), 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().

+ 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 216 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 239 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 228 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 406 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 424 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 149 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 142 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 156 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 195 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 205 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 179 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().

+ 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 35 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 235 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 233 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 232 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 258 of file radio-bearer-stats-connector.h.

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


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