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. 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< RadioBearerStatsCalculator > | m_pdcpStats |
Calculator for PDCP Statistics. More... | |
Ptr< RadioBearerStatsCalculator > | m_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... | |
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.
ns3::RadioBearerStatsConnector::RadioBearerStatsConnector | ( | ) |
Constructor.
Definition at line 137 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 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().
|
private |
Connects DRB trace sources at UE to RLC and PDCP calculators.
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().
|
private |
Connects SRB0 trace sources at UE and eNB to RLC and PDCP calculators.
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().
|
private |
Connects SRB1 trace sources at UE and eNB to RLC and PDCP calculators.
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().
|
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 217 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 240 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 229 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 407 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 425 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 150 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 143 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 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().
|
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 196 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 206 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 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().
|
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 36 of file radio-bearer-stats-connector.cc.
|
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().
|
private |
Calculator for PDCP Statistics.
Definition at line 234 of file radio-bearer-stats-connector.h.
Referenced by ConnectTracesDrbEnb(), ConnectTracesDrbUe(), ConnectTracesSrb1(), and EnablePdcpStats().
|
private |
Calculator for RLC Statistics.
Definition at line 233 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 259 of file radio-bearer-stats-connector.h.
Referenced by ConnectTracesSrb0(), ConnectTracesSrb1(), and StoreUeManagerPath().