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