satellite-ncc.cc
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: Sami Rantanen <sami.rantanen@magister.fi>
20  * Author: Mathias Ettinger <mettinger@toulouse.viveris.fr>
21  */
22 
23 #include "satellite-ncc.h"
24 
28 
29 #include <ns3/address.h>
30 #include <ns3/log.h>
31 #include <ns3/packet.h>
32 
33 #include <map>
34 #include <tuple>
35 #include <utility>
36 
37 NS_LOG_COMPONENT_DEFINE("SatNcc");
38 
39 namespace ns3
40 {
41 
42 NS_OBJECT_ENSURE_REGISTERED(SatNcc);
43 
44 TypeId
46 {
47  static TypeId tid =
48  TypeId("ns3::SatNcc")
49  .SetParent<Object>()
50  .AddConstructor<SatNcc>()
51  //
52  // Trace sources
53  //
54  .AddTraceSource("NccRx",
55  "Trace source indicating a CR has received by NCC",
56  MakeTraceSourceAccessor(&SatNcc::m_nccRxTrace),
57  "ns3::Packet::TracedCallback")
58  .AddTraceSource("NccTx",
59  "Trace source indicating a TBTP has sent by NCC",
60  MakeTraceSourceAccessor(&SatNcc::m_nccTxTrace),
61  "ns3::Packet::TracedCallback")
62  .AddAttribute("HandoverDelay",
63  "Delay between handover acceptance and effective information transfer",
64  TimeValue(Seconds(0.0)),
65  MakeTimeAccessor(&SatNcc::m_utHandoverDelay),
66  MakeTimeChecker())
67  .AddAttribute("UtTimeout",
68  "Timeout to logoff a UT, if logon procedure is used",
69  TimeValue(Seconds(10)),
70  MakeTimeAccessor(&SatNcc::m_utTimeout),
71  MakeTimeChecker());
72  return tid;
73 }
74 
75 TypeId
77 {
78  NS_LOG_FUNCTION(this);
79 
80  return GetTypeId();
81 }
82 
84  : m_utHandoverDelay(Seconds(0.0)),
85  m_utTimeout(Seconds(10)),
86  m_useLogon(false),
87  m_useLora(false)
88 {
89  NS_LOG_FUNCTION(this);
90 }
91 
93 {
94  NS_LOG_FUNCTION(this);
95 }
96 
97 void
99 {
100  NS_LOG_FUNCTION(this);
101 
102  m_updateRoutingCallback.Nullify();
103  m_isLowRandomAccessLoad.clear();
104 
105  Object::DoDispose();
106 }
107 
108 void
109 SatNcc::UtCnoUpdated(uint32_t satId,
110  uint32_t beamId,
111  Address sourceMac,
112  Address /*gwId*/,
113  double cno,
114  bool isSatelliteMac)
115 {
116  NS_LOG_FUNCTION(this << satId << beamId << sourceMac << cno);
117 
118  if (isSatelliteMac)
119  {
120  m_beamSchedulers[std::make_pair(satId, beamId)]->UpdateSatelliteCno(sourceMac, cno);
121  }
122  else
123  {
124  m_beamSchedulers[std::make_pair(satId, beamId)]->UpdateUtCno(sourceMac, cno);
125  }
126 }
127 
128 void
130  uint32_t beamId,
131  uint32_t carrierId,
132  uint8_t allocationChannelId,
133  double averageNormalizedOfferedLoad)
134 {
135  NS_LOG_FUNCTION(this << satId << beamId << carrierId << (uint32_t)allocationChannelId
136  << averageNormalizedOfferedLoad);
137 
138  bool isLowRandomAccessLoad = true;
139  std::map<std::tuple<uint32_t, uint32_t, uint8_t>, bool>::iterator findResult;
140  std::pair<std::map<std::tuple<uint32_t, uint32_t, uint8_t>, bool>::iterator, bool> insertResult;
141 
143  findResult = m_isLowRandomAccessLoad.find(std::make_tuple(satId, beamId, allocationChannelId));
144 
145  if (findResult == m_isLowRandomAccessLoad.end())
146  {
147  insertResult = m_isLowRandomAccessLoad.insert(
148  std::make_pair(std::make_tuple(satId, beamId, allocationChannelId),
149  isLowRandomAccessLoad));
150 
151  if (!insertResult.second)
152  {
153  NS_FATAL_ERROR("SatNcc::DoRandomAccessDynamicLoadControl - Insert failed");
154  }
155  else
156  {
157  isLowRandomAccessLoad = insertResult.second;
158  }
159  }
160  else
161  {
162  isLowRandomAccessLoad = findResult->second;
163  }
164 
165  NS_LOG_INFO("Beam: " << beamId << ", carrier ID: " << carrierId
166  << ", AC: " << (uint32_t)allocationChannelId
167  << " - Measuring the average normalized offered random access load: "
168  << averageNormalizedOfferedLoad);
169 
170  std::map<uint8_t, double>::iterator itThreshold =
171  m_randomAccessAverageNormalizedOfferedLoadThreshold.find(allocationChannelId);
172 
174  {
175  NS_FATAL_ERROR("SatNcc::DoRandomAccessDynamicLoadControl - Average normalized offered load "
176  "threshold not set for beam: "
177  << beamId << ", carrier: " << carrierId
178  << ", allocation channel: " << (uint32_t)allocationChannelId);
179  }
180 
182  if (isLowRandomAccessLoad)
183  {
184  NS_LOG_INFO("Beam: " << beamId << ", carrier ID: " << carrierId
185  << " - Currently low load in effect for allocation channel: "
186  << (uint32_t)allocationChannelId);
188  if (averageNormalizedOfferedLoad >= itThreshold->second)
189  {
190  std::map<uint8_t, uint16_t>::iterator it;
191 
192  it = m_highLoadBackOffProbability.find(allocationChannelId);
193 
194  if (it == m_highLoadBackOffProbability.end())
195  {
196  NS_FATAL_ERROR("SatNcc::DoRandomAccessDynamicLoadControl - High load backoff "
197  "probability not set for allocation channel: "
198  << (uint32_t)allocationChannelId);
199  }
200 
201  uint16_t probability = it->second;
202 
203  it = m_highLoadBackOffTime.find(allocationChannelId);
204 
205  if (it == m_highLoadBackOffTime.end())
206  {
207  NS_FATAL_ERROR("SatNcc::DoRandomAccessDynamicLoadControl - High load backoff time "
208  "not set for allocation channel: "
209  << (uint32_t)allocationChannelId);
210  }
211 
212  uint16_t time = it->second;
213 
216  time,
217  satId,
218  beamId,
219  allocationChannelId);
220 
221  NS_LOG_INFO("Beam: " << beamId << ", carrier ID: " << carrierId
222  << ", AC: " << (uint32_t)allocationChannelId
223  << " - Switching to HIGH LOAD back off parameterization");
224 
226  m_isLowRandomAccessLoad.at(std::make_tuple(satId, beamId, allocationChannelId)) = false;
227  }
228  }
230  else
231  {
232  NS_LOG_INFO("Beam: " << beamId << ", carrier ID: " << carrierId
233  << " - Currently high load in effect for allocation channel: "
234  << (uint32_t)allocationChannelId);
235 
237  if (averageNormalizedOfferedLoad < itThreshold->second)
238  {
239  std::map<uint8_t, uint16_t>::iterator it;
240 
241  it = m_lowLoadBackOffProbability.find(allocationChannelId);
242 
243  if (it == m_lowLoadBackOffProbability.end())
244  {
245  NS_FATAL_ERROR("SatNcc::DoRandomAccessDynamicLoadControl - Low load backoff "
246  "probability not set for allocation channel: "
247  << (uint32_t)allocationChannelId);
248  }
249 
250  uint16_t probability = it->second;
251 
252  it = m_lowLoadBackOffTime.find(allocationChannelId);
253 
254  if (it == m_lowLoadBackOffTime.end())
255  {
256  NS_FATAL_ERROR("SatNcc::DoRandomAccessDynamicLoadControl - Low load backoff time "
257  "not set for allocation channel: "
258  << (uint32_t)allocationChannelId);
259  }
260 
261  uint16_t time = it->second;
262 
265  time,
266  satId,
267  beamId,
268  allocationChannelId);
269 
270  NS_LOG_INFO("Beam: " << beamId << ", carrier ID: " << carrierId
271  << ", AC: " << (uint32_t)allocationChannelId
272  << " - Switching to LOW LOAD back off parameterization");
273 
275  m_isLowRandomAccessLoad.at(std::make_tuple(satId, beamId, allocationChannelId)) = true;
276  }
277  }
278 }
279 
280 void
282  uint16_t backoffTime,
283  uint32_t satId,
284  uint32_t beamId,
285  uint8_t allocationChannelId)
286 {
287  NS_LOG_FUNCTION(this);
288 
289  Ptr<SatRaMessage> raMsg = CreateObject<SatRaMessage>();
290  std::map<std::pair<uint32_t, uint32_t>, Ptr<SatBeamScheduler>>::iterator iterator =
291  m_beamSchedulers.find(std::make_pair(satId, beamId));
292 
293  if (iterator == m_beamSchedulers.end())
294  {
295  NS_FATAL_ERROR("SatNcc::SendRaControlMessage - Beam scheduler not found");
296  }
297 
299  raMsg->SetAllocationChannelId(allocationChannelId);
300 
302  raMsg->SetBackoffProbability(backoffProbability);
303  raMsg->SetBackoffTime(backoffTime);
304 
305  NS_LOG_INFO("Sending random access control message for AC: "
306  << (uint32_t)allocationChannelId << ", backoff probability: " << backoffProbability
307  << ", backoff time: " << backoffTime);
308 
309  iterator->second->Send(raMsg);
310 }
311 
312 void
313 SatNcc::UtCrReceived(uint32_t satId, uint32_t beamId, Address utId, Ptr<SatCrMessage> crMsg)
314 {
315  NS_LOG_FUNCTION(this << satId << beamId << utId << crMsg);
316 
317  m_beamSchedulers[std::make_pair(satId, beamId)]->UtCrReceived(utId, crMsg);
318 }
319 
320 void
321 SatNcc::AddBeam(uint32_t satId,
322  uint32_t beamId,
323  Ptr<SatNetDevice> gwNetDevice,
324  Ptr<SatOrbiterNetDevice> orbiterNetDevice,
327  Ptr<SatSuperframeSeq> seq,
328  uint32_t maxFrameSize,
329  Address satAddress,
330  Address gwAddress)
331 {
332  NS_LOG_FUNCTION(this << satId << beamId << gwNetDevice << orbiterNetDevice << &cb << &tbtpCb
333  << seq << maxFrameSize << satAddress << gwAddress);
334 
335  Ptr<SatBeamScheduler> scheduler;
336  std::map<std::pair<uint32_t, uint32_t>, Ptr<SatBeamScheduler>>::iterator iterator =
337  m_beamSchedulers.find(std::make_pair(satId, beamId));
338 
339  if (iterator != m_beamSchedulers.end())
340  {
341  NS_FATAL_ERROR("Beam tried to add, already added.");
342  }
343 
344  scheduler = CreateObject<SatBeamScheduler>();
345  scheduler->Initialize(satId,
346  beamId,
347  gwNetDevice,
348  orbiterNetDevice,
349  cb,
350  seq,
351  maxFrameSize,
352  satAddress,
353  gwAddress);
354 
355  scheduler->SetSendTbtpCallback(tbtpCb);
356 
357  scheduler->SetUseLora(m_useLora);
358 
359  m_beamSchedulers.insert(std::make_pair(std::make_pair(satId, beamId), scheduler));
360 }
361 
362 void
363 SatNcc::AddUt(Ptr<SatLowerLayerServiceConf> llsConf,
364  Address utId,
365  uint32_t satId,
366  uint32_t beamId,
367  Callback<void, uint32_t> setRaChannelCallback,
368  bool verifyExisting)
369 {
370  NS_LOG_FUNCTION(this << utId << beamId);
371 
372  std::map<std::pair<uint32_t, uint32_t>, Ptr<SatBeamScheduler>>::iterator iterator =
373  m_beamSchedulers.find(std::make_pair(satId, beamId));
374 
375  if (iterator == m_beamSchedulers.end())
376  {
377  NS_FATAL_ERROR("Beam where tried to add, not found.");
378  }
379 
380  if (!verifyExisting || !(m_beamSchedulers[std::make_pair(satId, beamId)]->HasUt(utId)))
381  {
382  setRaChannelCallback(m_beamSchedulers[std::make_pair(satId, beamId)]->AddUt(utId, llsConf));
383  }
384 }
385 
386 void
387 SatNcc::RemoveUt(Address utId, uint32_t satId, uint32_t beamId)
388 {
389  NS_LOG_FUNCTION(this << utId << beamId);
390 
391  if (m_beamSchedulers[std::make_pair(satId, beamId)]->HasUt(utId))
392  {
393  m_beamSchedulers[std::make_pair(satId, beamId)]->RemoveUt(utId);
394  }
395 }
396 
397 void
399  uint16_t lowLoadBackOffProbability)
400 {
401  NS_LOG_FUNCTION(this << (uint32_t)allocationChannelId << lowLoadBackOffProbability);
402 
403  NS_LOG_INFO("AC: " << (uint32_t)allocationChannelId
404  << ", low load backoff probability: " << lowLoadBackOffProbability);
405  m_lowLoadBackOffProbability[allocationChannelId] = lowLoadBackOffProbability;
406 }
407 
408 void
410  uint16_t highLoadBackOffProbability)
411 {
412  NS_LOG_FUNCTION(this << (uint32_t)allocationChannelId << highLoadBackOffProbability);
413 
414  NS_LOG_INFO("AC: " << (uint32_t)allocationChannelId
415  << ", high load backoff probability: " << highLoadBackOffProbability);
416  m_highLoadBackOffProbability[allocationChannelId] = highLoadBackOffProbability;
417 }
418 
419 void
420 SatNcc::SetRandomAccessLowLoadBackoffTime(uint8_t allocationChannelId, uint16_t lowLoadBackOffTime)
421 {
422  NS_LOG_FUNCTION(this << (uint32_t)allocationChannelId << lowLoadBackOffTime);
423 
424  NS_LOG_INFO("AC: " << (uint32_t)allocationChannelId
425  << ", low load backoff time: " << lowLoadBackOffTime);
426  m_lowLoadBackOffTime[allocationChannelId] = lowLoadBackOffTime;
427 }
428 
429 void
430 SatNcc::SetRandomAccessHighLoadBackoffTime(uint8_t allocationChannelId,
431  uint16_t highLoadBackOffTime)
432 {
433  NS_LOG_FUNCTION(this << (uint32_t)allocationChannelId << highLoadBackOffTime);
434 
435  NS_LOG_INFO("AC: " << (uint32_t)allocationChannelId
436  << ", high load backoff time: " << highLoadBackOffTime);
437  m_highLoadBackOffTime[allocationChannelId] = highLoadBackOffTime;
438 }
439 
440 void
442  double threshold)
443 {
444  NS_LOG_FUNCTION(this << (uint32_t)allocationChannelId << threshold);
445 
446  NS_LOG_INFO("AC: " << (uint32_t)allocationChannelId
447  << ", average normalized offered load threshold: " << threshold);
448  m_randomAccessAverageNormalizedOfferedLoadThreshold[allocationChannelId] = threshold;
449 }
450 
451 Ptr<SatBeamScheduler>
452 SatNcc::GetBeamScheduler(uint32_t satId, uint32_t beamId) const
453 {
454  NS_LOG_FUNCTION(this << satId << beamId);
455 
456  std::map<std::pair<uint32_t, uint32_t>, Ptr<SatBeamScheduler>>::const_iterator it =
457  m_beamSchedulers.find(std::make_pair(satId, beamId));
458 
459  if (it == m_beamSchedulers.end())
460  {
461  return 0;
462  }
463  else
464  {
465  return it->second;
466  }
467 }
468 
469 void
471  uint32_t srcSatId,
472  uint32_t srcBeamId,
473  uint32_t destSatId,
474  uint32_t destBeamId)
475 {
476  NS_LOG_FUNCTION(this << utId << srcSatId << srcBeamId << destSatId << destBeamId);
477 
478  Ptr<SatBeamScheduler> srcScheduler = GetBeamScheduler(srcSatId, srcBeamId);
479  Ptr<SatBeamScheduler> destScheduler = GetBeamScheduler(destSatId, destBeamId);
480 
481  if (!srcScheduler)
482  {
483  NS_FATAL_ERROR("Source beam not configured");
484  }
485 
486  if (!destScheduler)
487  {
488  NS_FATAL_ERROR("Destination beam not configured");
489  }
490 
491  srcScheduler->TransferUtToBeam(utId, destScheduler);
492  m_updateRoutingCallback(utId, srcScheduler->GetGwAddress(), destScheduler->GetGwAddress());
493 }
494 
495 void
497  uint32_t srcSatId,
498  uint32_t srcBeamId,
499  uint32_t destSatId,
500  uint32_t destBeamId)
501 {
502  NS_LOG_FUNCTION(this << utId << srcSatId << srcBeamId << destSatId << destBeamId);
503 
504  Ptr<SatBeamScheduler> scheduler = GetBeamScheduler(srcSatId, srcBeamId);
505  Ptr<SatBeamScheduler> destination = GetBeamScheduler(destSatId, destBeamId);
506 
507  if (!scheduler)
508  {
509  NS_FATAL_ERROR("Source beam does not exist!");
510  }
511 
512  if (!destination)
513  {
514  NS_LOG_WARN("Destination beam does not exist, cancel handover");
515 
516  Ptr<SatTimuMessage> timuMsg = scheduler->CreateTimu();
517  scheduler->SendTo(timuMsg, utId);
518  }
519  else if (scheduler->HasUt(utId) && !destination->HasUt(utId))
520  {
521  NS_LOG_INFO("Performing handover!");
522 
523  Ptr<SatTimuMessage> timuMsg = destination->CreateTimu();
524  scheduler->SendTo(timuMsg, utId);
525 
526  Simulator::Schedule(m_utHandoverDelay,
528  this,
529  utId,
530  srcSatId,
531  srcBeamId,
532  destSatId,
533  destBeamId);
534  }
535  else if (!scheduler->HasUt(utId) && destination->HasUt(utId))
536  {
537  NS_LOG_INFO("Handover already performed, sending back TIM-U just in case!");
538 
539  Ptr<SatTimuMessage> timuMsg = destination->CreateTimu();
540  scheduler->SendTo(timuMsg, utId);
541  }
542  else
543  {
544  NS_FATAL_ERROR("Inconsistent handover state: UT is neither in source nor destination beam; "
545  "or in both");
546  }
547 }
548 
549 void
551 {
552  NS_LOG_FUNCTION(this << &cb);
553 
555 }
556 
557 void
558 SatNcc::ReserveLogonChannel(uint32_t logonChannelId)
559 {
560  NS_LOG_FUNCTION(this << logonChannelId);
561 
562  for (auto& beamScheduler : m_beamSchedulers)
563  {
564  beamScheduler.second->ReserveLogonChannel(logonChannelId);
565  }
566 }
567 
568 void
569 SatNcc::ReceiveControlBurst(Address utId, uint32_t satId, uint32_t beamId)
570 {
571  NS_LOG_FUNCTION(this << utId << beamId);
572 
573  std::tuple<Address, uint32_t, uint32_t> id = std::make_tuple(utId, satId, beamId);
574 
576  {
577  Simulator::Schedule(m_utTimeout, &SatNcc::CheckTimeout, this, utId, satId, beamId);
578  }
579  m_lastControlBurstReception[id] = Simulator::Now();
580 }
581 
582 void
583 SatNcc::SetUseLogon(bool useLogon)
584 {
585  NS_LOG_FUNCTION(this << useLogon);
586 
587  m_useLogon = useLogon;
588 }
589 
590 void
591 SatNcc::SetUseLora(bool useLora)
592 {
593  NS_LOG_FUNCTION(this << useLora);
594 
595  m_useLora = useLora;
596 
597  for (std::pair<std::pair<uint32_t, uint32_t>, Ptr<SatBeamScheduler>> beamScheduler :
599  {
600  beamScheduler.second->SetUseLora(m_useLora);
601  }
602 }
603 
604 void
605 SatNcc::CheckTimeout(Address utId, uint32_t satId, uint32_t beamId)
606 {
607  NS_LOG_FUNCTION(this << utId);
608 
609  std::tuple<Address, uint32_t, uint32_t> id = std::make_tuple(utId, satId, beamId);
610  NS_ASSERT_MSG(m_lastControlBurstReception.find(id) != m_lastControlBurstReception.end(),
611  "UT address should be in map");
612 
613  Time lastReceptionDate = m_lastControlBurstReception[id];
614  if (Simulator::Now() >= lastReceptionDate + m_utTimeout)
615  {
616  m_lastControlBurstReception.erase(id);
617  RemoveUt(utId, satId, beamId);
618  }
619  else
620  {
621  Simulator::Schedule(lastReceptionDate + m_utTimeout - Simulator::Now(),
623  this,
624  utId,
625  satId,
626  beamId);
627  }
628 }
629 
630 } // namespace ns3
void SetUseLora(bool useLora)
Set if SNS-3 is used with Lora standard.
Callback< void, Address, Address, Address > UpdateRoutingCallback
Update routes and ARP tables on gateways after a terminal handover.
std::map< uint8_t, uint16_t > m_lowLoadBackOffProbability
Map for random access allocation channel specific low load backoff probabilities.
SatBeamScheduler::SendCtrlMsgCallback SendCallback
Define type SendCallback.
static TypeId GetTypeId(void)
Get the type ID.
void ReceiveControlBurst(Address utId, uint32_t satId, uint32_t beamId)
Function to call when a control burst has been received.
void ReserveLogonChannel(uint32_t logonChannelId)
void DoDispose(void)
Callback< void, Ptr< SatTbtpMessage > > SendTbtpCallback
void SetUseLogon(bool useLogon)
Set if logon is used in this simulation.
void AddUt(Ptr< SatLowerLayerServiceConf > llsConf, Address utId, uint32_t satId, uint32_t beamId, Callback< void, uint32_t > setRaChannelCallback, bool verifyExisting=false)
Function for adding the UT.
void RemoveUt(Address utId, uint32_t satId, uint32_t beamId)
Remove a UT.
void SetRandomAccessAverageNormalizedOfferedLoadThreshold(uint8_t allocationChannelId, double threshold)
Function for setting the random access allocation channel specific high load backoff probabilities.
void SetUpdateRoutingCallback(SatNcc::UpdateRoutingCallback cb)
Set the callback used to update routes and APR tables after a terminal handover.
std::map< std::pair< uint32_t, uint32_t >, Ptr< SatBeamScheduler > > m_beamSchedulers
The map containing beams in use (set).
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
std::map< std::tuple< uint32_t, uint32_t, uint8_t >, bool > m_isLowRandomAccessLoad
Map for keeping track of the load status of each random access allocation channel Tuple is (satId,...
SatNcc()
Construct a SatNcc.
void MoveUtBetweenBeams(Address utId, uint32_t srcSatId, uint32_t srcBeamId, uint32_t destSatId, uint32_t destBeamId)
Check if a terminal can be moved between two beams.
void AddBeam(uint32_t satId, uint32_t beamId, Ptr< SatNetDevice > gwNetDevice, Ptr< SatOrbiterNetDevice > orbiterNetDevice, SatNcc::SendCallback cb, SatNcc::SendTbtpCallback tbtpCb, Ptr< SatSuperframeSeq > seq, uint32_t maxFrameSizeInBytes, Address satAddress, Address gwAddress)
Function for adding the beam.
Time m_utTimeout
Timeout to logoff a UT, if logon procedure is used.
void SetRandomAccessLowLoadBackoffProbability(uint8_t allocationChannelId, uint16_t lowLoadBackOffProbability)
Function for setting the random access allocation channel specific high load backoff probabilities.
std::map< uint8_t, uint16_t > m_lowLoadBackOffTime
Map for random access allocation channel specific low load backoff time.
std::map< uint8_t, uint16_t > m_highLoadBackOffProbability
Map for random access allocation channel specific high load backoff probabilities.
void DoMoveUtBetweenBeams(Address utId, uint32_t srcSatId, uint32_t srcBeamId, uint32_t destSatId, uint32_t destBeamId)
Perform terminal handover on the terestrial network.
UpdateRoutingCallback m_updateRoutingCallback
Callback to update routing tables and ARP tables on gateways once a handover request has been accepte...
void UtCrReceived(uint32_t satId, uint32_t beamId, Address utId, Ptr< SatCrMessage > crMsg)
Capacity request receiver.
Ptr< SatBeamScheduler > GetBeamScheduler(uint32_t satId, uint32_t beamId) const
std::map< uint8_t, double > m_randomAccessAverageNormalizedOfferedLoadThreshold
Map for random access allocation channel specific load thresholds.
void DoRandomAccessDynamicLoadControl(uint32_t satId, uint32_t beamId, uint32_t carrierId, uint8_t allocationChannelId, double averageNormalizedOfferedLoad)
Function for adjusting the random access allocation channel specific load.
bool m_useLora
Flag indicating if lora standard is used.
bool m_useLogon
Flag indicating if logon procedure is used.
std::map< std::tuple< Address, uint32_t, uint32_t >, Time > m_lastControlBurstReception
List of reception time for all UTs.
void SetRandomAccessLowLoadBackoffTime(uint8_t allocationChannelId, uint16_t lowLoadBackOffTime)
Function for setting the random access allocation channel specific high load backoff time.
void UtCnoUpdated(uint32_t satId, uint32_t beamId, Address sourceMac, Address gwId, double cno, bool isSatelliteMac)
Update UT specific C/N0 information.
TracedCallback< Ptr< const Packet > > m_nccTxTrace
The trace source fired for TBTPs sent by the NCC.
~SatNcc()
Destroy a SatNcc.
void CreateRandomAccessLoadControlMessage(uint16_t backoffProbability, uint16_t backoffTime, uint32_t satId, uint32_t beamId, uint8_t allocationChannelId)
Function for creating the random access control message.
void CheckTimeout(Address utId, uint32_t satId, uint32_t beamId)
Check if a UT has not been receiving control bursts, and then need to logoff.
Time m_utHandoverDelay
Delay between handover acceptance and effective information transfer.
TracedCallback< Ptr< const Packet > > m_nccRxTrace
The trace source fired for Capacity Requests (CRs) received by the NCC.
std::map< uint8_t, uint16_t > m_highLoadBackOffTime
Map for random access allocation channel specific high load backoff time.
void SetRandomAccessHighLoadBackoffProbability(uint8_t allocationChannelId, uint16_t highLoadBackOffProbability)
Function for setting the random access allocation channel specific high load backoff probabilities.
void SetRandomAccessHighLoadBackoffTime(uint8_t allocationChannelId, uint16_t highLoadBackOffTime)
Function for setting the random access allocation channel specific high load backoff time.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.