satellite-stats-link-delay-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: Bastien Tauran <bastien.tauran@viveris.fr>
19  *
20  */
21 
23 
24 #include <ns3/application-delay-probe.h>
25 #include <ns3/application.h>
26 #include <ns3/boolean.h>
27 #include <ns3/callback.h>
28 #include <ns3/data-collection-object.h>
29 #include <ns3/distribution-collector.h>
30 #include <ns3/enum.h>
31 #include <ns3/inet-socket-address.h>
32 #include <ns3/ipv4.h>
33 #include <ns3/log.h>
34 #include <ns3/mac48-address.h>
35 #include <ns3/magister-gnuplot-aggregator.h>
36 #include <ns3/multi-file-aggregator.h>
37 #include <ns3/net-device.h>
38 #include <ns3/node-container.h>
39 #include <ns3/nstime.h>
40 #include <ns3/probe.h>
41 #include <ns3/satellite-geo-net-device.h>
42 #include <ns3/satellite-helper.h>
43 #include <ns3/satellite-id-mapper.h>
44 #include <ns3/satellite-mac.h>
45 #include <ns3/satellite-net-device.h>
46 #include <ns3/satellite-phy.h>
47 #include <ns3/satellite-time-tag.h>
48 #include <ns3/scalar-collector.h>
49 #include <ns3/singleton.h>
50 #include <ns3/string.h>
51 #include <ns3/traffic-time-tag.h>
52 #include <ns3/unit-conversion-collector.h>
53 
54 #include <sstream>
55 
56 NS_LOG_COMPONENT_DEFINE("SatStatsLinkDelayHelper");
57 
58 namespace ns3
59 {
60 
61 NS_OBJECT_ENSURE_REGISTERED(SatStatsLinkDelayHelper);
62 
63 SatStatsLinkDelayHelper::SatStatsLinkDelayHelper(Ptr<const SatHelper> satHelper)
64  : SatStatsHelper(satHelper),
65  m_averagingMode(false)
66 {
67  NS_LOG_FUNCTION(this << satHelper);
68 }
69 
71 {
72  NS_LOG_FUNCTION(this);
73 }
74 
75 TypeId // static
77 {
78  static TypeId tid =
79  TypeId("ns3::SatStatsLinkDelayHelper")
80  .SetParent<SatStatsHelper>()
81  .AddAttribute("AveragingMode",
82  "If true, all samples will be averaged before passed to aggregator. "
83  "Only affects histogram, PDF, and CDF output types.",
84  BooleanValue(false),
85  MakeBooleanAccessor(&SatStatsLinkDelayHelper::SetAveragingMode,
87  MakeBooleanChecker());
88  return tid;
89 }
90 
91 void
93 {
94  NS_LOG_FUNCTION(this << averagingMode);
95  m_averagingMode = averagingMode;
96 }
97 
98 bool
100 {
101  return m_averagingMode;
102 }
103 
104 void
106 {
107  NS_LOG_FUNCTION(this);
108 
109  switch (GetOutputType())
110  {
112  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
113  << " is not a valid output type for this statistics.");
114  break;
115 
117  // Setup aggregator.
118  m_aggregator = CreateAggregator("ns3::MultiFileAggregator",
119  "OutputFileName",
120  StringValue(GetOutputFileName()),
121  "MultiFileMode",
122  BooleanValue(false),
123  "EnableContextPrinting",
124  BooleanValue(true),
125  "GeneralHeading",
126  StringValue(GetIdentifierHeading("delay_sec")));
127 
128  // Setup collectors.
129  m_terminalCollectors.SetType("ns3::ScalarCollector");
130  m_terminalCollectors.SetAttribute("InputDataType",
131  EnumValue(ScalarCollector::INPUT_DATA_TYPE_DOUBLE));
132  m_terminalCollectors.SetAttribute(
133  "OutputType",
134  EnumValue(ScalarCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
136  m_terminalCollectors.ConnectToAggregator("Output",
137  m_aggregator,
138  &MultiFileAggregator::Write1d);
139  break;
140  }
141 
143  // Setup aggregator.
144  m_aggregator = CreateAggregator("ns3::MultiFileAggregator",
145  "OutputFileName",
146  StringValue(GetOutputFileName()),
147  "GeneralHeading",
148  StringValue(GetTimeHeading("delay_sec")));
149 
150  // Setup collectors.
151  m_terminalCollectors.SetType("ns3::UnitConversionCollector");
152  m_terminalCollectors.SetAttribute("ConversionType",
153  EnumValue(UnitConversionCollector::TRANSPARENT));
155  m_terminalCollectors.ConnectToAggregator("OutputTimeValue",
156  m_aggregator,
157  &MultiFileAggregator::Write2d);
158  break;
159  }
160 
164  if (m_averagingMode)
165  {
166  // Setup aggregator.
167  m_aggregator = CreateAggregator("ns3::MultiFileAggregator",
168  "OutputFileName",
169  StringValue(GetOutputFileName()),
170  "MultiFileMode",
171  BooleanValue(false),
172  "EnableContextPrinting",
173  BooleanValue(false),
174  "GeneralHeading",
175  StringValue(GetDistributionHeading("delay_sec")));
176  Ptr<MultiFileAggregator> fileAggregator =
177  m_aggregator->GetObject<MultiFileAggregator>();
178  NS_ASSERT(fileAggregator != nullptr);
179 
180  // Setup the final-level collector.
181  m_averagingCollector = CreateObject<DistributionCollector>();
182  DistributionCollector::OutputType_t outputType =
183  DistributionCollector::OUTPUT_TYPE_HISTOGRAM;
185  {
186  outputType = DistributionCollector::OUTPUT_TYPE_PROBABILITY;
187  }
189  {
190  outputType = DistributionCollector::OUTPUT_TYPE_CUMULATIVE;
191  }
192  m_averagingCollector->SetOutputType(outputType);
193  m_averagingCollector->SetName("0");
194  m_averagingCollector->TraceConnect(
195  "Output",
196  "0",
197  MakeCallback(&MultiFileAggregator::Write2d, fileAggregator));
198  m_averagingCollector->TraceConnect(
199  "OutputString",
200  "0",
201  MakeCallback(&MultiFileAggregator::AddContextHeading, fileAggregator));
202  m_averagingCollector->TraceConnect(
203  "Warning",
204  "0",
205  MakeCallback(&MultiFileAggregator::EnableContextWarning, fileAggregator));
206 
207  // Setup collectors.
208  m_terminalCollectors.SetType("ns3::ScalarCollector");
209  m_terminalCollectors.SetAttribute("InputDataType",
210  EnumValue(ScalarCollector::INPUT_DATA_TYPE_DOUBLE));
211  m_terminalCollectors.SetAttribute(
212  "OutputType",
213  EnumValue(ScalarCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
215  Callback<void, double> callback =
216  MakeCallback(&DistributionCollector::TraceSinkDouble1, m_averagingCollector);
217  for (CollectorMap::Iterator it = m_terminalCollectors.Begin();
218  it != m_terminalCollectors.End();
219  ++it)
220  {
221  it->second->TraceConnectWithoutContext("Output", callback);
222  }
223  }
224  else
225  {
226  // Setup aggregator.
227  m_aggregator = CreateAggregator("ns3::MultiFileAggregator",
228  "OutputFileName",
229  StringValue(GetOutputFileName()),
230  "GeneralHeading",
231  StringValue(GetDistributionHeading("delay_sec")));
232 
233  // Setup collectors.
234  m_terminalCollectors.SetType("ns3::DistributionCollector");
235  DistributionCollector::OutputType_t outputType =
236  DistributionCollector::OUTPUT_TYPE_HISTOGRAM;
238  {
239  outputType = DistributionCollector::OUTPUT_TYPE_PROBABILITY;
240  }
242  {
243  outputType = DistributionCollector::OUTPUT_TYPE_CUMULATIVE;
244  }
245  m_terminalCollectors.SetAttribute("OutputType", EnumValue(outputType));
247  m_terminalCollectors.ConnectToAggregator("Output",
248  m_aggregator,
249  &MultiFileAggregator::Write2d);
250  m_terminalCollectors.ConnectToAggregator("OutputString",
251  m_aggregator,
252  &MultiFileAggregator::AddContextHeading);
253  m_terminalCollectors.ConnectToAggregator("Warning",
254  m_aggregator,
255  &MultiFileAggregator::EnableContextWarning);
256  }
257 
258  break;
259  }
260 
263  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
264  << " is not a valid output type for this statistics.");
265  break;
266 
268  // Setup aggregator.
269  m_aggregator = CreateAggregator("ns3::MagisterGnuplotAggregator",
270  "OutputPath",
271  StringValue(GetOutputPath()),
272  "OutputFileName",
273  StringValue(GetName()));
274  Ptr<MagisterGnuplotAggregator> plotAggregator =
275  m_aggregator->GetObject<MagisterGnuplotAggregator>();
276  NS_ASSERT(plotAggregator != nullptr);
277  // plot->SetTitle ("");
278  plotAggregator->SetLegend("Time (in seconds)", "Packet delay (in seconds)");
279  plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
280 
281  // Setup collectors.
282  m_terminalCollectors.SetType("ns3::UnitConversionCollector");
283  m_terminalCollectors.SetAttribute("ConversionType",
284  EnumValue(UnitConversionCollector::TRANSPARENT));
286  for (CollectorMap::Iterator it = m_terminalCollectors.Begin();
287  it != m_terminalCollectors.End();
288  ++it)
289  {
290  const std::string context = it->second->GetName();
291  plotAggregator->Add2dDataset(context, context);
292  }
293  m_terminalCollectors.ConnectToAggregator("OutputTimeValue",
294  m_aggregator,
295  &MagisterGnuplotAggregator::Write2d);
296  break;
297  }
298 
302  if (m_averagingMode)
303  {
304  // Setup aggregator.
305  m_aggregator = CreateAggregator("ns3::MagisterGnuplotAggregator",
306  "OutputPath",
307  StringValue(GetOutputPath()),
308  "OutputFileName",
309  StringValue(GetName()));
310  Ptr<MagisterGnuplotAggregator> plotAggregator =
311  m_aggregator->GetObject<MagisterGnuplotAggregator>();
312  NS_ASSERT(plotAggregator != nullptr);
313  // plot->SetTitle ("");
314  plotAggregator->SetLegend("Packet delay (in seconds)", "Frequency");
315  plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
316  plotAggregator->Add2dDataset(GetName(), GetName());
318 
319  // Setup the final-level collector.
320  m_averagingCollector = CreateObject<DistributionCollector>();
321  DistributionCollector::OutputType_t outputType =
322  DistributionCollector::OUTPUT_TYPE_HISTOGRAM;
324  {
325  outputType = DistributionCollector::OUTPUT_TYPE_PROBABILITY;
326  }
328  {
329  outputType = DistributionCollector::OUTPUT_TYPE_CUMULATIVE;
330  }
331  m_averagingCollector->SetOutputType(outputType);
332  m_averagingCollector->SetName("0");
333  m_averagingCollector->TraceConnect(
334  "Output",
335  GetName(),
336  MakeCallback(&MagisterGnuplotAggregator::Write2d, plotAggregator));
338 
339  // Setup collectors.
340  m_terminalCollectors.SetType("ns3::ScalarCollector");
341  m_terminalCollectors.SetAttribute("InputDataType",
342  EnumValue(ScalarCollector::INPUT_DATA_TYPE_DOUBLE));
343  m_terminalCollectors.SetAttribute(
344  "OutputType",
345  EnumValue(ScalarCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
347  Callback<void, double> callback =
348  MakeCallback(&DistributionCollector::TraceSinkDouble1, m_averagingCollector);
349  for (CollectorMap::Iterator it = m_terminalCollectors.Begin();
350  it != m_terminalCollectors.End();
351  ++it)
352  {
353  it->second->TraceConnectWithoutContext("Output", callback);
354  }
355  }
356  else
357  {
358  // Setup aggregator.
359  m_aggregator = CreateAggregator("ns3::MagisterGnuplotAggregator",
360  "OutputPath",
361  StringValue(GetOutputPath()),
362  "OutputFileName",
363  StringValue(GetName()));
364  Ptr<MagisterGnuplotAggregator> plotAggregator =
365  m_aggregator->GetObject<MagisterGnuplotAggregator>();
366  NS_ASSERT(plotAggregator != nullptr);
367  // plot->SetTitle ("");
368  plotAggregator->SetLegend("Packet delay (in seconds)", "Frequency");
369  plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
370 
371  // Setup collectors.
372  m_terminalCollectors.SetType("ns3::DistributionCollector");
373  DistributionCollector::OutputType_t outputType =
374  DistributionCollector::OUTPUT_TYPE_HISTOGRAM;
376  {
377  outputType = DistributionCollector::OUTPUT_TYPE_PROBABILITY;
378  }
380  {
381  outputType = DistributionCollector::OUTPUT_TYPE_CUMULATIVE;
382  }
383  m_terminalCollectors.SetAttribute("OutputType", EnumValue(outputType));
385  for (CollectorMap::Iterator it = m_terminalCollectors.Begin();
386  it != m_terminalCollectors.End();
387  ++it)
388  {
389  const std::string context = it->second->GetName();
390  plotAggregator->Add2dDataset(context, context);
391  }
392  m_terminalCollectors.ConnectToAggregator("Output",
393  m_aggregator,
394  &MagisterGnuplotAggregator::Write2d);
395  }
396 
397  break;
398  }
399 
400  default:
401  NS_FATAL_ERROR("SatStatsLinkDelayHelper - Invalid output type");
402  break;
403  }
404 
405  // Setup probes and connect them to the collectors.
406  InstallProbes();
407 
408 } // end of `void DoInstall ();`
409 
410 void
412 {
413  // The method below is supposed to be implemented by the child class.
414  DoInstallProbes();
415 }
416 
417 void
418 SatStatsLinkDelayHelper::RxLinkDelayCallback(const Time& delay, const Address& from)
419 {
420  // NS_LOG_FUNCTION (this << delay.GetSeconds () << from);
421 
422  if (from.IsInvalid())
423  {
424  NS_LOG_WARN(this << " discarding a packet delay of " << delay.GetSeconds()
425  << " from statistics collection because of"
426  << " invalid sender address");
427  }
428  else if (Mac48Address::ConvertFrom(from).IsBroadcast())
429  {
430  for (std::pair<const Address, uint32_t> item : m_identifierMap)
431  {
432  PassSampleToCollector(delay, item.second);
433  }
434  }
435  else
436  {
437  // Determine the identifier associated with the sender address.
438  std::map<const Address, uint32_t>::const_iterator it = m_identifierMap.find(from);
439 
440  if (it != m_identifierMap.end())
441  {
442  PassSampleToCollector(delay, it->second);
443  }
444  else
445  {
446  NS_LOG_WARN(this << " discarding a packet delay of " << delay.GetSeconds()
447  << " from statistics collection because of"
448  << " unknown sender address " << from);
449  }
450  }
451 }
452 
453 void
455 {
456  NS_LOG_FUNCTION(this << utNode->GetId());
457 
458  const SatIdMapper* satIdMapper = Singleton<SatIdMapper>::Get();
459  const Address addr = satIdMapper->GetUtMacWithNode(utNode);
460 
461  if (addr.IsInvalid())
462  {
463  NS_LOG_WARN(this << " Node " << utNode->GetId() << " is not a valid UT");
464  }
465  else
466  {
467  const uint32_t identifier = GetIdentifierForUt(utNode);
468  m_identifierMap[addr] = identifier;
469  NS_LOG_INFO(this << " associated address " << addr << " with identifier " << identifier);
470  }
471 }
472 
473 bool
474 SatStatsLinkDelayHelper::ConnectProbeToCollector(Ptr<Probe> probe, uint32_t identifier)
475 {
476  NS_LOG_FUNCTION(this << probe << probe->GetName() << identifier);
477 
478  bool ret = false;
479  switch (GetOutputType())
480  {
483  ret = m_terminalCollectors.ConnectWithProbe(probe,
484  "OutputSeconds",
485  identifier,
486  &ScalarCollector::TraceSinkDouble);
487  break;
488 
491  ret = m_terminalCollectors.ConnectWithProbe(probe,
492  "OutputSeconds",
493  identifier,
494  &UnitConversionCollector::TraceSinkDouble);
495  break;
496 
503  if (m_averagingMode)
504  {
505  ret = m_terminalCollectors.ConnectWithProbe(probe,
506  "OutputSeconds",
507  identifier,
508  &ScalarCollector::TraceSinkDouble);
509  }
510  else
511  {
512  ret = m_terminalCollectors.ConnectWithProbe(probe,
513  "OutputSeconds",
514  identifier,
515  &DistributionCollector::TraceSinkDouble);
516  }
517  break;
518 
519  default:
520  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
521  << " is not a valid output type for this statistics.");
522  break;
523  }
524 
525  if (ret)
526  {
527  NS_LOG_INFO(this << " created probe " << probe->GetName() << ", connected to collector "
528  << identifier);
529  }
530  else
531  {
532  NS_LOG_WARN(this << " unable to connect probe " << probe->GetName() << " to collector "
533  << identifier);
534  }
535 
536  return ret;
537 }
538 
539 void
540 SatStatsLinkDelayHelper::PassSampleToCollector(const Time& delay, uint32_t identifier)
541 {
542  // NS_LOG_FUNCTION (this << delay.GetSeconds () << identifier);
543 
544  Ptr<DataCollectionObject> collector = m_terminalCollectors.Get(identifier);
545  NS_ASSERT_MSG(collector != nullptr, "Unable to find collector with identifier " << identifier);
546 
547  switch (GetOutputType())
548  {
551  Ptr<ScalarCollector> c = collector->GetObject<ScalarCollector>();
552  NS_ASSERT(c != nullptr);
553  c->TraceSinkDouble(0.0, delay.GetSeconds());
554  break;
555  }
556 
559  Ptr<UnitConversionCollector> c = collector->GetObject<UnitConversionCollector>();
560  NS_ASSERT(c != nullptr);
561  c->TraceSinkDouble(0.0, delay.GetSeconds());
562  break;
563  }
564 
571  if (m_averagingMode)
572  {
573  Ptr<ScalarCollector> c = collector->GetObject<ScalarCollector>();
574  NS_ASSERT(c != nullptr);
575  c->TraceSinkDouble(0.0, delay.GetSeconds());
576  }
577  else
578  {
579  Ptr<DistributionCollector> c = collector->GetObject<DistributionCollector>();
580  NS_ASSERT(c != nullptr);
581  c->TraceSinkDouble(0.0, delay.GetSeconds());
582  }
583  break;
584 
585  default:
586  NS_FATAL_ERROR(GetOutputTypeName(GetOutputType())
587  << " is not a valid output type for this statistics.");
588  break;
589 
590  } // end of `switch (GetOutputType ())`
591 
592 } // end of `void PassSampleToCollector (Time, uint32_t)`
593 
594 // FORWARD FEEDER LINK DEV-LEVEL /////////////////////////////////////////////////////
595 
596 NS_OBJECT_ENSURE_REGISTERED(SatStatsFwdFeederDevLinkDelayHelper);
597 
599  Ptr<const SatHelper> satHelper)
600  : SatStatsLinkDelayHelper(satHelper)
601 {
602  NS_LOG_FUNCTION(this << satHelper);
603 }
604 
606 {
607  NS_LOG_FUNCTION(this);
608 }
609 
610 TypeId // static
612 {
613  static TypeId tid =
614  TypeId("ns3::SatStatsFwdFeederDevLinkDelayHelper").SetParent<SatStatsLinkDelayHelper>();
615  return tid;
616 }
617 
618 void
620 {
621  NS_LOG_FUNCTION(this);
622 
623  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
624  Callback<void, const Time&, const Address&> callback =
626 
627  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
628  {
629  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
630  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
631  NS_ASSERT(satGeoDev != nullptr);
632  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
633 
634  // Connect the object to the probe.
635  if (satGeoDev->TraceConnectWithoutContext("RxFeederLinkDelay", callback))
636  {
637  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
638  << " device #" << satGeoDev->GetIfIndex());
639  }
640  else
641  {
642  NS_FATAL_ERROR("Error connecting to RxFeederLinkDelay trace source of SatNetDevice"
643  << " at node ID " << (*it)->GetId() << " device #"
644  << satGeoDev->GetIfIndex());
645  }
646  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
647 
648  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
649 
650  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
651  {
652  // Create a map of UT addresses and identifiers.
654 
655  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
656  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
657  NS_ASSERT(satDev != nullptr);
658 
659  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
660 
661  } // end of `for (it = uts.Begin(); it != uts.End (); ++it)`
662 
663  // Enable statistics-related tags on the transmitting device.
664  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
665  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
666  {
667  NetDeviceContainer devs = GetGwSatNetDevice(*it);
668 
669  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
670  {
671  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
672  NS_ASSERT(satDev != nullptr);
673 
674  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
675  }
676  }
677 
678 } // end of `void DoInstallProbes ();`
679 
680 // FORWARD USER LINK DEV-LEVEL /////////////////////////////////////////////////////
681 
682 NS_OBJECT_ENSURE_REGISTERED(SatStatsFwdUserDevLinkDelayHelper);
683 
685  : SatStatsLinkDelayHelper(satHelper)
686 {
687  NS_LOG_FUNCTION(this << satHelper);
688 }
689 
691 {
692  NS_LOG_FUNCTION(this);
693 }
694 
695 TypeId // static
697 {
698  static TypeId tid =
699  TypeId("ns3::SatStatsFwdUserDevLinkDelayHelper").SetParent<SatStatsLinkDelayHelper>();
700  return tid;
701 }
702 
703 void
705 {
706  NS_LOG_FUNCTION(this);
707 
708  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
709 
710  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
711  {
712  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
713  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
714  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
715  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
716 
717  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
718 
719  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
720  {
721  const int32_t utId = GetUtId(*it);
722  NS_ASSERT_MSG(utId > 0, "Node " << (*it)->GetId() << " is not a valid UT");
723  const uint32_t identifier = GetIdentifierForUt(*it);
724 
725  // Create the probe.
726  std::ostringstream probeName;
727  probeName << utId;
728  Ptr<ApplicationDelayProbe> probe = CreateObject<ApplicationDelayProbe>();
729  probe->SetName(probeName.str());
730 
731  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
732  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
733  NS_ASSERT(satDev != nullptr);
734 
735  // Connect the object to the probe.
736  if (probe->ConnectByObject("RxLinkDelay", satDev) &&
737  ConnectProbeToCollector(probe, identifier))
738  {
739  m_probes.push_back(probe->GetObject<Probe>());
740 
741  // Enable statistics-related tags and trace sources on the device.
742  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
743  }
744  else
745  {
746  NS_FATAL_ERROR("Error connecting to RxLinkDelay trace source of SatMac"
747  << " at node ID " << (*it)->GetId() << " device #2");
748  }
749 
750  } // end of `for (it = uts.Begin(); it != uts.End (); ++it)`
751 
752  // Enable statistics-related tags on the transmitting device.
753  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
754  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
755  {
756  NetDeviceContainer devs = GetGwSatNetDevice(*it);
757 
758  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
759  {
760  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
761  NS_ASSERT(satDev != nullptr);
762 
763  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
764  }
765  }
766 
767 } // end of `void DoInstallProbes ();`
768 
769 // FORWARD FEEDER LINK MAC-LEVEL /////////////////////////////////////////////////////
770 
771 NS_OBJECT_ENSURE_REGISTERED(SatStatsFwdFeederMacLinkDelayHelper);
772 
774  Ptr<const SatHelper> satHelper)
775  : SatStatsLinkDelayHelper(satHelper)
776 {
777  NS_LOG_FUNCTION(this << satHelper);
778 }
779 
781 {
782  NS_LOG_FUNCTION(this);
783 }
784 
785 TypeId // static
787 {
788  static TypeId tid =
789  TypeId("ns3::SatStatsFwdFeederMacLinkDelayHelper").SetParent<SatStatsLinkDelayHelper>();
790  return tid;
791 }
792 
793 void
795 {
796  NS_LOG_FUNCTION(this);
797 
798  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
799  Callback<void, const Time&, const Address&> callback =
801 
802  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
803  {
804  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
805  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
806  NS_ASSERT(satGeoDev != nullptr);
807  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
808  std::map<uint32_t, Ptr<SatMac>> satGeoFeederMacs = satGeoDev->GetFeederMac();
809  Ptr<SatMac> satMac;
810  for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satGeoFeederMacs.begin();
811  it2 != satGeoFeederMacs.end();
812  ++it2)
813  {
814  satMac = it2->second;
815  NS_ASSERT(satMac != nullptr);
816  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
817 
818  // Connect the object to the probe.
819  if (satMac->TraceConnectWithoutContext("RxLinkDelay", callback))
820  {
821  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
822  << " device #" << satGeoDev->GetIfIndex());
823 
824  // Enable statistics-related tags and trace sources on the device.
825  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
826  }
827  else
828  {
829  NS_FATAL_ERROR("Error connecting to RxLinkDelay trace source of SatNetDevice"
830  << " at node ID " << (*it)->GetId() << " device #"
831  << satGeoDev->GetIfIndex());
832  }
833  }
834  std::map<uint32_t, Ptr<SatMac>> satGeoUserMacs = satGeoDev->GetUserMac();
835  for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satGeoUserMacs.begin();
836  it2 != satGeoUserMacs.end();
837  ++it2)
838  {
839  satMac = it2->second;
840  NS_ASSERT(satMac != nullptr);
841  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
842  }
843  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
844 
845  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
846 
847  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
848  {
849  // Create a map of UT addresses and identifiers.
851 
852  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
853  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
854  NS_ASSERT(satDev != nullptr);
855  Ptr<SatMac> satMac = satDev->GetMac();
856  NS_ASSERT(satMac != nullptr);
857 
858  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
859  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
860 
861  } // end of `for (it = uts.Begin(); it != uts.End (); ++it)`
862 
863  // Enable statistics-related tags on the transmitting device.
864  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
865  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
866  {
867  NetDeviceContainer devs = GetGwSatNetDevice(*it);
868 
869  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
870  {
871  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
872  NS_ASSERT(satDev != nullptr);
873  Ptr<SatMac> satMac = satDev->GetMac();
874  NS_ASSERT(satMac != nullptr);
875 
876  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
877  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
878  }
879  }
880 
881 } // end of `void DoInstallProbes ();`
882 
883 // FORWARD USER LINK MAC-LEVEL /////////////////////////////////////////////////////
884 
885 NS_OBJECT_ENSURE_REGISTERED(SatStatsFwdUserMacLinkDelayHelper);
886 
888  : SatStatsLinkDelayHelper(satHelper)
889 {
890  NS_LOG_FUNCTION(this << satHelper);
891 }
892 
894 {
895  NS_LOG_FUNCTION(this);
896 }
897 
898 TypeId // static
900 {
901  static TypeId tid =
902  TypeId("ns3::SatStatsFwdUserMacLinkDelayHelper").SetParent<SatStatsLinkDelayHelper>();
903  return tid;
904 }
905 
906 void
908 {
909  NS_LOG_FUNCTION(this);
910 
911  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
912 
913  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
914  {
915  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
916  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
917  NS_ASSERT(satGeoDev != nullptr);
918  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
919  std::map<uint32_t, Ptr<SatMac>> satGeoFeederMacs = satGeoDev->GetFeederMac();
920  Ptr<SatMac> satMac;
921  for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satGeoFeederMacs.begin();
922  it2 != satGeoFeederMacs.end();
923  ++it2)
924  {
925  satMac = it2->second;
926  NS_ASSERT(satMac != nullptr);
927  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
928  }
929  std::map<uint32_t, Ptr<SatMac>> satGeoUserMacs = satGeoDev->GetUserMac();
930  for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satGeoUserMacs.begin();
931  it2 != satGeoUserMacs.end();
932  ++it2)
933  {
934  satMac = it2->second;
935  NS_ASSERT(satMac != nullptr);
936  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
937  }
938  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
939 
940  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
941 
942  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
943  {
944  const int32_t utId = GetUtId(*it);
945  NS_ASSERT_MSG(utId > 0, "Node " << (*it)->GetId() << " is not a valid UT");
946  const uint32_t identifier = GetIdentifierForUt(*it);
947 
948  // Create the probe.
949  std::ostringstream probeName;
950  probeName << utId;
951  Ptr<ApplicationDelayProbe> probe = CreateObject<ApplicationDelayProbe>();
952  probe->SetName(probeName.str());
953 
954  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
955  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
956  NS_ASSERT(satDev != nullptr);
957  Ptr<SatMac> satMac = satDev->GetMac();
958  NS_ASSERT(satMac != nullptr);
959 
960  // Connect the object to the probe.
961  if (probe->ConnectByObject("RxLinkDelay", satMac) &&
962  ConnectProbeToCollector(probe, identifier))
963  {
964  m_probes.push_back(probe->GetObject<Probe>());
965 
966  // Enable statistics-related tags and trace sources on the device.
967  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
968  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
969  }
970  else
971  {
972  NS_FATAL_ERROR("Error connecting to RxLinkDelay trace source of SatMac"
973  << " at node ID " << (*it)->GetId() << " device #2");
974  }
975 
976  } // end of `for (it = uts.Begin(); it != uts.End (); ++it)`
977 
978  // Enable statistics-related tags on the transmitting device.
979  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
980  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
981  {
982  NetDeviceContainer devs = GetGwSatNetDevice(*it);
983 
984  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
985  {
986  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
987  NS_ASSERT(satDev != nullptr);
988  Ptr<SatMac> satMac = satDev->GetMac();
989  NS_ASSERT(satMac != nullptr);
990 
991  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
992  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
993  }
994  }
995 
996 } // end of `void DoInstallProbes ();`
997 
998 // FORWARD FEEDER LINK PHY-LEVEL /////////////////////////////////////////////////////
999 
1000 NS_OBJECT_ENSURE_REGISTERED(SatStatsFwdFeederPhyLinkDelayHelper);
1001 
1003  Ptr<const SatHelper> satHelper)
1004  : SatStatsLinkDelayHelper(satHelper)
1005 {
1006  NS_LOG_FUNCTION(this << satHelper);
1007 }
1008 
1010 {
1011  NS_LOG_FUNCTION(this);
1012 }
1013 
1014 TypeId // static
1016 {
1017  static TypeId tid =
1018  TypeId("ns3::SatStatsFwdFeederPhyLinkDelayHelper").SetParent<SatStatsLinkDelayHelper>();
1019  return tid;
1020 }
1021 
1022 void
1024 {
1025  NS_LOG_FUNCTION(this);
1026 
1027  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
1028  Callback<void, const Time&, const Address&> callback =
1030 
1031  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1032  {
1033  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
1034  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
1035  NS_ASSERT(satGeoDev != nullptr);
1036  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1037  std::map<uint32_t, Ptr<SatPhy>> satGeoFeederPhys = satGeoDev->GetFeederPhy();
1038  Ptr<SatPhy> satPhy;
1039  for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satGeoFeederPhys.begin();
1040  it2 != satGeoFeederPhys.end();
1041  ++it2)
1042  {
1043  satPhy = it2->second;
1044  NS_ASSERT(satPhy != nullptr);
1045  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1046 
1047  // Connect the object to the probe.
1048  if (satPhy->TraceConnectWithoutContext("RxLinkDelay", callback))
1049  {
1050  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
1051  << " device #" << satGeoDev->GetIfIndex());
1052 
1053  // Enable statistics-related tags and trace sources on the device.
1054  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1055  }
1056  else
1057  {
1058  NS_FATAL_ERROR("Error connecting to RxLinkDelay trace source of SatNetDevice"
1059  << " at node ID " << (*it)->GetId() << " device #"
1060  << satGeoDev->GetIfIndex());
1061  }
1062  }
1063  std::map<uint32_t, Ptr<SatPhy>> satGeoUserPhys = satGeoDev->GetUserPhy();
1064  for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satGeoUserPhys.begin();
1065  it2 != satGeoUserPhys.end();
1066  ++it2)
1067  {
1068  satPhy = it2->second;
1069  NS_ASSERT(satPhy != nullptr);
1070  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1071  }
1072  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
1073 
1074  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
1075 
1076  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1077  {
1078  // Create a map of UT addresses and identifiers.
1080 
1081  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
1082  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
1083  NS_ASSERT(satDev != nullptr);
1084  Ptr<SatPhy> satPhy = satDev->GetPhy();
1085  NS_ASSERT(satPhy != nullptr);
1086 
1087  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1088  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1089 
1090  } // end of `for (it = uts.Begin(); it != uts.End (); ++it)`
1091 
1092  // Enable statistics-related tags on the transmitting device.
1093  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
1094  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1095  {
1096  NetDeviceContainer devs = GetGwSatNetDevice(*it);
1097 
1098  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1099  {
1100  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
1101  NS_ASSERT(satDev != nullptr);
1102  Ptr<SatPhy> satPhy = satDev->GetPhy();
1103  NS_ASSERT(satPhy != nullptr);
1104 
1105  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1106  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1107  }
1108  }
1109 
1110 } // end of `void DoInstallProbes ();`
1111 
1112 // FORWARD USER LINK PHY-LEVEL /////////////////////////////////////////////////////
1113 
1114 NS_OBJECT_ENSURE_REGISTERED(SatStatsFwdUserPhyLinkDelayHelper);
1115 
1117  : SatStatsLinkDelayHelper(satHelper)
1118 {
1119  NS_LOG_FUNCTION(this << satHelper);
1120 }
1121 
1123 {
1124  NS_LOG_FUNCTION(this);
1125 }
1126 
1127 TypeId // static
1129 {
1130  static TypeId tid =
1131  TypeId("ns3::SatStatsFwdUserPhyLinkDelayHelper").SetParent<SatStatsLinkDelayHelper>();
1132  return tid;
1133 }
1134 
1135 void
1137 {
1138  NS_LOG_FUNCTION(this);
1139 
1140  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
1141 
1142  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1143  {
1144  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
1145  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
1146  NS_ASSERT(satGeoDev != nullptr);
1147  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1148  std::map<uint32_t, Ptr<SatPhy>> satGeoFeederPhys = satGeoDev->GetFeederPhy();
1149  Ptr<SatPhy> satPhy;
1150  for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satGeoFeederPhys.begin();
1151  it2 != satGeoFeederPhys.end();
1152  ++it2)
1153  {
1154  satPhy = it2->second;
1155  NS_ASSERT(satPhy != nullptr);
1156  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1157  }
1158  std::map<uint32_t, Ptr<SatPhy>> satGeoUserPhys = satGeoDev->GetUserPhy();
1159  for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satGeoUserPhys.begin();
1160  it2 != satGeoUserPhys.end();
1161  ++it2)
1162  {
1163  satPhy = it2->second;
1164  NS_ASSERT(satPhy != nullptr);
1165  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1166  }
1167  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
1168 
1169  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
1170 
1171  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1172  {
1173  const int32_t utId = GetUtId(*it);
1174  NS_ASSERT_MSG(utId > 0, "Node " << (*it)->GetId() << " is not a valid UT");
1175  const uint32_t identifier = GetIdentifierForUt(*it);
1176 
1177  // Create the probe.
1178  std::ostringstream probeName;
1179  probeName << utId;
1180  Ptr<ApplicationDelayProbe> probe = CreateObject<ApplicationDelayProbe>();
1181  probe->SetName(probeName.str());
1182 
1183  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
1184  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
1185  NS_ASSERT(satDev != nullptr);
1186  Ptr<SatPhy> satPhy = satDev->GetPhy();
1187  NS_ASSERT(satPhy != nullptr);
1188 
1189  // Connect the object to the probe.
1190  if (probe->ConnectByObject("RxLinkDelay", satPhy) &&
1191  ConnectProbeToCollector(probe, identifier))
1192  {
1193  m_probes.push_back(probe->GetObject<Probe>());
1194 
1195  // Enable statistics-related tags and trace sources on the device.
1196  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1197  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1198  }
1199  else
1200  {
1201  NS_FATAL_ERROR("Error connecting to RxLinkDelay trace source of SatPhy"
1202  << " at node ID " << (*it)->GetId() << " device #2");
1203  }
1204 
1205  } // end of `for (it = uts.Begin(); it != uts.End (); ++it)`
1206 
1207  // Enable statistics-related tags on the transmitting device.
1208  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
1209  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1210  {
1211  NetDeviceContainer devs = GetGwSatNetDevice(*it);
1212 
1213  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1214  {
1215  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
1216  NS_ASSERT(satDev != nullptr);
1217  Ptr<SatPhy> satPhy = satDev->GetPhy();
1218  NS_ASSERT(satPhy != nullptr);
1219 
1220  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1221  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1222  }
1223  }
1224 
1225 } // end of `void DoInstallProbes ();`
1226 
1227 // RETURN FEEDER LINK DEV-LEVEL //////////////////////////////////////////////////////
1228 
1229 NS_OBJECT_ENSURE_REGISTERED(SatStatsRtnFeederDevLinkDelayHelper);
1230 
1232  Ptr<const SatHelper> satHelper)
1233  : SatStatsLinkDelayHelper(satHelper)
1234 {
1235  NS_LOG_FUNCTION(this << satHelper);
1236 }
1237 
1239 {
1240  NS_LOG_FUNCTION(this);
1241 }
1242 
1243 TypeId // static
1245 {
1246  static TypeId tid =
1247  TypeId("ns3::SatStatsRtnFeederDevLinkDelayHelper").SetParent<SatStatsLinkDelayHelper>();
1248  return tid;
1249 }
1250 
1251 void
1253 {
1254  NS_LOG_FUNCTION(this);
1255 
1256  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
1257 
1258  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1259  {
1260  Ptr<SatMac> satMac;
1261  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
1262  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
1263  NS_ASSERT(satGeoDev != nullptr);
1264  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1265  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
1266 
1267  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
1268  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1269  {
1270  // Create a map of UT addresses and identifiers.
1272 
1273  // Enable statistics-related tags and trace sources on the device.
1274  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
1275  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
1276  NS_ASSERT(satDev != nullptr);
1277  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1278  }
1279 
1280  // Connect to trace sources at GW nodes.
1281 
1282  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
1283  Callback<void, const Time&, const Address&> callback =
1285 
1286  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1287  {
1288  NetDeviceContainer devs = GetGwSatNetDevice(*it);
1289 
1290  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1291  {
1292  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
1293  NS_ASSERT(satDev != nullptr);
1294 
1295  // Connect the object to the probe.
1296  if (satDev->TraceConnectWithoutContext("RxLinkDelay", callback))
1297  {
1298  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
1299  << " device #" << satDev->GetIfIndex());
1300 
1301  // Enable statistics-related tags and trace sources on the device.
1302  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1303  }
1304  else
1305  {
1306  NS_FATAL_ERROR("Error connecting to RxLinkDelay trace source of SatNetDevice"
1307  << " at node ID " << (*it)->GetId() << " device #"
1308  << satDev->GetIfIndex());
1309  }
1310 
1311  } // end of `for (NetDeviceContainer::Iterator itDev = devs)`
1312 
1313  } // end of `for (NodeContainer::Iterator it = gws)`
1314 
1315 } // end of `void DoInstallProbes ();`
1316 
1317 // RETURN USER LINK DEV-LEVEL //////////////////////////////////////////////////////
1318 
1319 NS_OBJECT_ENSURE_REGISTERED(SatStatsRtnUserDevLinkDelayHelper);
1320 
1322  : SatStatsLinkDelayHelper(satHelper)
1323 {
1324  NS_LOG_FUNCTION(this << satHelper);
1325 }
1326 
1328 {
1329  NS_LOG_FUNCTION(this);
1330 }
1331 
1332 TypeId // static
1334 {
1335  static TypeId tid =
1336  TypeId("ns3::SatStatsRtnUserDevLinkDelayHelper").SetParent<SatStatsLinkDelayHelper>();
1337  return tid;
1338 }
1339 
1340 void
1342 {
1343  NS_LOG_FUNCTION(this);
1344 
1345  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
1346  Callback<void, const Time&, const Address&> callback =
1348 
1349  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1350  {
1351  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
1352  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
1353  NS_ASSERT(satGeoDev != nullptr);
1354  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1355 
1356  // Connect the object to the probe.
1357  if (satGeoDev->TraceConnectWithoutContext("RxUserLinkDelay", callback))
1358  {
1359  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
1360  << " device #" << satGeoDev->GetIfIndex());
1361  }
1362  else
1363  {
1364  NS_FATAL_ERROR("Error connecting to RxUserLinkDelay trace source of SatNetDevice"
1365  << " at node ID " << (*it)->GetId() << " device #"
1366  << satGeoDev->GetIfIndex());
1367  }
1368  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
1369 
1370  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
1371  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1372  {
1373  // Create a map of UT addresses and identifiers.
1375 
1376  // Enable statistics-related tags and trace sources on the device.
1377  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
1378  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
1379  NS_ASSERT(satDev != nullptr);
1380  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1381  }
1382 
1383  // Connect to trace sources at GW nodes.
1384 
1385  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
1386 
1387  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1388  {
1389  NetDeviceContainer devs = GetGwSatNetDevice(*it);
1390 
1391  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1392  {
1393  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
1394  NS_ASSERT(satDev != nullptr);
1395 
1396  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1397  } // end of `for (NetDeviceContainer::Iterator itDev = devs)`
1398 
1399  } // end of `for (NodeContainer::Iterator it = gws)`
1400 
1401 } // end of `void DoInstallProbes ();`
1402 
1403 // RETURN FEEDER LINK MAC-LEVEL //////////////////////////////////////////////////////
1404 
1405 NS_OBJECT_ENSURE_REGISTERED(SatStatsRtnFeederMacLinkDelayHelper);
1406 
1408  Ptr<const SatHelper> satHelper)
1409  : SatStatsLinkDelayHelper(satHelper)
1410 {
1411  NS_LOG_FUNCTION(this << satHelper);
1412 }
1413 
1415 {
1416  NS_LOG_FUNCTION(this);
1417 }
1418 
1419 TypeId // static
1421 {
1422  static TypeId tid =
1423  TypeId("ns3::SatStatsRtnFeederMacLinkDelayHelper").SetParent<SatStatsLinkDelayHelper>();
1424  return tid;
1425 }
1426 
1427 void
1429 {
1430  NS_LOG_FUNCTION(this);
1431 
1432  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
1433 
1434  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1435  {
1436  Ptr<SatMac> satMac;
1437  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
1438  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
1439  NS_ASSERT(satGeoDev != nullptr);
1440  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1441  std::map<uint32_t, Ptr<SatMac>> satGeoFeederMacs = satGeoDev->GetFeederMac();
1442  for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satGeoFeederMacs.begin();
1443  it2 != satGeoFeederMacs.end();
1444  ++it2)
1445  {
1446  satMac = it2->second;
1447  NS_ASSERT(satMac != nullptr);
1448  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1449  }
1450  std::map<uint32_t, Ptr<SatMac>> satGeoUserMacs = satGeoDev->GetUserMac();
1451  for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satGeoUserMacs.begin();
1452  it2 != satGeoUserMacs.end();
1453  ++it2)
1454  {
1455  satMac = it2->second;
1456  NS_ASSERT(satMac != nullptr);
1457  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1458  }
1459  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
1460 
1461  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
1462  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1463  {
1464  // Create a map of UT addresses and identifiers.
1466 
1467  // Enable statistics-related tags and trace sources on the device.
1468  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
1469  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
1470  NS_ASSERT(satDev != nullptr);
1471  Ptr<SatMac> satMac = satDev->GetMac();
1472  NS_ASSERT(satMac != nullptr);
1473  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1474  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1475  }
1476 
1477  // Connect to trace sources at GW nodes.
1478 
1479  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
1480  Callback<void, const Time&, const Address&> callback =
1482 
1483  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1484  {
1485  NetDeviceContainer devs = GetGwSatNetDevice(*it);
1486 
1487  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1488  {
1489  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
1490  NS_ASSERT(satDev != nullptr);
1491  Ptr<SatMac> satMac = satDev->GetMac();
1492  NS_ASSERT(satMac != nullptr);
1493 
1494  // Connect the object to the probe.
1495  if (satMac->TraceConnectWithoutContext("RxLinkDelay", callback))
1496  {
1497  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
1498  << " device #" << satDev->GetIfIndex());
1499 
1500  // Enable statistics-related tags and trace sources on the device.
1501  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1502  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1503  }
1504  else
1505  {
1506  NS_FATAL_ERROR("Error connecting to RxLinkDelay trace source of SatNetDevice"
1507  << " at node ID " << (*it)->GetId() << " device #"
1508  << satDev->GetIfIndex());
1509  }
1510 
1511  } // end of `for (NetDeviceContainer::Iterator itDev = devs)`
1512 
1513  } // end of `for (NodeContainer::Iterator it = gws)`
1514 
1515 } // end of `void DoInstallProbes ();`
1516 
1517 // RETURN USER LINK MAC-LEVEL //////////////////////////////////////////////////////
1518 
1519 NS_OBJECT_ENSURE_REGISTERED(SatStatsRtnUserMacLinkDelayHelper);
1520 
1522  : SatStatsLinkDelayHelper(satHelper)
1523 {
1524  NS_LOG_FUNCTION(this << satHelper);
1525 }
1526 
1528 {
1529  NS_LOG_FUNCTION(this);
1530 }
1531 
1532 TypeId // static
1534 {
1535  static TypeId tid =
1536  TypeId("ns3::SatStatsRtnUserMacLinkDelayHelper").SetParent<SatStatsLinkDelayHelper>();
1537  return tid;
1538 }
1539 
1540 void
1542 {
1543  NS_LOG_FUNCTION(this);
1544 
1545  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
1546  Callback<void, const Time&, const Address&> callback =
1548 
1549  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1550  {
1551  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
1552  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
1553  NS_ASSERT(satGeoDev != nullptr);
1554  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1555  std::map<uint32_t, Ptr<SatMac>> satGeoFeederMacs = satGeoDev->GetFeederMac();
1556  Ptr<SatMac> satMac;
1557  for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satGeoFeederMacs.begin();
1558  it2 != satGeoFeederMacs.end();
1559  ++it2)
1560  {
1561  satMac = it2->second;
1562  NS_ASSERT(satMac != nullptr);
1563  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1564  }
1565  std::map<uint32_t, Ptr<SatMac>> satGeoUserMacs = satGeoDev->GetUserMac();
1566  for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satGeoUserMacs.begin();
1567  it2 != satGeoUserMacs.end();
1568  ++it2)
1569  {
1570  satMac = it2->second;
1571  NS_ASSERT(satMac != nullptr);
1572  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1573 
1574  // Connect the object to the probe.
1575  if (satMac->TraceConnectWithoutContext("RxLinkDelay", callback))
1576  {
1577  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
1578  << " device #" << satGeoDev->GetIfIndex());
1579  }
1580  else
1581  {
1582  NS_FATAL_ERROR("Error connecting to RxLinkDelay trace source of SatNetDevice"
1583  << " at node ID " << (*it)->GetId() << " device #"
1584  << satGeoDev->GetIfIndex());
1585  }
1586  }
1587  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
1588 
1589  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
1590  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1591  {
1592  // Create a map of UT addresses and identifiers.
1594 
1595  // Enable statistics-related tags and trace sources on the device.
1596  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
1597  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
1598  NS_ASSERT(satDev != nullptr);
1599  Ptr<SatMac> satMac = satDev->GetMac();
1600  NS_ASSERT(satMac != nullptr);
1601  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1602  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1603  }
1604 
1605  // Connect to trace sources at GW nodes.
1606 
1607  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
1608 
1609  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1610  {
1611  NetDeviceContainer devs = GetGwSatNetDevice(*it);
1612 
1613  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1614  {
1615  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
1616  NS_ASSERT(satDev != nullptr);
1617  Ptr<SatMac> satMac = satDev->GetMac();
1618  NS_ASSERT(satMac != nullptr);
1619 
1620  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1621  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1622  } // end of `for (NetDeviceContainer::Iterator itDev = devs)`
1623 
1624  } // end of `for (NodeContainer::Iterator it = gws)`
1625 
1626 } // end of `void DoInstallProbes ();`
1627 
1628 // RETURN FEEDER LINK PHY-LEVEL //////////////////////////////////////////////////////
1629 
1630 NS_OBJECT_ENSURE_REGISTERED(SatStatsRtnFeederPhyLinkDelayHelper);
1631 
1633  Ptr<const SatHelper> satHelper)
1634  : SatStatsLinkDelayHelper(satHelper)
1635 {
1636  NS_LOG_FUNCTION(this << satHelper);
1637 }
1638 
1640 {
1641  NS_LOG_FUNCTION(this);
1642 }
1643 
1644 TypeId // static
1646 {
1647  static TypeId tid =
1648  TypeId("ns3::SatStatsRtnFeederPhyLinkDelayHelper").SetParent<SatStatsLinkDelayHelper>();
1649  return tid;
1650 }
1651 
1652 void
1654 {
1655  NS_LOG_FUNCTION(this);
1656 
1657  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
1658 
1659  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1660  {
1661  Ptr<SatPhy> satPhy;
1662  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
1663  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
1664  NS_ASSERT(satGeoDev != nullptr);
1665  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1666  std::map<uint32_t, Ptr<SatPhy>> satGeoFeederPhys = satGeoDev->GetFeederPhy();
1667  for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satGeoFeederPhys.begin();
1668  it2 != satGeoFeederPhys.end();
1669  ++it2)
1670  {
1671  satPhy = it2->second;
1672  NS_ASSERT(satPhy != nullptr);
1673  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1674  }
1675  std::map<uint32_t, Ptr<SatPhy>> satGeoUserPhys = satGeoDev->GetUserPhy();
1676  for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satGeoUserPhys.begin();
1677  it2 != satGeoUserPhys.end();
1678  ++it2)
1679  {
1680  satPhy = it2->second;
1681  NS_ASSERT(satPhy != nullptr);
1682  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1683  }
1684  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
1685 
1686  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
1687  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1688  {
1689  // Create a map of UT addresses and identifiers.
1691 
1692  // Enable statistics-related tags and trace sources on the device.
1693  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
1694  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
1695  NS_ASSERT(satDev != nullptr);
1696  Ptr<SatPhy> satPhy = satDev->GetPhy();
1697  NS_ASSERT(satPhy != nullptr);
1698  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1699  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1700  }
1701 
1702  // Connect to trace sources at GW nodes.
1703 
1704  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
1705  Callback<void, const Time&, const Address&> callback =
1707 
1708  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1709  {
1710  NetDeviceContainer devs = GetGwSatNetDevice(*it);
1711 
1712  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1713  {
1714  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
1715  NS_ASSERT(satDev != nullptr);
1716  Ptr<SatPhy> satPhy = satDev->GetPhy();
1717  NS_ASSERT(satPhy != nullptr);
1718 
1719  // Connect the object to the probe.
1720  if (satPhy->TraceConnectWithoutContext("RxLinkDelay", callback))
1721  {
1722  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
1723  << " device #" << satDev->GetIfIndex());
1724 
1725  // Enable statistics-related tags and trace sources on the device.
1726  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1727  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1728  }
1729  else
1730  {
1731  NS_FATAL_ERROR("Error connecting to RxLinkDelay trace source of SatNetDevice"
1732  << " at node ID " << (*it)->GetId() << " device #"
1733  << satDev->GetIfIndex());
1734  }
1735 
1736  } // end of `for (NetDeviceContainer::Iterator itDev = devs)`
1737 
1738  } // end of `for (NodeContainer::Iterator it = gws)`
1739 
1740 } // end of `void DoInstallProbes ();`
1741 
1742 // RETURN USER LINK PHY-LEVEL //////////////////////////////////////////////////////
1743 
1744 NS_OBJECT_ENSURE_REGISTERED(SatStatsRtnUserPhyLinkDelayHelper);
1745 
1747  : SatStatsLinkDelayHelper(satHelper)
1748 {
1749  NS_LOG_FUNCTION(this << satHelper);
1750 }
1751 
1753 {
1754  NS_LOG_FUNCTION(this);
1755 }
1756 
1757 TypeId // static
1759 {
1760  static TypeId tid =
1761  TypeId("ns3::SatStatsRtnUserPhyLinkDelayHelper").SetParent<SatStatsLinkDelayHelper>();
1762  return tid;
1763 }
1764 
1765 void
1767 {
1768  NS_LOG_FUNCTION(this);
1769 
1770  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
1771  Callback<void, const Time&, const Address&> callback =
1773 
1774  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1775  {
1776  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
1777  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
1778  NS_ASSERT(satGeoDev != nullptr);
1779  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1780  std::map<uint32_t, Ptr<SatPhy>> satGeoFeederPhys = satGeoDev->GetFeederPhy();
1781  Ptr<SatPhy> satPhy;
1782  for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satGeoFeederPhys.begin();
1783  it2 != satGeoFeederPhys.end();
1784  ++it2)
1785  {
1786  satPhy = it2->second;
1787  NS_ASSERT(satPhy != nullptr);
1788  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1789  }
1790  std::map<uint32_t, Ptr<SatPhy>> satGeoUserPhys = satGeoDev->GetUserPhy();
1791  for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satGeoUserPhys.begin();
1792  it2 != satGeoUserPhys.end();
1793  ++it2)
1794  {
1795  satPhy = it2->second;
1796  NS_ASSERT(satPhy != nullptr);
1797  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1798 
1799  // Connect the object to the probe.
1800  if (satPhy->TraceConnectWithoutContext("RxLinkDelay", callback))
1801  {
1802  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
1803  << " device #" << satGeoDev->GetIfIndex());
1804  }
1805  else
1806  {
1807  NS_FATAL_ERROR("Error connecting to RxLinkDelay trace source of SatNetDevice"
1808  << " at node ID " << (*it)->GetId() << " device #"
1809  << satGeoDev->GetIfIndex());
1810  }
1811  }
1812  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
1813 
1814  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
1815  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1816  {
1817  // Create a map of UT addresses and identifiers.
1819 
1820  // Enable statistics-related tags and trace sources on the device.
1821  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
1822  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
1823  NS_ASSERT(satDev != nullptr);
1824  Ptr<SatPhy> satPhy = satDev->GetPhy();
1825  NS_ASSERT(satPhy != nullptr);
1826  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1827  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1828  }
1829 
1830  // Connect to trace sources at GW nodes.
1831 
1832  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
1833 
1834  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1835  {
1836  NetDeviceContainer devs = GetGwSatNetDevice(*it);
1837 
1838  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1839  {
1840  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
1841  NS_ASSERT(satDev != nullptr);
1842  Ptr<SatPhy> satPhy = satDev->GetPhy();
1843  NS_ASSERT(satPhy != nullptr);
1844 
1845  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1846  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1847  } // end of `for (NetDeviceContainer::Iterator itDev = devs)`
1848 
1849  } // end of `for (NodeContainer::Iterator it = gws)`
1850 
1851 } // end of `void DoInstallProbes ();`
1852 
1853 } // 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.
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 GetUtId(Ptr< Node > utNode) const
uint32_t CreateCollectorPerIdentifier(CollectorMap &collectorMap) const
Create one collector instance for each identifier in the simulation.
static Ptr< NetDevice > GetUtSatNetDevice(Ptr< Node > utNode)
OutputType_t GetOutputType() const
uint32_t GetIdentifierForUt(Ptr< Node > utNode) const
std::string GetName() const
virtual std::string GetTimeHeading(std::string dataLabel) const
virtual std::string GetDistributionHeading(std::string dataLabel) const
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.