diff --git a/doc/leo.rst b/doc/leo.rst index 71a2754..9f9969b 100644 --- a/doc/leo.rst +++ b/doc/leo.rst @@ -136,11 +136,11 @@ planes,number of satellites per plane``. The duration is given in seconds. .. sourcode::bash - $ ./waf --run leo-circular-orbit \ - --orbitsFile=orbits.csv \ - --traceFile=mobility-trace.csv \ - --duration=10.0 - --precision=1.0 + $ ./waf --run "leo-orbit \ + --orbitFile=contrib/leo/data/orbits/starlink.csv \ + --duration=360.0 \ + --precision=1.0 \ + --traceFile=out.csv" leo-delay ######### @@ -151,18 +151,19 @@ given as pairs of longitude and latitude. .. sourcode::bash - $ ./waf --run leo-delay \ - --orbitsFile=orbits.csv \ - --groundFile=ground-stations.csv \ - --traceFile=delay-trace.csv \ + $ ./waf --run "leo-delay \ + --orbitFile=contrib/leo/data/orbits/starlink.csv \ + --traceFile=out.csv + --precision=1.0 \ + --duration=360.0 \ + --numGws=120 \ --source=54.4:77.1 \ --destination=-10.0:25.8 \ --islRate=1Gbps \ --constellation="StarlinkGateway" \ - --duration=10.0 \ - --maxPackets=360 \ --interval=1 \ - --packetSize=1024 + --ttlThresh=30 \ + --routeTimeout=0.25" leo-throughput ############## diff --git a/examples/leo-delay-tracing-example.cc b/examples/leo-delay-tracing-example.cc index 9b29b0b..bd624cc 100644 --- a/examples/leo-delay-tracing-example.cc +++ b/examples/leo-delay-tracing-example.cc @@ -32,18 +32,20 @@ int main (int argc, char *argv[]) std::string islRate; std::string constellation; uint64_t numGws; - Time interval; - Time duration; + double interval; + double duration; cmd.AddValue("orbitFile", "CSV file with orbit parameters", orbitFile); cmd.AddValue("traceFile", "CSV file to store mobility trace in", traceFile); cmd.AddValue("precision", "ns3::LeoCircularOrbitMobilityModel::Precision"); - cmd.AddValue("duration", "Duration of the simulation", duration); + cmd.AddValue("duration", "Duration of the simulation in seconds", duration); cmd.AddValue("numGws", "Number of gateways", numGws); cmd.AddValue("source", "Traffic source", source); cmd.AddValue("destination", "Traffic destination", destination); cmd.AddValue("islRate", "Throughput of the ISL link", islRate); cmd.AddValue("constellation", "LEO constellation link settings name", constellation); cmd.AddValue("interval", "Echo interval", interval); + cmd.AddValue("ttlThresh", "ns3::aodv::RoutingProtocol::TtlThreshold"); + cmd.AddValue("routeTimeout", "ns3::aodv::RoutingProtocol::ActiveRouteTimeout"); cmd.Parse (argc, argv); std::streambuf *coutbuf = std::cout.rdbuf(); @@ -78,10 +80,15 @@ int main (int argc, char *argv[]) utCh.SetConstellation (constellation); utNet = utCh.Install (satellites, stations); + //if (proto == "aodv") // Install internet stack on nodes AodvHelper aodv; // This disabled is far better for performance (huge network) aodv.Set ("EnableHello", BooleanValue (false)); + //aodv.Set ("TtlThreshold", UintegerValue (ttlThresh)); + aodv.Set ("RreqRateLimit", UintegerValue (1)); + aodv.Set ("RerrRateLimit", UintegerValue (1)); + //aodv.Set ("ActiveRouteTimeout", TimeValue (Seconds (routeTimeout))); InternetStackHelper stack; stack.SetRoutingHelper (aodv); @@ -103,7 +110,7 @@ int main (int argc, char *argv[]) ApplicationContainer clientApps; Address remote = server->GetObject<Ipv4> ()->GetAddress (1, 0).GetLocal (); UdpClientHelper echoClient (remote, 9); - echoClient.SetAttribute ("MaxPackets", UintegerValue (duration.GetDouble ()/interval.GetDouble ())); + echoClient.SetAttribute ("MaxPackets", UintegerValue (duration / interval)); echoClient.SetAttribute ("Interval", TimeValue (Seconds (interval))); echoClient.SetAttribute ("PacketSize", UintegerValue (1024)); clientApps.Add (echoClient.Install (client)); @@ -119,7 +126,7 @@ int main (int argc, char *argv[]) //serverApps.Start (Seconds (1)); //clientApps.Start (Seconds (1)); - Simulator::Stop (duration); + Simulator::Stop (Seconds (duration)); Simulator::Run (); Simulator::Destroy (); diff --git a/helper/leo-channel-helper.cc b/helper/leo-channel-helper.cc index 9364d5f..4ce023a 100644 --- a/helper/leo-channel-helper.cc +++ b/helper/leo-channel-helper.cc @@ -24,7 +24,9 @@ NS_LOG_COMPONENT_DEFINE ("LeoChannelHelper"); LeoChannelHelper::LeoChannelHelper () { m_gndQueueFactory.SetTypeId ("ns3::DropTailQueue<Packet>"); + // m_gndQueueFactory.Set ("MaxSize", QueueSizeValue (QueueSize ("10000p"))); m_satQueueFactory.SetTypeId ("ns3::DropTailQueue<Packet>"); + //m_satQueueFactory.Set ("MaxSize", QueueSizeValue (QueueSize ("10000p"))); m_gndDeviceFactory.SetTypeId ("ns3::LeoMockNetDevice"); m_gndDeviceFactory.Set ("DeviceType", EnumValue (LeoMockNetDevice::GND)); diff --git a/model/isl-propagation-loss-model.cc b/model/isl-propagation-loss-model.cc index 1f1111a..3b453d6 100644 --- a/model/isl-propagation-loss-model.cc +++ b/model/isl-propagation-loss-model.cc @@ -20,12 +20,6 @@ IslPropagationLossModel::GetTypeId (void) .SetParent<PropagationLossModel> () .SetGroupName ("Leo") .AddConstructor<IslPropagationLossModel> () - .AddAttribute ("MaxDistance", - "Cut-off distance for signal propagation", - DoubleValue (2000.0), - MakeDoubleAccessor (&IslPropagationLossModel::SetCutoffDistance, - &IslPropagationLossModel::GetCutoffDistance), - MakeDoubleChecker<double> ()) ; return tid; } @@ -71,7 +65,7 @@ IslPropagationLossModel::DoCalcRxPower (double txPowerDbm, Ptr<MobilityModel> a, Ptr<MobilityModel> b) const { - if (a->GetDistanceFrom (b) > m_cutoffDistance || !GetLos (a, b)) + if (!GetLos (a, b)) { NS_LOG_DEBUG ("DROP;"<<a->GetPosition ()<<";"<<b->GetPosition ()); return -1000.0; @@ -88,15 +82,4 @@ IslPropagationLossModel::DoAssignStreams (int64_t stream) return 0; } -void -IslPropagationLossModel::SetCutoffDistance (double d) -{ - m_cutoffDistance = d * 1000.0; -} - -double -IslPropagationLossModel::GetCutoffDistance () const -{ - return m_cutoffDistance / 1000.0; -} }; diff --git a/model/isl-propagation-loss-model.h b/model/isl-propagation-loss-model.h index 2bf0e19..bebd269 100644 --- a/model/isl-propagation-loss-model.h +++ b/model/isl-propagation-loss-model.h @@ -28,14 +28,6 @@ public: */ static bool GetLos (Ptr<MobilityModel> a, Ptr<MobilityModel> b); private: - /** - * Cutoff distance for signal - */ - double m_cutoffDistance; - - void SetCutoffDistance (double d); - double GetCutoffDistance () const; - /** * Returns the Rx Power taking into account only the particular * PropagationLossModel. diff --git a/model/leo-propagation-loss-model.cc b/model/leo-propagation-loss-model.cc index 86e9f2e..fe0461e 100644 --- a/model/leo-propagation-loss-model.cc +++ b/model/leo-propagation-loss-model.cc @@ -23,7 +23,7 @@ LeoPropagationLossModel::GetTypeId (void) .AddConstructor<LeoPropagationLossModel> () .AddAttribute ("MaxDistance", "Cut-off distance for signal propagation", - DoubleValue (4000.0), + DoubleValue (2000.0), MakeDoubleAccessor (&LeoPropagationLossModel::SetCutoffDistance, &LeoPropagationLossModel::GetCutoffDistance), MakeDoubleChecker<double> ()) @@ -80,7 +80,7 @@ LeoPropagationLossModel::GetAngle (Ptr<MobilityModel> a, Ptr<MobilityModel> b) NS_LOG_DEBUG ("LEO space -> ground"); } - double prod = (pa.x*-pb.x) + (pa.y*-pb.y) + (pa.z*-pb.z); + double prod = abs ((pa.x*-pb.x) + (pa.y*-pb.y) + (pa.z*-pb.z)); double norm = pa.GetLength () * pb.GetLength (); return acos (prod / norm); @@ -119,7 +119,7 @@ LeoPropagationLossModel::DoCalcRxPower (double txPowerDbm, if (distance > m_cutoffDistance) { - NS_LOG_DEBUG ("LEO DROP distance: a=" << a->GetPosition () << " b=" << b->GetPosition () << " m_cutOff="<<m_cutoffDistance<<" dist=" << distance); + NS_LOG_DEBUG ("LEO DROP distance: a=" << a->GetPosition () << " b=" << b->GetPosition ()<<" dist=" << distance); return -1000.0; } @@ -127,7 +127,7 @@ LeoPropagationLossModel::DoCalcRxPower (double txPowerDbm, double angle = GetAngle (a, b); if (angle > m_elevationAngle) { - NS_LOG_DEBUG ("LEO DROP angle: a=" << a->GetPosition () << " b=" << b->GetPosition () << " m_cutOff="<<m_cutoffDistance<<" m_angle="<<m_elevationAngle<<" dist=" << distance << "angle=" << angle); + NS_LOG_DEBUG ("LEO DROP angle: a=" << a->GetPosition () << " b=" << b->GetPosition () << " dist=" << distance << "angle=" << angle); return -1000.0; }