Start some simulation tests

This commit is contained in:
Loic Guegan 2019-04-25 15:51:05 +02:00
parent 1399886f4d
commit a6e70544bb
37 changed files with 53416 additions and 5509 deletions

View file

@ -37,12 +37,28 @@ int main(int argc, char* argv[]){
// Don't forget the following
Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
// Run Simulations
uint32_t nNode=ns3::NodeList::GetNNodes();
NS_LOG_UNCOND("Starting simulation with "<< nNode << " nodes");
Simulator::Stop (Seconds (20));
Simulator::Run ();
Simulator::Destroy ();
// Setup Logs
uint32_t nNode=ns3::NodeList::GetNNodes();
FlowMonitorHelper flowmon;
Ptr<FlowMonitor> monitor = flowmon.InstallAll();
Ptr<Ipv4FlowClassifier> classifier = DynamicCast<Ipv4FlowClassifier> (flowmon.GetClassifier ());
// Run Simulations
Simulator::Stop (Seconds (30));
Simulator::Run ();
// Print logs
NS_LOG_UNCOND("NS-3 Version " << NS3_VERSION);
NS_LOG_UNCOND("Simulation used "<< nNode << " nodes");
std::map<FlowId, FlowMonitor::FlowStats> stats = monitor->GetFlowStats ();
for (std::map< FlowId, FlowMonitor::FlowStats>::iterator flow=stats.begin(); flow!=stats.end(); flow++)
{
Ipv4FlowClassifier::FiveTuple t = classifier->FindFlow(flow->first);
NS_LOG_UNCOND("Flow " <<t.sourceAddress<< " -> "<< t.destinationAddress << " delay = " <<flow->second.delaySum.GetSeconds());
}
// Finish
Simulator::Destroy ();
return(0);
}