" std::map<FlowId, FlowMonitor::FlowStats> stats = monitor->GetFlowStats ();
std::map< FlowId, FlowMonitor::FlowStats > ns3::FlowMonitor::GetFlowStats |
( | ) | const |
Retrieve all collected the flow statistics. Note, if the FlowMonitor has not stopped monitoring yet, you should call CheckForLostPackets() to make sure all possibly lost packets are accounted for.
Then You go through each element of the std::map and get the results.for (std::map<FlowId, FlowMonitor::FlowStats>::const_iterator iter = stats.begin (); iter != stats.end (); ++iter)
{
Ipv4FlowClassifier::FiveTuple t = classifier->FindFlow (iter->first);
if ((t.sourceAddress == Ipv4Address("10.1.1.1") && t.destinationAddress == Ipv4Address("10.1.1.25"))
|| (t.sourceAddress == Ipv4Address("10.1.1.11") && t.destinationAddress == Ipv4Address("10.1.1.15"))
|| (t.sourceAddress == Ipv4Address("10.1.1.21") && t.destinationAddress == Ipv4Address("10.1.1.5")))
{
NS_LOG_UNCOND("Flow ID: " << iter->first << " Src Addr " << t.sourceAddress << " Dst Addr " << t.destinationAddress);
NS_LOG_UNCOND("Tx Packets = " << iter->second.txPackets);
NS_LOG_UNCOND("Rx Packets = " << iter->second.rxPackets);
NS_LOG_UNCOND("Throughput: " << iter->second.rxBytes * 8.0 / (iter->second.timeLastRxPacket.GetSeconds()-iter->second.timeFirstTxPacket.GetSeconds()) / 1024 << " Kbps");
}
}"
i read this part of the code from the following reference:
http://personal.ee.surrey.ac.uk/Personal/K.Katsaros/ns-3-workshop-part1.html#step5-1
But I am not able to understand it and need explanation on how
the programmer arrived on this code.
--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/TXk7CU8fzGQ/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.