73 arg->stats->DlTxPdu(arg->cellId, arg->imsi, rnti, lcid,
packetSize);
94 arg->stats->DlRxPdu(arg->cellId, arg->imsi, rnti, lcid,
packetSize, delay);
113 arg->stats->UlTxPdu(arg->cellId, arg->imsi, rnti, lcid,
packetSize);
134 arg->stats->UlRxPdu(arg->cellId, arg->imsi, rnti, lcid,
packetSize, delay);
166 "/NodeList/*/DeviceList/*/LteUeRrc/RandomAccessSuccessful",
183 std::string ueManagerPath;
184 ueManagerPath = context.substr(0, context.rfind(
'/')) +
"/UeMap/" +
std::to_string(rnti);
224 NS_LOG_FUNCTION(c << context << imsi << cellId << rnti << (uint16_t)lcid);
247 NS_LOG_FUNCTION(c << context << imsi << cellId << rnti << (uint16_t)lcid);
258 std::string ueRrcPath = context.substr(0, context.rfind(
'/'));
265 std::string ueManagerPath = it->second;
271 arg->cellId = cellId;
289 std::string ueRrcPath = context.substr(0, context.rfind(
'/'));
296 std::string ueManagerPath = it->second;
302 arg->cellId = cellId;
315 arg->cellId = cellId;
335 NS_LOG_FUNCTION(
this << context << imsi << cellId << rnti << (uint16_t)lcid);
336 NS_LOG_LOGIC(
"expected context should match /NodeList/*/DeviceList/*/LteEnbRrc/");
337 std::string basePath;
339 context.substr(0, context.rfind(
'/')) +
"/DataRadioBearerMap/" +
std::to_string(lcid - 2);
345 arg->cellId = cellId;
354 arg->cellId = cellId;
360 if (!foundTxPdcp && !foundRxPdcp)
362 NS_LOG_WARN(
"Unable to connect PDCP traces. This may happen if RlcSm is used");
374 NS_LOG_FUNCTION(
this << context << imsi << cellId << rnti << (uint16_t)lcid);
375 NS_LOG_LOGIC(
"expected context should match /NodeList/*/DeviceList/*/LteUeRrc/");
376 std::string basePath;
378 context.substr(0, context.rfind(
'/')) +
"/DataRadioBearerMap/" +
std::to_string(lcid);
384 arg->cellId = cellId;
393 arg->cellId = cellId;
399 if (!foundTxPdcp && !foundRxPdcp)
401 NS_LOG_WARN(
"Unable to connect PDCP traces. This may happen if RlcSm is used");
Smart pointer class similar to boost::intrusive_ptr.
This class is very useful when user needs to collect statistics from PDCP and RLC.
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 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.
Ptr< RadioBearerStatsCalculator > m_rlcStats
Calculator for RLC Statistics.
void EnablePdcpStats(Ptr< RadioBearerStatsCalculator > pdcpStats)
Enables trace sinks for PDCP layer.
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 comp...
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.
void EnableRlcStats(Ptr< RadioBearerStatsCalculator > rlcStats)
Enables trace sinks for RLC layer.
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 con...
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.
Ptr< RadioBearerStatsCalculator > m_pdcpStats
Calculator for PDCP Statistics.
RadioBearerStatsConnector()
Constructor.
std::map< CellIdRnti, std::string > m_ueManagerPathByCellIdRnti
List UE Manager Paths by CellIdRnti.
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 creat...
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,...
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 EnsureConnected()
Connects trace sinks to appropriate trace sources.
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.
bool m_connected
true if traces are connected to sinks, initially set to false
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,...
A template-based reference counting class.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
void Connect(std::string path, const CallbackBase &cb)
bool ConnectFailSafe(std::string path, const CallbackBase &cb)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
auto MakeBoundCallback(R(*fnPtr)(Args...), BArgs &&... bargs)
Make Callbacks with varying number of bound arguments.
NLOHMANN_BASIC_JSON_TPL_DECLARATION std::string to_string(const NLOHMANN_BASIC_JSON_TPL &j)
user-defined to_string function for JSON values
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void UlRxPduCallback(Ptr< BoundCallbackArgument > arg, std::string path, uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay)
Callback function for UL RX statistics for both RLC and PDCP.
bool operator<(const EventId &a, const EventId &b)
void DlTxPduCallback(Ptr< BoundCallbackArgument > arg, std::string path, uint16_t rnti, uint8_t lcid, uint32_t packetSize)
Callback function for DL TX statistics for both RLC and PDCP.
void DlRxPduCallback(Ptr< BoundCallbackArgument > arg, std::string path, uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay)
Callback function for DL RX statistics for both RLC and PDCP.
void UlTxPduCallback(Ptr< BoundCallbackArgument > arg, std::string path, uint16_t rnti, uint8_t lcid, uint32_t packetSize)
Callback function for UL TX statistics for both RLC and PDCP.
This structure is used as interface between trace sources and RadioBearerStatsCalculator.
Ptr< RadioBearerStatsCalculator > stats
statistics calculator
Struct used as key in m_ueManagerPathByCellIdRnti map.
static const uint32_t packetSize
Packet size generated at the AP.