satellite-point-to-point-isl-channel.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007 University of Washington
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * (Based on point-to-point channel)
19  * Author: Andre Aguas March 2020
20  * Adapted to SNS-3 by: Bastien Tauran <bastien.tauran@viveris.fr>
21  *
22  */
23 
24 #ifndef SATELLITE_POINT_TO_POINT_ISL_CHANNEL_H
25 #define SATELLITE_POINT_TO_POINT_ISL_CHANNEL_H
26 
27 #include "ns3/channel.h"
28 #include "ns3/data-rate.h"
29 #include "ns3/mobility-model.h"
30 #include "ns3/node.h"
31 #include "ns3/satellite-point-to-point-isl-net-device.h"
32 
33 namespace ns3
34 {
35 
36 class PointToPointIslNetDevice;
37 class Packet;
38 
56 class PointToPointIslChannel : public Channel
57 {
58  public:
64  static TypeId GetTypeId(void);
65 
71 
77  void Attach(Ptr<PointToPointIslNetDevice> device);
78 
88  virtual bool TransmitStart(Ptr<const Packet> p,
89  Ptr<PointToPointIslNetDevice> src,
90  Ptr<Node> dst,
91  Time txTime);
92 
98  virtual std::size_t GetNDevices(void) const;
99 
107  Ptr<PointToPointIslNetDevice> GetPointToPointIslDevice(std::size_t i) const;
108 
116  virtual Ptr<NetDevice> GetDevice(std::size_t i) const;
117 
118  protected:
127  Time GetDelay(Ptr<MobilityModel> senderMobility, Ptr<MobilityModel> receiverMobility) const;
128 
134  bool IsInitialized(void) const;
135 
144  Ptr<PointToPointIslNetDevice> GetSource(uint32_t i) const;
145 
153  Ptr<PointToPointIslNetDevice> GetDestination(uint32_t i) const;
154 
155  private:
157  static const std::size_t N_DEVICES = 2;
158 
160  std::size_t m_nDevices;
161 
166  {
175  };
176 
180  class Link
181  {
182  public:
188  m_src(0),
189  m_dst(0)
190  {
191  }
192 
194  Ptr<PointToPointIslNetDevice> m_src;
195  Ptr<PointToPointIslNetDevice> m_dst;
196  };
197 
199 };
200 
201 } // namespace ns3
202 
203 #endif /* SATELLITE_POINT_TO_POINT_ISL_CHANNEL_H */
static TypeId GetTypeId(void)
Get the TypeId.
@ IDLE
Idle state (no transmission from NetDevice)
@ TRANSMITTING
Transmitting state (data being transmitted from NetDevice.
@ PROPAGATING
Propagating state (data is being propagated in the channel.
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.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.