28 #include "ns3/core-module.h"
32 NS_LOG_COMPONENT_DEFINE(
"PointToPointIslChannel");
37 NS_OBJECT_ENSURE_REGISTERED(PointToPointIslChannel);
43 TypeId(
"ns3::PointToPointIslChannel")
45 .AddConstructor<PointToPointIslChannel>()
46 .AddAttribute(
"PropagationSpeed",
47 "Propagation speed through the channel",
50 MakeDoubleChecker<double>());
58 NS_LOG_FUNCTION(
this);
64 NS_LOG_FUNCTION(
this << device);
67 NS_ASSERT(device !=
nullptr);
85 Ptr<PointToPointIslNetDevice> src,
89 NS_LOG_FUNCTION(
this << p << src);
90 NS_LOG_LOGIC(
"UID is " << p->GetUid() <<
")");
95 Ptr<MobilityModel> senderMobility = src->GetNode()->GetObject<MobilityModel>();
96 Ptr<MobilityModel> receiverMobility = dst->GetObject<MobilityModel>();
97 Time delay = this->
GetDelay(senderMobility, receiverMobility);
101 Simulator::ScheduleWithContext(
m_link[wire].m_dst->GetNode()->GetId(),
113 NS_LOG_FUNCTION(
this);
118 Ptr<PointToPointIslNetDevice>
121 NS_LOG_FUNCTION(
this);
130 NS_LOG_FUNCTION(
this);
138 NS_LOG_FUNCTION(
this << a << b);
141 DynamicCast<SatMobilityModel>(a)->GetDistanceFrom(DynamicCast<SatMobilityModel>(b));
143 return Seconds(seconds);
146 Ptr<PointToPointIslNetDevice>
149 NS_LOG_FUNCTION(
this << i);
154 Ptr<PointToPointIslNetDevice>
157 NS_LOG_FUNCTION(
this << i);
165 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.