A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-stats-calculator.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Jaume Nin <jnin@cttc.es>
7 */
8
9#ifndef LTE_STATS_CALCULATOR_H_
10#define LTE_STATS_CALCULATOR_H_
11
12#include "ns3/object.h"
13#include "ns3/string.h"
14
15#include <map>
16
17namespace ns3
18{
19
20/**
21 * @ingroup lte
22 *
23 * Base class for ***StatsCalculator classes. Provides
24 * basic functionality to parse and store IMSI and CellId.
25 * Also stores names of output files.
26 */
27
29{
30 public:
31 /**
32 * Constructor
33 */
35
36 /**
37 * Destructor
38 */
39 ~LteStatsCalculator() override;
40
41 /**
42 * Register this type.
43 * @return The object TypeId.
44 */
45 static TypeId GetTypeId();
46
47 /**
48 * Set the name of the file where the uplink statistics will be stored.
49 *
50 * @param outputFilename string with the name of the file
51 */
52 void SetUlOutputFilename(std::string outputFilename);
53
54 /**
55 * Get the name of the file where the uplink statistics will be stored.
56 * @return the name of the file where the uplink statistics will be stored
57 */
58 std::string GetUlOutputFilename();
59
60 /**
61 * Set the name of the file where the downlink statistics will be stored.
62 *
63 * @param outputFilename string with the name of the file
64 */
65 void SetDlOutputFilename(std::string outputFilename);
66
67 /**
68 * Get the name of the file where the downlink statistics will be stored.
69 * @return the name of the file where the downlink statistics will be stored
70 */
71 std::string GetDlOutputFilename();
72
73 /**
74 * Checks if there is an already stored IMSI for the given path
75 * @param path Path in the attribute system to check
76 * @return true if the path exists, false otherwise
77 */
78 bool ExistsImsiPath(std::string path);
79
80 /**
81 * Stores the (path, imsi) pairs in a map
82 * @param path Path in the attribute system to store
83 * @param imsi IMSI value to store
84 */
85 void SetImsiPath(std::string path, uint64_t imsi);
86
87 /**
88 * Retrieves the imsi information for the given path
89 * @param path Path in the attribute system to get
90 * @return the IMSI associated with the given path
91 */
92 uint64_t GetImsiPath(std::string path);
93
94 /**
95 * Checks if there is an already stored cell id for the given path
96 * @param path Path in the attribute system to check
97 * @return true if the path exists, false otherwise
98 */
99 bool ExistsCellIdPath(std::string path);
100
101 /**
102 * Stores the (path, cellId) pairs in a map
103 * @param path Path in the attribute system to store
104 * @param cellId cell id value to store
105 */
106 void SetCellIdPath(std::string path, uint16_t cellId);
107
108 /**
109 * Retrieves the cell id information for the given path
110 * @param path Path in the attribute system to get
111 * @return the cell ID associated with the given path
112 */
113 uint16_t GetCellIdPath(std::string path);
114
115 protected:
116 /**
117 * Retrieves IMSI from Enb RLC path in the attribute system
118 * @param path Path in the attribute system to get
119 * @return the IMSI associated with the given path
120 */
121 static uint64_t FindImsiFromEnbRlcPath(std::string path);
122
123 /**
124 * Retrieves IMSI from Ue PHY path in the attribute system
125 * @param path Path in the attribute system to get
126 * @return the IMSI associated with the given path
127 */
128 static uint64_t FindImsiFromUePhy(std::string path);
129
130 /**
131 * Retrieves IMSI from LteNetDevice path in the attribute system
132 * @param path Path in the attribute system to get
133 * @return the IMSI associated with the given path
134 */
135 static uint64_t FindImsiFromLteNetDevice(std::string path);
136
137 /**
138 * Retrieves CellId from Enb RLC path in the attribute system
139 * @param path Path in the attribute system to get
140 * @return the CellId associated with the given path
141 */
142 static uint16_t FindCellIdFromEnbRlcPath(std::string path);
143
144 /**
145 * Retrieves IMSI from Enb MAC path in the attribute system
146 * @param path Path in the attribute system to get
147 * @param rnti RNTI of UE for which IMSI is needed
148 * @return the IMSI associated with the given path and RNTI
149 */
150 static uint64_t FindImsiFromEnbMac(std::string path, uint16_t rnti);
151
152 /**
153 * Retrieves CellId from Enb MAC path in the attribute system
154 * @param path Path in the attribute system to get
155 * @param rnti RNTI of UE for which CellId is needed
156 * @return the CellId associated with the given path and RNTI
157 */
158 static uint16_t FindCellIdFromEnbMac(std::string path, uint16_t rnti);
159
160 /**
161 * Retrieves IMSI from path for Enb in the attribute system
162 * @param path Path in the attribute system to get
163 * @param rnti RNTI of UE for which IMSI is needed
164 * @return the IMSI associated with the given path and RNTI
165 */
166 static uint64_t FindImsiForEnb(std::string path, uint16_t rnti);
167
168 /**
169 * Retrieves IMSI from path for Ue in the attribute system
170 * @param path Path in the attribute system to get
171 * @param rnti RNTI of UE for which IMSI is needed
172 * @return the IMSI associated with the given path and RNTI
173 */
174 static uint64_t FindImsiForUe(std::string path, uint16_t rnti);
175
176 private:
177 /**
178 * List of IMSI by path in the attribute system
179 */
180 std::map<std::string, uint64_t> m_pathImsiMap;
181
182 /**
183 * List of CellId by path in the attribute system
184 */
185 std::map<std::string, uint16_t> m_pathCellIdMap;
186
187 /**
188 * Name of the file where the downlink results will be saved
189 */
191
192 /**
193 * Name of the file where the uplink results will be saved
194 */
196};
197
198} // namespace ns3
199
200#endif /* LTE_STATS_CALCULATOR_H_ */
Base class for ***StatsCalculator classes.
void SetImsiPath(std::string path, uint64_t imsi)
Stores the (path, imsi) pairs in a map.
void SetCellIdPath(std::string path, uint16_t cellId)
Stores the (path, cellId) pairs in a map.
bool ExistsCellIdPath(std::string path)
Checks if there is an already stored cell id for the given path.
std::string m_ulOutputFilename
Name of the file where the uplink results will be saved.
std::string GetUlOutputFilename()
Get the name of the file where the uplink statistics will be stored.
void SetDlOutputFilename(std::string outputFilename)
Set the name of the file where the downlink statistics will be stored.
static uint64_t FindImsiFromEnbRlcPath(std::string path)
Retrieves IMSI from Enb RLC path in the attribute system.
static uint64_t FindImsiForUe(std::string path, uint16_t rnti)
Retrieves IMSI from path for Ue in the attribute system.
uint64_t GetImsiPath(std::string path)
Retrieves the imsi information for the given path.
~LteStatsCalculator() override
Destructor.
static uint64_t FindImsiFromUePhy(std::string path)
Retrieves IMSI from Ue PHY path in the attribute system.
std::map< std::string, uint64_t > m_pathImsiMap
List of IMSI by path in the attribute system.
void SetUlOutputFilename(std::string outputFilename)
Set the name of the file where the uplink statistics will be stored.
static TypeId GetTypeId()
Register this type.
std::map< std::string, uint16_t > m_pathCellIdMap
List of CellId by path in the attribute system.
bool ExistsImsiPath(std::string path)
Checks if there is an already stored IMSI for the given path.
static uint16_t FindCellIdFromEnbRlcPath(std::string path)
Retrieves CellId from Enb RLC path in the attribute system.
std::string GetDlOutputFilename()
Get the name of the file where the downlink statistics will be stored.
static uint64_t FindImsiFromLteNetDevice(std::string path)
Retrieves IMSI from LteNetDevice path in the attribute system.
static uint16_t FindCellIdFromEnbMac(std::string path, uint16_t rnti)
Retrieves CellId from Enb MAC path in the attribute system.
uint16_t GetCellIdPath(std::string path)
Retrieves the cell id information for the given path.
std::string m_dlOutputFilename
Name of the file where the downlink results will be saved.
static uint64_t FindImsiFromEnbMac(std::string path, uint16_t rnti)
Retrieves IMSI from Enb MAC path in the attribute system.
static uint64_t FindImsiForEnb(std::string path, uint16_t rnti)
Retrieves IMSI from path for Enb in the attribute system.
A base class which provides memory management and object aggregation.
Definition object.h:78
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.