satellite-phy.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-phy.h"
22 
23 #include "satellite-address-tag.h"
24 #include "satellite-channel.h"
25 #include "satellite-enums.h"
26 #include "satellite-lora-phy-rx.h"
27 #include "satellite-mac-tag.h"
28 #include "satellite-mac.h"
29 #include "satellite-node-info.h"
30 #include "satellite-phy-rx.h"
31 #include "satellite-phy-tx.h"
33 #include "satellite-time-tag.h"
34 #include "satellite-typedefs.h"
35 #include "satellite-utils.h"
36 
37 #include <ns3/boolean.h>
38 #include <ns3/double.h>
39 #include <ns3/log.h>
40 #include <ns3/node.h>
41 #include <ns3/pointer.h>
42 #include <ns3/simulator.h>
43 #include <ns3/uinteger.h>
44 
45 NS_LOG_COMPONENT_DEFINE("SatPhy");
46 
47 namespace ns3
48 {
49 
50 NS_OBJECT_ENSURE_REGISTERED(SatPhy);
51 
53  : m_satId(0),
54  m_beamId(0),
55  m_eirpWoGainW(0),
56  m_isStatisticsTagsEnabled(false),
57  m_lastDelay(0),
58  m_lastLinkDelay(0),
59  m_rxNoiseTemperatureDbk(0),
60  m_rxMaxAntennaGainDb(0),
61  m_rxAntennaLossDb(0),
62  m_txMaxAntennaGainDb(0),
63  m_txMaxPowerDbw(0),
64  m_txOutputLossDb(0),
65  m_txPointingLossDb(0),
66  m_txOboLossDb(0),
67  m_txAntennaLossDb(0),
68  m_defaultFadingValue(1.0)
69 {
70  NS_LOG_FUNCTION(this);
71  NS_FATAL_ERROR("SatPhy default constructor is not allowed to use");
72 }
73 
75  : m_satId(0),
76  m_beamId(0),
77  m_eirpWoGainW(0),
78  m_isStatisticsTagsEnabled(false),
79  m_lastDelay(0),
80  m_lastLinkDelay(0),
81  m_rxNoiseTemperatureDbk(0),
82  m_rxMaxAntennaGainDb(0),
83  m_rxAntennaLossDb(0),
84  m_txMaxAntennaGainDb(0),
85  m_txMaxPowerDbw(0),
86  m_txOutputLossDb(0),
87  m_txPointingLossDb(0),
88  m_txOboLossDb(0),
89  m_txAntennaLossDb(0),
90  m_defaultFadingValue(1.0)
91 {
92  NS_LOG_FUNCTION(this << params.m_satId << params.m_beamId);
93  ObjectBase::ConstructSelf(AttributeConstructionList());
94 
95  Ptr<MobilityModel> mobility = params.m_device->GetNode()->GetObject<MobilityModel>();
96 
97  switch (params.m_standard)
98  {
100  case SatEnums::DVB_UT:
101  case SatEnums::DVB_GW: {
102  m_phyTx = CreateObject<SatPhyTx>();
103  m_phyRx = CreateObject<SatPhyRx>();
104  break;
105  }
106  case SatEnums::LORA_ORBITER: {
107  m_phyTx = CreateObject<SatLoraPhyTx>();
108  m_phyRx = CreateObject<SatPhyRx>();
109  break;
110  }
111  case SatEnums::LORA_UT: {
112  m_phyTx = CreateObject<SatLoraPhyTx>();
113  m_phyRx = CreateObject<SatLoraPhyRx>();
114  break;
115  }
116  case SatEnums::LORA_GW: {
117  m_phyTx = CreateObject<SatLoraPhyTx>();
118  m_phyRx = CreateObject<SatPhyRx>();
119  break;
120  }
121  default:
122  NS_FATAL_ERROR("Standard not implemented yet: " << params.m_standard);
123  }
124 
125  m_phyTx->SetChannel(params.m_txCh);
126  m_satId = params.m_satId;
127  m_beamId = params.m_beamId;
128 
129  params.m_rxCh->AddRx(m_phyRx);
130  m_phyRx->SetDevice(params.m_device);
131  m_phyTx->SetMobility(mobility);
132  m_phyRx->SetMobility(mobility);
133 }
134 
135 TypeId
137 {
138  static TypeId tid =
139  TypeId("ns3::SatPhy")
140  .SetParent<Object>()
141  .AddAttribute("ReceiveCb",
142  "The receive callback for this phy.",
143  CallbackValue(),
144  MakeCallbackAccessor(&SatPhy::m_rxCallback),
145  MakeCallbackChecker())
146  .AddAttribute("CnoCb",
147  "The C/N0 info callback for this phy.",
148  CallbackValue(),
149  MakeCallbackAccessor(&SatPhy::m_cnoCallback),
150  MakeCallbackChecker())
151  .AddAttribute("AverageNormalizedOfferedLoadCallback",
152  "The average offered random access load callback for this phy.",
153  CallbackValue(),
154  MakeCallbackAccessor(&SatPhy::m_avgNormalizedOfferedLoadCallback),
155  MakeCallbackChecker())
156  .AddAttribute("EnableStatisticsTags",
157  "If true, some tags will be added to each transmitted packet to assist "
158  "with statistics computation",
159  BooleanValue(false),
160  MakeBooleanAccessor(&SatPhy::m_isStatisticsTagsEnabled),
161  MakeBooleanChecker())
162  .AddTraceSource("PacketTrace",
163  "Packet event trace",
164  MakeTraceSourceAccessor(&SatPhy::m_packetTrace),
165  "ns3::SatTypedefs::PacketTraceCallback")
166  .AddTraceSource("Rx",
167  "A packet received",
168  MakeTraceSourceAccessor(&SatPhy::m_rxTrace),
169  "ns3::SatTypedefs::PacketSourceAddressCallback")
170  .AddTraceSource("RxDelay",
171  "A packet is received with delay information",
172  MakeTraceSourceAccessor(&SatPhy::m_rxDelayTrace),
173  "ns3::SatTypedefs::PacketDelayAddressCallback")
174  .AddTraceSource("RxLinkDelay",
175  "A packet is received with link delay information",
176  MakeTraceSourceAccessor(&SatPhy::m_rxLinkDelayTrace),
177  "ns3::SatTypedefs::PacketDelayAddressCallback")
178  .AddTraceSource("RxJitter",
179  "A packet is received with jitter information",
180  MakeTraceSourceAccessor(&SatPhy::m_rxJitterTrace),
181  "ns3::SatTypedefs::PacketJitterAddressCallback")
182  .AddTraceSource("RxLinkJitter",
183  "A packet is received with link jitter information",
184  MakeTraceSourceAccessor(&SatPhy::m_rxLinkJitterTrace),
185  "ns3::SatTypedefs::PacketJitterAddressCallback")
186  .AddTraceSource("RxLinkModcod",
187  "A packet is received with link MODCOD information",
188  MakeTraceSourceAccessor(&SatPhy::m_rxLinkModcodTrace),
189  "ns3::SatTypedefs::PacketModcodAddressCallback");
190  return tid;
191 }
192 
193 TypeId
195 {
196  NS_LOG_FUNCTION(this);
197  return GetTypeId();
198 }
199 
200 void
202 {
203  NS_LOG_FUNCTION(this);
204  Object::DoInitialize();
205 }
206 
207 void
209 {
210  NS_LOG_FUNCTION(this);
211 
212  // calculate EIRP without Gain (maximum)
213  double eirpWoGainDbw =
215 
216  m_eirpWoGainW = SatUtils::DbWToW(eirpWoGainDbw);
217 
218  m_phyTx->SetSatId(m_satId);
219  m_phyRx->SetSatId(m_satId);
220 
221  m_phyTx->SetBeamId(m_beamId);
222  m_phyRx->SetBeamId(m_beamId);
223 
224  m_phyRx->SetReceiveCallback(MakeCallback(&SatPhy::Receive, this));
225 
226  if (m_cnoCallback.IsNull() == false)
227  {
228  m_phyRx->SetCnoCallback(MakeCallback(&SatPhy::CnoInfo, this));
229  }
230 
231  if (m_avgNormalizedOfferedLoadCallback.IsNull() == false)
232  {
233  m_phyRx->SetAverageNormalizedOfferedLoadCallback(
235  }
236 
237  m_phyTx->SetMaxAntennaGain_Db(m_txMaxAntennaGainDb);
238  m_phyRx->SetMaxAntennaGain_Db(m_rxMaxAntennaGainDb);
239 
240  m_phyTx->SetDefaultFadingValue(m_defaultFadingValue);
241  m_phyRx->SetDefaultFadingValue(m_defaultFadingValue);
242 
243  m_phyRx->SetAntennaLoss_Db(m_rxAntennaLossDb);
244 }
245 
247 {
248  NS_LOG_FUNCTION(this);
249 }
250 
251 void
253 {
254  NS_LOG_FUNCTION(this);
255  m_phyTx->DoDispose();
256  m_phyTx = 0;
257  m_phyRx->DoDispose();
258  m_phyRx = 0;
259 
260  Object::DoDispose();
261 }
262 
263 double
264 SatPhy::CalculateSinr(double sinr, double otherInterference)
265 {
266  NS_LOG_FUNCTION(this << sinr << otherInterference);
267 
268  if (sinr <= 0)
269  {
270  NS_FATAL_ERROR("Calculated own SINR is expected to be greater than zero!!!");
271  }
272 
273  if (otherInterference <= 0)
274  {
275  NS_FATAL_ERROR("Interference is expected to be greater than zero!!!");
276  }
277 
278  double finalSinr = 1 / ((1 / sinr) + (1 / otherInterference));
279 
280  return finalSinr;
281 }
282 
283 void
284 SatPhy::SetTxAntennaGainPattern(Ptr<SatAntennaGainPattern> agp,
285  Ptr<SatMobilityModel> satelliteMobility)
286 {
287  NS_LOG_FUNCTION(this);
288  m_phyTx->SetAntennaGainPattern(agp, satelliteMobility);
289 }
290 
291 void
292 SatPhy::SetRxAntennaGainPattern(Ptr<SatAntennaGainPattern> agp,
293  Ptr<SatMobilityModel> satelliteMobility)
294 {
295  NS_LOG_FUNCTION(this);
296  m_phyRx->SetAntennaGainPattern(agp, satelliteMobility);
297 }
298 
299 void
300 SatPhy::ConfigureRxCarriers(Ptr<SatPhyRxCarrierConf> carrierConf,
301  Ptr<SatSuperframeConf> superFrameConf)
302 {
303  NS_LOG_FUNCTION(this);
304  m_phyRx->ConfigurePhyRxCarriers(carrierConf, superFrameConf);
305 }
306 
307 void
308 SatPhy::SetRxFadingContainer(Ptr<SatBaseFading> fadingContainer)
309 {
310  NS_LOG_FUNCTION(this);
311 
312  m_phyRx->SetFadingContainer(fadingContainer);
313 }
314 
315 void
316 SatPhy::SetTxFadingContainer(Ptr<SatBaseFading> fadingContainer)
317 {
318  NS_LOG_FUNCTION(this);
319 
320  m_phyTx->SetFadingContainer(fadingContainer);
321 }
322 
323 void
324 SatPhy::SetNodeInfo(const Ptr<SatNodeInfo> nodeInfo)
325 {
326  NS_LOG_FUNCTION(this << nodeInfo);
327  m_nodeInfo = nodeInfo;
328  m_phyRx->SetNodeInfo(nodeInfo);
329 }
330 
331 void
333 {
334  NS_LOG_FUNCTION(this);
335  m_phyRx->BeginEndScheduling();
336 }
337 
338 Ptr<SatPhyTx>
340 {
341  NS_LOG_FUNCTION(this);
342  return m_phyTx;
343 }
344 
345 Ptr<SatPhyRx>
347 {
348  NS_LOG_FUNCTION(this);
349  return m_phyRx;
350 }
351 
352 void
353 SatPhy::SetPhyTx(Ptr<SatPhyTx> phyTx)
354 {
355  NS_LOG_FUNCTION(this << phyTx);
356  m_phyTx = phyTx;
357 }
358 
359 void
360 SatPhy::SetPhyRx(Ptr<SatPhyRx> phyRx)
361 {
362  NS_LOG_FUNCTION(this << phyRx);
363  m_phyRx = phyRx;
364 }
365 
366 Ptr<SatChannel>
368 {
369  NS_LOG_FUNCTION(this);
370  NS_ASSERT(m_phyTx);
371 
372  return m_phyTx->GetChannel();
373 }
374 
375 void
377  uint32_t carrierId,
378  Time duration,
380 {
381  NS_LOG_FUNCTION(this << carrierId << duration);
382  NS_LOG_INFO("Sending a packet with carrierId: " << carrierId << " duration: " << duration);
383 
384  // Add a SatPhyTimeTag tag for packet delay computation at the receiver end.
385  SetTimeTag(p);
386 
387  // Add packet trace entry:
389 
390  m_packetTrace(Simulator::Now(),
392  m_nodeInfo->GetNodeType(),
393  m_nodeInfo->GetNodeId(),
394  m_nodeInfo->GetMacAddress(),
396  ld,
398 
399  // Create a new SatSignalParameters related to this packet transmission
400  Ptr<SatSignalParameters> txParams = Create<SatSignalParameters>();
401  txParams->m_duration = duration;
402  txParams->m_phyTx = m_phyTx;
403  txParams->m_packetsInBurst = p;
404  txParams->m_satId = m_satId;
405  txParams->m_beamId = m_beamId;
406  txParams->m_carrierId = carrierId;
407  txParams->m_txPower_W = m_eirpWoGainW;
408  txParams->m_txInfo.modCod = txInfo.modCod;
409  txParams->m_txInfo.sliceId = txInfo.sliceId;
410  txParams->m_txInfo.fecBlockSizeInBytes = txInfo.fecBlockSizeInBytes;
411  txParams->m_txInfo.frameType = txInfo.frameType;
412  txParams->m_txInfo.waveformId = txInfo.waveformId;
413  txParams->m_txInfo.packetType = txInfo.packetType;
414  txParams->m_txInfo.crdsaUniquePacketId = txInfo.crdsaUniquePacketId;
415 
416  m_phyTx->StartTx(txParams);
417 }
418 
419 void
420 SatPhy::SendPduWithParams(Ptr<SatSignalParameters> txParams)
421 {
422  NS_LOG_FUNCTION(this << txParams);
423  NS_ASSERT(false);
424 
429 }
430 
431 void
432 SatPhy::SetSatId(uint32_t satId)
433 {
434  NS_LOG_FUNCTION(this << satId);
435  m_satId = satId;
436  m_phyTx->SetSatId(satId);
437  m_phyRx->SetSatId(satId);
438 }
439 
440 bool
441 SatPhy::SetBeamId(uint32_t beamId)
442 {
443  NS_LOG_FUNCTION(this << beamId);
444 
445  bool connect = m_beamId == 0 && beamId != 0;
446  bool disconnect = m_beamId != 0 && beamId == 0;
447 
448  m_beamId = beamId;
449  m_phyTx->SetBeamId(beamId);
450  m_phyRx->SetBeamId(beamId);
451 
452  return connect || disconnect;
453 }
454 
455 void
457 {
459  {
460  for (PacketContainer_t::const_iterator it = packets.begin(); it != packets.end(); ++it)
461  {
462  SatPhyTimeTag timeTag;
463  if (!(*it)->PeekPacketTag(timeTag))
464  {
465  (*it)->AddPacketTag(SatPhyTimeTag(Simulator::Now()));
466  }
467 
468  (*it)->AddPacketTag(SatPhyLinkTimeTag(Simulator::Now()));
469  }
470  }
471 }
472 
475 {
476  return SatEnums::LD_UNDEFINED;
477 }
478 
481 {
482  return SatEnums::LD_UNDEFINED;
483 }
484 
485 void
487 {
488  NS_LOG_FUNCTION(this);
489 
491  {
492  SatSignalParameters::PacketsInBurst_t::iterator it1;
493  for (it1 = packets.begin(); it1 != packets.end(); ++it1)
494  {
495  Address addr; // invalid address.
496  bool isTaggedWithAddress = false;
497  ByteTagIterator it2 = (*it1)->GetByteTagIterator();
498 
499  while (!isTaggedWithAddress && it2.HasNext())
500  {
501  ByteTagIterator::Item item = it2.Next();
502 
503  if (item.GetTypeId() == SatAddressTag::GetTypeId())
504  {
505  NS_LOG_DEBUG(this << " contains a SatAddressTag tag:"
506  << " start=" << item.GetStart() << " end=" << item.GetEnd());
507  SatAddressTag addrTag;
508  item.GetTag(addrTag);
509  addr = addrTag.GetSourceAddress();
510  isTaggedWithAddress = true; // this will exit the while loop.
511  }
512  }
513 
514  m_rxTrace(*it1, addr);
515 
516  SatPhyLinkTimeTag linkTimeTag;
517  if ((*it1)->RemovePacketTag(linkTimeTag))
518  {
519  NS_LOG_DEBUG(this << " contains a SatPhyLinkTimeTag tag");
520  Time delay = Simulator::Now() - linkTimeTag.GetSenderLinkTimestamp();
521  m_rxLinkDelayTrace(delay, addr);
522  if (m_lastLinkDelay.IsZero() == false)
523  {
524  Time jitter = Abs(delay - m_lastLinkDelay);
525  m_rxLinkJitterTrace(jitter, addr);
526  }
527  m_lastLinkDelay = delay;
528  }
529 
530  SatPhyTimeTag timeTag;
531  if ((*it1)->RemovePacketTag(timeTag))
532  {
533  NS_LOG_DEBUG(this << " contains a SatPhyTimeTag tag");
534  Time delay = Simulator::Now() - timeTag.GetSenderTimestamp();
535  m_rxDelayTrace(delay, addr);
536  if (m_lastDelay.IsZero() == false)
537  {
538  Time jitter = Abs(delay - m_lastDelay);
539  m_rxJitterTrace(jitter, addr);
540  }
541  m_lastDelay = delay;
542  }
543 
544  } // end of `for (it1 = rxParams->m_packetsInBurst)`
545 
546  } // end of `if (m_isStatisticsTagsEnabled)`
547 }
548 
549 void
550 SatPhy::ModcodTrace(Ptr<SatSignalParameters> rxParams)
551 {
552  NS_LOG_FUNCTION(this);
553 
554  Address addr;
555  SatAddressE2ETag satAddressE2ETag;
557  {
558  switch (GetSatLinkRxDir())
559  {
560  case SatEnums::LD_RETURN: {
561  SatSignalParameters::PacketsInBurst_t::iterator it1;
562  for (it1 = rxParams->m_packetsInBurst.begin(); it1 != rxParams->m_packetsInBurst.end();
563  ++it1)
564  {
565  if (!(*it1)->PeekPacketTag(satAddressE2ETag))
566  {
567  NS_FATAL_ERROR("SatUplinkInfoTag not found");
568  }
569  addr = satAddressE2ETag.GetE2ESourceAddress();
570  m_rxLinkModcodTrace(rxParams->m_txInfo.modCod, addr);
571  }
572  break;
573  }
574  case SatEnums::LD_FORWARD: {
575  SatSignalParameters::PacketsInBurst_t::iterator it1;
576  for (it1 = rxParams->m_packetsInBurst.begin(); it1 != rxParams->m_packetsInBurst.end();
577  ++it1)
578  {
579  if (!(*it1)->PeekPacketTag(satAddressE2ETag))
580  {
581  NS_FATAL_ERROR("SatUplinkInfoTag not found");
582  }
583  addr = satAddressE2ETag.GetE2EDestAddress();
584  m_rxLinkModcodTrace(rxParams->m_txInfo.modCod, addr);
585  }
586  break;
587  }
588  default:
589  NS_FATAL_ERROR("Incorrect satellite RX link direction");
590  }
591  }
592 }
593 
594 void
595 SatPhy::Receive(Ptr<SatSignalParameters> rxParams, bool phyError)
596 {
597  NS_LOG_FUNCTION(this << rxParams << phyError);
598 
599  // Add packet trace entry:
601 
603 
604  m_packetTrace(Simulator::Now(),
605  event,
606  m_nodeInfo->GetNodeType(),
607  m_nodeInfo->GetNodeId(),
608  m_nodeInfo->GetMacAddress(),
610  ld,
611  SatUtils::GetPacketInfo(rxParams->m_packetsInBurst));
612 
613  if (phyError)
614  {
615  // If there was a PHY error, the packet is dropped here.
616  NS_LOG_INFO(this << " dropped " << rxParams->m_packetsInBurst.size()
617  << " packets because of PHY error.");
618  }
619  else
620  {
621  // Invoke the `Rx` and `RxDelay` trace sources.
622  RxTraces(rxParams->m_packetsInBurst);
623 
624  ModcodTrace(rxParams);
625 
626  // Pass the packet to the upper layer.
627  m_rxCallback(rxParams->m_packetsInBurst, rxParams);
628 
629  } // end of else of `if (phyError)`
630 }
631 
632 void
633 SatPhy::CnoInfo(uint32_t satId,
634  uint32_t beamId,
635  Address source,
636  Address dest,
637  double cno,
638  bool isSatelliteMac)
639 {
640  NS_LOG_FUNCTION(this << beamId << source << cno << isSatelliteMac);
641  m_cnoCallback(satId, beamId, source, dest, cno, isSatelliteMac);
642 }
643 
644 void
646  uint32_t beamId,
647  uint32_t carrierId,
648  uint8_t allocationChannelId,
649  double averageNormalizedOfferedLoad)
650 {
651  NS_LOG_FUNCTION(this << satId << beamId << carrierId << allocationChannelId
652  << averageNormalizedOfferedLoad);
654  beamId,
655  carrierId,
656  allocationChannelId,
657  averageNormalizedOfferedLoad);
658 }
659 
660 void
662 {
663  NS_LOG_FUNCTION(this << &cb);
664 
666 }
667 
668 } // namespace ns3
This class implements a tag that carries the satellite MAC of GW and UT.
Mac48Address GetE2ESourceAddress(void) const
Get E2E source MAC address.
Mac48Address GetE2EDestAddress(void) const
Get E2E destination MAC address.
This class implements a tag that carries the MAC address of the sender of the packet.
static TypeId GetTypeId()
Inherited from ObjectBase base class.
Address GetSourceAddress() const
Get the source address.
SatLinkDir_t
Link direction used for packet tracing.
SatPacketEvent_t
Packet event used for packet tracing.
virtual void SetTxAntennaGainPattern(Ptr< SatAntennaGainPattern > agp, Ptr< SatMobilityModel > satelliteMobility)
Set the transmit antenna gain pattern.
double m_txMaxAntennaGainDb
Configured maximum transmitter antenna gain in dBi.
TracedCallback< Time, SatEnums::SatPacketEvent_t, SatEnums::SatNodeType_t, uint32_t, Mac48Address, SatEnums::SatLogLevel_t, SatEnums::SatLinkDir_t, std::string > m_packetTrace
Trace callback used for packet tracing:
void SetNodeInfo(const Ptr< SatNodeInfo > nodeInfo)
Set the node info class.
void SetTimeTag(SatPhy::PacketContainer_t packets)
Set SatPhyTimeTag of packets.
void ConfigureRxCarriers(Ptr< SatPhyRxCarrierConf > carrierConf, Ptr< SatSuperframeConf > superFrameConf)
Configure Rx carriers.
void Initialize()
Initialize phy.
virtual Ptr< SatPhyTx > GetPhyTx() const
Get the SatPhyTx pointer.
virtual void SetRxAntennaGainPattern(Ptr< SatAntennaGainPattern > agp, Ptr< SatMobilityModel > satelliteMobility)
Set the receive antenna gain pattern.
TracedCallback< const Time &, const Address & > m_rxDelayTrace
Traced callback for all received packets, including delay information and the address of the senders.
TracedCallback< const Time &, const Address & > m_rxJitterTrace
Traced callback for all received packets, including jitter information and the address of the senders...
void CnoInfo(uint32_t satId, uint32_t beamId, Address source, Address destination, double cno, bool isSatelliteMac)
Function for getting the C/NO information.
void SetSatId(uint32_t satId)
Set the satId this PHY is connected with.
TracedCallback< const Time &, const Address & > m_rxLinkDelayTrace
Traced callback for all received packets, including link delay information and the address of the sen...
Ptr< SatPhyRx > m_phyRx
Pointer to internal SatPhyRx instance.
virtual SatEnums::SatLinkDir_t GetSatLinkTxDir()
Get the link TX direction.
virtual SatEnums::SatLinkDir_t GetSatLinkRxDir()
Get the link RX direction.
uint32_t m_satId
Satellite ID.
void BeginEndScheduling()
Begin frame/window end scheduling for processes utilizing frame length as interval.
TypeId GetInstanceTypeId(void) const
Derived from Object.
virtual void SendPduWithParams(Ptr< SatSignalParameters > rxParams)
Send Pdu to the PHY tx module (for satellite switch packet forwarding)
uint32_t m_beamId
Beam ID.
double m_rxAntennaLossDb
Configured receiver antenna loss in Dbs.
double m_defaultFadingValue
Default fading value.
virtual Ptr< SatPhyRx > GetPhyRx() const
Get the SatPhyRx pointer.
static TypeId GetTypeId(void)
Derived from Object.
double m_txMaxPowerDbw
Configured maximum transmitter power in DbWs.
void SetRxFadingContainer(Ptr< SatBaseFading > fadingContainer)
Set fading container.
void AverageNormalizedOfferedRandomAccessLoadInfo(uint32_t satId, uint32_t beamId, uint32_t carrierId, uint8_t allocationChannelId, double averageNormalizedOfferedLoad)
Function for getting the normalized offered load of the specific random access allocation channel.
Ptr< SatChannel > GetTxChannel()
Get the Tx satellite channel.
Ptr< SatNodeInfo > m_nodeInfo
Node info containing node related information, such as node type, node id and MAC address (of the Sat...
TracedCallback< uint32_t, const Address & > m_rxLinkModcodTrace
Traced callback for all received packets, including link MODCOD information and the address of the se...
double m_rxMaxAntennaGainDb
Configured maximum receiver antenna gain in dBi.
virtual void SendPdu(PacketContainer_t, uint32_t carrierId, Time duration, SatSignalParameters::txInfo_s txInfo)
Send Pdu to the PHY tx module (for initial transmissions from either UT or GW)
void SetChannelPairGetterCallback(SatPhy::ChannelPairGetterCallback cb)
Set the channel pair getter callback.
virtual void RxTraces(SatPhy::PacketContainer_t packets)
Invoke the Rx trace source for each received packet.
virtual void Receive(Ptr< SatSignalParameters > rxParams, bool phyError)
Receives packets from lower layer.
double m_txOutputLossDb
Configured transmitter output loss in Dbs.
SatPhy::ChannelPairGetterCallback m_retrieveChannelPair
Callback for retrieving SatChannel pairs by beam.
TracedCallback< Ptr< const Packet >, const Address & > m_rxTrace
Traced callback for all received packets, including the address of the senders.
SatPhy(void)
Default constructor.
SatPhy::AverageNormalizedOfferedLoadCallback m_avgNormalizedOfferedLoadCallback
Average normalized offered load callback.
double m_eirpWoGainW
Calculated EIRP without gain in W.
virtual void SetPhyTx(Ptr< SatPhyTx > phyTx)
Set the SatPhyTx module.
Time m_lastDelay
Last delay measurement.
double m_txPointingLossDb
Configured transmitter pointing loss in Dbs.
Ptr< SatPhyTx > m_phyTx
Pointer to internal SatPhyTx instance.
void ModcodTrace(Ptr< SatSignalParameters > rxParams)
Invoke the RxLinkModcod trace source for each received packet.
double m_txAntennaLossDb
Configured transmitter antenna loss in Dbs.
bool m_isStatisticsTagsEnabled
EnableStatisticsTags attribute.
virtual void DoDispose(void)
Dispose of SatPhy.
virtual ~SatPhy()
Destructor.
Time m_lastLinkDelay
Last delay measurement for link.
void SetTxFadingContainer(Ptr< SatBaseFading > fadingContainer)
Set fading container.
double CalculateSinr(double sinr, double otherInterference)
Calculate final SINR with PHY specific parameters and given calculated SINR.
SatSignalParameters::PacketsInBurst_t PacketContainer_t
Define PacketContainer in SatPhy.
Definition: satellite-phy.h:79
double m_txOboLossDb
Configured transmitter OBO loss in Dbs.
virtual void SetPhyRx(Ptr< SatPhyRx > phyRx)
Set the SatPhyRx module.
SatPhy::CnoCallback m_cnoCallback
The C/N0 info callback.
Callback< SatChannelPair::ChannelPair_t, uint32_t, uint32_t > ChannelPairGetterCallback
Callback for retrieving a pair of SatChannel associated to a beam.
virtual void DoInitialize(void)
Initialization of SatPhy.
SatPhy::ReceiveCallback m_rxCallback
The upper layer package receive callback.
TracedCallback< const Time &, const Address & > m_rxLinkJitterTrace
Traced callback for all received packets, including link jitter information and the address of the se...
bool SetBeamId(uint32_t beamId)
Set the beamId this PHY is connected with.
Time tag used to identify the time when packet is enqueued at PHY on first link between GW and UT lev...
Time GetSenderTimestamp(void) const
Get sender time stamp of this tag.
static T DbWToW(T dbw)
Converts Decibel Watts to Watts.
static std::string GetPacketInfo(const Ptr< const Packet > p)
Get packet information in std::string for printing purposes.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Creation parameters for base PHY object.
Ptr< SatChannel > m_rxCh
Ptr< NetDevice > m_device
Ptr< SatChannel > m_txCh
SatEnums::SatLoraNodeType_t m_standard
Struct for storing the packet specific Tx information.