Loading...
Searching...
No Matches
satellite-stats-packet-collision-helper.cc
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2014 Magister Solutions
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Budiarto Herman <budiarto.herman@magister.fi>
19 *
20 */
21
23
24#include "ns3/boolean.h"
25#include "ns3/callback.h"
26#include "ns3/data-collection-object.h"
27#include "ns3/enum.h"
28#include "ns3/interval-rate-collector.h"
29#include "ns3/log.h"
30#include "ns3/mac48-address.h"
31#include "ns3/magister-gnuplot-aggregator.h"
32#include "ns3/multi-file-aggregator.h"
33#include "ns3/node-container.h"
34#include "ns3/object-vector.h"
35#include "ns3/satellite-helper.h"
36#include "ns3/satellite-id-mapper.h"
37#include "ns3/satellite-net-device.h"
38#include "ns3/satellite-orbiter-net-device.h"
39#include "ns3/satellite-phy-rx-carrier.h"
40#include "ns3/satellite-phy-rx.h"
41#include "ns3/satellite-phy.h"
42#include "ns3/satellite-topology.h"
43#include "ns3/scalar-collector.h"
44#include "ns3/singleton.h"
45#include "ns3/string.h"
46
47#include <map>
48#include <sstream>
49#include <string>
50
51NS_LOG_COMPONENT_DEFINE("SatStatsPacketCollisionHelper");
52
53namespace ns3
54{
55
56// BASE CLASS /////////////////////////////////////////////////////////////////
57
58NS_OBJECT_ENSURE_REGISTERED(SatStatsPacketCollisionHelper);
59
61 : SatStatsHelper(satHelper)
62{
63 NS_LOG_FUNCTION(this << satHelper);
64}
65
70
71TypeId // static
73{
74 static TypeId tid = TypeId("ns3::SatStatsPacketCollisionHelper").SetParent<SatStatsHelper>();
75 return tid;
76}
77
78void
80{
81 NS_LOG_FUNCTION(this << traceSourceName);
82 m_traceSourceName = traceSourceName;
83}
84
85std::string
90
91void
93 const Address& from,
94 bool isCollided)
95{
96 NS_LOG_FUNCTION(this << nPackets << from << isCollided);
97
98 if (from.IsInvalid())
99 {
100 NS_LOG_WARN(this << " discarding " << nPackets << " packets"
101 << " from statistics collection because of" << " invalid sender address");
102 }
103 else
104 {
105 // Determine the identifier associated with the sender address.
106 std::map<const Address, uint32_t>::const_iterator it = m_identifierMap.find(from);
107
108 if (it == m_identifierMap.end())
109 {
110 NS_LOG_WARN(this << " discarding " << nPackets << " packets"
111 << " from statistics collection because of"
112 << " unknown sender address " << from);
113 }
114 else
115 {
116 // Find the first-level collector with the right identifier.
117 Ptr<DataCollectionObject> collector = m_terminalCollectors.Get(it->second);
118 NS_ASSERT_MSG(collector != nullptr,
119 "Unable to find collector with identifier " << it->second);
120
121 switch (GetOutputType())
122 {
125 Ptr<ScalarCollector> c = collector->GetObject<ScalarCollector>();
126 NS_ASSERT(c != nullptr);
127 c->TraceSinkBoolean(false, isCollided);
128 break;
129 }
130
133 Ptr<IntervalRateCollector> c = collector->GetObject<IntervalRateCollector>();
134 NS_ASSERT(c != nullptr);
135 c->TraceSinkBoolean(false, isCollided);
136 break;
137 }
138
139 default:
140 NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
141 << " is not a valid output type for this statistics.");
142 break;
143
144 } // end of `switch (GetOutputType ())`
145
146 } // end of else of `if (it == m_identifierMap.end ())`
147
148 } // end of else of `if (from.IsInvalid ())`
149
150} // end of `void CollisionRxCallback (uint32_t, const Address &, bool);`
151
152// BASE CLASS FEEDER /////////////////////////////////////////////////////////////////
153
154NS_OBJECT_ENSURE_REGISTERED(SatStatsFeederPacketCollisionHelper);
155
157 Ptr<const SatHelper> satHelper)
159{
160 NS_LOG_FUNCTION(this << satHelper);
161}
162
167
168TypeId // static
170{
171 static TypeId tid = TypeId("ns3::SatStatsFeederPacketCollisionHelper")
172 .SetParent<SatStatsPacketCollisionHelper>();
173 return tid;
174}
175
176void
178{
179 NS_LOG_FUNCTION(this);
180
181 switch (GetOutputType())
182 {
184 NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
185 << " is not a valid output type for this statistics.");
186 break;
187
189 // Setup aggregator.
190 m_aggregator = CreateAggregator("ns3::MultiFileAggregator",
191 "OutputFileName",
192 StringValue(GetOutputFileName()),
193 "MultiFileMode",
194 BooleanValue(false),
195 "EnableContextPrinting",
196 BooleanValue(true),
197 "GeneralHeading",
198 StringValue(GetIdentifierHeading("collision_rate")));
199
200 // Setup collectors.
201 m_terminalCollectors.SetType("ns3::ScalarCollector");
202 m_terminalCollectors.SetAttribute("InputDataType",
203 EnumValue(ScalarCollector::INPUT_DATA_TYPE_BOOLEAN));
204 m_terminalCollectors.SetAttribute(
205 "OutputType",
206 EnumValue(ScalarCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
208 m_terminalCollectors.ConnectToAggregator("Output",
210 &MultiFileAggregator::Write1d);
211 break;
212 }
213
215 // Setup aggregator.
216 m_aggregator = CreateAggregator("ns3::MultiFileAggregator",
217 "OutputFileName",
218 StringValue(GetOutputFileName()),
219 "GeneralHeading",
220 StringValue(GetTimeHeading("collision_rate")));
221
222 // Setup collectors.
223 m_terminalCollectors.SetType("ns3::IntervalRateCollector");
224 m_terminalCollectors.SetAttribute(
225 "InputDataType",
226 EnumValue(IntervalRateCollector::INPUT_DATA_TYPE_BOOLEAN));
227 m_terminalCollectors.SetAttribute(
228 "OutputType",
229 EnumValue(IntervalRateCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
231 m_terminalCollectors.ConnectToAggregator("OutputWithTime",
233 &MultiFileAggregator::Write2d);
234 m_terminalCollectors.ConnectToAggregator("OutputString",
236 &MultiFileAggregator::AddContextHeading);
237 break;
238 }
239
243 NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
244 << " is not a valid output type for this statistics.");
245 break;
246
249 NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
250 << " is not a valid output type for this statistics.");
251 break;
252
254 // Setup aggregator.
255 m_aggregator = CreateAggregator("ns3::MagisterGnuplotAggregator",
256 "OutputPath",
257 StringValue(GetOutputPath()),
258 "OutputFileName",
259 StringValue(GetName()));
260 Ptr<MagisterGnuplotAggregator> plotAggregator =
261 m_aggregator->GetObject<MagisterGnuplotAggregator>();
262 NS_ASSERT(plotAggregator != nullptr);
263 // plot->SetTitle ("");
264 plotAggregator->SetLegend("Time (in seconds)", "Packet collision rate");
265 plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
266
267 // Setup collectors.
268 m_terminalCollectors.SetType("ns3::IntervalRateCollector");
269 m_terminalCollectors.SetAttribute(
270 "InputDataType",
271 EnumValue(IntervalRateCollector::INPUT_DATA_TYPE_BOOLEAN));
272 m_terminalCollectors.SetAttribute(
273 "OutputType",
274 EnumValue(IntervalRateCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
276 for (CollectorMap::Iterator it = m_terminalCollectors.Begin();
277 it != m_terminalCollectors.End();
278 ++it)
279 {
280 const std::string context = it->second->GetName();
281 plotAggregator->Add2dDataset(context, context);
282 }
283 m_terminalCollectors.ConnectToAggregator("OutputWithTime",
285 &MagisterGnuplotAggregator::Write2d);
286 break;
287 }
288
292 NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
293 << " is not a valid output type for this statistics.");
294 break;
295
296 default:
297 NS_FATAL_ERROR("SatStatsUserPacketCollisionHelper - Invalid output type");
298 break;
299 }
300
301 // Create a map of UT addresses and identifiers.
302 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
303 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
304 {
306 }
307
308 // Connect to trace sources at GW nodes.
309
310 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
311 Callback<void, uint32_t, const Address&, bool> callback =
313
314 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
315 {
316 NetDeviceContainer devs = GetGwSatNetDevice(*it);
317
318 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
319 {
320 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
321 NS_ASSERT(satDev != nullptr);
322 Ptr<SatPhy> satPhy = satDev->GetPhy();
323 NS_ASSERT(satPhy != nullptr);
324 Ptr<SatPhyRx> satPhyRx = satPhy->GetPhyRx();
325 NS_ASSERT(satPhyRx != nullptr);
326 ObjectVectorValue carriers;
327 satPhyRx->GetAttribute("RxCarrierList", carriers);
328 NS_LOG_DEBUG(this << " Node ID " << (*it)->GetId() << " device #"
329 << (*itDev)->GetIfIndex() << " has " << carriers.GetN()
330 << " RX carriers");
331
332 for (ObjectVectorValue::Iterator itCarrier = carriers.Begin();
333 itCarrier != carriers.End();
334 ++itCarrier)
335 {
337 DynamicCast<SatPhyRxCarrier>(itCarrier->second)->GetCarrierType();
338 if (ct != GetValidCarrierType())
339 {
340 continue;
341 }
342
343 const bool ret =
344 itCarrier->second->TraceConnectWithoutContext(GetTraceSourceName(), callback);
345 if (ret)
346 {
347 NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
348 << " device #" << (*itDev)->GetIfIndex() << " RX carrier #"
349 << itCarrier->first);
350 }
351 else
352 {
353 NS_FATAL_ERROR("Error connecting to "
354 << GetTraceSourceName() << " trace source"
355 << " of SatPhyRxCarrier" << " at node ID " << (*it)->GetId()
356 << " device #" << (*itDev)->GetIfIndex() << " RX carrier #"
357 << itCarrier->first);
358 }
359
360 } // end of `for (ObjectVectorValue::Iterator itCarrier = carriers)`
361
362 } // end of `for (NetDeviceContainer::Iterator itDev = devs)`
363
364 } // end of `for (NodeContainer::Iterator it = gws)`
365
366} // end of `void DoInstall ();`
367
368// BASE CLASS USER /////////////////////////////////////////////////////////////////
369
370NS_OBJECT_ENSURE_REGISTERED(SatStatsUserPacketCollisionHelper);
371
374{
375 NS_LOG_FUNCTION(this << satHelper);
376}
377
382
383TypeId // static
385{
386 static TypeId tid =
387 TypeId("ns3::SatStatsUserPacketCollisionHelper").SetParent<SatStatsPacketCollisionHelper>();
388 return tid;
389}
390
391void
393{
394 NS_LOG_FUNCTION(this);
395
396 switch (GetOutputType())
397 {
399 NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
400 << " is not a valid output type for this statistics.");
401 break;
402
404 // Setup aggregator.
405 m_aggregator = CreateAggregator("ns3::MultiFileAggregator",
406 "OutputFileName",
407 StringValue(GetOutputFileName()),
408 "MultiFileMode",
409 BooleanValue(false),
410 "EnableContextPrinting",
411 BooleanValue(true),
412 "GeneralHeading",
413 StringValue(GetIdentifierHeading("collision_rate")));
414
415 // Setup collectors.
416 m_terminalCollectors.SetType("ns3::ScalarCollector");
417 m_terminalCollectors.SetAttribute("InputDataType",
418 EnumValue(ScalarCollector::INPUT_DATA_TYPE_BOOLEAN));
419 m_terminalCollectors.SetAttribute(
420 "OutputType",
421 EnumValue(ScalarCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
423 m_terminalCollectors.ConnectToAggregator("Output",
425 &MultiFileAggregator::Write1d);
426 break;
427 }
428
430 // Setup aggregator.
431 m_aggregator = CreateAggregator("ns3::MultiFileAggregator",
432 "OutputFileName",
433 StringValue(GetOutputFileName()),
434 "GeneralHeading",
435 StringValue(GetTimeHeading("collision_rate")));
436
437 // Setup collectors.
438 m_terminalCollectors.SetType("ns3::IntervalRateCollector");
439 m_terminalCollectors.SetAttribute(
440 "InputDataType",
441 EnumValue(IntervalRateCollector::INPUT_DATA_TYPE_BOOLEAN));
442 m_terminalCollectors.SetAttribute(
443 "OutputType",
444 EnumValue(IntervalRateCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
446 m_terminalCollectors.ConnectToAggregator("OutputWithTime",
448 &MultiFileAggregator::Write2d);
449 m_terminalCollectors.ConnectToAggregator("OutputString",
451 &MultiFileAggregator::AddContextHeading);
452 break;
453 }
454
458 NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
459 << " is not a valid output type for this statistics.");
460 break;
461
464 NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
465 << " is not a valid output type for this statistics.");
466 break;
467
469 // Setup aggregator.
470 m_aggregator = CreateAggregator("ns3::MagisterGnuplotAggregator",
471 "OutputPath",
472 StringValue(GetOutputPath()),
473 "OutputFileName",
474 StringValue(GetName()));
475 Ptr<MagisterGnuplotAggregator> plotAggregator =
476 m_aggregator->GetObject<MagisterGnuplotAggregator>();
477 NS_ASSERT(plotAggregator != nullptr);
478 // plot->SetTitle ("");
479 plotAggregator->SetLegend("Time (in seconds)", "Packet collision rate");
480 plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
481
482 // Setup collectors.
483 m_terminalCollectors.SetType("ns3::IntervalRateCollector");
484 m_terminalCollectors.SetAttribute(
485 "InputDataType",
486 EnumValue(IntervalRateCollector::INPUT_DATA_TYPE_BOOLEAN));
487 m_terminalCollectors.SetAttribute(
488 "OutputType",
489 EnumValue(IntervalRateCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
491 for (CollectorMap::Iterator it = m_terminalCollectors.Begin();
492 it != m_terminalCollectors.End();
493 ++it)
494 {
495 const std::string context = it->second->GetName();
496 plotAggregator->Add2dDataset(context, context);
497 }
498 m_terminalCollectors.ConnectToAggregator("OutputWithTime",
500 &MagisterGnuplotAggregator::Write2d);
501 break;
502 }
503
507 NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
508 << " is not a valid output type for this statistics.");
509 break;
510
511 default:
512 NS_FATAL_ERROR("SatStatsFeederPacketCollisionHelper - Invalid output type");
513 break;
514 }
515
516 // Create a map of UT addresses and identifiers.
517 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
518 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
519 {
521 }
522
523 // Connect to trace sources at SAT nodes.
524
525 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
526 Callback<void, uint32_t, const Address&, bool> callback =
528
529 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
530 {
531 Ptr<NetDevice> dev = GetSatSatOrbiterNetDevice(*it);
532
533 Ptr<SatPhy> satPhy;
534 Ptr<SatOrbiterNetDevice> satOrbiterDev = dev->GetObject<SatOrbiterNetDevice>();
535 NS_ASSERT(satOrbiterDev != nullptr);
536 std::map<uint32_t, Ptr<SatPhy>> satOrbiterUserPhys = satOrbiterDev->GetUserPhy();
537 for (std::map<uint32_t, Ptr<SatPhy>>::iterator itPhy = satOrbiterUserPhys.begin();
538 itPhy != satOrbiterUserPhys.end();
539 ++itPhy)
540 {
541 satPhy = itPhy->second;
542 NS_ASSERT(satPhy != nullptr);
543 Ptr<SatPhyRx> satPhyRx = satPhy->GetPhyRx();
544 NS_ASSERT(satPhyRx != nullptr);
545
546 ObjectVectorValue carriers;
547 satPhyRx->GetAttribute("RxCarrierList", carriers);
548 NS_LOG_DEBUG(this << " Node ID " << (*it)->GetId() << " device #" << dev->GetIfIndex()
549 << " has " << carriers.GetN() << " RX carriers");
550
551 for (ObjectVectorValue::Iterator itCarrier = carriers.Begin();
552 itCarrier != carriers.End();
553 ++itCarrier)
554 {
556 DynamicCast<SatPhyRxCarrier>(itCarrier->second)->GetCarrierType();
557 if (ct != GetValidCarrierType())
558 {
559 continue;
560 }
561
562 const bool ret =
563 itCarrier->second->TraceConnectWithoutContext(GetTraceSourceName(), callback);
564 if (ret)
565 {
566 NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
567 << " device #" << dev->GetIfIndex() << " RX carrier #"
568 << itCarrier->first);
569 }
570 else
571 {
572 NS_FATAL_ERROR("Error connecting to " << GetTraceSourceName() << " trace source"
573 << " of SatPhyRxCarrier" << " at node ID "
574 << (*it)->GetId() << " device #"
575 << dev->GetIfIndex() << " RX carrier #"
576 << itCarrier->first);
577 }
578
579 } // end of `for (ObjectVectorValue::Iterator itCarrier = carriers)`
580
581 } // end of `for (std::map<uint32_t, Ptr<SatPhy>>::iterator itPhy = satOrbiterUserPhys)`
582
583 } // end of `for (NodeContainer::Iterator it = sats)`
584
585} // end of `void DoInstall ();`
586
587// SLOTTED ALOHA FEEDER //////////////////////////////////////////////////////////////
588
589NS_OBJECT_ENSURE_REGISTERED(SatStatsFeederSlottedAlohaPacketCollisionHelper);
590
592 Ptr<const SatHelper> satHelper)
594{
595 NS_LOG_FUNCTION(this << satHelper);
596 SetTraceSourceName("SlottedAlohaRxCollision");
598}
599
604
605TypeId // static
607{
608 static TypeId tid = TypeId("ns3::SatStatsFeederSlottedAlohaPacketCollisionHelper")
610 return tid;
611}
612
613// CRDSA FEEDER //////////////////////////////////////////////////////////////////////
614
615NS_OBJECT_ENSURE_REGISTERED(SatStatsFeederCrdsaPacketCollisionHelper);
616
618 Ptr<const SatHelper> satHelper)
620{
621 NS_LOG_FUNCTION(this << satHelper);
622 SetTraceSourceName("CrdsaReplicaRx");
624}
625
630
631TypeId // static
633{
634 static TypeId tid = TypeId("ns3::SatStatsFeederCrdsaPacketCollisionHelper")
636 return tid;
637}
638
639// E-SSA FEEDER //////////////////////////////////////////////////////////////
640
641NS_OBJECT_ENSURE_REGISTERED(SatStatsFeederEssaPacketCollisionHelper);
642
644 Ptr<const SatHelper> satHelper)
646{
647 NS_LOG_FUNCTION(this << satHelper);
648 SetTraceSourceName("EssaRxCollision");
650}
651
656
657TypeId // static
659{
660 static TypeId tid = TypeId("ns3::SatStatsFeederEssaPacketCollisionHelper")
662 return tid;
663}
664
665// SLOTTED ALOHA USER //////////////////////////////////////////////////////////////
666
667NS_OBJECT_ENSURE_REGISTERED(SatStatsUserSlottedAlohaPacketCollisionHelper);
668
670 Ptr<const SatHelper> satHelper)
672{
673 NS_LOG_FUNCTION(this << satHelper);
674 SetTraceSourceName("SlottedAlohaRxCollision");
676}
677
682
683TypeId // static
685{
686 static TypeId tid = TypeId("ns3::SatStatsUserSlottedAlohaPacketCollisionHelper")
688 return tid;
689}
690
691// CRDSA USER //////////////////////////////////////////////////////////////////////
692
693NS_OBJECT_ENSURE_REGISTERED(SatStatsUserCrdsaPacketCollisionHelper);
694
696 Ptr<const SatHelper> satHelper)
698{
699 NS_LOG_FUNCTION(this << satHelper);
700 SetTraceSourceName("CrdsaReplicaRx");
702}
703
708
709TypeId // static
711{
712 static TypeId tid = TypeId("ns3::SatStatsUserCrdsaPacketCollisionHelper")
714 return tid;
715}
716
717// E-SSA USER //////////////////////////////////////////////////////////////
718
719NS_OBJECT_ENSURE_REGISTERED(SatStatsUserEssaPacketCollisionHelper);
720
722 Ptr<const SatHelper> satHelper)
724{
725 NS_LOG_FUNCTION(this << satHelper);
726 SetTraceSourceName("EssaRxCollision");
728}
729
734
735TypeId // static
737{
738 static TypeId tid = TypeId("ns3::SatStatsUserEssaPacketCollisionHelper")
740 return tid;
741}
742
743} // end of namespace ns3
SatNetDevice to be utilized in the UT and GW nodes.
SatOrbiterNetDevice to be utilized in geostationary satellite.
CarrierType
Possible carrier types.
Produce packet collision statistics of Random Access CRDSA from a satellite module simulation.
static TypeId GetTypeId()
inherited from ObjectBase base class
Produce packet collision statistics of Random Access E-SSA from a satellite module simulation.
static TypeId GetTypeId()
inherited from ObjectBase base class
Ptr< DataCollectionObject > m_aggregator
The aggregator created by this helper.
static TypeId GetTypeId()
inherited from ObjectBase base class
void DoInstall()
Install the probes, collectors, and aggregators necessary to produce the statistics output.
Produce packet collision statistics of Random Access Slotted ALOHA from a satellite module simulation...
static Ptr< NetDevice > GetSatSatOrbiterNetDevice(Ptr< Node > satNode)
static NetDeviceContainer GetGwSatNetDevice(Ptr< Node > gwNode)
virtual void SaveAddressAndIdentifier(Ptr< Node > utNode)
Save the address and the proper identifier from the given UT node.
static std::string GetOutputTypeName(OutputType_t outputType)
SatStatsHelper(Ptr< const SatHelper > satHelper)
Creates a new helper instance.
virtual std::string GetIdentifierHeading(std::string dataLabel) const
virtual std::string GetOutputPath() const
Ptr< DataCollectionObject > CreateAggregator(std::string aggregatorTypeId, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue())
Create the aggregator according to the output type.
virtual std::string GetOutputFileName() const
Compute the path and file name where statistics output should be written to.
uint32_t CreateCollectorPerIdentifier(CollectorMap &collectorMap) const
Create one collector instance for each identifier in the simulation.
OutputType_t GetOutputType() const
std::map< const Address, uint32_t > m_identifierMap
Map of address and the identifier associated with it.
std::string GetName() const
virtual std::string GetTimeHeading(std::string dataLabel) const
void CollisionRxCallback(uint32_t nPackets, const Address &from, bool isCollided)
Receive inputs from trace sources and determine the right collector to forward the inputs to.
void SetValidCarrierType(SatPhyRxCarrier::CarrierType carrierType)
Set valid carrier type for this statistics helper type.
SatStatsPacketCollisionHelper(Ptr< const SatHelper > satHelper)
SatPhyRxCarrier::CarrierType GetValidCarrierType() const
Get the valid carrier type.
CollectorMap m_terminalCollectors
Maintains a list of collectors created by this helper.
static TypeId GetTypeId()
inherited from ObjectBase base class
Produce packet collision statistics of Random Access CRDSA from a satellite module simulation.
static TypeId GetTypeId()
inherited from ObjectBase base class
Produce packet collision statistics of Random Access E-SSA from a satellite module simulation.
static TypeId GetTypeId()
inherited from ObjectBase base class
void DoInstall()
Install the probes, collectors, and aggregators necessary to produce the statistics output.
Ptr< DataCollectionObject > m_aggregator
The aggregator created by this helper.
static TypeId GetTypeId()
inherited from ObjectBase base class
Produce packet collision statistics of Random Access Slotted ALOHA from a satellite module simulation...
static TypeId GetTypeId()
inherited from ObjectBase base class
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.