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-ut-llc.h>
33 #include <ns3/string.h>
35 NS_LOG_COMPONENT_DEFINE(
"SatStatsCapacityRequestHelper");
40 NS_OBJECT_ENSURE_REGISTERED(SatStatsCapacityRequestHelper);
45 NS_LOG_FUNCTION(
this << satHelper);
50 NS_LOG_FUNCTION(
this);
56 static TypeId tid = TypeId(
"ns3::SatStatsCapacityRequestHelper").SetParent<
SatStatsHelper>();
63 NS_LOG_FUNCTION(
this);
68 <<
" is not a valid output type for this statistics.");
74 <<
" is not a valid identifier type for this statistics.");
79 "ns3::MultiFileAggregator",
83 StringValue(
"% time_sec, node_id, rc_id, type, kbps / bytes, queue_bytes"));
84 Ptr<MultiFileAggregator> multiFileAggregator =
m_aggregator->GetObject<MultiFileAggregator>();
85 NS_ASSERT(multiFileAggregator !=
nullptr);
86 Callback<void, std::string, std::string> aggregatorSink =
87 MakeCallback(&MultiFileAggregator::WriteString, multiFileAggregator);
90 NodeContainer uts =
GetSatHelper()->GetBeamHelper()->GetUtNodes();
91 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
93 std::ostringstream context;
112 NS_FATAL_ERROR(
"SatStatsCapacityRequestHelper - Invalid identifier type");
117 Ptr<SatNetDevice> satDev = dev->GetObject<
SatNetDevice>();
118 NS_ASSERT(satDev !=
nullptr);
119 Ptr<SatLlc> satLlc = satDev->GetLlc();
120 NS_ASSERT(satLlc !=
nullptr);
121 Ptr<SatUtLlc> utLlc = satLlc->GetObject<
SatUtLlc>();
122 NS_ASSERT(utLlc !=
nullptr);
123 Ptr<SatRequestManager> requestManager = utLlc->GetRequestManager();
125 const bool ret = requestManager->TraceConnect(
"CrTraceLog", context.str(), aggregatorSink);
126 NS_ASSERT_MSG(ret,
"Error connecting to CrTraceLog of node " << (*it)->GetId());
127 NS_LOG_INFO(
this <<
" successfully connected"
128 <<
" 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.
Ptr< const SatHelper > GetSatHelper() const
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.