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  {
99  case SatEnums::GEO:
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_UT: {
107  m_phyTx = CreateObject<SatLoraPhyTx>();
108  m_phyRx = CreateObject<SatLoraPhyRx>();
109  break;
110  }
111  case SatEnums::LORA_GW: {
112  m_phyTx = CreateObject<SatLoraPhyTx>();
113  m_phyRx = CreateObject<SatPhyRx>();
114  break;
115  }
116  default:
117  NS_FATAL_ERROR("Standard not implemented yet: " << params.m_standard);
118  }
119 
120  m_phyTx->SetChannel(params.m_txCh);
121  m_satId = params.m_satId;
122  m_beamId = params.m_beamId;
123 
124  params.m_rxCh->AddRx(m_phyRx);
125  m_phyRx->SetDevice(params.m_device);
126  m_phyTx->SetMobility(mobility);
127  m_phyRx->SetMobility(mobility);
128 }
129 
130 TypeId
132 {
133  static TypeId tid =
134  TypeId("ns3::SatPhy")
135  .SetParent<Object>()
136  .AddAttribute("ReceiveCb",
137  "The receive callback for this phy.",
138  CallbackValue(),
139  MakeCallbackAccessor(&SatPhy::m_rxCallback),
140  MakeCallbackChecker())
141  .AddAttribute("CnoCb",
142  "The C/N0 info callback for this phy.",
143  CallbackValue(),
144  MakeCallbackAccessor(&SatPhy::m_cnoCallback),
145  MakeCallbackChecker())
146  .AddAttribute("AverageNormalizedOfferedLoadCallback",
147  "The average offered random access load callback for this phy.",
148  CallbackValue(),
149  MakeCallbackAccessor(&SatPhy::m_avgNormalizedOfferedLoadCallback),
150  MakeCallbackChecker())
151  .AddAttribute("EnableStatisticsTags",
152  "If true, some tags will be added to each transmitted packet to assist "
153  "with statistics computation",
154  BooleanValue(false),
155  MakeBooleanAccessor(&SatPhy::m_isStatisticsTagsEnabled),
156  MakeBooleanChecker())
157  .AddTraceSource("PacketTrace",
158  "Packet event trace",
159  MakeTraceSourceAccessor(&SatPhy::m_packetTrace),
160  "ns3::SatTypedefs::PacketTraceCallback")
161  .AddTraceSource("Rx",
162  "A packet received",
163  MakeTraceSourceAccessor(&SatPhy::m_rxTrace),
164  "ns3::SatTypedefs::PacketSourceAddressCallback")
165  .AddTraceSource("RxDelay",
166  "A packet is received with delay information",
167  MakeTraceSourceAccessor(&SatPhy::m_rxDelayTrace),
168  "ns3::SatTypedefs::PacketDelayAddressCallback")
169  .AddTraceSource("RxLinkDelay",
170  "A packet is received with link delay information",
171  MakeTraceSourceAccessor(&SatPhy::m_rxLinkDelayTrace),
172  "ns3::SatTypedefs::PacketDelayAddressCallback")
173  .AddTraceSource("RxJitter",
174  "A packet is received with jitter information",
175  MakeTraceSourceAccessor(&SatPhy::m_rxJitterTrace),
176  "ns3::SatTypedefs::PacketJitterAddressCallback")
177  .AddTraceSource("RxLinkJitter",
178  "A packet is received with link jitter information",
179  MakeTraceSourceAccessor(&SatPhy::m_rxLinkJitterTrace),
180  "ns3::SatTypedefs::PacketJitterAddressCallback")
181  .AddTraceSource("RxLinkModcod",
182  "A packet is received with link MODCOD information",
183  MakeTraceSourceAccessor(&SatPhy::m_rxLinkModcodTrace),
184  "ns3::SatTypedefs::PacketModcodAddressCallback");
185  return tid;
186 }
187 
188 TypeId
190 {
191  NS_LOG_FUNCTION(this);
192  return GetTypeId();
193 }
194 
195 void
197 {
198  NS_LOG_FUNCTION(this);
199  Object::DoInitialize();
200 }
201 
202 void
204 {
205  NS_LOG_FUNCTION(this);
206 
207  // calculate EIRP without Gain (maximum)
208  double eirpWoGainDbw =
210 
211  m_eirpWoGainW = SatUtils::DbWToW(eirpWoGainDbw);
212 
213  m_phyTx->SetSatId(m_satId);
214  m_phyRx->SetSatId(m_satId);
215 
216  m_phyTx->SetBeamId(m_beamId);
217  m_phyRx->SetBeamId(m_beamId);
218 
219  m_phyRx->SetReceiveCallback(MakeCallback(&SatPhy::Receive, this));
220 
221  if (m_cnoCallback.IsNull() == false)
222  {
223  m_phyRx->SetCnoCallback(MakeCallback(&SatPhy::CnoInfo, this));
224  }
225 
226  if (m_avgNormalizedOfferedLoadCallback.IsNull() == false)
227  {
228  m_phyRx->SetAverageNormalizedOfferedLoadCallback(
230  }
231 
232  m_phyTx->SetMaxAntennaGain_Db(m_txMaxAntennaGainDb);
233  m_phyRx->SetMaxAntennaGain_Db(m_rxMaxAntennaGainDb);
234 
235  m_phyTx->SetDefaultFadingValue(m_defaultFadingValue);
236  m_phyRx->SetDefaultFadingValue(m_defaultFadingValue);
237 
238  m_phyRx->SetAntennaLoss_Db(m_rxAntennaLossDb);
239 }
240 
242 {
243  NS_LOG_FUNCTION(this);
244 }
245 
246 void
248 {
249  NS_LOG_FUNCTION(this);
250  m_phyTx->DoDispose();
251  m_phyTx = 0;
252  m_phyRx->DoDispose();
253  m_phyRx = 0;
254 
255  Object::DoDispose();
256 }
257 
258 double
259 SatPhy::CalculateSinr(double sinr, double otherInterference)
260 {
261  NS_LOG_FUNCTION(this << sinr << otherInterference);
262 
263  if (sinr <= 0)
264  {
265  NS_FATAL_ERROR("Calculated own SINR is expected to be greater than zero!!!");
266  }
267 
268  if (otherInterference <= 0)
269  {
270  NS_FATAL_ERROR("Interference is expected to be greater than zero!!!");
271  }
272 
273  double finalSinr = 1 / ((1 / sinr) + (1 / otherInterference));
274 
275  return finalSinr;
276 }
277 
278 void
279 SatPhy::SetTxAntennaGainPattern(Ptr<SatAntennaGainPattern> agp,
280  Ptr<SatMobilityModel> satelliteMobility)
281 {
282  NS_LOG_FUNCTION(this);
283  m_phyTx->SetAntennaGainPattern(agp, satelliteMobility);
284 }
285 
286 void
287 SatPhy::SetRxAntennaGainPattern(Ptr<SatAntennaGainPattern> agp,
288  Ptr<SatMobilityModel> satelliteMobility)
289 {
290  NS_LOG_FUNCTION(this);
291  m_phyRx->SetAntennaGainPattern(agp, satelliteMobility);
292 }
293 
294 void
295 SatPhy::ConfigureRxCarriers(Ptr<SatPhyRxCarrierConf> carrierConf,
296  Ptr<SatSuperframeConf> superFrameConf)
297 {
298  NS_LOG_FUNCTION(this);
299  m_phyRx->ConfigurePhyRxCarriers(carrierConf, superFrameConf);
300 }
301 
302 void
303 SatPhy::SetRxFadingContainer(Ptr<SatBaseFading> fadingContainer)
304 {
305  NS_LOG_FUNCTION(this);
306 
307  m_phyRx->SetFadingContainer(fadingContainer);
308 }
309 
310 void
311 SatPhy::SetTxFadingContainer(Ptr<SatBaseFading> fadingContainer)
312 {
313  NS_LOG_FUNCTION(this);
314 
315  m_phyTx->SetFadingContainer(fadingContainer);
316 }
317 
318 void
319 SatPhy::SetNodeInfo(const Ptr<SatNodeInfo> nodeInfo)
320 {
321  NS_LOG_FUNCTION(this << nodeInfo);
322  m_nodeInfo = nodeInfo;
323  m_phyRx->SetNodeInfo(nodeInfo);
324 }
325 
326 void
328 {
329  NS_LOG_FUNCTION(this);
330  m_phyRx->BeginEndScheduling();
331 }
332 
333 Ptr<SatPhyTx>
335 {
336  NS_LOG_FUNCTION(this);
337  return m_phyTx;
338 }
339 
340 Ptr<SatPhyRx>
342 {
343  NS_LOG_FUNCTION(this);
344  return m_phyRx;
345 }
346 
347 void
348 SatPhy::SetPhyTx(Ptr<SatPhyTx> phyTx)
349 {
350  NS_LOG_FUNCTION(this << phyTx);
351  m_phyTx = phyTx;
352 }
353 
354 void
355 SatPhy::SetPhyRx(Ptr<SatPhyRx> phyRx)
356 {
357  NS_LOG_FUNCTION(this << phyRx);
358  m_phyRx = phyRx;
359 }
360 
361 Ptr<SatChannel>
363 {
364  NS_LOG_FUNCTION(this);
365  NS_ASSERT(m_phyTx);
366 
367  return m_phyTx->GetChannel();
368 }
369 
370 void
372  uint32_t carrierId,
373  Time duration,
375 {
376  NS_LOG_FUNCTION(this << carrierId << duration);
377  NS_LOG_INFO("Sending a packet with carrierId: " << carrierId << " duration: " << duration);
378 
379  // Add a SatPhyTimeTag tag for packet delay computation at the receiver end.
380  SetTimeTag(p);
381 
382  // Add packet trace entry:
384 
385  m_packetTrace(Simulator::Now(),
387  m_nodeInfo->GetNodeType(),
388  m_nodeInfo->GetNodeId(),
389  m_nodeInfo->GetMacAddress(),
391  ld,
393 
394  // Create a new SatSignalParameters related to this packet transmission
395  Ptr<SatSignalParameters> txParams = Create<SatSignalParameters>();
396  txParams->m_duration = duration;
397  txParams->m_phyTx = m_phyTx;
398  txParams->m_packetsInBurst = p;
399  txParams->m_satId = m_satId;
400  txParams->m_beamId = m_beamId;
401  txParams->m_carrierId = carrierId;
402  txParams->m_txPower_W = m_eirpWoGainW;
403  txParams->m_txInfo.modCod = txInfo.modCod;
404  txParams->m_txInfo.sliceId = txInfo.sliceId;
405  txParams->m_txInfo.fecBlockSizeInBytes = txInfo.fecBlockSizeInBytes;
406  txParams->m_txInfo.frameType = txInfo.frameType;
407  txParams->m_txInfo.waveformId = txInfo.waveformId;
408  txParams->m_txInfo.packetType = txInfo.packetType;
409  txParams->m_txInfo.crdsaUniquePacketId = txInfo.crdsaUniquePacketId;
410 
411  m_phyTx->StartTx(txParams);
412 }
413 
414 void
415 SatPhy::SendPduWithParams(Ptr<SatSignalParameters> txParams)
416 {
417  NS_LOG_FUNCTION(this << txParams);
418  NS_ASSERT(false);
419 
424 }
425 
426 void
427 SatPhy::SetSatId(uint32_t satId)
428 {
429  NS_LOG_FUNCTION(this << satId);
430  m_satId = satId;
431  m_phyTx->SetSatId(satId);
432  m_phyRx->SetSatId(satId);
433 }
434 
435 void
436 SatPhy::SetBeamId(uint32_t beamId)
437 {
438  NS_LOG_FUNCTION(this << beamId);
439  m_beamId = beamId;
440  m_phyTx->SetBeamId(beamId);
441  m_phyRx->SetBeamId(beamId);
442 }
443 
444 void
446 {
448  {
449  for (PacketContainer_t::const_iterator it = packets.begin(); it != packets.end(); ++it)
450  {
451  SatPhyTimeTag timeTag;
452  if (!(*it)->PeekPacketTag(timeTag))
453  {
454  (*it)->AddPacketTag(SatPhyTimeTag(Simulator::Now()));
455  }
456 
457  (*it)->AddPacketTag(SatPhyLinkTimeTag(Simulator::Now()));
458  }
459  }
460 }
461 
464 {
465  return SatEnums::LD_UNDEFINED;
466 }
467 
470 {
471  return SatEnums::LD_UNDEFINED;
472 }
473 
474 void
476 {
477  NS_LOG_FUNCTION(this);
478 
480  {
481  SatSignalParameters::PacketsInBurst_t::iterator it1;
482  for (it1 = packets.begin(); it1 != packets.end(); ++it1)
483  {
484  Address addr; // invalid address.
485  bool isTaggedWithAddress = false;
486  ByteTagIterator it2 = (*it1)->GetByteTagIterator();
487 
488  while (!isTaggedWithAddress && it2.HasNext())
489  {
490  ByteTagIterator::Item item = it2.Next();
491 
492  if (item.GetTypeId() == SatAddressTag::GetTypeId())
493  {
494  NS_LOG_DEBUG(this << " contains a SatAddressTag tag:"
495  << " start=" << item.GetStart() << " end=" << item.GetEnd());
496  SatAddressTag addrTag;
497  item.GetTag(addrTag);
498  addr = addrTag.GetSourceAddress();
499  isTaggedWithAddress = true; // this will exit the while loop.
500  }
501  }
502 
503  m_rxTrace(*it1, addr);
504 
505  SatPhyLinkTimeTag linkTimeTag;
506  if ((*it1)->RemovePacketTag(linkTimeTag))
507  {
508  NS_LOG_DEBUG(this << " contains a SatPhyLinkTimeTag tag");
509  Time delay = Simulator::Now() - linkTimeTag.GetSenderLinkTimestamp();
510  m_rxLinkDelayTrace(delay, addr);
511  if (m_lastLinkDelay.IsZero() == false)
512  {
513  Time jitter = Abs(delay - m_lastLinkDelay);
514  m_rxLinkJitterTrace(jitter, addr);
515  }
516  m_lastLinkDelay = delay;
517  }
518 
519  SatPhyTimeTag timeTag;
520  if ((*it1)->RemovePacketTag(timeTag))
521  {
522  NS_LOG_DEBUG(this << " contains a SatPhyTimeTag tag");
523  Time delay = Simulator::Now() - timeTag.GetSenderTimestamp();
524  m_rxDelayTrace(delay, addr);
525  if (m_lastDelay.IsZero() == false)
526  {
527  Time jitter = Abs(delay - m_lastDelay);
528  m_rxJitterTrace(jitter, addr);
529  }
530  m_lastDelay = delay;
531  }
532 
533  } // end of `for (it1 = rxParams->m_packetsInBurst)`
534 
535  } // end of `if (m_isStatisticsTagsEnabled)`
536 }
537 
538 void
539 SatPhy::ModcodTrace(Ptr<SatSignalParameters> rxParams)
540 {
541  NS_LOG_FUNCTION(this);
542 
543  Address addr;
544  SatAddressE2ETag satAddressE2ETag;
546  {
547  switch (GetSatLinkRxDir())
548  {
549  case SatEnums::LD_RETURN: {
550  SatSignalParameters::PacketsInBurst_t::iterator it1;
551  for (it1 = rxParams->m_packetsInBurst.begin(); it1 != rxParams->m_packetsInBurst.end();
552  ++it1)
553  {
554  if (!(*it1)->PeekPacketTag(satAddressE2ETag))
555  {
556  NS_FATAL_ERROR("SatUplinkInfoTag not found");
557  }
558  addr = satAddressE2ETag.GetE2ESourceAddress();
559  m_rxLinkModcodTrace(rxParams->m_txInfo.modCod, addr);
560  }
561  break;
562  }
563  case SatEnums::LD_FORWARD: {
564  SatSignalParameters::PacketsInBurst_t::iterator it1;
565  for (it1 = rxParams->m_packetsInBurst.begin(); it1 != rxParams->m_packetsInBurst.end();
566  ++it1)
567  {
568  if (!(*it1)->PeekPacketTag(satAddressE2ETag))
569  {
570  NS_FATAL_ERROR("SatUplinkInfoTag not found");
571  }
572  addr = satAddressE2ETag.GetE2EDestAddress();
573  m_rxLinkModcodTrace(rxParams->m_txInfo.modCod, addr);
574  }
575  break;
576  }
577  default:
578  NS_FATAL_ERROR("Incorrect satellite RX link direction");
579  }
580  }
581 }
582 
583 void
584 SatPhy::Receive(Ptr<SatSignalParameters> rxParams, bool phyError)
585 {
586  NS_LOG_FUNCTION(this << rxParams << phyError);
587 
588  // Add packet trace entry:
590 
592 
593  m_packetTrace(Simulator::Now(),
594  event,
595  m_nodeInfo->GetNodeType(),
596  m_nodeInfo->GetNodeId(),
597  m_nodeInfo->GetMacAddress(),
599  ld,
600  SatUtils::GetPacketInfo(rxParams->m_packetsInBurst));
601 
602  if (phyError)
603  {
604  // If there was a PHY error, the packet is dropped here.
605  NS_LOG_INFO(this << " dropped " << rxParams->m_packetsInBurst.size()
606  << " packets because of PHY error.");
607  }
608  else
609  {
610  // Invoke the `Rx` and `RxDelay` trace sources.
611  RxTraces(rxParams->m_packetsInBurst);
612 
613  ModcodTrace(rxParams);
614 
615  // Pass the packet to the upper layer.
616  m_rxCallback(rxParams->m_packetsInBurst, rxParams);
617 
618  } // end of else of `if (phyError)`
619 }
620 
621 void
622 SatPhy::CnoInfo(uint32_t satId,
623  uint32_t beamId,
624  Address source,
625  Address dest,
626  double cno,
627  bool isSatelliteMac)
628 {
629  NS_LOG_FUNCTION(this << beamId << source << cno << isSatelliteMac);
630  m_cnoCallback(satId, beamId, source, dest, cno, isSatelliteMac);
631 }
632 
633 void
635  uint32_t beamId,
636  uint32_t carrierId,
637  uint8_t allocationChannelId,
638  double averageNormalizedOfferedLoad)
639 {
640  NS_LOG_FUNCTION(this << satId << beamId << carrierId << allocationChannelId
641  << averageNormalizedOfferedLoad);
643  beamId,
644  carrierId,
645  allocationChannelId,
646  averageNormalizedOfferedLoad);
647 }
648 
649 void
651 {
652  NS_LOG_FUNCTION(this << &cb);
653 
655 }
656 
657 } // 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.
void SetBeamId(uint32_t beamId)
Set the beamId this PHY is connected with.
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 GEO 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:78
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...
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.