From c1218039dacd2b999244e25efcf01247861675ab Mon Sep 17 00:00:00 2001 From: Tim Schubert Date: Tue, 18 Aug 2020 14:04:05 +0200 Subject: [PATCH] Adapt params and log delay --- examples/leo-delay-tracing-example.cc | 43 +++++++++++++-------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/examples/leo-delay-tracing-example.cc b/examples/leo-delay-tracing-example.cc index a040580..67c0129 100644 --- a/examples/leo-delay-tracing-example.cc +++ b/examples/leo-delay-tracing-example.cc @@ -10,22 +10,23 @@ using namespace ns3; NS_LOG_COMPONENT_DEFINE ("LeoDelayTracingExample"); +Time t_start; +uint64_t send = 0;; +uint64_t received = 0; + static void EchoTx (std::string context, Ptr packet) { - std::cout << context << ",ClientTx," << packet << std::endl; + send ++; + t_start = Simulator::Now (); } static void EchoRx (std::string context, Ptr packet) { - std::cout << context << ",ClientRx," << packet << std::endl; -} - -static void -EchoServerRx (std::string context, Ptr packet) -{ - std::cout << context << ",ServerRx," << packet << std::endl; + received ++; + Time now = Simulator::Now (); + std::cout << context << "," << (now - t_start) << std::endl; } int main (int argc, char *argv[]) @@ -67,15 +68,16 @@ int main (int argc, char *argv[]) // Install internet stack on nodes AodvHelper aodv; aodv.Set ("HelloInterval", TimeValue (Seconds (10))); - aodv.Set ("TtlStart", UintegerValue (100)); - aodv.Set ("TtlIncrement", UintegerValue (100)); + aodv.Set ("TtlStart", UintegerValue (10)); + aodv.Set ("TtlIncrement", UintegerValue (10)); aodv.Set ("TtlThreshold", UintegerValue (1000)); aodv.Set ("RreqRetries", UintegerValue (100)); - aodv.Set ("RerrRateLimit", UintegerValue (1000)); - aodv.Set ("RreqRateLimit", UintegerValue (1000)); + aodv.Set ("RreqRateLimit", UintegerValue (100)); + aodv.Set ("RerrRateLimit", UintegerValue (100)); + aodv.Set ("ActiveRouteTimeout", TimeValue (Seconds (10))); aodv.Set ("NextHopWait", TimeValue (MilliSeconds (100))); aodv.Set ("NetDiameter", UintegerValue (1000)); - aodv.Set ("PathDiscoveryTime", TimeValue (Seconds (100))); + aodv.Set ("PathDiscoveryTime", TimeValue (Seconds (1))); InternetStackHelper stack; stack.SetRoutingHelper (aodv); stack.Install (satellites); @@ -90,22 +92,17 @@ int main (int argc, char *argv[]) // we want to ping terminals UdpEchoServerHelper echoServer (9); - ApplicationContainer serverApps = echoServer.Install (stations); + ApplicationContainer serverApps = echoServer.Install (stations.Get (1)); // install a client on one of the terminals ApplicationContainer clientApps; Address remote = stations.Get (1)->GetObject ()->GetAddress (1, 0).GetLocal ();//utIp.GetAddress (1, 0); - std::cerr << "REMOTE: node=" <GetId ()<<"addr="<GetObject ()->GetAddress (1, 0).GetLocal ();//utIp.GetAddress (1, 0); - std::cerr << "LOCAL: node=" <GetId ()<<"addr="<