satellite-random-access-allocation-channel.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014 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: Frans Laakso <frans.laakso@magister.fi>
20  * Author: Mathias Ettinger <mettinger@toulouse.viveris.fr>
21  */
22 #ifndef SATELLITE_RANDOM_ACCESS_ALLOCATION_CHANNEL_H
23 #define SATELLITE_RANDOM_ACCESS_ALLOCATION_CHANNEL_H
24 
25 #include <ns3/object.h>
26 #include <ns3/simulator.h>
27 #include <ns3/uinteger.h>
28 
29 namespace ns3
30 {
31 
39 class SatRandomAccessAllocationChannel : public Object
40 {
41  public:
46 
51 
56  static TypeId GetTypeId(void);
57 
63  {
64  return m_slottedAlohaAllowed;
65  }
66 
71  void SetSlottedAlohaAllowed(bool isSlottedAlohaAllowed)
72  {
73  m_slottedAlohaAllowed = isSlottedAlohaAllowed;
74  }
75 
81  {
82  return m_crdsaAllowed;
83  }
84 
89  void SetCrdsaAllowed(bool isCrdsaAllowed)
90  {
91  m_crdsaAllowed = isCrdsaAllowed;
92  }
93 
99  {
100  return m_essaAllowed;
101  }
102 
107  void SetEssaAllowed(bool isEssaAllowed)
108  {
109  m_essaAllowed = isEssaAllowed;
110  }
111 
117  {
119  }
120 
125  void SetCrdsaBackoffTimeInMilliSeconds(uint32_t crdsaBackoffTimeInMilliSeconds)
126  {
127  m_crdsaBackoffTimeInMilliSeconds = crdsaBackoffTimeInMilliSeconds;
128  }
129 
135  {
137  }
138 
143  void SetFSimBackoffTimeInMilliSeconds(uint32_t fSimBackoffTimeInMilliSeconds)
144  {
145  m_fSimBackoffTimeInMilliSeconds = fSimBackoffTimeInMilliSeconds;
146  }
147 
152  void SetFSimBackoffTimeInFrames(uint32_t fSimBackoffTimeInFrames)
153  {
155  fSimBackoffTimeInFrames * m_fSimPhysicalLayerFrameInMilliSeconds;
156  }
157 
163  {
165  }
166 
171  void SetFSimPhysicalLayerFrameInMilliSeconds(uint32_t fSimPhysicalLayerFrameInMilliSeconds)
172  {
173  m_fSimPhysicalLayerFrameInMilliSeconds = fSimPhysicalLayerFrameInMilliSeconds;
174  }
175 
180  void SetCrdsaBackoffReleaseTime(Time crdsaBackoffReleaseTime)
181  {
182  m_crdsaBackoffReleaseTime = crdsaBackoffReleaseTime;
183  }
184 
190  {
192  }
193 
198  void SetCrdsaBackoffProbability(uint16_t crdsaBackoffProbability)
199  {
200  m_crdsaBackoffProbability = (crdsaBackoffProbability + 1) * (1 / (std::pow(2, 16)));
201  }
202 
208  {
210  }
211 
216  void SetFSimBackoffProbability(uint16_t fSimPersistence)
217  {
218  m_fSimBackoffProbability = 1.0 / (std::pow(2.0, fSimPersistence / 2.0));
219  }
220 
226  {
228  }
229 
234  void SetCrdsaMinRandomizationValue(uint32_t minRandomizationValue)
235  {
236  m_crdsaMinRandomizationValue = minRandomizationValue;
237  }
238 
244  {
246  }
247 
252  void SetCrdsaMaxRandomizationValue(uint32_t maxRandomizationValue)
253  {
254  m_crdsaMaxRandomizationValue = maxRandomizationValue;
255  }
256 
262  {
263  return m_crdsaNumOfInstances;
264  }
265 
270  void SetCrdsaNumOfInstances(uint32_t numOfInstances)
271  {
272  m_crdsaNumOfInstances = numOfInstances;
273  }
274 
280  {
281  return m_crdsaMinIdleBlocks;
282  }
283 
288  void SetCrdsaMinIdleBlocks(uint32_t minIdleBlocks)
289  {
290  m_crdsaMinIdleBlocks = minIdleBlocks;
291  }
292 
298  {
299  return m_crdsaIdleBlocksLeft;
300  }
301 
306  void SetCrdsaIdleBlocksLeft(uint32_t idleBlocksLeft)
307  {
308  m_crdsaIdleBlocksLeft = idleBlocksLeft;
309  }
310 
316  {
318  }
319 
324  void SetCrdsaMaxUniquePayloadPerBlock(uint32_t maxUniquePayloadPerBlock)
325  {
326  m_crdsaMaxUniquePayloadPerBlock = maxUniquePayloadPerBlock;
327  }
328 
334  {
336  }
337 
342  void SetCrdsaMaxConsecutiveBlocksAccessed(uint32_t maxConsecutiveBlocksAccessed)
343  {
344  m_crdsaMaxConsecutiveBlocksAccessed = maxConsecutiveBlocksAccessed;
345  }
346 
352  {
354  }
355 
360  void SetCrdsaNumOfConsecutiveBlocksUsed(uint32_t numOfConsecutiveBlocksUsed)
361  {
362  m_crdsaNumOfConsecutiveBlocksUsed = numOfConsecutiveBlocksUsed;
363  }
364 
369 
370  private:
375 
380 
385 
390 
395 
400 
405 
410 
415 
420 
425 
430 
435 
440 
445 
450 
456 };
457 
458 } // namespace ns3
459 
460 #endif /* SATELLITE_RANDOM_ACCESS_ALLOCATION_CHANNEL_H */
Class for random access allocation channel configuration.
bool GetCrdsaAllowed()
Function for getting the status of CRDSA allowance.
uint32_t m_fSimBackoffTimeInMilliSeconds
F-SIM Backoff Time in physical layer frame units.
bool GetSlottedAlohaAllowed()
Function for getting the status of Slotted Aloha allowance.
uint32_t m_crdsaNumOfConsecutiveBlocksUsed
CRDSA number of consecutive blocks used.
void SetCrdsaNumOfConsecutiveBlocksUsed(uint32_t numOfConsecutiveBlocksUsed)
Function for setting the CRDSA number of consecutive blocks used.
void SetCrdsaBackoffReleaseTime(Time crdsaBackoffReleaseTime)
Function for setting the CRDSA backoff release time.
void SetFSimBackoffTimeInMilliSeconds(uint32_t fSimBackoffTimeInMilliSeconds)
Function for setting the F-SIM backoff time.
Time GetCrdsaBackoffReleaseTime()
Function for getting the CRDSA backoff release time.
bool GetEssaAllowed()
Function for getting the status of ESSA allowance.
void SetCrdsaMaxRandomizationValue(uint32_t maxRandomizationValue)
Function for setting the CRDSA maximum randomization value.
uint32_t m_crdsaNumOfInstances
CRDSA number of packet instances (replicas)
void DoCrdsaVariableSanityCheck()
Function for checking the CRDSA parameter sanity.
uint32_t m_crdsaMaxUniquePayloadPerBlock
CRDSA maximum number of unique payloads per block.
void SetCrdsaMaxConsecutiveBlocksAccessed(uint32_t maxConsecutiveBlocksAccessed)
Function for setting the CRDSA maximum number of consecutive blocks accessed.
uint32_t GetCrdsaMaxRandomizationValue()
Function for getting the CRDSA maximum randomization value.
void SetFSimBackoffTimeInFrames(uint32_t fSimBackoffTimeInFrames)
Function for setting the F-SIM backoff time.
uint32_t m_fSimPhysicalLayerFrameInMilliSeconds
F-SIM physical layer frame duration in milliseconds TODO: maybe this shouldn't be here.
uint32_t GetFSimBackoffTimeInMilliSeconds()
Function for getting the F-SIM backoff time.
uint32_t GetCrdsaNumOfConsecutiveBlocksUsed()
Function for getting the CRDSA number of consecutive blocks used.
uint32_t GetCrdsaMinIdleBlocks()
Function for getting the CRDSA minimum number of idle blocks.
void SetEssaAllowed(bool isEssaAllowed)
Function for setting the status of ESSA allowance.
uint32_t m_crdsaMinRandomizationValue
CRDSA minimum randomization value.
void SetCrdsaBackoffTimeInMilliSeconds(uint32_t crdsaBackoffTimeInMilliSeconds)
Function for setting the CRDSA backoff time.
double GetFSimBackoffProbability()
Function for getting the F-SIM backoff probability.
double GetCrdsaBackoffProbability()
Function for getting the CRDSA backoff probability.
uint32_t m_crdsaMaxRandomizationValue
CRDSA maximum randomization value.
uint32_t m_crdsaMaxConsecutiveBlocksAccessed
CRDSA maximum number of consecutive blocks accessed.
void SetSlottedAlohaAllowed(bool isSlottedAlohaAllowed)
Function for setting the status of Slotted Aloha allowance.
void SetCrdsaBackoffProbability(uint16_t crdsaBackoffProbability)
Function for setting the CRDSA backoff probability.
void SetCrdsaMaxUniquePayloadPerBlock(uint32_t maxUniquePayloadPerBlock)
Function for setting the CRDSA maximum number of unique payloads per block.
uint32_t GetCrdsaMinRandomizationValue()
Function for getting the CRDSA minimum randomization value.
uint32_t GetCrdsaIdleBlocksLeft()
Function for getting the CRDSA number of idle blocks left.
void SetFSimPhysicalLayerFrameInMilliSeconds(uint32_t fSimPhysicalLayerFrameInMilliSeconds)
Function for setting the F-SIM physical layer frame duration.
uint32_t m_crdsaMinIdleBlocks
CRDSA minimum number of idle blocks.
void SetCrdsaNumOfInstances(uint32_t numOfInstances)
Function for setting the CRDSA number of packet instances (replicas)
uint32_t m_crdsaIdleBlocksLeft
CRDSA number of idle blocks left.
void SetCrdsaMinIdleBlocks(uint32_t minIdleBlocks)
Function for setting the CRDSA minimum number of idle blocks.
uint32_t GetCrdsaMaxConsecutiveBlocksAccessed()
Function for getting the CRDSA number of consecutive blocks accessed.
uint32_t GetCrdsaBackoffTimeInMilliSeconds()
Function for getting the CRDSA backoff time.
void SetCrdsaMinRandomizationValue(uint32_t minRandomizationValue)
Function for setting the CRDSA minimum randomization value.
uint32_t GetCrdsaMaxUniquePayloadPerBlock()
Function for getting the CRDSA maximum number of unique payloads per block.
void SetFSimBackoffProbability(uint16_t fSimPersistence)
Function for setting the F-SIM backoff probability.
uint32_t GetCrdsaNumOfInstances()
Function for getting the CRDSA number of packet instances (replicas)
void SetCrdsaAllowed(bool isCrdsaAllowed)
Function for setting the status of CRDSA allowance.
void SetCrdsaIdleBlocksLeft(uint32_t idleBlocksLeft)
Function for setting the CRDSA number of idle blocks left.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.