satellite-phy-rx-carrier-per-frame.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_CARRIER_PER_FRAME_H
24 #define SATELLITE_PHY_RX_CARRIER_PER_FRAME_H
25 
30 
31 #include <ns3/singleton.h>
32 
33 namespace ns3
34 {
35 
36 class Address;
37 class SatPhy;
38 class SatSignalParameters;
39 class SatLinkResults;
40 class SatChannelEstimationErrorContainer;
41 class SatNodeInfo;
42 class SatPhyRxCarrier;
43 class SatPhyRxCarrierPerSlot;
44 class SatCrdsaReplicaTag;
45 
52 {
53  public:
57  typedef struct
58  {
59  Ptr<SatSignalParameters> rxParams;
60  Mac48Address destAddress;
61  Mac48Address sourceAddress;
62  uint16_t ownSlotId;
63  std::vector<uint16_t> slotIdsForOtherReplicas;
66  double cSinr;
67  double ifPower;
68  bool phyError;
70 
78  SatPhyRxCarrierPerFrame(uint32_t carrierId,
79  Ptr<SatPhyRxCarrierConf> carrierConf,
80  Ptr<SatWaveformConf> waveformConf,
81  bool randomAccessEnabled);
82 
86  virtual ~SatPhyRxCarrierPerFrame();
87 
92  static TypeId GetTypeId(void);
93 
102 
106  void BeginEndScheduling();
107 
111  inline virtual CarrierType GetCarrierType()
112  {
113  return CarrierType::RA_CRDSA;
114  }
115 
116  protected:
120  virtual void ReceiveSlot(SatPhyRxCarrier::rxParams_s packetRxParams, const uint32_t nPackets);
121 
125  virtual void DoDispose();
126 
134  virtual void PerformSicCycles(
135  std::vector<SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s>& combinedPacketsForFrame);
136 
144  const SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s& otherPacket) const;
145 
151  double CalculatePacketCompositeSinr(crdsaPacketRxParams_s& packet);
152 
159  std::map<uint32_t, std::list<SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s>>::iterator
160  iter,
162 
168 
169  inline std::map<uint32_t, std::list<SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s>>&
171  {
172  return m_crdsaPacketContainer;
173  }
174 
175  private:
181 
192  TracedCallback<uint32_t, const Address&, bool> m_crdsaReplicaRxTrace;
193 
205  TracedCallback<uint32_t, const Address&, bool> m_crdsaUniquePayloadRxTrace;
206 
211  std::vector<SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s> ProcessFrame();
212 
220  const SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s& otherPacket) const;
221 
227 
231  void DoFrameEnd();
232 
237 
242  void UpdateRandomAccessLoad();
243 
249  uint32_t numOfPacketsForThisSlot);
250 
254  std::map<uint32_t, std::list<SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s>>
256 
261 };
262 
264 
265 } // namespace ns3
266 
267 #endif /* SATELLITE_PHY_RX_CARRIER_PER_FRAME_H */
CarrierType
Possible carrier types.
Inherited the functionality of ground station SatPhyRxCarriers and extended it with CRDSA functionali...
void EliminateInterference(std::map< uint32_t, std::list< SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s >>::iterator iter, SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s processedPacket)
Function for eliminating the interference to other packets in the slot from the correctly received pa...
void BeginEndScheduling()
Function for initializing the frame end scheduling.
void AddCrdsaPacket(SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s crdsaPacketParams)
Function for storing the received CRDSA packets.
virtual void ReceiveSlot(SatPhyRxCarrier::rxParams_s packetRxParams, const uint32_t nPackets)
Receive a slot.
virtual void DoDispose()
Dispose implementation.
bool IsReplica(const SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s &packet, const SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s &otherPacket) const
Function for identifying whether the packet is a replica of another packet.
TracedCallback< uint32_t, const Address &, bool > m_crdsaUniquePayloadRxTrace
CrdsaUniquePayloadRx trace source.
virtual void PerformSicCycles(std::vector< SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s > &combinedPacketsForFrame)
Function for receiving decodable packets and removing their interference from the other packets in th...
double CalculateNormalizedOfferedRandomAccessLoad()
Function for calculating the normalized offered random access load.
TracedCallback< uint32_t, const Address &, bool > m_crdsaReplicaRxTrace
CrdsaReplicaRx trace source.
bool m_frameEndSchedulingInitialized
Has the frame end scheduling been initialized.
std::vector< SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s > ProcessFrame()
Function for processing the CRDSA frame.
bool HaveSameSlotIds(const SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s &packet, const SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s &otherPacket) const
Function for checking do the packets have identical slots.
void UpdateRandomAccessLoad()
Update the random access load for CRDSA.
double CalculatePacketCompositeSinr(crdsaPacketRxParams_s &packet)
Function for computing the composite SINR of the given packet.
void FindAndRemoveReplicas(SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s packet)
Function for finding and removing the replicas of the CRDSA packet.
void MeasureRandomAccessLoad()
Function for measuring the random access load.
SatPhyRxCarrierPerFrame(uint32_t carrierId, Ptr< SatPhyRxCarrierConf > carrierConf, Ptr< SatWaveformConf > waveformConf, bool randomAccessEnabled)
Constructor.
virtual CarrierType GetCarrierType()
Method for querying the type of the carrier.
SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s ProcessReceivedCrdsaPacket(SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s packet, uint32_t numOfPacketsForThisSlot)
Process received CRDSA packet.
void DoFrameEnd()
Function for processing the frame interval operations.
static bool CompareCrdsaPacketId(SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s obj1, SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s obj2)
Function for comparing the CRDSA unique packet IDs.
static TypeId GetTypeId(void)
Get the TypeId of the class.
std::map< uint32_t, std::list< SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s > > & GetCrdsaPacketContainer()
std::map< uint32_t, std::list< SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s > > m_crdsaPacketContainer
CRDSA packet container.
Inherited the base functionality of SatPhyRxCarriers for ground station nodes.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Struct for storing the packet specific Rx parameters.
Struct for storing the CRDSA packet specific Rx parameters.