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 #include <cmath>
30 #include <stdint.h>
31 
32 namespace ns3
33 {
34 
42 class SatRandomAccessAllocationChannel : public Object
43 {
44  public:
49 
54 
59  static TypeId GetTypeId(void);
60 
66  {
67  return m_slottedAlohaAllowed;
68  }
69 
74  void SetSlottedAlohaAllowed(bool isSlottedAlohaAllowed)
75  {
76  m_slottedAlohaAllowed = isSlottedAlohaAllowed;
77  }
78 
84  {
85  return m_crdsaAllowed;
86  }
87 
92  void SetCrdsaAllowed(bool isCrdsaAllowed)
93  {
94  m_crdsaAllowed = isCrdsaAllowed;
95  }
96 
102  {
103  return m_essaAllowed;
104  }
105 
110  void SetEssaAllowed(bool isEssaAllowed)
111  {
112  m_essaAllowed = isEssaAllowed;
113  }
114 
120  {
122  }
123 
128  void SetCrdsaBackoffTimeInMilliSeconds(uint32_t crdsaBackoffTimeInMilliSeconds)
129  {
130  m_crdsaBackoffTimeInMilliSeconds = crdsaBackoffTimeInMilliSeconds;
131  }
132 
138  {
140  }
141 
146  void SetFSimBackoffTimeInMilliSeconds(uint32_t fSimBackoffTimeInMilliSeconds)
147  {
148  m_fSimBackoffTimeInMilliSeconds = fSimBackoffTimeInMilliSeconds;
149  }
150 
155  void SetFSimBackoffTimeInFrames(uint32_t fSimBackoffTimeInFrames)
156  {
158  fSimBackoffTimeInFrames * m_fSimPhysicalLayerFrameInMilliSeconds;
159  }
160 
166  {
168  }
169 
174  void SetFSimPhysicalLayerFrameInMilliSeconds(uint32_t fSimPhysicalLayerFrameInMilliSeconds)
175  {
176  m_fSimPhysicalLayerFrameInMilliSeconds = fSimPhysicalLayerFrameInMilliSeconds;
177  }
178 
183  void SetCrdsaBackoffReleaseTime(Time crdsaBackoffReleaseTime)
184  {
185  m_crdsaBackoffReleaseTime = crdsaBackoffReleaseTime;
186  }
187 
193  {
195  }
196 
201  void SetCrdsaBackoffProbability(uint16_t crdsaBackoffProbability)
202  {
203  m_crdsaBackoffProbability = (crdsaBackoffProbability + 1) * (1 / (std::pow(2, 16)));
204  }
205 
211  {
213  }
214 
219  void SetFSimBackoffProbability(uint16_t fSimPersistence)
220  {
221  m_fSimBackoffProbability = 1.0 / (std::pow(2.0, fSimPersistence / 2.0));
222  }
223 
229  {
231  }
232 
237  void SetCrdsaMinRandomizationValue(uint32_t minRandomizationValue)
238  {
239  m_crdsaMinRandomizationValue = minRandomizationValue;
240  }
241 
247  {
249  }
250 
255  void SetCrdsaMaxRandomizationValue(uint32_t maxRandomizationValue)
256  {
257  m_crdsaMaxRandomizationValue = maxRandomizationValue;
258  }
259 
265  {
266  return m_crdsaNumOfInstances;
267  }
268 
273  void SetCrdsaNumOfInstances(uint32_t numOfInstances)
274  {
275  m_crdsaNumOfInstances = numOfInstances;
276  }
277 
283  {
284  return m_crdsaMinIdleBlocks;
285  }
286 
291  void SetCrdsaMinIdleBlocks(uint32_t minIdleBlocks)
292  {
293  m_crdsaMinIdleBlocks = minIdleBlocks;
294  }
295 
301  {
302  return m_crdsaIdleBlocksLeft;
303  }
304 
309  void SetCrdsaIdleBlocksLeft(uint32_t idleBlocksLeft)
310  {
311  m_crdsaIdleBlocksLeft = idleBlocksLeft;
312  }
313 
319  {
321  }
322 
327  void SetCrdsaMaxUniquePayloadPerBlock(uint32_t maxUniquePayloadPerBlock)
328  {
329  m_crdsaMaxUniquePayloadPerBlock = maxUniquePayloadPerBlock;
330  }
331 
337  {
339  }
340 
345  void SetCrdsaMaxConsecutiveBlocksAccessed(uint32_t maxConsecutiveBlocksAccessed)
346  {
347  m_crdsaMaxConsecutiveBlocksAccessed = maxConsecutiveBlocksAccessed;
348  }
349 
355  {
357  }
358 
363  void SetCrdsaNumOfConsecutiveBlocksUsed(uint32_t numOfConsecutiveBlocksUsed)
364  {
365  m_crdsaNumOfConsecutiveBlocksUsed = numOfConsecutiveBlocksUsed;
366  }
367 
372 
373  private:
378 
383 
388 
393 
398 
403 
408 
413 
418 
423 
428 
433 
438 
443 
448 
453 
459 };
460 
461 } // namespace ns3
462 
463 #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.