Loading...
Searching...
No Matches
satellite-phy-rx-carrier-per-slot.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_SLOT_H
24#define SATELLITE_PHY_RX_CARRIER_PER_SLOT_H
25
27
28#include "ns3/mac48-address.h"
29#include "ns3/object.h"
30#include "ns3/ptr.h"
31#include "ns3/traced-callback.h"
32
33#include <deque>
34#include <list>
35#include <map>
36#include <stdint.h>
37#include <vector>
38
39namespace ns3
40{
41
42class SatPhyRxCarrier;
43
50{
51 public:
59 SatPhyRxCarrierPerSlot(uint32_t carrierId,
60 Ptr<SatPhyRxCarrierConf> carrierConf,
61 Ptr<SatWaveformConf> waveformConf,
62 bool randomAccessEnabled);
63
68
73 static TypeId GetTypeId(void);
74
78 virtual void BeginEndScheduling();
79
84 inline void SetRandomAccessAllocationChannelId(uint8_t randomAccessAllocationChannelId)
85 {
86 m_randomAccessAllocationChannelId = randomAccessAllocationChannelId;
87 }
88
94 {
96 }
97
106
107 protected:
112 virtual void EndRxData(uint32_t key);
113
117 virtual void DoDispose();
118
122 virtual void ReceiveSlot(SatPhyRxCarrier::rxParams_s packetRxParams, const uint32_t nPackets);
123
131
139
145
150 void SaveMeasuredRandomAccessLoad(double measuredRandomAccessLoad);
151
157 virtual Ptr<SatInterference::InterferenceChangeEvent> CreateInterference(
158 Ptr<SatSignalParameters> rxParams,
159 Address rxAddress);
160
166
168
178 TracedCallback<uint32_t, const Address&, bool> m_slottedAlohaRxCollisionTrace;
179
190 TracedCallback<uint32_t, const Address&, bool> m_slottedAlohaRxErrorTrace;
191
192 private:
201 double cSinr,
202 Ptr<SatSignalParameters> rxParams,
203 Ptr<SatInterference::InterferenceChangeEvent> interferenceEvent);
204
206
207 uint8_t m_randomAccessAllocationChannelId; //< Random access allocation ID
209 m_randomAccessCollisionModel; //< Random access collision model
210 double m_randomAccessConstantErrorRate; //< Constant error rate if collision model is
211 // RA_CONSTANT_COLLISION_PROBABILITY
212 uint32_t
214 // normalized offered load
215 // measurement window size
216 bool m_enableRandomAccessDynamicLoadControl; //< Is random access dynamic load control enabled
217 std::deque<double>
219 // normalized offered loads
220
221 bool m_disableErrorHighTransmissionTime; //< Disable fatal error when transmission time is
222 // higher than propagation time, but computations are
223 // less precise
224};
225
226} // namespace ns3
227
228#endif /* SATELLITE_PHY_RX_CARRIER_PER_SLOT_H */
RandomAccessCollisionModel
Random access collision model enum.
Base class for all SatPhyRxCarriers.
CarrierType
Possible carrier types.
const bool m_randomAccessEnabled
Is random access enabled for this carrier.
SatPhyRxCarrier(uint32_t carrierId, Ptr< SatPhyRxCarrierConf > carrierConf, Ptr< SatWaveformConf > waveformConf, bool isRandomAccessEnabled)
Constructor.
uint8_t m_randomAccessAllocationChannelId
PRIVATE MEMBER VARIABLES.
TracedCallback< uint32_t, const Address &, bool > m_slottedAlohaRxCollisionTrace
SlottedAlohaRxCollision trace source.
uint8_t GetRandomAccessAllocationChannelId() const
Function for getting the random access allocation channel ID.
SatPhyRxCarrierPerSlot(uint32_t carrierId, Ptr< SatPhyRxCarrierConf > carrierConf, Ptr< SatWaveformConf > waveformConf, bool randomAccessEnabled)
Constructor.
static TypeId GetTypeId(void)
Get the TypeId of the class.
virtual void EndRxData(uint32_t key)
Function for ending the packet reception from the SatChannel.
bool ProcessSlottedAlohaCollisions(double cSinr, Ptr< SatSignalParameters > rxParams, Ptr< SatInterference::InterferenceChangeEvent > interferenceEvent)
Function for processing the Slotted ALOHA collisions.
TracedCallback< uint32_t, const Address &, bool > m_slottedAlohaRxErrorTrace
SlottedAlohaRxError trace source.
virtual void ReceiveSlot(SatPhyRxCarrier::rxParams_s packetRxParams, const uint32_t nPackets)
Receive a slot.
virtual void DoDispose()
Dispose implementation.
void SaveMeasuredRandomAccessLoad(double measuredRandomAccessLoad)
Function for saving the measured random access load.
void SetRandomAccessAllocationChannelId(uint8_t randomAccessAllocationChannelId)
Function for setting the random access allocation channel ID.
SatPhyRxCarrierConf::RandomAccessCollisionModel m_randomAccessCollisionModel
virtual CarrierType GetCarrierType()
Method for querying the type of the carrier.
virtual Ptr< SatInterference::InterferenceChangeEvent > CreateInterference(Ptr< SatSignalParameters > rxParams, Address rxAddress)
Create an interference event based on Rx parameters and address.
SatPhyRxCarrierConf::RandomAccessCollisionModel GetRandomAccessCollisionModel() const
Get the random access collision model of the carrier.
bool IsRandomAccessDynamicLoadControlEnabled() const
Check if random access dynamic load control is enabled.
uint32_t m_randomAccessBitsInFrame
The number of random access bits in current frame.
std::deque< double > m_randomAccessDynamicLoadControlNormalizedOfferedLoad
double CalculateAverageNormalizedOfferedRandomAccessLoad()
Function for calculating the average normalized offered random access load.
virtual void BeginEndScheduling()
Function for initializing the frame/window end scheduling.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Struct for storing the packet specific Rx parameters.