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"
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"
59NS_LOG_COMPONENT_DEFINE(
"SatStatsThroughputHelper");
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()
407 <<
" bytes)" <<
" from statistics collection because of"
408 <<
" invalid sender address");
413 std::map<const Address, uint32_t>::const_iterator it =
m_identifierMap.find(from);
417 NS_LOG_WARN(
this <<
" discarding packet " << packet <<
" (" << packet->GetSize()
418 <<
" bytes)" <<
" from statistics collection because of"
419 <<
" unknown sender address " << from);
425 NS_ASSERT_MSG(collector !=
nullptr,
426 "Unable to find collector with identifier " << it->second);
427 Ptr<UnitConversionCollector> c = collector->GetObject<UnitConversionCollector>();
428 NS_ASSERT(c !=
nullptr);
431 c->TraceSinkUinteger32(0, packet->GetSize());
444 NS_LOG_FUNCTION(
this << satHelper);
449 NS_LOG_FUNCTION(
this);
463 NS_LOG_FUNCTION(
this);
464 NodeContainer utUsers = Singleton<SatTopology>::Get()->GetUtUserNodes();
466 for (NodeContainer::Iterator it = utUsers.Begin(); it != utUsers.End(); ++it)
469 NS_ASSERT_MSG(utUserId > 0,
"Node " << (*it)->GetId() <<
" is not a valid UT user");
472 for (uint32_t i = 0; i < (*it)->GetNApplications(); i++)
475 std::ostringstream probeName;
476 probeName << utUserId <<
"-" << i;
477 Ptr<ApplicationPacketProbe> probe = CreateObject<ApplicationPacketProbe>();
478 probe->SetName(probeName.str());
481 if (probe->ConnectByObject(
"Rx", (*it)->GetApplication(i)))
485 probe->GetObject<Probe>(),
488 &UnitConversionCollector::TraceSinkUinteger32))
490 NS_LOG_INFO(
this <<
" created probe " << probeName.str()
491 <<
", connected to collector " << identifier);
493 std::make_pair(probe->GetObject<Probe>(), std::make_pair(*it, identifier)));
497 NS_LOG_WARN(
this <<
" unable to connect probe " << probeName.str()
498 <<
" to collector " << identifier);
508 NS_LOG_WARN(
this <<
" unable to connect probe " << probeName.str()
509 <<
" with node ID " << (*it)->GetId() <<
" application #" << i);
521 NS_LOG_FUNCTION(
this);
523 std::map<Ptr<Probe>, std::pair<Ptr<Node>, uint32_t>>::iterator it;
527 Ptr<Probe> probe = it->first;
528 Ptr<Node> node = it->second.first;
529 uint32_t identifier = it->second.second;
533 &UnitConversionCollector::TraceSinkUinteger32);
540 &UnitConversionCollector::TraceSinkUinteger32);
542 it->second.second = identifier;
551 Ptr<const SatHelper> satHelper)
554 NS_LOG_FUNCTION(
this << satHelper);
559 NS_LOG_FUNCTION(
this);
573 NS_LOG_FUNCTION(
this);
575 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
576 Callback<void, Ptr<const Packet>,
const Address&> callback =
579 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
583 NS_ASSERT(satOrbiterDev !=
nullptr);
584 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
586 if (satOrbiterDev->TraceConnectWithoutContext(
"RxFeeder", callback))
588 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
589 <<
" device #" << satOrbiterDev->GetIfIndex());
592 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
596 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatNetDevice"
597 <<
" at node ID " << (*it)->GetId() <<
" device #"
598 << satOrbiterDev->GetIfIndex());
602 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
604 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
610 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
611 NS_ASSERT(satDev !=
nullptr);
613 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
618 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
619 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
623 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
625 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
626 NS_ASSERT(satDev !=
nullptr);
628 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
638 Ptr<const SatHelper> satHelper)
641 NS_LOG_FUNCTION(
this << satHelper);
646 NS_LOG_FUNCTION(
this);
660 NS_LOG_FUNCTION(
this);
661 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
663 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
665 const int32_t utId =
GetUtId(*it);
666 NS_ASSERT_MSG(utId > 0,
"Node " << (*it)->GetId() <<
" is not a valid UT");
670 std::ostringstream probeName;
672 Ptr<ApplicationPacketProbe> probe = CreateObject<ApplicationPacketProbe>();
673 probe->SetName(probeName.str());
678 if (probe->ConnectByObject(
"Rx", dev))
682 probe->GetObject<Probe>(),
685 &UnitConversionCollector::TraceSinkUinteger32))
687 NS_LOG_INFO(
this <<
" created probe " << probeName.str()
688 <<
", connected to collector " << identifier);
690 std::make_pair(probe->GetObject<Probe>(), std::make_pair(*it, identifier)));
693 dev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
697 NS_LOG_WARN(
this <<
" unable to connect probe " << probeName.str()
698 <<
" to collector " << identifier);
704 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatNetDevice"
705 <<
" at node ID " << (*it)->GetId() <<
" device #2");
711 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
712 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
716 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
718 NS_ASSERT((*itDev)->GetObject<
SatNetDevice>() !=
nullptr);
719 (*itDev)->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
728 NS_LOG_FUNCTION(
this);
730 std::map<Ptr<Probe>, std::pair<Ptr<Node>, uint32_t>>::iterator it;
734 Ptr<Probe> probe = it->first;
735 Ptr<Node> node = it->second.first;
736 uint32_t identifier = it->second.second;
740 &UnitConversionCollector::TraceSinkUinteger32);
747 &UnitConversionCollector::TraceSinkUinteger32);
749 it->second.second = identifier;
758 Ptr<const SatHelper> satHelper)
761 NS_LOG_FUNCTION(
this << satHelper);
766 NS_LOG_FUNCTION(
this);
780 NS_LOG_FUNCTION(
this);
782 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
783 Callback<void, Ptr<const Packet>,
const Address&> callback =
786 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
790 NS_ASSERT(satOrbiterDev !=
nullptr);
791 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
792 std::map<uint32_t, Ptr<SatMac>> satOrbiterFeederMacs = satOrbiterDev->GetAllFeederMac();
794 for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satOrbiterFeederMacs.begin();
795 it2 != satOrbiterFeederMacs.end();
798 satMac = it2->second;
799 NS_ASSERT(satMac !=
nullptr);
800 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
803 if (satMac->TraceConnectWithoutContext(
"Rx", callback))
805 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
806 <<
" device #" << satOrbiterDev->GetIfIndex());
810 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatMac"
811 <<
" at node ID " << (*it)->GetId() <<
" device #"
812 << satOrbiterDev->GetIfIndex());
815 std::map<uint32_t, Ptr<SatMac>> satOrbiterUserMacs = satOrbiterDev->GetUserMac();
816 for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satOrbiterUserMacs.begin();
817 it2 != satOrbiterUserMacs.end();
820 satMac = it2->second;
821 NS_ASSERT(satMac !=
nullptr);
822 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
826 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
828 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
834 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
835 NS_ASSERT(satDev !=
nullptr);
836 Ptr<SatMac> satMac = satDev->GetMac();
837 NS_ASSERT(satMac !=
nullptr);
839 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
840 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
845 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
846 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
850 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
852 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
853 NS_ASSERT(satDev !=
nullptr);
854 Ptr<SatMac> satMac = satDev->GetMac();
855 NS_ASSERT(satMac !=
nullptr);
857 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
858 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
869 Ptr<const SatHelper> satHelper)
872 NS_LOG_FUNCTION(
this << satHelper);
877 NS_LOG_FUNCTION(
this);
891 NS_LOG_FUNCTION(
this);
893 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
895 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
899 NS_ASSERT(satOrbiterDev !=
nullptr);
900 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
901 std::map<uint32_t, Ptr<SatMac>> satOrbiterFeederMacs = satOrbiterDev->GetAllFeederMac();
903 for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satOrbiterFeederMacs.begin();
904 it2 != satOrbiterFeederMacs.end();
907 satMac = it2->second;
908 NS_ASSERT(satMac !=
nullptr);
909 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
911 std::map<uint32_t, Ptr<SatMac>> satOrbiterUserMacs = satOrbiterDev->GetUserMac();
912 for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satOrbiterUserMacs.begin();
913 it2 != satOrbiterUserMacs.end();
916 satMac = it2->second;
917 NS_ASSERT(satMac !=
nullptr);
918 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
922 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
924 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
926 const int32_t utId =
GetUtId(*it);
927 NS_ASSERT_MSG(utId > 0,
"Node " << (*it)->GetId() <<
" is not a valid UT");
931 std::ostringstream probeName;
933 Ptr<ApplicationPacketProbe> probe = CreateObject<ApplicationPacketProbe>();
934 probe->SetName(probeName.str());
937 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
938 NS_ASSERT(satDev !=
nullptr);
939 Ptr<SatMac> satMac = satDev->GetMac();
940 NS_ASSERT(satMac !=
nullptr);
943 if (probe->ConnectByObject(
"Rx", satMac))
947 probe->GetObject<Probe>(),
950 &UnitConversionCollector::TraceSinkUinteger32))
953 std::make_pair(probe->GetObject<Probe>(), std::make_pair(*it, identifier)));
956 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
957 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
961 NS_LOG_WARN(
this <<
" unable to connect probe " << probeName.str()
962 <<
" to collector " << identifier);
967 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatMac"
968 <<
" at node ID " << (*it)->GetId() <<
" device #2");
973 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
974 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
978 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
980 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
981 NS_ASSERT(satDev !=
nullptr);
982 Ptr<SatMac> satMac = satDev->GetMac();
983 NS_ASSERT(satMac !=
nullptr);
985 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
986 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
995 NS_LOG_FUNCTION(
this);
997 std::map<Ptr<Probe>, std::pair<Ptr<Node>, uint32_t>>::iterator it;
1001 Ptr<Probe> probe = it->first;
1002 Ptr<Node> node = it->second.first;
1003 uint32_t identifier = it->second.second;
1007 &UnitConversionCollector::TraceSinkUinteger32);
1014 &UnitConversionCollector::TraceSinkUinteger32);
1016 it->second.second = identifier;
1025 Ptr<const SatHelper> satHelper)
1028 NS_LOG_FUNCTION(
this << satHelper);
1033 NS_LOG_FUNCTION(
this);
1047 NS_LOG_FUNCTION(
this);
1049 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
1050 Callback<void, Ptr<const Packet>,
const Address&> callback =
1053 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1057 NS_ASSERT(satOrbiterDev !=
nullptr);
1058 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1059 std::map<uint32_t, Ptr<SatPhy>> satOrbiterFeederPhys = satOrbiterDev->GetFeederPhy();
1061 for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satOrbiterFeederPhys.begin();
1062 it2 != satOrbiterFeederPhys.end();
1065 satPhy = it2->second;
1066 NS_ASSERT(satPhy !=
nullptr);
1067 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1070 if (satPhy->TraceConnectWithoutContext(
"Rx", callback))
1072 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
1073 <<
" device #" << satOrbiterDev->GetIfIndex());
1076 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1080 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatPhy"
1081 <<
" at node ID " << (*it)->GetId() <<
" device #"
1082 << satOrbiterDev->GetIfIndex());
1085 std::map<uint32_t, Ptr<SatPhy>> satOrbiterUserPhys = satOrbiterDev->GetUserPhy();
1086 for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satOrbiterUserPhys.begin();
1087 it2 != satOrbiterUserPhys.end();
1090 satPhy = it2->second;
1091 NS_ASSERT(satPhy !=
nullptr);
1092 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1096 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
1098 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1104 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
1105 NS_ASSERT(satDev !=
nullptr);
1106 Ptr<SatPhy> satPhy = satDev->GetPhy();
1107 NS_ASSERT(satPhy !=
nullptr);
1109 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1110 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1115 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
1116 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1120 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1122 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
1123 NS_ASSERT(satDev !=
nullptr);
1124 Ptr<SatPhy> satPhy = satDev->GetPhy();
1125 NS_ASSERT(satPhy !=
nullptr);
1127 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1128 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1139 Ptr<const SatHelper> satHelper)
1142 NS_LOG_FUNCTION(
this << satHelper);
1147 NS_LOG_FUNCTION(
this);
1161 NS_LOG_FUNCTION(
this);
1163 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
1165 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1169 NS_ASSERT(satOrbiterDev !=
nullptr);
1170 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1171 std::map<uint32_t, Ptr<SatPhy>> satOrbiterFeederPhys = satOrbiterDev->GetFeederPhy();
1173 for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satOrbiterFeederPhys.begin();
1174 it2 != satOrbiterFeederPhys.end();
1177 satPhy = it2->second;
1178 NS_ASSERT(satPhy !=
nullptr);
1179 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1181 std::map<uint32_t, Ptr<SatPhy>> satOrbiterUserPhys = satOrbiterDev->GetUserPhy();
1182 for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satOrbiterUserPhys.begin();
1183 it2 != satOrbiterUserPhys.end();
1186 satPhy = it2->second;
1187 NS_ASSERT(satPhy !=
nullptr);
1188 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1192 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
1194 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1196 const int32_t utId =
GetUtId(*it);
1197 NS_ASSERT_MSG(utId > 0,
"Node " << (*it)->GetId() <<
" is not a valid UT");
1201 std::ostringstream probeName;
1203 Ptr<ApplicationPacketProbe> probe = CreateObject<ApplicationPacketProbe>();
1204 probe->SetName(probeName.str());
1207 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
1208 NS_ASSERT(satDev !=
nullptr);
1209 Ptr<SatPhy> satPhy = satDev->GetPhy();
1210 NS_ASSERT(satPhy !=
nullptr);
1213 if (probe->ConnectByObject(
"Rx", satPhy))
1216 probe->GetObject<Probe>(),
1219 &UnitConversionCollector::TraceSinkUinteger32))
1222 std::make_pair(probe->GetObject<Probe>(), std::make_pair(*it, identifier)));
1225 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1226 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1230 NS_LOG_WARN(
this <<
" unable to connect probe " << probeName.str()
1231 <<
" to collector " << identifier);
1236 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatPhy"
1237 <<
" at node ID " << (*it)->GetId() <<
" device #2");
1242 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
1243 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1247 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1249 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
1250 NS_ASSERT(satDev !=
nullptr);
1251 Ptr<SatPhy> satPhy = satDev->GetPhy();
1252 NS_ASSERT(satPhy !=
nullptr);
1254 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1255 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1264 NS_LOG_FUNCTION(
this);
1266 std::map<Ptr<Probe>, std::pair<Ptr<Node>, uint32_t>>::iterator it;
1270 Ptr<Probe> probe = it->first;
1271 Ptr<Node> node = it->second.first;
1272 uint32_t identifier = it->second.second;
1276 &UnitConversionCollector::TraceSinkUinteger32);
1283 &UnitConversionCollector::TraceSinkUinteger32);
1285 it->second.second = identifier;
1296 NS_LOG_FUNCTION(
this << satHelper);
1301 NS_LOG_FUNCTION(
this);
1315 NS_LOG_FUNCTION(
this);
1318 NodeContainer utUsers = Singleton<SatTopology>::Get()->GetUtUserNodes();
1319 for (NodeContainer::Iterator it = utUsers.Begin(); it != utUsers.End(); ++it)
1326 NodeContainer gwUsers = Singleton<SatTopology>::Get()->GetGwUserNodes();
1327 Callback<void, Ptr<const Packet>,
const Address&> callback =
1330 for (NodeContainer::Iterator it = gwUsers.Begin(); it != gwUsers.End(); ++it)
1332 for (uint32_t i = 0; i < (*it)->GetNApplications(); i++)
1334 Ptr<Application> app = (*it)->GetApplication(i);
1336 if (app->TraceConnectWithoutContext(
"Rx", callback))
1338 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
1339 <<
" application #" << i);
1348 NS_LOG_WARN(
this <<
" unable to connect with node ID " << (*it)->GetId()
1349 <<
" application #" << i);
1361 if (InetSocketAddress::IsMatchingType(from))
1364 const Address ipv4Addr = InetSocketAddress::ConvertFrom(from).GetIpv4();
1365 std::map<const Address, uint32_t>::const_iterator it1 =
m_identifierMap.find(ipv4Addr);
1369 NS_LOG_WARN(
this <<
" discarding packet " << packet <<
" (" << packet->GetSize()
1370 <<
" bytes)" <<
" from statistics collection because of"
1371 <<
" unknown sender IPv4 address " << ipv4Addr);
1377 NS_ASSERT_MSG(collector !=
nullptr,
1378 "Unable to find collector with identifier " << it1->second);
1379 Ptr<UnitConversionCollector> c = collector->GetObject<UnitConversionCollector>();
1380 NS_ASSERT(c !=
nullptr);
1383 c->TraceSinkUinteger32(0, packet->GetSize());
1388 NS_LOG_WARN(
this <<
" discarding packet " << packet <<
" (" << packet->GetSize()
1389 <<
" bytes)" <<
" from statistics collection"
1390 <<
" because it comes from sender " << from
1391 <<
" without valid InetSocketAddress");
1399 NS_LOG_FUNCTION(
this << utUserNode->GetId());
1401 Ptr<Ipv4> ipv4 = utUserNode->GetObject<Ipv4>();
1403 if (ipv4 ==
nullptr)
1405 NS_LOG_INFO(
this <<
" Node " << utUserNode->GetId() <<
" does not support IPv4 protocol");
1407 else if (ipv4->GetNInterfaces() >= 2)
1415 for (uint32_t i = 0; i < ipv4->GetNAddresses(1); i++)
1417 const Address addr = ipv4->GetAddress(1, i).GetLocal();
1419 NS_LOG_INFO(
this <<
" associated address " << addr <<
" with identifier "
1425 NS_LOG_WARN(
this <<
" Node " << utUserNode->GetId() <<
" is not a valid UT user");
1434 Ptr<const SatHelper> satHelper)
1437 NS_LOG_FUNCTION(
this << satHelper);
1442 NS_LOG_FUNCTION(
this);
1456 NS_LOG_FUNCTION(
this);
1458 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
1459 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1466 dev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1471 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
1472 Callback<void, Ptr<const Packet>,
const Address&> callback =
1475 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1479 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1481 NS_ASSERT((*itDev)->GetObject<
SatNetDevice>() !=
nullptr);
1483 if ((*itDev)->TraceConnectWithoutContext(
"Rx", callback))
1485 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
1486 <<
" device #" << (*itDev)->GetIfIndex());
1489 (*itDev)->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1493 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatNetDevice"
1494 <<
" at node ID " << (*it)->GetId() <<
" device #"
1495 << (*itDev)->GetIfIndex());
1509 Ptr<const SatHelper> satHelper)
1512 NS_LOG_FUNCTION(
this << satHelper);
1517 NS_LOG_FUNCTION(
this);
1531 NS_LOG_FUNCTION(
this);
1533 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
1534 Callback<void, Ptr<const Packet>,
const Address&> callback =
1537 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1541 NS_ASSERT(satOrbiterDev !=
nullptr);
1542 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1545 if (satOrbiterDev->TraceConnectWithoutContext(
"RxUser", callback))
1547 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
1548 <<
" device #" << satOrbiterDev->GetIfIndex());
1552 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatMac"
1553 <<
" at node ID " << (*it)->GetId() <<
" device #"
1554 << satOrbiterDev->GetIfIndex());
1558 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
1559 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1566 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
1567 NS_ASSERT(satDev !=
nullptr);
1568 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1573 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
1575 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1579 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1581 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
1582 NS_ASSERT(satDev !=
nullptr);
1584 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1596 Ptr<const SatHelper> satHelper)
1599 NS_LOG_FUNCTION(
this << satHelper);
1604 NS_LOG_FUNCTION(
this);
1618 NS_LOG_FUNCTION(
this);
1620 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
1622 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1627 NS_ASSERT(satOrbiterDev !=
nullptr);
1628 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1629 std::map<uint32_t, Ptr<SatMac>> satOrbiterFeederMacs = satOrbiterDev->GetAllFeederMac();
1630 for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satOrbiterFeederMacs.begin();
1631 it2 != satOrbiterFeederMacs.end();
1634 satMac = it2->second;
1635 NS_ASSERT(satMac !=
nullptr);
1636 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1638 std::map<uint32_t, Ptr<SatMac>> satOrbiterUserMacs = satOrbiterDev->GetUserMac();
1639 for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satOrbiterUserMacs.begin();
1640 it2 != satOrbiterUserMacs.end();
1643 satMac = it2->second;
1644 NS_ASSERT(satMac !=
nullptr);
1645 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1649 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
1650 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1657 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
1658 NS_ASSERT(satDev !=
nullptr);
1659 Ptr<SatMac> satMac = satDev->GetMac();
1660 NS_ASSERT(satMac !=
nullptr);
1661 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1662 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1667 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
1668 Callback<void, Ptr<const Packet>,
const Address&> callback =
1671 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1675 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1677 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
1678 NS_ASSERT(satDev !=
nullptr);
1679 Ptr<SatMac> satMac = satDev->GetMac();
1680 NS_ASSERT(satMac !=
nullptr);
1683 if (satMac->TraceConnectWithoutContext(
"Rx", callback))
1685 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
1686 <<
" device #" << satDev->GetIfIndex());
1689 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1690 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1694 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatMac"
1695 <<
" at node ID " << (*it)->GetId() <<
" device #"
1696 << satDev->GetIfIndex());
1710 Ptr<const SatHelper> satHelper)
1713 NS_LOG_FUNCTION(
this << satHelper);
1718 NS_LOG_FUNCTION(
this);
1732 NS_LOG_FUNCTION(
this);
1734 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
1735 Callback<void, Ptr<const Packet>,
const Address&> callback =
1738 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1742 NS_ASSERT(satOrbiterDev !=
nullptr);
1743 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1744 std::map<uint32_t, Ptr<SatMac>> satOrbiterFeederMacs = satOrbiterDev->GetAllFeederMac();
1746 for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satOrbiterFeederMacs.begin();
1747 it2 != satOrbiterFeederMacs.end();
1750 satMac = it2->second;
1751 NS_ASSERT(satMac !=
nullptr);
1752 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1754 std::map<uint32_t, Ptr<SatMac>> satOrbiterUserMacs = satOrbiterDev->GetUserMac();
1755 for (std::map<uint32_t, Ptr<SatMac>>::iterator it2 = satOrbiterUserMacs.begin();
1756 it2 != satOrbiterUserMacs.end();
1759 satMac = it2->second;
1760 NS_ASSERT(satMac !=
nullptr);
1761 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1764 if (satMac->TraceConnectWithoutContext(
"Rx", callback))
1766 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
1767 <<
" device #" << satOrbiterDev->GetIfIndex());
1771 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatMac"
1772 <<
" at node ID " << (*it)->GetId() <<
" device #"
1773 << satOrbiterDev->GetIfIndex());
1778 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
1779 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1786 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
1787 NS_ASSERT(satDev !=
nullptr);
1788 Ptr<SatMac> satMac = satDev->GetMac();
1789 NS_ASSERT(satMac !=
nullptr);
1790 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1791 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1796 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
1798 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1802 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1804 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
1805 NS_ASSERT(satDev !=
nullptr);
1806 Ptr<SatMac> satMac = satDev->GetMac();
1807 NS_ASSERT(satMac !=
nullptr);
1809 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1810 satMac->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1822 Ptr<const SatHelper> satHelper)
1825 NS_LOG_FUNCTION(
this << satHelper);
1830 NS_LOG_FUNCTION(
this);
1844 NS_LOG_FUNCTION(
this);
1846 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
1848 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1853 NS_ASSERT(satOrbiterDev !=
nullptr);
1854 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1855 std::map<uint32_t, Ptr<SatPhy>> satOrbiterFeederPhys = satOrbiterDev->GetFeederPhy();
1856 for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satOrbiterFeederPhys.begin();
1857 it2 != satOrbiterFeederPhys.end();
1860 satPhy = it2->second;
1861 NS_ASSERT(satPhy !=
nullptr);
1862 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1864 std::map<uint32_t, Ptr<SatPhy>> satOrbiterUserPhys = satOrbiterDev->GetUserPhy();
1865 for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satOrbiterUserPhys.begin();
1866 it2 != satOrbiterUserPhys.end();
1869 satPhy = it2->second;
1870 NS_ASSERT(satPhy !=
nullptr);
1871 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1875 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
1876 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
1883 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
1884 NS_ASSERT(satDev !=
nullptr);
1885 Ptr<SatPhy> satPhy = satDev->GetPhy();
1886 NS_ASSERT(satPhy !=
nullptr);
1887 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1888 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1893 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
1894 Callback<void, Ptr<const Packet>,
const Address&> callback =
1897 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
1901 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
1903 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
1904 NS_ASSERT(satDev !=
nullptr);
1905 Ptr<SatPhy> satPhy = satDev->GetPhy();
1906 NS_ASSERT(satPhy !=
nullptr);
1909 if (satPhy->TraceConnectWithoutContext(
"Rx", callback))
1911 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
1912 <<
" device #" << satDev->GetIfIndex());
1915 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1916 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1920 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatPhy"
1921 <<
" at node ID " << (*it)->GetId() <<
" device #"
1922 << satDev->GetIfIndex());
1936 Ptr<const SatHelper> satHelper)
1939 NS_LOG_FUNCTION(
this << satHelper);
1944 NS_LOG_FUNCTION(
this);
1958 NS_LOG_FUNCTION(
this);
1960 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
1961 Callback<void, Ptr<const Packet>,
const Address&> callback =
1964 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
1968 NS_ASSERT(satOrbiterDev !=
nullptr);
1969 satOrbiterDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1970 std::map<uint32_t, Ptr<SatPhy>> satOrbiterFeederPhys = satOrbiterDev->GetFeederPhy();
1972 for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satOrbiterFeederPhys.begin();
1973 it2 != satOrbiterFeederPhys.end();
1976 satPhy = it2->second;
1977 NS_ASSERT(satPhy !=
nullptr);
1978 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1980 std::map<uint32_t, Ptr<SatPhy>> satOrbiterUserPhys = satOrbiterDev->GetUserPhy();
1981 for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satOrbiterUserPhys.begin();
1982 it2 != satOrbiterUserPhys.end();
1985 satPhy = it2->second;
1986 NS_ASSERT(satPhy !=
nullptr);
1987 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
1990 if (satPhy->TraceConnectWithoutContext(
"Rx", callback))
1992 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
1993 <<
" device #" << satOrbiterDev->GetIfIndex());
1997 NS_FATAL_ERROR(
"Error connecting to Rx trace source of SatPhy"
1998 <<
" at node ID " << (*it)->GetId() <<
" device #"
1999 << satOrbiterDev->GetIfIndex());
2004 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
2005 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
2012 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
2013 NS_ASSERT(satDev !=
nullptr);
2014 Ptr<SatPhy> satPhy = satDev->GetPhy();
2015 NS_ASSERT(satPhy !=
nullptr);
2016 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
2017 satPhy->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
2022 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
2024 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
2028 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
2030 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
2031 NS_ASSERT(satDev !=
nullptr);
2032 Ptr<SatPhy> satPhy = satDev->GetPhy();
2033 NS_ASSERT(satPhy !=
nullptr);
2035 satDev->SetAttribute(
"EnableStatisticsTags", BooleanValue(
true));
2036 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.
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)
SatStatsHelper(Ptr< const SatHelper > satHelper)
Creates a new helper instance.
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.