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