Config::SetDefault ("ns3::FlowMonitor::StartTime",TimeValue (Seconds (m_dataStart)));
Config::SetDefault ("ns3::FlowMonitor::PacketSizeBinWidth", DoubleValue (1000));
//Print per flow statistics
monitor->CheckForLostPackets ();
Ptr<Ipv4FlowClassifier> classifier = DynamicCast<Ipv4FlowClassifier> (flowmon.GetClassifier ());
std::map<FlowId, FlowMonitor::FlowStats> stats = monitor->GetFlowStats ();
for (std::map<FlowId, FlowMonitor::FlowStats>::const_iterator iter = stats.begin (); iter != stats.end (); ++iter)
{
Ipv4FlowClassifier::FiveTuple t = classifier->FindFlow (iter->first);
std::cout << "Time: "<< Simulator :: Now() <<"Flow ID: " << iter->first << " Src Addr " << t.sourceAddress << " Dst Addr " << t.destinationAddress;
std::cout << "Tx Packets = " << iter->second.txPackets;
std::cout << "Rx Packets = " << iter->second.rxPackets;
std::cout << "Throughput: " << iter->second.rxBytes * 8.0 / (iter->second.timeLastRxPacket.GetSeconds()-iter->second.timeFirstTxPacket.GetSeconds()) / 1024 << " Kbps";
}
monitor = flowmon.InstallAll();
Simulator::Stop (Seconds (m_totalTime));
AnimationInterface anim ("aerorp.xml");
Simulator::Run ();
monitor->SerializeToXmlFile("aerorp.flowmon", true, true);
Simulator::Destroy ();
the error is
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Trace file generated is AeroRP_2Nodes_100SimTime.tr
Creating 2 anNodes.
[node 1] [Time 0]AeroRPRoutingProtocol:NotifyAddAddress(0x80c6a20, interface , 1, address , m_local=10.1.1.1; m_mask=255.255.255.0; m_broadcast=10.1.1.255; m_scope=2; m_secondary=0)
[node 1] [Time 0]AeroRPRoutingProtocol:NotifyInterfaceUp(0x80c6a20, 10.1.1.1)
[node 2] [Time 0]AeroRPRoutingProtocol:NotifyAddAddress(0x80c7578, interface , 1, address , m_local=10.1.1.2; m_mask=255.255.255.0; m_broadcast=10.1.1.255; m_scope=2; m_secondary=0)
[node 2] [Time 0]AeroRPRoutingProtocol:NotifyInterfaceUp(0x80c7578, 10.1.1.2)
[node 0] [Time 0]AeroRPRoutingProtocol:NotifyAddAddress(0x80c8348, interface , 1, address , m_local=10.1.1.3; m_mask=255.255.255.0; m_broadcast=10.1.1.255; m_scope=2; m_secondary=0)
[node 0] [Time 0]AeroRPRoutingProtocol:NotifyInterfaceUp(0x80c8348, 10.1.1.3)
[node 0] [Time 0]AeroRPRoutingProtocol:Start(0x80c8348)
[node 1] [Time 0]AeroRPRoutingProtocol:Start(0x80c6a20)
[node 2] [Time 0]AeroRPRoutingProtocol:Start(0x80c7578)
Starting simulation for 100 s ...
Program received signal SIGSEGV, Segmentation fault.
0xb7b552d4 in ns3::Time::Time (this=0xbfffe878, o=...) at ./ns3/nstime.h:175
175 : m_data (o.m_data)
(gdb) backtrace
#0 0xb7b552d4 in ns3::Time::Time (this=0xbfffe878, o=...)
at ./ns3/nstime.h:175
#1 0xb6bcf9f3 in ns3::FlowMonitor::CheckForLostPackets (this=0x0)
at ../src/flow-monitor/model/flow-monitor.cc:305
#2 0x0805bb69 in AeroRPSimulation::CaseRun (this=0xbfffedb8, nWifis=2,
nSinks=1, totalTime=100, rate=..., phyMode=..., nodeSpeed=1200,
dataStart=30, printRoutes=true, CSVfileName=...)
at ../scratch/aero2dtest.cc:310
#3 0x0805a987 in main (argc=1, argv=0xbffff054)
at ../scratch/aero2dtest.cc:192
(gdb)
any way the function CheckForLostPackets() doesn't receive any arg the flow monitor has 2 func with the name CheckForLostPackets () one has no arg which i use and the other one receive time arg