Loading...
Searching...
No Matches
satellite-channel.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 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Jani Puttonen <jani.puttonen@magister.fi>
19 */
20
21#include "satellite-channel.h"
22
25#include "satellite-id-mapper.h"
26#include "satellite-mac-tag.h"
27#include "satellite-phy-rx.h"
28#include "satellite-phy-tx.h"
32#include "satellite-utils.h"
33
34#include "ns3/boolean.h"
35#include "ns3/enum.h"
36#include "ns3/log.h"
37#include "ns3/mobility-model.h"
38#include "ns3/net-device.h"
39#include "ns3/node.h"
40#include "ns3/object.h"
41#include "ns3/packet.h"
42#include "ns3/propagation-delay-model.h"
43#include "ns3/simulator.h"
44#include "ns3/singleton.h"
45
46#include <algorithm>
47#include <cstddef>
48#include <utility>
49#include <vector>
50
51NS_LOG_COMPONENT_DEFINE("SatChannel");
52
53namespace ns3
54{
55
56NS_OBJECT_ENSURE_REGISTERED(SatChannel);
57
61 m_channelType(SatEnums::UNKNOWN_CH),
63 m_freqId(),
66 m_rxPowerCalculationMode(SatEnums::RX_PWR_CALCULATION),
67 /*
68 * Currently, the Rx power calculation mode is fully independent of other
69 * possible satellite network configurations, e.g. fading, antenna patterns.
70 * TODO optimization: Tie Rx power calculation mode to other PHY/channel level
71 * configurations. If using input Rx trace, there is no need to enable e.g. Markov
72 * fading, nor antenna patterns.
73 */
78{
79 NS_LOG_FUNCTION(this);
80}
81
82void
84{
85 NS_LOG_FUNCTION(this);
86
87 Channel::NotifyConstructionCompleted();
88
90 {
92 CreateObject<SatFadingExternalInputTraceContainer>();
93 }
94}
95
97{
98 NS_LOG_FUNCTION(this);
99}
100
101void
103{
104 NS_LOG_FUNCTION(this);
105 m_phyRxContainer.clear();
107 Channel::DoDispose();
108}
109
110TypeId
112{
113 static TypeId tid =
114 TypeId("ns3::SatChannel")
115 .SetParent<Channel>()
116 .AddConstructor<SatChannel>()
117 .AddAttribute("EnableRxPowerOutputTrace",
118 "Enable Rx power output trace.",
119 BooleanValue(false),
120 MakeBooleanAccessor(&SatChannel::m_enableRxPowerOutputTrace),
121 MakeBooleanChecker())
122 .AddAttribute("EnableFadingOutputTrace",
123 "Enable fading output trace.",
124 BooleanValue(false),
125 MakeBooleanAccessor(&SatChannel::m_enableFadingOutputTrace),
126 MakeBooleanChecker())
127 .AddAttribute("EnableExternalFadingInputTrace",
128 "Enable external fading input trace.",
129 BooleanValue(false),
131 MakeBooleanChecker())
132 .AddAttribute("RxPowerCalculationMode",
133 "Rx Power calculation mode",
135 MakeEnumAccessor<SatEnums::RxPowerCalculationMode_t>(
137 MakeEnumChecker(SatEnums::RX_PWR_CALCULATION,
138 "RxPowerCalculation",
140 "RxPowerInputTrace",
142 "RxCnoInputTrace"))
143 .AddAttribute("ForwardingMode",
144 "Channel forwarding mode.",
145 EnumValue(SatChannel::ALL_BEAMS),
146 MakeEnumAccessor<SatChannel::SatChannelFwdMode_e>(&SatChannel::m_fwdMode),
147 MakeEnumChecker(SatChannel::ONLY_DEST_NODE,
148 "OnlyDestNode",
150 "OnlyDestBeam",
152 "AllBeams"));
153 return tid;
154}
155
156void
157SatChannel::AddRx(Ptr<SatPhyRx> phyRx)
158{
159 NS_LOG_FUNCTION(this << phyRx);
160
161 m_phyRxContainer.push_back(phyRx);
162}
163
164void
165SatChannel::RemoveRx(Ptr<SatPhyRx> phyRx)
166{
167 NS_LOG_FUNCTION(this << phyRx);
168
169 PhyRxContainer::iterator phyIter =
170 std::find(m_phyRxContainer.begin(), m_phyRxContainer.end(), phyRx);
171
172 if (phyIter != m_phyRxContainer.end()) // == vector.end() means the element was not found
173 {
174 m_phyRxContainer.erase(phyIter);
175 }
176}
177
178void
179SatChannel::StartTx(Ptr<SatSignalParameters> txParams)
180{
181 NS_LOG_FUNCTION(this << txParams);
182 NS_ASSERT_MSG(txParams->m_phyTx, "NULL phyTx");
183
184 switch (m_fwdMode)
185 {
193 // For all receivers
194 for (PhyRxContainer::const_iterator rxPhyIterator = m_phyRxContainer.begin();
195 rxPhyIterator != m_phyRxContainer.end();
196 ++rxPhyIterator)
197 {
198 // If the same beam
199 if ((*rxPhyIterator)->GetBeamId() == txParams->m_beamId)
200 {
201 switch (m_channelType)
202 {
203 // If the destination is satellite
206 // The packet burst is passed on to the satellite receiver
207 ScheduleRx(txParams, *rxPhyIterator);
208 break;
209 }
210 // If the destination is terrestrial node
213 // Go through the packets and check their destination address by peeking the MAC
214 // tag
215 SatSignalParameters::PacketsInBurst_t::const_iterator it =
216 txParams->m_packetsInBurst.begin();
217 for (; it != txParams->m_packetsInBurst.end(); ++it)
218 {
219 SatMacTag macTag;
220 bool mSuccess = (*it)->PeekPacketTag(macTag);
221 if (!mSuccess)
222 {
223 NS_FATAL_ERROR("MAC tag was not found from the packet!");
224 }
225
226 Mac48Address dest = macTag.GetDestAddress();
227
228 // If the packet destination is the same as the receiver MAC
229 if (dest == (*rxPhyIterator)->GetAddress() || dest.IsBroadcast() ||
230 dest.IsGroup())
231 {
232 ScheduleRx(txParams, *rxPhyIterator);
233
234 // Remember to break the packet loop, so that the transmission
235 // is not received several times!
236 break;
237 }
238 }
239 break;
240 }
241 default: {
242 NS_FATAL_ERROR("Unsupported channel type!");
243 break;
244 }
245 }
246 }
247 }
248 break;
249 }
256 for (PhyRxContainer::const_iterator rxPhyIterator = m_phyRxContainer.begin();
257 rxPhyIterator != m_phyRxContainer.end();
258 ++rxPhyIterator)
259 {
260 // If the same beam
261 if ((*rxPhyIterator)->GetBeamId() == txParams->m_beamId)
262 {
263 ScheduleRx(txParams, *rxPhyIterator);
264 }
265 }
266 break;
267 }
275 for (PhyRxContainer::const_iterator rxPhyIterator = m_phyRxContainer.begin();
276 rxPhyIterator != m_phyRxContainer.end();
277 ++rxPhyIterator)
278 {
279 ScheduleRx(txParams, *rxPhyIterator);
280 }
281 break;
282 }
283 default: {
284 NS_FATAL_ERROR("Unsupported SatChannel FwdMode!");
285 break;
286 }
287 }
288}
289
290void
291SatChannel::ScheduleRx(Ptr<SatSignalParameters> txParams, Ptr<SatPhyRx> receiver)
292{
293 NS_LOG_FUNCTION(this << txParams << receiver);
294
295 Time delay = Seconds(0);
296
297 Ptr<MobilityModel> senderMobility = txParams->m_phyTx->GetMobility();
298 Ptr<MobilityModel> receiverMobility = receiver->GetMobility();
299
300 NS_LOG_INFO("copying signal parameters " << txParams);
301 Ptr<SatSignalParameters> rxParams = txParams->Copy();
302
304 {
310 delay = m_propagationDelay->GetDelay(senderMobility, receiverMobility);
311 }
312 else
313 {
318 NS_FATAL_ERROR("SatChannel::ScheduleRx - propagation delay model not set!");
319 }
320
321 NS_LOG_INFO("Setting propagation delay: " << delay);
322
323 Ptr<NetDevice> netDev = receiver->GetDevice();
324 uint32_t dstNodeId = netDev->GetNode()->GetId();
325 Simulator::ScheduleWithContext(dstNodeId,
326 delay,
328 this,
329 rxParams,
330 receiver);
331}
332
333void
334SatChannel::StartRx(Ptr<SatSignalParameters> rxParams, Ptr<SatPhyRx> phyRx)
335{
336 NS_LOG_FUNCTION(this << rxParams << phyRx);
337
338 rxParams->m_channelType = m_channelType;
339
340 double frequency_hz = m_carrierFreqConverter(m_channelType, m_freqId, rxParams->m_carrierId);
341 rxParams->m_carrierFreq_hz = frequency_hz;
342
344 {
346 DoRxPowerCalculation(rxParams, phyRx);
347
349 {
350 DoRxPowerOutputTrace(rxParams, phyRx);
351 }
352 break;
353 }
355 DoRxPowerInputTrace(rxParams, phyRx);
356 break;
357 }
359 DoRxCnoInputTrace(rxParams, phyRx);
360 break;
361 }
362 default: {
363 NS_FATAL_ERROR("SatChannel::StartRx - Invalid Rx power calculation mode");
364 break;
365 }
366 }
367
368 phyRx->StartRx(rxParams);
369}
370
371void
372SatChannel::DoRxPowerOutputTrace(Ptr<SatSignalParameters> rxParams, Ptr<SatPhyRx> phyRx)
373{
374 NS_LOG_FUNCTION(this << rxParams << phyRx);
375
376 // Get the bandwidth of the currently used carrier
377 double carrierBandwidthHz = m_carrierBandwidthConverter(m_channelType,
378 rxParams->m_carrierId,
380
381 NS_LOG_INFO("Carrier bw: " << carrierBandwidthHz
382 << ", rxPower: " << SatUtils::LinearToDb(rxParams->m_rxPower_W)
383 << ", carrierId: " << rxParams->m_carrierId
384 << ", channelType: " << SatEnums::GetChannelTypeName(m_channelType));
385
386 std::vector<double> tempVector;
387 tempVector.push_back(Now().GetSeconds());
388
389 // Output the Rx power density (W / Hz)
390 tempVector.push_back(rxParams->m_rxPower_W / carrierBandwidthHz);
391
392 switch (m_channelType)
393 {
396 Singleton<SatRxPowerOutputTraceContainer>::Get()->AddToContainer(
397 std::make_pair(phyRx->GetDevice()->GetAddress(), m_channelType),
398 tempVector);
399 break;
400 }
403 Singleton<SatRxPowerOutputTraceContainer>::Get()->AddToContainer(
404 std::make_pair(GetSourceAddress(rxParams), m_channelType),
405 tempVector);
406 break;
407 }
408 default: {
409 NS_FATAL_ERROR("SatChannel::DoRxPowerOutputTrace - Invalid channel type");
410 break;
411 }
412 }
413}
414
415void
416SatChannel::DoRxPowerInputTrace(Ptr<SatSignalParameters> rxParams, Ptr<SatPhyRx> phyRx)
417{
418 NS_LOG_FUNCTION(this << rxParams << phyRx);
419
420 // Get the bandwidth of the currently used carrier
421 double carrierBandwidthHz = m_carrierBandwidthConverter(m_channelType,
422 rxParams->m_carrierId,
424
425 switch (m_channelType)
426 {
429 // Calculate the Rx power from Rx power density
430 rxParams->m_rxPower_W =
431 carrierBandwidthHz *
432 Singleton<SatRxPowerInputTraceContainer>::Get()->GetRxPowerDensity(
433 std::make_pair(phyRx->GetDevice()->GetAddress(), m_channelType));
434
435 break;
436 }
439 // Calculate the Rx power from Rx power density
440 rxParams->m_rxPower_W =
441 carrierBandwidthHz * Singleton<SatRxPowerInputTraceContainer>::Get()->GetRxPowerDensity(
442 std::make_pair(GetSourceAddress(rxParams), m_channelType));
443 break;
444 }
445 default: {
446 NS_FATAL_ERROR("SatChannel::DoRxPowerInputTrace - Invalid channel type");
447 break;
448 }
449 }
450
451 NS_LOG_INFO("Carrier bw: " << carrierBandwidthHz
452 << ", rxPower: " << SatUtils::LinearToDb(rxParams->m_rxPower_W)
453 << ", carrierId: " << rxParams->m_carrierId
454 << ", channelType: " << SatEnums::GetChannelTypeName(m_channelType));
455
456 // get external fading input trace
458 {
459 rxParams->m_rxPower_W /= GetExternalFadingTrace(rxParams, phyRx);
460 }
461}
462
463void
464SatChannel::DoRxCnoInputTrace(Ptr<SatSignalParameters> rxParams, Ptr<SatPhyRx> phyRx)
465{
466 NS_LOG_FUNCTION(this << rxParams << phyRx);
467
468 /* Get the required parameters
469 *
470 * We have C/N0 = B*P/N
471 * So P = N/B * C/N0
472 * Where:
473 * B is the carrier bandwidth
474 * N is the noise
475 * P is the required power to get the selected C/N0
476 */
477 double cno;
478 double carrierBandwidthHz = m_carrierBandwidthConverter(m_channelType,
479 rxParams->m_carrierId,
481 double rxTemperatureK = phyRx->GetRxTemperatureK(rxParams);
482 ;
483 double rxNoisePowerW =
484 SatConstVariables::BOLTZMANN_CONSTANT * rxTemperatureK * carrierBandwidthHz;
485
486 switch (m_channelType)
487 {
490 // Calculate the Rx power from C/N0
491 cno = Singleton<SatRxCnoInputTraceContainer>::Get()->GetRxCno(
492 std::make_pair(phyRx->GetDevice()->GetAddress(), m_channelType));
493 if (cno == 0)
494 {
495 DoRxPowerCalculation(rxParams, phyRx);
496 NS_LOG_INFO("Use calculation downlink \t" << cno << " " << carrierBandwidthHz << " "
497 << rxNoisePowerW << " "
498 << rxParams->m_rxPower_W);
499 return;
500 }
501 rxParams->m_rxPower_W = rxNoisePowerW * cno / carrierBandwidthHz;
502 NS_LOG_INFO("Channel downlink \t" << cno << " " << carrierBandwidthHz << " "
503 << rxNoisePowerW << " "
504 << rxNoisePowerW * cno / carrierBandwidthHz);
505 break;
506 }
509 // Calculate the Rx power from C/N0
510 cno = Singleton<SatRxCnoInputTraceContainer>::Get()->GetRxCno(
511 std::make_pair(GetSourceAddress(rxParams), m_channelType));
512 if (cno == 0)
513 {
514 DoRxPowerCalculation(rxParams, phyRx);
515 NS_LOG_INFO("Use calculation uplink \t" << cno << " " << carrierBandwidthHz << " "
516 << rxNoisePowerW << " "
517 << rxParams->m_rxPower_W);
518 return;
519 }
520 rxParams->m_rxPower_W = rxNoisePowerW * cno / carrierBandwidthHz;
521 NS_LOG_INFO("Channel uplink \t" << cno << " " << carrierBandwidthHz << " "
522 << rxNoisePowerW << " "
523 << rxNoisePowerW * cno / carrierBandwidthHz);
524 break;
525 }
526 default: {
527 NS_FATAL_ERROR("SatChannel::DoRxCnoInputTrace - Invalid channel type");
528 break;
529 }
530 }
531
532 NS_LOG_INFO("Target C/N0: " << cno << ", carrier bw: " << carrierBandwidthHz
533 << ", rxPower: " << SatUtils::LinearToDb(rxParams->m_rxPower_W)
534 << ", carrierId: " << rxParams->m_carrierId << ", channelType: "
536
537 // get external fading input trace
539 {
540 rxParams->m_rxPower_W /= GetExternalFadingTrace(rxParams, phyRx);
541 }
542}
543
544void
545SatChannel::DoFadingOutputTrace(Ptr<SatSignalParameters> rxParams,
546 Ptr<SatPhyRx> phyRx,
547 double fadingValue)
548{
549 NS_LOG_FUNCTION(this << rxParams << phyRx << fadingValue);
550
551 std::vector<double> tempVector;
552 tempVector.push_back(Now().GetSeconds());
553 tempVector.push_back(fadingValue);
554
555 switch (m_channelType)
556 {
559 Singleton<SatFadingOutputTraceContainer>::Get()->AddToContainer(
560 std::make_pair(phyRx->GetDevice()->GetAddress(), m_channelType),
561 tempVector);
562 break;
563 }
566 Singleton<SatFadingOutputTraceContainer>::Get()->AddToContainer(
567 std::make_pair(GetSourceAddress(rxParams), m_channelType),
568 tempVector);
569 break;
570 }
571 default: {
572 NS_FATAL_ERROR("SatChannel::DoFadingOutputTrace - Invalid channel type");
573 break;
574 }
575 }
576}
577
578void
579SatChannel::DoRxPowerCalculation(Ptr<SatSignalParameters> rxParams, Ptr<SatPhyRx> phyRx)
580{
581 NS_LOG_FUNCTION(this << rxParams << phyRx);
582
583 Ptr<MobilityModel> txMobility = rxParams->m_phyTx->GetMobility();
584 Ptr<MobilityModel> rxMobility = phyRx->GetMobility();
585
586 double txAntennaGain_W = 0.0;
587 double rxAntennaGain_W = 0.0;
588 double markovFading = 0.0;
589 double extFading = 1.0;
590
591 // use always UT's or GW's position when getting antenna gain
592 switch (m_channelType)
593 {
596 txAntennaGain_W = rxParams->m_phyTx->GetAntennaGain(rxMobility);
597 rxAntennaGain_W = phyRx->GetAntennaGain(rxMobility);
598 markovFading = phyRx->GetFadingValue(phyRx->GetDevice()->GetAddress(), m_channelType);
599 break;
600 }
603 txAntennaGain_W = rxParams->m_phyTx->GetAntennaGain(txMobility);
604 rxAntennaGain_W = phyRx->GetAntennaGain(txMobility);
605 markovFading = rxParams->m_phyTx->GetFadingValue(GetSourceAddress(rxParams), m_channelType);
606 break;
607 }
608 default: {
609 NS_FATAL_ERROR("SatChannel::DoRxPowerCalculation - Invalid channel type");
610 break;
611 }
612 }
613
621 {
622 extFading = GetExternalFadingTrace(rxParams, phyRx);
623 }
624
631 {
632 DoFadingOutputTrace(rxParams, phyRx, markovFading);
633 }
634
635 // get (calculate) free space loss and RX power and set it to RX params
636 double rxPower_W = (rxParams->m_txPower_W * txAntennaGain_W) /
637 m_freeSpaceLoss->GetFsl(txMobility, rxMobility, rxParams->m_carrierFreq_hz);
638 rxParams->m_rxPower_W =
639 rxPower_W * rxAntennaGain_W / phyRx->GetLosses() * markovFading / extFading;
640}
641
642double
643SatChannel::GetExternalFadingTrace(Ptr<SatSignalParameters> rxParams, Ptr<SatPhyRx> phyRx)
644{
645 NS_LOG_FUNCTION(this << rxParams << phyRx);
646
647 int32_t nodeId;
648 Ptr<MobilityModel> mobility;
649
650 switch (m_channelType)
651 {
653 nodeId = Singleton<SatIdMapper>::Get()->GetGwIdWithMac(phyRx->GetDevice()->GetAddress());
654 mobility = phyRx->GetMobility();
655 break;
656 }
658 nodeId = Singleton<SatIdMapper>::Get()->GetUtIdWithMac(phyRx->GetDevice()->GetAddress());
659 mobility = phyRx->GetMobility();
660 break;
661 }
663 nodeId = Singleton<SatIdMapper>::Get()->GetUtIdWithMac(GetSourceAddress(rxParams));
664 mobility = rxParams->m_phyTx->GetMobility();
665 break;
666 }
668 nodeId = Singleton<SatIdMapper>::Get()->GetGwIdWithMac(GetSourceAddress(rxParams));
669 mobility = rxParams->m_phyTx->GetMobility();
670 break;
671 }
672 default: {
673 NS_FATAL_ERROR("SatChannel::GetExternalFadingTrace - Invalid channel type");
674 break;
675 }
676 }
677
678 if (nodeId < 0)
679 {
680 NS_FATAL_ERROR("SatChannel::GetExternalFadingTrace - Invalid node ID");
681 }
682
683 return (m_satFadingExternalInputTraceContainer->GetFadingTrace((uint32_t)nodeId,
685 mobility))
686 ->GetFading();
687}
688
690Mac48Address
691SatChannel::GetSourceAddress(Ptr<SatSignalParameters> rxParams)
692{
693 NS_LOG_FUNCTION(this << rxParams);
694
695 SatMacTag tag;
696
697 SatSignalParameters::PacketsInBurst_t::const_iterator i = rxParams->m_packetsInBurst.begin();
698
699 if (*i == nullptr)
700 {
701 NS_FATAL_ERROR("SatChannel::GetSourceAddress - Empty packet list");
702 }
703
704 (*i)->PeekPacketTag(tag);
705
706 return tag.GetSourceAddress();
707}
708
709void
711{
712 NS_LOG_FUNCTION(this << chType);
713 NS_ASSERT(chType != SatEnums::UNKNOWN_CH);
714
715 m_channelType = chType;
716}
717
718void
720{
721 NS_LOG_FUNCTION(this << freqId);
722
723 m_freqId = freqId;
724}
725
726void
728{
729 NS_LOG_FUNCTION(this << &converter);
730
731 m_carrierFreqConverter = converter;
732}
733
734void
736{
737 NS_LOG_FUNCTION(this << &converter);
738
739 m_carrierBandwidthConverter = converter;
740}
741
744{
745 NS_LOG_FUNCTION(this);
747
748 return m_channelType;
749}
750
751void
752SatChannel::SetPropagationDelayModel(Ptr<PropagationDelayModel> delay)
753{
754 NS_LOG_FUNCTION(this << delay);
755 NS_ASSERT(m_propagationDelay == nullptr);
756 m_propagationDelay = delay;
757}
758
759Ptr<PropagationDelayModel>
761{
762 NS_LOG_FUNCTION(this);
763 NS_ASSERT(m_propagationDelay != nullptr);
764
765 return m_propagationDelay;
766}
767
768void
769SatChannel::SetFreeSpaceLoss(Ptr<SatFreeSpaceLoss> loss)
770{
771 NS_LOG_FUNCTION(this << loss);
772 NS_ASSERT(m_freeSpaceLoss == nullptr);
773 m_freeSpaceLoss = loss;
774}
775
776Ptr<SatFreeSpaceLoss>
778{
779 NS_LOG_FUNCTION(this);
780 NS_ASSERT(m_freeSpaceLoss != nullptr);
781 return m_freeSpaceLoss;
782}
783
784std::size_t
786{
787 NS_LOG_FUNCTION(this);
788 return m_phyRxContainer.size();
789}
790
791Ptr<NetDevice>
792SatChannel::GetDevice(std::size_t i) const
793{
794 NS_LOG_FUNCTION(this << i);
795 return m_phyRxContainer.at(i)->GetDevice()->GetObject<NetDevice>();
796}
797
798} // namespace ns3
Satellite channel implementation.
Ptr< SatFadingExternalInputTraceContainer > m_satFadingExternalInputTraceContainer
External fading input tracing container.
void DoRxPowerOutputTrace(Ptr< SatSignalParameters > rxParams, Ptr< SatPhyRx > phyRx)
Function for Rx power output trace.
void DoRxCnoInputTrace(Ptr< SatSignalParameters > rxParams, Ptr< SatPhyRx > phyRx)
Function for Rx power input trace from C/N0 values.
SatChannelFwdMode_e m_fwdMode
Forwarding mode of the SatChannel: SINGLE_RX = only the proper receiver of the packet shall receive t...
virtual Ptr< PropagationDelayModel > GetPropagationDelayModel()
Get the propagation delay model to be used in the SatChannel.
virtual void DoDispose()
Dispose SatChannel.
Callback< double, SatEnums::ChannelType_t, uint32_t, uint32_t > CarrierFreqConverter
Ptr< SatFreeSpaceLoss > m_freeSpaceLoss
Free space loss model to be used with this channel.
bool m_enableFadingOutputTrace
Defines whether fading output tracing is in use or not.
SatChannel()
Default constructor.
double GetExternalFadingTrace(Ptr< SatSignalParameters > rxParams, Ptr< SatPhyRx > phyRx)
Function for getting the external source fading value.
void DoRxPowerCalculation(Ptr< SatSignalParameters > rxParams, Ptr< SatPhyRx > phyRx)
Function for calculating the Rx power.
virtual void NotifyConstructionCompleted() override
Notifier called once the ObjectBase is fully constructed.
static TypeId GetTypeId(void)
Get the type ID.
virtual void SetFrequencyId(uint32_t freqId)
Set the frequency id of the channel.
void DoRxPowerInputTrace(Ptr< SatSignalParameters > rxParams, Ptr< SatPhyRx > phyRx)
Function for Rx power input trace.
SatTypedefs::CarrierBandwidthConverter_t m_carrierBandwidthConverter
Bandwidth converter callback.
virtual void SetChannelType(SatEnums::ChannelType_t chType)
Set the type of the channel.
bool m_enableRxPowerOutputTrace
Defines whether Rx power output tracing is in use or not.
uint32_t m_freqId
Frequency id of the channel.
virtual void SetPropagationDelayModel(Ptr< PropagationDelayModel > delay)
Set the propagation delay model to be used in the SatChannel.
virtual void RemoveRx(Ptr< SatPhyRx > phyRx)
This method is used to remove a SatPhyRx instance from a SatChannel instance, e.g.
Mac48Address GetSourceAddress(Ptr< SatSignalParameters > rxParams)
Function for getting the source MAC address from Rx parameters.
void DoFadingOutputTrace(Ptr< SatSignalParameters > rxParams, Ptr< SatPhyRx > phyRx, double fadingValue)
Function for fading output trace.
virtual Ptr< NetDevice > GetDevice(std::size_t i) const
Get a device for a certain receiver index.
virtual void SetBandwidthConverter(SatTypedefs::CarrierBandwidthConverter_t converter)
Set the bandwidth converter callback.
virtual SatEnums::ChannelType_t GetChannelType()
Get the type of the channel.
PhyRxContainer m_phyRxContainer
Container of SatPhyRx instances attached to the channel.
void ScheduleRx(Ptr< SatSignalParameters > txParams, Ptr< SatPhyRx > phyRx)
Used internally to schedule the StartRx method call after the propagation delay.
void StartRx(Ptr< SatSignalParameters > rxParams, Ptr< SatPhyRx > phyRx)
Used internally to start the packet reception of at the phyRx.
virtual void StartTx(Ptr< SatSignalParameters > params)
Used by attached SatPhyTx instances to transmit signals to the channel.
virtual ~SatChannel()
Destructor for SatChannel.
virtual void SetFreeSpaceLoss(Ptr< SatFreeSpaceLoss > delay)
Set the propagation delay model to be used in the SatChannel.
CarrierFreqConverter m_carrierFreqConverter
Frequency converter callback.
SatEnums::ChannelType_t m_channelType
Type of the channel.
virtual void AddRx(Ptr< SatPhyRx > phyRx)
This method is used to attach the receiver entity SatPhyRx instance to a SatChannel instance,...
Ptr< PropagationDelayModel > m_propagationDelay
Propagation delay model to be used with this channel.
virtual void SetFrequencyConverter(CarrierFreqConverter converter)
Set the frequency converter callback.
bool m_enableExternalFadingInputTrace
Defines whether external fading input tracing is in use or not.
virtual std::size_t GetNDevices(void) const
virtual Ptr< SatFreeSpaceLoss > GetFreeSpaceLoss() const
Get the propagation delay model used in the SatChannel.
SatEnums::RxPowerCalculationMode_t m_rxPowerCalculationMode
Defines the mode used for Rx power calculation.
SatEnums class is for simplifying the use of enumerators in the satellite module.
ChannelType_t
Types of channel.
static std::string GetChannelTypeName(ChannelType_t channelType)
This class implements a tag that carries the satellite MAC specific information, such as source and d...
Mac48Address GetSourceAddress(void) const
Get source MAC address.
Mac48Address GetDestAddress(void) const
Get destination MAC address.
Callback< double, SatEnums::ChannelType_t, uint32_t, SatEnums::CarrierBandwidthType_t > CarrierBandwidthConverter_t
Callback for carrier bandwidths.
static T LinearToDb(T linear)
Converts linear to decibels.
constexpr double BOLTZMANN_CONSTANT
Boltzmann Constant.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.