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-geo-net-device.h>
36 #include <ns3/satellite-helper.h>
37 #include <ns3/satellite-id-mapper.h>
38 #include <ns3/satellite-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/scalar-collector.h>
43 #include <ns3/singleton.h>
44 #include <ns3/string.h>
45 
46 #include <sstream>
47 
48 NS_LOG_COMPONENT_DEFINE("SatStatsPacketCollisionHelper");
49 
50 namespace ns3
51 {
52 
53 // BASE CLASS /////////////////////////////////////////////////////////////////
54 
55 NS_OBJECT_ENSURE_REGISTERED(SatStatsPacketCollisionHelper);
56 
58  : SatStatsHelper(satHelper)
59 {
60  NS_LOG_FUNCTION(this << satHelper);
61 }
62 
64 {
65  NS_LOG_FUNCTION(this);
66 }
67 
68 TypeId // static
70 {
71  static TypeId tid = TypeId("ns3::SatStatsPacketCollisionHelper").SetParent<SatStatsHelper>();
72  return tid;
73 }
74 
75 void
77 {
78  NS_LOG_FUNCTION(this << traceSourceName);
79  m_traceSourceName = traceSourceName;
80 }
81 
82 std::string
84 {
85  return m_traceSourceName;
86 }
87 
88 void
90  const Address& from,
91  bool isCollided)
92 {
93  NS_LOG_FUNCTION(this << nPackets << from << isCollided);
94 
95  if (from.IsInvalid())
96  {
97  NS_LOG_WARN(this << " discarding " << nPackets << " packets"
98  << " from statistics collection because of"
99  << " invalid sender address");
100  }
101  else
102  {
103  // Determine the identifier associated with the sender address.
104  std::map<const Address, uint32_t>::const_iterator it = m_identifierMap.find(from);
105 
106  if (it == m_identifierMap.end())
107  {
108  NS_LOG_WARN(this << " discarding " << nPackets << " packets"
109  << " from statistics collection because of"
110  << " unknown sender address " << from);
111  }
112  else
113  {
114  // Find the first-level collector with the right identifier.
115  Ptr<DataCollectionObject> collector = m_terminalCollectors.Get(it->second);
116  NS_ASSERT_MSG(collector != nullptr,
117  "Unable to find collector with identifier " << it->second);
118 
119  switch (GetOutputType())
120  {
123  Ptr<ScalarCollector> c = collector->GetObject<ScalarCollector>();
124  NS_ASSERT(c != nullptr);
125  c->TraceSinkBoolean(false, isCollided);
126  break;
127  }
128 
131  Ptr<IntervalRateCollector> c = collector->GetObject<IntervalRateCollector>();
132  NS_ASSERT(c != nullptr);
133  c->TraceSinkBoolean(false, isCollided);
134  break;
135  }
136 
137  default:
138  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
139  << " is not a valid output type for this statistics.");
140  break;
141 
142  } // end of `switch (GetOutputType ())`
143 
144  } // end of else of `if (it == m_identifierMap.end ())`
145 
146  } // end of else of `if (from.IsInvalid ())`
147 
148 } // end of `void CollisionRxCallback (uint32_t, const Address &, bool);`
149 
150 void
152 {
153  NS_LOG_FUNCTION(this << utNode->GetId());
154 
155  const SatIdMapper* satIdMapper = Singleton<SatIdMapper>::Get();
156  const Address addr = satIdMapper->GetUtMacWithNode(utNode);
157 
158  if (addr.IsInvalid())
159  {
160  NS_LOG_WARN(this << " Node " << utNode->GetId() << " is not a valid UT");
161  }
162  else
163  {
164  const uint32_t identifier = GetIdentifierForUt(utNode);
165  m_identifierMap[addr] = identifier;
166  NS_LOG_INFO(this << " associated address " << addr << " with identifier " << identifier);
167  }
168 }
169 
170 // BASE CLASS FEEDER /////////////////////////////////////////////////////////////////
171 
172 NS_OBJECT_ENSURE_REGISTERED(SatStatsFeederPacketCollisionHelper);
173 
175  Ptr<const SatHelper> satHelper)
176  : SatStatsPacketCollisionHelper(satHelper)
177 {
178  NS_LOG_FUNCTION(this << satHelper);
179 }
180 
182 {
183  NS_LOG_FUNCTION(this);
184 }
185 
186 TypeId // static
188 {
189  static TypeId tid = TypeId("ns3::SatStatsFeederPacketCollisionHelper")
190  .SetParent<SatStatsPacketCollisionHelper>();
191  return tid;
192 }
193 
194 void
196 {
197  NS_LOG_FUNCTION(this);
198 
199  switch (GetOutputType())
200  {
202  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
203  << " is not a valid output type for this statistics.");
204  break;
205 
207  // Setup aggregator.
208  m_aggregator = CreateAggregator("ns3::MultiFileAggregator",
209  "OutputFileName",
210  StringValue(GetOutputFileName()),
211  "MultiFileMode",
212  BooleanValue(false),
213  "EnableContextPrinting",
214  BooleanValue(true),
215  "GeneralHeading",
216  StringValue(GetIdentifierHeading("collision_rate")));
217 
218  // Setup collectors.
219  m_terminalCollectors.SetType("ns3::ScalarCollector");
220  m_terminalCollectors.SetAttribute("InputDataType",
221  EnumValue(ScalarCollector::INPUT_DATA_TYPE_BOOLEAN));
222  m_terminalCollectors.SetAttribute(
223  "OutputType",
224  EnumValue(ScalarCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
226  m_terminalCollectors.ConnectToAggregator("Output",
227  m_aggregator,
228  &MultiFileAggregator::Write1d);
229  break;
230  }
231 
233  // Setup aggregator.
234  m_aggregator = CreateAggregator("ns3::MultiFileAggregator",
235  "OutputFileName",
236  StringValue(GetOutputFileName()),
237  "GeneralHeading",
238  StringValue(GetTimeHeading("collision_rate")));
239 
240  // Setup collectors.
241  m_terminalCollectors.SetType("ns3::IntervalRateCollector");
242  m_terminalCollectors.SetAttribute(
243  "InputDataType",
244  EnumValue(IntervalRateCollector::INPUT_DATA_TYPE_BOOLEAN));
245  m_terminalCollectors.SetAttribute(
246  "OutputType",
247  EnumValue(IntervalRateCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
249  m_terminalCollectors.ConnectToAggregator("OutputWithTime",
250  m_aggregator,
251  &MultiFileAggregator::Write2d);
252  m_terminalCollectors.ConnectToAggregator("OutputString",
253  m_aggregator,
254  &MultiFileAggregator::AddContextHeading);
255  break;
256  }
257 
261  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
262  << " is not a valid output type for this statistics.");
263  break;
264 
267  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
268  << " is not a valid output type for this statistics.");
269  break;
270 
272  // Setup aggregator.
273  m_aggregator = CreateAggregator("ns3::MagisterGnuplotAggregator",
274  "OutputPath",
275  StringValue(GetOutputPath()),
276  "OutputFileName",
277  StringValue(GetName()));
278  Ptr<MagisterGnuplotAggregator> plotAggregator =
279  m_aggregator->GetObject<MagisterGnuplotAggregator>();
280  NS_ASSERT(plotAggregator != nullptr);
281  // plot->SetTitle ("");
282  plotAggregator->SetLegend("Time (in seconds)", "Packet collision rate");
283  plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
284 
285  // Setup collectors.
286  m_terminalCollectors.SetType("ns3::IntervalRateCollector");
287  m_terminalCollectors.SetAttribute(
288  "InputDataType",
289  EnumValue(IntervalRateCollector::INPUT_DATA_TYPE_BOOLEAN));
290  m_terminalCollectors.SetAttribute(
291  "OutputType",
292  EnumValue(IntervalRateCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
294  for (CollectorMap::Iterator it = m_terminalCollectors.Begin();
295  it != m_terminalCollectors.End();
296  ++it)
297  {
298  const std::string context = it->second->GetName();
299  plotAggregator->Add2dDataset(context, context);
300  }
301  m_terminalCollectors.ConnectToAggregator("OutputWithTime",
302  m_aggregator,
303  &MagisterGnuplotAggregator::Write2d);
304  break;
305  }
306 
310  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
311  << " is not a valid output type for this statistics.");
312  break;
313 
314  default:
315  NS_FATAL_ERROR("SatStatsUserPacketCollisionHelper - Invalid output type");
316  break;
317  }
318 
319  // Create a map of UT addresses and identifiers.
320  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
321  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
322  {
324  }
325 
326  // Connect to trace sources at GW nodes.
327 
328  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
329  Callback<void, uint32_t, const Address&, bool> callback =
331 
332  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
333  {
334  NetDeviceContainer devs = GetGwSatNetDevice(*it);
335 
336  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
337  {
338  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
339  NS_ASSERT(satDev != nullptr);
340  Ptr<SatPhy> satPhy = satDev->GetPhy();
341  NS_ASSERT(satPhy != nullptr);
342  Ptr<SatPhyRx> satPhyRx = satPhy->GetPhyRx();
343  NS_ASSERT(satPhyRx != nullptr);
344  ObjectVectorValue carriers;
345  satPhyRx->GetAttribute("RxCarrierList", carriers);
346  NS_LOG_DEBUG(this << " Node ID " << (*it)->GetId() << " device #"
347  << (*itDev)->GetIfIndex() << " has " << carriers.GetN()
348  << " RX carriers");
349 
350  for (ObjectVectorValue::Iterator itCarrier = carriers.Begin();
351  itCarrier != carriers.End();
352  ++itCarrier)
353  {
355  DynamicCast<SatPhyRxCarrier>(itCarrier->second)->GetCarrierType();
356  if (ct != GetValidCarrierType())
357  {
358  continue;
359  }
360 
361  const bool ret =
362  itCarrier->second->TraceConnectWithoutContext(GetTraceSourceName(), callback);
363  if (ret)
364  {
365  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
366  << " device #" << (*itDev)->GetIfIndex() << " RX carrier #"
367  << itCarrier->first);
368  }
369  else
370  {
371  NS_FATAL_ERROR("Error connecting to " << GetTraceSourceName() << " trace source"
372  << " of SatPhyRxCarrier"
373  << " at node ID " << (*it)->GetId()
374  << " device #" << (*itDev)->GetIfIndex()
375  << " RX carrier #" << itCarrier->first);
376  }
377 
378  } // end of `for (ObjectVectorValue::Iterator itCarrier = carriers)`
379 
380  } // end of `for (NetDeviceContainer::Iterator itDev = devs)`
381 
382  } // end of `for (NodeContainer::Iterator it = gws)`
383 
384 } // end of `void DoInstall ();`
385 
386 // BASE CLASS USER /////////////////////////////////////////////////////////////////
387 
388 NS_OBJECT_ENSURE_REGISTERED(SatStatsUserPacketCollisionHelper);
389 
391  : SatStatsPacketCollisionHelper(satHelper)
392 {
393  NS_LOG_FUNCTION(this << satHelper);
394 }
395 
397 {
398  NS_LOG_FUNCTION(this);
399 }
400 
401 TypeId // static
403 {
404  static TypeId tid =
405  TypeId("ns3::SatStatsUserPacketCollisionHelper").SetParent<SatStatsPacketCollisionHelper>();
406  return tid;
407 }
408 
409 void
411 {
412  NS_LOG_FUNCTION(this);
413 
414  switch (GetOutputType())
415  {
417  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
418  << " is not a valid output type for this statistics.");
419  break;
420 
422  // Setup aggregator.
423  m_aggregator = CreateAggregator("ns3::MultiFileAggregator",
424  "OutputFileName",
425  StringValue(GetOutputFileName()),
426  "MultiFileMode",
427  BooleanValue(false),
428  "EnableContextPrinting",
429  BooleanValue(true),
430  "GeneralHeading",
431  StringValue(GetIdentifierHeading("collision_rate")));
432 
433  // Setup collectors.
434  m_terminalCollectors.SetType("ns3::ScalarCollector");
435  m_terminalCollectors.SetAttribute("InputDataType",
436  EnumValue(ScalarCollector::INPUT_DATA_TYPE_BOOLEAN));
437  m_terminalCollectors.SetAttribute(
438  "OutputType",
439  EnumValue(ScalarCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
441  m_terminalCollectors.ConnectToAggregator("Output",
442  m_aggregator,
443  &MultiFileAggregator::Write1d);
444  break;
445  }
446 
448  // Setup aggregator.
449  m_aggregator = CreateAggregator("ns3::MultiFileAggregator",
450  "OutputFileName",
451  StringValue(GetOutputFileName()),
452  "GeneralHeading",
453  StringValue(GetTimeHeading("collision_rate")));
454 
455  // Setup collectors.
456  m_terminalCollectors.SetType("ns3::IntervalRateCollector");
457  m_terminalCollectors.SetAttribute(
458  "InputDataType",
459  EnumValue(IntervalRateCollector::INPUT_DATA_TYPE_BOOLEAN));
460  m_terminalCollectors.SetAttribute(
461  "OutputType",
462  EnumValue(IntervalRateCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
464  m_terminalCollectors.ConnectToAggregator("OutputWithTime",
465  m_aggregator,
466  &MultiFileAggregator::Write2d);
467  m_terminalCollectors.ConnectToAggregator("OutputString",
468  m_aggregator,
469  &MultiFileAggregator::AddContextHeading);
470  break;
471  }
472 
476  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
477  << " is not a valid output type for this statistics.");
478  break;
479 
482  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
483  << " is not a valid output type for this statistics.");
484  break;
485 
487  // Setup aggregator.
488  m_aggregator = CreateAggregator("ns3::MagisterGnuplotAggregator",
489  "OutputPath",
490  StringValue(GetOutputPath()),
491  "OutputFileName",
492  StringValue(GetName()));
493  Ptr<MagisterGnuplotAggregator> plotAggregator =
494  m_aggregator->GetObject<MagisterGnuplotAggregator>();
495  NS_ASSERT(plotAggregator != nullptr);
496  // plot->SetTitle ("");
497  plotAggregator->SetLegend("Time (in seconds)", "Packet collision rate");
498  plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
499 
500  // Setup collectors.
501  m_terminalCollectors.SetType("ns3::IntervalRateCollector");
502  m_terminalCollectors.SetAttribute(
503  "InputDataType",
504  EnumValue(IntervalRateCollector::INPUT_DATA_TYPE_BOOLEAN));
505  m_terminalCollectors.SetAttribute(
506  "OutputType",
507  EnumValue(IntervalRateCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
509  for (CollectorMap::Iterator it = m_terminalCollectors.Begin();
510  it != m_terminalCollectors.End();
511  ++it)
512  {
513  const std::string context = it->second->GetName();
514  plotAggregator->Add2dDataset(context, context);
515  }
516  m_terminalCollectors.ConnectToAggregator("OutputWithTime",
517  m_aggregator,
518  &MagisterGnuplotAggregator::Write2d);
519  break;
520  }
521 
525  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
526  << " is not a valid output type for this statistics.");
527  break;
528 
529  default:
530  NS_FATAL_ERROR("SatStatsFeederPacketCollisionHelper - Invalid output type");
531  break;
532  }
533 
534  // Create a map of UT addresses and identifiers.
535  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
536  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
537  {
539  }
540 
541  // Connect to trace sources at SAT nodes.
542 
543  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
544  Callback<void, uint32_t, const Address&, bool> callback =
546 
547  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
548  {
549  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
550 
551  Ptr<SatPhy> satPhy;
552  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
553  NS_ASSERT(satGeoDev != nullptr);
554  std::map<uint32_t, Ptr<SatPhy>> satGeoUserPhys = satGeoDev->GetUserPhy();
555  for (std::map<uint32_t, Ptr<SatPhy>>::iterator itPhy = satGeoUserPhys.begin();
556  itPhy != satGeoUserPhys.end();
557  ++itPhy)
558  {
559  satPhy = itPhy->second;
560  NS_ASSERT(satPhy != nullptr);
561  Ptr<SatPhyRx> satPhyRx = satPhy->GetPhyRx();
562  NS_ASSERT(satPhyRx != nullptr);
563 
564  ObjectVectorValue carriers;
565  satPhyRx->GetAttribute("RxCarrierList", carriers);
566  NS_LOG_DEBUG(this << " Node ID " << (*it)->GetId() << " device #" << dev->GetIfIndex()
567  << " has " << carriers.GetN() << " RX carriers");
568 
569  for (ObjectVectorValue::Iterator itCarrier = carriers.Begin();
570  itCarrier != carriers.End();
571  ++itCarrier)
572  {
574  DynamicCast<SatPhyRxCarrier>(itCarrier->second)->GetCarrierType();
575  if (ct != GetValidCarrierType())
576  {
577  continue;
578  }
579 
580  const bool ret =
581  itCarrier->second->TraceConnectWithoutContext(GetTraceSourceName(), callback);
582  if (ret)
583  {
584  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
585  << " device #" << dev->GetIfIndex() << " RX carrier #"
586  << itCarrier->first);
587  }
588  else
589  {
590  NS_FATAL_ERROR("Error connecting to " << GetTraceSourceName() << " trace source"
591  << " of SatPhyRxCarrier"
592  << " at node ID " << (*it)->GetId()
593  << " device #" << dev->GetIfIndex()
594  << " RX carrier #" << itCarrier->first);
595  }
596 
597  } // end of `for (ObjectVectorValue::Iterator itCarrier = carriers)`
598 
599  } // end of `for (std::map<uint32_t, Ptr<SatPhy>>::iterator itPhy = satGeoUserPhys)`
600 
601  } // end of `for (NodeContainer::Iterator it = sats)`
602 
603 } // end of `void DoInstall ();`
604 
605 // SLOTTED ALOHA FEEDER //////////////////////////////////////////////////////////////
606 
607 NS_OBJECT_ENSURE_REGISTERED(SatStatsFeederSlottedAlohaPacketCollisionHelper);
608 
610  Ptr<const SatHelper> satHelper)
612 {
613  NS_LOG_FUNCTION(this << satHelper);
614  SetTraceSourceName("SlottedAlohaRxCollision");
616 }
617 
619 {
620  NS_LOG_FUNCTION(this);
621 }
622 
623 TypeId // static
625 {
626  static TypeId tid = TypeId("ns3::SatStatsFeederSlottedAlohaPacketCollisionHelper")
628  return tid;
629 }
630 
631 // CRDSA FEEDER //////////////////////////////////////////////////////////////////////
632 
633 NS_OBJECT_ENSURE_REGISTERED(SatStatsFeederCrdsaPacketCollisionHelper);
634 
636  Ptr<const SatHelper> satHelper)
638 {
639  NS_LOG_FUNCTION(this << satHelper);
640  SetTraceSourceName("CrdsaReplicaRx");
642 }
643 
645 {
646  NS_LOG_FUNCTION(this);
647 }
648 
649 TypeId // static
651 {
652  static TypeId tid = TypeId("ns3::SatStatsFeederCrdsaPacketCollisionHelper")
654  return tid;
655 }
656 
657 // E-SSA FEEDER //////////////////////////////////////////////////////////////
658 
659 NS_OBJECT_ENSURE_REGISTERED(SatStatsFeederEssaPacketCollisionHelper);
660 
662  Ptr<const SatHelper> satHelper)
664 {
665  NS_LOG_FUNCTION(this << satHelper);
666  SetTraceSourceName("EssaRxCollision");
668 }
669 
671 {
672  NS_LOG_FUNCTION(this);
673 }
674 
675 TypeId // static
677 {
678  static TypeId tid = TypeId("ns3::SatStatsFeederEssaPacketCollisionHelper")
680  return tid;
681 }
682 
683 // SLOTTED ALOHA USER //////////////////////////////////////////////////////////////
684 
685 NS_OBJECT_ENSURE_REGISTERED(SatStatsUserSlottedAlohaPacketCollisionHelper);
686 
688  Ptr<const SatHelper> satHelper)
690 {
691  NS_LOG_FUNCTION(this << satHelper);
692  SetTraceSourceName("SlottedAlohaRxCollision");
694 }
695 
697 {
698  NS_LOG_FUNCTION(this);
699 }
700 
701 TypeId // static
703 {
704  static TypeId tid = TypeId("ns3::SatStatsUserSlottedAlohaPacketCollisionHelper")
705  .SetParent<SatStatsUserPacketCollisionHelper>();
706  return tid;
707 }
708 
709 // CRDSA USER //////////////////////////////////////////////////////////////////////
710 
711 NS_OBJECT_ENSURE_REGISTERED(SatStatsUserCrdsaPacketCollisionHelper);
712 
714  Ptr<const SatHelper> satHelper)
716 {
717  NS_LOG_FUNCTION(this << satHelper);
718  SetTraceSourceName("CrdsaReplicaRx");
720 }
721 
723 {
724  NS_LOG_FUNCTION(this);
725 }
726 
727 TypeId // static
729 {
730  static TypeId tid = TypeId("ns3::SatStatsUserCrdsaPacketCollisionHelper")
731  .SetParent<SatStatsUserPacketCollisionHelper>();
732  return tid;
733 }
734 
735 // E-SSA USER //////////////////////////////////////////////////////////////
736 
737 NS_OBJECT_ENSURE_REGISTERED(SatStatsUserEssaPacketCollisionHelper);
738 
740  Ptr<const SatHelper> satHelper)
742 {
743  NS_LOG_FUNCTION(this << satHelper);
744  SetTraceSourceName("EssaRxCollision");
746 }
747 
749 {
750  NS_LOG_FUNCTION(this);
751 }
752 
753 TypeId // static
755 {
756  static TypeId tid = TypeId("ns3::SatStatsUserEssaPacketCollisionHelper")
757  .SetParent<SatStatsUserPacketCollisionHelper>();
758  return tid;
759 }
760 
761 } // end of namespace ns3
SatGeoNetDevice to be utilized in geostationary satellite.
Class for ID-mapper.
Address GetUtMacWithNode(Ptr< Node > utNode) const
SatNetDevice to be utilized in the UT and GW nodes.
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.
Ptr< const SatHelper > GetSatHelper() const
static NetDeviceContainer GetGwSatNetDevice(Ptr< Node > gwNode)
static std::string GetOutputTypeName(OutputType_t outputType)
static Ptr< NetDevice > GetSatSatGeoNetDevice(Ptr< Node > satNode)
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
uint32_t GetIdentifierForUt(Ptr< Node > utNode) const
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 SaveAddressAndIdentifier(Ptr< Node > utNode)
Save the address and the proper identifier from the given UT node.
void SetValidCarrierType(SatPhyRxCarrier::CarrierType carrierType)
Set valid carrier type for this statistics helper type.
std::map< const Address, uint32_t > m_identifierMap
Map of address and the identifier associated with it (for forward link).
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.