Loading...
Searching...
No Matches
satellite-phy-rx-carrier-per-window.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2018 CNES
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: Joaquin Muguerza <jmuguerza@toulouse.viveris.fr>
19 */
20
21#ifndef SATELLITE_PHY_RX_CARRIER_PER_WINDOW_H
22#define SATELLITE_PHY_RX_CARRIER_PER_WINDOW_H
23
28
29#include "ns3/singleton.h"
30
31#include <list>
32#include <stdint.h>
33#include <utility>
34#include <vector>
35
36namespace ns3
37{
38
39class Address;
40class SatPhy;
42class SatLinkResults;
44class SatNodeInfo;
45class SatPhyRxCarrier;
48
55{
56 public:
60 typedef struct
61 {
62 Ptr<SatSignalParameters> rxParams;
63 Mac48Address destAddress;
64 Mac48Address sourceAddress;
70 double meanSinr;
72 std::vector<std::pair<double, double>> gamma;
76
84 SatPhyRxCarrierPerWindow(uint32_t carrierId,
85 Ptr<SatPhyRxCarrierConf> carrierConf,
86 Ptr<SatWaveformConf> waveformConf,
87 bool randomAccessEnabled);
88
93
98 static TypeId GetTypeId(void);
99
103 void BeginEndScheduling();
104
109 {
111 }
112
116 typedef void (*WindowLoadTraceCallback)(double windowLoad);
117
118 protected:
122 virtual void ReceiveSlot(SatPhyRxCarrier::rxParams_s packetRxParams, const uint32_t nPackets);
123
125
135 TracedCallback<uint32_t, const Address&, bool> m_essaRxErrorTrace;
136
147 TracedCallback<uint32_t, const Address&, bool> m_essaRxCollisionTrace;
148
157 TracedCallback<double> m_windowLoadTrace;
158
162 virtual void DoDispose();
163
164 private:
165 typedef std::list<SatPhyRxCarrierPerWindow::essaPacketRxParams_s> packetList_t;
170
176
181
186
191
195 void CleanOldPackets(const Time windowStartTime);
196
200 void DoWindowEnd();
201
205 void DoSic(packetList_t::iterator processedPacket,
206 std::pair<packetList_t::iterator, packetList_t::iterator> windowBounds);
207
212
217 packetList_t::iterator GetHighestSnirPacket(
218 const std::pair<packetList_t::iterator, packetList_t::iterator> windowBounds);
219
223 std::pair<double, double> GetNormalizedPacketInterferenceTime(
225 const SatPhyRxCarrierPerWindow::essaPacketRxParams_s& interferingPacket);
226
231 std::pair<packetList_t::iterator, packetList_t::iterator> GetWindowBounds(Time startTime,
232 Time endTime);
233
238
242 void ProcessWindow(Time startTime, Time endTime);
243
248
253
258
263
268
269 // TODO: REMOVE!
274
279
283 // TODO: find a more appropiate place for this parameter
285
290
295
299 uint32_t m_sicEnabled;
300};
301
303
304} // namespace ns3
305
306#endif /* SATELLITE_PHY_RX_CARRIER_PER_WINDOW_H */
SatChannelEstimationErrorContainer is responsible of adding a channel estimation error on top of raw ...
This class implements a tag that carries information about the slot IDs of CRDSA packet replicas.
The SatNodeInfo implements a container for all needed node related information.
The SatPhy models the basic physical layer of the satellite system.
Base class for all SatPhyRxCarriers.
CarrierType
Possible carrier types.
Inherited the base functionality of SatPhyRxCarriers for ground station nodes.
SatPhyRxCarrierPerSlot(uint32_t carrierId, Ptr< SatPhyRxCarrierConf > carrierConf, Ptr< SatWaveformConf > waveformConf, bool randomAccessEnabled)
Constructor.
bool m_windowEndSchedulingInitialized
Has the window end scheduling been initialized.
void BeginEndScheduling()
Function for initializing the window end scheduling.
uint32_t m_payloadBytesInWindow
The number of payload bytes in the window.
void CleanOldPackets(const Time windowStartTime)
Remove old packets from packet container.
Time m_windowDuration
The duration of the sliding window.
void CalculatePacketInterferenceVectors(SatPhyRxCarrierPerWindow::essaPacketRxParams_s &packet)
Calculate gamma and Interference vectors for a single packet.
void AddEssaPacket(SatPhyRxCarrierPerWindow::essaPacketRxParams_s essaPacketParams)
Function for storing the received E-SSA packets.
double GetEffectiveSnir(const SatPhyRxCarrierPerWindow::essaPacketRxParams_s &packet)
Get the effective SNIR of the packet using the Mutual Information function.
virtual void ReceiveSlot(SatPhyRxCarrier::rxParams_s packetRxParams, const uint32_t nPackets)
Receive a slot.
double CalculateNormalizedOfferedRandomAccessLoad()
Function for calculating the normalized offered random access load.
static TypeId GetTypeId(void)
Get the TypeId of the class.
Time m_windowDelay
The delay before processing a sliding window.
void DoWindowEnd()
Function called when a window ends.
TracedCallback< uint32_t, const Address &, bool > m_essaRxErrorTrace
EssaRxError trace source.
Time m_firstWindow
The time of the first window.
void MeasureRandomAccessLoad()
Function for measuring the random access load.
std::pair< double, double > GetNormalizedPacketInterferenceTime(const SatPhyRxCarrierPerWindow::essaPacketRxParams_s &packet, const SatPhyRxCarrierPerWindow::essaPacketRxParams_s &interferingPacket)
Get the normalized start and end time between two interfering packets.
SatPhyRxCarrierPerWindow(uint32_t carrierId, Ptr< SatPhyRxCarrierConf > carrierConf, Ptr< SatWaveformConf > waveformConf, bool randomAccessEnabled)
Constructor.
bool PacketCanBeDetected(const SatPhyRxCarrierPerWindow::essaPacketRxParams_s &packet)
Function for processing a window.
virtual CarrierType GetCarrierType()
Method for querying the type of the carrier.
double m_detectionThreshold
SNIR detection threshold for a packet (in magnitude).
virtual void DoDispose()
Dispose implementation.
void EliminatePreviousInterferences(SatPhyRxCarrierPerWindow::essaPacketRxParams_s &packet)
Calculate gamma and Interference vectors for a single packet.
std::pair< packetList_t::iterator, packetList_t::iterator > GetWindowBounds(Time startTime, Time endTime)
Get a pair of iterators, pointing to the first element in the window, and to the first after the wind...
void DoSic(packetList_t::iterator processedPacket, std::pair< packetList_t::iterator, packetList_t::iterator > windowBounds)
Perform SIC for a given decoded packet.
std::list< SatPhyRxCarrierPerWindow::essaPacketRxParams_s > packetList_t
Time m_windowStep
The step of the sliding window.
packetList_t m_essaPacketContainer
ESSA packet container.
uint32_t m_spreadingFactor
The spreading factor of packets.
packetList_t::iterator GetHighestSnirPacket(const std::pair< packetList_t::iterator, packetList_t::iterator > windowBounds)
Get the packet with the highst SNIR on the list.
uint32_t m_windowSicIterations
The number of SIC iterations performed on each window.
TracedCallback< double > m_windowLoadTrace
WindowLoad trace source.
TracedCallback< uint32_t, const Address &, bool > m_essaRxCollisionTrace
EssaRxError trace source.
void ProcessWindow(Time startTime, Time endTime)
Function for processing a window.
void(* WindowLoadTraceCallback)(double windowLoad)
Callback signature for WindowLoadTrace trace source.
Actual physical layer transmission container.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Struct for storing the packet specific Rx parameters.
Struct for storing the E-SSA packet specific Rx parameters.