A Discrete-Event Network Simulator
API
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: Nicola Baldo <nbaldo@cttc.es>
18  * Manuel Requena <manuel.requena@cttc.es>
19  */
20 
21 #ifndef RADIO_BEARER_STATS_CONNECTOR_H
22 #define RADIO_BEARER_STATS_CONNECTOR_H
23 
24 #include "ns3/config.h"
25 #include "ns3/ptr.h"
26 #include "ns3/simple-ref-count.h"
27 #include "ns3/traced-callback.h"
28 
29 #include <map>
30 
31 namespace ns3
32 {
33 
34 class RadioBearerStatsCalculator;
35 
48 {
49  public:
52 
59 
66 
70  void EnsureConnected();
71 
72  // trace sinks, to be used with MakeBoundCallback
73 
85  std::string context,
86  uint16_t cellid,
87  uint16_t rnti);
88 
100  std::string context,
101  uint64_t imsi,
102  uint16_t cellid,
103  uint16_t rnti);
104 
116  std::string context,
117  uint64_t imsi,
118  uint16_t cellid,
119  uint16_t rnti);
120 
133  std::string context,
134  uint64_t imsi,
135  uint16_t cellid,
136  uint16_t rnti,
137  uint8_t lcid);
138 
151  std::string context,
152  uint64_t imsi,
153  uint16_t cellid,
154  uint16_t rnti,
155  uint8_t lcid);
156 
165  void DisconnectTracesEnb(std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
166 
175  void DisconnectTracesUe(std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
176 
177  private:
184  void StoreUeManagerPath(std::string ueManagerPath, uint16_t cellId, uint16_t rnti);
185 
193  void ConnectTracesSrb0(std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti);
194 
202  void ConnectTracesSrb1(std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti);
203 
212  void ConnectTracesDrbEnb(std::string context,
213  uint64_t imsi,
214  uint16_t cellId,
215  uint16_t rnti,
216  uint8_t lcid);
217 
226  void ConnectTracesDrbUe(std::string context,
227  uint64_t imsi,
228  uint16_t cellId,
229  uint16_t rnti,
230  uint8_t lcid);
231 
234 
235  bool m_connected;
236 
240  struct CellIdRnti
241  {
242  uint16_t cellId;
243  uint16_t rnti;
244  };
245 
253  friend bool operator<(const CellIdRnti& a, const CellIdRnti& b);
254 
258  std::map<CellIdRnti, std::string> m_ueManagerPathByCellIdRnti;
259 };
260 
261 } // namespace ns3
262 
263 #endif // RADIO_BEARER_STATS_CONNECTOR_H
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
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.