5G-LENA nr-v3.1-69-g2dd513a7
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-bearer-stats-simple.h
1// Copyright (c) 2022 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2//
3// SPDX-License-Identifier: GPL-2.0-only
4
5#ifndef NR_RADIO_BEARER_STATS_SIMPLE_H_
6#define NR_RADIO_BEARER_STATS_SIMPLE_H_
7
8#include "nr-stats-calculator.h"
9
10#include "ns3/basic-data-calculators.h"
11#include "ns3/nr-common.h"
12#include "ns3/object.h"
13#include "ns3/uinteger.h"
14
15#include <fstream>
16#include <string>
17
18namespace ns3
19{
20
21/*
22 * \ingroup helpers
23 *
24 * Defines the minimum set of functions that RLC or PDC stats class should implement.
25 * See also NrBearerStatsSimple and NrBearerStatsSimple.
26 */
27class NrBearerStatsBase : public Object
28{
29 public:
30 // Inherited from ns3::Object
35 static TypeId GetTypeId();
36 void DoDispose() override;
45 virtual void UlTxPdu(uint16_t cellId,
46 uint64_t imsi,
47 uint16_t rnti,
48 uint8_t lcid,
49 uint32_t packetSize) = 0;
59 virtual void UlRxPdu(uint16_t cellId,
60 uint64_t imsi,
61 uint16_t rnti,
62 uint8_t lcid,
63 uint32_t packetSize,
64 uint64_t delay) = 0;
73 virtual void DlTxPdu(uint16_t cellId,
74 uint64_t imsi,
75 uint16_t rnti,
76 uint8_t lcid,
77 uint32_t packetSize) = 0;
87 virtual void DlRxPdu(uint16_t cellId,
88 uint64_t imsi,
89 uint16_t rnti,
90 uint8_t lcid,
91 uint32_t packetSize,
92 uint64_t delay) = 0;
93};
94
107{
108 public:
113
117 NrBearerStatsSimple(std::string protocolType);
118
122 ~NrBearerStatsSimple() override;
123
124 // Inherited from ns3::Object
129 static TypeId GetTypeId();
130 void DoDispose() override;
131
136 std::string GetUlTxOutputFilename();
137
142 std::string GetUlRxOutputFilename();
143
148 std::string GetDlTxOutputFilename();
149
154 std::string GetDlRxOutputFilename();
155
164 void UlTxPdu(uint16_t cellId,
165 uint64_t imsi,
166 uint16_t rnti,
167 uint8_t lcid,
168 uint32_t packetSize) override;
169
179 void UlRxPdu(uint16_t cellId,
180 uint64_t imsi,
181 uint16_t rnti,
182 uint8_t lcid,
183 uint32_t packetSize,
184 uint64_t delay) override;
185
194 void DlTxPdu(uint16_t cellId,
195 uint64_t imsi,
196 uint16_t rnti,
197 uint8_t lcid,
198 uint32_t packetSize) override;
199
209 void DlRxPdu(uint16_t cellId,
210 uint64_t imsi,
211 uint16_t rnti,
212 uint8_t lcid,
213 uint32_t packetSize,
214 uint64_t delay) override;
215
216 private:
220 std::string m_protocolType;
221 std::string m_dlRlcTxOutputFilename;
222 std::string m_dlRlcRxOutputFilename;
223 std::string m_ulRlcTxOutputFilename;
224 std::string m_ulRlcRxOutputFilename;
225 std::string m_dlPdcpTxOutputFilename;
226 std::string m_dlPdcpRxOutputFilename;
227 std::string m_ulPdcpTxOutputFilename;
228 std::string m_ulPdcpRxOutputFilename;
229 std::ofstream m_dlTxOutFile;
230 std::ofstream m_dlRxOutFile;
231 std::ofstream m_ulTxOutFile;
232 std::ofstream m_ulRxOutFile;
233};
234
235} // namespace ns3
236
237#endif /* NR_RADIO_BEARER_STATS_SIMPLE_H_ */
virtual void UlRxPdu(uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay)=0
virtual void DlRxPdu(uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay)=0
virtual void UlTxPdu(uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize)=0
virtual void DlTxPdu(uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize)=0
This class writes RLC or PDC statistics to separate files:
void UlRxPdu(uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay) override
void DlTxPdu(uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize) override
void UlTxPdu(uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize) override
void DlRxPdu(uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay) override