A Discrete-Event Network Simulator
API
lte-enb-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 <mmiozzo@cttc.es>
20  */
21 
22 #include <ns3/object-factory.h>
23 #include <ns3/log.h>
24 #include <cfloat>
25 #include <cmath>
26 #include <ns3/simulator.h>
27 #include <ns3/attribute-accessor-helper.h>
28 #include <ns3/double.h>
29 
30 
31 #include "lte-enb-phy.h"
32 #include "lte-ue-phy.h"
33 #include "lte-net-device.h"
35 #include "lte-control-messages.h"
36 #include "lte-enb-net-device.h"
37 #include "lte-ue-rrc.h"
38 #include "lte-enb-mac.h"
39 #include <ns3/lte-common.h>
40 #include <ns3/lte-vendor-specific-parameters.h>
41 
42 // WILD HACK for the inizialization of direct eNB-UE ctrl messaging
43 #include <ns3/node-list.h>
44 #include <ns3/node.h>
45 #include <ns3/lte-ue-net-device.h>
46 #include <ns3/pointer.h>
47 
48 namespace ns3 {
49 
50 NS_LOG_COMPONENT_DEFINE ("LteEnbPhy");
51 
52 NS_OBJECT_ENSURE_REGISTERED (LteEnbPhy);
53 
60 static const Time DL_DATA_DURATION = NanoSeconds (785714 -1);
61 
68 
70 // member SAP forwarders
72 
75 {
76 public:
78 
79  // inherited from LteEnbPhySapProvider
80  virtual void SendMacPdu (Ptr<Packet> p);
81  virtual void SetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth);
82  virtual void SetCellId (uint16_t cellId);
84  virtual uint8_t GetMacChTtiDelay ();
85 
86 
87 private:
89 };
90 
92 {
93 
94 }
95 
96 void
98 {
99  m_phy->DoSendMacPdu (p);
100 }
101 
102 void
103 EnbMemberLteEnbPhySapProvider::SetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth)
104 {
105  m_phy->DoSetBandwidth (ulBandwidth, dlBandwidth);
106 }
107 
108 void
110 {
111  m_phy->DoSetCellId (cellId);
112 }
113 
114 void
116 {
118 }
119 
120 uint8_t
122 {
123  return (m_phy->DoGetMacChTtiDelay ());
124 }
125 
126 
128 // generic LteEnbPhy methods
130 
131 
132 
134 {
135  NS_LOG_FUNCTION (this);
136  NS_FATAL_ERROR ("This constructor should not be called");
137 }
138 
140  : LtePhy (dlPhy, ulPhy),
141  m_enbPhySapUser (0),
142  m_enbCphySapUser (0),
143  m_nrFrames (0),
144  m_nrSubFrames (0),
145  m_srsPeriodicity (0),
146  m_srsStartTime (Seconds (0)),
147  m_currentSrsOffset (0),
148  m_interferenceSampleCounter (0)
149 {
152  m_harqPhyModule = Create <LteHarqPhy> ();
153  m_downlinkSpectrumPhy->SetHarqPhyModule (m_harqPhyModule);
154  m_uplinkSpectrumPhy->SetHarqPhyModule (m_harqPhyModule);
156 }
157 
158 TypeId
160 {
161  static TypeId tid = TypeId ("ns3::LteEnbPhy")
162  .SetParent<LtePhy> ()
163  .AddConstructor<LteEnbPhy> ()
164  .AddAttribute ("TxPower",
165  "Transmission power in dBm",
166  DoubleValue (30.0),
169  MakeDoubleChecker<double> ())
170  .AddAttribute ("NoiseFigure",
171  "Loss (dB) in the Signal-to-Noise-Ratio due to "
172  "non-idealities in the receiver. According to Wikipedia "
173  "(http://en.wikipedia.org/wiki/Noise_figure), this is "
174  "\"the difference in decibels (dB) between"
175  " the noise output of the actual receiver to "
176  "the noise output of an ideal receiver with "
177  "the same overall gain and bandwidth when the receivers "
178  "are connected to sources at the standard noise "
179  "temperature T0.\" In this model, we consider T0 = 290K.",
180  DoubleValue (5.0),
183  MakeDoubleChecker<double> ())
184  .AddAttribute ("MacToChannelDelay",
185  "The delay in TTI units that occurs between "
186  "a scheduling decision in the MAC and the actual "
187  "start of the transmission by the PHY. This is "
188  "intended to be used to model the latency of real PHY "
189  "and MAC implementations.",
190  UintegerValue (2),
193  MakeUintegerChecker<uint8_t> ())
194  .AddTraceSource ("ReportUeSinr",
195  "Report UEs' averaged linear SINR",
197  "ns3::LteEnbPhy::ReportUeSinrTracedCallback")
198  .AddAttribute ("UeSinrSamplePeriod",
199  "The sampling period for reporting UEs' SINR stats.",
200  UintegerValue (1),
202  MakeUintegerChecker<uint16_t> ())
203  .AddTraceSource ("ReportInterference",
204  "Report linear interference power per PHY RB",
206  "ns3::LteEnbPhy::ReportInterferenceTracedCallback")
207  .AddAttribute ("InterferenceSamplePeriod",
208  "The sampling period for reporting interference stats",
209  UintegerValue (1),
211  MakeUintegerChecker<uint16_t> ())
212  .AddTraceSource ("DlPhyTransmission",
213  "DL transmission PHY layer statistics.",
215  "ns3::PhyTransmissionStatParameters::TracedCallback")
216  .AddAttribute ("DlSpectrumPhy",
217  "The downlink LteSpectrumPhy associated to this LtePhy",
219  PointerValue (),
221  MakePointerChecker <LteSpectrumPhy> ())
222  .AddAttribute ("UlSpectrumPhy",
223  "The uplink LteSpectrumPhy associated to this LtePhy",
225  PointerValue (),
227  MakePointerChecker <LteSpectrumPhy> ())
228  ;
229  return tid;
230 }
231 
232 
234 {
235 }
236 
237 void
239 {
240  NS_LOG_FUNCTION (this);
241  m_ueAttached.clear ();
242  m_srsUeOffset.clear ();
243  delete m_enbPhySapProvider;
244  delete m_enbCphySapProvider;
246 }
247 
248 void
250 {
251  NS_LOG_FUNCTION (this);
253  m_uplinkSpectrumPhy->SetNoisePowerSpectralDensity (noisePsd);
255 }
256 
257 
258 void
260 {
261  m_enbPhySapUser = s;
262 }
263 
266 {
267  return (m_enbPhySapProvider);
268 }
269 
270 void
272 {
273  NS_LOG_FUNCTION (this);
275 }
276 
279 {
280  NS_LOG_FUNCTION (this);
281  return (m_enbCphySapProvider);
282 }
283 
284 void
286 {
287  NS_LOG_FUNCTION (this << pow);
288  m_txPower = pow;
289 }
290 
291 double
293 {
294  NS_LOG_FUNCTION (this);
295  return m_txPower;
296 }
297 
298 int8_t
300 {
301  NS_LOG_FUNCTION (this);
302  return m_txPower;
303 }
304 
305 void
307 {
308  NS_LOG_FUNCTION (this << nf);
309  m_noiseFigure = nf;
310 }
311 
312 double
314 {
315  NS_LOG_FUNCTION (this);
316  return m_noiseFigure;
317 }
318 
319 void
321 {
322  NS_LOG_FUNCTION (this);
323  m_macChTtiDelay = delay;
324  for (int i = 0; i < m_macChTtiDelay; i++)
325  {
326  Ptr<PacketBurst> pb = CreateObject <PacketBurst> ();
327  m_packetBurstQueue.push_back (pb);
328  std::list<Ptr<LteControlMessage> > l;
329  m_controlMessagesQueue.push_back (l);
330  std::list<UlDciLteControlMessage> l1;
331  m_ulDciQueue.push_back (l1);
332  }
333  for (int i = 0; i < UL_PUSCH_TTIS_DELAY; i++)
334  {
335  std::list<UlDciLteControlMessage> l1;
336  m_ulDciQueue.push_back (l1);
337  }
338 }
339 
340 uint8_t
342 {
343  return (m_macChTtiDelay);
344 }
345 
348 {
349  return m_downlinkSpectrumPhy;
350 }
351 
354 {
355  return m_uplinkSpectrumPhy;
356 }
357 
358 bool
359 LteEnbPhy::AddUePhy (uint16_t rnti)
360 {
361  NS_LOG_FUNCTION (this << rnti);
362  std::set <uint16_t>::iterator it;
363  it = m_ueAttached.find (rnti);
364  if (it == m_ueAttached.end ())
365  {
366  m_ueAttached.insert (rnti);
367  return (true);
368  }
369  else
370  {
371  NS_LOG_ERROR ("UE already attached");
372  return (false);
373  }
374 }
375 
376 bool
377 LteEnbPhy::DeleteUePhy (uint16_t rnti)
378 {
379  NS_LOG_FUNCTION (this << rnti);
380  std::set <uint16_t>::iterator it;
381  it = m_ueAttached.find (rnti);
382  if (it == m_ueAttached.end ())
383  {
384  NS_LOG_ERROR ("UE not attached");
385  return (false);
386  }
387  else
388  {
389  m_ueAttached.erase (it);
390  return (true);
391  }
392 }
393 
394 
395 
396 void
398 {
399  NS_LOG_FUNCTION (this);
400  SetMacPdu (p);
401 }
402 
403 uint8_t
405 {
406  return (m_macChTtiDelay);
407 }
408 
409 
410 void
412 {
413  NS_LOG_FUNCTION (this);
415 }
416 
417 void
418 LteEnbPhy::SetDownlinkSubChannels (std::vector<int> mask)
419 {
420  NS_LOG_FUNCTION (this);
423  m_downlinkSpectrumPhy->SetTxPowerSpectralDensity (txPsd);
424 }
425 
426 void
428 {
429  NS_LOG_FUNCTION (this);
432  m_downlinkSpectrumPhy->SetTxPowerSpectralDensity (txPsd);
433 }
434 
435 std::vector<int>
437 {
438  NS_LOG_FUNCTION (this);
440 }
441 
442 void
443 LteEnbPhy::GeneratePowerAllocationMap (uint16_t rnti, int rbId)
444 {
445  NS_LOG_FUNCTION (this);
446  double rbgTxPower = m_txPower;
447 
448  std::map<uint16_t, double>::iterator it = m_paMap.find (rnti);
449  if (it != m_paMap.end ())
450  {
451  rbgTxPower = m_txPower + it->second;
452  }
453 
454  m_dlPowerAllocationMap.insert (std::pair<int, double> (rbId, rbgTxPower));
455 }
456 
459 {
460  NS_LOG_FUNCTION (this);
461 
463 
464  return psd;
465 }
466 
469 {
470  NS_LOG_FUNCTION (this);
471 
473 
474  return psd;
475 }
476 
477 
478 void
480 {
481  NS_LOG_FUNCTION (this);
482 }
483 
484 
485 void
487 {
488  NS_LOG_FUNCTION (this << msg);
489  // queues the message (wait for MAC-PHY delay)
490  SetControlMessages (msg);
491 }
492 
493 
494 
495 void
497 {
498  NS_FATAL_ERROR ("Obsolete function");
499  NS_LOG_FUNCTION (this << msg);
501 }
502 
503 void
505 {
506  NS_LOG_FUNCTION (this);
507  std::list<Ptr<LteControlMessage> >::iterator it;
508  for (it = msgList.begin (); it != msgList.end (); it++)
509  {
510  switch ((*it)->GetMessageType ())
511  {
513  {
514  Ptr<RachPreambleLteControlMessage> rachPreamble = DynamicCast<RachPreambleLteControlMessage> (*it);
515  m_enbPhySapUser->ReceiveRachPreamble (rachPreamble->GetRapId ());
516  }
517  break;
519  {
520  Ptr<DlCqiLteControlMessage> dlcqiMsg = DynamicCast<DlCqiLteControlMessage> (*it);
521  CqiListElement_s dlcqi = dlcqiMsg->GetDlCqi ();
522  // check whether the UE is connected
523  if (m_ueAttached.find (dlcqi.m_rnti) != m_ueAttached.end ())
524  {
526  }
527  }
528  break;
530  {
531  Ptr<BsrLteControlMessage> bsrMsg = DynamicCast<BsrLteControlMessage> (*it);
532  MacCeListElement_s bsr = bsrMsg->GetBsr ();
533  // check whether the UE is connected
534  if (m_ueAttached.find (bsr.m_rnti) != m_ueAttached.end ())
535  {
537  }
538  }
539  break;
541  {
542  Ptr<DlHarqFeedbackLteControlMessage> dlharqMsg = DynamicCast<DlHarqFeedbackLteControlMessage> (*it);
543  DlInfoListElement_s dlharq = dlharqMsg->GetDlHarqFeedback ();
544  // check whether the UE is connected
545  if (m_ueAttached.find (dlharq.m_rnti) != m_ueAttached.end ())
546  {
548  }
549  }
550  break;
551  default:
552  NS_FATAL_ERROR ("Unexpected LteControlMessage type");
553  break;
554  }
555  }
556 }
557 
558 
559 
560 void
562 {
563  NS_LOG_FUNCTION (this);
564 
565  ++m_nrFrames;
566  NS_LOG_INFO ("-----frame " << m_nrFrames << "-----");
567  m_nrSubFrames = 0;
568 
569  // send MIB at beginning of every frame
571  Ptr<MibLteControlMessage> mibMsg = Create<MibLteControlMessage> ();
572  mibMsg->SetMib (m_mib);
573  m_controlMessagesQueue.at (0).push_back (mibMsg);
574 
575  StartSubFrame ();
576 }
577 
578 
579 void
581 {
582  NS_LOG_FUNCTION (this);
583 
584  ++m_nrSubFrames;
585 
586  /*
587  * Send SIB1 at 6th subframe of every odd-numbered radio frame. This is
588  * equivalent with Section 5.2.1.2 of 3GPP TS 36.331, where it is specified
589  * "repetitions are scheduled in subframe #5 of all other radio frames for
590  * which SFN mod 2 = 0," except that 3GPP counts frames and subframes starting
591  * from 0, while ns-3 counts starting from 1.
592  */
593  if ((m_nrSubFrames == 6) && ((m_nrFrames % 2) == 1))
594  {
595  Ptr<Sib1LteControlMessage> msg = Create<Sib1LteControlMessage> ();
596  msg->SetSib1 (m_sib1);
597  m_controlMessagesQueue.at (0).push_back (msg);
598  }
599 
600  if (m_srsPeriodicity>0)
601  {
602  // might be 0 in case the eNB has no UEs attached
603  NS_ASSERT_MSG (m_nrFrames > 1, "the SRS index check code assumes that frameNo starts at 1");
604  NS_ASSERT_MSG (m_nrSubFrames > 0 && m_nrSubFrames <= 10, "the SRS index check code assumes that subframeNo starts at 1");
606  }
607  NS_LOG_INFO ("-----sub frame " << m_nrSubFrames << "-----");
608  m_harqPhyModule->SubframeIndication (m_nrFrames, m_nrSubFrames);
609 
610  // update info on TB to be received
611  std::list<UlDciLteControlMessage> uldcilist = DequeueUlDci ();
612  std::list<UlDciLteControlMessage>::iterator dciIt = uldcilist.begin ();
613  NS_LOG_DEBUG (this << " eNB Expected TBs " << uldcilist.size ());
614  for (dciIt = uldcilist.begin (); dciIt!=uldcilist.end (); dciIt++)
615  {
616  std::set <uint16_t>::iterator it2;
617  it2 = m_ueAttached.find ((*dciIt).GetDci ().m_rnti);
618 
619  if (it2 == m_ueAttached.end ())
620  {
621  NS_LOG_ERROR ("UE not attached");
622  }
623  else
624  {
625  // send info of TB to LteSpectrumPhy
626  // translate to allocation map
627  std::vector <int> rbMap;
628  for (int i = (*dciIt).GetDci ().m_rbStart; i < (*dciIt).GetDci ().m_rbStart + (*dciIt).GetDci ().m_rbLen; i++)
629  {
630  rbMap.push_back (i);
631  }
632  m_uplinkSpectrumPhy->AddExpectedTb ((*dciIt).GetDci ().m_rnti, (*dciIt).GetDci ().m_ndi, (*dciIt).GetDci ().m_tbSize, (*dciIt).GetDci ().m_mcs, rbMap, 0 /* always SISO*/, 0 /* no HARQ proc id in UL*/, 0 /*evaluated by LteSpectrumPhy*/, false /* UL*/);
633  if ((*dciIt).GetDci ().m_ndi==1)
634  {
635  NS_LOG_DEBUG (this << " RNTI " << (*dciIt).GetDci ().m_rnti << " NEW TB");
636  }
637  else
638  {
639  NS_LOG_DEBUG (this << " RNTI " << (*dciIt).GetDci ().m_rnti << " HARQ RETX");
640  }
641  }
642  }
643 
644  // process the current burst of control messages
645  std::list<Ptr<LteControlMessage> > ctrlMsg = GetControlMessages ();
646  m_dlDataRbMap.clear ();
647  m_dlPowerAllocationMap.clear ();
648  if (ctrlMsg.size () > 0)
649  {
650  std::list<Ptr<LteControlMessage> >::iterator it;
651  it = ctrlMsg.begin ();
652  while (it != ctrlMsg.end ())
653  {
654  Ptr<LteControlMessage> msg = (*it);
655  if (msg->GetMessageType () == LteControlMessage::DL_DCI)
656  {
657  Ptr<DlDciLteControlMessage> dci = DynamicCast<DlDciLteControlMessage> (msg);
658  // get the tx power spectral density according to DL-DCI(s)
659  // translate the DCI to Spectrum framework
660  uint32_t mask = 0x1;
661  for (int i = 0; i < 32; i++)
662  {
663  if (((dci->GetDci ().m_rbBitmap & mask) >> i) == 1)
664  {
665  for (int k = 0; k < GetRbgSize (); k++)
666  {
667  m_dlDataRbMap.push_back ((i * GetRbgSize ()) + k);
668  //NS_LOG_DEBUG(this << " [enb]DL-DCI allocated PRB " << (i*GetRbgSize()) + k);
669  GeneratePowerAllocationMap (dci->GetDci ().m_rnti, (i * GetRbgSize ()) + k );
670  }
671  }
672  mask = (mask << 1);
673  }
674  // fire trace of DL Tx PHY stats
675  for (uint8_t i = 0; i < dci->GetDci ().m_mcs.size (); i++)
676  {
678  params.m_cellId = m_cellId;
679  params.m_imsi = 0; // it will be set by DlPhyTransmissionCallback in LteHelper
681  params.m_rnti = dci->GetDci ().m_rnti;
682  params.m_txMode = 0; // TBD
683  params.m_layer = i;
684  params.m_mcs = dci->GetDci ().m_mcs.at (i);
685  params.m_size = dci->GetDci ().m_tbsSize.at (i);
686  params.m_rv = dci->GetDci ().m_rv.at (i);
687  params.m_ndi = dci->GetDci ().m_ndi.at (i);
688  m_dlPhyTransmission (params);
689  }
690 
691  }
692  else if (msg->GetMessageType () == LteControlMessage::UL_DCI)
693  {
694  Ptr<UlDciLteControlMessage> dci = DynamicCast<UlDciLteControlMessage> (msg);
695  QueueUlDci (*dci);
696  }
697  else if (msg->GetMessageType () == LteControlMessage::RAR)
698  {
699  Ptr<RarLteControlMessage> rarMsg = DynamicCast<RarLteControlMessage> (msg);
700  for (std::list<RarLteControlMessage::Rar>::const_iterator it = rarMsg->RarListBegin (); it != rarMsg->RarListEnd (); ++it)
701  {
702  if (it->rarPayload.m_grant.m_ulDelay == true)
703  {
704  NS_FATAL_ERROR (" RAR delay is not yet implemented");
705  }
706  UlGrant_s ulGrant = it->rarPayload.m_grant;
707  // translate the UL grant in a standard UL-DCI and queue it
708  UlDciListElement_s dci;
709  dci.m_rnti = ulGrant.m_rnti;
710  dci.m_rbStart = ulGrant.m_rbStart;
711  dci.m_rbLen = ulGrant.m_rbLen;
712  dci.m_tbSize = ulGrant.m_tbSize;
713  dci.m_mcs = ulGrant.m_mcs;
714  dci.m_hopping = ulGrant.m_hopping;
715  dci.m_tpc = ulGrant.m_tpc;
716  dci.m_cqiRequest = ulGrant.m_cqiRequest;
717  dci.m_ndi = 1;
719  msg.SetDci (dci);
720  QueueUlDci (msg);
721  }
722  }
723  it++;
724 
725  }
726  }
727 
728  SendControlChannels (ctrlMsg);
729 
730  // send data frame
732  if (pb)
733  {
734  Simulator::Schedule (DL_CTRL_DELAY_FROM_SUBFRAME_START, // ctrl frame fixed to 3 symbols
736  this,pb);
737  }
738 
739  // trigger the MAC
741 
744  this);
745 
746 }
747 
748 void
750 {
751  NS_LOG_FUNCTION (this << " eNB " << m_cellId << " start tx ctrl frame");
752  // set the current tx power spectral density (full bandwidth)
753  std::vector <int> dlRb;
754  for (uint8_t i = 0; i < m_dlBandwidth; i++)
755  {
756  dlRb.push_back (i);
757  }
758  SetDownlinkSubChannels (dlRb);
759  NS_LOG_LOGIC (this << " eNB start TX CTRL");
760  bool pss = false;
761  if ((m_nrSubFrames == 1) || (m_nrSubFrames == 6))
762  {
763  pss = true;
764  }
765  m_downlinkSpectrumPhy->StartTxDlCtrlFrame (ctrlMsgList, pss);
766 
767 }
768 
769 void
771 {
772  // set the current tx power spectral density
774  // send the current burts of packets
775  NS_LOG_LOGIC (this << " eNB start TX DATA");
776  std::list<Ptr<LteControlMessage> > ctrlMsgList;
777  ctrlMsgList.clear ();
778  m_downlinkSpectrumPhy->StartTxDataFrame (pb, ctrlMsgList, DL_DATA_DURATION);
779 }
780 
781 
782 void
784 {
785  NS_LOG_FUNCTION (this << Simulator::Now ().GetSeconds ());
786  if (m_nrSubFrames == 10)
787  {
789  }
790  else
791  {
793  }
794 }
795 
796 
797 void
799 {
800  NS_LOG_FUNCTION (this << Simulator::Now ().GetSeconds ());
802 }
803 
804 
805 void
807 {
808  NS_LOG_FUNCTION (this << sinr << Simulator::Now () << m_srsStartTime);
809  // avoid processing SRSs sent with an old SRS configuration index
811  {
813  m_enbPhySapUser->UlCqiReport (ulcqi);
814  }
815 }
816 
817 void
819 {
820  NS_LOG_FUNCTION (this << sinr);
822  m_enbPhySapUser->UlCqiReport (ulcqi);
823 }
824 
825 void
827 {
828  NS_LOG_FUNCTION (this << interf);
829  Ptr<SpectrumValue> interfCopy = Create<SpectrumValue> (interf);
831  if (m_interferenceSampleCounter == m_interferenceSamplePeriod)
832  {
833  m_reportInterferenceTrace (m_cellId, interfCopy);
834  m_interferenceSampleCounter = 0;
835  }
836 }
837 
838 void
840 {
841  // not used by eNB
842 }
843 
844 
845 
848 {
849  NS_LOG_FUNCTION (this << sinr);
850  Values::const_iterator it;
852  ulcqi.m_ulCqi.m_type = UlCqi_s::PUSCH;
853  int i = 0;
854  for (it = sinr.ConstValuesBegin (); it != sinr.ConstValuesEnd (); it++)
855  {
856  double sinrdb = 10 * std::log10 ((*it));
857 // NS_LOG_DEBUG ("ULCQI RB " << i << " value " << sinrdb);
858  // convert from double to fixed point notation Sxxxxxxxxxxx.xxx
859  int16_t sinrFp = LteFfConverter::double2fpS11dot3 (sinrdb);
860  ulcqi.m_ulCqi.m_sinr.push_back (sinrFp);
861  i++;
862  }
863  return (ulcqi);
864 
865 }
866 
867 
868 void
869 LteEnbPhy::DoSetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth)
870 {
871  NS_LOG_FUNCTION (this << (uint32_t) ulBandwidth << (uint32_t) dlBandwidth);
872  m_ulBandwidth = ulBandwidth;
873  m_dlBandwidth = dlBandwidth;
874 
875  static const int Type0AllocationRbg[4] = {
876  10, // RGB size 1
877  26, // RGB size 2
878  63, // RGB size 3
879  110 // RGB size 4
880  }; // see table 7.1.6.1-1 of 36.213
881  for (int i = 0; i < 4; i++)
882  {
883  if (dlBandwidth < Type0AllocationRbg[i])
884  {
885  m_rbgSize = i + 1;
886  break;
887  }
888  }
889 }
890 
891 void
892 LteEnbPhy::DoSetEarfcn (uint16_t ulEarfcn, uint16_t dlEarfcn)
893 {
894  NS_LOG_FUNCTION (this << ulEarfcn << dlEarfcn);
895  m_ulEarfcn = ulEarfcn;
896  m_dlEarfcn = dlEarfcn;
897 }
898 
899 
900 void
901 LteEnbPhy::DoAddUe (uint16_t rnti)
902 {
903  NS_LOG_FUNCTION (this << rnti);
904 
905  bool success = AddUePhy (rnti);
906  NS_ASSERT_MSG (success, "AddUePhy() failed");
907 
908  // add default P_A value
909  DoSetPa (rnti, 0);
910 }
911 
912 void
913 LteEnbPhy::DoRemoveUe (uint16_t rnti)
914 {
915  NS_LOG_FUNCTION (this << rnti);
916 
917  bool success = DeleteUePhy (rnti);
918  NS_ASSERT_MSG (success, "DeleteUePhy() failed");
919 
920  // remove also P_A value
921  std::map<uint16_t, double>::iterator it = m_paMap.find (rnti);
922  if (it != m_paMap.end ())
923  {
924  m_paMap.erase (it);
925  }
926 
927 }
928 
929 void
930 LteEnbPhy::DoSetPa (uint16_t rnti, double pa)
931 {
932  NS_LOG_FUNCTION (this << rnti);
933 
934  std::map<uint16_t, double>::iterator it = m_paMap.find (rnti);
935 
936  if (it == m_paMap.end ())
937  {
938  m_paMap.insert (std::pair<uint16_t, double> (rnti, pa));
939  }
940  else
941  {
942  it->second = pa;
943  }
944 
945 }
946 
949 {
950  NS_LOG_FUNCTION (this << sinr);
951  Values::const_iterator it;
953  ulcqi.m_ulCqi.m_type = UlCqi_s::SRS;
954  int i = 0;
955  double srsSum = 0.0;
956  for (it = sinr.ConstValuesBegin (); it != sinr.ConstValuesEnd (); it++)
957  {
958  double sinrdb = 10 * log10 ((*it));
959  // NS_LOG_DEBUG ("ULCQI RB " << i << " value " << sinrdb);
960  // convert from double to fixed point notation Sxxxxxxxxxxx.xxx
961  int16_t sinrFp = LteFfConverter::double2fpS11dot3 (sinrdb);
962  srsSum += (*it);
963  ulcqi.m_ulCqi.m_sinr.push_back (sinrFp);
964  i++;
965  }
966  // Insert the user generated the srs as a vendor specific parameter
967  NS_LOG_DEBUG (this << " ENB RX UL-CQI of " << m_srsUeOffset.at (m_currentSrsOffset));
969  vsp.m_type = SRS_CQI_RNTI_VSP;
970  vsp.m_length = sizeof(SrsCqiRntiVsp);
971  Ptr<SrsCqiRntiVsp> rnti = Create <SrsCqiRntiVsp> (m_srsUeOffset.at (m_currentSrsOffset));
972  vsp.m_value = rnti;
973  ulcqi.m_vendorSpecificList.push_back (vsp);
974  // call SRS tracing method
976  (i > 0) ? (srsSum / i) : DBL_MAX);
977  return (ulcqi);
978 
979 }
980 
981 
982 void
983 LteEnbPhy::CreateSrsReport (uint16_t rnti, double srs)
984 {
985  NS_LOG_FUNCTION (this << rnti << srs);
986  std::map <uint16_t,uint16_t>::iterator it = m_srsSampleCounterMap.find (rnti);
987  if (it==m_srsSampleCounterMap.end ())
988  {
989  // create new entry
990  m_srsSampleCounterMap.insert (std::pair <uint16_t,uint16_t> (rnti, 0));
991  it = m_srsSampleCounterMap.find (rnti);
992  }
993  (*it).second++;
994  if ((*it).second == m_srsSamplePeriod)
995  {
996  m_reportUeSinr (m_cellId, rnti, srs);
997  (*it).second = 0;
998  }
999 }
1000 
1001 void
1002 LteEnbPhy::DoSetTransmissionMode (uint16_t rnti, uint8_t txMode)
1003 {
1004  NS_LOG_FUNCTION (this << rnti << (uint16_t)txMode);
1005  // UL supports only SISO MODE
1006 }
1007 
1008 void
1010 {
1011  NS_LOG_FUNCTION (this);
1012  m_ulDciQueue.at (UL_PUSCH_TTIS_DELAY - 1).push_back (m);
1013 }
1014 
1015 std::list<UlDciLteControlMessage>
1017 {
1018  NS_LOG_FUNCTION (this);
1019  if (m_ulDciQueue.at (0).size ()>0)
1020  {
1021  std::list<UlDciLteControlMessage> ret = m_ulDciQueue.at (0);
1022  m_ulDciQueue.erase (m_ulDciQueue.begin ());
1023  std::list<UlDciLteControlMessage> l;
1024  m_ulDciQueue.push_back (l);
1025  return (ret);
1026  }
1027  else
1028  {
1029  m_ulDciQueue.erase (m_ulDciQueue.begin ());
1030  std::list<UlDciLteControlMessage> l;
1031  m_ulDciQueue.push_back (l);
1032  std::list<UlDciLteControlMessage> emptylist;
1033  return (emptylist);
1034  }
1035 }
1036 
1037 void
1038 LteEnbPhy::DoSetSrsConfigurationIndex (uint16_t rnti, uint16_t srcCi)
1039 {
1040  NS_LOG_FUNCTION (this);
1041  uint16_t p = GetSrsPeriodicity (srcCi);
1042  if (p!=m_srsPeriodicity)
1043  {
1044  // resize the array of offset -> re-initialize variables
1045  m_srsUeOffset.clear ();
1046  m_srsUeOffset.resize (p, 0);
1047  m_srsPeriodicity = p;
1048  // inhibit SRS until RRC Connection Reconfiguration propagates
1049  // to UEs, otherwise we might be wrong in determining the UE who
1050  // actually sent the SRS (if the UE was using a stale SRS config)
1051  // if we use a static SRS configuration index, we can have a 0ms guard time
1053  }
1054 
1055  NS_LOG_DEBUG (this << " ENB SRS P " << m_srsPeriodicity << " RNTI " << rnti << " offset " << GetSrsSubframeOffset (srcCi) << " CI " << srcCi);
1056  std::map <uint16_t,uint16_t>::iterator it = m_srsCounter.find (rnti);
1057  if (it != m_srsCounter.end ())
1058  {
1059  (*it).second = GetSrsSubframeOffset (srcCi) + 1;
1060  }
1061  else
1062  {
1063  m_srsCounter.insert (std::pair<uint16_t, uint16_t> (rnti, GetSrsSubframeOffset (srcCi) + 1));
1064  }
1065  m_srsUeOffset.at (GetSrsSubframeOffset (srcCi)) = rnti;
1066 
1067 }
1068 
1069 
1070 void
1072 {
1073  NS_LOG_FUNCTION (this);
1074  m_mib = mib;
1075 }
1076 
1077 
1078 void
1080 {
1081  NS_LOG_FUNCTION (this);
1082  m_sib1 = sib1;
1083 }
1084 
1085 
1086 void
1088 {
1089  m_harqPhyModule = harq;
1090 }
1091 
1092 
1093 void
1095 {
1096  NS_LOG_FUNCTION (this);
1097  // forward to scheduler
1099 }
1100 
1101 };
Values::const_iterator ConstValuesEnd() const
virtual ~LteEnbPhy()
Definition: lte-enb-phy.cc:233
Template for the implementation of the LteEnbCphySapProvider as a member of an owner class of type C ...
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:95
uint8_t m_txMode
the transmission Mode
Definition: lte-common.h:124
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
uint16_t m_interferenceSampleCounter
Definition: lte-enb-phy.h:427
void DoSetCellId(uint16_t cellId)
Definition: lte-phy.cc:244
double m_noiseFigure
Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver.
Definition: lte-phy.h:245
uint32_t m_nrSubFrames
The subframe number currently served.
Definition: lte-enb-phy.h:381
static uint16_t double2fpS11dot3(double val)
Definition: lte-common.cc:96
double m_txPower
Transmission power in dBm.
Definition: lte-phy.h:233
uint16_t m_dlEarfcn
The downlink carrier frequency.
Definition: lte-phy.h:265
virtual void SendMacPdu(Ptr< Packet > p)
Send the MAC PDU to the channel.
Definition: lte-enb-phy.cc:97
uint16_t m_srsSamplePeriod
The UeSinrSamplePeriod trace source.
Definition: lte-enb-phy.h:412
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:44
void SetDownlinkSubChannels(std::vector< int > mask)
set the resource blocks (a.k.a.
Definition: lte-enb-phy.cc:418
void CalcChannelQualityForUe(std::vector< double > sinr, Ptr< LteSpectrumPhy > ue)
Calculate the channel quality for a given UE.
Definition: lte-enb-phy.cc:479
The Uplink Data Control Indicator messages defines the RB allocation for the users in the uplink...
bool DeleteUePhy(uint16_t rnti)
Remove the given RNTI from the list of attached UE m_ueAttached.
Definition: lte-enb-phy.cc:377
std::list< UlDciLteControlMessage > DequeueUlDci(void)
std::vector< Ptr< PacketBurst > > m_packetBurstQueue
A queue of packet bursts to be sent.
Definition: lte-phy.h:273
virtual uint8_t GetMacChTtiDelay()
Get the delay from MAC to Channel expressed in TTIs.
Definition: lte-enb-phy.cc:121
virtual void ReceiveLteControlMessageList(std::list< Ptr< LteControlMessage > >)
PhySpectrum received a new list of LteControlMessage.
Definition: lte-enb-phy.cc:504
enum ns3::UlCqi_s::Type_e m_type
void DoSendLteControlMessage(Ptr< LteControlMessage > msg)
Definition: lte-enb-phy.cc:486
virtual void ReportRsReceivedPower(const SpectrumValue &power)
generate a report based on the linear RS power perceived during CTRL frame NOTE: used only by UE for ...
Definition: lte-enb-phy.cc:839
void DoSetSystemInformationBlockType1(LteRrcSap::SystemInformationBlockType1 sib1)
uint16_t GetSrsPeriodicity(uint16_t srcCi) const
Definition: lte-phy.cc:146
double GetTti(void) const
Definition: lte-phy.cc:138
std::vector< uint16_t > m_sinr
virtual Ptr< SpectrumValue > CreateTxPowerSpectralDensity()
Create the PSD for TX.
Definition: lte-enb-phy.cc:458
std::vector< std::list< UlDciLteControlMessage > > m_ulDciQueue
For storing info on future receptions.
Definition: lte-enb-phy.h:363
std::map< int, double > m_dlPowerAllocationMap
DL power allocation map.
Definition: lte-enb-phy.h:350
virtual void SendLteControlMessage(Ptr< LteControlMessage > msg)
Send SendLteControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel.
Definition: lte-enb-phy.cc:115
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
virtual Ptr< SpectrumValue > CreateTxPowerSpectralDensityWithPowerAllocation()
Create the PSD for TX with power allocation for each RB.
Definition: lte-enb-phy.cc:468
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:867
Ptr< LteSpectrumPhy > m_downlinkSpectrumPhy
The downlink LteSpectrumPhy associated to this LtePhy.
Definition: lte-phy.h:222
std::map< uint16_t, double > m_paMap
P_A per UE RNTI.
Definition: lte-enb-phy.h:347
See section 4.3.2 ulDciListElement.
TracedCallback< uint16_t, uint16_t, double > m_reportUeSinr
The ReportUeSinr trace source.
Definition: lte-enb-phy.h:407
See section 4.3.24 cqiListElement.
#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
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
EnbMemberLteEnbPhySapProvider(LteEnbPhy *phy)
Definition: lte-enb-phy.cc:91
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
Service Access Point (SAP) offered by the eNB-PHY to the eNB-MAC.
See section 4.3.12 ulInfoListElement.
uint8_t m_rv
the redundancy version (HARQ)
Definition: lte-common.h:128
std::vector< int > m_dlDataRbMap
Definition: lte-enb-phy.h:360
uint32_t m_nrFrames
The frame number currently served.
Definition: lte-enb-phy.h:375
std::map< uint16_t, uint16_t > m_srsCounter
Definition: lte-enb-phy.h:385
Service Access Point (SAP) offered by the eNB-PHY to the eNB-MAC.
void DoSetEarfcn(uint16_t dlEarfcn, uint16_t ulEarfcn)
Definition: lte-enb-phy.cc:892
LteEnbPhySapUser * m_enbPhySapUser
Definition: lte-enb-phy.h:366
uint8_t m_ulBandwidth
The UL bandwidth in number of PRBs.
Definition: lte-phy.h:253
uint16_t m_tbSize
virtual void ReceiveRachPreamble(uint32_t prachId)=0
notify the reception of a RACH preamble on the PRACH
std::vector< int > m_listOfDownlinkSubchannel
A vector of integers, if the i-th value is j it means that the j-th resource block is used for transm...
Definition: lte-enb-phy.h:358
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
double GetNoiseFigure() const
Definition: lte-enb-phy.cc:313
void CreateSrsReport(uint16_t rnti, double srs)
Definition: lte-enb-phy.cc:983
static const int Type0AllocationRbg[4]
void SetMacChDelay(uint8_t delay)
Definition: lte-enb-phy.cc:320
The attribute can be read.
Definition: type-id.h:58
static TypeId GetTypeId(void)
Definition: lte-enb-phy.cc:159
virtual void GenerateCtrlCqiReport(const SpectrumValue &sinr)
generate a CQI report based on the given SINR of Ctrl frame
Definition: lte-enb-phy.cc:806
LteEnbCphySapProvider * m_enbCphySapProvider
Definition: lte-enb-phy.h:368
uint16_t GetSrsSubframeOffset(uint16_t srcCi) const
Definition: lte-phy.cc:164
std::vector< struct VendorSpecificListElement_s > m_vendorSpecificList
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: pointer.h:210
void DoDispose()
Destructor implementation.
Definition: lte-phy.cc:74
void DoSetMasterInformationBlock(LteRrcSap::MasterInformationBlock mib)
virtual void DoInitialize(void)
Initialize() implementation.
Definition: lte-enb-phy.cc:249
virtual void GenerateDataCqiReport(const SpectrumValue &sinr)
generate a CQI report based on the given SINR of Data frame (used for PUSCH CQIs) ...
Definition: lte-enb-phy.cc:818
uint8_t GetRbgSize(void) const
Definition: lte-phy.cc:182
Ptr< LteHarqPhy > m_harqPhyModule
Definition: lte-enb-phy.h:401
Ptr< LteSpectrumPhy > GetDlSpectrumPhy() const
Definition: lte-enb-phy.cc:347
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:883
uint64_t m_imsi
IMSI of the scheduled UE.
Definition: lte-common.h:122
std::map< uint16_t, uint16_t > m_srsSampleCounterMap
Definition: lte-enb-phy.h:413
virtual void ReceiveLteUlHarqFeedback(UlInfoListElement_s mes)
PhySpectrum generated a new UL HARQ feedback.
Hold an unsigned integer type.
Definition: uinteger.h:44
virtual void SetBandwidth(uint8_t ulBandwidth, uint8_t dlBandwidth)
Definition: lte-enb-phy.cc:103
Ptr< SampleEmitter > s
void SetHarqPhyModule(Ptr< LteHarqPhy > harq)
Define the RNTI that has generated the.
uint16_t m_interferenceSamplePeriod
The InterferenceSamplePeriod attribute.
Definition: lte-enb-phy.h:426
virtual void ReceiveLteControlMessage(Ptr< LteControlMessage > msg)
Receive the control message.
Definition: lte-enb-phy.cc:496
uint16_t m_ulEarfcn
The uplink carrier frequency.
Definition: lte-phy.h:270
void StartSubFrame(void)
Start a LTE sub frame.
Definition: lte-enb-phy.cc:580
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:252
See section 4.3.3 vendorSpecifiListElement.
bool AddUePhy(uint16_t rnti)
Add the given RNTI to the list of attached UE m_ueAttached.
Definition: lte-enb-phy.cc:359
#define list
virtual void ReportInterference(const SpectrumValue &interf)
generate a report based on the linear interference and noise power perceived during DATA frame NOTE: ...
Definition: lte-enb-phy.cc:826
See section 4.3.23 dlInfoListElement.
See section 4.3.14 macCEListElement.
void DoSetBandwidth(uint8_t ulBandwidth, uint8_t dlBandwidth)
Definition: lte-enb-phy.cc:869
uint8_t m_mcs
MCS for transport block.
Definition: lte-common.h:126
Substitutive structure for specifying BuildRarListElement_s::m_grant field.
void SendControlChannels(std::list< Ptr< LteControlMessage > > ctrlMsgList)
Send the PDCCH and PCFICH in the first 3 symbols.
Definition: lte-enb-phy.cc:749
double GetTxPower() const
Definition: lte-enb-phy.cc:292
uint8_t m_macChTtiDelay
Delay between MAC and channel layer in terms of TTIs.
Definition: lte-phy.h:285
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void UlInfoListElementHarqFeeback(UlInfoListElement_s params)=0
Notify the HARQ on the UL tranmission status.
LteEnbPhySapProvider * GetLteEnbPhySapProvider()
Get the PHY SAP provider.
Definition: lte-enb-phy.cc:265
Hold objects of type Ptr.
Definition: pointer.h:36
LteRrcSap::MasterInformationBlock m_mib
The Master Information Block message to be broadcasted every frame.
Definition: lte-enb-phy.h:393
void DoRemoveUe(uint16_t rnti)
Definition: lte-enb-phy.cc:913
void SetControlMessages(Ptr< LteControlMessage > m)
Definition: lte-phy.cc:213
LteEnbPhySapProvider * m_enbPhySapProvider
Definition: lte-enb-phy.h:365
uint16_t m_currentSrsOffset
Definition: lte-enb-phy.h:387
void SetTxPower(double pow)
Definition: lte-enb-phy.cc:285
void SetDci(UlDciListElement_s dci)
add a DCI into the message
uint8_t m_dlBandwidth
The DL bandwidth in number of PRBs.
Definition: lte-phy.h:258
void DoAddUe(uint16_t rnti)
Definition: lte-enb-phy.cc:901
static EventId ScheduleNow(MEM mem_ptr, OBJ obj)
Schedule an event to expire Now.
Definition: simulator.h:980
uint16_t m_size
Size of transport block.
Definition: lte-common.h:127
void SetDownlinkSubChannelsWithPowerAllocation(std::vector< int > mask)
set the resource blocks (a.k.a.
Definition: lte-enb-phy.cc:427
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:223
int8_t DoGetReferenceSignalPower() const
Definition: lte-enb-phy.cc:299
virtual void SetCellId(uint16_t cellId)
Definition: lte-enb-phy.cc:109
LteEnbCphySapProvider * GetLteEnbCphySapProvider()
Get the CPHY SAP provider.
Definition: lte-enb-phy.cc:278
uint16_t m_cellId
Cell identifier.
Definition: lte-phy.h:292
uint8_t m_ndi
new data indicator flag
Definition: lte-common.h:129
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters CreatePuschCqiReport(const SpectrumValue &sinr)
Create the UL CQI feedback from SINR values perceived at the physical layer with the PUSCH signal rec...
Definition: lte-enb-phy.cc:847
#define SRS_CQI_RNTI_VSP
LteEnbCphySapUser * m_enbCphySapUser
Definition: lte-enb-phy.h:369
#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
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: double.h:42
static Ptr< SpectrumValue > CreateTxPowerSpectralDensity(uint16_t earfcn, uint8_t bandwidth, double powerTx, std::vector< int > activeRbs)
create a spectrum value representing the power spectral density of a signal to be transmitted...
uint8_t DoGetMacChTtiDelay()
Definition: lte-enb-phy.cc:404
friend class EnbMemberLteEnbPhySapProvider
Definition: lte-enb-phy.h:49
std::list< Ptr< LteControlMessage > > GetControlMessages(void)
Definition: lte-phy.cc:221
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
Ptr< PacketBurst > GetPacketBurst(void)
Definition: lte-phy.cc:194
void DoSetSrsConfigurationIndex(uint16_t rnti, uint16_t srcCi)
uint16_t m_cellId
Cell ID of the attached Enb.
Definition: lte-common.h:121
void SetNoiseFigure(double pow)
Definition: lte-enb-phy.cc:306
void SetLteEnbPhySapUser(LteEnbPhySapUser *s)
Set the PHY SAP User.
Definition: lte-enb-phy.cc:259
static const Time DL_DATA_DURATION
Duration of the data portion of a DL subframe.
Definition: lte-enb-phy.cc:60
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:236
uint8_t m_layer
the layer (cw) of the transmission
Definition: lte-common.h:125
void StartFrame(void)
Start a LTE frame.
Definition: lte-enb-phy.cc:561
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:859
std::vector< int > GetDownlinkSubChannels(void)
Definition: lte-enb-phy.cc:436
std::vector< uint16_t > m_srsUeOffset
Definition: lte-enb-phy.h:386
void DoSetTransmissionMode(uint16_t rnti, uint8_t txMode)
uint8_t m_rbgSize
The RB gruop size according to the bandwidth.
Definition: lte-phy.h:260
virtual void UlCqiReport(FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi)=0
Returns to MAC level the UL-CQI evaluated.
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters CreateSrsCqiReport(const SpectrumValue &sinr)
Create the UL CQI feedback from SINR values perceived at the physical layer with the SRS signal recei...
Definition: lte-enb-phy.cc:948
void QueueUlDci(UlDciLteControlMessage m)
void GeneratePowerAllocationMap(uint16_t rnti, int rbId)
Generate power allocation map (i.e.
Definition: lte-enb-phy.cc:443
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition: log.h:220
Values::const_iterator ConstValuesBegin() const
LteRrcSap::SystemInformationBlockType1 m_sib1
The System Information Block Type 1 message to be broadcasted.
Definition: lte-enb-phy.h:399
std::vector< std::list< Ptr< LteControlMessage > > > m_controlMessagesQueue
A queue of control messages to be sent.
Definition: lte-phy.h:275
LteEnbPhy models the physical layer for the eNodeB.
Definition: lte-enb-phy.h:47
Ptr< LteSpectrumPhy > m_uplinkSpectrumPhy
The uplink LteSpectrumPhy associated to this LtePhy.
Definition: lte-phy.h:227
virtual void SubframeIndication(uint32_t frameNo, uint32_t subframeNo)=0
Trigger the start from a new frame (input from Phy layer)
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
TracedCallback< uint16_t, Ptr< SpectrumValue > > m_reportInterferenceTrace
The ReportInterference trace source.
Definition: lte-enb-phy.h:420
void SendDataChannels(Ptr< PacketBurst > pb)
Send the PDSCH.
Definition: lte-enb-phy.cc:770
virtual void ReceivePhyPdu(Ptr< Packet > p)=0
Called by the Phy to notify the MAC of the reception of a new PHY-PDU.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
Definition: double.h:41
Set of values corresponding to a given SpectrumModel.
virtual void DoDispose(void)
Destructor implementation.
Definition: lte-enb-phy.cc:238
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: uinteger.h:45
void PhyPduReceived(Ptr< Packet > p)
PhySpectrum received a new PHY-PDU.
Definition: lte-enb-phy.cc:411
std::set< uint16_t > m_ueAttached
List of RNTI of attached UEs.
Definition: lte-enb-phy.h:343
Ptr< LteSpectrumPhy > GetUlSpectrumPhy() const
Definition: lte-enb-phy.cc:353
void SetMacPdu(Ptr< Packet > p)
Definition: lte-phy.cc:188
a unique identifier for an interface.
Definition: type-id.h:51
uint8_t GetMacChDelay(void) const
Definition: lte-enb-phy.cc:341
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
void SetLteEnbCphySapUser(LteEnbCphySapUser *s)
Set the CPHY SAP User.
Definition: lte-enb-phy.cc:271
virtual void DoInitialize(void)
Initialize() implementation.
Definition: object.cc:345
uint16_t m_rnti
C-RNTI scheduled.
Definition: lte-common.h:123
The LtePhy models the physical layer of LTE.
Definition: lte-phy.h:52
TracedCallback< PhyTransmissionStatParameters > m_dlPhyTransmission
The DlPhyTransmission trace source.
Definition: lte-enb-phy.h:434
static Ptr< SpectrumValue > CreateNoisePowerSpectralDensity(uint16_t earfcn, uint8_t bandwidth, double noiseFigure)
create a SpectrumValue that models the power spectral density of AWGN
#define UL_PUSCH_TTIS_DELAY
Definition: lte-common.h:28
uint16_t m_srsPeriodicity
Definition: lte-enb-phy.h:383
void EndFrame(void)
End a LTE frame.
Definition: lte-enb-phy.cc:798
void DoSetPa(uint16_t rnti, double pa)
Definition: lte-enb-phy.cc:930
void DoSendMacPdu(Ptr< Packet > p)
Queue the MAC PDU to be sent (according to m_macChTtiDelay)
Definition: lte-enb-phy.cc:397
void EndSubFrame(void)
End a LTE sub frame.
Definition: lte-enb-phy.cc:783
virtual void ReceiveLteControlMessage(Ptr< LteControlMessage > msg)=0
Receive SendLteControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel.
static const Time DL_CTRL_DELAY_FROM_SUBFRAME_START
Delay from the start of a DL subframe to transmission of the data portion.
Definition: lte-enb-phy.cc:67