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 #include <list>
34 #include <map>
35 #include <stdint.h>
36 #include <vector>
37 
38 namespace ns3
39 {
40 
41 class Address;
42 class SatPhy;
43 class SatSignalParameters;
44 class SatLinkResults;
45 class SatChannelEstimationErrorContainer;
46 class SatNodeInfo;
47 class SatPhyRxCarrier;
48 class SatPhyRxCarrierPerSlot;
49 class SatCrdsaReplicaTag;
50 
57 {
58  public:
62  typedef struct
63  {
64  Ptr<SatSignalParameters> rxParams;
65  Mac48Address destAddress;
66  Mac48Address sourceAddress;
67  uint16_t ownSlotId;
68  std::vector<uint16_t> slotIdsForOtherReplicas;
71  double cSinr;
72  double ifPower;
73  bool phyError;
75 
83  SatPhyRxCarrierPerFrame(uint32_t carrierId,
84  Ptr<SatPhyRxCarrierConf> carrierConf,
85  Ptr<SatWaveformConf> waveformConf,
86  bool randomAccessEnabled);
87 
91  virtual ~SatPhyRxCarrierPerFrame();
92 
97  static TypeId GetTypeId(void);
98 
107 
111  void BeginEndScheduling();
112 
116  inline virtual CarrierType GetCarrierType()
117  {
118  return CarrierType::RA_CRDSA;
119  }
120 
121  protected:
125  virtual void ReceiveSlot(SatPhyRxCarrier::rxParams_s packetRxParams, const uint32_t nPackets);
126 
130  virtual void DoDispose();
131 
139  virtual void PerformSicCycles(
140  std::vector<SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s>& combinedPacketsForFrame);
141 
149  const SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s& otherPacket) const;
150 
156  double CalculatePacketCompositeSinr(crdsaPacketRxParams_s& packet);
157 
164  std::map<uint32_t, std::list<SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s>>::iterator
165  iter,
167 
173 
174  inline std::map<uint32_t, std::list<SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s>>&
176  {
177  return m_crdsaPacketContainer;
178  }
179 
180  private:
186 
197  TracedCallback<uint32_t, const Address&, bool> m_crdsaReplicaRxTrace;
198 
210  TracedCallback<uint32_t, const Address&, bool> m_crdsaUniquePayloadRxTrace;
211 
216  std::vector<SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s> ProcessFrame();
217 
225  const SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s& otherPacket) const;
226 
232 
236  void DoFrameEnd();
237 
242 
247  void UpdateRandomAccessLoad();
248 
254  uint32_t numOfPacketsForThisSlot);
255 
259  std::map<uint32_t, std::list<SatPhyRxCarrierPerFrame::crdsaPacketRxParams_s>>
261 
266 };
267 
269 
270 } // namespace ns3
271 
272 #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.