A Discrete-Event Network Simulator
API
lte-spectrum-phy.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009, 2011 CTTC
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: Nicola Baldo <nbaldo@cttc.es>
19  * Giuseppe Piro <g.piro@poliba.it>
20  * Marco Miozzo <marco.miozzo@cttc.es> (add physical error model)
21  */
22 
23 
24 #include <ns3/object-factory.h>
25 #include <ns3/log.h>
26 #include <cmath>
27 #include <ns3/simulator.h>
28 #include <ns3/trace-source-accessor.h>
29 #include <ns3/antenna-model.h>
30 #include "lte-spectrum-phy.h"
32 #include "lte-net-device.h"
33 #include "lte-radio-bearer-tag.h"
34 #include "lte-chunk-processor.h"
35 #include "lte-phy-tag.h"
36 #include <ns3/lte-mi-error-model.h>
37 #include <ns3/lte-radio-bearer-tag.h>
38 #include <ns3/boolean.h>
39 #include <ns3/double.h>
40 #include <ns3/config.h>
41 
42 namespace ns3 {
43 
44 NS_LOG_COMPONENT_DEFINE ("LteSpectrumPhy");
45 
46 
47 // duration of SRS portion of UL subframe
48 // = 1 symbol for SRS -1ns as margin to avoid overlapping simulator events
49 static const Time UL_SRS_DURATION = NanoSeconds (71429 -1);
50 
51 // duration of the control portion of a subframe
52 // = 0.001 / 14 * 3 (ctrl fixed to 3 symbols) -1ns as margin to avoid overlapping simulator events
53 static const Time DL_CTRL_DURATION = NanoSeconds (214286 -1);
54 
55 static const double EffectiveCodingRate[29] = {
56  0.08,
57  0.1,
58  0.11,
59  0.15,
60  0.19,
61  0.24,
62  0.3,
63  0.37,
64  0.44,
65  0.51,
66  0.3,
67  0.33,
68  0.37,
69  0.42,
70  0.48,
71  0.54,
72  0.6,
73  0.43,
74  0.45,
75  0.5,
76  0.55,
77  0.6,
78  0.65,
79  0.7,
80  0.75,
81  0.8,
82  0.85,
83  0.89,
84  0.92
85 };
86 
87 
88 
89 
91 {
92 }
93 
94 TbId_t::TbId_t (const uint16_t a, const uint8_t b)
95 : m_rnti (a),
96  m_layer (b)
97 {
98 }
99 
100 bool
101 operator == (const TbId_t &a, const TbId_t &b)
102 {
103  return ( (a.m_rnti == b.m_rnti) && (a.m_layer == b.m_layer) );
104 }
105 
106 bool
107 operator < (const TbId_t& a, const TbId_t& b)
108 {
109  return ( (a.m_rnti < b.m_rnti) || ( (a.m_rnti == b.m_rnti) && (a.m_layer < b.m_layer) ) );
110 }
111 
112 NS_OBJECT_ENSURE_REGISTERED (LteSpectrumPhy);
113 
115  : m_state (IDLE),
116  m_cellId (0),
117  m_transmissionMode (0),
118  m_layersNum (1)
119 {
120  NS_LOG_FUNCTION (this);
121  m_random = CreateObject<UniformRandomVariable> ();
122  m_random->SetAttribute ("Min", DoubleValue (0.0));
123  m_random->SetAttribute ("Max", DoubleValue (1.0));
124  m_interferenceData = CreateObject<LteInterference> ();
125  m_interferenceCtrl = CreateObject<LteInterference> ();
126 
127  for (uint8_t i = 0; i < 7; i++)
128  {
129  m_txModeGain.push_back (1.0);
130  }
131 }
132 
133 
135 {
136  NS_LOG_FUNCTION (this);
137  m_expectedTbs.clear ();
138  m_txModeGain.clear ();
139 }
140 
142 {
143  NS_LOG_FUNCTION (this);
144  m_channel = 0;
145  m_mobility = 0;
146  m_device = 0;
147  m_interferenceData->Dispose ();
148  m_interferenceData = 0;
149  m_interferenceCtrl->Dispose ();
150  m_interferenceCtrl = 0;
151  m_ltePhyTxEndCallback = MakeNullCallback< void, Ptr<const Packet> > ();
152  m_ltePhyRxDataEndErrorCallback = MakeNullCallback< void > ();
153  m_ltePhyRxDataEndOkCallback = MakeNullCallback< void, Ptr<Packet> > ();
154  m_ltePhyRxCtrlEndOkCallback = MakeNullCallback< void, std::list<Ptr<LteControlMessage> > > ();
155  m_ltePhyRxCtrlEndErrorCallback = MakeNullCallback< void > ();
156  m_ltePhyDlHarqFeedbackCallback = MakeNullCallback< void, DlInfoListElement_s > ();
157  m_ltePhyUlHarqFeedbackCallback = MakeNullCallback< void, UlInfoListElement_s > ();
158  m_ltePhyRxPssCallback = MakeNullCallback< void, uint16_t, Ptr<SpectrumValue> > ();
160 }
161 
162 std::ostream& operator<< (std::ostream& os, LteSpectrumPhy::State s)
163 {
164  switch (s)
165  {
167  os << "IDLE";
168  break;
170  os << "RX_DATA";
171  break;
173  os << "RX_CTRL";
174  break;
175  case LteSpectrumPhy::TX:
176  os << "TX";
177  break;
178  default:
179  os << "UNKNOWN";
180  break;
181  }
182  return os;
183 }
184 
185 TypeId
187 {
188  static TypeId tid = TypeId ("ns3::LteSpectrumPhy")
190  .AddTraceSource ("TxStart",
191  "Trace fired when a new transmission is started",
193  "ns3::PacketBurst::TracedCallback")
194  .AddTraceSource ("TxEnd",
195  "Trace fired when a previosuly started transmission is finished",
197  "ns3::PacketBurst::TracedCallback")
198  .AddTraceSource ("RxStart",
199  "Trace fired when the start of a signal is detected",
201  "ns3::PacketBurst::TracedCallback")
202  .AddTraceSource ("RxEndOk",
203  "Trace fired when a previosuly started RX terminates successfully",
205  "ns3::Packet::TracedCallback")
206  .AddTraceSource ("RxEndError",
207  "Trace fired when a previosuly started RX terminates with an error",
209  "ns3::Packet::TracedCallback")
210  .AddAttribute ("DataErrorModelEnabled",
211  "Activate/Deactivate the error model of data (TBs of PDSCH and PUSCH) [by default is active].",
212  BooleanValue (true),
215  .AddAttribute ("CtrlErrorModelEnabled",
216  "Activate/Deactivate the error model of control (PCFICH-PDCCH decodification) [by default is active].",
217  BooleanValue (true),
220  .AddTraceSource ("DlPhyReception",
221  "DL reception PHY layer statistics.",
223  "ns3::PhyReceptionStatParameters::TracedCallback")
224  .AddTraceSource ("UlPhyReception",
225  "DL reception PHY layer statistics.",
227  "ns3::PhyReceptionStatParameters::TracedCallback")
228  ;
229  return tid;
230 }
231 
232 
233 
236 {
237  NS_LOG_FUNCTION (this);
238  return m_device;
239 }
240 
241 
244 {
245  NS_LOG_FUNCTION (this);
246  return m_mobility;
247 }
248 
249 
250 void
252 {
253  NS_LOG_FUNCTION (this << d);
254  m_device = d;
255 }
256 
257 
258 void
260 {
261  NS_LOG_FUNCTION (this << m);
262  m_mobility = m;
263 }
264 
265 
266 void
268 {
269  NS_LOG_FUNCTION (this << c);
270  m_channel = c;
271 }
272 
275 {
276  return m_channel;
277 }
278 
281 {
282  return m_rxSpectrumModel;
283 }
284 
285 
286 void
288 {
289  NS_LOG_FUNCTION (this << txPsd);
290  NS_ASSERT (txPsd);
291  m_txPsd = txPsd;
292 }
293 
294 
295 void
297 {
298  NS_LOG_FUNCTION (this << noisePsd);
299  NS_ASSERT (noisePsd);
300  m_rxSpectrumModel = noisePsd->GetSpectrumModel ();
301  m_interferenceData->SetNoisePowerSpectralDensity (noisePsd);
302  m_interferenceCtrl->SetNoisePowerSpectralDensity (noisePsd);
303 }
304 
305 
306 void
308 {
309  NS_LOG_FUNCTION (this);
310  m_cellId = 0;
311  m_state = IDLE;
312  m_transmissionMode = 0;
313  m_layersNum = 1;
314  m_endTxEvent.Cancel ();
318  m_rxControlMessageList.clear ();
319  m_expectedTbs.clear ();
320  m_txControlMessageList.clear ();
321  m_rxPacketBurstList.clear ();
322  m_txPacketBurst = 0;
323  m_rxSpectrumModel = 0;
324 }
325 
326 
327 
328 void
330 {
331  NS_LOG_FUNCTION (this);
333 }
334 
335 
336 void
338 {
339  NS_LOG_FUNCTION (this);
341 }
342 
343 
344 void
346 {
347  NS_LOG_FUNCTION (this);
349 }
350 
351 void
353 {
354  NS_LOG_FUNCTION (this);
356 }
357 
358 void
360 {
361  NS_LOG_FUNCTION (this);
363 }
364 
365 
366 void
368 {
369  NS_LOG_FUNCTION (this);
371 }
372 
373 void
375 {
376  NS_LOG_FUNCTION (this);
378 }
379 
380 void
382 {
383  NS_LOG_FUNCTION (this);
385 }
386 
387 
390 {
391  return m_antenna;
392 }
393 
394 void
396 {
397  NS_LOG_FUNCTION (this << a);
398  m_antenna = a;
399 }
400 
401 void
403 {
404  ChangeState (newState);
405 }
406 
407 
408 void
410 {
411  NS_LOG_LOGIC (this << " state: " << m_state << " -> " << newState);
412  m_state = newState;
413 }
414 
415 
416 void
418 {
419  m_harqPhyModule = harq;
420 }
421 
422 
423 
424 
425 bool
427 {
428  NS_LOG_FUNCTION (this << pb);
429  NS_LOG_LOGIC (this << " state: " << m_state);
430 
431  m_phyTxStartTrace (pb);
432 
433  switch (m_state)
434  {
435  case RX_DATA:
436  case RX_CTRL:
437  NS_FATAL_ERROR ("cannot TX while RX: according to FDD channel acces, the physical layer for transmission cannot be used for reception");
438  break;
439 
440  case TX:
441  NS_FATAL_ERROR ("cannot TX while already TX: the MAC should avoid this");
442  break;
443 
444  case IDLE:
445  {
446  /*
447  m_txPsd must be setted by the device, according to
448  (i) the available subchannel for transmission
449  (ii) the power transmission
450  */
451  NS_ASSERT (m_txPsd);
452  m_txPacketBurst = pb;
453 
454  // we need to convey some PHY meta information to the receiver
455  // to be used for simulation purposes (e.g., the CellId). This
456  // is done by setting the ctrlMsgList parameter of
457  // LteSpectrumSignalParametersDataFrame
458  ChangeState (TX);
460  Ptr<LteSpectrumSignalParametersDataFrame> txParams = Create<LteSpectrumSignalParametersDataFrame> ();
461  txParams->duration = duration;
462  txParams->txPhy = GetObject<SpectrumPhy> ();
463  txParams->txAntenna = m_antenna;
464  txParams->psd = m_txPsd;
465  txParams->packetBurst = pb;
466  txParams->ctrlMsgList = ctrlMsgList;
467  txParams->cellId = m_cellId;
468  m_channel->StartTx (txParams);
470  }
471  return false;
472  break;
473 
474  default:
475  NS_FATAL_ERROR ("unknown state");
476  return true;
477  break;
478  }
479 }
480 
481 bool
483 {
484  NS_LOG_FUNCTION (this << " PSS " << (uint16_t)pss);
485  NS_LOG_LOGIC (this << " state: " << m_state);
486 
487 
488 // m_phyTxStartTrace (pb);
489 
490  switch (m_state)
491  {
492  case RX_DATA:
493  case RX_CTRL:
494  NS_FATAL_ERROR ("cannot TX while RX: according to FDD channel acces, the physical layer for transmission cannot be used for reception");
495  break;
496 
497  case TX:
498  NS_FATAL_ERROR ("cannot TX while already TX: the MAC should avoid this");
499  break;
500 
501  case IDLE:
502  {
503  /*
504  m_txPsd must be setted by the device, according to
505  (i) the available subchannel for transmission
506  (ii) the power transmission
507  */
508  NS_ASSERT (m_txPsd);
509 
510  // we need to convey some PHY meta information to the receiver
511  // to be used for simulation purposes (e.g., the CellId). This
512  // is done by setting the cellId parameter of
513  // LteSpectrumSignalParametersDlCtrlFrame
514  ChangeState (TX);
516 
517  Ptr<LteSpectrumSignalParametersDlCtrlFrame> txParams = Create<LteSpectrumSignalParametersDlCtrlFrame> ();
518  txParams->duration = DL_CTRL_DURATION;
519  txParams->txPhy = GetObject<SpectrumPhy> ();
520  txParams->txAntenna = m_antenna;
521  txParams->psd = m_txPsd;
522  txParams->cellId = m_cellId;
523  txParams->pss = pss;
524  txParams->ctrlMsgList = ctrlMsgList;
525  m_channel->StartTx (txParams);
526  m_endTxEvent = Simulator::Schedule (DL_CTRL_DURATION, &LteSpectrumPhy::EndTx, this);
527  }
528  return false;
529  break;
530 
531  default:
532  NS_FATAL_ERROR ("unknown state");
533  return true;
534  break;
535  }
536 }
537 
538 
539 bool
541 {
542  NS_LOG_FUNCTION (this);
543  NS_LOG_LOGIC (this << " state: " << m_state);
544 
545  // m_phyTxStartTrace (pb);
546 
547  switch (m_state)
548  {
549  case RX_DATA:
550  case RX_CTRL:
551  NS_FATAL_ERROR ("cannot TX while RX: according to FDD channel acces, the physical layer for transmission cannot be used for reception");
552  break;
553 
554  case TX:
555  NS_FATAL_ERROR ("cannot TX while already TX: the MAC should avoid this");
556  break;
557 
558  case IDLE:
559  {
560  /*
561  m_txPsd must be setted by the device, according to
562  (i) the available subchannel for transmission
563  (ii) the power transmission
564  */
565  NS_ASSERT (m_txPsd);
566  NS_LOG_LOGIC (this << " m_txPsd: " << *m_txPsd);
567 
568  // we need to convey some PHY meta information to the receiver
569  // to be used for simulation purposes (e.g., the CellId). This
570  // is done by setting the cellId parameter of
571  // LteSpectrumSignalParametersDlCtrlFrame
572  ChangeState (TX);
574  Ptr<LteSpectrumSignalParametersUlSrsFrame> txParams = Create<LteSpectrumSignalParametersUlSrsFrame> ();
575  txParams->duration = UL_SRS_DURATION;
576  txParams->txPhy = GetObject<SpectrumPhy> ();
577  txParams->txAntenna = m_antenna;
578  txParams->psd = m_txPsd;
579  txParams->cellId = m_cellId;
580  m_channel->StartTx (txParams);
581  m_endTxEvent = Simulator::Schedule (UL_SRS_DURATION, &LteSpectrumPhy::EndTx, this);
582  }
583  return false;
584  break;
585 
586  default:
587  NS_FATAL_ERROR ("unknown state");
588  return true;
589  break;
590  }
591 }
592 
593 
594 
595 void
597 {
598  NS_LOG_FUNCTION (this);
599  NS_LOG_LOGIC (this << " state: " << m_state);
600 
601  NS_ASSERT (m_state == TX);
602 
604 
606  {
607  for (std::list<Ptr<Packet> >::const_iterator iter = m_txPacketBurst->Begin (); iter
608  != m_txPacketBurst->End (); ++iter)
609  {
610  Ptr<Packet> packet = (*iter)->Copy ();
611  m_ltePhyTxEndCallback (packet);
612  }
613  }
614 
615  m_txPacketBurst = 0;
616  ChangeState (IDLE);
617 }
618 
619 
620 void
622 {
623  NS_LOG_FUNCTION (this << spectrumRxParams);
624  NS_LOG_LOGIC (this << " state: " << m_state);
625 
626  Ptr <const SpectrumValue> rxPsd = spectrumRxParams->psd;
627  Time duration = spectrumRxParams->duration;
628 
629  // the device might start RX only if the signal is of a type
630  // understood by this device - in this case, an LTE signal.
631  Ptr<LteSpectrumSignalParametersDataFrame> lteDataRxParams = DynamicCast<LteSpectrumSignalParametersDataFrame> (spectrumRxParams);
632  if (lteDataRxParams != 0)
633  {
634  m_interferenceData->AddSignal (rxPsd, duration);
635  StartRxData (lteDataRxParams);
636  }
637  else
638  {
639  Ptr<LteSpectrumSignalParametersDlCtrlFrame> lteDlCtrlRxParams = DynamicCast<LteSpectrumSignalParametersDlCtrlFrame> (spectrumRxParams);
640  Ptr<LteSpectrumSignalParametersUlSrsFrame> lteUlSrsRxParams = DynamicCast<LteSpectrumSignalParametersUlSrsFrame> (spectrumRxParams);
641  if ((lteDlCtrlRxParams!=0)||(lteUlSrsRxParams!=0))
642  {
643  m_interferenceCtrl->AddSignal (rxPsd, duration);
644  StartRxCtrl (spectrumRxParams);
645  }
646  else
647  {
648  // other type of signal (could be 3G, GSM, whatever) -> interference
649  m_interferenceData->AddSignal (rxPsd, duration);
650  m_interferenceCtrl->AddSignal (rxPsd, duration);
651  }
652  }
653 
654 }
655 
656 void
658 {
659  NS_LOG_FUNCTION (this);
660  switch (m_state)
661  {
662  case TX:
663  NS_FATAL_ERROR ("cannot RX while TX: according to FDD channel access, the physical layer for transmission cannot be used for reception");
664  break;
665  case RX_CTRL:
666  NS_FATAL_ERROR ("cannot RX Data while receiving control");
667  break;
668  case IDLE:
669  case RX_DATA:
670  // the behavior is similar when
671  // we're IDLE or RX because we can receive more signals
672  // simultaneously (e.g., at the eNB).
673  {
674  // To check if we're synchronized to this signal, we check
675  // for the CellId which is reported in the
676  // LteSpectrumSignalParametersDataFrame
677  if (params->cellId == m_cellId)
678  {
679  NS_LOG_LOGIC (this << " synchronized with this signal (cellId=" << params->cellId << ")");
680  if ((m_rxPacketBurstList.empty ())&&(m_rxControlMessageList.empty ()))
681  {
682  NS_ASSERT (m_state == IDLE);
683  // first transmission, i.e., we're IDLE and we
684  // start RX
686  m_firstRxDuration = params->duration;
687  NS_LOG_LOGIC (this << " scheduling EndRx with delay " << params->duration.GetSeconds () << "s");
689  }
690  else
691  {
693  // sanity check: if there are multiple RX events, they
694  // should occur at the same time and have the same
695  // duration, otherwise the interference calculation
696  // won't be correct
698  && (m_firstRxDuration == params->duration));
699  }
700 
702  if (params->packetBurst)
703  {
704  m_rxPacketBurstList.push_back (params->packetBurst);
705  m_interferenceData->StartRx (params->psd);
706 
707  m_phyRxStartTrace (params->packetBurst);
708  }
709  NS_LOG_DEBUG (this << " insert msgs " << params->ctrlMsgList.size ());
710  m_rxControlMessageList.insert (m_rxControlMessageList.end (), params->ctrlMsgList.begin (), params->ctrlMsgList.end ());
711 
712  NS_LOG_LOGIC (this << " numSimultaneousRxEvents = " << m_rxPacketBurstList.size ());
713  }
714  else
715  {
716  NS_LOG_LOGIC (this << " not in sync with this signal (cellId="
717  << params->cellId << ", m_cellId=" << m_cellId << ")");
718  }
719  }
720  break;
721 
722  default:
723  NS_FATAL_ERROR ("unknown state");
724  break;
725  }
726 
727  NS_LOG_LOGIC (this << " state: " << m_state);
728 }
729 
730 
731 
732 void
734 {
735  NS_LOG_FUNCTION (this);
736  switch (m_state)
737  {
738  case TX:
739  NS_FATAL_ERROR ("cannot RX while TX: according to FDD channel access, the physical layer for transmission cannot be used for reception");
740  break;
741  case RX_DATA:
742  NS_FATAL_ERROR ("cannot RX data while receing control");
743  break;
744  case IDLE:
745  case RX_CTRL:
746  // the behavior is similar when
747  // we're IDLE or RX because we can receive more signals
748  // simultaneously (e.g., at the eNB).
749  {
750  // To check if we're synchronized to this signal, we check
751  // for the CellId which is reported in the
752  // LteSpectrumSignalParametersDlCtrlFrame
753  uint16_t cellId;
754  bool dl;
755  Ptr<LteSpectrumSignalParametersDlCtrlFrame> lteDlCtrlRxParams = DynamicCast<LteSpectrumSignalParametersDlCtrlFrame> (params);
756  if (lteDlCtrlRxParams!=0)
757  {
758  cellId = lteDlCtrlRxParams->cellId;
759  dl = true;
760  }
761  else
762  {
763  Ptr<LteSpectrumSignalParametersUlSrsFrame> lteUlSrsRxParams = DynamicCast<LteSpectrumSignalParametersUlSrsFrame> (params);
764  cellId = lteUlSrsRxParams->cellId;
765  dl = false;
766  }
767  if (dl)
768  {
769  // check presence of PSS for UE measuerements
770  if (lteDlCtrlRxParams->pss == true)
771  {
772  SpectrumValue pssPsd = *params->psd;
774  {
775  m_ltePhyRxPssCallback (cellId, params->psd);
776  }
777  }
778  }
779  if (cellId == m_cellId)
780  {
781  NS_LOG_LOGIC (this << " synchronized with this signal (cellId=" << cellId << ")");
782  if (m_state == IDLE)
783  {
784  // first transmission, i.e., we're IDLE and we
785  // start RX
788  m_firstRxDuration = params->duration;
789  NS_LOG_LOGIC (this << " scheduling EndRx with delay " << params->duration);
790  if (dl==true)
791  {
792  // store the DCIs
793  m_rxControlMessageList = lteDlCtrlRxParams->ctrlMsgList;
795  }
796  else
797  {
799  }
800  }
801  else if (m_state == RX_CTRL)
802  {
803  // sanity check: if there are multiple RX events, they
804  // should occur at the same time and have the same
805  // duration, otherwise the interference calculation
806  // won't be correct
808  && (m_firstRxDuration == params->duration));
809  }
810 
812  m_interferenceCtrl->StartRx (params->psd);
813 
814 // NS_LOG_LOGIC (this << " numSimultaneousRxEvents = " << m_rxPacketBurstList.size ());
815  }
816  else
817  {
818  NS_LOG_LOGIC (this << " not in sync with this signal (cellId="
819  << cellId << ", m_cellId=" << m_cellId << ")");
820  }
821  }
822  break;
823 
824  default:
825  NS_FATAL_ERROR ("unknown state");
826  break;
827  }
828 
829  NS_LOG_LOGIC (this << " state: " << m_state);
830 }
831 
832 
833 void
835 {
836  NS_LOG_FUNCTION (this << sinr);
837  m_sinrPerceived = sinr;
838 }
839 
840 
841 void
842 LteSpectrumPhy::AddExpectedTb (uint16_t rnti, uint8_t ndi, uint16_t size, uint8_t mcs, std::vector<int> map, uint8_t layer, uint8_t harqId,uint8_t rv, bool downlink)
843 {
844  NS_LOG_FUNCTION (this << " rnti: " << rnti << " NDI " << (uint16_t)ndi << " size " << size << " mcs " << (uint16_t)mcs << " layer " << (uint16_t)layer << " rv " << (uint16_t)rv);
845  TbId_t tbId;
846  tbId.m_rnti = rnti;
847  tbId.m_layer = layer;
848  expectedTbs_t::iterator it;
849  it = m_expectedTbs.find (tbId);
850  if (it != m_expectedTbs.end ())
851  {
852  // migth be a TB of an unreceived packet (due to high progpalosses)
853  m_expectedTbs.erase (it);
854  }
855  // insert new entry
856  tbInfo_t tbInfo = {ndi, size, mcs, map, harqId, rv, 0.0, downlink, false, false};
857  m_expectedTbs.insert (std::pair<TbId_t, tbInfo_t> (tbId,tbInfo));
858 }
859 
860 
861 void
863 {
864  NS_LOG_FUNCTION (this);
865  NS_LOG_LOGIC (this << " state: " << m_state);
866 
868 
869  // this will trigger CQI calculation and Error Model evaluation
870  // as a side effect, the error model should update the error status of all TBs
871  m_interferenceData->EndRx ();
872  NS_LOG_DEBUG (this << " No. of burts " << m_rxPacketBurstList.size ());
873  NS_LOG_DEBUG (this << " Expected TBs " << m_expectedTbs.size ());
874  expectedTbs_t::iterator itTb = m_expectedTbs.begin ();
875 
876  // apply transmission mode gain
877  NS_LOG_DEBUG (this << " txMode " << (uint16_t)m_transmissionMode << " gain " << m_txModeGain.at (m_transmissionMode));
880 
881  while (itTb!=m_expectedTbs.end ())
882  {
883  if ((m_dataErrorModelEnabled)&&(m_rxPacketBurstList.size ()>0)) // avoid to check for errors when there is no actual data transmitted
884  {
885  // retrieve HARQ info
886  HarqProcessInfoList_t harqInfoList;
887  if ((*itTb).second.ndi == 0)
888  {
889  // TB retxed: retrieve HARQ history
890  uint16_t ulHarqId = 0;
891  if ((*itTb).second.downlink)
892  {
893  harqInfoList = m_harqPhyModule->GetHarqProcessInfoDl ((*itTb).second.harqProcessId, (*itTb).first.m_layer);
894  }
895  else
896  {
897  harqInfoList = m_harqPhyModule->GetHarqProcessInfoUl ((*itTb).first.m_rnti, ulHarqId);
898  }
899  }
900  TbStats_t tbStats = LteMiErrorModel::GetTbDecodificationStats (m_sinrPerceived, (*itTb).second.rbBitmap, (*itTb).second.size, (*itTb).second.mcs, harqInfoList);
901  (*itTb).second.mi = tbStats.mi;
902  (*itTb).second.corrupt = m_random->GetValue () > tbStats.tbler ? false : true;
903  NS_LOG_DEBUG (this << "RNTI " << (*itTb).first.m_rnti << " size " << (*itTb).second.size << " mcs " << (uint32_t)(*itTb).second.mcs << " bitmap " << (*itTb).second.rbBitmap.size () << " layer " << (uint16_t)(*itTb).first.m_layer << " TBLER " << tbStats.tbler << " corrupted " << (*itTb).second.corrupt);
904  // fire traces on DL/UL reception PHY stats
907  params.m_cellId = m_cellId;
908  params.m_imsi = 0; // it will be set by DlPhyTransmissionCallback in LteHelper
909  params.m_rnti = (*itTb).first.m_rnti;
910  params.m_txMode = m_transmissionMode;
911  params.m_layer = (*itTb).first.m_layer;
912  params.m_mcs = (*itTb).second.mcs;
913  params.m_size = (*itTb).second.size;
914  params.m_rv = (*itTb).second.rv;
915  params.m_ndi = (*itTb).second.ndi;
916  params.m_correctness = (uint8_t)!(*itTb).second.corrupt;
917  if ((*itTb).second.downlink)
918  {
919  // DL
920  m_dlPhyReception (params);
921  }
922  else
923  {
924  // UL
925  params.m_rv = harqInfoList.size ();
926  m_ulPhyReception (params);
927  }
928  }
929 
930  itTb++;
931  }
932  std::map <uint16_t, DlInfoListElement_s> harqDlInfoMap;
933  for (std::list<Ptr<PacketBurst> >::const_iterator i = m_rxPacketBurstList.begin ();
934  i != m_rxPacketBurstList.end (); ++i)
935  {
936  for (std::list<Ptr<Packet> >::const_iterator j = (*i)->Begin (); j != (*i)->End (); ++j)
937  {
938  // retrieve TB info of this packet
939  LteRadioBearerTag tag;
940  (*j)->PeekPacketTag (tag);
941  TbId_t tbId;
942  tbId.m_rnti = tag.GetRnti ();
943  tbId.m_layer = tag.GetLayer ();
944  itTb = m_expectedTbs.find (tbId);
945  NS_LOG_INFO (this << " Packet of " << tbId.m_rnti << " layer " << (uint16_t) tag.GetLayer ());
946  if (itTb!=m_expectedTbs.end ())
947  {
948  if (!(*itTb).second.corrupt)
949  {
950  m_phyRxEndOkTrace (*j);
951 
953  {
955  }
956  }
957  else
958  {
959  // TB received with errors
961  }
962 
963  // send HARQ feedback (if not already done for this TB)
964  if (!(*itTb).second.harqFeedbackSent)
965  {
966  (*itTb).second.harqFeedbackSent = true;
967  if (!(*itTb).second.downlink)
968  {
969  UlInfoListElement_s harqUlInfo;
970  harqUlInfo.m_rnti = tbId.m_rnti;
971  harqUlInfo.m_tpc = 0;
972  if ((*itTb).second.corrupt)
973  {
975  NS_LOG_DEBUG (this << " RNTI " << tbId.m_rnti << " send UL-HARQ-NACK");
976  m_harqPhyModule->UpdateUlHarqProcessStatus (tbId.m_rnti, (*itTb).second.mi, (*itTb).second.size, (*itTb).second.size / EffectiveCodingRate [(*itTb).second.mcs]);
977  }
978  else
979  {
981  NS_LOG_DEBUG (this << " RNTI " << tbId.m_rnti << " send UL-HARQ-ACK");
982  m_harqPhyModule->ResetUlHarqProcessStatus (tbId.m_rnti, (*itTb).second.harqProcessId);
983  }
985  {
986  m_ltePhyUlHarqFeedbackCallback (harqUlInfo);
987  }
988  }
989  else
990  {
991  std::map <uint16_t, DlInfoListElement_s>::iterator itHarq = harqDlInfoMap.find (tbId.m_rnti);
992  if (itHarq==harqDlInfoMap.end ())
993  {
994  DlInfoListElement_s harqDlInfo;
996  harqDlInfo.m_rnti = tbId.m_rnti;
997  harqDlInfo.m_harqProcessId = (*itTb).second.harqProcessId;
998  if ((*itTb).second.corrupt)
999  {
1000  harqDlInfo.m_harqStatus.at (tbId.m_layer) = DlInfoListElement_s::NACK;
1001  NS_LOG_DEBUG (this << " RNTI " << tbId.m_rnti << " harqId " << (uint16_t)(*itTb).second.harqProcessId << " layer " <<(uint16_t)tbId.m_layer << " send DL-HARQ-NACK");
1002  m_harqPhyModule->UpdateDlHarqProcessStatus ((*itTb).second.harqProcessId, tbId.m_layer, (*itTb).second.mi, (*itTb).second.size, (*itTb).second.size / EffectiveCodingRate [(*itTb).second.mcs]);
1003  }
1004  else
1005  {
1006 
1007  harqDlInfo.m_harqStatus.at (tbId.m_layer) = DlInfoListElement_s::ACK;
1008  NS_LOG_DEBUG (this << " RNTI " << tbId.m_rnti << " harqId " << (uint16_t)(*itTb).second.harqProcessId << " layer " <<(uint16_t)tbId.m_layer << " size " << (*itTb).second.size << " send DL-HARQ-ACK");
1009  m_harqPhyModule->ResetDlHarqProcessStatus ((*itTb).second.harqProcessId);
1010  }
1011  harqDlInfoMap.insert (std::pair <uint16_t, DlInfoListElement_s> (tbId.m_rnti, harqDlInfo));
1012  }
1013  else
1014  {
1015  if ((*itTb).second.corrupt)
1016  {
1017  (*itHarq).second.m_harqStatus.at (tbId.m_layer) = DlInfoListElement_s::NACK;
1018  NS_LOG_DEBUG (this << " RNTI " << tbId.m_rnti << " harqId " << (uint16_t)(*itTb).second.harqProcessId << " layer " <<(uint16_t)tbId.m_layer << " size " << (*itHarq).second.m_harqStatus.size () << " send DL-HARQ-NACK");
1019  m_harqPhyModule->UpdateDlHarqProcessStatus ((*itTb).second.harqProcessId, tbId.m_layer, (*itTb).second.mi, (*itTb).second.size, (*itTb).second.size / EffectiveCodingRate [(*itTb).second.mcs]);
1020  }
1021  else
1022  {
1023  NS_ASSERT_MSG (tbId.m_layer < (*itHarq).second.m_harqStatus.size (), " layer " << (uint16_t)tbId.m_layer);
1024  (*itHarq).second.m_harqStatus.at (tbId.m_layer) = DlInfoListElement_s::ACK;
1025  NS_LOG_DEBUG (this << " RNTI " << tbId.m_rnti << " harqId " << (uint16_t)(*itTb).second.harqProcessId << " layer " << (uint16_t)tbId.m_layer << " size " << (*itHarq).second.m_harqStatus.size () << " send DL-HARQ-ACK");
1026  m_harqPhyModule->ResetDlHarqProcessStatus ((*itTb).second.harqProcessId);
1027  }
1028  }
1029  } // end if ((*itTb).second.downlink) HARQ
1030  } // end if (!(*itTb).second.harqFeedbackSent)
1031  }
1032  }
1033  }
1034 
1035  // send DL HARQ feedback to LtePhy
1036  std::map <uint16_t, DlInfoListElement_s>::iterator itHarq;
1037  for (itHarq = harqDlInfoMap.begin (); itHarq != harqDlInfoMap.end (); itHarq++)
1038  {
1040  {
1041  m_ltePhyDlHarqFeedbackCallback ((*itHarq).second);
1042  }
1043  }
1044  // forward control messages of this frame to LtePhy
1045  if (!m_rxControlMessageList.empty ())
1046  {
1048  {
1050  }
1051  }
1052  ChangeState (IDLE);
1053  m_rxPacketBurstList.clear ();
1054  m_rxControlMessageList.clear ();
1055  m_expectedTbs.clear ();
1056 }
1057 
1058 
1059 void
1061 {
1062  NS_LOG_FUNCTION (this);
1063  NS_LOG_LOGIC (this << " state: " << m_state);
1064 
1065  NS_ASSERT (m_state == RX_CTRL);
1066 
1067  // this will trigger CQI calculation and Error Model evaluation
1068  // as a side effect, the error model should update the error status of all TBs
1069  m_interferenceCtrl->EndRx ();
1070  // apply transmission mode gain
1071  NS_LOG_DEBUG (this << " txMode " << (uint16_t)m_transmissionMode << " gain " << m_txModeGain.at (m_transmissionMode));
1073  if (m_transmissionMode>0)
1074  {
1075  // in case of MIMO, ctrl is always txed as TX diversity
1076  m_sinrPerceived *= m_txModeGain.at (1);
1077  }
1078 // m_sinrPerceived *= m_txModeGain.at (m_transmissionMode);
1079  bool error = false;
1081  {
1084  error = m_random->GetValue () > errorRate ? false : true;
1085  NS_LOG_DEBUG (this << " PCFICH-PDCCH Decodification, errorRate " << errorRate << " error " << error);
1086  }
1087 
1088  if (!error)
1089  {
1091  {
1092  NS_LOG_DEBUG (this << " PCFICH-PDCCH Rxed OK");
1094  }
1095  }
1096  else
1097  {
1099  {
1100  NS_LOG_DEBUG (this << " PCFICH-PDCCH Error");
1102  }
1103  }
1104  ChangeState (IDLE);
1105  m_rxControlMessageList.clear ();
1106 }
1107 
1108 void
1110 {
1111  NS_ASSERT (m_state == RX_CTRL);
1112  ChangeState (IDLE);
1113  m_interferenceCtrl->EndRx ();
1114  // nothing to do (used only for SRS at this stage)
1115 }
1116 
1117 void
1118 LteSpectrumPhy::SetCellId (uint16_t cellId)
1119 {
1120  m_cellId = cellId;
1121 }
1122 
1123 
1124 void
1126 {
1127  m_interferenceCtrl->AddRsPowerChunkProcessor (p);
1128 }
1129 
1130 void
1132 {
1133  m_interferenceData->AddRsPowerChunkProcessor (p);
1134 }
1135 
1136 void
1138 {
1139  m_interferenceData->AddSinrChunkProcessor (p);
1140 }
1141 
1142 void
1144 {
1145  m_interferenceCtrl->AddInterferenceChunkProcessor (p);
1146 }
1147 
1148 void
1150 {
1151  m_interferenceData->AddInterferenceChunkProcessor (p);
1152 }
1153 
1154 void
1156 {
1157  m_interferenceCtrl->AddSinrChunkProcessor (p);
1158 }
1159 
1160 void
1162 {
1163  NS_LOG_FUNCTION (this << (uint16_t) txMode);
1164  NS_ASSERT_MSG (txMode < m_txModeGain.size (), "TransmissionMode not available: 1.." << m_txModeGain.size ());
1165  m_transmissionMode = txMode;
1167 }
1168 
1169 
1170 void
1171 LteSpectrumPhy::SetTxModeGain (uint8_t txMode, double gain)
1172 {
1173  NS_LOG_FUNCTION (this << " txmode " << (uint16_t)txMode << " gain " << gain);
1174  // convert to linear
1175  gain = std::pow (10.0, (gain / 10.0));
1176  if (m_txModeGain.size () < txMode)
1177  {
1178  m_txModeGain.resize (txMode);
1179  }
1180  std::vector <double> temp;
1181  temp = m_txModeGain;
1182  m_txModeGain.clear ();
1183  for (uint8_t i = 0; i < temp.size (); i++)
1184  {
1185  if (i==txMode-1)
1186  {
1187  m_txModeGain.push_back (gain);
1188  }
1189  else
1190  {
1191  m_txModeGain.push_back (temp.at (i));
1192  }
1193  }
1194 }
1195 
1196 int64_t
1198 {
1199  NS_LOG_FUNCTION (this << stream);
1200  m_random->SetStream (stream);
1201  return 1;
1202 }
1203 
1204 
1205 
1206 } // namespace ns3
static const Time UL_SRS_DURATION
Ptr< LteHarqPhy > m_harqPhyModule
void SetLtePhyTxEndCallback(LtePhyTxEndCallback c)
set the callback for the end of a TX, as part of the interconnections between the PHY and the MAC ...
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:95
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
void SetStream(int64_t stream)
Specifies the stream number for this RNG stream.
void StartRxData(Ptr< LteSpectrumSignalParametersDataFrame > params)
Abstract base class for Spectrum-aware PHY layers.
Definition: spectrum-phy.h:45
Ptr< LteInterference > m_interferenceCtrl
AttributeValue implementation for Boolean.
Definition: boolean.h:34
LtePhyRxCtrlEndOkCallback m_ltePhyRxCtrlEndOkCallback
uint8_t m_mcs
MCS for transport block.
Definition: lte-common.h:149
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:44
TracedCallback< Ptr< const PacketBurst > > m_phyTxEndTrace
void AddDataSinrChunkProcessor(Ptr< LteChunkProcessor > p)
uint16_t GetRnti(void) const
void SetState(State newState)
Set the state of the phy layer.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: boolean.h:81
bool IsNull(void) const
Check for null implementation.
Definition: callback.h:1072
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:61
uint8_t m_rv
the redundancy version (HARQ)
Definition: lte-common.h:151
TracedCallback< Ptr< const Packet > > m_phyRxEndErrorTrace
void SetLtePhyRxDataEndErrorCallback(LtePhyRxDataEndErrorCallback c)
set the callback for the end of a RX in error, as part of the interconnections between the PHY and th...
Channel is IDLE, no packet is being transmitted.
Definition: csma-channel.h:62
void SetTxModeGain(uint8_t txMode, double gain)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
LtePhyRxCtrlEndErrorCallback m_ltePhyRxCtrlEndErrorCallback
void SetTransmissionMode(uint8_t txMode)
Ptr< SpectrumChannel > m_channel
std::list< Ptr< LteControlMessage > > m_txControlMessageList
LtePhyTxEndCallback m_ltePhyTxEndCallback
virtual void DoDispose(void)
Destructor implementation.
Definition: object.cc:338
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:244
#define NS_FATAL_ERROR(msg)
Fatal error handling.
Definition: fatal-error.h:100
expectedTbs_t m_expectedTbs
Ptr< LteInterference > m_interferenceData
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
Definition: simulator.h:819
Ptr< SpectrumChannel > GetChannel()
LtePhyRxDataEndErrorCallback m_ltePhyRxDataEndErrorCallback
See section 4.3.12 ulInfoListElement.
static TbStats_t GetTbDecodificationStats(const SpectrumValue &sinr, const std::vector< int > &map, uint16_t size, uint8_t mcs, HarqProcessInfoList_t miHistory)
run the error-model algorithm for the specified TB
void AddCtrlSinrChunkProcessor(Ptr< LteChunkProcessor > p)
void SetNoisePowerSpectralDensity(Ptr< const SpectrumValue > noisePsd)
set the noise power spectral density
Ptr< UniformRandomVariable > m_random
Provides uniform random variables.
void SetDevice(Ptr< NetDevice > d)
set the associated NetDevice instance
std::list< Ptr< PacketBurst > > m_rxPacketBurstList
static const Time DL_CTRL_DURATION
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
void AddInterferenceCtrlChunkProcessor(Ptr< LteChunkProcessor > p)
LteChunkProcessor devoted to evaluate interference + noise power in control symbols of the subframe...
void SetLtePhyUlHarqFeedbackCallback(LtePhyUlHarqFeedbackCallback c)
set the callback for the UL HARQ feedback as part of the interconnections between the LteSpectrumPhy ...
void ChangeState(State newState)
std::list< Ptr< LteControlMessage > > m_rxControlMessageList
void SetLtePhyRxCtrlEndOkCallback(LtePhyRxCtrlEndOkCallback c)
set the callback for the successful end of a RX ctrl frame, as part of the interconnections between t...
void SetTxPowerSpectralDensity(Ptr< SpectrumValue > txPsd)
set the Power Spectral Density of outgoing signals in W/Hz.
void SetLtePhyRxCtrlEndErrorCallback(LtePhyRxCtrlEndErrorCallback c)
set the callback for the erroneous end of a RX ctrl frame, as part of the interconnections between th...
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:883
Ptr< AntennaModel > m_antenna
TracedCallback< Ptr< const PacketBurst > > m_phyRxStartTrace
LtePhyRxDataEndOkCallback m_ltePhyRxDataEndOkCallback
void AddDataPowerChunkProcessor(Ptr< LteChunkProcessor > p)
static uint8_t TxMode2LayerNum(uint8_t txMode)
Definition: lte-common.cc:169
Ptr< SampleEmitter > s
static const double EffectiveCodingRate[29]
bool StartTxDataFrame(Ptr< PacketBurst > pb, std::list< Ptr< LteControlMessage > > ctrlMsgList, Time duration)
Start a transmission of data frame in DL and UL.
uint8_t m_layer
the layer (cw) of the transmission
Definition: lte-common.h:148
Ptr< MobilityModel > m_mobility
void SetHarqPhyModule(Ptr< LteHarqPhy > harq)
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
static double GetPcfichPdcchError(const SpectrumValue &sinr)
run the error-model algorithm for the specified PCFICH+PDCCH channels
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:252
#define list
virtual void DoDispose()
Destructor implementation.
See section 4.3.23 dlInfoListElement.
bool operator<(const int64x64_t &lhs, const int64x64_t &rhs)
Less than operator.
Definition: int64x64-128.h:350
void StartRxCtrl(Ptr< SpectrumSignalParameters > params)
Ptr< NetDevice > GetDevice()
get the associated NetDevice instance
Ptr< SpectrumValue > m_txPsd
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition: angles.cc:42
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
Definition: packet.cc:122
void SetAntenna(Ptr< AntennaModel > a)
set the AntennaModel to be used
uint16_t m_rnti
uint8_t m_ndi
new data indicator flag
Definition: lte-common.h:152
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void AddExpectedTb(uint16_t rnti, uint8_t ndi, uint16_t size, uint8_t mcs, std::vector< int > map, uint8_t layer, uint8_t harqId, uint8_t rv, bool downlink)
Ptr< const SpectrumModel > GetRxSpectrumModel() const
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
Ptr< AntennaModel > GetRxAntenna()
get the AntennaModel used by the NetDevice for reception
Ptr< MobilityModel > GetMobility()
get the associated MobilityModel instance
Ptr< const SpectrumModel > m_rxSpectrumModel
LtePhyDlHarqFeedbackCallback m_ltePhyDlHarqFeedbackCallback
double GetValue(double min, double max)
Returns a random double from the uniform distribution with the specified range.
std::vector< enum HarqStatus_e > m_harqStatus
Ptr< PacketBurst > m_txPacketBurst
void SetChannel(Ptr< SpectrumChannel > c)
Set the channel attached to this device.
void AddInterferenceDataChunkProcessor(Ptr< LteChunkProcessor > p)
LteChunkProcessor devoted to evaluate interference + noise power in data symbols of the subframe...
uint8_t m_txMode
the transmission Mode
Definition: lte-common.h:147
uint16_t m_size
Size of transport block.
Definition: lte-common.h:150
void Reset()
reset the internal state
TracedCallback< PhyReceptionStatParameters > m_ulPhyReception
Trace information regarding PHY stats from UL Rx perspective PhyReceptionStatParameters (see lte-comm...
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:223
Ptr< NetDevice > m_device
uint8_t m_correctness
correctness of the TB received
Definition: lte-common.h:153
LtePhyUlHarqFeedbackCallback m_ltePhyUlHarqFeedbackCallback
static TypeId GetTypeId(void)
TracedCallback< Ptr< const Packet > > m_phyRxEndOkTrace
bool StartTxDlCtrlFrame(std::list< Ptr< LteControlMessage > > ctrlMsgList, bool pss)
Start a transmission of control frame in DL.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:84
uint16_t m_rnti
C-RNTI scheduled.
Definition: lte-common.h:146
uint16_t m_cellId
Cell ID of the attached Enb.
Definition: lte-common.h:144
void SetLtePhyDlHarqFeedbackCallback(LtePhyDlHarqFeedbackCallback c)
set the callback for the DL HARQ feedback as part of the interconnections between the LteSpectrumPhy ...
void SetLtePhyRxPssCallback(LtePhyRxPssCallback c)
set the callback for the reception of the PSS as part of the interconnections between the LteSpectrum...
LtePhyRxPssCallback m_ltePhyRxPssCallback
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:236
bool operator==(const EventId &a, const EventId &b)
Definition: event-id.cc:95
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
Definition: event-id.cc:53
Tag used to define the RNTI and LC id for each MAC packet trasmitted.
void SetLtePhyRxDataEndOkCallback(LtePhyRxDataEndOkCallback c)
set the callback for the successful end of a RX, as part of the interconnections between the PHY and ...
void AddRsPowerChunkProcessor(Ptr< LteChunkProcessor > p)
void SetMobility(Ptr< MobilityModel > m)
Set the mobility model associated with this device.
enum ns3::UlInfoListElement_s::ReceptionStatus_e m_receptionStatus
void StartRx(Ptr< SpectrumSignalParameters > params)
Notify the SpectrumPhy instance of an incoming signal.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
Definition: double.h:41
TracedCallback< Ptr< const PacketBurst > > m_phyTxStartTrace
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:190
Set of values corresponding to a given SpectrumModel.
uint64_t m_imsi
IMSI of the scheduled UE.
Definition: lte-common.h:145
a unique identifier for an interface.
Definition: type-id.h:51
uint8_t GetLayer(void) const
void UpdateSinrPerceived(const SpectrumValue &sinr)
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:331
TypeId SetParent(TypeId tid)
Definition: type-id.cc:631
bool StartTxUlSrsFrame()
Start a transmission of control frame in UL.
void SetCellId(uint16_t cellId)
SpectrumValue m_sinrPerceived
std::vector< double > m_txModeGain
TracedCallback< PhyReceptionStatParameters > m_dlPhyReception
Trace information regarding PHY stats from DL Rx perspective PhyReceptionStatParameters (see lte-comm...
std::vector< HarqProcessInfoElement_t > HarqProcessInfoList_t
Definition: lte-harq-phy.h:47