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 
51 NS_LOG_COMPONENT_DEFINE("SatStatsPacketCollisionHelper");
52 
53 namespace ns3
54 {
55 
56 // BASE CLASS /////////////////////////////////////////////////////////////////
57 
58 NS_OBJECT_ENSURE_REGISTERED(SatStatsPacketCollisionHelper);
59 
61  : SatStatsHelper(satHelper)
62 {
63  NS_LOG_FUNCTION(this << satHelper);
64 }
65 
67 {
68  NS_LOG_FUNCTION(this);
69 }
70 
71 TypeId // static
73 {
74  static TypeId tid = TypeId("ns3::SatStatsPacketCollisionHelper").SetParent<SatStatsHelper>();
75  return tid;
76 }
77 
78 void
80 {
81  NS_LOG_FUNCTION(this << traceSourceName);
82  m_traceSourceName = traceSourceName;
83 }
84 
85 std::string
87 {
88  return m_traceSourceName;
89 }
90 
91 void
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"
102  << " invalid sender address");
103  }
104  else
105  {
106  // Determine the identifier associated with the sender address.
107  std::map<const Address, uint32_t>::const_iterator it = m_identifierMap.find(from);
108 
109  if (it == m_identifierMap.end())
110  {
111  NS_LOG_WARN(this << " discarding " << nPackets << " packets"
112  << " from statistics collection because of"
113  << " unknown sender address " << from);
114  }
115  else
116  {
117  // Find the first-level collector with the right identifier.
118  Ptr<DataCollectionObject> collector = m_terminalCollectors.Get(it->second);
119  NS_ASSERT_MSG(collector != nullptr,
120  "Unable to find collector with identifier " << it->second);
121 
122  switch (GetOutputType())
123  {
126  Ptr<ScalarCollector> c = collector->GetObject<ScalarCollector>();
127  NS_ASSERT(c != nullptr);
128  c->TraceSinkBoolean(false, isCollided);
129  break;
130  }
131 
134  Ptr<IntervalRateCollector> c = collector->GetObject<IntervalRateCollector>();
135  NS_ASSERT(c != nullptr);
136  c->TraceSinkBoolean(false, isCollided);
137  break;
138  }
139 
140  default:
141  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
142  << " is not a valid output type for this statistics.");
143  break;
144 
145  } // end of `switch (GetOutputType ())`
146 
147  } // end of else of `if (it == m_identifierMap.end ())`
148 
149  } // end of else of `if (from.IsInvalid ())`
150 
151 } // end of `void CollisionRxCallback (uint32_t, const Address &, bool);`
152 
153 // BASE CLASS FEEDER /////////////////////////////////////////////////////////////////
154 
155 NS_OBJECT_ENSURE_REGISTERED(SatStatsFeederPacketCollisionHelper);
156 
158  Ptr<const SatHelper> satHelper)
159  : SatStatsPacketCollisionHelper(satHelper)
160 {
161  NS_LOG_FUNCTION(this << satHelper);
162 }
163 
165 {
166  NS_LOG_FUNCTION(this);
167 }
168 
169 TypeId // static
171 {
172  static TypeId tid = TypeId("ns3::SatStatsFeederPacketCollisionHelper")
173  .SetParent<SatStatsPacketCollisionHelper>();
174  return tid;
175 }
176 
177 void
179 {
180  NS_LOG_FUNCTION(this);
181 
182  switch (GetOutputType())
183  {
185  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
186  << " is not a valid output type for this statistics.");
187  break;
188 
190  // Setup aggregator.
191  m_aggregator = CreateAggregator("ns3::MultiFileAggregator",
192  "OutputFileName",
193  StringValue(GetOutputFileName()),
194  "MultiFileMode",
195  BooleanValue(false),
196  "EnableContextPrinting",
197  BooleanValue(true),
198  "GeneralHeading",
199  StringValue(GetIdentifierHeading("collision_rate")));
200 
201  // Setup collectors.
202  m_terminalCollectors.SetType("ns3::ScalarCollector");
203  m_terminalCollectors.SetAttribute("InputDataType",
204  EnumValue(ScalarCollector::INPUT_DATA_TYPE_BOOLEAN));
205  m_terminalCollectors.SetAttribute(
206  "OutputType",
207  EnumValue(ScalarCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
209  m_terminalCollectors.ConnectToAggregator("Output",
210  m_aggregator,
211  &MultiFileAggregator::Write1d);
212  break;
213  }
214 
216  // Setup aggregator.
217  m_aggregator = CreateAggregator("ns3::MultiFileAggregator",
218  "OutputFileName",
219  StringValue(GetOutputFileName()),
220  "GeneralHeading",
221  StringValue(GetTimeHeading("collision_rate")));
222 
223  // Setup collectors.
224  m_terminalCollectors.SetType("ns3::IntervalRateCollector");
225  m_terminalCollectors.SetAttribute(
226  "InputDataType",
227  EnumValue(IntervalRateCollector::INPUT_DATA_TYPE_BOOLEAN));
228  m_terminalCollectors.SetAttribute(
229  "OutputType",
230  EnumValue(IntervalRateCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
232  m_terminalCollectors.ConnectToAggregator("OutputWithTime",
233  m_aggregator,
234  &MultiFileAggregator::Write2d);
235  m_terminalCollectors.ConnectToAggregator("OutputString",
236  m_aggregator,
237  &MultiFileAggregator::AddContextHeading);
238  break;
239  }
240 
244  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
245  << " is not a valid output type for this statistics.");
246  break;
247 
250  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
251  << " is not a valid output type for this statistics.");
252  break;
253 
255  // Setup aggregator.
256  m_aggregator = CreateAggregator("ns3::MagisterGnuplotAggregator",
257  "OutputPath",
258  StringValue(GetOutputPath()),
259  "OutputFileName",
260  StringValue(GetName()));
261  Ptr<MagisterGnuplotAggregator> plotAggregator =
262  m_aggregator->GetObject<MagisterGnuplotAggregator>();
263  NS_ASSERT(plotAggregator != nullptr);
264  // plot->SetTitle ("");
265  plotAggregator->SetLegend("Time (in seconds)", "Packet collision rate");
266  plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
267 
268  // Setup collectors.
269  m_terminalCollectors.SetType("ns3::IntervalRateCollector");
270  m_terminalCollectors.SetAttribute(
271  "InputDataType",
272  EnumValue(IntervalRateCollector::INPUT_DATA_TYPE_BOOLEAN));
273  m_terminalCollectors.SetAttribute(
274  "OutputType",
275  EnumValue(IntervalRateCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
277  for (CollectorMap::Iterator it = m_terminalCollectors.Begin();
278  it != m_terminalCollectors.End();
279  ++it)
280  {
281  const std::string context = it->second->GetName();
282  plotAggregator->Add2dDataset(context, context);
283  }
284  m_terminalCollectors.ConnectToAggregator("OutputWithTime",
285  m_aggregator,
286  &MagisterGnuplotAggregator::Write2d);
287  break;
288  }
289 
293  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
294  << " is not a valid output type for this statistics.");
295  break;
296 
297  default:
298  NS_FATAL_ERROR("SatStatsUserPacketCollisionHelper - Invalid output type");
299  break;
300  }
301 
302  // Create a map of UT addresses and identifiers.
303  NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
304  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
305  {
307  }
308 
309  // Connect to trace sources at GW nodes.
310 
311  NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
312  Callback<void, uint32_t, const Address&, bool> callback =
314 
315  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
316  {
317  NetDeviceContainer devs = GetGwSatNetDevice(*it);
318 
319  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
320  {
321  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
322  NS_ASSERT(satDev != nullptr);
323  Ptr<SatPhy> satPhy = satDev->GetPhy();
324  NS_ASSERT(satPhy != nullptr);
325  Ptr<SatPhyRx> satPhyRx = satPhy->GetPhyRx();
326  NS_ASSERT(satPhyRx != nullptr);
327  ObjectVectorValue carriers;
328  satPhyRx->GetAttribute("RxCarrierList", carriers);
329  NS_LOG_DEBUG(this << " Node ID " << (*it)->GetId() << " device #"
330  << (*itDev)->GetIfIndex() << " has " << carriers.GetN()
331  << " RX carriers");
332 
333  for (ObjectVectorValue::Iterator itCarrier = carriers.Begin();
334  itCarrier != carriers.End();
335  ++itCarrier)
336  {
338  DynamicCast<SatPhyRxCarrier>(itCarrier->second)->GetCarrierType();
339  if (ct != GetValidCarrierType())
340  {
341  continue;
342  }
343 
344  const bool ret =
345  itCarrier->second->TraceConnectWithoutContext(GetTraceSourceName(), callback);
346  if (ret)
347  {
348  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
349  << " device #" << (*itDev)->GetIfIndex() << " RX carrier #"
350  << itCarrier->first);
351  }
352  else
353  {
354  NS_FATAL_ERROR("Error connecting to " << GetTraceSourceName() << " trace source"
355  << " of SatPhyRxCarrier"
356  << " at node ID " << (*it)->GetId()
357  << " device #" << (*itDev)->GetIfIndex()
358  << " RX carrier #" << itCarrier->first);
359  }
360 
361  } // end of `for (ObjectVectorValue::Iterator itCarrier = carriers)`
362 
363  } // end of `for (NetDeviceContainer::Iterator itDev = devs)`
364 
365  } // end of `for (NodeContainer::Iterator it = gws)`
366 
367 } // end of `void DoInstall ();`
368 
369 // BASE CLASS USER /////////////////////////////////////////////////////////////////
370 
371 NS_OBJECT_ENSURE_REGISTERED(SatStatsUserPacketCollisionHelper);
372 
374  : SatStatsPacketCollisionHelper(satHelper)
375 {
376  NS_LOG_FUNCTION(this << satHelper);
377 }
378 
380 {
381  NS_LOG_FUNCTION(this);
382 }
383 
384 TypeId // static
386 {
387  static TypeId tid =
388  TypeId("ns3::SatStatsUserPacketCollisionHelper").SetParent<SatStatsPacketCollisionHelper>();
389  return tid;
390 }
391 
392 void
394 {
395  NS_LOG_FUNCTION(this);
396 
397  switch (GetOutputType())
398  {
400  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
401  << " is not a valid output type for this statistics.");
402  break;
403 
405  // Setup aggregator.
406  m_aggregator = CreateAggregator("ns3::MultiFileAggregator",
407  "OutputFileName",
408  StringValue(GetOutputFileName()),
409  "MultiFileMode",
410  BooleanValue(false),
411  "EnableContextPrinting",
412  BooleanValue(true),
413  "GeneralHeading",
414  StringValue(GetIdentifierHeading("collision_rate")));
415 
416  // Setup collectors.
417  m_terminalCollectors.SetType("ns3::ScalarCollector");
418  m_terminalCollectors.SetAttribute("InputDataType",
419  EnumValue(ScalarCollector::INPUT_DATA_TYPE_BOOLEAN));
420  m_terminalCollectors.SetAttribute(
421  "OutputType",
422  EnumValue(ScalarCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
424  m_terminalCollectors.ConnectToAggregator("Output",
425  m_aggregator,
426  &MultiFileAggregator::Write1d);
427  break;
428  }
429 
431  // Setup aggregator.
432  m_aggregator = CreateAggregator("ns3::MultiFileAggregator",
433  "OutputFileName",
434  StringValue(GetOutputFileName()),
435  "GeneralHeading",
436  StringValue(GetTimeHeading("collision_rate")));
437 
438  // Setup collectors.
439  m_terminalCollectors.SetType("ns3::IntervalRateCollector");
440  m_terminalCollectors.SetAttribute(
441  "InputDataType",
442  EnumValue(IntervalRateCollector::INPUT_DATA_TYPE_BOOLEAN));
443  m_terminalCollectors.SetAttribute(
444  "OutputType",
445  EnumValue(IntervalRateCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
447  m_terminalCollectors.ConnectToAggregator("OutputWithTime",
448  m_aggregator,
449  &MultiFileAggregator::Write2d);
450  m_terminalCollectors.ConnectToAggregator("OutputString",
451  m_aggregator,
452  &MultiFileAggregator::AddContextHeading);
453  break;
454  }
455 
459  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
460  << " is not a valid output type for this statistics.");
461  break;
462 
465  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
466  << " is not a valid output type for this statistics.");
467  break;
468 
470  // Setup aggregator.
471  m_aggregator = CreateAggregator("ns3::MagisterGnuplotAggregator",
472  "OutputPath",
473  StringValue(GetOutputPath()),
474  "OutputFileName",
475  StringValue(GetName()));
476  Ptr<MagisterGnuplotAggregator> plotAggregator =
477  m_aggregator->GetObject<MagisterGnuplotAggregator>();
478  NS_ASSERT(plotAggregator != nullptr);
479  // plot->SetTitle ("");
480  plotAggregator->SetLegend("Time (in seconds)", "Packet collision rate");
481  plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
482 
483  // Setup collectors.
484  m_terminalCollectors.SetType("ns3::IntervalRateCollector");
485  m_terminalCollectors.SetAttribute(
486  "InputDataType",
487  EnumValue(IntervalRateCollector::INPUT_DATA_TYPE_BOOLEAN));
488  m_terminalCollectors.SetAttribute(
489  "OutputType",
490  EnumValue(IntervalRateCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
492  for (CollectorMap::Iterator it = m_terminalCollectors.Begin();
493  it != m_terminalCollectors.End();
494  ++it)
495  {
496  const std::string context = it->second->GetName();
497  plotAggregator->Add2dDataset(context, context);
498  }
499  m_terminalCollectors.ConnectToAggregator("OutputWithTime",
500  m_aggregator,
501  &MagisterGnuplotAggregator::Write2d);
502  break;
503  }
504 
508  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
509  << " is not a valid output type for this statistics.");
510  break;
511 
512  default:
513  NS_FATAL_ERROR("SatStatsFeederPacketCollisionHelper - Invalid output type");
514  break;
515  }
516 
517  // Create a map of UT addresses and identifiers.
518  NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
519  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
520  {
522  }
523 
524  // Connect to trace sources at SAT nodes.
525 
526  NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
527  Callback<void, uint32_t, const Address&, bool> callback =
529 
530  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
531  {
532  Ptr<NetDevice> dev = GetSatSatOrbiterNetDevice(*it);
533 
534  Ptr<SatPhy> satPhy;
535  Ptr<SatOrbiterNetDevice> satOrbiterDev = dev->GetObject<SatOrbiterNetDevice>();
536  NS_ASSERT(satOrbiterDev != nullptr);
537  std::map<uint32_t, Ptr<SatPhy>> satOrbiterUserPhys = satOrbiterDev->GetUserPhy();
538  for (std::map<uint32_t, Ptr<SatPhy>>::iterator itPhy = satOrbiterUserPhys.begin();
539  itPhy != satOrbiterUserPhys.end();
540  ++itPhy)
541  {
542  satPhy = itPhy->second;
543  NS_ASSERT(satPhy != nullptr);
544  Ptr<SatPhyRx> satPhyRx = satPhy->GetPhyRx();
545  NS_ASSERT(satPhyRx != nullptr);
546 
547  ObjectVectorValue carriers;
548  satPhyRx->GetAttribute("RxCarrierList", carriers);
549  NS_LOG_DEBUG(this << " Node ID " << (*it)->GetId() << " device #" << dev->GetIfIndex()
550  << " has " << carriers.GetN() << " RX carriers");
551 
552  for (ObjectVectorValue::Iterator itCarrier = carriers.Begin();
553  itCarrier != carriers.End();
554  ++itCarrier)
555  {
557  DynamicCast<SatPhyRxCarrier>(itCarrier->second)->GetCarrierType();
558  if (ct != GetValidCarrierType())
559  {
560  continue;
561  }
562 
563  const bool ret =
564  itCarrier->second->TraceConnectWithoutContext(GetTraceSourceName(), callback);
565  if (ret)
566  {
567  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
568  << " device #" << dev->GetIfIndex() << " RX carrier #"
569  << itCarrier->first);
570  }
571  else
572  {
573  NS_FATAL_ERROR("Error connecting to " << GetTraceSourceName() << " trace source"
574  << " of SatPhyRxCarrier"
575  << " at node ID " << (*it)->GetId()
576  << " device #" << dev->GetIfIndex()
577  << " RX carrier #" << itCarrier->first);
578  }
579 
580  } // end of `for (ObjectVectorValue::Iterator itCarrier = carriers)`
581 
582  } // end of `for (std::map<uint32_t, Ptr<SatPhy>>::iterator itPhy = satOrbiterUserPhys)`
583 
584  } // end of `for (NodeContainer::Iterator it = sats)`
585 
586 } // end of `void DoInstall ();`
587 
588 // SLOTTED ALOHA FEEDER //////////////////////////////////////////////////////////////
589 
590 NS_OBJECT_ENSURE_REGISTERED(SatStatsFeederSlottedAlohaPacketCollisionHelper);
591 
593  Ptr<const SatHelper> satHelper)
595 {
596  NS_LOG_FUNCTION(this << satHelper);
597  SetTraceSourceName("SlottedAlohaRxCollision");
599 }
600 
602 {
603  NS_LOG_FUNCTION(this);
604 }
605 
606 TypeId // static
608 {
609  static TypeId tid = TypeId("ns3::SatStatsFeederSlottedAlohaPacketCollisionHelper")
611  return tid;
612 }
613 
614 // CRDSA FEEDER //////////////////////////////////////////////////////////////////////
615 
616 NS_OBJECT_ENSURE_REGISTERED(SatStatsFeederCrdsaPacketCollisionHelper);
617 
619  Ptr<const SatHelper> satHelper)
621 {
622  NS_LOG_FUNCTION(this << satHelper);
623  SetTraceSourceName("CrdsaReplicaRx");
625 }
626 
628 {
629  NS_LOG_FUNCTION(this);
630 }
631 
632 TypeId // static
634 {
635  static TypeId tid = TypeId("ns3::SatStatsFeederCrdsaPacketCollisionHelper")
637  return tid;
638 }
639 
640 // E-SSA FEEDER //////////////////////////////////////////////////////////////
641 
642 NS_OBJECT_ENSURE_REGISTERED(SatStatsFeederEssaPacketCollisionHelper);
643 
645  Ptr<const SatHelper> satHelper)
647 {
648  NS_LOG_FUNCTION(this << satHelper);
649  SetTraceSourceName("EssaRxCollision");
651 }
652 
654 {
655  NS_LOG_FUNCTION(this);
656 }
657 
658 TypeId // static
660 {
661  static TypeId tid = TypeId("ns3::SatStatsFeederEssaPacketCollisionHelper")
663  return tid;
664 }
665 
666 // SLOTTED ALOHA USER //////////////////////////////////////////////////////////////
667 
668 NS_OBJECT_ENSURE_REGISTERED(SatStatsUserSlottedAlohaPacketCollisionHelper);
669 
671  Ptr<const SatHelper> satHelper)
673 {
674  NS_LOG_FUNCTION(this << satHelper);
675  SetTraceSourceName("SlottedAlohaRxCollision");
677 }
678 
680 {
681  NS_LOG_FUNCTION(this);
682 }
683 
684 TypeId // static
686 {
687  static TypeId tid = TypeId("ns3::SatStatsUserSlottedAlohaPacketCollisionHelper")
688  .SetParent<SatStatsUserPacketCollisionHelper>();
689  return tid;
690 }
691 
692 // CRDSA USER //////////////////////////////////////////////////////////////////////
693 
694 NS_OBJECT_ENSURE_REGISTERED(SatStatsUserCrdsaPacketCollisionHelper);
695 
697  Ptr<const SatHelper> satHelper)
699 {
700  NS_LOG_FUNCTION(this << satHelper);
701  SetTraceSourceName("CrdsaReplicaRx");
703 }
704 
706 {
707  NS_LOG_FUNCTION(this);
708 }
709 
710 TypeId // static
712 {
713  static TypeId tid = TypeId("ns3::SatStatsUserCrdsaPacketCollisionHelper")
714  .SetParent<SatStatsUserPacketCollisionHelper>();
715  return tid;
716 }
717 
718 // E-SSA USER //////////////////////////////////////////////////////////////
719 
720 NS_OBJECT_ENSURE_REGISTERED(SatStatsUserEssaPacketCollisionHelper);
721 
723  Ptr<const SatHelper> satHelper)
725 {
726  NS_LOG_FUNCTION(this << satHelper);
727  SetTraceSourceName("EssaRxCollision");
729 }
730 
732 {
733  NS_LOG_FUNCTION(this);
734 }
735 
736 TypeId // static
738 {
739  static TypeId tid = TypeId("ns3::SatStatsUserEssaPacketCollisionHelper")
740  .SetParent<SatStatsUserPacketCollisionHelper>();
741  return tid;
742 }
743 
744 } // 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 TypeId GetTypeId()
inherited from ObjectBase base class
Parent abstract class of all satellite statistics helpers.
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)
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.