Add missing propagation delay

This commit is contained in:
Tim Schubert 2020-08-19 23:31:11 +02:00
parent fb9950c8cc
commit 9599470b0f
3 changed files with 13 additions and 8 deletions

View file

@ -45,8 +45,12 @@ public:
int main (int argc, char *argv[]) int main (int argc, char *argv[])
{ {
std::vector<Orbit> orbits = { std::vector<Orbit> orbits = {
Orbit (1150, 53.0, 32, 50), //Orbit (1000.0, 99.5, 6, 12),
Orbit (1110, 53.8, 32, 50), //Orbit (1248.0, 37.4, 5, 9),
Orbit (1150, 53.0, 32, 50),
Orbit (1110, 53.8, 32, 50),
// Orbit (1150, 53.0, 32, 50),
// Orbit (1110, 53.8, 32, 50),
}; };
NodeContainer satellites; NodeContainer satellites;
for (Orbit orb: orbits) for (Orbit orb: orbits)
@ -78,12 +82,12 @@ int main (int argc, char *argv[])
islNet = islCh.Install (satellites); islNet = islCh.Install (satellites);
LeoChannelHelper utCh; LeoChannelHelper utCh;
utCh.SetConstellation ("TelesatUser"); utCh.SetConstellation ("StarlinkUser");
utNet = utCh.Install (satellites, stations); utNet = utCh.Install (satellites, stations);
// Install internet stack on nodes // Install internet stack on nodes
AodvHelper aodv; AodvHelper aodv;
// This is far better for performance (huge network) // This disabled is far better for performance (huge network)
aodv.Set ("EnableHello", BooleanValue (false)); aodv.Set ("EnableHello", BooleanValue (false));
//aodv.Set ("HelloInterval", TimeValue (Seconds (10))); //aodv.Set ("HelloInterval", TimeValue (Seconds (10)));
//aodv.Set ("TtlStart", UintegerValue (2)); //aodv.Set ("TtlStart", UintegerValue (2));
@ -121,7 +125,7 @@ int main (int argc, char *argv[])
ApplicationContainer clientApps; ApplicationContainer clientApps;
Address remote = server->GetObject<Ipv4> ()->GetAddress (1, 0).GetLocal (); Address remote = server->GetObject<Ipv4> ()->GetAddress (1, 0).GetLocal ();
UdpClientHelper echoClient (remote, 9); UdpClientHelper echoClient (remote, 9);
echoClient.SetAttribute ("MaxPackets", UintegerValue (60)); echoClient.SetAttribute ("MaxPackets", UintegerValue (6000));
echoClient.SetAttribute ("Interval", TimeValue (Seconds (1))); echoClient.SetAttribute ("Interval", TimeValue (Seconds (1)));
echoClient.SetAttribute ("PacketSize", UintegerValue (1024)); echoClient.SetAttribute ("PacketSize", UintegerValue (1024));
clientApps.Add (echoClient.Install (client)); clientApps.Add (echoClient.Install (client));
@ -136,8 +140,6 @@ int main (int argc, char *argv[])
serverApps.Start (Seconds (1)); serverApps.Start (Seconds (1));
clientApps.Start (Seconds (1)); clientApps.Start (Seconds (1));
serverApps.Stop (Minutes (1));
clientApps.Stop (Minutes (1));
Simulator::Stop (Minutes (10)); Simulator::Stop (Minutes (10));
Simulator::Run (); Simulator::Run ();

View file

@ -33,6 +33,7 @@ LeoChannelHelper::LeoChannelHelper ()
m_satDeviceFactory.Set ("DeviceType", EnumValue (LeoMockNetDevice::SAT)); m_satDeviceFactory.Set ("DeviceType", EnumValue (LeoMockNetDevice::SAT));
m_channelFactory.SetTypeId ("ns3::LeoMockChannel"); m_channelFactory.SetTypeId ("ns3::LeoMockChannel");
m_channelFactory.Set ("PropagationDelay", StringValue ("ns3::ConstantSpeedPropagationDelayModel"));
m_propagationLossFactory.SetTypeId ("ns3::LeoPropagationLossModel"); m_propagationLossFactory.SetTypeId ("ns3::LeoPropagationLossModel");

View file

@ -22,7 +22,7 @@ IslPropagationLossModel::GetTypeId (void)
.AddConstructor<IslPropagationLossModel> () .AddConstructor<IslPropagationLossModel> ()
.AddAttribute ("MaxDistance", .AddAttribute ("MaxDistance",
"Cut-off distance for signal propagation", "Cut-off distance for signal propagation",
DoubleValue (1000.0), DoubleValue (2000.0),
MakeDoubleAccessor (&IslPropagationLossModel::SetCutoffDistance, MakeDoubleAccessor (&IslPropagationLossModel::SetCutoffDistance,
&IslPropagationLossModel::GetCutoffDistance), &IslPropagationLossModel::GetCutoffDistance),
MakeDoubleChecker<double> ()) MakeDoubleChecker<double> ())
@ -41,6 +41,8 @@ IslPropagationLossModel::~IslPropagationLossModel ()
bool bool
IslPropagationLossModel::GetLos (Ptr<MobilityModel> moda, Ptr<MobilityModel> modb) IslPropagationLossModel::GetLos (Ptr<MobilityModel> moda, Ptr<MobilityModel> modb)
{ {
// TODO get max distance with line-sphere intersection
// origin of LOS // origin of LOS
Vector3D oc = moda->GetPosition (); Vector3D oc = moda->GetPosition ();
Vector3D bp = modb->GetPosition (); Vector3D bp = modb->GetPosition ();