Loading...
Searching...
No Matches
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
28
29#include "ns3/channel.h"
30#include "ns3/data-rate.h"
31#include "ns3/mobility-model.h"
32#include "ns3/node.h"
33
34#include <cstddef>
35#include <stdint.h>
36
37namespace ns3
38{
39
41class Packet;
42
60class PointToPointIslChannel : public Channel
61{
62 public:
68 static TypeId GetTypeId(void);
69
75
81 void Attach(Ptr<PointToPointIslNetDevice> device);
82
92 virtual bool TransmitStart(Ptr<const Packet> p,
93 Ptr<PointToPointIslNetDevice> src,
94 Ptr<Node> dst,
95 Time txTime);
96
102 virtual std::size_t GetNDevices(void) const;
103
111 Ptr<PointToPointIslNetDevice> GetPointToPointIslDevice(std::size_t i) const;
112
120 virtual Ptr<NetDevice> GetDevice(std::size_t i) const;
121
122 protected:
131 Time GetDelay(Ptr<MobilityModel> senderMobility, Ptr<MobilityModel> receiverMobility) const;
132
138 bool IsInitialized(void) const;
139
148 Ptr<PointToPointIslNetDevice> GetSource(uint32_t i) const;
149
157 Ptr<PointToPointIslNetDevice> GetDestination(uint32_t i) const;
158
159 private:
161 static const std::size_t N_DEVICES = 2;
162
164 std::size_t m_nDevices;
165
180
184 class Link
185 {
186 public:
192 m_src(0),
193 m_dst(0)
194 {
195 }
196
198 Ptr<PointToPointIslNetDevice> m_src;
199 Ptr<PointToPointIslNetDevice> m_dst;
200 };
201
203};
204
205} // namespace ns3
206
207#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.