satellite-stats-link-jitter-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("SatStatsLinkJitterHelper");
57 
58 namespace ns3
59 {
60 
61 NS_OBJECT_ENSURE_REGISTERED(SatStatsLinkJitterHelper);
62 
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::SatStatsLinkJitterHelper")
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(&SatStatsLinkJitterHelper::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("jitter_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("jitter_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("jitter_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("jitter_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 jitter (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 jitter (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 jitter (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("SatStatsLinkJitterHelper - 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 SatStatsLinkJitterHelper::RxLinkJitterCallback(const Time& jitter, const Address& from)
419 {
420  // NS_LOG_FUNCTION (this << jitter.GetSeconds () << from);
421 
422  if (from.IsInvalid())
423  {
424  NS_LOG_WARN(this << " discarding a packet jitter of " << jitter.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(jitter, 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(jitter, it->second);
443  }
444  else
445  {
446  NS_LOG_WARN(this << " discarding a packet jitter of " << jitter.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 SatStatsLinkJitterHelper::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 SatStatsLinkJitterHelper::PassSampleToCollector(const Time& jitter, uint32_t identifier)
541 {
542  // NS_LOG_FUNCTION (this << jitter.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, jitter.GetSeconds());
554  break;
555  }
556 
559  Ptr<UnitConversionCollector> c = collector->GetObject<UnitConversionCollector>();
560  NS_ASSERT(c != nullptr);
561  c->TraceSinkDouble(0.0, jitter.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, jitter.GetSeconds());
576  }
577  else
578  {
579  Ptr<DistributionCollector> c = collector->GetObject<DistributionCollector>();
580  NS_ASSERT(c != nullptr);
581  c->TraceSinkDouble(0.0, jitter.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 void
596 {
597  m_channelLink = channelLink;
598 }
599 
600 // FORWARD FEEDER LINK DEV-LEVEL /////////////////////////////////////////////////////
601 
602 NS_OBJECT_ENSURE_REGISTERED(SatStatsFwdFeederDevLinkJitterHelper);
603 
605  Ptr<const SatHelper> satHelper)
606  : SatStatsLinkJitterHelper(satHelper)
607 {
608  NS_LOG_FUNCTION(this << satHelper);
609 }
610 
612 {
613  NS_LOG_FUNCTION(this);
614 }
615 
616 TypeId // static
618 {
619  static TypeId tid =
620  TypeId("ns3::SatStatsFwdFeederDevLinkJitterHelper").SetParent<SatStatsLinkJitterHelper>();
621  return tid;
622 }
623 
624 void
626 {
627  NS_LOG_FUNCTION(this);
628 
629  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
630  Callback<void, const Time&, const Address&> callback =
632 
633  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
634  {
635  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
636  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
637  NS_ASSERT(satGeoDev != nullptr);
638  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
639  if (satGeoDev->TraceConnectWithoutContext("RxFeederLinkJitter", callback))
640  {
641  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
642  << " device #" << satGeoDev->GetIfIndex());
643  }
644  else
645  {
646  NS_FATAL_ERROR("Error connecting to RxFeederLinkJitter trace source of SatNetDevice"
647  << " at node ID " << (*it)->GetId() << " device #"
648  << satGeoDev->GetIfIndex());
649  }
650  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
651 
652  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
653 
654  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
655  {
656  // Create a map of UT addresses and identifiers.
658 
659  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
660  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
661  NS_ASSERT(satDev != nullptr);
662 
663  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
664 
665  } // end of `for (it = uts.Begin(); it != uts.End (); ++it)`
666 
667  // Enable statistics-related tags on the transmitting device.
668  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
669  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
670  {
671  NetDeviceContainer devs = GetGwSatNetDevice(*it);
672 
673  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
674  {
675  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
676  NS_ASSERT(satDev != nullptr);
677 
678  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
679  }
680  }
681 
682 } // end of `void DoInstallProbes ();`
683 
684 // FORWARD USER LINK DEV-LEVEL /////////////////////////////////////////////////////
685 
686 NS_OBJECT_ENSURE_REGISTERED(SatStatsFwdUserDevLinkJitterHelper);
687 
689  Ptr<const SatHelper> satHelper)
690  : SatStatsLinkJitterHelper(satHelper)
691 {
692  NS_LOG_FUNCTION(this << satHelper);
693 }
694 
696 {
697  NS_LOG_FUNCTION(this);
698 }
699 
700 TypeId // static
702 {
703  static TypeId tid =
704  TypeId("ns3::SatStatsFwdUserDevLinkJitterHelper").SetParent<SatStatsLinkJitterHelper>();
705  return tid;
706 }
707 
708 void
710 {
711  NS_LOG_FUNCTION(this);
712 
713  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
714 
715  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
716  {
717  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
718  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
719  NS_ASSERT(satGeoDev != nullptr);
720  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
721  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
722 
723  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
724 
725  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
726  {
727  const int32_t utId = GetUtId(*it);
728  NS_ASSERT_MSG(utId > 0, "Node " << (*it)->GetId() << " is not a valid UT");
729  const uint32_t identifier = GetIdentifierForUt(*it);
730 
731  // Create the probe.
732  std::ostringstream probeName;
733  probeName << utId;
734  Ptr<ApplicationDelayProbe> probe = CreateObject<ApplicationDelayProbe>();
735  probe->SetName(probeName.str());
736 
737  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
738  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
739  NS_ASSERT(satDev != nullptr);
740 
741  // Connect the object to the probe.
742  if (probe->ConnectByObject("RxLinkJitter", satDev) &&
743  ConnectProbeToCollector(probe, identifier))
744  {
745  m_probes.push_back(probe->GetObject<Probe>());
746 
747  // Enable statistics-related tags and trace sources on the device.
748  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
749  }
750  else
751  {
752  NS_FATAL_ERROR("Error connecting to RxLinkJitter trace source of SatMac"
753  << " at node ID " << (*it)->GetId() << " device #2");
754  }
755 
756  } // end of `for (it = uts.Begin(); it != uts.End (); ++it)`
757 
758  // Enable statistics-related tags on the transmitting device.
759  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
760  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
761  {
762  NetDeviceContainer devs = GetGwSatNetDevice(*it);
763 
764  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
765  {
766  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
767  NS_ASSERT(satDev != nullptr);
768 
769  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
770  }
771  }
772 
773 } // end of `void DoInstallProbes ();`
774 
775 // FORWARD FEEDER LINK MAC-LEVEL /////////////////////////////////////////////////////
776 
777 NS_OBJECT_ENSURE_REGISTERED(SatStatsFwdFeederMacLinkJitterHelper);
778 
780  Ptr<const SatHelper> satHelper)
781  : SatStatsLinkJitterHelper(satHelper)
782 {
783  NS_LOG_FUNCTION(this << satHelper);
784 }
785 
787 {
788  NS_LOG_FUNCTION(this);
789 }
790 
791 TypeId // static
793 {
794  static TypeId tid =
795  TypeId("ns3::SatStatsFwdFeederMacLinkJitterHelper").SetParent<SatStatsLinkJitterHelper>();
796  return tid;
797 }
798 
799 void
801 {
802  NS_LOG_FUNCTION(this);
803 
804  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
805  Callback<void, const Time&, const Address&> callback =
807 
808  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
809  {
810  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
811  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
812  NS_ASSERT(satGeoDev != nullptr);
813  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
814  std::map<uint32_t, Ptr<SatMac>> satGeoFeederMacs = satGeoDev->GetFeederMac();
815  Ptr<SatMac> satMac;
816  for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satGeoFeederMacs.begin();
817  it2 != satGeoFeederMacs.end();
818  ++it2)
819  {
820  satMac = it2->second;
821  NS_ASSERT(satMac != nullptr);
822  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
823 
824  // Connect the object to the probe.
825  if (satMac->TraceConnectWithoutContext("RxLinkJitter", callback))
826  {
827  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
828  << " device #" << satGeoDev->GetIfIndex());
829 
830  // Enable statistics-related tags and trace sources on the device.
831  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
832  }
833  else
834  {
835  NS_FATAL_ERROR("Error connecting to RxLinkJitter trace source of SatNetDevice"
836  << " at node ID " << (*it)->GetId() << " device #"
837  << satGeoDev->GetIfIndex());
838  }
839  }
840  std::map<uint32_t, Ptr<SatMac>> satGeoUserMacs = satGeoDev->GetUserMac();
841  for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satGeoUserMacs.begin();
842  it2 != satGeoUserMacs.end();
843  ++it2)
844  {
845  satMac = it2->second;
846  NS_ASSERT(satMac != nullptr);
847  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
848  }
849  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
850 
851  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
852 
853  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
854  {
855  // Create a map of UT addresses and identifiers.
857 
858  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
859  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
860  NS_ASSERT(satDev != nullptr);
861  Ptr<SatMac> satMac = satDev->GetMac();
862  NS_ASSERT(satMac != nullptr);
863 
864  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
865  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
866 
867  } // end of `for (it = uts.Begin(); it != uts.End (); ++it)`
868 
869  // Enable statistics-related tags on the transmitting device.
870  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
871  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
872  {
873  NetDeviceContainer devs = GetGwSatNetDevice(*it);
874 
875  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
876  {
877  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
878  NS_ASSERT(satDev != nullptr);
879  Ptr<SatMac> satMac = satDev->GetMac();
880  NS_ASSERT(satMac != nullptr);
881 
882  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
883  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
884  }
885  }
886 
887 } // end of `void DoInstallProbes ();`
888 
889 // FORWARD USER LINK MAC-LEVEL /////////////////////////////////////////////////////
890 
891 NS_OBJECT_ENSURE_REGISTERED(SatStatsFwdUserMacLinkJitterHelper);
892 
894  Ptr<const SatHelper> satHelper)
895  : SatStatsLinkJitterHelper(satHelper)
896 {
897  NS_LOG_FUNCTION(this << satHelper);
898 }
899 
901 {
902  NS_LOG_FUNCTION(this);
903 }
904 
905 TypeId // static
907 {
908  static TypeId tid =
909  TypeId("ns3::SatStatsFwdUserMacLinkJitterHelper").SetParent<SatStatsLinkJitterHelper>();
910  return tid;
911 }
912 
913 void
915 {
916  NS_LOG_FUNCTION(this);
917 
918  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
919 
920  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
921  {
922  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
923  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
924  NS_ASSERT(satGeoDev != nullptr);
925  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
926  std::map<uint32_t, Ptr<SatMac>> satGeoFeederMacs = satGeoDev->GetFeederMac();
927  Ptr<SatMac> satMac;
928  for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satGeoFeederMacs.begin();
929  it2 != satGeoFeederMacs.end();
930  ++it2)
931  {
932  satMac = it2->second;
933  NS_ASSERT(satMac != nullptr);
934  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
935  }
936  std::map<uint32_t, Ptr<SatMac>> satGeoUserMacs = satGeoDev->GetUserMac();
937  for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satGeoUserMacs.begin();
938  it2 != satGeoUserMacs.end();
939  ++it2)
940  {
941  satMac = it2->second;
942  NS_ASSERT(satMac != nullptr);
943  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
944  }
945  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
946 
947  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
948 
949  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
950  {
951  const int32_t utId = GetUtId(*it);
952  NS_ASSERT_MSG(utId > 0, "Node " << (*it)->GetId() << " is not a valid UT");
953  const uint32_t identifier = GetIdentifierForUt(*it);
954 
955  // Create the probe.
956  std::ostringstream probeName;
957  probeName << utId;
958  Ptr<ApplicationDelayProbe> probe = CreateObject<ApplicationDelayProbe>();
959  probe->SetName(probeName.str());
960 
961  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
962  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
963  NS_ASSERT(satDev != nullptr);
964  Ptr<SatMac> satMac = satDev->GetMac();
965  NS_ASSERT(satMac != nullptr);
966 
967  // Connect the object to the probe.
968  if (probe->ConnectByObject("RxLinkJitter", satMac) &&
969  ConnectProbeToCollector(probe, identifier))
970  {
971  m_probes.push_back(probe->GetObject<Probe>());
972 
973  // Enable statistics-related tags and trace sources on the device.
974  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
975  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
976  }
977  else
978  {
979  NS_FATAL_ERROR("Error connecting to RxLinkJitter trace source of SatMac"
980  << " at node ID " << (*it)->GetId() << " device #2");
981  }
982 
983  } // end of `for (it = uts.Begin(); it != uts.End (); ++it)`
984 
985  // Enable statistics-related tags on the transmitting device.
986  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
987  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
988  {
989  NetDeviceContainer devs = GetGwSatNetDevice(*it);
990 
991  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
992  {
993  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
994  NS_ASSERT(satDev != nullptr);
995  Ptr<SatMac> satMac = satDev->GetMac();
996  NS_ASSERT(satMac != nullptr);
997 
998  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
999  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1000  }
1001  }
1002 
1003 } // end of `void DoInstallProbes ();`
1004 
1005 // FORWARD FEEDER LINK PHY-LEVEL /////////////////////////////////////////////////////
1006 
1007 NS_OBJECT_ENSURE_REGISTERED(SatStatsFwdFeederPhyLinkJitterHelper);
1008 
1010  Ptr<const SatHelper> satHelper)
1011  : SatStatsLinkJitterHelper(satHelper)
1012 {
1013  NS_LOG_FUNCTION(this << satHelper);
1014 
1016 }
1017 
1019 {
1020  NS_LOG_FUNCTION(this);
1021 }
1022 
1023 TypeId // static
1025 {
1026  static TypeId tid =
1027  TypeId("ns3::SatStatsFwdFeederPhyLinkJitterHelper").SetParent<SatStatsLinkJitterHelper>();
1028  return tid;
1029 }
1030 
1031 void
1033 {
1034  NS_LOG_FUNCTION(this);
1035 
1036  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
1037  Callback<void, const Time&, const Address&> callback =
1039 
1040  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1041  {
1042  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
1043  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
1044  NS_ASSERT(satGeoDev != nullptr);
1045  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1046  std::map<uint32_t, Ptr<SatPhy>> satGeoFeederPhys = satGeoDev->GetFeederPhy();
1047  Ptr<SatPhy> satPhy;
1048  for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satGeoFeederPhys.begin();
1049  it2 != satGeoFeederPhys.end();
1050  ++it2)
1051  {
1052  satPhy = it2->second;
1053  NS_ASSERT(satPhy != nullptr);
1054  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1055 
1056  // Connect the object to the probe.
1057  if (satPhy->TraceConnectWithoutContext("RxLinkJitter", callback))
1058  {
1059  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
1060  << " device #" << satGeoDev->GetIfIndex());
1061 
1062  // Enable statistics-related tags and trace sources on the device.
1063  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1064  }
1065  else
1066  {
1067  NS_FATAL_ERROR("Error connecting to RxLinkJitter trace source of SatNetDevice"
1068  << " at node ID " << (*it)->GetId() << " device #"
1069  << satGeoDev->GetIfIndex());
1070  }
1071  }
1072  std::map<uint32_t, Ptr<SatPhy>> satGeoUserPhys = satGeoDev->GetUserPhy();
1073  for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satGeoUserPhys.begin();
1074  it2 != satGeoUserPhys.end();
1075  ++it2)
1076  {
1077  satPhy = it2->second;
1078  NS_ASSERT(satPhy != nullptr);
1079  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1080  }
1081  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
1082 
1083  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
1084 
1085  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1086  {
1087  // Create a map of UT addresses and identifiers.
1089 
1090  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
1091  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
1092  NS_ASSERT(satDev != nullptr);
1093  Ptr<SatPhy> satPhy = satDev->GetPhy();
1094  NS_ASSERT(satPhy != nullptr);
1095 
1096  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1097  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1098 
1099  } // end of `for (it = uts.Begin(); it != uts.End (); ++it)`
1100 
1101  // Enable statistics-related tags on the transmitting device.
1102  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
1103  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1104  {
1105  NetDeviceContainer devs = GetGwSatNetDevice(*it);
1106 
1107  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1108  {
1109  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
1110  NS_ASSERT(satDev != nullptr);
1111  Ptr<SatPhy> satPhy = satDev->GetPhy();
1112  NS_ASSERT(satPhy != nullptr);
1113 
1114  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1115  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1116  }
1117  }
1118 
1119 } // end of `void DoInstallProbes ();`
1120 
1121 // FORWARD USER LINK PHY-LEVEL /////////////////////////////////////////////////////
1122 
1123 NS_OBJECT_ENSURE_REGISTERED(SatStatsFwdUserPhyLinkJitterHelper);
1124 
1126  Ptr<const SatHelper> satHelper)
1127  : SatStatsLinkJitterHelper(satHelper)
1128 {
1129  NS_LOG_FUNCTION(this << satHelper);
1130 
1132 }
1133 
1135 {
1136  NS_LOG_FUNCTION(this);
1137 }
1138 
1139 TypeId // static
1141 {
1142  static TypeId tid =
1143  TypeId("ns3::SatStatsFwdUserPhyLinkJitterHelper").SetParent<SatStatsLinkJitterHelper>();
1144  return tid;
1145 }
1146 
1147 void
1149 {
1150  NS_LOG_FUNCTION(this);
1151 
1152  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
1153 
1154  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1155  {
1156  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
1157  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
1158  NS_ASSERT(satGeoDev != nullptr);
1159  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1160  std::map<uint32_t, Ptr<SatPhy>> satGeoFeederPhys = satGeoDev->GetFeederPhy();
1161  Ptr<SatPhy> satPhy;
1162  for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satGeoFeederPhys.begin();
1163  it2 != satGeoFeederPhys.end();
1164  ++it2)
1165  {
1166  satPhy = it2->second;
1167  NS_ASSERT(satPhy != nullptr);
1168  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1169  }
1170  std::map<uint32_t, Ptr<SatPhy>> satGeoUserPhys = satGeoDev->GetUserPhy();
1171  for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satGeoUserPhys.begin();
1172  it2 != satGeoUserPhys.end();
1173  ++it2)
1174  {
1175  satPhy = it2->second;
1176  NS_ASSERT(satPhy != nullptr);
1177  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1178  }
1179  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
1180 
1181  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
1182 
1183  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1184  {
1185  const int32_t utId = GetUtId(*it);
1186  NS_ASSERT_MSG(utId > 0, "Node " << (*it)->GetId() << " is not a valid UT");
1187  const uint32_t identifier = GetIdentifierForUt(*it);
1188 
1189  // Create the probe.
1190  std::ostringstream probeName;
1191  probeName << utId;
1192  Ptr<ApplicationDelayProbe> probe = CreateObject<ApplicationDelayProbe>();
1193  probe->SetName(probeName.str());
1194 
1195  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
1196  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
1197  NS_ASSERT(satDev != nullptr);
1198  Ptr<SatPhy> satPhy = satDev->GetPhy();
1199  NS_ASSERT(satPhy != nullptr);
1200 
1201  // Connect the object to the probe.
1202  if (probe->ConnectByObject("RxLinkJitter", satPhy) &&
1203  ConnectProbeToCollector(probe, identifier))
1204  {
1205  m_probes.push_back(probe->GetObject<Probe>());
1206 
1207  // Enable statistics-related tags and trace sources on the device.
1208  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1209  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1210  }
1211  else
1212  {
1213  NS_FATAL_ERROR("Error connecting to RxLinkJitter trace source of SatPhy"
1214  << " at node ID " << (*it)->GetId() << " device #2");
1215  }
1216 
1217  } // end of `for (it = uts.Begin(); it != uts.End (); ++it)`
1218 
1219  // Enable statistics-related tags on the transmitting device.
1220  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
1221  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1222  {
1223  NetDeviceContainer devs = GetGwSatNetDevice(*it);
1224 
1225  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1226  {
1227  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
1228  NS_ASSERT(satDev != nullptr);
1229  Ptr<SatPhy> satPhy = satDev->GetPhy();
1230  NS_ASSERT(satPhy != nullptr);
1231 
1232  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1233  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1234  }
1235  }
1236 
1237 } // end of `void DoInstallProbes ();`
1238 
1239 // RETURN FEEDER LINK DEV-LEVEL //////////////////////////////////////////////////////
1240 
1241 NS_OBJECT_ENSURE_REGISTERED(SatStatsRtnFeederDevLinkJitterHelper);
1242 
1244  Ptr<const SatHelper> satHelper)
1245  : SatStatsLinkJitterHelper(satHelper)
1246 {
1247  NS_LOG_FUNCTION(this << satHelper);
1248 }
1249 
1251 {
1252  NS_LOG_FUNCTION(this);
1253 }
1254 
1255 TypeId // static
1257 {
1258  static TypeId tid =
1259  TypeId("ns3::SatStatsRtnFeederDevLinkJitterHelper").SetParent<SatStatsLinkJitterHelper>();
1260  return tid;
1261 }
1262 
1263 void
1265 {
1266  NS_LOG_FUNCTION(this);
1267 
1268  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
1269 
1270  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1271  {
1272  Ptr<SatMac> satMac;
1273  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
1274  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
1275  NS_ASSERT(satGeoDev != nullptr);
1276  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1277  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
1278 
1279  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
1280  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1281  {
1282  // Create a map of UT addresses and identifiers.
1284 
1285  // Enable statistics-related tags and trace sources on the device.
1286  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
1287  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
1288  NS_ASSERT(satDev != nullptr);
1289  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1290  }
1291 
1292  // Connect to trace sources at GW nodes.
1293 
1294  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
1295  Callback<void, const Time&, const Address&> callback =
1297 
1298  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1299  {
1300  NetDeviceContainer devs = GetGwSatNetDevice(*it);
1301 
1302  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1303  {
1304  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
1305  NS_ASSERT(satDev != nullptr);
1306 
1307  // Connect the object to the probe.
1308  if (satDev->TraceConnectWithoutContext("RxLinkJitter", callback))
1309  {
1310  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
1311  << " device #" << satDev->GetIfIndex());
1312 
1313  // Enable statistics-related tags and trace sources on the device.
1314  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1315  }
1316  else
1317  {
1318  NS_FATAL_ERROR("Error connecting to RxLinkJitter trace source of SatNetDevice"
1319  << " at node ID " << (*it)->GetId() << " device #"
1320  << satDev->GetIfIndex());
1321  }
1322 
1323  } // end of `for (NetDeviceContainer::Iterator itDev = devs)`
1324 
1325  } // end of `for (NodeContainer::Iterator it = gws)`
1326 
1327 } // end of `void DoInstallProbes ();`
1328 
1329 // RETURN USER LINK DEV-LEVEL //////////////////////////////////////////////////////
1330 
1331 NS_OBJECT_ENSURE_REGISTERED(SatStatsRtnUserDevLinkJitterHelper);
1332 
1334  Ptr<const SatHelper> satHelper)
1335  : SatStatsLinkJitterHelper(satHelper)
1336 {
1337  NS_LOG_FUNCTION(this << satHelper);
1338 }
1339 
1341 {
1342  NS_LOG_FUNCTION(this);
1343 }
1344 
1345 TypeId // static
1347 {
1348  static TypeId tid =
1349  TypeId("ns3::SatStatsRtnUserDevLinkJitterHelper").SetParent<SatStatsLinkJitterHelper>();
1350  return tid;
1351 }
1352 
1353 void
1355 {
1356  NS_LOG_FUNCTION(this);
1357 
1358  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
1359  Callback<void, const Time&, const Address&> callback =
1361 
1362  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1363  {
1364  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
1365  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
1366  NS_ASSERT(satGeoDev != nullptr);
1367  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1368 
1369  // Connect the object to the probe.
1370  if (satGeoDev->TraceConnectWithoutContext("RxUserLinkJitter", callback))
1371  {
1372  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
1373  << " device #" << satGeoDev->GetIfIndex());
1374  }
1375  else
1376  {
1377  NS_FATAL_ERROR("Error connecting to RxUserLinkJitter trace source of SatNetDevice"
1378  << " at node ID " << (*it)->GetId() << " device #"
1379  << satGeoDev->GetIfIndex());
1380  }
1381  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
1382 
1383  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
1384  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1385  {
1386  // Create a map of UT addresses and identifiers.
1388 
1389  // Enable statistics-related tags and trace sources on the device.
1390  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
1391  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
1392  NS_ASSERT(satDev != nullptr);
1393  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1394  }
1395 
1396  // Connect to trace sources at GW nodes.
1397 
1398  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
1399 
1400  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1401  {
1402  NetDeviceContainer devs = GetGwSatNetDevice(*it);
1403 
1404  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1405  {
1406  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
1407  NS_ASSERT(satDev != nullptr);
1408 
1409  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1410  } // end of `for (NetDeviceContainer::Iterator itDev = devs)`
1411 
1412  } // end of `for (NodeContainer::Iterator it = gws)`
1413 
1414 } // end of `void DoInstallProbes ();`
1415 
1416 // RETURN FEEDER LINK MAC-LEVEL //////////////////////////////////////////////////////
1417 
1418 NS_OBJECT_ENSURE_REGISTERED(SatStatsRtnFeederMacLinkJitterHelper);
1419 
1421  Ptr<const SatHelper> satHelper)
1422  : SatStatsLinkJitterHelper(satHelper)
1423 {
1424  NS_LOG_FUNCTION(this << satHelper);
1425 }
1426 
1428 {
1429  NS_LOG_FUNCTION(this);
1430 }
1431 
1432 TypeId // static
1434 {
1435  static TypeId tid =
1436  TypeId("ns3::SatStatsRtnFeederMacLinkJitterHelper").SetParent<SatStatsLinkJitterHelper>();
1437  return tid;
1438 }
1439 
1440 void
1442 {
1443  NS_LOG_FUNCTION(this);
1444 
1445  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
1446 
1447  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1448  {
1449  Ptr<SatMac> satMac;
1450  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
1451  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
1452  NS_ASSERT(satGeoDev != nullptr);
1453  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1454  std::map<uint32_t, Ptr<SatMac>> satGeoFeederMacs = satGeoDev->GetFeederMac();
1455  for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satGeoFeederMacs.begin();
1456  it2 != satGeoFeederMacs.end();
1457  ++it2)
1458  {
1459  satMac = it2->second;
1460  NS_ASSERT(satMac != nullptr);
1461  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1462  }
1463  std::map<uint32_t, Ptr<SatMac>> satGeoUserMacs = satGeoDev->GetUserMac();
1464  for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satGeoUserMacs.begin();
1465  it2 != satGeoUserMacs.end();
1466  ++it2)
1467  {
1468  satMac = it2->second;
1469  NS_ASSERT(satMac != nullptr);
1470  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1471  }
1472  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
1473 
1474  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
1475  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1476  {
1477  // Create a map of UT addresses and identifiers.
1479 
1480  // Enable statistics-related tags and trace sources on the device.
1481  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
1482  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
1483  NS_ASSERT(satDev != nullptr);
1484  Ptr<SatMac> satMac = satDev->GetMac();
1485  NS_ASSERT(satMac != nullptr);
1486  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1487  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1488  }
1489 
1490  // Connect to trace sources at GW nodes.
1491 
1492  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
1493  Callback<void, const Time&, const Address&> callback =
1495 
1496  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1497  {
1498  NetDeviceContainer devs = GetGwSatNetDevice(*it);
1499 
1500  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1501  {
1502  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
1503  NS_ASSERT(satDev != nullptr);
1504  Ptr<SatMac> satMac = satDev->GetMac();
1505  NS_ASSERT(satMac != nullptr);
1506 
1507  // Connect the object to the probe.
1508  if (satMac->TraceConnectWithoutContext("RxLinkJitter", callback))
1509  {
1510  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
1511  << " device #" << satDev->GetIfIndex());
1512 
1513  // Enable statistics-related tags and trace sources on the device.
1514  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1515  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1516  }
1517  else
1518  {
1519  NS_FATAL_ERROR("Error connecting to RxLinkJitter trace source of SatNetDevice"
1520  << " at node ID " << (*it)->GetId() << " device #"
1521  << satDev->GetIfIndex());
1522  }
1523 
1524  } // end of `for (NetDeviceContainer::Iterator itDev = devs)`
1525 
1526  } // end of `for (NodeContainer::Iterator it = gws)`
1527 
1528 } // end of `void DoInstallProbes ();`
1529 
1530 // RETURN USER LINK MAC-LEVEL //////////////////////////////////////////////////////
1531 
1532 NS_OBJECT_ENSURE_REGISTERED(SatStatsRtnUserMacLinkJitterHelper);
1533 
1535  Ptr<const SatHelper> satHelper)
1536  : SatStatsLinkJitterHelper(satHelper)
1537 {
1538  NS_LOG_FUNCTION(this << satHelper);
1539 }
1540 
1542 {
1543  NS_LOG_FUNCTION(this);
1544 }
1545 
1546 TypeId // static
1548 {
1549  static TypeId tid =
1550  TypeId("ns3::SatStatsRtnUserMacLinkJitterHelper").SetParent<SatStatsLinkJitterHelper>();
1551  return tid;
1552 }
1553 
1554 void
1556 {
1557  NS_LOG_FUNCTION(this);
1558 
1559  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
1560  Callback<void, const Time&, const Address&> callback =
1562 
1563  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1564  {
1565  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
1566  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
1567  NS_ASSERT(satGeoDev != nullptr);
1568  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1569  std::map<uint32_t, Ptr<SatMac>> satGeoFeederMacs = satGeoDev->GetFeederMac();
1570  Ptr<SatMac> satMac;
1571  for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satGeoFeederMacs.begin();
1572  it2 != satGeoFeederMacs.end();
1573  ++it2)
1574  {
1575  satMac = it2->second;
1576  NS_ASSERT(satMac != nullptr);
1577  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1578  }
1579  std::map<uint32_t, Ptr<SatMac>> satGeoUserMacs = satGeoDev->GetUserMac();
1580  for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satGeoUserMacs.begin();
1581  it2 != satGeoUserMacs.end();
1582  ++it2)
1583  {
1584  satMac = it2->second;
1585  NS_ASSERT(satMac != nullptr);
1586  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1587 
1588  // Connect the object to the probe.
1589  if (satMac->TraceConnectWithoutContext("RxLinkJitter", callback))
1590  {
1591  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
1592  << " device #" << satGeoDev->GetIfIndex());
1593  }
1594  else
1595  {
1596  NS_FATAL_ERROR("Error connecting to RxLinkJitter trace source of SatNetDevice"
1597  << " at node ID " << (*it)->GetId() << " device #"
1598  << satGeoDev->GetIfIndex());
1599  }
1600  }
1601  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
1602 
1603  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
1604  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1605  {
1606  // Create a map of UT addresses and identifiers.
1608 
1609  // Enable statistics-related tags and trace sources on the device.
1610  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
1611  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
1612  NS_ASSERT(satDev != nullptr);
1613  Ptr<SatMac> satMac = satDev->GetMac();
1614  NS_ASSERT(satMac != nullptr);
1615  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1616  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1617  }
1618 
1619  // Connect to trace sources at GW nodes.
1620 
1621  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
1622 
1623  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1624  {
1625  NetDeviceContainer devs = GetGwSatNetDevice(*it);
1626 
1627  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1628  {
1629  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
1630  NS_ASSERT(satDev != nullptr);
1631  Ptr<SatMac> satMac = satDev->GetMac();
1632  NS_ASSERT(satMac != nullptr);
1633 
1634  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1635  satMac->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1636  } // end of `for (NetDeviceContainer::Iterator itDev = devs)`
1637 
1638  } // end of `for (NodeContainer::Iterator it = gws)`
1639 
1640 } // end of `void DoInstallProbes ();`
1641 
1642 // RETURN FEEDER LINK PHY-LEVEL //////////////////////////////////////////////////////
1643 
1644 NS_OBJECT_ENSURE_REGISTERED(SatStatsRtnFeederPhyLinkJitterHelper);
1645 
1647  Ptr<const SatHelper> satHelper)
1648  : SatStatsLinkJitterHelper(satHelper)
1649 {
1650  NS_LOG_FUNCTION(this << satHelper);
1651 
1653 }
1654 
1656 {
1657  NS_LOG_FUNCTION(this);
1658 }
1659 
1660 TypeId // static
1662 {
1663  static TypeId tid =
1664  TypeId("ns3::SatStatsRtnFeederPhyLinkJitterHelper").SetParent<SatStatsLinkJitterHelper>();
1665  return tid;
1666 }
1667 
1668 void
1670 {
1671  NS_LOG_FUNCTION(this);
1672 
1673  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
1674 
1675  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1676  {
1677  Ptr<SatPhy> satPhy;
1678  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
1679  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
1680  NS_ASSERT(satGeoDev != nullptr);
1681  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1682  std::map<uint32_t, Ptr<SatPhy>> satGeoFeederPhys = satGeoDev->GetFeederPhy();
1683  for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satGeoFeederPhys.begin();
1684  it2 != satGeoFeederPhys.end();
1685  ++it2)
1686  {
1687  satPhy = it2->second;
1688  NS_ASSERT(satPhy != nullptr);
1689  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1690  }
1691  std::map<uint32_t, Ptr<SatPhy>> satGeoUserPhys = satGeoDev->GetUserPhy();
1692  for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satGeoUserPhys.begin();
1693  it2 != satGeoUserPhys.end();
1694  ++it2)
1695  {
1696  satPhy = it2->second;
1697  NS_ASSERT(satPhy != nullptr);
1698  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1699  }
1700  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
1701 
1702  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
1703  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1704  {
1705  // Create a map of UT addresses and identifiers.
1707 
1708  // Enable statistics-related tags and trace sources on the device.
1709  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
1710  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
1711  NS_ASSERT(satDev != nullptr);
1712  Ptr<SatPhy> satPhy = satDev->GetPhy();
1713  NS_ASSERT(satPhy != nullptr);
1714  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1715  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1716  }
1717 
1718  // Connect to trace sources at GW nodes.
1719 
1720  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
1721  Callback<void, const Time&, const Address&> callback =
1723 
1724  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1725  {
1726  NetDeviceContainer devs = GetGwSatNetDevice(*it);
1727 
1728  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1729  {
1730  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
1731  NS_ASSERT(satDev != nullptr);
1732  Ptr<SatPhy> satPhy = satDev->GetPhy();
1733  NS_ASSERT(satPhy != nullptr);
1734 
1735  // Connect the object to the probe.
1736  if (satPhy->TraceConnectWithoutContext("RxLinkJitter", callback))
1737  {
1738  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
1739  << " device #" << satDev->GetIfIndex());
1740 
1741  // Enable statistics-related tags and trace sources on the device.
1742  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1743  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1744  }
1745  else
1746  {
1747  NS_FATAL_ERROR("Error connecting to RxLinkJitter trace source of SatNetDevice"
1748  << " at node ID " << (*it)->GetId() << " device #"
1749  << satDev->GetIfIndex());
1750  }
1751 
1752  } // end of `for (NetDeviceContainer::Iterator itDev = devs)`
1753 
1754  } // end of `for (NodeContainer::Iterator it = gws)`
1755 
1756 } // end of `void DoInstallProbes ();`
1757 
1758 // RETURN USER LINK PHY-LEVEL //////////////////////////////////////////////////////
1759 
1760 NS_OBJECT_ENSURE_REGISTERED(SatStatsRtnUserPhyLinkJitterHelper);
1761 
1763  Ptr<const SatHelper> satHelper)
1764  : SatStatsLinkJitterHelper(satHelper)
1765 {
1766  NS_LOG_FUNCTION(this << satHelper);
1767 
1769 }
1770 
1772 {
1773  NS_LOG_FUNCTION(this);
1774 }
1775 
1776 TypeId // static
1778 {
1779  static TypeId tid =
1780  TypeId("ns3::SatStatsRtnUserPhyLinkJitterHelper").SetParent<SatStatsLinkJitterHelper>();
1781  return tid;
1782 }
1783 
1784 void
1786 {
1787  NS_LOG_FUNCTION(this);
1788 
1789  NodeContainer sats = GetSatHelper()->GetBeamHelper()->GetGeoSatNodes();
1790  Callback<void, const Time&, const Address&> callback =
1792 
1793  for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1794  {
1795  Ptr<NetDevice> dev = GetSatSatGeoNetDevice(*it);
1796  Ptr<SatGeoNetDevice> satGeoDev = dev->GetObject<SatGeoNetDevice>();
1797  NS_ASSERT(satGeoDev != nullptr);
1798  satGeoDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1799  std::map<uint32_t, Ptr<SatPhy>> satGeoFeederPhys = satGeoDev->GetFeederPhy();
1800  Ptr<SatPhy> satPhy;
1801  for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satGeoFeederPhys.begin();
1802  it2 != satGeoFeederPhys.end();
1803  ++it2)
1804  {
1805  satPhy = it2->second;
1806  NS_ASSERT(satPhy != nullptr);
1807  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1808  }
1809  std::map<uint32_t, Ptr<SatPhy>> satGeoUserPhys = satGeoDev->GetUserPhy();
1810  for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satGeoUserPhys.begin();
1811  it2 != satGeoUserPhys.end();
1812  ++it2)
1813  {
1814  satPhy = it2->second;
1815  NS_ASSERT(satPhy != nullptr);
1816  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1817 
1818  // Connect the object to the probe.
1819  if (satPhy->TraceConnectWithoutContext("RxLinkJitter", callback))
1820  {
1821  NS_LOG_INFO(this << " successfully connected with node ID " << (*it)->GetId()
1822  << " device #" << satGeoDev->GetIfIndex());
1823  }
1824  else
1825  {
1826  NS_FATAL_ERROR("Error connecting to RxLinkJitter trace source of SatNetDevice"
1827  << " at node ID " << (*it)->GetId() << " device #"
1828  << satGeoDev->GetIfIndex());
1829  }
1830  }
1831  } // end of `for (it = sats.Begin(); it != sats.End (); ++it)`
1832 
1833  NodeContainer uts = GetSatHelper()->GetBeamHelper()->GetUtNodes();
1834  for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1835  {
1836  // Create a map of UT addresses and identifiers.
1838 
1839  // Enable statistics-related tags and trace sources on the device.
1840  Ptr<NetDevice> dev = GetUtSatNetDevice(*it);
1841  Ptr<SatNetDevice> satDev = dev->GetObject<SatNetDevice>();
1842  NS_ASSERT(satDev != nullptr);
1843  Ptr<SatPhy> satPhy = satDev->GetPhy();
1844  NS_ASSERT(satPhy != nullptr);
1845  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1846  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1847  }
1848 
1849  // Connect to trace sources at GW nodes.
1850 
1851  NodeContainer gws = GetSatHelper()->GetBeamHelper()->GetGwNodes();
1852 
1853  for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1854  {
1855  NetDeviceContainer devs = GetGwSatNetDevice(*it);
1856 
1857  for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1858  {
1859  Ptr<SatNetDevice> satDev = (*itDev)->GetObject<SatNetDevice>();
1860  NS_ASSERT(satDev != nullptr);
1861  Ptr<SatPhy> satPhy = satDev->GetPhy();
1862  NS_ASSERT(satPhy != nullptr);
1863 
1864  satDev->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1865  satPhy->SetAttribute("EnableStatisticsTags", BooleanValue(true));
1866  } // end of `for (NetDeviceContainer::Iterator itDev = devs)`
1867 
1868  } // end of `for (NodeContainer::Iterator it = gws)`
1869 
1870 } // end of `void DoInstallProbes ();`
1871 
1872 } // end of namespace ns3
ChannelType_t
Types of channel.
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.