mirror of
https://gitlab.com/manzerbredes/paper-lowrate-iot.git
synced 2025-05-01 09:27:45 +00:00
Start some simulation tests
This commit is contained in:
parent
1399886f4d
commit
a6e70544bb
37 changed files with 53416 additions and 5509 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue