satellite-geo-user-phy.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: Sami Rantanen <sami.rantanen@magister.fi>
19  * Bastien Tauran <bastien.tauran@viveris.fr>
20  */
21 
22 #ifndef SATELLITE_GEO_USER_PHY_H
23 #define SATELLITE_GEO_USER_PHY_H
24 
25 #include "satellite-frame-conf.h"
26 #include "satellite-phy.h"
28 
29 #include <ns3/address.h>
30 #include <ns3/nstime.h>
31 #include <ns3/object.h>
32 #include <ns3/packet.h>
33 #include <ns3/ptr.h>
34 
35 #include <queue>
36 #include <tuple>
37 
38 namespace ns3
39 {
40 
41 class SatPhyRxCarrier;
42 class SatPhyRxCarrierUplink;
43 class SatPhyRxCarrierPerSlot;
44 class SatPhyRxCarrierPerFrame;
45 class SatPhyRxCarrierPerWindow;
46 
53 class SatGeoUserPhy : public SatPhy
54 {
55  public:
59  SatGeoUserPhy(void);
60 
62  Ptr<SatLinkResults> linkResults,
63  SatPhyRxCarrierConf::RxCarrierCreateParams_s parameters,
64  Ptr<SatSuperframeConf> superFrameConf,
65  SatEnums::RegenerationMode_t forwardLinkRegenerationMode,
66  SatEnums::RegenerationMode_t returnLinkRegenerationMode);
67 
71  virtual ~SatGeoUserPhy();
72 
76  static TypeId GetTypeId(void);
77  TypeId GetInstanceTypeId(void) const;
78  virtual void DoInitialize(void);
79 
83  virtual void DoDispose(void);
84 
89  virtual void SendPduWithParams(Ptr<SatSignalParameters> rxParams);
90 
100  virtual void Receive(Ptr<SatSignalParameters> rxParams, bool phyError);
101 
107  virtual double GetAdditionalInterference();
108 
114  typedef void (*QueueSizeCallback)(uint32_t size, const Address& from);
115 
119  typedef Callback<bool, Ptr<SatControlMessage>, const Address&, Ptr<SatSignalParameters>>
121 
126 
131 
132  protected:
137  virtual void RxTraces(SatPhy::PacketContainer_t packets);
138 
144 
150 
154  TracedCallback<uint32_t, const Address&> m_queueSizeBytesTrace;
155 
159  TracedCallback<uint32_t, const Address&> m_queueSizePacketsTrace;
160 
161  private:
165  void SendFromQueue();
166 
170  void EndTx();
171 
178 
183 
188 
193 
198 
203 
208 
213  std::queue<std::tuple<Ptr<SatSignalParameters>, uint32_t, uint32_t>> m_queue;
214 
219 
224 
228  uint32_t m_queueSizeMax;
229 
234 };
235 
236 } // namespace ns3
237 
238 #endif /* SATELLITE_GEO_USER_PHY_H */
SatLinkDir_t
Link direction used for packet tracing.
RegenerationMode_t
The regeneration mode used in satellites.
The SatGeoUserPhy models the user link physical layer of the satellite node.
uint32_t m_queueSizeMax
Maximum size of FIFO m_queue in bytes.
uint32_t m_queueSizeBytes
Size of FIFO queue in bytes.
virtual void SendPduWithParams(Ptr< SatSignalParameters > rxParams)
Send Pdu to the PHY tx module (for GEO satellite switch packet forwarding)
Address GetE2EDestinationAddress(SatPhy::PacketContainer_t packets)
Get destination address of packets.
void EndTx()
Notify a packet has finished being sent.
std::queue< std::tuple< Ptr< SatSignalParameters >, uint32_t, uint32_t > > m_queue
Simple FIFO queue to avoid collisions on TX in case of REGENERATION_PHY.
virtual double GetAdditionalInterference()
Get additional interference, used to compute final SINR at RX.
virtual void DoDispose(void)
Dispose of this class instance.
double m_aciInterferenceCOverIDb
Configured Adjacent Channel Interference (ACI) in dB.
TypeId GetInstanceTypeId(void) const
void(* QueueSizeCallback)(uint32_t size, const Address &from)
Callback signature for QueueSizeBytes and QueueSizePackets trace source.
uint32_t m_queueSizePackets
Size of FIFO queue in packets.
void SetSendControlMsgToFeederCallback(SendControlMsgToFeederCallback cb)
Set SendControlMsgToFeederCallback.
virtual SatEnums::SatLinkDir_t GetSatLinkTxDir()
Get the link TX direction.
bool m_isSending
Indicates if a packet is already being sent.
Callback< bool, Ptr< SatControlMessage >, const Address &, Ptr< SatSignalParameters > > SendControlMsgToFeederCallback
virtual void Receive(Ptr< SatSignalParameters > rxParams, bool phyError)
Receives packets from lower layer.
TracedCallback< uint32_t, const Address & > m_queueSizeBytesTrace
Traced callback to monitor RTN feeder queue size in bytes.
virtual SatEnums::SatLinkDir_t GetSatLinkRxDir()
Get the link RX direction.
double m_otherSysInterferenceCOverIDb
Configured other system interference in dB.
TracedCallback< uint32_t, const Address & > m_queueSizePacketsTrace
Traced callback to monitor RTN feeder queue size in packets.
double m_aciInterferenceCOverI
Adjacent Channel Interference (ACI) in linear.
double m_otherSysInterferenceCOverI
Other system interference in linear.
static TypeId GetTypeId(void)
inherited from Object
virtual void RxTraces(SatPhy::PacketContainer_t packets)
Invoke the Rx trace source for each received packet.
SatGeoUserPhy(void)
Default constructor.
virtual ~SatGeoUserPhy()
Destructor for SatGeoUserPhy.
SatEnums::RegenerationMode_t m_forwardLinkRegenerationMode
Regeneration mode on forward link.
SatEnums::RegenerationMode_t m_returnLinkRegenerationMode
Regeneration mode on return link.
virtual void DoInitialize(void)
Initialization of SatPhy.
SatGeoUserPhy::SendControlMsgToFeederCallback m_txCtrlFeederCallback
Callback to send ctrl packet on geo feeder.
void SendFromQueue()
Send a packet from the queue.
The SatPhy models the basic physical layer of the satellite system.
Definition: satellite-phy.h:61
SatSignalParameters::PacketsInBurst_t PacketContainer_t
Define PacketContainer in SatPhy.
Definition: satellite-phy.h:78
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Creation parameters for base PHY object.