A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
radio-bearer-stats-connector.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2012-2018 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Authors:
18 * Nicola Baldo <nbaldo@cttc.es>
19 * Manuel Requena <manuel.requena@cttc.es>
20 */
21
22#ifndef RADIO_BEARER_STATS_CONNECTOR_H
23#define RADIO_BEARER_STATS_CONNECTOR_H
24
25#include "ns3/config.h"
26#include "ns3/ptr.h"
27#include "ns3/simple-ref-count.h"
28#include "ns3/traced-callback.h"
29
30#include <map>
31
32namespace ns3
33{
34
35class RadioBearerStatsCalculator;
36
49{
50 public:
53
60
67
71 void EnsureConnected();
72
73 // trace sinks, to be used with MakeBoundCallback
74
86 std::string context,
87 uint16_t cellid,
88 uint16_t rnti);
89
101 std::string context,
102 uint64_t imsi,
103 uint16_t cellid,
104 uint16_t rnti);
105
117 std::string context,
118 uint64_t imsi,
119 uint16_t cellid,
120 uint16_t rnti);
121
134 std::string context,
135 uint64_t imsi,
136 uint16_t cellid,
137 uint16_t rnti,
138 uint8_t lcid);
139
152 std::string context,
153 uint64_t imsi,
154 uint16_t cellid,
155 uint16_t rnti,
156 uint8_t lcid);
157
166 void DisconnectTracesEnb(std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
167
176 void DisconnectTracesUe(std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
177
178 private:
185 void StoreUeManagerPath(std::string ueManagerPath, uint16_t cellId, uint16_t rnti);
186
194 void ConnectTracesSrb0(std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti);
195
203 void ConnectTracesSrb1(std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti);
204
213 void ConnectTracesDrbEnb(std::string context,
214 uint64_t imsi,
215 uint16_t cellId,
216 uint16_t rnti,
217 uint8_t lcid);
218
227 void ConnectTracesDrbUe(std::string context,
228 uint64_t imsi,
229 uint16_t cellId,
230 uint16_t rnti,
231 uint8_t lcid);
232
235
237
242 {
243 uint16_t cellId;
244 uint16_t rnti;
245 };
246
254 friend bool operator<(const CellIdRnti& a, const CellIdRnti& b);
255
259 std::map<CellIdRnti, std::string> m_ueManagerPathByCellIdRnti;
260};
261
262} // namespace ns3
263
264#endif // RADIO_BEARER_STATS_CONNECTOR_H
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
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.
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
friend bool operator<(const CellIdRnti &a, const CellIdRnti &b)
Less than operator for CellIdRnti, because it is used as key in map.
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,...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Struct used as key in m_ueManagerPathByCellIdRnti map.