Loading...
Searching...
No Matches
satellite-random-access-allocation-channel.cc
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
24
25#include "ns3/log.h"
26
27#include <stdint.h>
28
29NS_LOG_COMPONENT_DEFINE("SatRandomAccessAllocationChannel");
30
31namespace ns3
32{
33
34NS_OBJECT_ENSURE_REGISTERED(SatRandomAccessAllocationChannel);
35
36TypeId
38{
39 static TypeId tid = TypeId("ns3::SatRandomAccessAllocationChannel")
40 .SetParent<Object>()
41 .AddConstructor<SatRandomAccessAllocationChannel>();
42 return tid;
43}
44
66
71
72void
74{
75 NS_LOG_FUNCTION(this);
76
77 if (!m_crdsaAllowed)
78 {
79 NS_LOG_INFO("CRDSA disallowed: skipping sanity check");
80 return;
81 }
82
84 {
85 NS_FATAL_ERROR("SatRandomAccessAllocationChannel::DoCrdsaVariableSanityCheck - max < 1");
86 }
87
89 {
90 NS_FATAL_ERROR("SatRandomAccessAllocationChannel::DoCrdsaVariableSanityCheck - min > max");
91 }
92
94 {
95 NS_FATAL_ERROR(
96 "SatRandomAccessAllocationChannel::DoCrdsaVariableSanityCheck - instances < 1");
97 }
98
100 {
101 NS_FATAL_ERROR("SatRandomAccessAllocationChannel::DoCrdsaVariableSanityCheck - (max - min) "
102 "< instances");
103 }
104
106 {
107 NS_FATAL_ERROR("SatRandomAccessAllocationChannel::CrdsaDoVariableSanityCheck - "
108 "m_crdsaBackoffProbability < 0.0 || m_crdsaBackoffProbability > 1.0");
109 }
110
111 NS_LOG_INFO("Variable sanity check done");
112}
113
114} // namespace ns3
Class for random access allocation channel configuration.
uint32_t m_fSimBackoffTimeInMilliSeconds
F-SIM Backoff Time in physical layer frame units.
uint32_t m_crdsaNumOfConsecutiveBlocksUsed
CRDSA number of consecutive blocks used.
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.
uint32_t m_fSimPhysicalLayerFrameInMilliSeconds
F-SIM physical layer frame duration in milliseconds TODO: maybe this shouldn't be here.
uint32_t m_crdsaMinRandomizationValue
CRDSA minimum randomization value.
uint32_t m_crdsaMaxRandomizationValue
CRDSA maximum randomization value.
uint32_t m_crdsaMaxConsecutiveBlocksAccessed
CRDSA maximum number of consecutive blocks accessed.
uint32_t m_crdsaMinIdleBlocks
CRDSA minimum number of idle blocks.
uint32_t m_crdsaIdleBlocksLeft
CRDSA number of idle blocks left.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.