24 #include <ns3/data-collection-object.h>
25 #include <ns3/fatal-error.h>
27 #include <ns3/multi-file-aggregator.h>
28 #include <ns3/node-container.h>
29 #include <ns3/satellite-helper.h>
30 #include <ns3/satellite-net-device.h>
31 #include <ns3/satellite-request-manager.h>
32 #include <ns3/satellite-topology.h>
33 #include <ns3/satellite-ut-llc.h>
34 #include <ns3/singleton.h>
35 #include <ns3/string.h>
40 NS_LOG_COMPONENT_DEFINE(
"SatStatsCapacityRequestHelper");
45 NS_OBJECT_ENSURE_REGISTERED(SatStatsCapacityRequestHelper);
50 NS_LOG_FUNCTION(
this << satHelper);
55 NS_LOG_FUNCTION(
this);
61 static TypeId tid = TypeId(
"ns3::SatStatsCapacityRequestHelper").SetParent<
SatStatsHelper>();
68 NS_LOG_FUNCTION(
this);
73 <<
" is not a valid output type for this statistics.");
79 <<
" is not a valid identifier type for this statistics.");
84 "ns3::MultiFileAggregator",
88 StringValue(
"% time_sec, node_id, rc_id, type, kbps / bytes, queue_bytes"));
89 Ptr<MultiFileAggregator> multiFileAggregator =
m_aggregator->GetObject<MultiFileAggregator>();
90 NS_ASSERT(multiFileAggregator !=
nullptr);
91 Callback<void, std::string, std::string> aggregatorSink =
92 MakeCallback(&MultiFileAggregator::WriteString, multiFileAggregator);
95 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
96 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
98 std::ostringstream context;
117 NS_FATAL_ERROR(
"SatStatsCapacityRequestHelper - Invalid identifier type");
122 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
123 NS_ASSERT(satDev !=
nullptr);
124 Ptr<SatLlc> satLlc = satDev->GetLlc();
125 NS_ASSERT(satLlc !=
nullptr);
126 Ptr<SatUtLlc> utLlc = satLlc->GetObject<
SatUtLlc>();
127 NS_ASSERT(utLlc !=
nullptr);
128 Ptr<SatRequestManager> requestManager = utLlc->GetRequestManager();
130 const bool ret = requestManager->TraceConnect(
"CrTraceLog", context.str(), aggregatorSink);
131 NS_ASSERT_MSG(ret,
"Error connecting to CrTraceLog of node " << (*it)->GetId());
132 NS_LOG_INFO(
this <<
" successfully connected"
133 <<
" with node ID " << (*it)->GetId());
SatNetDevice to be utilized in the UT and GW nodes.
virtual ~SatStatsCapacityRequestHelper()
/ Destructor.
SatStatsCapacityRequestHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
void DoInstall()
Install the probes, collectors, and aggregators necessary to produce the statistics output.
Ptr< DataCollectionObject > m_aggregator
The aggregator created by this helper.
Parent abstract class of all satellite statistics helpers.
IdentifierType_t GetIdentifierType() const
static std::string GetOutputTypeName(OutputType_t outputType)
static std::string GetIdentifierTypeName(IdentifierType_t identifierType)
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.
static Ptr< NetDevice > GetUtSatNetDevice(Ptr< Node > utNode)
OutputType_t GetOutputType() const
uint32_t GetIdentifierForUt(Ptr< Node > utNode) const
SatUtLlc holds the UT implementation of LLC layer.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.