A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lte-ue-phy.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
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: Giuseppe Piro <g.piro@poliba.it>
19  * Marco Miozzo <marco.miozzo@cttc.es>
20  * Nicola Baldo <nbaldo@cttc.es>
21  */
22 
23 #include <ns3/object-factory.h>
24 #include <ns3/log.h>
25 #include <cfloat>
26 #include <cmath>
27 #include <ns3/simulator.h>
28 #include <ns3/double.h>
29 #include "lte-ue-phy.h"
30 #include "lte-enb-phy.h"
31 #include "lte-net-device.h"
32 #include "lte-ue-net-device.h"
33 #include "lte-enb-net-device.h"
35 #include "lte-amc.h"
36 #include "lte-ue-mac.h"
37 #include "ff-mac-common.h"
39 #include <ns3/lte-common.h>
40 #include <ns3/pointer.h>
41 
42 NS_LOG_COMPONENT_DEFINE ("LteUePhy");
43 
44 namespace ns3 {
45 
46 
47 
48 
49 // duration of data portion of UL subframe
50 // = TTI - 1 symbol for SRS - 1ns as margin to avoid overlapping simulator events
51 // (symbol duration in nanoseconds = TTI / 14 (rounded))
52 // in other words, duration of data portion of UL subframe = TTI*(13/14) -1ns
53 static const Time UL_DATA_DURATION = NanoSeconds (1e6 - 71429 - 1);
54 
55 // delay from subframe start to transmission of SRS
56 // = TTI - 1 symbol for SRS
57 static const Time UL_SRS_DELAY_FROM_SUBFRAME_START = NanoSeconds (1e6 - 71429);
58 
59 
60 
61 
63 // member SAP forwarders
65 
66 
68 {
69 public:
71 
72  // inherited from LtePhySapProvider
73  virtual void SendMacPdu (Ptr<Packet> p);
75  virtual void SendRachPreamble (uint32_t prachId, uint32_t raRnti);
76 
77 private:
79 };
80 
82 {
83 
84 }
85 
86 void
88 {
89  m_phy->DoSendMacPdu (p);
90 }
91 
92 void
94 {
96 }
97 
98 void
99 UeMemberLteUePhySapProvider::SendRachPreamble (uint32_t prachId, uint32_t raRnti)
100 {
101  m_phy->DoSendRachPreamble (prachId, raRnti);
102 }
103 
104 
106 // LteUePhy methods
108 
109 
111 
112 
114 {
115  NS_LOG_FUNCTION (this);
116  NS_FATAL_ERROR ("This constructor should not be called");
117 }
118 
120  : LtePhy (dlPhy, ulPhy),
121  m_p10CqiPeriocity (MilliSeconds (1)), // ideal behavior
122  m_a30CqiPeriocity (MilliSeconds (1)), // ideal behavior
123  m_uePhySapUser (0),
124  m_ueCphySapUser (0),
125  m_subframeNo (0),
126  m_rsReceivedPowerUpdated (false),
127  m_rsInterferencePowerUpdated (false),
128  m_pssReceived (false),
129  m_ueMeasurementsFilterPeriod (MilliSeconds (200)),
130  m_ueMeasurementsFilterLast (MilliSeconds (0)),
131  m_rsrpSinrSampleCounter (0)
132 {
133  m_amc = CreateObject <LteAmc> ();
137 
138  NS_ASSERT_MSG (Simulator::Now ().GetNanoSeconds () == 0,
139  "Cannot create UE devices after simulation started");
142 
143  DoReset ();
144 }
145 
146 
148 {
149  m_txModeGain.clear ();
150 }
151 
152 void
154 {
155  NS_LOG_FUNCTION (this);
156  delete m_uePhySapProvider;
157  delete m_ueCphySapProvider;
159 }
160 
161 
162 
163 TypeId
165 {
166  static TypeId tid = TypeId ("ns3::LteUePhy")
167  .SetParent<LtePhy> ()
168  .AddConstructor<LteUePhy> ()
169  .AddAttribute ("TxPower",
170  "Transmission power in dBm",
171  DoubleValue (10.0),
172  MakeDoubleAccessor (&LteUePhy::SetTxPower,
174  MakeDoubleChecker<double> ())
175  .AddAttribute ("NoiseFigure",
176  "Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver."
177  " According to Wikipedia (http://en.wikipedia.org/wiki/Noise_figure), this is "
178  "\"the difference in decibels (dB) between"
179  " the noise output of the actual receiver to the noise output of an "
180  " ideal receiver with the same overall gain and bandwidth when the receivers "
181  " are connected to sources at the standard noise temperature T0.\" "
182  "In this model, we consider T0 = 290K.",
183  DoubleValue (9.0),
184  MakeDoubleAccessor (&LteUePhy::SetNoiseFigure,
186  MakeDoubleChecker<double> ())
187  .AddAttribute ("TxMode1Gain",
188  "Transmission mode 1 gain in dB",
189  DoubleValue (0.0),
190  MakeDoubleAccessor (&LteUePhy::SetTxMode1Gain ),
191  MakeDoubleChecker<double> ())
192  .AddAttribute ("TxMode2Gain",
193  "Transmission mode 2 gain in dB",
194  DoubleValue (4.2),
195  MakeDoubleAccessor (&LteUePhy::SetTxMode2Gain ),
196  MakeDoubleChecker<double> ())
197  .AddAttribute ("TxMode3Gain",
198  "Transmission mode 3 gain in dB",
199  DoubleValue (-2.8),
200  MakeDoubleAccessor (&LteUePhy::SetTxMode3Gain ),
201  MakeDoubleChecker<double> ())
202  .AddAttribute ("TxMode4Gain",
203  "Transmission mode 4 gain in dB",
204  DoubleValue (0.0),
205  MakeDoubleAccessor (&LteUePhy::SetTxMode4Gain ),
206  MakeDoubleChecker<double> ())
207  .AddAttribute ("TxMode5Gain",
208  "Transmission mode 5 gain in dB",
209  DoubleValue (0.0),
210  MakeDoubleAccessor (&LteUePhy::SetTxMode5Gain ),
211  MakeDoubleChecker<double> ())
212  .AddAttribute ("TxMode6Gain",
213  "Transmission mode 6 gain in dB",
214  DoubleValue (0.0),
215  MakeDoubleAccessor (&LteUePhy::SetTxMode6Gain ),
216  MakeDoubleChecker<double> ())
217  .AddAttribute ("TxMode7Gain",
218  "Transmission mode 7 gain in dB",
219  DoubleValue (0.0),
220  MakeDoubleAccessor (&LteUePhy::SetTxMode7Gain ),
221  MakeDoubleChecker<double> ())
222  .AddTraceSource ("ReportCurrentCellRsrpSinr",
223  "RSRP and SINR statistics.",
225  .AddAttribute ("RsrpSinrSamplePeriod",
226  "The sampling period for reporting RSRP-SINR stats (default value 1)",
227  UintegerValue (1),
228  MakeUintegerAccessor (&LteUePhy::m_rsrpSinrSamplePeriod),
229  MakeUintegerChecker<uint16_t> ())
230  .AddTraceSource ("UlPhyTransmission",
231  "DL transmission PHY layer statistics.",
233  .AddAttribute ("DlSpectrumPhy",
234  "The downlink LteSpectrumPhy associated to this LtePhy",
236  PointerValue (),
237  MakePointerAccessor (&LteUePhy::GetDlSpectrumPhy),
238  MakePointerChecker <LteSpectrumPhy> ())
239  .AddAttribute ("UlSpectrumPhy",
240  "The uplink LteSpectrumPhy associated to this LtePhy",
242  PointerValue (),
243  MakePointerAccessor (&LteUePhy::GetUlSpectrumPhy),
244  MakePointerChecker <LteSpectrumPhy> ())
245  .AddAttribute ("RsrqUeMeasThreshold",
246  "Receive threshold for PSS on RSRQ [dB]",
247  DoubleValue (-1000.0),
248  MakeDoubleAccessor (&LteUePhy::m_pssReceptionThreshold ),
249  MakeDoubleChecker<double> ())
250  .AddAttribute ("UeMeasurementsFilterPeriod",
251  "Time period for reporting UE measurements (default 200 ms.) ",
252  TimeValue (MilliSeconds (200)),
253  MakeTimeAccessor (&LteUePhy::m_ueMeasurementsFilterPeriod),
254  MakeTimeChecker ())
255  .AddTraceSource ("ReportUeMeasurements",
256  "Report UE measurements RSRP (dBm) and RSRQ (dB).",
258  ;
259  return tid;
260 }
261 
262 void
264 {
265  NS_LOG_FUNCTION (this);
267 }
268 
269 void
271 {
272  NS_LOG_FUNCTION (this);
273  m_uePhySapUser = s;
274 }
275 
278 {
279  NS_LOG_FUNCTION (this);
280  return (m_uePhySapProvider);
281 }
282 
283 
284 void
286 {
287  NS_LOG_FUNCTION (this);
288  m_ueCphySapUser = s;
289 }
290 
293 {
294  NS_LOG_FUNCTION (this);
295  return (m_ueCphySapProvider);
296 }
297 
298 void
300 {
301  NS_LOG_FUNCTION (this << nf);
302  m_noiseFigure = nf;
303 }
304 
305 double
307 {
308  NS_LOG_FUNCTION (this);
309  return m_noiseFigure;
310 }
311 
312 void
314 {
315  NS_LOG_FUNCTION (this << pow);
316  m_txPower = pow;
317 }
318 
319 double
321 {
322  NS_LOG_FUNCTION (this);
323  return m_txPower;
324 }
325 
326 
327 uint8_t
329 {
330  return (m_macChTtiDelay);
331 }
332 
335 {
336  return m_downlinkSpectrumPhy;
337 }
338 
341 {
342  return m_uplinkSpectrumPhy;
343 }
344 
345 void
347 {
348  NS_LOG_FUNCTION (this);
349 
350  SetMacPdu (p);
351 }
352 
353 
354 void
356 {
358 }
359 
360 void
362 {
363  NS_LOG_FUNCTION (this);
364 
366 
368  m_uplinkSpectrumPhy->SetTxPowerSpectralDensity (txPsd);
369 }
370 
371 
372 void
373 LteUePhy::SetSubChannelsForReception (std::vector <int> mask)
374 {
375  NS_LOG_FUNCTION (this);
377 }
378 
379 
380 std::vector <int>
382 {
383  NS_LOG_FUNCTION (this);
385 }
386 
387 
388 std::vector <int>
390 {
391  NS_LOG_FUNCTION (this);
393 }
394 
395 
398 {
399  NS_LOG_FUNCTION (this);
400  LteSpectrumValueHelper psdHelper;
402 
403  return psd;
404 }
405 
406 void
408 {
409  NS_LOG_FUNCTION (this);
410 
411  if ((!(m_dlConfigured && m_ulConfigured)) || (m_rnti == 0))
412  {
413  // abort method, the UE is still not registered
414  m_pssList.clear ();
415  return;
416  }
417 
418  // check periodic wideband CQI
420  {
421  Ptr<LteUeNetDevice> thisDevice = GetDevice ()->GetObject<LteUeNetDevice> ();
423  if (msg)
424  {
426  }
428  }
429  // check aperiodic high-layer configured subband CQI
431  {
432  Ptr<LteUeNetDevice> thisDevice = GetDevice ()->GetObject<LteUeNetDevice> ();
434  if (msg)
435  {
437  }
439  }
440 
441  // Generate PHY trace
444  {
445  NS_ASSERT_MSG (m_rsReceivedPowerUpdated, " RS received power info obsolete");
446  // RSRP evaluated as averaged received power among RBs
447  double sum = 0.0;
448  uint8_t rbNum = 0;
449  Values::const_iterator it;
451  {
452  // convert PSD [W/Hz] to linear power [W] for the single RE
453  // we consider only one RE for the RS since the channel is
454  // flat within the same RB
455  double powerTxW = ((*it) * 180000.0) / 12.0;
456  sum += powerTxW;
457  rbNum++;
458  }
459  double rsrp = (rbNum > 0) ? (sum / rbNum) : DBL_MAX;
460  // averaged SINR among RBs
461  sum = 0.0;
462  rbNum = 0;
463  for (it = sinr.ConstValuesBegin (); it != sinr.ConstValuesEnd (); it++)
464  {
465  sum += (*it);
466  rbNum++;
467  }
468  double avSinr = (rbNum > 0) ? (sum / rbNum) : DBL_MAX;
469  NS_LOG_INFO (this << " cellId " << m_cellId << " rnti " << m_rnti << " RSRP " << rsrp << " SINR " << avSinr);
470 
473  }
474 
475  // Generate UE Measurements for upper layers
476  if (m_pssReceived)
477  {
478  NS_ASSERT_MSG (m_rsInterferencePowerUpdated, " RS interference power info obsolete");
479  // PSSs received
480  NS_LOG_DEBUG (this << " Process PSS RNTI " << m_rnti << " cellId " << m_cellId << " PSS num " << m_pssList.size ());
481  std::list <PssElement>::iterator itPss = m_pssList.begin ();
482  while (itPss != m_pssList.end ())
483  {
484  uint8_t rbNum = 0;
485  double rsrqSum = 0.0;
486  Values::const_iterator itIntN = m_rsIntereferencePower.ConstValuesBegin ();
487  Values::const_iterator itPj = m_rsReceivedPower.ConstValuesBegin ();
488  for (itPj = m_rsReceivedPower.ConstValuesBegin (); itPj != m_rsReceivedPower.ConstValuesEnd (); itIntN++, itPj++)
489  {
490  rbNum++;
491  // convert PSD [W/Hz] to linear power [W] for the single RE
492  double noisePowerTxW = ((*itIntN) * 180000.0) / 12.0;
493  double intPowerTxW = ((*itPj) * 180000.0) / 12.0;
494  rsrqSum += (2 * (noisePowerTxW + intPowerTxW));
495  }
496  NS_ASSERT (rbNum == (*itPss).nRB);
497  double rsrp_dBm = 10 * log10 (1000 * ((*itPss).pssPsdSum / (double)rbNum));
498  double rsrq_dB = 10 * log10 ((*itPss).pssPsdSum / rsrqSum);
499 
500  if (rsrq_dB > m_pssReceptionThreshold)
501  {
502  // report UE Measurements to upper layers
503  NS_LOG_INFO (this << " PSS received from CellId " << (*itPss).cellId << " has RSRP " << rsrp_dBm << " and RSRQ " << rsrq_dB << " RBnum " << (uint16_t)rbNum);
504  // store measurements
505  std::map <uint16_t, UeMeasurementsElement>::iterator itMeasMap = m_UeMeasurementsMap.find ((*itPss).cellId);
506  if (itMeasMap == m_UeMeasurementsMap.end ())
507  {
508  // insert new entry
509  UeMeasurementsElement newEl;
510  newEl.rsrpSum = rsrp_dBm;
511  newEl.rsrpNum = 1;
512  newEl.rsrqSum = rsrq_dB;
513  newEl.rsrqNum = 1;
514  m_UeMeasurementsMap.insert (std::pair <uint16_t, UeMeasurementsElement> ((*itPss).cellId, newEl));
515  }
516  else
517  {
518  (*itMeasMap).second.rsrpSum += rsrp_dBm;
519  (*itMeasMap).second.rsrpNum++;
520  (*itMeasMap).second.rsrqSum += rsrq_dB;
521  (*itMeasMap).second.rsrqNum++;
522  }
523 
524  }
525  itPss++;
526  }
527  m_pssList.clear ();
528  }
529 
530 
531 
532 }
533 
534 void
536 {
537  // Not used by UE, CQI are based only on RS
538 }
539 
540 void
542 {
543  NS_LOG_FUNCTION (this << interf);
545  m_rsIntereferencePower = interf;
546 }
547 
548 void
550 {
551  NS_LOG_FUNCTION (this << power);
553  m_rsReceivedPower = power;
554 }
555 
556 
557 
560 {
561  NS_LOG_FUNCTION (this);
562 
563 
564  // apply transmission mode gain
566  SpectrumValue newSinr = sinr;
567  newSinr *= m_txModeGain.at (m_transmissionMode);
568 
569  // CREATE DlCqiLteControlMessage
570  Ptr<DlCqiLteControlMessage> msg = Create<DlCqiLteControlMessage> ();
571  CqiListElement_s dlcqi;
572  std::vector<int> cqi;
574  {
575  cqi = m_amc->CreateCqiFeedbacks (newSinr, m_dlBandwidth);
576 
578  int nbSubChannels = cqi.size ();
579  double cqiSum = 0.0;
580  int activeSubChannels = 0;
581  // average the CQIs of the different RBs
582  for (int i = 0; i < nbSubChannels; i++)
583  {
584  if (cqi.at (i) != -1)
585  {
586  cqiSum += cqi.at (i);
587  activeSubChannels++;
588  }
589  NS_LOG_DEBUG (this << " subch " << i << " cqi " << cqi.at (i));
590  }
591  dlcqi.m_rnti = m_rnti;
592  dlcqi.m_ri = 1; // not yet used
593  dlcqi.m_cqiType = CqiListElement_s::P10; // Peridic CQI using PUCCH wideband
594  NS_ASSERT_MSG (nLayer > 0, " nLayer negative");
595  NS_ASSERT_MSG (nLayer < 3, " nLayer limit is 2s");
596  for (int i = 0; i < nLayer; i++)
597  {
598  if (activeSubChannels > 0)
599  {
600  dlcqi.m_wbCqi.push_back ((uint16_t) cqiSum / activeSubChannels);
601  }
602  else
603  {
604  // approximate with the worst case -> CQI = 1
605  dlcqi.m_wbCqi.push_back (1);
606  }
607  }
608  //NS_LOG_DEBUG (this << " Generate P10 CQI feedback " << (uint16_t) cqiSum / activeSubChannels);
609  dlcqi.m_wbPmi = 0; // not yet used
610  // dl.cqi.m_sbMeasResult others CQI report modes: not yet implemented
611  }
613  {
614  cqi = m_amc->CreateCqiFeedbacks (newSinr, GetRbgSize ());
616  int nbSubChannels = cqi.size ();
617  int rbgSize = GetRbgSize ();
618  double cqiSum = 0.0;
619  int cqiNum = 0;
620  SbMeasResult_s rbgMeas;
621  //NS_LOG_DEBUG (this << " Create A30 CQI feedback, RBG " << rbgSize << " cqiNum " << nbSubChannels << " band " << (uint16_t)m_dlBandwidth);
622  for (int i = 0; i < nbSubChannels; i++)
623  {
624  if (cqi.at (i) != -1)
625  {
626  cqiSum += cqi.at (i);
627  }
628  // else "nothing" no CQI is treated as CQI = 0 (worst case scenario)
629  cqiNum++;
630  if (cqiNum == rbgSize)
631  {
632  // average the CQIs of the different RBGs
633  //NS_LOG_DEBUG (this << " RBG CQI " << (uint16_t) cqiSum / rbgSize);
634  HigherLayerSelected_s hlCqi;
635  hlCqi.m_sbPmi = 0; // not yet used
636  for (int i = 0; i < nLayer; i++)
637  {
638  hlCqi.m_sbCqi.push_back ((uint16_t) cqiSum / rbgSize);
639  }
640  rbgMeas.m_higherLayerSelected.push_back (hlCqi);
641  cqiSum = 0.0;
642  cqiNum = 0;
643  }
644  }
645  dlcqi.m_rnti = m_rnti;
646  dlcqi.m_ri = 1; // not yet used
647  dlcqi.m_cqiType = CqiListElement_s::A30; // Aperidic CQI using PUSCH
648  //dlcqi.m_wbCqi.push_back ((uint16_t) cqiSum / nbSubChannels);
649  dlcqi.m_wbPmi = 0; // not yet used
650  dlcqi.m_sbMeasResult = rbgMeas;
651  }
652 
653  msg->SetDlCqi (dlcqi);
654  return msg;
655 }
656 
657 
658 void
660 {
661  NS_LOG_FUNCTION (this << Simulator::Now ());
662  NS_LOG_DEBUG (this << " Report UE Measurements ");
664  std::map <uint16_t, UeMeasurementsElement>::iterator it;
665  for (it = m_UeMeasurementsMap.begin (); it != m_UeMeasurementsMap.end (); it++)
666  {
667  double avg_rsrp = (*it).second.rsrpSum / (double)(*it).second.rsrpNum;
668  double avg_rsrq = (*it).second.rsrqSum / (double)(*it).second.rsrqNum;
669  NS_LOG_DEBUG (this << " CellId " << (*it).first << " RSRP " << avg_rsrp << " (nSamples " << (*it).second.rsrpNum << ") RSRQ " << avg_rsrq << " (nSamples " << (*it).second.rsrpNum << ")");
671  newEl.m_cellId = (*it).first;
672  newEl.m_rsrp = avg_rsrp;
673  newEl.m_rsrq = avg_rsrq;
674  ret.m_ueMeasurementsList.push_back (newEl);
675  // report to UE measurements trace
676  m_reportUeMeasurements (m_rnti, m_cellId, avg_rsrp, avg_rsrq, ((*it).first == m_cellId ? 1 : 0));
677  }
679  m_UeMeasurementsMap.clear ();
681 }
682 
683 
684 
685 void
687 {
688  NS_LOG_FUNCTION (this << msg);
689 
690  SetControlMessages (msg);
691 }
692 
693 void
694 LteUePhy::DoSendRachPreamble (uint32_t raPreambleId, uint32_t raRnti)
695 {
696  NS_LOG_FUNCTION (this << raPreambleId);
697 
698  // unlike other control messages, RACH preamble is sent ASAP
699  Ptr<RachPreambleLteControlMessage> msg = Create<RachPreambleLteControlMessage> ();
700  msg->SetRapId (raPreambleId);
701  m_raPreambleId = raPreambleId;
702  m_raRnti = raRnti;
703  m_controlMessagesQueue.at (0).push_back (msg);
704 }
705 
706 
707 void
709 {
710  NS_LOG_FUNCTION (this);
711 
712  std::list<Ptr<LteControlMessage> >::iterator it;
713  for (it = msgList.begin (); it != msgList.end(); it++)
714  {
715  Ptr<LteControlMessage> msg = (*it);
716 
717  if (msg->GetMessageType () == LteControlMessage::DL_DCI)
718  {
719  Ptr<DlDciLteControlMessage> msg2 = DynamicCast<DlDciLteControlMessage> (msg);
720 
721  DlDciListElement_s dci = msg2->GetDci ();
722  if (dci.m_rnti != m_rnti)
723  {
724  // DCI not for me
725  continue;
726  }
727 
728  if (dci.m_resAlloc != 0)
729  {
730  NS_FATAL_ERROR ("Resource Allocation type not implemented");
731  }
732 
733  std::vector <int> dlRb;
734 
735  // translate the DCI to Spectrum framework
736  uint32_t mask = 0x1;
737  for (int i = 0; i < 32; i++)
738  {
739  if (((dci.m_rbBitmap & mask) >> i) == 1)
740  {
741  for (int k = 0; k < GetRbgSize (); k++)
742  {
743  dlRb.push_back ((i * GetRbgSize ()) + k);
744 // NS_LOG_DEBUG(this << " RNTI " << m_rnti << " RBG " << i << " DL-DCI allocated PRB " << (i*GetRbgSize()) + k);
745  }
746  }
747  mask = (mask << 1);
748  }
749 
750  // send TB info to LteSpectrumPhy
751  NS_LOG_DEBUG (this << " UE " << m_rnti << " DL-DCI " << dci.m_rnti << " bitmap " << dci.m_rbBitmap);
752  for (uint8_t i = 0; i < dci.m_tbsSize.size (); i++)
753  {
754  m_downlinkSpectrumPhy->AddExpectedTb (dci.m_rnti, dci.m_ndi.at (i), dci.m_tbsSize.at (i), dci.m_mcs.at (i), dlRb, i, dci.m_harqProcess, dci.m_rv.at (i), true /* DL */);
755  }
756 
758 
759 
760  }
761  else if (msg->GetMessageType () == LteControlMessage::UL_DCI)
762  {
763  // set the uplink bandwidht according to the UL-CQI
764  Ptr<UlDciLteControlMessage> msg2 = DynamicCast<UlDciLteControlMessage> (msg);
765  UlDciListElement_s dci = msg2->GetDci ();
766  if (dci.m_rnti != m_rnti)
767  {
768  // DCI not for me
769  continue;
770  }
771  NS_LOG_INFO (this << " UL DCI");
772  std::vector <int> ulRb;
773  for (int i = 0; i < dci.m_rbLen; i++)
774  {
775  ulRb.push_back (i + dci.m_rbStart);
776  //NS_LOG_DEBUG (this << " UE RB " << i + dci.m_rbStart);
777  }
779  // fire trace of UL Tx PHY stats
780  HarqProcessInfoList_t harqInfoList = m_harqPhyModule->GetHarqProcessInfoUl (m_rnti, 0);
782  params.m_cellId = m_cellId;
783  params.m_imsi = 0; // it will be set by DlPhyTransmissionCallback in LteHelper
785  params.m_rnti = m_rnti;
786  params.m_txMode = 0; // always SISO for UE
787  params.m_layer = 0;
788  params.m_mcs = dci.m_mcs;
789  params.m_size = dci.m_tbSize;
790  params.m_rv = harqInfoList.size ();
791  params.m_ndi = dci.m_ndi;
792  m_ulPhyTransmission (params);
793  // pass the info to the MAC
795  }
796  else if (msg->GetMessageType () == LteControlMessage::RAR)
797  {
798  Ptr<RarLteControlMessage> rarMsg = DynamicCast<RarLteControlMessage> (msg);
799  if (rarMsg->GetRaRnti () == m_raRnti)
800  {
801  for (std::list<RarLteControlMessage::Rar>::const_iterator it = rarMsg->RarListBegin (); it != rarMsg->RarListEnd (); ++it)
802  {
803  if (it->rapId != m_raPreambleId)
804  {
805  // UL grant not for me
806  continue;
807  }
808  else
809  {
810  NS_LOG_INFO ("received RAR RNTI " << m_raRnti);
811  // set the uplink bandwidht according to the UL grant
812  std::vector <int> ulRb;
813  for (int i = 0; i < it->rarPayload.m_grant.m_rbLen; i++)
814  {
815  ulRb.push_back (i + it->rarPayload.m_grant.m_rbStart);
816  }
817 
819  // pass the info to the MAC
821  // reset RACH variables with out of range values
822  m_raPreambleId = 255;
823  m_raRnti = 11;
824  }
825  }
826  }
827  }
828  else if (msg->GetMessageType () == LteControlMessage::MIB)
829  {
830  NS_LOG_INFO ("received MIB");
831  Ptr<MibLteControlMessage> msg2 = DynamicCast<MibLteControlMessage> (msg);
832  m_ueCphySapUser->RecvMasterInformationBlock (msg2->GetMib ());
833  }
834  else
835  {
836  // pass the message to UE-MAC
838  }
839 
840  }
841 
842 
843 }
844 
845 
846 void
848 {
849  NS_LOG_FUNCTION (this << cellId << (*p));
850  if (!m_dlConfigured)
851  {
852  // LteUePhy not yet configured -> skip measurement
853  return;
854  }
855  m_pssReceived = true;
856  PssElement el;
857  el.cellId = cellId;
858  double sum = 0.0;
859  uint16_t nRB = 0;
860  Values::const_iterator itPi;
861  for (itPi = p->ConstValuesBegin (); itPi != p->ConstValuesEnd (); itPi++)
862  {
863  // convert PSD [W/Hz] to linear power [W] for the single RE
864  double powerTxW = ((*itPi) * 180000.0) / 12.0;
865  sum += powerTxW;
866  nRB++;
867  }
868  el.pssPsdSum = sum;
869  el.nRB = nRB;
870  m_pssList.push_back (el);
871 }
872 
873 
874 void
876 {
878 }
879 
880 
881 void
882 LteUePhy::SubframeIndication (uint32_t frameNo, uint32_t subframeNo)
883 {
884  NS_LOG_FUNCTION (this << frameNo << subframeNo);
885 
886  NS_ASSERT_MSG (frameNo > 0, "the SRS index check code assumes that frameNo starts at 1");
887 
888  // refresh internal variables
889  m_rsReceivedPowerUpdated = false;
891  m_pssReceived = false;
892 
893  if (m_ulConfigured)
894  {
895  // update uplink transmission mask according to previous UL-CQIs
897 
898  // shift the queue
899  for (uint8_t i = 1; i < m_macChTtiDelay; i++)
900  {
902  }
903  m_subChannelsForTransmissionQueue.at (m_macChTtiDelay-1).clear ();
904 
906  {
907 
908  NS_ASSERT_MSG (subframeNo > 0 && subframeNo <= 10, "the SRS index check code assumes that subframeNo starts at 1");
909  if ((((frameNo-1)*10 + (subframeNo-1)) % m_srsPeriodicity) == m_srsSubframeOffset)
910  {
911  NS_LOG_INFO ("frame " << frameNo << " subframe " << subframeNo << " sending SRS (offset=" << m_srsSubframeOffset << ", period=" << m_srsPeriodicity << ")");
914  this);
915  }
916  }
917 
918  std::list<Ptr<LteControlMessage> > ctrlMsg = GetControlMessages ();
919  // send packets in queue
920  NS_LOG_LOGIC (this << " UE - start slot for PUSCH + PUCCH - RNTI " << m_rnti << " CELLID " << m_cellId);
921  // send the current burts of packets
923  if (pb)
924  {
925  m_uplinkSpectrumPhy->StartTxDataFrame (pb, ctrlMsg, UL_DATA_DURATION);
926  }
927  else
928  {
929  // send only PUCCH (ideal: fake null bandwidth signal)
930  if (ctrlMsg.size ()>0)
931  {
932  NS_LOG_LOGIC (this << " UE - start TX PUCCH (NO PUSCH)");
933  std::vector <int> dlRb;
935  m_uplinkSpectrumPhy->StartTxDataFrame (pb, ctrlMsg, UL_DATA_DURATION);
936  }
937  else
938  {
939  NS_LOG_LOGIC (this << " UE - UL NOTHING TO SEND");
940  }
941  }
942  } // m_configured
943 
944  // trigger the MAC
945  m_uePhySapUser->SubframeIndication (frameNo, subframeNo);
946 
947  m_subframeNo = subframeNo;
948  ++subframeNo;
949  if (subframeNo > 10)
950  {
951  ++frameNo;
952  subframeNo = 1;
953  }
954 
955  // schedule next subframe indication
956  Simulator::Schedule (Seconds (GetTti ()), &LteUePhy::SubframeIndication, this, frameNo, subframeNo);
957 }
958 
959 void
961 {
962  NS_LOG_FUNCTION (this << " UE " << m_rnti << " start tx SRS, cell Id " << (uint32_t) m_cellId);
963  NS_ASSERT (m_cellId > 0);
964  // set the current tx power spectral density (full bandwidth)
965  std::vector <int> dlRb;
966  for (uint8_t i = 0; i < m_ulBandwidth; i++)
967  {
968  dlRb.push_back (i);
969  }
971  m_uplinkSpectrumPhy->StartTxUlSrsFrame ();
972 }
973 
974 
975 void
977 {
978  NS_LOG_FUNCTION (this);
979 
980  m_rnti = 0;
981  m_transmissionMode = 0;
982  m_srsPeriodicity = 0;
983  m_srsConfigured = false;
984  m_dlConfigured = false;
985  m_ulConfigured = false;
986  m_raPreambleId = 255; // value out of range
987  m_raRnti = 11; // value out of range
991 
992  m_packetBurstQueue.clear ();
993  m_controlMessagesQueue.clear ();
995  for (int i = 0; i < m_macChTtiDelay; i++)
996  {
997  Ptr<PacketBurst> pb = CreateObject <PacketBurst> ();
998  m_packetBurstQueue.push_back (pb);
999  std::list<Ptr<LteControlMessage> > l;
1000  m_controlMessagesQueue.push_back (l);
1001  }
1002  std::vector <int> ulRb;
1003  m_subChannelsForTransmissionQueue.resize (m_macChTtiDelay, ulRb);
1004 
1006  m_downlinkSpectrumPhy->Reset ();
1007  m_uplinkSpectrumPhy->Reset ();
1008 }
1009 
1010 void
1011 LteUePhy::DoSyncronizeWithEnb (uint16_t cellId, uint16_t dlEarfcn)
1012 {
1013  NS_LOG_FUNCTION (this << cellId);
1014  m_cellId = cellId;
1015  m_dlEarfcn = dlEarfcn;
1016  m_downlinkSpectrumPhy->SetCellId (cellId);
1017  m_uplinkSpectrumPhy->SetCellId (cellId);
1018 
1019  // configure DL for receing the BCH with the minimum bandwith
1020  m_dlBandwidth = 6;
1022  m_downlinkSpectrumPhy->SetNoisePowerSpectralDensity (noisePsd);
1023  m_downlinkSpectrumPhy->GetChannel ()->AddRx (m_downlinkSpectrumPhy);
1024 
1025  m_dlConfigured = false;
1026  m_ulConfigured = false;
1027 }
1028 
1029 void
1030 LteUePhy::DoSetDlBandwidth (uint8_t dlBandwidth)
1031 {
1032  NS_LOG_FUNCTION (this << (uint32_t) dlBandwidth);
1033  if (m_dlBandwidth != dlBandwidth or !m_dlConfigured)
1034  {
1035  m_dlBandwidth = dlBandwidth;
1036 
1037  int Type0AllocationRbg[4] = {
1038  10, // RGB size 1
1039  26, // RGB size 2
1040  63, // RGB size 3
1041  110 // RGB size 4
1042  }; // see table 7.1.6.1-1 of 36.213
1043  for (int i = 0; i < 4; i++)
1044  {
1045  if (dlBandwidth < Type0AllocationRbg[i])
1046  {
1047  m_rbgSize = i + 1;
1048  break;
1049  }
1050  }
1051 
1053  m_downlinkSpectrumPhy->SetNoisePowerSpectralDensity (noisePsd);
1054  m_downlinkSpectrumPhy->GetChannel ()->AddRx (m_downlinkSpectrumPhy);
1055  }
1056  m_dlConfigured = true;
1057 }
1058 
1059 
1060 void
1061 LteUePhy::DoConfigureUplink (uint16_t ulEarfcn, uint8_t ulBandwidth)
1062 {
1063  m_ulEarfcn = ulEarfcn;
1064  m_ulBandwidth = ulBandwidth;
1065  m_ulConfigured = true;
1066 }
1067 
1068 
1069 void
1070 LteUePhy::DoSetRnti (uint16_t rnti)
1071 {
1072  NS_LOG_FUNCTION (this << rnti);
1073  m_rnti = rnti;
1074 }
1075 
1076 void
1078 {
1079  NS_LOG_FUNCTION (this << (uint16_t)txMode);
1080  m_transmissionMode = txMode;
1081  m_downlinkSpectrumPhy->SetTransmissionMode (txMode);
1082 }
1083 
1084 void
1086 {
1087  NS_LOG_FUNCTION (this << srcCi);
1090  m_srsConfigured = true;
1091 
1092  // a guard time is needed for the case where the SRS periodicity is changed dynamically at run time
1093  // if we use a static one, we can have a 0ms guard time
1094  m_srsStartTime = Simulator::Now () + MilliSeconds (0);
1095  NS_LOG_DEBUG (this << " UE SRS P " << m_srsPeriodicity << " RNTI " << m_rnti << " offset " << m_srsSubframeOffset << " cellId " << m_cellId << " CI " << srcCi);
1096 }
1097 
1098 
1099 void
1101 {
1102  SetTxModeGain (1, gain);
1103 }
1104 
1105 void
1107 {
1108  SetTxModeGain (2, gain);
1109 }
1110 
1111 void
1113 {
1114  SetTxModeGain (3, gain);
1115 }
1116 
1117 void
1119 {
1120  SetTxModeGain (4, gain);
1121 }
1122 
1123 void
1125 {
1126  SetTxModeGain (5, gain);
1127 }
1128 
1129 void
1131 {
1132  SetTxModeGain (6, gain);
1133 }
1134 
1135 void
1137 {
1138  SetTxModeGain (7, gain);
1139 }
1140 
1141 
1142 void
1143 LteUePhy::SetTxModeGain (uint8_t txMode, double gain)
1144 {
1145  NS_LOG_FUNCTION (this << gain);
1146  // convert to linear
1147  double gainLin = std::pow (10.0, (gain / 10.0));
1148  if (m_txModeGain.size () < txMode)
1149  {
1150  m_txModeGain.resize (txMode);
1151  }
1152  std::vector <double> temp;
1153  temp = m_txModeGain;
1154  m_txModeGain.clear ();
1155  for (uint8_t i = 0; i < temp.size (); i++)
1156  {
1157  if (i==txMode-1)
1158  {
1159  m_txModeGain.push_back (gainLin);
1160  }
1161  else
1162  {
1163  m_txModeGain.push_back (temp.at (i));
1164  }
1165  }
1166  // forward the info to DL LteSpectrumPhy
1167  m_downlinkSpectrumPhy->SetTxModeGain (txMode, gain);
1168 }
1169 
1170 
1171 
1172 void
1174 {
1175  NS_LOG_FUNCTION (this);
1176  // generate feedback to eNB and send it through ideal PUCCH
1177  Ptr<DlHarqFeedbackLteControlMessage> msg = Create<DlHarqFeedbackLteControlMessage> ();
1178  msg->SetDlHarqFeedback (m);
1179  SetControlMessages (msg);
1180 }
1181 
1182 void
1184 {
1185  m_harqPhyModule = harq;
1186 }
1187 
1188 
1189 } // namespace ns3
Values::const_iterator ConstValuesEnd() const
See section 4.3.1 dlDciListElement.
Definition: ff-mac-common.h:88
double GetNoiseFigure() const
Definition: lte-ue-phy.cc:306
Ptr< LteSpectrumPhy > GetUlSpectrumPhy() const
Definition: lte-ue-phy.cc:340
SpectrumValue m_rsIntereferencePower
Definition: lte-ue-phy.h:290
uint16_t m_srsConfigured
Definition: lte-ue-phy.h:278
keep track of time values and allow control of global simulation resolution
Definition: nstime.h:81
#define NS_LOG_FUNCTION(parameters)
Definition: log.h:311
virtual void ReceiveLteControlMessage(Ptr< LteControlMessage > msg)=0
Receive SendLteControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel.
double m_noiseFigure
Definition: lte-phy.h:228
See section 4.3.25 sbMeasResult.
double m_txPower
Definition: lte-phy.h:227
std::vector< struct UeMeasurementsElement > m_ueMeasurementsList
uint16_t m_dlEarfcn
Definition: lte-phy.h:235
LteUePhySapUser * m_uePhySapUser
Definition: lte-ue-phy.h:266
void SetNoiseFigure(double pow)
Definition: lte-ue-phy.cc:299
void SetTxMode5Gain(double gain)
Definition: lte-ue-phy.cc:1124
virtual void SendMacPdu(Ptr< Packet > p)
Send the MAC PDU to the channel.
Definition: lte-ue-phy.cc:87
virtual void GenerateDataCqiReport(const SpectrumValue &sinr)
Definition: lte-ue-phy.cc:535
std::list< PssElement > m_pssList
Definition: lte-ue-phy.h:299
void SetTxMode2Gain(double gain)
Definition: lte-ue-phy.cc:1106
bool m_ulConfigured
Definition: lte-ue-phy.h:282
uint8_t GetMacChDelay(void) const
Definition: lte-ue-phy.cc:328
void DoConfigureUplink(uint16_t ulEarfcn, uint8_t ulBandwidth)
Definition: lte-ue-phy.cc:1061
std::vector< Ptr< PacketBurst > > m_packetBurstQueue
Definition: lte-phy.h:238
std::vector< int > GetSubChannelsForTransmission(void)
Get a list of sub channels to use in RX.
Definition: lte-ue-phy.cc:381
virtual void GenerateCtrlCqiReport(const SpectrumValue &sinr)
Definition: lte-ue-phy.cc:407
TracedCallback< uint16_t, uint16_t, double, double > m_reportCurrentCellRsrpSinrTrace
Definition: lte-ue-phy.h:324
Time m_a30CqiLast
Definition: lte-ue-phy.h:263
void DoSyncronizeWithEnb(uint16_t cellId, uint16_t dlEarfcn)
Definition: lte-ue-phy.cc:1011
void SetSubChannelsForTransmission(std::vector< int > mask)
Set a list of sub channels to use in TX.
Definition: lte-ue-phy.cc:361
uint16_t GetSrsPeriodicity(uint16_t srcCi) const
Definition: lte-phy.cc:147
double GetTti(void) const
Definition: lte-phy.cc:139
LteUePhySapProvider * m_uePhySapProvider
Definition: lte-ue-phy.h:265
#define NS_ASSERT(condition)
Definition: assert.h:64
void SetTxMode6Gain(double gain)
Definition: lte-ue-phy.cc:1130
Ptr< LteSpectrumPhy > m_downlinkSpectrumPhy
Definition: lte-phy.h:224
See section 4.3.2 ulDciListElement.
virtual void SendLteControlMessage(Ptr< LteControlMessage > msg)
Send SendLteControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel.
Definition: lte-ue-phy.cc:93
See section 4.3.24 cqiListElement.
std::vector< double > m_txModeGain
Definition: lte-ue-phy.h:274
#define NS_LOG_INFO(msg)
Definition: log.h:264
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Definition: simulator.h:824
void QueueSubChannelsForTransmission(std::vector< int > rbMap)
Definition: lte-ue-phy.cc:875
void SetTxModeGain(uint8_t txMode, double gain)
Definition: lte-ue-phy.cc:1143
std::map< uint16_t, UeMeasurementsElement > m_UeMeasurementsMap
Definition: lte-ue-phy.h:311
virtual void DoSendMacPdu(Ptr< Packet > p)
Queue the MAC PDU to be sent (according to m_macChTtiDelay)
Definition: lte-ue-phy.cc:346
std::vector< int > GetSubChannelsForReception(void)
Get a list of sub channels to use in RX.
Definition: lte-ue-phy.cc:389
This class defines all functions to create spectrum model for lte.
uint8_t m_transmissionMode
Definition: lte-ue-phy.h:273
NS_LOG_COMPONENT_DEFINE("LteUePhy")
EventId m_sendSrsEvent
Definition: lte-ue-phy.h:334
void SetHarqPhyModule(Ptr< LteHarqPhy > harq)
Set the HARQ PHY module.
Definition: lte-ue-phy.cc:1183
Ptr< LteNetDevice > GetDevice()
Get the device where the phy layer is attached.
Definition: lte-phy.cc:97
uint8_t m_ulBandwidth
Definition: lte-phy.h:231
#define NS_FATAL_ERROR(msg)
fatal error handling
Definition: fatal-error.h:72
bool m_pssReceived
Definition: lte-ue-phy.h:292
void DoSetSrsConfigurationIndex(uint16_t srcCi)
Definition: lte-ue-phy.cc:1085
void DoSetTransmissionMode(uint8_t txMode)
Definition: lte-ue-phy.cc:1077
UeMemberLteUePhySapProvider(LteUePhy *phy)
Definition: lte-ue-phy.cc:81
double m_pssReceptionThreshold
Definition: lte-ue-phy.h:301
TracedCallback< uint16_t, uint16_t, double, double, bool > m_reportUeMeasurements
Definition: lte-ue-phy.h:332
uint16_t GetSrsSubframeOffset(uint16_t srcCi) const
Definition: lte-phy.cc:165
LteUeCphySapUser * m_ueCphySapUser
Definition: lte-ue-phy.h:269
void DoSetDlBandwidth(uint8_t ulBandwidth)
Definition: lte-ue-phy.cc:1030
void DoDispose()
Definition: lte-phy.cc:75
hold objects of type ns3::Time
Definition: nstime.h:828
uint8_t GetRbgSize(void) const
Definition: lte-phy.cc:183
uint16_t m_rsrpSinrSamplePeriod
Definition: lte-ue-phy.h:325
See section 4.3.27 higherLayerSelected.
void SetLteUePhySapUser(LteUePhySapUser *s)
Set the PHY SAP User.
Definition: lte-ue-phy.cc:270
Hold an unsigned integer type.
Definition: uinteger.h:46
void SetTxMode3Gain(double gain)
Definition: lte-ue-phy.cc:1112
static uint8_t TxMode2LayerNum(uint8_t txMode)
Definition: lte-common.cc:170
Ptr< SampleEmitter > s
NS_OBJECT_ENSURE_REGISTERED(AntennaModel)
Ptr< DlCqiLteControlMessage > CreateDlCqiFeedbackMessage(const SpectrumValue &sinr)
Create the DL CQI feedback from SINR values perceived at the physical layer with the signal received ...
Definition: lte-ue-phy.cc:559
void SetTxMode4Gain(double gain)
Definition: lte-ue-phy.cc:1118
void SendSrs()
Send the SRS signal in the last symbols of the frame.
Definition: lte-ue-phy.cc:960
uint16_t m_ulEarfcn
Definition: lte-phy.h:236
bool m_rsInterferencePowerUpdated
Definition: lte-ue-phy.h:289
#define NS_LOG_LOGIC(msg)
Definition: log.h:334
std::vector< uint8_t > m_sbCqi
void SetTxMode7Gain(double gain)
Definition: lte-ue-phy.cc:1136
#define list
See section 4.3.23 dlInfoListElement.
void DoReset()
Definition: lte-ue-phy.cc:976
virtual void DoSendRachPreamble(uint32_t prachId, uint32_t raRnti)
Definition: lte-ue-phy.cc:694
virtual void ReceiveLteDlHarqFeedback(DlInfoListElement_s mes)
PhySpectrum generated a new DL HARQ feedback.
Definition: lte-ue-phy.cc:1173
uint8_t m_macChTtiDelay
Definition: lte-phy.h:240
static const Time UL_DATA_DURATION
Definition: lte-ue-phy.cc:53
Ptr< LteHarqPhy > m_harqPhyModule
Definition: lte-ue-phy.h:315
hold objects of type Ptr
Definition: pointer.h:33
void SetControlMessages(Ptr< LteControlMessage > m)
Definition: lte-phy.cc:214
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
uint16_t m_rsrpSinrSampleCounter
Definition: lte-ue-phy.h:326
SpectrumValue m_rsReceivedPower
Definition: lte-ue-phy.h:287
double GetTxPower() const
Definition: lte-ue-phy.cc:320
uint16_t m_srsSubframeOffset
Definition: lte-ue-phy.h:277
Time m_srsStartTime
Definition: lte-ue-phy.h:279
uint8_t m_dlBandwidth
Definition: lte-phy.h:232
uint8_t m_subframeNo
Definition: lte-ue-phy.h:284
static EventId ScheduleNow(MEM mem_ptr, OBJ obj)
Definition: simulator.h:985
static Time Now(void)
Definition: simulator.cc:180
uint16_t m_cellId
Definition: lte-phy.h:242
void SubframeIndication(uint32_t frameNo, uint32_t subframeNo)
trigger from eNB the start from a new frame
Definition: lte-ue-phy.cc:882
virtual void DoInitialize(void)
Definition: lte-ue-phy.cc:263
#define NS_ASSERT_MSG(condition, message)
Definition: assert.h:86
static Ptr< SpectrumValue > CreateTxPowerSpectralDensity(uint16_t earfcn, uint8_t bandwidth, double powerTx, std::vector< int > activeRbs)
void SetTxMode1Gain(double gain)
Definition: lte-ue-phy.cc:1100
std::vector< int > m_subChannelsForTransmission
Definition: lte-ue-phy.h:249
Time m_p10CqiPeriocity
Definition: lte-ue-phy.h:257
uint32_t m_raRnti
Definition: lte-ue-phy.h:318
bool m_dlConfigured
Definition: lte-ue-phy.h:281
std::vector< std::vector< int > > m_subChannelsForTransmissionQueue
Definition: lte-ue-phy.h:252
std::list< Ptr< LteControlMessage > > GetControlMessages(void)
Definition: lte-phy.cc:222
Time m_a30CqiPeriocity
Definition: lte-ue-phy.h:262
LteUeCphySapProvider * m_ueCphySapProvider
Definition: lte-ue-phy.h:268
Ptr< PacketBurst > GetPacketBurst(void)
Definition: lte-phy.cc:195
std::vector< int > m_subChannelsForReception
Definition: lte-ue-phy.h:250
static const Time UL_SRS_DELAY_FROM_SUBFRAME_START
Definition: lte-ue-phy.cc:57
int Type0AllocationRbg[4]
#define NS_LOG_DEBUG(msg)
Definition: log.h:255
virtual void ReceiveLteControlMessageList(std::list< Ptr< LteControlMessage > >)
Definition: lte-ue-phy.cc:708
void SetTxPower(double pow)
Definition: lte-ue-phy.cc:313
virtual void ReceivePss(uint16_t cellId, Ptr< SpectrumValue > p)
Definition: lte-ue-phy.cc:847
uint16_t m_srsPeriodicity
Definition: lte-ue-phy.h:276
LteUePhySapProvider * GetLteUePhySapProvider()
Get the PHY SAP provider.
Definition: lte-ue-phy.cc:277
void Cancel(void)
Definition: event-id.cc:47
virtual void SendRachPreamble(uint32_t prachId, uint32_t raRnti)
Definition: lte-ue-phy.cc:99
uint32_t m_raPreambleId
Definition: lte-ue-phy.h:317
uint8_t m_rbgSize
Definition: lte-phy.h:233
void SetLteUeCphySapUser(LteUeCphySapUser *s)
Set the CPHY SAP User.
Definition: lte-ue-phy.cc:285
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range. Both limits are inclusive.
Definition: time.cc:404
friend class UeMemberLteUePhySapProvider
Definition: lte-ue-phy.h:52
void PhyPduReceived(Ptr< Packet > p)
PhySpectrum received a new PHY-PDU.
Definition: lte-ue-phy.cc:355
Values::const_iterator ConstValuesBegin() const
virtual void DoSendLteControlMessage(Ptr< LteControlMessage > msg)
Definition: lte-ue-phy.cc:686
std::vector< std::list< Ptr< LteControlMessage > > > m_controlMessagesQueue
Definition: lte-phy.h:239
bool m_rsReceivedPowerUpdated
Definition: lte-ue-phy.h:286
virtual ~LteUePhy()
Definition: lte-ue-phy.cc:147
Ptr< LteSpectrumPhy > GetDlSpectrumPhy() const
Definition: lte-ue-phy.cc:334
Ptr< LteSpectrumPhy > m_uplinkSpectrumPhy
Definition: lte-phy.h:225
virtual void ReportRsReceivedPower(const SpectrumValue &power)
Definition: lte-ue-phy.cc:549
Time m_p10CqiLast
Definition: lte-ue-phy.h:258
LteUeCphySapProvider * GetLteUeCphySapProvider()
Get the CPHY SAP provider.
Definition: lte-ue-phy.cc:292
Hold an floating point type.
Definition: double.h:41
Set of values corresponding to a given SpectrumModel.
void SetMacPdu(Ptr< Packet > p)
Definition: lte-phy.cc:189
std::vector< struct HigherLayerSelected_s > m_higherLayerSelected
a unique identifier for an interface.
Definition: type-id.h:49
uint16_t m_rnti
Definition: lte-ue-phy.h:271
int64_t GetMilliSeconds(void) const
Definition: nstime.h:275
TypeId SetParent(TypeId tid)
Definition: type-id.cc:610
virtual void DoInitialize(void)
Definition: object.cc:342
TracedCallback< PhyTransmissionStatParameters > m_ulPhyTransmission
Definition: lte-ue-phy.h:340
static TypeId GetTypeId(void)
Definition: lte-ue-phy.cc:164
Ptr< LteAmc > m_amc
Definition: lte-ue-phy.h:255
void ReportUeMeasurements()
Definition: lte-ue-phy.cc:659
virtual void ReportInterference(const SpectrumValue &interf)
Definition: lte-ue-phy.cc:541
virtual void RecvMasterInformationBlock(LteRrcSap::MasterInformationBlock mib)=0
virtual void ReceivePhyPdu(Ptr< Packet > p)=0
static Ptr< SpectrumValue > CreateNoisePowerSpectralDensity(uint16_t earfcn, uint8_t bandwidth, double noiseFigure)
virtual Ptr< SpectrumValue > CreateTxPowerSpectralDensity()
Create the PSD for the TX.
Definition: lte-ue-phy.cc:397
#define UL_PUSCH_TTIS_DELAY
Definition: lte-common.h:28
void DoSetRnti(uint16_t rnti)
Definition: lte-ue-phy.cc:1070
virtual void SubframeIndication(uint32_t frameNo, uint32_t subframeNo)=0
Trigger the start from a new frame (input from Phy layer)
std::vector< HarqProcessInfoElement_t > HarqProcessInfoList_t
Definition: lte-harq-phy.h:47
void SetSubChannelsForReception(std::vector< int > mask)
Get a list of sub channels to use in RX.
Definition: lte-ue-phy.cc:373
virtual void DoDispose(void)
Definition: lte-ue-phy.cc:153
Time m_ueMeasurementsFilterPeriod
Definition: lte-ue-phy.h:312