24 #include "ns3/satellite-point-to-point-isl-channel.h"
26 #include "ns3/core-module.h"
27 #include "ns3/satellite-const-variables.h"
29 NS_LOG_COMPONENT_DEFINE(
"PointToPointIslChannel");
34 NS_OBJECT_ENSURE_REGISTERED(PointToPointIslChannel);
40 TypeId(
"ns3::PointToPointIslChannel")
42 .AddConstructor<PointToPointIslChannel>()
43 .AddAttribute(
"PropagationSpeed",
44 "Propagation speed through the channel",
47 MakeDoubleChecker<double>());
55 NS_LOG_FUNCTION(
this);
61 NS_LOG_FUNCTION(
this << device);
64 NS_ASSERT(device !=
nullptr);
82 Ptr<PointToPointIslNetDevice> src,
86 NS_LOG_FUNCTION(
this << p << src);
87 NS_LOG_LOGIC(
"UID is " << p->GetUid() <<
")");
92 Ptr<MobilityModel> senderMobility = src->GetNode()->GetObject<MobilityModel>();
93 Ptr<MobilityModel> receiverMobility = dst->GetObject<MobilityModel>();
94 Time delay = this->
GetDelay(senderMobility, receiverMobility);
98 Simulator::ScheduleWithContext(
m_link[wire].m_dst->GetNode()->GetId(),
110 NS_LOG_FUNCTION(
this);
115 Ptr<PointToPointIslNetDevice>
118 NS_LOG_FUNCTION(
this);
127 NS_LOG_FUNCTION(
this);
135 NS_LOG_FUNCTION(
this << a << b);
137 double distance = a->GetDistanceFrom(b);
139 return Seconds(seconds);
142 Ptr<PointToPointIslNetDevice>
145 NS_LOG_FUNCTION(
this << i);
150 Ptr<PointToPointIslNetDevice>
153 NS_LOG_FUNCTION(
this << i);
161 NS_LOG_FUNCTION(
this);
Ptr< PointToPointIslNetDevice > m_dst
Second NetDevice.
WireState m_state
State of the link.
Ptr< PointToPointIslNetDevice > m_src
First NetDevice.
static TypeId GetTypeId(void)
Get the TypeId.
Link m_link[N_DEVICES]
Link model.
@ IDLE
Idle state (no transmission from NetDevice)
@ INITIALIZING
Initializing state.
Time GetDelay(Ptr< MobilityModel > senderMobility, Ptr< MobilityModel > receiverMobility) const
Get the delay between two nodes on this channel.
bool IsInitialized(void) const
Check to make sure the link is initialized.
double m_propagationSpeed
propagation speed on the channel
PointToPointIslChannel()
Create a PointToPointIslChannel.
virtual bool TransmitStart(Ptr< const Packet > p, Ptr< PointToPointIslNetDevice > src, Ptr< Node > dst, Time txTime)
Transmit a packet over this channel.
virtual std::size_t GetNDevices(void) const
Get number of devices on this channel.
Ptr< PointToPointIslNetDevice > GetDestination(uint32_t i) const
Get the destination net-device.
Ptr< PointToPointIslNetDevice > GetSource(uint32_t i) const
Get the source net-device.
void Attach(Ptr< PointToPointIslNetDevice > device)
Attach a given netdevice to this channel.
std::size_t m_nDevices
Devices of this channel.
static const std::size_t N_DEVICES
Each point to point link has exactly two net devices.
Ptr< PointToPointIslNetDevice > GetPointToPointIslDevice(std::size_t i) const
Get PointToPointIslNetDevice corresponding to index i on this channel.
virtual Ptr< NetDevice > GetDevice(std::size_t i) const
Get NetDevice corresponding to index i on this channel.
void Receive(Ptr< Packet > p)
Receive a packet from a connected PointToPointIslChannel.
constexpr double SPEED_OF_LIGHT
Constant definition for the speed of light in m/s.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.