Use speed of light in air

This commit is contained in:
Tim Schubert 2020-08-28 21:29:57 +02:00
parent b0bd80c8fe
commit 37631d0758
6 changed files with 15 additions and 4 deletions

View file

@ -143,7 +143,6 @@ int main (int argc, char *argv[])
//aodv.Set ("RreqRetries", UintegerValue (1000));
//aodv.Set ("RerrRateLimit", UintegerValue (1000));
//aodv.Set ("RreqRateLimit", UintegerValue (10));
aodv.Set ("TtlIncrement", UintegerValue (5));
aodv.Set ("TtlThreshold", UintegerValue (25));
aodv.Set ("NetDiameter", UintegerValue (50));
stack.SetRoutingHelper (aodv);

View file

@ -39,7 +39,8 @@ LeoChannelHelper::LeoChannelHelper ()
m_channelFactory.Set ("PropagationDelay", StringValue ("ns3::ConstantSpeedPropagationDelayModel"));
m_propagationLossFactory.SetTypeId ("ns3::LeoPropagationLossModel");
m_propagationDelayFactory.SetTypeId ("ns3::ConstantSpeedPropagationDelayModel");
m_propagationDelayFactory.Set ("Speed", DoubleValue (LEO_SPEED_OF_LIGHT_IN_AIR));
}
LeoChannelHelper::LeoChannelHelper (std::string constellation) :
@ -338,6 +339,7 @@ LeoChannelHelper::Install (std::vector<Ptr<Node> > &satellites, std::vector<Ptr<
Ptr<LeoMockChannel> channel = m_channelFactory.Create<LeoMockChannel> ();
channel->SetPropagationLoss (m_propagationLossFactory.Create<LeoPropagationLossModel> ());
channel->SetPropagationDelay (m_propagationLossFactory.Create<ConstantSpeedPropagationDelayModel> ());
NetDeviceContainer container;

View file

@ -62,6 +62,7 @@ private:
ObjectFactory m_channelFactory;
ObjectFactory m_propagationLossFactory;
ObjectFactory m_propagationDelayFactory;
void SetQueue (ObjectFactory &factory,
std::string type,

View file

@ -7,6 +7,7 @@
#include <ns3/propagation-loss-model.h>
#define LEO_PROP_EARTH_RAD 6.37101e6
#define LEO_SPEED_OF_LIGHT_IN_AIR 299702458
namespace ns3 {

View file

@ -191,4 +191,10 @@ MockChannel::Deliver (
return true;
}
void
MockChannel::SetPropagationDelay (Ptr<PropagationDelayModel> delay)
{
m_propagationDelay = delay;
}
} // namespace ns3

View file

@ -72,9 +72,12 @@ public:
std::size_t GetNDevices (void) const;
virtual bool TransmitStart (Ptr<const Packet> p, uint32_t devId, Address dst, Time txTime) = 0;
Ptr<PropagationLossModel> GetPropagationLoss () const;
Ptr<PropagationLossModel> GetPropagationLoss (void) const;
void SetPropagationLoss (Ptr<PropagationLossModel> model);
Ptr<PropagationDelayModel> GetPropagationDelay (void) const;
void SetPropagationDelay (Ptr<PropagationDelayModel> delay);
protected:
TracedCallback<Ptr<const Packet>, // Packet being transmitted
Ptr<NetDevice>, // Transmitting NetDevice
@ -89,7 +92,6 @@ protected:
*/
Time GetPropagationDelay (Ptr<MobilityModel> first, Ptr<MobilityModel> second, Time txTime) const;
Ptr<PropagationDelayModel> GetPropagationDelay () const;
Ptr<MockNetDevice> GetDevice (Address &addr) const;
bool Deliver ( Ptr<const Packet> p, Ptr<MockNetDevice> src, Ptr<MockNetDevice> dst, Time txTime);