A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
radio-bearer-stats-calculator.cc
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 * Nicola Baldo <nbaldo@cttc.es>
8 */
9
11
12#include "ns3/nstime.h"
13#include "ns3/string.h"
14#include <ns3/log.h>
15
16#include <algorithm>
17#include <vector>
18
19namespace ns3
20{
21
22NS_LOG_COMPONENT_DEFINE("RadioBearerStatsCalculator");
23
24NS_OBJECT_ENSURE_REGISTERED(RadioBearerStatsCalculator);
25
27 : m_firstWrite(true),
28 m_pendingOutput(false),
29 m_protocolType("RLC")
30{
31 NS_LOG_FUNCTION(this);
32}
33
35 : m_firstWrite(true),
36 m_pendingOutput(false)
37{
38 NS_LOG_FUNCTION(this);
39 m_protocolType = protocolType;
40}
41
46
49{
50 static TypeId tid =
51 TypeId("ns3::RadioBearerStatsCalculator")
53 .AddConstructor<RadioBearerStatsCalculator>()
54 .SetGroupName("Lte")
55 .AddAttribute("StartTime",
56 "Start time of the on going epoch.",
57 TimeValue(Seconds(0.)),
61 .AddAttribute("EpochDuration",
62 "Epoch duration.",
63 TimeValue(Seconds(0.25)),
67 .AddAttribute("DlRlcOutputFilename",
68 "Name of the file where the downlink results will be saved.",
69 StringValue("DlRlcStats.txt"),
72 .AddAttribute("UlRlcOutputFilename",
73 "Name of the file where the uplink results will be saved.",
74 StringValue("UlRlcStats.txt"),
77 .AddAttribute("DlPdcpOutputFilename",
78 "Name of the file where the downlink results will be saved.",
79 StringValue("DlPdcpStats.txt"),
82 .AddAttribute("UlPdcpOutputFilename",
83 "Name of the file where the uplink results will be saved.",
84 StringValue("UlPdcpStats.txt"),
87 return tid;
88}
89
90void
99
100void
106
107Time
112
113void
119
120Time
125
126void
128 uint64_t imsi,
129 uint16_t rnti,
130 uint8_t lcid,
132{
133 NS_LOG_FUNCTION(this << "UlTxPDU" << cellId << imsi << rnti << (uint32_t)lcid << packetSize);
134 ImsiLcidPair_t p(imsi, lcid);
136 {
137 m_ulCellId[p] = cellId;
138 m_flowId[p] = LteFlowId_t(rnti, lcid);
139 m_ulTxPackets[p]++;
141 }
142 m_pendingOutput = true;
143}
144
145void
147 uint64_t imsi,
148 uint16_t rnti,
149 uint8_t lcid,
151{
152 NS_LOG_FUNCTION(this << "DlTxPDU" << cellId << imsi << rnti << (uint32_t)lcid << packetSize);
153 ImsiLcidPair_t p(imsi, lcid);
155 {
156 m_dlCellId[p] = cellId;
157 m_flowId[p] = LteFlowId_t(rnti, lcid);
158 m_dlTxPackets[p]++;
160 }
161 m_pendingOutput = true;
162}
163
164void
166 uint64_t imsi,
167 uint16_t rnti,
168 uint8_t lcid,
170 uint64_t delay)
171{
172 NS_LOG_FUNCTION(this << "UlRxPDU" << cellId << imsi << rnti << (uint32_t)lcid << packetSize
173 << delay);
174 ImsiLcidPair_t p(imsi, lcid);
176 {
177 m_ulCellId[p] = cellId;
178 m_ulRxPackets[p]++;
180
181 auto it = m_ulDelay.find(p);
182 if (it == m_ulDelay.end())
183 {
184 NS_LOG_DEBUG(this << " Creating UL stats calculators for IMSI " << p.m_imsi
185 << " and LCID " << (uint32_t)p.m_lcId);
188 }
189 m_ulDelay[p]->Update(delay);
190 m_ulPduSize[p]->Update(packetSize);
191 }
192 m_pendingOutput = true;
193}
194
195void
197 uint64_t imsi,
198 uint16_t rnti,
199 uint8_t lcid,
201 uint64_t delay)
202{
203 NS_LOG_FUNCTION(this << "DlRxPDU" << cellId << imsi << rnti << (uint32_t)lcid << packetSize
204 << delay);
205 ImsiLcidPair_t p(imsi, lcid);
207 {
208 m_dlCellId[p] = cellId;
209 m_dlRxPackets[p]++;
211
212 auto it = m_dlDelay.find(p);
213 if (it == m_dlDelay.end())
214 {
215 NS_LOG_DEBUG(this << " Creating DL stats calculators for IMSI " << p.m_imsi
216 << " and LCID " << (uint32_t)p.m_lcId);
219 }
220 m_dlDelay[p]->Update(delay);
221 m_dlPduSize[p]->Update(packetSize);
222 }
223 m_pendingOutput = true;
224}
225
226void
228{
230 NS_LOG_INFO("Write Rlc Stats in " << GetUlOutputFilename() << " and in "
232
233 std::ofstream ulOutFile;
234 std::ofstream dlOutFile;
235
236 if (m_firstWrite)
237 {
238 ulOutFile.open(GetUlOutputFilename());
239 if (!ulOutFile.is_open())
240 {
241 NS_LOG_ERROR("Can't open file " << GetUlOutputFilename());
242 return;
243 }
244
245 dlOutFile.open(GetDlOutputFilename());
246 if (!dlOutFile.is_open())
247 {
248 NS_LOG_ERROR("Can't open file " << GetDlOutputFilename());
249 return;
250 }
251 m_firstWrite = false;
252 ulOutFile << "% start\tend\tCellId\tIMSI\tRNTI\tLCID\tnTxPDUs\tTxBytes\tnRxPDUs\tRxBytes\t";
253 ulOutFile << "delay\tstdDev\tmin\tmax\t";
254 ulOutFile << "PduSize\tstdDev\tmin\tmax";
255 ulOutFile << std::endl;
256 dlOutFile << "% start\tend\tCellId\tIMSI\tRNTI\tLCID\tnTxPDUs\tTxBytes\tnRxPDUs\tRxBytes\t";
257 dlOutFile << "delay\tstdDev\tmin\tmax\t";
258 dlOutFile << "PduSize\tstdDev\tmin\tmax";
259 dlOutFile << std::endl;
260 }
261 else
262 {
263 ulOutFile.open(GetUlOutputFilename(), std::ios_base::app);
264 if (!ulOutFile.is_open())
265 {
266 NS_LOG_ERROR("Can't open file " << GetUlOutputFilename());
267 return;
268 }
269
270 dlOutFile.open(GetDlOutputFilename(), std::ios_base::app);
271 if (!dlOutFile.is_open())
272 {
273 NS_LOG_ERROR("Can't open file " << GetDlOutputFilename());
274 return;
275 }
276 }
277
278 WriteUlResults(ulOutFile);
279 WriteDlResults(dlOutFile);
280 m_pendingOutput = false;
281}
282
283void
285{
286 NS_LOG_FUNCTION(this);
287
288 // Get the unique IMSI/LCID pairs list
289 std::vector<ImsiLcidPair_t> pairVector;
290 for (auto it = m_ulTxPackets.begin(); it != m_ulTxPackets.end(); ++it)
291 {
292 if (find(pairVector.begin(), pairVector.end(), (*it).first) == pairVector.end())
293 {
294 pairVector.push_back((*it).first);
295 }
296 }
297
298 for (auto it = m_ulRxPackets.begin(); it != m_ulRxPackets.end(); ++it)
299 {
300 if (find(pairVector.begin(), pairVector.end(), (*it).first) == pairVector.end())
301 {
302 pairVector.push_back((*it).first);
303 }
304 }
305
306 Time endTime = m_startTime + m_epochDuration;
307 for (auto it = pairVector.begin(); it != pairVector.end(); ++it)
308 {
309 ImsiLcidPair_t p = *it;
310 auto flowIdIt = m_flowId.find(p);
311 NS_ASSERT_MSG(flowIdIt != m_flowId.end(),
312 "FlowId (imsi " << p.m_imsi << " lcid " << (uint32_t)p.m_lcId
313 << ") is missing");
314 LteFlowId_t flowId = flowIdIt->second;
315 NS_ASSERT_MSG(flowId.m_lcId == p.m_lcId, "lcid mismatch");
316
317 outFile << m_startTime.GetSeconds() << "\t";
318 outFile << endTime.GetSeconds() << "\t";
319 outFile << GetUlCellId(p.m_imsi, p.m_lcId) << "\t";
320 outFile << p.m_imsi << "\t";
321 outFile << flowId.m_rnti << "\t";
322 outFile << (uint32_t)flowId.m_lcId << "\t";
323 outFile << GetUlTxPackets(p.m_imsi, p.m_lcId) << "\t";
324 outFile << GetUlTxData(p.m_imsi, p.m_lcId) << "\t";
325 outFile << GetUlRxPackets(p.m_imsi, p.m_lcId) << "\t";
326 outFile << GetUlRxData(p.m_imsi, p.m_lcId) << "\t";
327 std::vector<double> stats = GetUlDelayStats(p.m_imsi, p.m_lcId);
328 for (auto it = stats.begin(); it != stats.end(); ++it)
329 {
330 outFile << (*it) * 1e-9 << "\t";
331 }
332 stats = GetUlPduSizeStats(p.m_imsi, p.m_lcId);
333 for (auto it = stats.begin(); it != stats.end(); ++it)
334 {
335 outFile << (*it) << "\t";
336 }
337 outFile << std::endl;
338 }
339
340 outFile.close();
341}
342
343void
345{
346 NS_LOG_FUNCTION(this);
347
348 // Get the unique IMSI/LCID pairs list
349 std::vector<ImsiLcidPair_t> pairVector;
350 for (auto it = m_dlTxPackets.begin(); it != m_dlTxPackets.end(); ++it)
351 {
352 if (find(pairVector.begin(), pairVector.end(), (*it).first) == pairVector.end())
353 {
354 pairVector.push_back((*it).first);
355 }
356 }
357
358 for (auto it = m_dlRxPackets.begin(); it != m_dlRxPackets.end(); ++it)
359 {
360 if (find(pairVector.begin(), pairVector.end(), (*it).first) == pairVector.end())
361 {
362 pairVector.push_back((*it).first);
363 }
364 }
365
366 Time endTime = m_startTime + m_epochDuration;
367 for (auto pair = pairVector.begin(); pair != pairVector.end(); ++pair)
368 {
369 ImsiLcidPair_t p = *pair;
370 auto flowIdIt = m_flowId.find(p);
371 NS_ASSERT_MSG(flowIdIt != m_flowId.end(),
372 "FlowId (imsi " << p.m_imsi << " lcid " << (uint32_t)p.m_lcId
373 << ") is missing");
374 LteFlowId_t flowId = flowIdIt->second;
375 NS_ASSERT_MSG(flowId.m_lcId == p.m_lcId, "lcid mismatch");
376
377 outFile << m_startTime.GetSeconds() << "\t";
378 outFile << endTime.GetSeconds() << "\t";
379 outFile << GetDlCellId(p.m_imsi, p.m_lcId) << "\t";
380 outFile << p.m_imsi << "\t";
381 outFile << flowId.m_rnti << "\t";
382 outFile << (uint32_t)flowId.m_lcId << "\t";
383 outFile << GetDlTxPackets(p.m_imsi, p.m_lcId) << "\t";
384 outFile << GetDlTxData(p.m_imsi, p.m_lcId) << "\t";
385 outFile << GetDlRxPackets(p.m_imsi, p.m_lcId) << "\t";
386 outFile << GetDlRxData(p.m_imsi, p.m_lcId) << "\t";
387 std::vector<double> stats = GetDlDelayStats(p.m_imsi, p.m_lcId);
388 for (auto it = stats.begin(); it != stats.end(); ++it)
389 {
390 outFile << (*it) * 1e-9 << "\t";
391 }
392 stats = GetDlPduSizeStats(p.m_imsi, p.m_lcId);
393 for (auto it = stats.begin(); it != stats.end(); ++it)
394 {
395 outFile << (*it) << "\t";
396 }
397 outFile << std::endl;
398 }
399
400 outFile.close();
401}
402
403void
405{
406 NS_LOG_FUNCTION(this);
407
408 m_ulTxPackets.erase(m_ulTxPackets.begin(), m_ulTxPackets.end());
409 m_ulRxPackets.erase(m_ulRxPackets.begin(), m_ulRxPackets.end());
410 m_ulRxData.erase(m_ulRxData.begin(), m_ulRxData.end());
411 m_ulTxData.erase(m_ulTxData.begin(), m_ulTxData.end());
412 m_ulDelay.erase(m_ulDelay.begin(), m_ulDelay.end());
413 m_ulPduSize.erase(m_ulPduSize.begin(), m_ulPduSize.end());
414
415 m_dlTxPackets.erase(m_dlTxPackets.begin(), m_dlTxPackets.end());
416 m_dlRxPackets.erase(m_dlRxPackets.begin(), m_dlRxPackets.end());
417 m_dlRxData.erase(m_dlRxData.begin(), m_dlRxData.end());
418 m_dlTxData.erase(m_dlTxData.begin(), m_dlTxData.end());
419 m_dlDelay.erase(m_dlDelay.begin(), m_dlDelay.end());
420 m_dlPduSize.erase(m_dlPduSize.begin(), m_dlPduSize.end());
421}
422
423void
433
434void
444
447{
448 NS_LOG_FUNCTION(this << imsi << (uint16_t)lcid);
449 ImsiLcidPair_t p(imsi, lcid);
450 return m_ulTxPackets[p];
451}
452
455{
456 NS_LOG_FUNCTION(this << imsi << (uint16_t)lcid);
457 ImsiLcidPair_t p(imsi, lcid);
458 return m_ulRxPackets[p];
459}
460
461uint64_t
462RadioBearerStatsCalculator::GetUlTxData(uint64_t imsi, uint8_t lcid)
463{
464 NS_LOG_FUNCTION(this << imsi << (uint16_t)lcid);
465 ImsiLcidPair_t p(imsi, lcid);
466 return m_ulTxData[p];
467}
468
469uint64_t
470RadioBearerStatsCalculator::GetUlRxData(uint64_t imsi, uint8_t lcid)
471{
472 NS_LOG_FUNCTION(this << imsi << (uint16_t)lcid);
473 ImsiLcidPair_t p(imsi, lcid);
474 return m_ulRxData[p];
475}
476
477double
478RadioBearerStatsCalculator::GetUlDelay(uint64_t imsi, uint8_t lcid)
479{
480 NS_LOG_FUNCTION(this << imsi << (uint16_t)lcid);
481 ImsiLcidPair_t p(imsi, lcid);
482 auto it = m_ulDelay.find(p);
483 if (it == m_ulDelay.end())
484 {
485 NS_LOG_ERROR("UL delay for " << imsi << " - " << (uint16_t)lcid << " not found");
486 return 0;
487 }
488 return m_ulDelay[p]->getMean();
489}
490
491std::vector<double>
493{
494 NS_LOG_FUNCTION(this << imsi << (uint16_t)lcid);
495 ImsiLcidPair_t p(imsi, lcid);
496 std::vector<double> stats;
497 auto it = m_ulDelay.find(p);
498 if (it == m_ulDelay.end())
499 {
500 stats.push_back(0.0);
501 stats.push_back(0.0);
502 stats.push_back(0.0);
503 stats.push_back(0.0);
504 return stats;
505 }
506 stats.push_back(m_ulDelay[p]->getMean());
507 stats.push_back(m_ulDelay[p]->getStddev());
508 stats.push_back(m_ulDelay[p]->getMin());
509 stats.push_back(m_ulDelay[p]->getMax());
510 return stats;
511}
512
513std::vector<double>
515{
516 NS_LOG_FUNCTION(this << imsi << (uint16_t)lcid);
517 ImsiLcidPair_t p(imsi, lcid);
518 std::vector<double> stats;
519 auto it = m_ulPduSize.find(p);
520 if (it == m_ulPduSize.end())
521 {
522 stats.push_back(0.0);
523 stats.push_back(0.0);
524 stats.push_back(0.0);
525 stats.push_back(0.0);
526 return stats;
527 }
528 stats.push_back(m_ulPduSize[p]->getMean());
529 stats.push_back(m_ulPduSize[p]->getStddev());
530 stats.push_back(m_ulPduSize[p]->getMin());
531 stats.push_back(m_ulPduSize[p]->getMax());
532 return stats;
533}
534
537{
538 NS_LOG_FUNCTION(this << imsi << (uint16_t)lcid);
539 ImsiLcidPair_t p(imsi, lcid);
540 return m_dlTxPackets[p];
541}
542
545{
546 NS_LOG_FUNCTION(this << imsi << (uint16_t)lcid);
547 ImsiLcidPair_t p(imsi, lcid);
548 return m_dlRxPackets[p];
549}
550
551uint64_t
552RadioBearerStatsCalculator::GetDlTxData(uint64_t imsi, uint8_t lcid)
553{
554 NS_LOG_FUNCTION(this << imsi << (uint16_t)lcid);
555 ImsiLcidPair_t p(imsi, lcid);
556 return m_dlTxData[p];
557}
558
559uint64_t
560RadioBearerStatsCalculator::GetDlRxData(uint64_t imsi, uint8_t lcid)
561{
562 NS_LOG_FUNCTION(this << imsi << (uint16_t)lcid);
563 ImsiLcidPair_t p(imsi, lcid);
564 return m_dlRxData[p];
565}
566
568RadioBearerStatsCalculator::GetUlCellId(uint64_t imsi, uint8_t lcid)
569{
570 NS_LOG_FUNCTION(this << imsi << (uint16_t)lcid);
571 ImsiLcidPair_t p(imsi, lcid);
572 return m_ulCellId[p];
573}
574
576RadioBearerStatsCalculator::GetDlCellId(uint64_t imsi, uint8_t lcid)
577{
578 NS_LOG_FUNCTION(this << imsi << (uint16_t)lcid);
579 ImsiLcidPair_t p(imsi, lcid);
580 return m_dlCellId[p];
581}
582
583double
584RadioBearerStatsCalculator::GetDlDelay(uint64_t imsi, uint8_t lcid)
585{
586 NS_LOG_FUNCTION(this << imsi << (uint16_t)lcid);
587 ImsiLcidPair_t p(imsi, lcid);
588 auto it = m_dlDelay.find(p);
589 if (it == m_dlDelay.end())
590 {
591 NS_LOG_ERROR("DL delay for " << imsi << " not found");
592 return 0;
593 }
594 return m_dlDelay[p]->getMean();
595}
596
597std::vector<double>
599{
600 NS_LOG_FUNCTION(this << imsi << (uint16_t)lcid);
601 ImsiLcidPair_t p(imsi, lcid);
602 std::vector<double> stats;
603 auto it = m_dlDelay.find(p);
604 if (it == m_dlDelay.end())
605 {
606 stats.push_back(0.0);
607 stats.push_back(0.0);
608 stats.push_back(0.0);
609 stats.push_back(0.0);
610 return stats;
611 }
612 stats.push_back(m_dlDelay[p]->getMean());
613 stats.push_back(m_dlDelay[p]->getStddev());
614 stats.push_back(m_dlDelay[p]->getMin());
615 stats.push_back(m_dlDelay[p]->getMax());
616 return stats;
617}
618
619std::vector<double>
621{
622 NS_LOG_FUNCTION(this << imsi << (uint16_t)lcid);
623 ImsiLcidPair_t p(imsi, lcid);
624 std::vector<double> stats;
625 auto it = m_dlPduSize.find(p);
626 if (it == m_dlPduSize.end())
627 {
628 stats.push_back(0.0);
629 stats.push_back(0.0);
630 stats.push_back(0.0);
631 stats.push_back(0.0);
632 return stats;
633 }
634 stats.push_back(m_dlPduSize[p]->getMean());
635 stats.push_back(m_dlPduSize[p]->getStddev());
636 stats.push_back(m_dlPduSize[p]->getMin());
637 stats.push_back(m_dlPduSize[p]->getMax());
638 return stats;
639}
640
641std::string
643{
644 if (m_protocolType == "RLC")
645 {
647 }
648 else
649 {
651 }
652}
653
654std::string
656{
657 if (m_protocolType == "RLC")
658 {
660 }
661 else
662 {
664 }
665}
666
667void
669{
670 m_ulPdcpOutputFilename = outputFilename;
671}
672
673std::string
678
679void
681{
682 m_dlPdcpOutputFilename = outputFilename;
683}
684
685std::string
690
691} // namespace ns3
void Cancel()
This method is syntactic sugar for the ns3::Simulator::Cancel method.
Definition event-id.cc:44
Base class for ***StatsCalculator classes.
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.
void SetUlOutputFilename(std::string outputFilename)
Set the name of the file where the uplink statistics will be stored.
std::string GetDlOutputFilename()
Get the name of the file where the downlink statistics will be stored.
Uint32Map m_ulTxPackets
Number of UL TX Packets by (IMSI, LCID) pair.
Uint64StatsMap m_dlDelay
DL delay by (IMSI, LCID) pair.
std::vector< double > GetDlDelayStats(uint64_t imsi, uint8_t lcid)
Gets the downlink RLC to RLC statistics: average, min, max and standard deviation.
std::string m_protocolType
Protocol type, by default RLC.
Uint64Map m_dlRxData
Amount of DL RX Data by (IMSI, LCID) pair.
uint64_t GetDlTxData(uint64_t imsi, uint8_t lcid)
Gets the number of transmitted downlink data bytes.
uint32_t GetUlRxPackets(uint64_t imsi, uint8_t lcid)
Gets the number of received uplink packets.
~RadioBearerStatsCalculator() override
Class destructor.
uint32_t GetDlRxPackets(uint64_t imsi, uint8_t lcid)
Gets the number of received downlink data bytes.
std::vector< double > GetDlPduSizeStats(uint64_t imsi, uint8_t lcid)
Gets the downlink PDU size statistics: average, min, max and standard deviation.
void RescheduleEndEpoch()
Reschedules EndEpoch event.
Uint64StatsMap m_ulDelay
UL delay by (IMSI, LCID) pair.
uint32_t GetUlCellId(uint64_t imsi, uint8_t lcid)
Gets the attached Enb cellId.
Uint64Map m_ulRxData
Amount of UL RX Data by (IMSI, LCID) pair.
void EndEpoch()
Function called in every endEpochEvent.
Time m_startTime
Start time of the on going epoch.
std::vector< double > GetUlPduSizeStats(uint64_t imsi, uint8_t lcid)
Gets the uplink PDU size statistics: average, min, max and standard deviation.
Uint64Map m_ulTxData
Amount of UL TX Data by (IMSI, LCID) pair.
std::string GetUlPdcpOutputFilename()
Get the name of the file where the uplink PDCP statistics will be stored.
void ShowResults()
Called after each epoch to write collected statistics to output files.
uint32_t GetDlTxPackets(uint64_t imsi, uint8_t lcid)
Gets the number of transmitted downlink data bytes.
Uint32StatsMap m_ulPduSize
UL PDU Size by (IMSI, LCID) pair.
EventId m_endEpochEvent
Event id for next end epoch event.
void DoDispose() override
Destructor implementation.
void UlRxPdu(uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay)
Notifies the stats calculator that an uplink reception has occurred.
uint64_t GetUlRxData(uint64_t imsi, uint8_t lcid)
Gets the number of received uplink data bytes.
std::string m_dlPdcpOutputFilename
Name of the file where the downlink PDCP statistics will be saved.
void UlTxPdu(uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize)
Notifies the stats calculator that an uplink transmission has occurred.
uint64_t GetDlRxData(uint64_t imsi, uint8_t lcid)
Gets the number of received downlink data bytes.
Uint32Map m_dlRxPackets
Number of DL RX Packets by (IMSI, LCID) pair.
std::string GetUlOutputFilename()
Get the name of the file where the uplink statistics will be stored.
void DlTxPdu(uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize)
Notifies the stats calculator that an downlink transmission has occurred.
uint64_t GetUlTxData(uint64_t imsi, uint8_t lcid)
Gets the number of transmitted uplink data bytes.
std::string GetDlOutputFilename()
Get the name of the file where the downlink statistics will be stored.
std::string m_ulPdcpOutputFilename
Name of the file where the uplink PDCP statistics will be saved.
void DlRxPdu(uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay)
Notifies the stats calculator that an downlink reception has occurred.
void ResetResults()
Erases collected statistics.
void WriteDlResults(std::ofstream &outFile)
Writes collected statistics to DL output file and closes DL output file.
Uint32StatsMap m_dlPduSize
DL PDU Size by (IMSI, LCID) pair.
Uint32Map m_ulRxPackets
Number of UL RX Packets by (IMSI, LCID) pair.
bool m_firstWrite
true if output files have not been opened yet
std::string GetDlPdcpOutputFilename()
Get the name of the file where the downlink PDCP statistics will be stored.
uint32_t GetDlCellId(uint64_t imsi, uint8_t lcid)
Gets the attached Enb cellId.
double GetDlDelay(uint64_t imsi, uint8_t lcid)
Gets the downlink RLC to RLC delay.
void WriteUlResults(std::ofstream &outFile)
Writes collected statistics to UL output file and closes UL output file.
double GetUlDelay(uint64_t imsi, uint8_t lcid)
Gets the uplink RLC to RLC delay.
void SetUlPdcpOutputFilename(std::string outputFilename)
Set the name of the file where the uplink PDCP statistics will be stored.
Uint32Map m_ulCellId
List of UL CellIds by (IMSI, LCID) pair.
uint32_t GetUlTxPackets(uint64_t imsi, uint8_t lcid)
Gets the number of transmitted uplink packets.
Uint32Map m_dlCellId
List of DL CellIds by (IMSI, LCID) pair.
std::vector< double > GetUlDelayStats(uint64_t imsi, uint8_t lcid)
Gets the uplink RLC to RLC statistics: average, min, max and standard deviation.
Uint32Map m_dlTxPackets
Number of DL TX Packets by (IMSI, LCID) pair.
bool m_pendingOutput
true if any output is pending
static TypeId GetTypeId()
Register this type.
Uint64Map m_dlTxData
Amount of DL TX Data by (IMSI, LCID) pair.
void SetDlPdcpOutputFilename(std::string outputFilename)
Set the name of the file where the downlink PDCP statistics will be stored.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition simulator.h:560
static Time Now()
Return the current simulation virtual time.
Definition simulator.cc:197
Hold variables of type string.
Definition string.h:45
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition nstime.h:392
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition assert.h:55
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition assert.h:75
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition log.h:243
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition log.h:257
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition log.h:264
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1308
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Definition nstime.h:1396
Ptr< const AttributeChecker > MakeStringChecker()
Definition string.cc:19
Ptr< const AttributeAccessor > MakeStringAccessor(T1 a1)
Definition string.h:46
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Definition nstime.h:1416
ImsiLcidPair structure.
Definition lte-common.h:52
uint8_t m_lcId
LCID.
Definition lte-common.h:54
uint64_t m_imsi
IMSI.
Definition lte-common.h:53
LteFlowId structure.
Definition lte-common.h:32
uint8_t m_lcId
LCID.
Definition lte-common.h:34
uint16_t m_rnti
RNTI.
Definition lte-common.h:33
static const uint32_t packetSize
Packet size generated at the AP.