I am conducting a research related to the evaluation of some real implemented protocols considering some scenarios (easily configured in the NS-3). As a starting point, I am adapting the tap-wifi-virtual-machine example in order to verify the statistics generated by the Flow Monitor. However, when I run the example, the NS-3 returns a SIGSEGV exactly when I interact with the monitor object. Someone has experimented do something like this?
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TapBridgeHelper tapBridge;
tapBridge.SetAttribute ("Mode", StringValue ("UseLocal"));
tapBridge.SetAttribute ("DeviceName", StringValue ("tap-left"));
tapBridge.Install (nodes.Get (0), devices.Get (0));
tapBridge.SetAttribute ("DeviceName", StringValue ("tap-right"));
tapBridge.Install (nodes.Get (1), devices.Get (1));
// Install FlowMonitor on all nodes
FlowMonitorHelper flowmon;
Ptr<FlowMonitor> monitor = flowmon.InstallAll();
Simulator::Stop (Seconds (30.)); // 600.
Simulator::Run ();
NS_LOG_UNCOND("Checking for lost packets...");
monitor->CheckForLostPackets ();
NS_LOG_UNCOND("Getting flows...");
Ptr<Ipv4FlowClassifier> classifier = DynamicCast<Ipv4FlowClassifier> (flowmon.GetClassifier ());
std::map<FlowId, FlowMonitor::FlowStats> stats = monitor->GetFlowStats ();
NS_LOG_UNCOND("Checking flows...");
for (std::map<FlowId, FlowMonitor::FlowStats>::const_iterator iter = stats.begin (); iter != stats.end (); ++iter)
{
Ipv4FlowClassifier::FiveTuple t = classifier->FindFlow (iter->first);
const uint16_t port = 4324;
if (t.sourcePort == port || t.destinationPort == port) {
NS_LOG_UNCOND("Flow ID: " << iter->first << " Src Addr " << t.sourceAddress << " Dst Addr " << t.destinationAddress << " Protocol " << t.protocol);
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");
}
}
Simulator::Destroy ();
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------