Loading...
Searching...
No Matches
satellite-channel.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2013 Magister Solutions Ltd.
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 * Author: Jani Puttonen <jani.puttonen@magister.fi>
19 */
20
21#ifndef SATELLITE_CHANNEL_H
22#define SATELLITE_CHANNEL_H
23
24#include "satellite-enums.h"
28#include "satellite-phy-rx.h"
30#include "satellite-typedefs.h"
31
32#include "ns3/channel.h"
33#include "ns3/nstime.h"
34#include "ns3/object.h"
35#include "ns3/propagation-delay-model.h"
36#include "ns3/traced-callback.h"
37
38#include <cstddef>
39#include <stdint.h>
40#include <vector>
41
42namespace ns3
43{
44
66
67class SatChannel : public Channel
68{
69 public:
73 SatChannel();
74
83 virtual void NotifyConstructionCompleted() override;
84
88 virtual ~SatChannel();
89
101
106 static TypeId GetTypeId(void);
107
111 typedef std::vector<Ptr<SatPhyRx>> PhyRxContainer;
112
120 typedef Callback<double, SatEnums::ChannelType_t, uint32_t, uint32_t> CarrierFreqConverter;
121
126 virtual void SetPropagationDelayModel(Ptr<PropagationDelayModel> delay);
127
132 virtual Ptr<PropagationDelayModel> GetPropagationDelayModel();
133
138 virtual void SetChannelType(SatEnums::ChannelType_t chType);
139
144 virtual void SetFrequencyId(uint32_t freqId);
145
151 virtual void SetFrequencyConverter(CarrierFreqConverter converter);
152
159
165
170 virtual void SetFreeSpaceLoss(Ptr<SatFreeSpaceLoss> delay);
171
176 virtual Ptr<SatFreeSpaceLoss> GetFreeSpaceLoss() const;
177
182 virtual void StartTx(Ptr<SatSignalParameters> params);
183
189 virtual void AddRx(Ptr<SatPhyRx> phyRx);
190
196 virtual void RemoveRx(Ptr<SatPhyRx> phyRx);
197
201 virtual std::size_t GetNDevices(void) const;
202
208 virtual Ptr<NetDevice> GetDevice(std::size_t i) const;
209
210 private:
217
222
227
232
237
241 uint32_t m_freqId;
242
246 Ptr<PropagationDelayModel> m_propagationDelay;
247
251 Ptr<SatFreeSpaceLoss> m_freeSpaceLoss;
252
257
262
267
272
276 Ptr<SatFadingExternalInputTraceContainer> m_satFadingExternalInputTraceContainer;
277
281 virtual void DoDispose();
282
288 void ScheduleRx(Ptr<SatSignalParameters> txParams, Ptr<SatPhyRx> phyRx);
289
296 void StartRx(Ptr<SatSignalParameters> rxParams, Ptr<SatPhyRx> phyRx);
297
303 void DoRxPowerOutputTrace(Ptr<SatSignalParameters> rxParams, Ptr<SatPhyRx> phyRx);
304
310 void DoRxPowerInputTrace(Ptr<SatSignalParameters> rxParams, Ptr<SatPhyRx> phyRx);
311
317 void DoRxCnoInputTrace(Ptr<SatSignalParameters> rxParams, Ptr<SatPhyRx> phyRx);
318
325 void DoFadingOutputTrace(Ptr<SatSignalParameters> rxParams,
326 Ptr<SatPhyRx> phyRx,
327 double fadingValue);
328
334 void DoRxPowerCalculation(Ptr<SatSignalParameters> rxParams, Ptr<SatPhyRx> phyRx);
335
342 double GetExternalFadingTrace(Ptr<SatSignalParameters> rxParams, Ptr<SatPhyRx> phyRx);
343
349 Mac48Address GetSourceAddress(Ptr<SatSignalParameters> rxParams);
350};
351
352} // namespace ns3
353
354#endif /* SATELLITE_CHANNEL_H */
Ptr< SatFadingExternalInputTraceContainer > m_satFadingExternalInputTraceContainer
External fading input tracing container.
void DoRxPowerOutputTrace(Ptr< SatSignalParameters > rxParams, Ptr< SatPhyRx > phyRx)
Function for Rx power output trace.
void DoRxCnoInputTrace(Ptr< SatSignalParameters > rxParams, Ptr< SatPhyRx > phyRx)
Function for Rx power input trace from C/N0 values.
SatChannelFwdMode_e m_fwdMode
Forwarding mode of the SatChannel: SINGLE_RX = only the proper receiver of the packet shall receive t...
virtual Ptr< PropagationDelayModel > GetPropagationDelayModel()
Get the propagation delay model to be used in the SatChannel.
virtual void DoDispose()
Dispose SatChannel.
Callback< double, SatEnums::ChannelType_t, uint32_t, uint32_t > CarrierFreqConverter
Ptr< SatFreeSpaceLoss > m_freeSpaceLoss
Free space loss model to be used with this channel.
bool m_enableFadingOutputTrace
Defines whether fading output tracing is in use or not.
SatChannel()
Default constructor.
double GetExternalFadingTrace(Ptr< SatSignalParameters > rxParams, Ptr< SatPhyRx > phyRx)
Function for getting the external source fading value.
void DoRxPowerCalculation(Ptr< SatSignalParameters > rxParams, Ptr< SatPhyRx > phyRx)
Function for calculating the Rx power.
virtual void NotifyConstructionCompleted() override
Notifier called once the ObjectBase is fully constructed.
static TypeId GetTypeId(void)
Get the type ID.
virtual void SetFrequencyId(uint32_t freqId)
Set the frequency id of the channel.
void DoRxPowerInputTrace(Ptr< SatSignalParameters > rxParams, Ptr< SatPhyRx > phyRx)
Function for Rx power input trace.
SatTypedefs::CarrierBandwidthConverter_t m_carrierBandwidthConverter
Bandwidth converter callback.
virtual void SetChannelType(SatEnums::ChannelType_t chType)
Set the type of the channel.
bool m_enableRxPowerOutputTrace
Defines whether Rx power output tracing is in use or not.
std::vector< Ptr< SatPhyRx > > PhyRxContainer
Define type PhyRxContainer.
uint32_t m_freqId
Frequency id of the channel.
virtual void SetPropagationDelayModel(Ptr< PropagationDelayModel > delay)
Set the propagation delay model to be used in the SatChannel.
virtual void RemoveRx(Ptr< SatPhyRx > phyRx)
This method is used to remove a SatPhyRx instance from a SatChannel instance, e.g.
Mac48Address GetSourceAddress(Ptr< SatSignalParameters > rxParams)
Function for getting the source MAC address from Rx parameters.
void DoFadingOutputTrace(Ptr< SatSignalParameters > rxParams, Ptr< SatPhyRx > phyRx, double fadingValue)
Function for fading output trace.
virtual Ptr< NetDevice > GetDevice(std::size_t i) const
Get a device for a certain receiver index.
virtual void SetBandwidthConverter(SatTypedefs::CarrierBandwidthConverter_t converter)
Set the bandwidth converter callback.
virtual SatEnums::ChannelType_t GetChannelType()
Get the type of the channel.
PhyRxContainer m_phyRxContainer
Container of SatPhyRx instances attached to the channel.
void ScheduleRx(Ptr< SatSignalParameters > txParams, Ptr< SatPhyRx > phyRx)
Used internally to schedule the StartRx method call after the propagation delay.
void StartRx(Ptr< SatSignalParameters > rxParams, Ptr< SatPhyRx > phyRx)
Used internally to start the packet reception of at the phyRx.
virtual void StartTx(Ptr< SatSignalParameters > params)
Used by attached SatPhyTx instances to transmit signals to the channel.
virtual ~SatChannel()
Destructor for SatChannel.
virtual void SetFreeSpaceLoss(Ptr< SatFreeSpaceLoss > delay)
Set the propagation delay model to be used in the SatChannel.
CarrierFreqConverter m_carrierFreqConverter
Frequency converter callback.
SatEnums::ChannelType_t m_channelType
Type of the channel.
virtual void AddRx(Ptr< SatPhyRx > phyRx)
This method is used to attach the receiver entity SatPhyRx instance to a SatChannel instance,...
Ptr< PropagationDelayModel > m_propagationDelay
Propagation delay model to be used with this channel.
virtual void SetFrequencyConverter(CarrierFreqConverter converter)
Set the frequency converter callback.
bool m_enableExternalFadingInputTrace
Defines whether external fading input tracing is in use or not.
virtual std::size_t GetNDevices(void) const
virtual Ptr< SatFreeSpaceLoss > GetFreeSpaceLoss() const
Get the propagation delay model used in the SatChannel.
SatEnums::RxPowerCalculationMode_t m_rxPowerCalculationMode
Defines the mode used for Rx power calculation.
SatChannelFwdMode_e
ONLY_DEST_NODE = only the receivers to which this transmission is intended to shall receive the packe...
ChannelType_t
Types of channel.
RxPowerCalculationMode_t
Modes of Rx power calculation.
Callback< double, SatEnums::ChannelType_t, uint32_t, SatEnums::CarrierBandwidthType_t > CarrierBandwidthConverter_t
Callback for carrier bandwidths.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.