Loading...
Searching...
No Matches
satellite-lower-layer-service.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: Sami Rantanen <sami.rantanen@magister.fi>
20 * Author: Mathias Ettinger <mettinger@toulouse.viveris.fr>
21 */
22
24
25#include "satellite-utils.h"
26
27#include "ns3/boolean.h"
28#include "ns3/double.h"
29#include "ns3/log.h"
30#include "ns3/object.h"
31#include "ns3/pointer.h"
32#include "ns3/random-variable-stream.h"
33#include "ns3/string.h"
34#include "ns3/uinteger.h"
35
36#include <limits>
37#include <string>
38
39NS_LOG_COMPONENT_DEFINE("SatLowerLayerServiceConf");
40
41namespace ns3
42{
43
55
60
77
82
83NS_OBJECT_ENSURE_REGISTERED(SatLowerLayerServiceConf);
84
91{
92 NS_LOG_FUNCTION(this);
93
95 {
96 NS_FATAL_ERROR("SatLowerLayerServiceConf::SatLowerLayerServiceConf - m_minRaServiceEntries "
97 "> m_maxRaServiceEntries");
98 }
99
101 {
102 NS_FATAL_ERROR("SatLowerLayerServiceConf::SatLowerLayerServiceConf - m_minDaServiceEntries "
103 "> m_maxDaServiceEntries");
104 }
105}
106
108{
109 NS_LOG_FUNCTION(this);
110}
111
112std::string
114{
115 std::string name = "DaService";
116 return name + GetNumberAsString<uint8_t>(index);
117}
118
119std::string
121{
122 std::string name = "RaService";
123 return name + GetNumberAsString<uint8_t>(index);
124}
125
141#define SAT_ADD_DA_SERVICE_ATTRIBUTES(index, a1, a2, a3, a4, a5, a6, a7) \
142 AddAttribute(GetIndexAsDaServiceName(index) + "_ConstantAssignmentProvided", \
143 "Constant Assignment provided for " + GetIndexAsDaServiceName(index), \
144 BooleanValue(a1), \
145 MakeBooleanAccessor( \
146 &SatLowerLayerServiceConf::SetDaServ##index##ConstantAssignmentProvided, \
147 &SatLowerLayerServiceConf::GetDaServ##index##ConstantAssignmentProvided), \
148 MakeBooleanChecker()) \
149 .AddAttribute( \
150 GetIndexAsDaServiceName(index) + "_RbdcAllowed", \
151 "RBDC allowed for DA " + GetIndexAsDaServiceName(index), \
152 BooleanValue(a2), \
153 MakeBooleanAccessor(&SatLowerLayerServiceConf::SetDaServ##index##RbdcAllowed, \
154 &SatLowerLayerServiceConf::GetDaServ##index##RbdcAllowed), \
155 MakeBooleanChecker()) \
156 .AddAttribute( \
157 GetIndexAsDaServiceName(index) + "_VolumeAllowed", \
158 "Volume allowed for DA " + GetIndexAsDaServiceName(index), \
159 BooleanValue(a3), \
160 MakeBooleanAccessor(&SatLowerLayerServiceConf::SetDaServ##index##VolumeAllowed, \
161 &SatLowerLayerServiceConf::GetDaServ##index##VolumeAllowed), \
162 MakeBooleanChecker()) \
163 .AddAttribute(GetIndexAsDaServiceName(index) + "_ConstantServiceRate", \
164 "A RandomVariableStream for constant service rate [kbps] for DA " + \
165 GetIndexAsDaServiceName(index), \
166 StringValue("ns3::ConstantRandomVariable[Constant=" + \
167 GetNumberAsString<uint16_t>(a4) + "]"), \
168 MakePointerAccessor( \
169 &SatLowerLayerServiceConf::SetDaServ##index##ConstantServiceRateStream, \
170 &SatLowerLayerServiceConf::GetDaServ##index##ConstantServiceRateStream), \
171 MakePointerChecker<RandomVariableStream>()) \
172 .AddAttribute(GetIndexAsDaServiceName(index) + "_MaximumServiceRate", \
173 "Maximum service rate [kbps] for DA " + GetIndexAsDaServiceName(index), \
174 UintegerValue(a5), \
175 MakeUintegerAccessor( \
176 &SatLowerLayerServiceConf::SetDaServ##index##MaximumServiceRateInKbps, \
177 &SatLowerLayerServiceConf::GetDaServ##index##MaximumServiceRateInKbps), \
178 MakeUintegerChecker<uint16_t>()) \
179 .AddAttribute(GetIndexAsDaServiceName(index) + "_MinimumServiceRate", \
180 "Minimum service rate [kbps] for DA " + GetIndexAsDaServiceName(index), \
181 UintegerValue(a6), \
182 MakeUintegerAccessor( \
183 &SatLowerLayerServiceConf::SetDaServ##index##MinimumServiceRateInKbps, \
184 &SatLowerLayerServiceConf::GetDaServ##index##MinimumServiceRateInKbps), \
185 MakeUintegerChecker<uint16_t>()) \
186 .AddAttribute(GetIndexAsDaServiceName(index) + "_MaximumBacklogSize", \
187 "Maximum backlog size [Kbytes] for DA " + GetIndexAsDaServiceName(index), \
188 UintegerValue(a7), \
189 MakeUintegerAccessor( \
190 &SatLowerLayerServiceConf::SetDaServ##index##MaximumBacklogInKbytes, \
191 &SatLowerLayerServiceConf::GetDaServ##index##MaximumBacklogInKbytes), \
192 MakeUintegerChecker<uint16_t>())
193
214#define SAT_ADD_RA_SERVICE_ATTRIBUTES(index, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) \
215 AddAttribute(GetIndexAsRaServiceName(index) + "_MaximumUniquePayloadPerBlock", \
216 "Maximum unique payload per block for RA " + GetIndexAsRaServiceName(index), \
217 UintegerValue(a1), \
218 MakeUintegerAccessor( \
219 &SatLowerLayerServiceConf::SetRaServ##index##MaximumUniquePayloadPerBlock, \
220 &SatLowerLayerServiceConf::GetRaServ##index##MaximumUniquePayloadPerBlock), \
221 MakeUintegerChecker<uint8_t>()) \
222 .AddAttribute( \
223 GetIndexAsRaServiceName(index) + "_MaximumConsecutiveBlockAccessed", \
224 "Maximum consecutive block accessed for RA " + GetIndexAsRaServiceName(index), \
225 UintegerValue(a2), \
226 MakeUintegerAccessor( \
227 &SatLowerLayerServiceConf::SetRaServ##index##MaximumConsecutiveBlockAccessed, \
228 &SatLowerLayerServiceConf::GetRaServ##index##MaximumConsecutiveBlockAccessed), \
229 MakeUintegerChecker<uint8_t>()) \
230 .AddAttribute( \
231 GetIndexAsRaServiceName(index) + "_MinimumIdleBlock", \
232 "Minimum idle block for RA " + GetIndexAsRaServiceName(index), \
233 UintegerValue(a3), \
234 MakeUintegerAccessor(&SatLowerLayerServiceConf::SetRaServ##index##MinimumIdleBlock, \
235 &SatLowerLayerServiceConf::GetRaServ##index##MinimumIdleBlock), \
236 MakeUintegerChecker<uint8_t>()) \
237 .AddAttribute(GetIndexAsRaServiceName(index) + "_BackOffTimeInMilliSeconds", \
238 "Back off time in milliseconds for RA " + GetIndexAsRaServiceName(index), \
239 UintegerValue(a4), \
240 MakeUintegerAccessor( \
241 &SatLowerLayerServiceConf::SetRaServ##index##BackOffTimeInMilliSeconds, \
242 &SatLowerLayerServiceConf::GetRaServ##index##BackOffTimeInMilliSeconds), \
243 MakeUintegerChecker<uint16_t>()) \
244 .AddAttribute( \
245 GetIndexAsRaServiceName(index) + "_HighLoadBackOffTimeInMilliSeconds", \
246 "High load back off time in milliseconds for RA " + GetIndexAsRaServiceName(index), \
247 UintegerValue(a5), \
248 MakeUintegerAccessor( \
249 &SatLowerLayerServiceConf::SetRaServ##index##HighLoadBackOffTimeInMilliSeconds, \
250 &SatLowerLayerServiceConf::GetRaServ##index##HighLoadBackOffTimeInMilliSeconds), \
251 MakeUintegerChecker<uint16_t>()) \
252 .AddAttribute( \
253 GetIndexAsRaServiceName(index) + "_BackOffProbability", \
254 "Back off probability for RA " + GetIndexAsRaServiceName(index), \
255 UintegerValue(a6), \
256 MakeUintegerAccessor(&SatLowerLayerServiceConf::SetRaServ##index##BackOffProbability, \
257 &SatLowerLayerServiceConf::GetRaServ##index##BackOffProbability), \
258 MakeUintegerChecker<uint16_t>()) \
259 .AddAttribute( \
260 GetIndexAsRaServiceName(index) + "_HighLoadBackOffProbability", \
261 "High load back off probability for RA " + GetIndexAsRaServiceName(index), \
262 UintegerValue(a7), \
263 MakeUintegerAccessor( \
264 &SatLowerLayerServiceConf::SetRaServ##index##HighLoadBackOffProbability, \
265 &SatLowerLayerServiceConf::GetRaServ##index##HighLoadBackOffProbability), \
266 MakeUintegerChecker<uint16_t>()) \
267 .AddAttribute( \
268 GetIndexAsRaServiceName(index) + "_NumberOfInstances", \
269 "Number of instances for RA " + GetIndexAsRaServiceName(index), \
270 UintegerValue(a8), \
271 MakeUintegerAccessor(&SatLowerLayerServiceConf::SetRaServ##index##NumberOfInstances, \
272 &SatLowerLayerServiceConf::GetRaServ##index##NumberOfInstances), \
273 MakeUintegerChecker<uint8_t>()) \
274 .AddAttribute( \
275 GetIndexAsRaServiceName(index) + "_AverageNormalizedOfferedLoadThreshold", \
276 "Average normalized offered load threshold for RA " + GetIndexAsRaServiceName(index), \
277 DoubleValue(a9), \
278 MakeDoubleAccessor(&SatLowerLayerServiceConf:: \
279 SetRaServ##index##AverageNormalizedOfferedLoadThreshold, \
280 &SatLowerLayerServiceConf:: \
281 GetRaServ##index##AverageNormalizedOfferedLoadThreshold), \
282 MakeDoubleChecker<double>()) \
283 .AddAttribute(GetIndexAsRaServiceName(index) + "_SlottedAlohaAllowed", \
284 "Slotted Aloha allowed for RA " + GetIndexAsRaServiceName(index), \
285 BooleanValue(a10), \
286 MakeBooleanAccessor( \
287 &SatLowerLayerServiceConf::SetRaServ##index##IsSlottedAlohaAllowed, \
288 &SatLowerLayerServiceConf::GetRaServ##index##IsSlottedAlohaAllowed), \
289 MakeBooleanChecker()) \
290 .AddAttribute( \
291 GetIndexAsRaServiceName(index) + "_CrdsaAllowed", \
292 "CRDSA allowed for RA " + GetIndexAsRaServiceName(index), \
293 BooleanValue(a11), \
294 MakeBooleanAccessor(&SatLowerLayerServiceConf::SetRaServ##index##IsCrdsaAllowed, \
295 &SatLowerLayerServiceConf::GetRaServ##index##IsCrdsaAllowed), \
296 MakeBooleanChecker()) \
297 .AddAttribute( \
298 GetIndexAsRaServiceName(index) + "_EssaAllowed", \
299 "ESSA allowed for RA " + GetIndexAsRaServiceName(index), \
300 BooleanValue(a12), \
301 MakeBooleanAccessor(&SatLowerLayerServiceConf::SetRaServ##index##IsEssaAllowed, \
302 &SatLowerLayerServiceConf::GetRaServ##index##IsEssaAllowed), \
303 MakeBooleanChecker())
304
305TypeId
307{
308 static TypeId tid =
309 TypeId("ns3::SatLowerLayerServiceConf")
310 .SetParent<Object>()
311 .AddConstructor<SatLowerLayerServiceConf>()
312 .AddAttribute(
313 "DaServiceCount",
314 "DA services in use.",
315 UintegerValue(4),
317 MakeUintegerChecker<uint8_t>(SatLowerLayerServiceConf::m_minDaServiceEntries,
319 .AddAttribute(
320 "RaServiceCount",
321 "RA services in use.",
322 UintegerValue(1),
324 MakeUintegerChecker<uint8_t>(SatLowerLayerServiceConf::m_minRaServiceEntries,
326 .AddAttribute(
327 "RaServiceDefault",
328 "Index of the RA service to use as a default for carriers with no explicitly "
329 "assigned services.",
330 UintegerValue(0),
332 MakeUintegerChecker<uint8_t>(0,
334 .AddAttribute("DynamicRatePersistence",
335 "Dynamic rate persistence for the lower layer service.",
336 UintegerValue(5),
338 MakeUintegerChecker<uint8_t>())
339 .AddAttribute(
340 "VolumeBacklogPersistence",
341 "Volume backlog persistence for the lower layer service",
342 UintegerValue(7),
344 MakeUintegerChecker<uint8_t>())
345 .AddAttribute(
346 "DefaultControlRandomizationInterval",
347 "Default control randomization interval for the lower layer service",
348 TimeValue(MilliSeconds(100)),
350 MakeTimeChecker(MilliSeconds(0), MilliSeconds(std::numeric_limits<uint8_t>::max())))
351 /*
352 * RC index, CRA allowed, RBDC allowed, VBDC allowed, CRA rate, Max RBDC rate, Min RBDC
353 * rate, Max volume backlog
354 */
355 .SAT_ADD_DA_SERVICE_ATTRIBUTES(0, true, false, false, 50, 9216, 10, 384)
356 .SAT_ADD_DA_SERVICE_ATTRIBUTES(1, false, false, false, 50, 9216, 10, 384)
357 .SAT_ADD_DA_SERVICE_ATTRIBUTES(2, false, false, false, 50, 9216, 10, 384)
358 .SAT_ADD_DA_SERVICE_ATTRIBUTES(3, false, true, false, 50, 9216, 10, 384)
359
360 /*
361 * Max payload per block, Max consecutive blocks, Min IDLE block, Backoff time, High
362 * load Backoff time, Backoff probability, High load Backoff probability, Replicas,
363 * Average load threshold
364 */
365 .SAT_ADD_RA_SERVICE_ATTRIBUTES(0,
366 3,
367 4,
368 2,
369 250,
370 500,
371 10000,
372 30000,
373 3,
374 0.5,
375 true,
376 true,
377 false)
378 .SAT_ADD_RA_SERVICE_ATTRIBUTES(1,
379 3,
380 4,
381 2,
382 250,
383 500,
384 10000,
385 30000,
386 2,
387 0.5,
388 true,
389 true,
390 false)
391 .SAT_ADD_RA_SERVICE_ATTRIBUTES(2,
392 3,
393 4,
394 2,
395 250,
396 500,
397 10000,
398 30000,
399 5,
400 0.5,
401 true,
402 true,
403 false);
404
405 return tid;
406}
407
408bool
410{
411 NS_LOG_FUNCTION(this << (uint32_t)index);
412
413 if (index >= m_maxDaServiceEntries)
414 {
415 NS_FATAL_ERROR("Service index out of range!!!");
416 }
417
418 return m_daServiceEntries[index].GetConstantAssignmentProvided();
419}
420
421void
423 bool constAssignmentProvided)
424{
425 NS_LOG_FUNCTION(this << (uint32_t)index << constAssignmentProvided);
426
427 if (index >= m_maxDaServiceEntries)
428 {
429 NS_FATAL_ERROR("Service index out of range!!!");
430 }
431
432 m_daServiceEntries[index].SetConstantAssignmentProvided(constAssignmentProvided);
433}
434
435bool
437{
438 NS_LOG_FUNCTION(this << (uint32_t)index);
439
440 if (index >= m_maxDaServiceEntries)
441 {
442 NS_FATAL_ERROR("Service index out of range!!!");
443 }
444
445 return m_daServiceEntries[index].GetRbdcAllowed();
446}
447
448void
449SatLowerLayerServiceConf::SetDaRbdcAllowed(uint8_t index, bool bdcAllowed)
450{
451 NS_LOG_FUNCTION(this << (uint32_t)index << bdcAllowed);
452
453 if (index >= m_maxDaServiceEntries)
454 {
455 NS_FATAL_ERROR("Service index out of range!!!");
456 }
457
458 m_daServiceEntries[index].SetRbdcAllowed(bdcAllowed);
459}
460
461bool
463{
464 NS_LOG_FUNCTION(this << (uint32_t)index);
465
466 if (index >= m_maxDaServiceEntries)
467 {
468 NS_FATAL_ERROR("Service index out of range!!!");
469 }
470
471 return m_daServiceEntries[index].GetVolumeAllowed();
472}
473
474void
475SatLowerLayerServiceConf::SetDaVolumeAllowed(uint8_t index, bool volumeAllowed)
476{
477 NS_LOG_FUNCTION(this << (uint32_t)index << volumeAllowed);
478
479 if (index >= m_maxDaServiceEntries)
480 {
481 NS_FATAL_ERROR("Service index out of range!!!");
482 }
483
484 m_daServiceEntries[index].SetVolumeAllowed(volumeAllowed);
485}
486
487uint16_t
489{
490 NS_LOG_FUNCTION(this << (uint32_t)index);
491
492 if (index >= m_maxDaServiceEntries)
493 {
494 NS_FATAL_ERROR("Service index out of range!!!");
495 }
496
497 return m_daServiceEntries[index].GetConstantServiceRateInKbps();
498}
499
500Ptr<RandomVariableStream>
502{
503 NS_LOG_FUNCTION(this << (uint32_t)index);
504
505 if (index >= m_maxDaServiceEntries)
506 {
507 NS_FATAL_ERROR("Service index out of range!!!");
508 }
509
510 return m_daServiceEntries[index].GetConstantServiceRateStream();
511}
512
513void
515 uint8_t index,
516 Ptr<RandomVariableStream> constantServiceRateStream)
517{
518 NS_LOG_FUNCTION(this << (uint32_t)index);
519
520 if (index >= m_maxDaServiceEntries)
521 {
522 NS_FATAL_ERROR("Service index out of range!!!");
523 }
524
525 m_daServiceEntries[index].SetConstantServiceRateStream(constantServiceRateStream);
526}
527
528uint16_t
530{
531 NS_LOG_FUNCTION(this << (uint32_t)index);
532
533 if (index >= m_maxDaServiceEntries)
534 {
535 NS_FATAL_ERROR("Service index out of range!!!");
536 }
537
538 return m_daServiceEntries[index].GetMaximumServiceRateInKbps();
539}
540
541void
543 uint16_t maximumServiceRateKbps)
544{
545 NS_LOG_FUNCTION(this << (uint32_t)index << maximumServiceRateKbps);
546
547 if (index >= m_maxDaServiceEntries)
548 {
549 NS_FATAL_ERROR("Service index out of range!!!");
550 }
551
552 m_daServiceEntries[index].SetMaximumServiceRateInKbps(maximumServiceRateKbps);
553}
554
555uint16_t
557{
558 NS_LOG_FUNCTION(this << (uint32_t)index);
559
560 if (index >= m_maxDaServiceEntries)
561 {
562 NS_FATAL_ERROR("Service index out of range!!!");
563 }
564
565 return m_daServiceEntries[index].GetMinimumServiceRateInKbps();
566}
567
568void
570 uint16_t minimumServiceRateKbps)
571{
572 NS_LOG_FUNCTION(this << (uint32_t)index << minimumServiceRateKbps);
573
574 if (index >= m_maxDaServiceEntries)
575 {
576 NS_FATAL_ERROR("Service index out of range!!!");
577 }
578
579 m_daServiceEntries[index].SetMinimumServiceRateInKbps(minimumServiceRateKbps);
580}
581
582uint16_t
584{
585 NS_LOG_FUNCTION(this << (uint32_t)index);
586
587 if (index >= m_maxDaServiceEntries)
588 {
589 NS_FATAL_ERROR("Service index out of range!!!");
590 }
591
592 return m_daServiceEntries[index].GetMaximumBacklogInKbytes();
593}
594
595void
597 uint16_t maximumBacklogInKbytes)
598{
599 NS_LOG_FUNCTION(this << (uint32_t)index << maximumBacklogInKbytes);
600
601 if (index >= m_maxDaServiceEntries)
602 {
603 NS_FATAL_ERROR("Service index out of range!!!");
604 }
605
606 m_daServiceEntries[index].SetMaximumBacklogInKbytes(maximumBacklogInKbytes);
607}
608
609uint8_t
611{
612 NS_LOG_FUNCTION(this << (uint32_t)index);
613
614 if (index >= m_maxRaServiceEntries)
615 {
616 NS_FATAL_ERROR("Service index out of range!!!");
617 }
618
619 return m_raServiceEntries[index].GetMaximumUniquePayloadPerBlock();
620}
621
622void
624 uint8_t uniquePayloadPerBlock)
625{
626 NS_LOG_FUNCTION(this << (uint32_t)index << uniquePayloadPerBlock);
627
628 if (index >= m_maxRaServiceEntries)
629 {
630 NS_FATAL_ERROR("Service index out of range!!!");
631 }
632
633 m_raServiceEntries[index].SetMaximumUniquePayloadPerBlock(uniquePayloadPerBlock);
634}
635
636uint8_t
638{
639 NS_LOG_FUNCTION(this << (uint32_t)index);
640
641 if (index >= m_maxRaServiceEntries)
642 {
643 NS_FATAL_ERROR("Service index out of range!!!");
644 }
645
646 return m_raServiceEntries[index].GetMaximumConsecutiveBlockAccessed();
647}
648
649void
651 uint8_t consecutiveBlockAccessed)
652{
653 NS_LOG_FUNCTION(this << (uint32_t)index << consecutiveBlockAccessed);
654
655 if (index >= m_maxRaServiceEntries)
656 {
657 NS_FATAL_ERROR("Service index out of range!!!");
658 }
659
660 m_raServiceEntries[index].SetMaximumConsecutiveBlockAccessed(consecutiveBlockAccessed);
661}
662
663uint8_t
665{
666 NS_LOG_FUNCTION(this << (uint32_t)index);
667
668 if (index >= m_maxRaServiceEntries)
669 {
670 NS_FATAL_ERROR("Service index out of range!!!");
671 }
672
673 return m_raServiceEntries[index].GetMinimumIdleBlock();
674}
675
676void
677SatLowerLayerServiceConf::SetRaMinimumIdleBlock(uint8_t index, uint8_t minimumIdleBlock)
678{
679 NS_LOG_FUNCTION(this << (uint32_t)index << minimumIdleBlock);
680
681 if (index >= m_maxRaServiceEntries)
682 {
683 NS_FATAL_ERROR("Service index out of range!!!");
684 }
685
686 m_raServiceEntries[index].SetMinimumIdleBlock(minimumIdleBlock);
687}
688
689uint16_t
691{
692 NS_LOG_FUNCTION(this << (uint32_t)index);
693
694 if (index >= m_maxRaServiceEntries)
695 {
696 NS_FATAL_ERROR("Service index out of range!!!");
697 }
698
699 return m_raServiceEntries[index].GetBackOffTimeInMilliSeconds();
700}
701
702void
704 uint16_t backOffTimeInMilliSeconds)
705{
706 NS_LOG_FUNCTION(this << (uint32_t)index << backOffTimeInMilliSeconds);
707
708 if (index >= m_maxRaServiceEntries)
709 {
710 NS_FATAL_ERROR("Service index out of range!!!");
711 }
712
713 m_raServiceEntries[index].SetBackOffTimeInMilliSeconds(backOffTimeInMilliSeconds);
714}
715
716uint16_t
718{
719 NS_LOG_FUNCTION(this << (uint32_t)index);
720
721 if (index >= m_maxRaServiceEntries)
722 {
723 NS_FATAL_ERROR("Service index out of range!!!");
724 }
725
726 return m_raServiceEntries[index].GetHighLoadBackOffTimeInMilliSeconds();
727}
728
729void
731 uint16_t backOffTimeInMilliSeconds)
732{
733 NS_LOG_FUNCTION(this << (uint32_t)index << backOffTimeInMilliSeconds);
734
735 if (index >= m_maxRaServiceEntries)
736 {
737 NS_FATAL_ERROR("Service index out of range!!!");
738 }
739
740 m_raServiceEntries[index].SetHighLoadBackOffTimeInMilliSeconds(backOffTimeInMilliSeconds);
741}
742
743uint16_t
745{
746 NS_LOG_FUNCTION(this << (uint32_t)index);
747
748 if (index >= m_maxRaServiceEntries)
749 {
750 NS_FATAL_ERROR("Service index out of range!!!");
751 }
752
753 return m_raServiceEntries[index].GetBackOffProbability();
754}
755
756void
757SatLowerLayerServiceConf::SetRaBackOffProbability(uint8_t index, uint16_t backOffProbability)
758{
759 NS_LOG_FUNCTION(this << (uint32_t)index << backOffProbability);
760
761 if (index >= m_maxRaServiceEntries)
762 {
763 NS_FATAL_ERROR("Service index out of range!!!");
764 }
765
766 m_raServiceEntries[index].SetBackOffProbability(backOffProbability);
767}
768
769uint16_t
771{
772 NS_LOG_FUNCTION(this << (uint32_t)index);
773
774 if (index >= m_maxRaServiceEntries)
775 {
776 NS_FATAL_ERROR("Service index out of range!!!");
777 }
778
779 return m_raServiceEntries[index].GetHighLoadBackOffProbability();
780}
781
782void
784 uint16_t highLoadBackOffProbability)
785{
786 NS_LOG_FUNCTION(this << (uint32_t)index << highLoadBackOffProbability);
787
788 if (index >= m_maxRaServiceEntries)
789 {
790 NS_FATAL_ERROR("Service index out of range!!!");
791 }
792
793 m_raServiceEntries[index].SetHighLoadBackOffProbability(highLoadBackOffProbability);
794}
795
796uint8_t
798{
799 NS_LOG_FUNCTION(this << (uint32_t)index);
800
801 if (index >= m_maxRaServiceEntries)
802 {
803 NS_FATAL_ERROR("Service index out of range!!!");
804 }
805
806 return m_raServiceEntries[index].GetNumberOfInstances();
807}
808
809void
810SatLowerLayerServiceConf::SetRaNumberOfInstances(uint8_t index, uint8_t numberOfInstances)
811{
812 NS_LOG_FUNCTION(this << (uint32_t)index << (uint32_t)numberOfInstances);
813
814 if (index >= m_maxRaServiceEntries)
815 {
816 NS_FATAL_ERROR("Service index out of range!!!");
817 }
818
819 m_raServiceEntries[index].SetNumberOfInstances(numberOfInstances);
820}
821
822double
824{
825 NS_LOG_FUNCTION(this << (uint32_t)index);
826
827 if (index >= m_maxRaServiceEntries)
828 {
829 NS_FATAL_ERROR("Service index out of range!!!");
830 }
831
832 return m_raServiceEntries[index].GetAverageNormalizedOfferedLoadThreshold();
833}
834
835void
837 uint8_t index,
838 double averageNormalizedOfferedLoadThreshold)
839{
840 NS_LOG_FUNCTION(this << (uint32_t)index << averageNormalizedOfferedLoadThreshold);
841
842 if (index >= m_maxRaServiceEntries)
843 {
844 NS_FATAL_ERROR("Service index out of range!!!");
845 }
846
847 m_raServiceEntries[index].SetAverageNormalizedOfferedLoadThreshold(
848 averageNormalizedOfferedLoadThreshold);
849}
850
851bool
853{
854 NS_LOG_FUNCTION(this << (uint32_t)index);
855
856 if (index >= m_maxRaServiceEntries)
857 {
858 NS_FATAL_ERROR("Service index out of range!!!");
859 }
860
861 return m_raServiceEntries[index].GetIsSlottedAlohaAllowed();
862}
863
864void
865SatLowerLayerServiceConf::SetRaIsSlottedAlohaAllowed(uint8_t index, bool isSlottedAlohaAllowed)
866{
867 NS_LOG_FUNCTION(this << (uint32_t)index << isSlottedAlohaAllowed);
868
869 if (index >= m_maxRaServiceEntries)
870 {
871 NS_FATAL_ERROR("Service index out of range!!!");
872 }
873
874 m_raServiceEntries[index].SetIsSlottedAlohaAllowed(isSlottedAlohaAllowed);
875}
876
877bool
879{
880 NS_LOG_FUNCTION(this << (uint32_t)index);
881
882 if (index >= m_maxRaServiceEntries)
883 {
884 NS_FATAL_ERROR("Service index out of range!!!");
885 }
886
887 return m_raServiceEntries[index].GetIsCrdsaAllowed();
888}
889
890void
891SatLowerLayerServiceConf::SetRaIsCrdsaAllowed(uint8_t index, bool isCrdsaAllowed)
892{
893 NS_LOG_FUNCTION(this << (uint32_t)index << isCrdsaAllowed);
894
895 if (index >= m_maxRaServiceEntries)
896 {
897 NS_FATAL_ERROR("Service index out of range!!!");
898 }
899
900 m_raServiceEntries[index].SetIsCrdsaAllowed(isCrdsaAllowed);
901}
902
903bool
905{
906 NS_LOG_FUNCTION(this << (uint32_t)index);
907
908 if (index >= m_maxRaServiceEntries)
909 {
910 NS_FATAL_ERROR("Service index out of range!!!");
911 }
912
913 return m_raServiceEntries[index].GetIsEssaAllowed();
914}
915
916void
917SatLowerLayerServiceConf::SetRaIsEssaAllowed(uint8_t index, bool isEssaAllowed)
918{
919 NS_LOG_FUNCTION(this << (uint32_t)index << isEssaAllowed);
920
921 if (index >= m_maxRaServiceEntries)
922 {
923 NS_FATAL_ERROR("Service index out of range!!!");
924 }
925
926 m_raServiceEntries[index].SetIsEssaAllowed(isEssaAllowed);
927}
928
929} // namespace ns3
The SatLowerLayerServiceConf class holds information of all configures lower layer service entries.
void SetDaVolumeAllowed(uint8_t index, bool volumeAllowed)
Set state, if volume is allowed for a DA service.
bool GetDaVolumeAllowed(uint8_t index) const
Get state, if volume is allowed for a DA service.
uint16_t GetDaMaximumBacklogInKbytes(uint8_t index) const
Get maximum backlog size for a DA service.
uint8_t GetRaMaximumUniquePayloadPerBlock(uint8_t index) const
Get maximum unique payload per block for a RA service.
void SetRaIsCrdsaAllowed(uint8_t index, bool isCrdsaAllowed)
Set CRDSA allowance.
void SetDaMinimumServiceRateInKbps(uint8_t index, uint16_t minimumServiceRateKbps)
Set minimum service rate for a DA service.
static std::string GetIndexAsDaServiceName(uint8_t index)
Method to convert DA service index to service name.
bool GetRaIsSlottedAlohaAllowed(uint8_t index) const
Get Slotted Aloha allowance.
void SetRaHighLoadBackOffProbability(uint8_t index, uint16_t highLoadBackOffProbability)
Set high load back off probability.
static std::string GetNumberAsString(T number)
Template method to convert number to string.
void SetRaNumberOfInstances(uint8_t index, uint8_t numberOfInstances)
Set number of instances.
void SetDaConstantAssignmentProvided(uint8_t index, bool constAssignmentProvided)
Set state, if constant assignment is provided for a DA service.
bool GetDaRbdcAllowed(uint8_t index) const
Get state, if RBDC is allowed for a DA service.
uint16_t GetRaHighLoadBackOffProbability(uint8_t index) const
Get high load back off probability.
uint16_t GetDaMaximumServiceRateInKbps(uint8_t index) const
Get maximum service rate for a DA service.
void SetRaMaximumUniquePayloadPerBlock(uint8_t index, uint8_t maxUniquePayloadPerBlock)
Set maximum unique payload per block for a RA service.
~SatLowerLayerServiceConf()
Destructor for SatLowerLayerServiceConf.
uint16_t GetRaHighLoadBackOffTimeInMilliSeconds(uint8_t index) const
Get high load back off time in milliseconds.
SatLowerLayerServiceConf()
Constructor for SatLowerLayerServiceConf.
void SetRaAverageNormalizedOfferedLoadThreshold(uint8_t index, double averageNormalizedOfferedLoadThreshold)
Set average normalized offeredLoad Threshold.
SatLowerLayerServiceRaEntry m_raServiceEntries[m_maxRaServiceEntries]
bool GetRaIsEssaAllowed(uint8_t index) const
Get E-SSA allowance.
void SetRaIsSlottedAlohaAllowed(uint8_t index, bool isSlottedAlohaAllowed)
Set Slotted Aloha allowance.
void SetRaIsEssaAllowed(uint8_t index, bool isEssaAllowed)
Set ESSA allowance.
static TypeId GetTypeId(void)
methods derived from base classes
uint16_t GetDaMinimumServiceRateInKbps(uint8_t index) const
Get minimum service rate for a DA service.
bool GetRaIsCrdsaAllowed(uint8_t index) const
Get CRDSA allowance.
uint16_t GetDaConstantServiceRateInKbps(uint8_t index) const
Get constant service rate for a DA service.
void SetDaRbdcAllowed(uint8_t index, bool bdcAllowed)
Set state, if RBDC is allowed for a DA service.
double GetRaAverageNormalizedOfferedLoadThreshold(uint8_t index) const
Get average normalized offeredLoad Threshold.
uint8_t GetRaNumberOfInstances(uint8_t index) const
Get number of instances.
Ptr< RandomVariableStream > GetDaConstantServiceRateStream(uint8_t index) const
Get constant service rate stream for a DA service.
void SetRaMaximumConsecutiveBlockAccessed(uint8_t index, uint8_t maxConsecutiveBlockAccessed)
Set maximum consecutive block accessed for a RA service.
void SetRaBackOffProbability(uint8_t index, uint16_t backOffProbability)
Set back off probability.
void SetRaMinimumIdleBlock(uint8_t index, uint8_t minimumIdleBlock)
Set minimum idle block for a RA service.
uint16_t GetRaBackOffProbability(uint8_t index) const
Get back off probability.
static std::string GetIndexAsRaServiceName(uint8_t index)
Method to convert RA service index to service name.
uint8_t GetRaMaximumConsecutiveBlockAccessed(uint8_t index) const
Get maximum consecutive block accessed for a RA service.
void SetRaBackOffTimeInMilliSeconds(uint8_t index, uint16_t backOffTimeInMilliSeconds)
Set back off time in milliseconds.
void SetDaMaximumServiceRateInKbps(uint8_t index, uint16_t maximumServiceRateKbps)
Set maximum service rate for a DA service.
void SetRaHighLoadBackOffTimeInMilliSeconds(uint8_t index, uint16_t backOffTimeInMilliSeconds)
Set high load back off time in milliseconds.
void SetDaConstantServiceRateStream(uint8_t index, Ptr< RandomVariableStream > constantServiceRateStream)
Set constant service rate stream for a DA service.
bool GetDaConstantAssignmentProvided(uint8_t index) const
Get state, if constant assignment is provided for a DA service.
SatLowerLayerServiceDaEntry m_daServiceEntries[m_maxDaServiceEntries]
uint8_t GetRaMinimumIdleBlock(uint8_t index) const
Get minimum idle block for a RA service.
uint16_t GetRaBackOffTimeInMilliSeconds(uint8_t index) const
Get back off time in milliseconds.
void SetDaMaximumBacklogInKbytes(uint8_t index, uint16_t maximumBacklogInKbytes)
Set maximum backlog size for a DA service.
uint16_t m_minimumServiceRateKbps
uint16_t m_maximumServiceRateKbps
Ptr< RandomVariableStream > m_constantServiceRateStream
bool m_volumeAllowed
SatLowerLayerServiceDaEntry()
~SatLowerLayerServiceDaEntry()
Destructor for SatLowerLayerServiceDaEntry.
uint16_t m_maximumBacklogInKbytes
bool m_rbdcAllowed
bool m_constantAssignmentProvided
SatLowerLayerServiceRaEntry()
uint16_t m_backOffProbability
uint8_t m_maxUniquePayloadPerBlock
uint8_t m_minimumIdleBlock
uint8_t m_numberOfInstances
bool m_isSlottedAlohaAllowed
uint16_t m_highLoadBackOffTimeInMilliSeconds
uint16_t m_highLoadBackOffProbability
uint8_t m_maxConsecutiveBlockAccessed
~SatLowerLayerServiceRaEntry()
Destructor for SatLowerLayerServiceRaEntry.
bool m_isCrdsaAllowed
uint16_t m_backOffTimeInMilliSeconds
bool m_isEssaAllowed
double m_averageNormalizedOfferedLoadThreshold
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.