24 #include <ns3/application-packet-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>
31 #include <ns3/inet-socket-address.h>
32 #include <ns3/interval-rate-collector.h>
35 #include <ns3/mac48-address.h>
36 #include <ns3/magister-gnuplot-aggregator.h>
37 #include <ns3/multi-file-aggregator.h>
38 #include <ns3/net-device.h>
39 #include <ns3/node-container.h>
40 #include <ns3/packet.h>
41 #include <ns3/probe.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-orbiter-net-device.h>
47 #include <ns3/satellite-phy.h>
48 #include <ns3/satellite-topology.h>
49 #include <ns3/scalar-collector.h>
50 #include <ns3/singleton.h>
51 #include <ns3/string.h>
52 #include <ns3/unit-conversion-collector.h>
59 NS_LOG_COMPONENT_DEFINE(
"SatStatsThroughputHelper");
64 NS_OBJECT_ENSURE_REGISTERED(SatStatsThroughputHelper);
68 m_averagingMode(false)
70 NS_LOG_FUNCTION(
this << satHelper);
75 NS_LOG_FUNCTION(
this);
82 TypeId(
"ns3::SatStatsThroughputHelper")
84 .AddAttribute(
"AveragingMode",
85 "If true, all samples will be averaged before passed to aggregator. "
86 "Only affects histogram, PDF, and CDF output types.",
90 MakeBooleanChecker());
97 NS_LOG_FUNCTION(
this << averagingMode);
110 NS_LOG_FUNCTION(
this);
116 <<
" is not a valid output type for this statistics.");
126 "EnableContextPrinting",
134 EnumValue(ScalarCollector::INPUT_DATA_TYPE_DOUBLE));
137 EnumValue(ScalarCollector::OUTPUT_TYPE_AVERAGE_PER_SECOND));
141 &MultiFileAggregator::Write1d);
146 EnumValue(UnitConversionCollector::FROM_BYTES_TO_KBIT));
150 &ScalarCollector::TraceSinkDouble);
165 EnumValue(IntervalRateCollector::INPUT_DATA_TYPE_DOUBLE));
169 &MultiFileAggregator::Write2d);
172 &MultiFileAggregator::AddContextHeading);
177 EnumValue(UnitConversionCollector::FROM_BYTES_TO_KBIT));
181 &IntervalRateCollector::TraceSinkDouble);
190 NS_FATAL_ERROR(
"This statistics require AveragingMode to be enabled");
199 "EnableContextPrinting",
203 Ptr<MultiFileAggregator> fileAggregator =
m_aggregator->GetObject<MultiFileAggregator>();
204 NS_ASSERT(fileAggregator !=
nullptr);
208 DistributionCollector::OutputType_t outputType =
209 DistributionCollector::OUTPUT_TYPE_HISTOGRAM;
212 outputType = DistributionCollector::OUTPUT_TYPE_PROBABILITY;
216 outputType = DistributionCollector::OUTPUT_TYPE_CUMULATIVE;
223 MakeCallback(&MultiFileAggregator::Write2d, fileAggregator));
227 MakeCallback(&MultiFileAggregator::AddContextHeading, fileAggregator));
231 MakeCallback(&MultiFileAggregator::EnableContextWarning, fileAggregator));
236 EnumValue(ScalarCollector::INPUT_DATA_TYPE_DOUBLE));
239 EnumValue(ScalarCollector::OUTPUT_TYPE_AVERAGE_PER_SECOND));
241 Callback<void, double> callback =
247 it->second->TraceConnectWithoutContext(
"Output", callback);
253 EnumValue(UnitConversionCollector::FROM_BYTES_TO_KBIT));
257 &ScalarCollector::TraceSinkDouble);
264 <<
" is not a valid output type for this statistics.");
274 Ptr<MagisterGnuplotAggregator> plotAggregator =
276 NS_ASSERT(plotAggregator !=
nullptr);
278 plotAggregator->SetLegend(
"Time (in seconds)",
279 "Received throughput (in kilobits per second)");
280 plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
285 EnumValue(IntervalRateCollector::INPUT_DATA_TYPE_DOUBLE));
291 const std::string context = it->second->GetName();
292 plotAggregator->Add2dDataset(context, context);
296 &MagisterGnuplotAggregator::Write2d);
301 EnumValue(UnitConversionCollector::FROM_BYTES_TO_KBIT));
305 &IntervalRateCollector::TraceSinkDouble);
314 NS_FATAL_ERROR(
"This statistics require AveragingMode to be enabled");
323 Ptr<MagisterGnuplotAggregator> plotAggregator =
325 NS_ASSERT(plotAggregator !=
nullptr);
327 plotAggregator->SetLegend(
"Received throughput (in kilobits per second)",
"Frequency");
328 plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
334 DistributionCollector::OutputType_t outputType =
335 DistributionCollector::OUTPUT_TYPE_HISTOGRAM;
338 outputType = DistributionCollector::OUTPUT_TYPE_PROBABILITY;
342 outputType = DistributionCollector::OUTPUT_TYPE_CUMULATIVE;
349 MakeCallback(&MagisterGnuplotAggregator::Write2d, plotAggregator));
355 EnumValue(ScalarCollector::INPUT_DATA_TYPE_DOUBLE));
358 EnumValue(ScalarCollector::OUTPUT_TYPE_AVERAGE_PER_SECOND));
360 Callback<void, double> callback =
366 it->second->TraceConnectWithoutContext(
"Output", callback);
372 EnumValue(UnitConversionCollector::FROM_BYTES_TO_KBIT));
376 &ScalarCollector::TraceSinkDouble);
381 NS_FATAL_ERROR(
"SatStatsThroughputHelper - Invalid output type");
393 NS_LOG_FUNCTION(
this);
402 NS_LOG_FUNCTION(
this << packet->GetSize() << from);
404 if (from.IsInvalid())
406 NS_LOG_WARN(
this <<
" discarding packet " << packet <<
" (" << packet->GetSize()
408 <<
" from statistics collection because of"
409 <<
" invalid sender address");
414 std::map<const Address, uint32_t>::const_iterator it =
m_identifierMap.find(from);
418 NS_LOG_WARN(
this <<
" discarding packet " << packet <<
" (" << packet->GetSize()
420 <<
" from statistics collection because of"
421 <<
" unknown sender address " << from);
427 NS_ASSERT_MSG(collector !=
nullptr,
428 "Unable to find collector with identifier " << it->second);
429 Ptr<UnitConversionCollector> c = collector->GetObject<UnitConversionCollector>();
430 NS_ASSERT(c !=
nullptr);
433 c->TraceSinkUinteger32(0, packet->GetSize());
446 NS_LOG_FUNCTION(
this << satHelper);
451 NS_LOG_FUNCTION(
this);
465 NS_LOG_FUNCTION(
this);
466 NodeContainer utUsers = Singleton<SatTopology>::Get()->GetUtUserNodes();
468 for (NodeContainer::Iterator it = utUsers.Begin(); it != utUsers.End(); ++it)
471 NS_ASSERT_MSG(utUserId > 0,
"Node " << (*it)->GetId() <<
" is not a valid UT user");
474 for (uint32_t i = 0; i < (*it)->GetNApplications(); i++)
477 std::ostringstream probeName;
478 probeName << utUserId <<
"-" << i;
479 Ptr<ApplicationPacketProbe> probe = CreateObject<ApplicationPacketProbe>();
480 probe->SetName(probeName.str());
483 if (probe->ConnectByObject(
"Rx", (*it)->GetApplication(i)))
487 probe->GetObject<Probe>(),
490 &UnitConversionCollector::TraceSinkUinteger32))
492 NS_LOG_INFO(
this <<
" created probe " << probeName.str()
493 <<
", connected to collector " << identifier);
495 std::make_pair(probe->GetObject<Probe>(), std::make_pair(*it, identifier)));
499 NS_LOG_WARN(
this <<
" unable to connect probe " << probeName.str()
500 <<
" to collector " << identifier);
510 NS_LOG_WARN(
this <<
" unable to connect probe " << probeName.str()
511 <<
" with node ID " << (*it)->GetId() <<
" application #" << i);
523 NS_LOG_FUNCTION(
this);
525 std::map<Ptr<Probe>, std::pair<Ptr<Node>, uint32_t>>::iterator it;
529 Ptr<Probe> probe = it->first;
530 Ptr<Node> node = it->second.first;
531 uint32_t identifier = it->second.second;
535 &UnitConversionCollector::TraceSinkUinteger32);
542 &UnitConversionCollector::TraceSinkUinteger32);
544 it->second.second = identifier;
553 Ptr<const SatHelper> satHelper)
556 NS_LOG_FUNCTION(
this << satHelper);
561 NS_LOG_FUNCTION(
this);
575 NS_LOG_FUNCTION(
this);
577 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
578 Callback<void, Ptr<const Packet>,
const Address&> callback =
581 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
585 NS_ASSERT(satOrbiterDev !=
nullptr);
586 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
588 if (satOrbiterDev->TraceConnectWithoutContext(
"RxFeeder", callback))
590 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
591 <<
" device #" << satOrbiterDev->GetIfIndex());
594 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
598 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatNetDevice"
599 <<
" at node ID " << (*it)->GetId() <<
" device #"
600 << satOrbiterDev->GetIfIndex());
604 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
606 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
612 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
613 NS_ASSERT(satDev !=
nullptr);
615 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
620 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
621 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
625 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
627 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
628 NS_ASSERT(satDev !=
nullptr);
630 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
640 Ptr<const SatHelper> satHelper)
643 NS_LOG_FUNCTION(
this << satHelper);
648 NS_LOG_FUNCTION(
this);
662 NS_LOG_FUNCTION(
this);
663 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
665 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
667 const int32_t utId =
GetUtId(*it);
668 NS_ASSERT_MSG(utId > 0,
"Node " << (*it)->GetId() <<
" is not a valid UT");
672 std::ostringstream probeName;
674 Ptr<ApplicationPacketProbe> probe = CreateObject<ApplicationPacketProbe>();
675 probe->SetName(probeName.str());
680 if (probe->ConnectByObject(
"Rx", dev))
684 probe->GetObject<Probe>(),
687 &UnitConversionCollector::TraceSinkUinteger32))
689 NS_LOG_INFO(
this <<
" created probe " << probeName.str()
690 <<
", connected to collector " << identifier);
692 std::make_pair(probe->GetObject<Probe>(), std::make_pair(*it, identifier)));
695 dev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
699 NS_LOG_WARN(
this <<
" unable to connect probe " << probeName.str()
700 <<
" to collector " << identifier);
706 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatNetDevice"
707 <<
" at node ID " << (*it)->GetId() <<
" device #2");
713 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
714 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
718 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
720 NS_ASSERT((*itDev)->GetObject<
SatNetDevice>() !=
nullptr);
721 (*itDev)->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
730 NS_LOG_FUNCTION(
this);
732 std::map<Ptr<Probe>, std::pair<Ptr<Node>, uint32_t>>::iterator it;
736 Ptr<Probe> probe = it->first;
737 Ptr<Node> node = it->second.first;
738 uint32_t identifier = it->second.second;
742 &UnitConversionCollector::TraceSinkUinteger32);
749 &UnitConversionCollector::TraceSinkUinteger32);
751 it->second.second = identifier;
760 Ptr<const SatHelper> satHelper)
763 NS_LOG_FUNCTION(
this << satHelper);
768 NS_LOG_FUNCTION(
this);
782 NS_LOG_FUNCTION(
this);
784 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
785 Callback<void, Ptr<const Packet>,
const Address&> callback =
788 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
792 NS_ASSERT(satOrbiterDev !=
nullptr);
793 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
794 std::map<uint32_t, Ptr<SatMac>> satOrbiterFeederMacs = satOrbiterDev->GetAllFeederMac();
796 for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satOrbiterFeederMacs.begin();
797 it2 != satOrbiterFeederMacs.end();
800 satMac = it2->second;
801 NS_ASSERT(satMac !=
nullptr);
802 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
805 if (satMac->TraceConnectWithoutContext(
"Rx", callback))
807 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
808 <<
" device #" << satOrbiterDev->GetIfIndex());
812 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatMac"
813 <<
" at node ID " << (*it)->GetId() <<
" device #"
814 << satOrbiterDev->GetIfIndex());
817 std::map<uint32_t, Ptr<SatMac>> satOrbiterUserMacs = satOrbiterDev->GetUserMac();
818 for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satOrbiterUserMacs.begin();
819 it2 != satOrbiterUserMacs.end();
822 satMac = it2->second;
823 NS_ASSERT(satMac !=
nullptr);
824 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
828 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
830 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
836 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
837 NS_ASSERT(satDev !=
nullptr);
838 Ptr<SatMac> satMac = satDev->GetMac();
839 NS_ASSERT(satMac !=
nullptr);
841 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
842 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
847 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
848 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
852 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
854 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
855 NS_ASSERT(satDev !=
nullptr);
856 Ptr<SatMac> satMac = satDev->GetMac();
857 NS_ASSERT(satMac !=
nullptr);
859 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
860 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
871 Ptr<const SatHelper> satHelper)
874 NS_LOG_FUNCTION(
this << satHelper);
879 NS_LOG_FUNCTION(
this);
893 NS_LOG_FUNCTION(
this);
895 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
897 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
901 NS_ASSERT(satOrbiterDev !=
nullptr);
902 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
903 std::map<uint32_t, Ptr<SatMac>> satOrbiterFeederMacs = satOrbiterDev->GetAllFeederMac();
905 for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satOrbiterFeederMacs.begin();
906 it2 != satOrbiterFeederMacs.end();
909 satMac = it2->second;
910 NS_ASSERT(satMac !=
nullptr);
911 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
913 std::map<uint32_t, Ptr<SatMac>> satOrbiterUserMacs = satOrbiterDev->GetUserMac();
914 for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satOrbiterUserMacs.begin();
915 it2 != satOrbiterUserMacs.end();
918 satMac = it2->second;
919 NS_ASSERT(satMac !=
nullptr);
920 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
924 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
926 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
928 const int32_t utId =
GetUtId(*it);
929 NS_ASSERT_MSG(utId > 0,
"Node " << (*it)->GetId() <<
" is not a valid UT");
933 std::ostringstream probeName;
935 Ptr<ApplicationPacketProbe> probe = CreateObject<ApplicationPacketProbe>();
936 probe->SetName(probeName.str());
939 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
940 NS_ASSERT(satDev !=
nullptr);
941 Ptr<SatMac> satMac = satDev->GetMac();
942 NS_ASSERT(satMac !=
nullptr);
945 if (probe->ConnectByObject(
"Rx", satMac))
949 probe->GetObject<Probe>(),
952 &UnitConversionCollector::TraceSinkUinteger32))
955 std::make_pair(probe->GetObject<Probe>(), std::make_pair(*it, identifier)));
958 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
959 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
963 NS_LOG_WARN(
this <<
" unable to connect probe " << probeName.str()
964 <<
" to collector " << identifier);
969 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatMac"
970 <<
" at node ID " << (*it)->GetId() <<
" device #2");
975 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
976 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
980 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
982 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
983 NS_ASSERT(satDev !=
nullptr);
984 Ptr<SatMac> satMac = satDev->GetMac();
985 NS_ASSERT(satMac !=
nullptr);
987 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
988 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
997 NS_LOG_FUNCTION(
this);
999 std::map<Ptr<Probe>, std::pair<Ptr<Node>, uint32_t>>::iterator it;
1003 Ptr<Probe> probe = it->first;
1004 Ptr<Node> node = it->second.first;
1005 uint32_t identifier = it->second.second;
1009 &UnitConversionCollector::TraceSinkUinteger32);
1016 &UnitConversionCollector::TraceSinkUinteger32);
1018 it->second.second = identifier;
1027 Ptr<const SatHelper> satHelper)
1030 NS_LOG_FUNCTION(
this << satHelper);
1035 NS_LOG_FUNCTION(
this);
1049 NS_LOG_FUNCTION(
this);
1051 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
1052 Callback<void, Ptr<const Packet>,
const Address&> callback =
1055 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1059 NS_ASSERT(satOrbiterDev !=
nullptr);
1060 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1061 std::map<uint32_t, Ptr<SatPhy>> satOrbiterFeederPhys = satOrbiterDev->GetFeederPhy();
1063 for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satOrbiterFeederPhys.begin();
1064 it2 != satOrbiterFeederPhys.end();
1067 satPhy = it2->second;
1068 NS_ASSERT(satPhy !=
nullptr);
1069 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1072 if (satPhy->TraceConnectWithoutContext(
"Rx", callback))
1074 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
1075 <<
" device #" << satOrbiterDev->GetIfIndex());
1078 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1082 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatPhy"
1083 <<
" at node ID " << (*it)->GetId() <<
" device #"
1084 << satOrbiterDev->GetIfIndex());
1087 std::map<uint32_t, Ptr<SatPhy>> satOrbiterUserPhys = satOrbiterDev->GetUserPhy();
1088 for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satOrbiterUserPhys.begin();
1089 it2 != satOrbiterUserPhys.end();
1092 satPhy = it2->second;
1093 NS_ASSERT(satPhy !=
nullptr);
1094 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1098 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
1100 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1106 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
1107 NS_ASSERT(satDev !=
nullptr);
1108 Ptr<SatPhy> satPhy = satDev->GetPhy();
1109 NS_ASSERT(satPhy !=
nullptr);
1111 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1112 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1117 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
1118 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1122 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1124 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
1125 NS_ASSERT(satDev !=
nullptr);
1126 Ptr<SatPhy> satPhy = satDev->GetPhy();
1127 NS_ASSERT(satPhy !=
nullptr);
1129 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1130 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1141 Ptr<const SatHelper> satHelper)
1144 NS_LOG_FUNCTION(
this << satHelper);
1149 NS_LOG_FUNCTION(
this);
1163 NS_LOG_FUNCTION(
this);
1165 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
1167 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1171 NS_ASSERT(satOrbiterDev !=
nullptr);
1172 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1173 std::map<uint32_t, Ptr<SatPhy>> satOrbiterFeederPhys = satOrbiterDev->GetFeederPhy();
1175 for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satOrbiterFeederPhys.begin();
1176 it2 != satOrbiterFeederPhys.end();
1179 satPhy = it2->second;
1180 NS_ASSERT(satPhy !=
nullptr);
1181 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1183 std::map<uint32_t, Ptr<SatPhy>> satOrbiterUserPhys = satOrbiterDev->GetUserPhy();
1184 for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satOrbiterUserPhys.begin();
1185 it2 != satOrbiterUserPhys.end();
1188 satPhy = it2->second;
1189 NS_ASSERT(satPhy !=
nullptr);
1190 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1194 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
1196 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1198 const int32_t utId =
GetUtId(*it);
1199 NS_ASSERT_MSG(utId > 0,
"Node " << (*it)->GetId() <<
" is not a valid UT");
1203 std::ostringstream probeName;
1205 Ptr<ApplicationPacketProbe> probe = CreateObject<ApplicationPacketProbe>();
1206 probe->SetName(probeName.str());
1209 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
1210 NS_ASSERT(satDev !=
nullptr);
1211 Ptr<SatPhy> satPhy = satDev->GetPhy();
1212 NS_ASSERT(satPhy !=
nullptr);
1215 if (probe->ConnectByObject(
"Rx", satPhy))
1218 probe->GetObject<Probe>(),
1221 &UnitConversionCollector::TraceSinkUinteger32))
1224 std::make_pair(probe->GetObject<Probe>(), std::make_pair(*it, identifier)));
1227 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1228 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1232 NS_LOG_WARN(
this <<
" unable to connect probe " << probeName.str()
1233 <<
" to collector " << identifier);
1238 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatPhy"
1239 <<
" at node ID " << (*it)->GetId() <<
" device #2");
1244 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
1245 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1249 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1251 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
1252 NS_ASSERT(satDev !=
nullptr);
1253 Ptr<SatPhy> satPhy = satDev->GetPhy();
1254 NS_ASSERT(satPhy !=
nullptr);
1256 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1257 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1266 NS_LOG_FUNCTION(
this);
1268 std::map<Ptr<Probe>, std::pair<Ptr<Node>, uint32_t>>::iterator it;
1272 Ptr<Probe> probe = it->first;
1273 Ptr<Node> node = it->second.first;
1274 uint32_t identifier = it->second.second;
1278 &UnitConversionCollector::TraceSinkUinteger32);
1285 &UnitConversionCollector::TraceSinkUinteger32);
1287 it->second.second = identifier;
1298 NS_LOG_FUNCTION(
this << satHelper);
1303 NS_LOG_FUNCTION(
this);
1317 NS_LOG_FUNCTION(
this);
1320 NodeContainer utUsers = Singleton<SatTopology>::Get()->GetUtUserNodes();
1321 for (NodeContainer::Iterator it = utUsers.Begin(); it != utUsers.End(); ++it)
1328 NodeContainer gwUsers = Singleton<SatTopology>::Get()->GetGwUserNodes();
1329 Callback<void, Ptr<const Packet>,
const Address&> callback =
1332 for (NodeContainer::Iterator it = gwUsers.Begin(); it != gwUsers.End(); ++it)
1334 for (uint32_t i = 0; i < (*it)->GetNApplications(); i++)
1336 Ptr<Application> app = (*it)->GetApplication(i);
1338 if (app->TraceConnectWithoutContext(
"Rx", callback))
1340 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
1341 <<
" application #" << i);
1350 NS_LOG_WARN(
this <<
" unable to connect with node ID " << (*it)->GetId()
1351 <<
" application #" << i);
1363 if (InetSocketAddress::IsMatchingType(from))
1366 const Address ipv4Addr = InetSocketAddress::ConvertFrom(from).GetIpv4();
1367 std::map<const Address, uint32_t>::const_iterator it1 =
m_identifierMap.find(ipv4Addr);
1371 NS_LOG_WARN(
this <<
" discarding packet " << packet <<
" (" << packet->GetSize()
1373 <<
" from statistics collection because of"
1374 <<
" unknown sender IPv4 address " << ipv4Addr);
1380 NS_ASSERT_MSG(collector !=
nullptr,
1381 "Unable to find collector with identifier " << it1->second);
1382 Ptr<UnitConversionCollector> c = collector->GetObject<UnitConversionCollector>();
1383 NS_ASSERT(c !=
nullptr);
1386 c->TraceSinkUinteger32(0, packet->GetSize());
1392 this <<
" discarding packet " << packet <<
" (" << packet->GetSize() <<
" bytes)"
1393 <<
" from statistics collection"
1394 <<
" because it comes from sender " << from <<
" without valid InetSocketAddress");
1402 NS_LOG_FUNCTION(
this << utUserNode->GetId());
1404 Ptr<Ipv4> ipv4 = utUserNode->GetObject<Ipv4>();
1406 if (ipv4 ==
nullptr)
1408 NS_LOG_INFO(
this <<
" Node " << utUserNode->GetId() <<
" does not support IPv4 protocol");
1410 else if (ipv4->GetNInterfaces() >= 2)
1418 for (uint32_t i = 0; i < ipv4->GetNAddresses(1); i++)
1420 const Address addr = ipv4->GetAddress(1, i).GetLocal();
1422 NS_LOG_INFO(
this <<
" associated address " << addr <<
" with identifier "
1428 NS_LOG_WARN(
this <<
" Node " << utUserNode->GetId() <<
" is not a valid UT user");
1437 Ptr<const SatHelper> satHelper)
1440 NS_LOG_FUNCTION(
this << satHelper);
1445 NS_LOG_FUNCTION(
this);
1459 NS_LOG_FUNCTION(
this);
1461 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
1462 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1469 dev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1474 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
1475 Callback<void, Ptr<const Packet>,
const Address&> callback =
1478 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1482 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1484 NS_ASSERT((*itDev)->GetObject<
SatNetDevice>() !=
nullptr);
1486 if ((*itDev)->TraceConnectWithoutContext(
"Rx", callback))
1488 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
1489 <<
" device #" << (*itDev)->GetIfIndex());
1492 (*itDev)->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1496 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatNetDevice"
1497 <<
" at node ID " << (*it)->GetId() <<
" device #"
1498 << (*itDev)->GetIfIndex());
1512 Ptr<const SatHelper> satHelper)
1515 NS_LOG_FUNCTION(
this << satHelper);
1520 NS_LOG_FUNCTION(
this);
1534 NS_LOG_FUNCTION(
this);
1536 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
1537 Callback<void, Ptr<const Packet>,
const Address&> callback =
1540 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1544 NS_ASSERT(satOrbiterDev !=
nullptr);
1545 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1548 if (satOrbiterDev->TraceConnectWithoutContext(
"RxUser", callback))
1550 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
1551 <<
" device #" << satOrbiterDev->GetIfIndex());
1555 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatMac"
1556 <<
" at node ID " << (*it)->GetId() <<
" device #"
1557 << satOrbiterDev->GetIfIndex());
1561 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
1562 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1569 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
1570 NS_ASSERT(satDev !=
nullptr);
1571 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1576 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
1578 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1582 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1584 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
1585 NS_ASSERT(satDev !=
nullptr);
1587 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1599 Ptr<const SatHelper> satHelper)
1602 NS_LOG_FUNCTION(
this << satHelper);
1607 NS_LOG_FUNCTION(
this);
1621 NS_LOG_FUNCTION(
this);
1623 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
1625 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1630 NS_ASSERT(satOrbiterDev !=
nullptr);
1631 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1632 std::map<uint32_t, Ptr<SatMac>> satOrbiterFeederMacs = satOrbiterDev->GetAllFeederMac();
1633 for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satOrbiterFeederMacs.begin();
1634 it2 != satOrbiterFeederMacs.end();
1637 satMac = it2->second;
1638 NS_ASSERT(satMac !=
nullptr);
1639 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1641 std::map<uint32_t, Ptr<SatMac>> satOrbiterUserMacs = satOrbiterDev->GetUserMac();
1642 for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satOrbiterUserMacs.begin();
1643 it2 != satOrbiterUserMacs.end();
1646 satMac = it2->second;
1647 NS_ASSERT(satMac !=
nullptr);
1648 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1652 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
1653 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1660 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
1661 NS_ASSERT(satDev !=
nullptr);
1662 Ptr<SatMac> satMac = satDev->GetMac();
1663 NS_ASSERT(satMac !=
nullptr);
1664 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1665 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1670 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
1671 Callback<void, Ptr<const Packet>,
const Address&> callback =
1674 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1678 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1680 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
1681 NS_ASSERT(satDev !=
nullptr);
1682 Ptr<SatMac> satMac = satDev->GetMac();
1683 NS_ASSERT(satMac !=
nullptr);
1686 if (satMac->TraceConnectWithoutContext(
"Rx", callback))
1688 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
1689 <<
" device #" << satDev->GetIfIndex());
1692 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1693 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1697 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatMac"
1698 <<
" at node ID " << (*it)->GetId() <<
" device #"
1699 << satDev->GetIfIndex());
1713 Ptr<const SatHelper> satHelper)
1716 NS_LOG_FUNCTION(
this << satHelper);
1721 NS_LOG_FUNCTION(
this);
1735 NS_LOG_FUNCTION(
this);
1737 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
1738 Callback<void, Ptr<const Packet>,
const Address&> callback =
1741 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1745 NS_ASSERT(satOrbiterDev !=
nullptr);
1746 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1747 std::map<uint32_t, Ptr<SatMac>> satOrbiterFeederMacs = satOrbiterDev->GetAllFeederMac();
1749 for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satOrbiterFeederMacs.begin();
1750 it2 != satOrbiterFeederMacs.end();
1753 satMac = it2->second;
1754 NS_ASSERT(satMac !=
nullptr);
1755 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1757 std::map<uint32_t, Ptr<SatMac>> satOrbiterUserMacs = satOrbiterDev->GetUserMac();
1758 for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satOrbiterUserMacs.begin();
1759 it2 != satOrbiterUserMacs.end();
1762 satMac = it2->second;
1763 NS_ASSERT(satMac !=
nullptr);
1764 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1767 if (satMac->TraceConnectWithoutContext(
"Rx", callback))
1769 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
1770 <<
" device #" << satOrbiterDev->GetIfIndex());
1774 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatMac"
1775 <<
" at node ID " << (*it)->GetId() <<
" device #"
1776 << satOrbiterDev->GetIfIndex());
1781 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
1782 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1789 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
1790 NS_ASSERT(satDev !=
nullptr);
1791 Ptr<SatMac> satMac = satDev->GetMac();
1792 NS_ASSERT(satMac !=
nullptr);
1793 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1794 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1799 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
1801 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1805 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1807 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
1808 NS_ASSERT(satDev !=
nullptr);
1809 Ptr<SatMac> satMac = satDev->GetMac();
1810 NS_ASSERT(satMac !=
nullptr);
1812 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1813 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1825 Ptr<const SatHelper> satHelper)
1828 NS_LOG_FUNCTION(
this << satHelper);
1833 NS_LOG_FUNCTION(
this);
1847 NS_LOG_FUNCTION(
this);
1849 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
1851 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1856 NS_ASSERT(satOrbiterDev !=
nullptr);
1857 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1858 std::map<uint32_t, Ptr<SatPhy>> satOrbiterFeederPhys = satOrbiterDev->GetFeederPhy();
1859 for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satOrbiterFeederPhys.begin();
1860 it2 != satOrbiterFeederPhys.end();
1863 satPhy = it2->second;
1864 NS_ASSERT(satPhy !=
nullptr);
1865 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1867 std::map<uint32_t, Ptr<SatPhy>> satOrbiterUserPhys = satOrbiterDev->GetUserPhy();
1868 for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satOrbiterUserPhys.begin();
1869 it2 != satOrbiterUserPhys.end();
1872 satPhy = it2->second;
1873 NS_ASSERT(satPhy !=
nullptr);
1874 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1878 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
1879 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1886 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
1887 NS_ASSERT(satDev !=
nullptr);
1888 Ptr<SatPhy> satPhy = satDev->GetPhy();
1889 NS_ASSERT(satPhy !=
nullptr);
1890 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1891 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1896 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
1897 Callback<void, Ptr<const Packet>,
const Address&> callback =
1900 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1904 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1906 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
1907 NS_ASSERT(satDev !=
nullptr);
1908 Ptr<SatPhy> satPhy = satDev->GetPhy();
1909 NS_ASSERT(satPhy !=
nullptr);
1912 if (satPhy->TraceConnectWithoutContext(
"Rx", callback))
1914 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
1915 <<
" device #" << satDev->GetIfIndex());
1918 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1919 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1923 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatPhy"
1924 <<
" at node ID " << (*it)->GetId() <<
" device #"
1925 << satDev->GetIfIndex());
1939 Ptr<const SatHelper> satHelper)
1942 NS_LOG_FUNCTION(
this << satHelper);
1947 NS_LOG_FUNCTION(
this);
1961 NS_LOG_FUNCTION(
this);
1963 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
1964 Callback<void, Ptr<const Packet>,
const Address&> callback =
1967 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1971 NS_ASSERT(satOrbiterDev !=
nullptr);
1972 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1973 std::map<uint32_t, Ptr<SatPhy>> satOrbiterFeederPhys = satOrbiterDev->GetFeederPhy();
1975 for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satOrbiterFeederPhys.begin();
1976 it2 != satOrbiterFeederPhys.end();
1979 satPhy = it2->second;
1980 NS_ASSERT(satPhy !=
nullptr);
1981 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1983 std::map<uint32_t, Ptr<SatPhy>> satOrbiterUserPhys = satOrbiterDev->GetUserPhy();
1984 for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satOrbiterUserPhys.begin();
1985 it2 != satOrbiterUserPhys.end();
1988 satPhy = it2->second;
1989 NS_ASSERT(satPhy !=
nullptr);
1990 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1993 if (satPhy->TraceConnectWithoutContext(
"Rx", callback))
1995 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
1996 <<
" device #" << satOrbiterDev->GetIfIndex());
2000 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatPhy"
2001 <<
" at node ID " << (*it)->GetId() <<
" device #"
2002 << satOrbiterDev->GetIfIndex());
2007 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
2008 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
2015 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
2016 NS_ASSERT(satDev !=
nullptr);
2017 Ptr<SatPhy> satPhy = satDev->GetPhy();
2018 NS_ASSERT(satPhy !=
nullptr);
2019 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
2020 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
2025 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
2027 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
2031 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
2033 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
2034 NS_ASSERT(satDev !=
nullptr);
2035 Ptr<SatPhy> satPhy = satDev->GetPhy();
2036 NS_ASSERT(satPhy !=
nullptr);
2038 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
2039 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
SatNetDevice to be utilized in the UT and GW nodes.
SatOrbiterNetDevice to be utilized in geostationary satellite.
Produce forward link application-level throughput statistics from a satellite module simulation.
std::map< Ptr< Probe >, std::pair< Ptr< Node >, uint32_t > > m_probes
Maintains a list of probes created by this helper.
SatStatsFwdAppThroughputHelper(Ptr< const SatHelper > satHelper)
virtual ~SatStatsFwdAppThroughputHelper()
/ Destructor.
static TypeId GetTypeId()
inherited from ObjectBase base class
virtual void UpdateIdentifierOnProbes()
Change identifier used on probes, when handovers occur.
Produce forward feeder link device-level throughput statistics from a satellite module simulation.
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsFwdFeederDevThroughputHelper(Ptr< const SatHelper > satHelper)
virtual ~SatStatsFwdFeederDevThroughputHelper()
/ Destructor.
Produce forward feeder link MAC-level throughput statistics from a satellite module simulation.
SatStatsFwdFeederMacThroughputHelper(Ptr< const SatHelper > satHelper)
virtual ~SatStatsFwdFeederMacThroughputHelper()
/ Destructor.
static TypeId GetTypeId()
inherited from ObjectBase base class
Produce forward feeder link PHY-level throughput statistics from a satellite module simulation.
SatStatsFwdFeederPhyThroughputHelper(Ptr< const SatHelper > satHelper)
virtual ~SatStatsFwdFeederPhyThroughputHelper()
/ Destructor.
static TypeId GetTypeId()
inherited from ObjectBase base class
Produce forward user link device-level throughput statistics from a satellite module simulation.
SatStatsFwdUserDevThroughputHelper(Ptr< const SatHelper > satHelper)
std::map< Ptr< Probe >, std::pair< Ptr< Node >, uint32_t > > m_probes
Maintains a list of probes created by this helper.
virtual void UpdateIdentifierOnProbes()
Change identifier used on probes, when handovers occur.
static TypeId GetTypeId()
inherited from ObjectBase base class
virtual ~SatStatsFwdUserDevThroughputHelper()
/ Destructor.
Produce forward user link MAC-level throughput statistics from a satellite module simulation.
std::map< Ptr< Probe >, std::pair< Ptr< Node >, uint32_t > > m_probes
Maintains a list of probes created by this helper.
virtual ~SatStatsFwdUserMacThroughputHelper()
/ Destructor.
virtual void UpdateIdentifierOnProbes()
Change identifier used on probes, when handovers occur.
SatStatsFwdUserMacThroughputHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
Produce forward user link PHY-level throughput statistics from a satellite module simulation.
virtual void UpdateIdentifierOnProbes()
Change identifier used on probes, when handovers occur.
SatStatsFwdUserPhyThroughputHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
std::map< Ptr< Probe >, std::pair< Ptr< Node >, uint32_t > > m_probes
Maintains a list of probes created by this helper.
virtual ~SatStatsFwdUserPhyThroughputHelper()
/ Destructor.
Parent abstract class of all satellite statistics helpers.
static Ptr< NetDevice > GetSatSatOrbiterNetDevice(Ptr< Node > satNode)
uint32_t GetIdentifierForUtUser(Ptr< Node > utUserNode) const
static NetDeviceContainer GetGwSatNetDevice(Ptr< Node > gwNode)
virtual void SaveAddressAndIdentifier(Ptr< Node > utNode)
Save the address and the proper identifier from the given UT node.
static std::string GetOutputTypeName(OutputType_t outputType)
virtual std::string GetIdentifierHeading(std::string dataLabel) const
virtual std::string GetOutputPath() const
Ptr< DataCollectionObject > CreateAggregator(std::string aggregatorTypeId, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue())
Create the aggregator according to the output type.
virtual std::string GetOutputFileName() const
Compute the path and file name where statistics output should be written to.
uint32_t 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::map< const Address, uint32_t > m_identifierMap
Map of address and the identifier associated with it.
uint32_t GetUtUserId(Ptr< Node > utUserNode) const
std::string GetName() const
virtual std::string GetTimeHeading(std::string dataLabel) const
virtual std::string GetDistributionHeading(std::string dataLabel) const
Produce return link application-level throughput statistics from a satellite module simulation.
void Ipv4Callback(Ptr< const Packet > packet, const Address &from)
Receive inputs from trace sources and determine the right collector to forward the inputs to.
SatStatsRtnAppThroughputHelper(Ptr< const SatHelper > satHelper)
virtual ~SatStatsRtnAppThroughputHelper()
/ Destructor.
static TypeId GetTypeId()
inherited from ObjectBase base class
void SaveIpv4AddressAndIdentifier(Ptr< Node > utUserNode)
Save the IPv4 address and the proper identifier from the given UT user node.
Produce return feeder link device-level throughput statistics from a satellite module simulation.
SatStatsRtnFeederDevThroughputHelper(Ptr< const SatHelper > satHelper)
virtual ~SatStatsRtnFeederDevThroughputHelper()
/ Destructor.
static TypeId GetTypeId()
inherited from ObjectBase base class
Produce return feeder link MAC-level throughput statistics from a satellite module simulation.
virtual ~SatStatsRtnFeederMacThroughputHelper()
/ Destructor.
SatStatsRtnFeederMacThroughputHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
Produce return feeder link PHY-level throughput statistics from a satellite module simulation.
static TypeId GetTypeId()
inherited from ObjectBase base class
virtual ~SatStatsRtnFeederPhyThroughputHelper()
/ Destructor.
SatStatsRtnFeederPhyThroughputHelper(Ptr< const SatHelper > satHelper)
Produce return user link device-level throughput statistics from a satellite module simulation.
virtual ~SatStatsRtnUserDevThroughputHelper()
/ Destructor.
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsRtnUserDevThroughputHelper(Ptr< const SatHelper > satHelper)
Produce return user link MAC-level throughput statistics from a satellite module simulation.
SatStatsRtnUserMacThroughputHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
virtual ~SatStatsRtnUserMacThroughputHelper()
/ Destructor.
Produce return user link PHY-level throughput statistics from a satellite module simulation.
virtual ~SatStatsRtnUserPhyThroughputHelper()
/ Destructor.
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsRtnUserPhyThroughputHelper(Ptr< const SatHelper > satHelper)
CollectorMap m_conversionCollectors
Maintains a list of first-level collectors created by this helper.
void InstallProbes()
Set up several probes or other means of listeners and connect them to the first-level collectors.
Ptr< DistributionCollector > m_averagingCollector
The final collector utilized in averaged output (histogram, PDF, and CDF).
void RxCallback(Ptr< const Packet > packet, const Address &from)
Receive inputs from trace sources and determine the right collector to forward the inputs to.
Ptr< DataCollectionObject > m_aggregator
The aggregator created by this helper.
void SetAveragingMode(bool averagingMode)
static TypeId GetTypeId()
inherited from ObjectBase base class
virtual void DoInstallProbes()=0
virtual ~SatStatsThroughputHelper()
/ Destructor.
CollectorMap m_terminalCollectors
Maintains a list of second-level collectors created by this helper.
SatStatsThroughputHelper(Ptr< const SatHelper > satHelper)
bool m_averagingMode
AveragingMode attribute.
void DoInstall()
Install the probes, collectors, and aggregators necessary to produce the statistics output.
bool GetAveragingMode() const
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.