satellite-phy-rx.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  * Copyright (c) 2018 CNES
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Author: Jani Puttonen <jani.puttonen@magister.fi>
20  * Author: Mathias Ettinger <mettinger@toulouse.viveris.fr>
21  */
22 
23 #ifndef SATELLITE_PHY_RX_H
24 #define SATELLITE_PHY_RX_H
25 
27 #include "satellite-base-fading.h"
28 #include "satellite-frame-conf.h"
30 #include "satellite-net-device.h"
32 
33 #include <ns3/mobility-model.h>
34 #include <ns3/nstime.h>
35 #include <ns3/packet.h>
36 
37 namespace ns3
38 {
39 
40 class SatPhyRxCarrierConf;
41 class SatPhyRxCarrier;
42 class SatPhyRxCarrierPerSlot;
43 class SatPhyRxCarrierPerFrame;
44 class SatPhyRxCarrierPerWindow;
45 class SatPhyRxCarrierUplink;
46 
53 class SatPhyRx : public Object
54 {
55  public:
59  SatPhyRx();
60 
64  virtual ~SatPhyRx();
65 
69  static TypeId GetTypeId(void);
70 
74  virtual void DoDispose();
75 
76  void SetMobility(Ptr<MobilityModel> m);
77  Ptr<MobilityModel> GetMobility();
78 
79  /*
80  * Set the receive antenna gain pattern.
81  * \param agp antenna gain pattern
82  * \param mobility mobility model of satellite
83  */
84  void SetAntennaGainPattern(Ptr<SatAntennaGainPattern> agp, Ptr<SatMobilityModel> mobility);
85 
86  void SetDevice(Ptr<NetDevice> d);
87  Ptr<NetDevice> GetDevice();
88 
93  void SetMaxAntennaGain_Db(double gain_Db);
94 
102  double GetAntennaGain(Ptr<MobilityModel> mobility);
103 
108  void SetDefaultFadingValue(double fadingValue);
109 
116  double GetFadingValue(Address macAddress, SatEnums::ChannelType_t channelType);
117 
122  void SetFadingContainer(Ptr<SatBaseFading> fadingContainer);
123 
128  void SetAntennaLoss_Db(double loss_Db);
129 
135  double GetLosses();
136 
141  void SetSatId(uint32_t satId);
142 
147  uint32_t GetSatId() const;
148 
153  void SetBeamId(uint32_t beamId);
154 
159  uint32_t GetBeamId() const;
160 
165  void ConfigurePhyRxCarriers(Ptr<SatPhyRxCarrierConf> carrierConf,
166  Ptr<SatSuperframeConf> superFrameConf);
167 
172  virtual void StartRx(Ptr<SatSignalParameters> rxParams);
173 
179  typedef Callback<void, Ptr<SatSignalParameters>, bool> ReceiveCallback;
180 
189  typedef Callback<void, uint32_t, uint32_t, Address, Address, double, bool> CnoCallback;
190 
198  typedef Callback<void, uint32_t, uint32_t, uint32_t, uint8_t, double>
200 
206 
212 
218 
223  Mac48Address GetAddress() const;
224 
229  void SetNodeInfo(const Ptr<SatNodeInfo> nodeInfo);
230 
234  void BeginEndScheduling();
235 
240  double GetRxTemperatureK(Ptr<SatSignalParameters> rxParams);
241 
242  private:
243  Ptr<MobilityModel> m_mobility;
244  Ptr<NetDevice> m_device;
245 
246  uint32_t m_satId;
247  uint32_t m_beamId;
248  Mac48Address m_macAddress;
249 
250  /*
251  * Receive antenna gain pattern
252  */
253  Ptr<SatAntennaGainPattern> m_antennaGainPattern;
254 
255  /*
256  * Satellite mobility model
257  */
258  Ptr<SatMobilityModel> m_satMobility;
259 
264 
269 
270  // A SatPhyRxCarrier object for receiving packets from each carrier
271  std::vector<Ptr<SatPhyRxCarrier>> m_rxCarriers;
272 
276  Ptr<SatBaseFading> m_fadingContainer;
277 
282 };
283 
284 } // namespace ns3
285 
286 #endif /* SATELLITE_PHY_RX_H */
ChannelType_t
Types of channel.
The SatPhyRx models the physical layer receiver of satellite system.
void ConfigurePhyRxCarriers(Ptr< SatPhyRxCarrierConf > carrierConf, Ptr< SatSuperframeConf > superFrameConf)
uint32_t GetSatId() const
Get satellite id of this receiver.
Ptr< SatAntennaGainPattern > m_antennaGainPattern
virtual void DoDispose()
Dispose of this class instance.
SatPhyRx()
Default constructor.
void SetFadingContainer(Ptr< SatBaseFading > fadingContainer)
Set fading container.
void SetAntennaLoss_Db(double loss_Db)
Set the Antenna loss in Db.
void SetAntennaGainPattern(Ptr< SatAntennaGainPattern > agp, Ptr< SatMobilityModel > mobility)
void SetMaxAntennaGain_Db(double gain_Db)
Set the maximum Antenna gain in Db.
void SetDevice(Ptr< NetDevice > d)
Callback< void, uint32_t, uint32_t, Address, Address, double, bool > CnoCallback
virtual ~SatPhyRx()
Destructor for SatPhyRx.
double GetFadingValue(Address macAddress, SatEnums::ChannelType_t channelType)
Get fading value.
double GetRxTemperatureK(Ptr< SatSignalParameters > rxParams)
Method for querying the temperature of the chosen carrier.
void BeginEndScheduling()
Begin frame/window end scheduling for processes utilizing frame length as interval.
double m_maxAntennaGain
Configured maximum antenna gain in linear.
void SetSatId(uint32_t satId)
Set the satellite id for all the transmissions from this SatPhyTx.
void SetMobility(Ptr< MobilityModel > m)
Mac48Address m_macAddress
Mac48Address GetAddress() const
Get MAC address of this PHY/MAC.
void SetAverageNormalizedOfferedLoadCallback(SatPhyRx::AverageNormalizedOfferedLoadCallback cb)
Set average normalized offered load callback.
void SetCnoCallback(SatPhyRx::CnoCallback cb)
Set C/N0 receiver.
std::vector< Ptr< SatPhyRxCarrier > > m_rxCarriers
void SetDefaultFadingValue(double fadingValue)
Function for setting the default fading value.
double GetAntennaGain(Ptr< MobilityModel > mobility)
Get antenna gain based on position or in case that antenna pattern is not configured,...
Ptr< NetDevice > m_device
double m_defaultFadingValue
Default fading value.
Ptr< MobilityModel > m_mobility
Callback< void, Ptr< SatSignalParameters >, bool > ReceiveCallback
void SetReceiveCallback(SatPhyRx::ReceiveCallback cb)
Set the upper layer receive callback.
virtual void StartRx(Ptr< SatSignalParameters > rxParams)
Start packet reception from the SatChannel.
double GetLosses()
Get configures RX losses, currently only antenna loss used.
Ptr< MobilityModel > GetMobility()
void SetBeamId(uint32_t beamId)
Set the beam id for all the transmissions from this SatPhyTx.
Ptr< SatBaseFading > m_fadingContainer
Fading container for fading model.
void SetNodeInfo(const Ptr< SatNodeInfo > nodeInfo)
Set the node info class.
double m_antennaLoss
Configured antenna loss in linear.
Callback< void, uint32_t, uint32_t, uint32_t, uint8_t, double > AverageNormalizedOfferedLoadCallback
Ptr< SatMobilityModel > m_satMobility
uint32_t GetBeamId() const
Get beam id of this receiver.
Ptr< NetDevice > GetDevice()
static TypeId GetTypeId(void)
inherited from Object
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.