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);
155 }
156 
157 TypeId
159 {
160  static TypeId tid = TypeId ("ns3::LteEnbPhy")
161  .SetParent<LtePhy> ()
162  .SetGroupName("Lte")
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);
252  bool haveNodeId = false;
253  uint32_t nodeId = 0;
254  if (m_netDevice != 0)
255  {
256  Ptr<Node> node = m_netDevice->GetNode ();
257  if (node != 0)
258  {
259  nodeId = node->GetId ();
260  haveNodeId = true;
261  }
262  }
263  if (haveNodeId)
264  {
266  }
267  else
268  {
270  }
272  m_uplinkSpectrumPhy->SetNoisePowerSpectralDensity (noisePsd);
274 }
275 
276 
277 void
279 {
280  m_enbPhySapUser = s;
281 }
282 
285 {
286  return (m_enbPhySapProvider);
287 }
288 
289 void
291 {
292  NS_LOG_FUNCTION (this);
293  m_enbCphySapUser = s;
294 }
295 
298 {
299  NS_LOG_FUNCTION (this);
300  return (m_enbCphySapProvider);
301 }
302 
303 void
305 {
306  NS_LOG_FUNCTION (this << pow);
307  m_txPower = pow;
308 }
309 
310 double
312 {
313  NS_LOG_FUNCTION (this);
314  return m_txPower;
315 }
316 
317 int8_t
319 {
320  NS_LOG_FUNCTION (this);
321  return m_txPower;
322 }
323 
324 void
326 {
327  NS_LOG_FUNCTION (this << nf);
328  m_noiseFigure = nf;
329 }
330 
331 double
333 {
334  NS_LOG_FUNCTION (this);
335  return m_noiseFigure;
336 }
337 
338 void
340 {
341  NS_LOG_FUNCTION (this);
342  m_macChTtiDelay = delay;
343  for (int i = 0; i < m_macChTtiDelay; i++)
344  {
345  Ptr<PacketBurst> pb = CreateObject <PacketBurst> ();
346  m_packetBurstQueue.push_back (pb);
347  std::list<Ptr<LteControlMessage> > l;
348  m_controlMessagesQueue.push_back (l);
349  std::list<UlDciLteControlMessage> l1;
350  m_ulDciQueue.push_back (l1);
351  }
352  for (int i = 0; i < UL_PUSCH_TTIS_DELAY; i++)
353  {
354  std::list<UlDciLteControlMessage> l1;
355  m_ulDciQueue.push_back (l1);
356  }
357 }
358 
359 uint8_t
361 {
362  return (m_macChTtiDelay);
363 }
364 
367 {
368  return m_downlinkSpectrumPhy;
369 }
370 
373 {
374  return m_uplinkSpectrumPhy;
375 }
376 
377 bool
378 LteEnbPhy::AddUePhy (uint16_t rnti)
379 {
380  NS_LOG_FUNCTION (this << rnti);
381  std::set <uint16_t>::iterator it;
382  it = m_ueAttached.find (rnti);
383  if (it == m_ueAttached.end ())
384  {
385  m_ueAttached.insert (rnti);
386  return (true);
387  }
388  else
389  {
390  NS_LOG_ERROR ("UE already attached");
391  return (false);
392  }
393 }
394 
395 bool
396 LteEnbPhy::DeleteUePhy (uint16_t rnti)
397 {
398  NS_LOG_FUNCTION (this << rnti);
399  std::set <uint16_t>::iterator it;
400  it = m_ueAttached.find (rnti);
401  if (it == m_ueAttached.end ())
402  {
403  NS_LOG_ERROR ("UE not attached");
404  return (false);
405  }
406  else
407  {
408  m_ueAttached.erase (it);
409  return (true);
410  }
411 }
412 
413 
414 
415 void
417 {
418  NS_LOG_FUNCTION (this);
419  SetMacPdu (p);
420 }
421 
422 uint8_t
424 {
425  return (m_macChTtiDelay);
426 }
427 
428 
429 void
431 {
432  NS_LOG_FUNCTION (this);
434 }
435 
436 void
437 LteEnbPhy::SetDownlinkSubChannels (std::vector<int> mask)
438 {
439  NS_LOG_FUNCTION (this);
442  m_downlinkSpectrumPhy->SetTxPowerSpectralDensity (txPsd);
443 }
444 
445 void
447 {
448  NS_LOG_FUNCTION (this);
451  m_downlinkSpectrumPhy->SetTxPowerSpectralDensity (txPsd);
452 }
453 
454 std::vector<int>
456 {
457  NS_LOG_FUNCTION (this);
459 }
460 
461 void
462 LteEnbPhy::GeneratePowerAllocationMap (uint16_t rnti, int rbId)
463 {
464  NS_LOG_FUNCTION (this);
465  double rbgTxPower = m_txPower;
466 
467  std::map<uint16_t, double>::iterator it = m_paMap.find (rnti);
468  if (it != m_paMap.end ())
469  {
470  rbgTxPower = m_txPower + it->second;
471  }
472 
473  m_dlPowerAllocationMap.insert (std::pair<int, double> (rbId, rbgTxPower));
474 }
475 
478 {
479  NS_LOG_FUNCTION (this);
480 
482 
483  return psd;
484 }
485 
488 {
489  NS_LOG_FUNCTION (this);
490 
492 
493  return psd;
494 }
495 
496 
497 void
499 {
500  NS_LOG_FUNCTION (this);
501 }
502 
503 
504 void
506 {
507  NS_LOG_FUNCTION (this << msg);
508  // queues the message (wait for MAC-PHY delay)
509  SetControlMessages (msg);
510 }
511 
512 
513 
514 void
516 {
517  NS_FATAL_ERROR ("Obsolete function");
518  NS_LOG_FUNCTION (this << msg);
520 }
521 
522 void
524 {
525  NS_LOG_FUNCTION (this);
526  std::list<Ptr<LteControlMessage> >::iterator it;
527  for (it = msgList.begin (); it != msgList.end (); it++)
528  {
529  switch ((*it)->GetMessageType ())
530  {
532  {
533  Ptr<RachPreambleLteControlMessage> rachPreamble = DynamicCast<RachPreambleLteControlMessage> (*it);
534  m_enbPhySapUser->ReceiveRachPreamble (rachPreamble->GetRapId ());
535  }
536  break;
538  {
539  Ptr<DlCqiLteControlMessage> dlcqiMsg = DynamicCast<DlCqiLteControlMessage> (*it);
540  CqiListElement_s dlcqi = dlcqiMsg->GetDlCqi ();
541  // check whether the UE is connected
542  if (m_ueAttached.find (dlcqi.m_rnti) != m_ueAttached.end ())
543  {
545  }
546  }
547  break;
549  {
550  Ptr<BsrLteControlMessage> bsrMsg = DynamicCast<BsrLteControlMessage> (*it);
551  MacCeListElement_s bsr = bsrMsg->GetBsr ();
552  // check whether the UE is connected
553  if (m_ueAttached.find (bsr.m_rnti) != m_ueAttached.end ())
554  {
556  }
557  }
558  break;
560  {
561  Ptr<DlHarqFeedbackLteControlMessage> dlharqMsg = DynamicCast<DlHarqFeedbackLteControlMessage> (*it);
562  DlInfoListElement_s dlharq = dlharqMsg->GetDlHarqFeedback ();
563  // check whether the UE is connected
564  if (m_ueAttached.find (dlharq.m_rnti) != m_ueAttached.end ())
565  {
567  }
568  }
569  break;
570  default:
571  NS_FATAL_ERROR ("Unexpected LteControlMessage type");
572  break;
573  }
574  }
575 }
576 
577 
578 
579 void
581 {
582  NS_LOG_FUNCTION (this);
583 
584  ++m_nrFrames;
585  NS_LOG_INFO ("-----frame " << m_nrFrames << "-----");
586  m_nrSubFrames = 0;
587 
588  // send MIB at beginning of every frame
590  Ptr<MibLteControlMessage> mibMsg = Create<MibLteControlMessage> ();
591  mibMsg->SetMib (m_mib);
592  m_controlMessagesQueue.at (0).push_back (mibMsg);
593 
594  StartSubFrame ();
595 }
596 
597 
598 void
600 {
601  NS_LOG_FUNCTION (this);
602 
603  ++m_nrSubFrames;
604 
605  /*
606  * Send SIB1 at 6th subframe of every odd-numbered radio frame. This is
607  * equivalent with Section 5.2.1.2 of 3GPP TS 36.331, where it is specified
608  * "repetitions are scheduled in subframe #5 of all other radio frames for
609  * which SFN mod 2 = 0," except that 3GPP counts frames and subframes starting
610  * from 0, while ns-3 counts starting from 1.
611  */
612  if ((m_nrSubFrames == 6) && ((m_nrFrames % 2) == 1))
613  {
614  Ptr<Sib1LteControlMessage> msg = Create<Sib1LteControlMessage> ();
615  msg->SetSib1 (m_sib1);
616  m_controlMessagesQueue.at (0).push_back (msg);
617  }
618 
619  if (m_srsPeriodicity>0)
620  {
621  // might be 0 in case the eNB has no UEs attached
622  NS_ASSERT_MSG (m_nrFrames > 1, "the SRS index check code assumes that frameNo starts at 1");
623  NS_ASSERT_MSG (m_nrSubFrames > 0 && m_nrSubFrames <= 10, "the SRS index check code assumes that subframeNo starts at 1");
625  }
626  NS_LOG_INFO ("-----sub frame " << m_nrSubFrames << "-----");
627  m_harqPhyModule->SubframeIndication (m_nrFrames, m_nrSubFrames);
628 
629  // update info on TB to be received
630  std::list<UlDciLteControlMessage> uldcilist = DequeueUlDci ();
631  std::list<UlDciLteControlMessage>::iterator dciIt = uldcilist.begin ();
632  NS_LOG_DEBUG (this << " eNB Expected TBs " << uldcilist.size ());
633  for (dciIt = uldcilist.begin (); dciIt!=uldcilist.end (); dciIt++)
634  {
635  std::set <uint16_t>::iterator it2;
636  it2 = m_ueAttached.find ((*dciIt).GetDci ().m_rnti);
637 
638  if (it2 == m_ueAttached.end ())
639  {
640  NS_LOG_ERROR ("UE not attached");
641  }
642  else
643  {
644  // send info of TB to LteSpectrumPhy
645  // translate to allocation map
646  std::vector <int> rbMap;
647  for (int i = (*dciIt).GetDci ().m_rbStart; i < (*dciIt).GetDci ().m_rbStart + (*dciIt).GetDci ().m_rbLen; i++)
648  {
649  rbMap.push_back (i);
650  }
651  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*/);
652  if ((*dciIt).GetDci ().m_ndi==1)
653  {
654  NS_LOG_DEBUG (this << " RNTI " << (*dciIt).GetDci ().m_rnti << " NEW TB");
655  }
656  else
657  {
658  NS_LOG_DEBUG (this << " RNTI " << (*dciIt).GetDci ().m_rnti << " HARQ RETX");
659  }
660  }
661  }
662 
663  // process the current burst of control messages
664  std::list<Ptr<LteControlMessage> > ctrlMsg = GetControlMessages ();
665  m_dlDataRbMap.clear ();
666  m_dlPowerAllocationMap.clear ();
667  if (ctrlMsg.size () > 0)
668  {
669  std::list<Ptr<LteControlMessage> >::iterator it;
670  it = ctrlMsg.begin ();
671  while (it != ctrlMsg.end ())
672  {
673  Ptr<LteControlMessage> msg = (*it);
674  if (msg->GetMessageType () == LteControlMessage::DL_DCI)
675  {
676  Ptr<DlDciLteControlMessage> dci = DynamicCast<DlDciLteControlMessage> (msg);
677  // get the tx power spectral density according to DL-DCI(s)
678  // translate the DCI to Spectrum framework
679  uint32_t mask = 0x1;
680  for (int i = 0; i < 32; i++)
681  {
682  if (((dci->GetDci ().m_rbBitmap & mask) >> i) == 1)
683  {
684  for (int k = 0; k < GetRbgSize (); k++)
685  {
686  m_dlDataRbMap.push_back ((i * GetRbgSize ()) + k);
687  //NS_LOG_DEBUG(this << " [enb]DL-DCI allocated PRB " << (i*GetRbgSize()) + k);
688  GeneratePowerAllocationMap (dci->GetDci ().m_rnti, (i * GetRbgSize ()) + k );
689  }
690  }
691  mask = (mask << 1);
692  }
693  // fire trace of DL Tx PHY stats
694  for (uint8_t i = 0; i < dci->GetDci ().m_mcs.size (); i++)
695  {
697  params.m_cellId = m_cellId;
698  params.m_imsi = 0; // it will be set by DlPhyTransmissionCallback in LteHelper
700  params.m_rnti = dci->GetDci ().m_rnti;
701  params.m_txMode = 0; // TBD
702  params.m_layer = i;
703  params.m_mcs = dci->GetDci ().m_mcs.at (i);
704  params.m_size = dci->GetDci ().m_tbsSize.at (i);
705  params.m_rv = dci->GetDci ().m_rv.at (i);
706  params.m_ndi = dci->GetDci ().m_ndi.at (i);
707  m_dlPhyTransmission (params);
708  }
709 
710  }
711  else if (msg->GetMessageType () == LteControlMessage::UL_DCI)
712  {
713  Ptr<UlDciLteControlMessage> dci = DynamicCast<UlDciLteControlMessage> (msg);
714  QueueUlDci (*dci);
715  }
716  else if (msg->GetMessageType () == LteControlMessage::RAR)
717  {
718  Ptr<RarLteControlMessage> rarMsg = DynamicCast<RarLteControlMessage> (msg);
719  for (std::list<RarLteControlMessage::Rar>::const_iterator it = rarMsg->RarListBegin (); it != rarMsg->RarListEnd (); ++it)
720  {
721  if (it->rarPayload.m_grant.m_ulDelay == true)
722  {
723  NS_FATAL_ERROR (" RAR delay is not yet implemented");
724  }
725  UlGrant_s ulGrant = it->rarPayload.m_grant;
726  // translate the UL grant in a standard UL-DCI and queue it
727  UlDciListElement_s dci;
728  dci.m_rnti = ulGrant.m_rnti;
729  dci.m_rbStart = ulGrant.m_rbStart;
730  dci.m_rbLen = ulGrant.m_rbLen;
731  dci.m_tbSize = ulGrant.m_tbSize;
732  dci.m_mcs = ulGrant.m_mcs;
733  dci.m_hopping = ulGrant.m_hopping;
734  dci.m_tpc = ulGrant.m_tpc;
735  dci.m_cqiRequest = ulGrant.m_cqiRequest;
736  dci.m_ndi = 1;
738  msg.SetDci (dci);
739  QueueUlDci (msg);
740  }
741  }
742  it++;
743 
744  }
745  }
746 
747  SendControlChannels (ctrlMsg);
748 
749  // send data frame
751  if (pb)
752  {
753  Simulator::Schedule (DL_CTRL_DELAY_FROM_SUBFRAME_START, // ctrl frame fixed to 3 symbols
755  this,pb);
756  }
757 
758  // trigger the MAC
760 
763  this);
764 
765 }
766 
767 void
769 {
770  NS_LOG_FUNCTION (this << " eNB " << m_cellId << " start tx ctrl frame");
771  // set the current tx power spectral density (full bandwidth)
772  std::vector <int> dlRb;
773  for (uint8_t i = 0; i < m_dlBandwidth; i++)
774  {
775  dlRb.push_back (i);
776  }
777  SetDownlinkSubChannels (dlRb);
778  NS_LOG_LOGIC (this << " eNB start TX CTRL");
779  bool pss = false;
780  if ((m_nrSubFrames == 1) || (m_nrSubFrames == 6))
781  {
782  pss = true;
783  }
784  m_downlinkSpectrumPhy->StartTxDlCtrlFrame (ctrlMsgList, pss);
785 
786 }
787 
788 void
790 {
791  // set the current tx power spectral density
793  // send the current burts of packets
794  NS_LOG_LOGIC (this << " eNB start TX DATA");
795  std::list<Ptr<LteControlMessage> > ctrlMsgList;
796  ctrlMsgList.clear ();
797  m_downlinkSpectrumPhy->StartTxDataFrame (pb, ctrlMsgList, DL_DATA_DURATION);
798 }
799 
800 
801 void
803 {
804  NS_LOG_FUNCTION (this << Simulator::Now ().GetSeconds ());
805  if (m_nrSubFrames == 10)
806  {
808  }
809  else
810  {
812  }
813 }
814 
815 
816 void
818 {
819  NS_LOG_FUNCTION (this << Simulator::Now ().GetSeconds ());
821 }
822 
823 
824 void
826 {
827  NS_LOG_FUNCTION (this << sinr << Simulator::Now () << m_srsStartTime);
828  // avoid processing SRSs sent with an old SRS configuration index
830  {
832  m_enbPhySapUser->UlCqiReport (ulcqi);
833  }
834 }
835 
836 void
838 {
839  NS_LOG_FUNCTION (this << sinr);
841  m_enbPhySapUser->UlCqiReport (ulcqi);
842 }
843 
844 void
846 {
847  NS_LOG_FUNCTION (this << interf);
848  Ptr<SpectrumValue> interfCopy = Create<SpectrumValue> (interf);
850  if (m_interferenceSampleCounter == m_interferenceSamplePeriod)
851  {
852  m_reportInterferenceTrace (m_cellId, interfCopy);
853  m_interferenceSampleCounter = 0;
854  }
855 }
856 
857 void
859 {
860  // not used by eNB
861 }
862 
863 
864 
867 {
868  NS_LOG_FUNCTION (this << sinr);
869  Values::const_iterator it;
871  ulcqi.m_ulCqi.m_type = UlCqi_s::PUSCH;
872  int i = 0;
873  for (it = sinr.ConstValuesBegin (); it != sinr.ConstValuesEnd (); it++)
874  {
875  double sinrdb = 10 * std::log10 ((*it));
876 // NS_LOG_DEBUG ("ULCQI RB " << i << " value " << sinrdb);
877  // convert from double to fixed point notation Sxxxxxxxxxxx.xxx
878  int16_t sinrFp = LteFfConverter::double2fpS11dot3 (sinrdb);
879  ulcqi.m_ulCqi.m_sinr.push_back (sinrFp);
880  i++;
881  }
882  return (ulcqi);
883 
884 }
885 
886 
887 void
888 LteEnbPhy::DoSetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth)
889 {
890  NS_LOG_FUNCTION (this << (uint32_t) ulBandwidth << (uint32_t) dlBandwidth);
891  m_ulBandwidth = ulBandwidth;
892  m_dlBandwidth = dlBandwidth;
893 
894  static const int Type0AllocationRbg[4] = {
895  10, // RGB size 1
896  26, // RGB size 2
897  63, // RGB size 3
898  110 // RGB size 4
899  }; // see table 7.1.6.1-1 of 36.213
900  for (int i = 0; i < 4; i++)
901  {
902  if (dlBandwidth < Type0AllocationRbg[i])
903  {
904  m_rbgSize = i + 1;
905  break;
906  }
907  }
908 }
909 
910 void
911 LteEnbPhy::DoSetEarfcn (uint16_t ulEarfcn, uint16_t dlEarfcn)
912 {
913  NS_LOG_FUNCTION (this << ulEarfcn << dlEarfcn);
914  m_ulEarfcn = ulEarfcn;
915  m_dlEarfcn = dlEarfcn;
916 }
917 
918 
919 void
920 LteEnbPhy::DoAddUe (uint16_t rnti)
921 {
922  NS_LOG_FUNCTION (this << rnti);
923 
924  bool success = AddUePhy (rnti);
925  NS_ASSERT_MSG (success, "AddUePhy() failed");
926 
927  // add default P_A value
928  DoSetPa (rnti, 0);
929 }
930 
931 void
932 LteEnbPhy::DoRemoveUe (uint16_t rnti)
933 {
934  NS_LOG_FUNCTION (this << rnti);
935 
936  bool success = DeleteUePhy (rnti);
937  NS_ASSERT_MSG (success, "DeleteUePhy() failed");
938 
939  // remove also P_A value
940  std::map<uint16_t, double>::iterator it = m_paMap.find (rnti);
941  if (it != m_paMap.end ())
942  {
943  m_paMap.erase (it);
944  }
945 
946 }
947 
948 void
949 LteEnbPhy::DoSetPa (uint16_t rnti, double pa)
950 {
951  NS_LOG_FUNCTION (this << rnti);
952 
953  std::map<uint16_t, double>::iterator it = m_paMap.find (rnti);
954 
955  if (it == m_paMap.end ())
956  {
957  m_paMap.insert (std::pair<uint16_t, double> (rnti, pa));
958  }
959  else
960  {
961  it->second = pa;
962  }
963 
964 }
965 
968 {
969  NS_LOG_FUNCTION (this << sinr);
970  Values::const_iterator it;
972  ulcqi.m_ulCqi.m_type = UlCqi_s::SRS;
973  int i = 0;
974  double srsSum = 0.0;
975  for (it = sinr.ConstValuesBegin (); it != sinr.ConstValuesEnd (); it++)
976  {
977  double sinrdb = 10 * log10 ((*it));
978  // NS_LOG_DEBUG ("ULCQI RB " << i << " value " << sinrdb);
979  // convert from double to fixed point notation Sxxxxxxxxxxx.xxx
980  int16_t sinrFp = LteFfConverter::double2fpS11dot3 (sinrdb);
981  srsSum += (*it);
982  ulcqi.m_ulCqi.m_sinr.push_back (sinrFp);
983  i++;
984  }
985  // Insert the user generated the srs as a vendor specific parameter
986  NS_LOG_DEBUG (this << " ENB RX UL-CQI of " << m_srsUeOffset.at (m_currentSrsOffset));
988  vsp.m_type = SRS_CQI_RNTI_VSP;
989  vsp.m_length = sizeof(SrsCqiRntiVsp);
990  Ptr<SrsCqiRntiVsp> rnti = Create <SrsCqiRntiVsp> (m_srsUeOffset.at (m_currentSrsOffset));
991  vsp.m_value = rnti;
992  ulcqi.m_vendorSpecificList.push_back (vsp);
993  // call SRS tracing method
995  (i > 0) ? (srsSum / i) : DBL_MAX);
996  return (ulcqi);
997 
998 }
999 
1000 
1001 void
1002 LteEnbPhy::CreateSrsReport (uint16_t rnti, double srs)
1003 {
1004  NS_LOG_FUNCTION (this << rnti << srs);
1005  std::map <uint16_t,uint16_t>::iterator it = m_srsSampleCounterMap.find (rnti);
1006  if (it==m_srsSampleCounterMap.end ())
1007  {
1008  // create new entry
1009  m_srsSampleCounterMap.insert (std::pair <uint16_t,uint16_t> (rnti, 0));
1010  it = m_srsSampleCounterMap.find (rnti);
1011  }
1012  (*it).second++;
1013  if ((*it).second == m_srsSamplePeriod)
1014  {
1015  m_reportUeSinr (m_cellId, rnti, srs);
1016  (*it).second = 0;
1017  }
1018 }
1019 
1020 void
1021 LteEnbPhy::DoSetTransmissionMode (uint16_t rnti, uint8_t txMode)
1022 {
1023  NS_LOG_FUNCTION (this << rnti << (uint16_t)txMode);
1024  // UL supports only SISO MODE
1025 }
1026 
1027 void
1029 {
1030  NS_LOG_FUNCTION (this);
1031  m_ulDciQueue.at (UL_PUSCH_TTIS_DELAY - 1).push_back (m);
1032 }
1033 
1034 std::list<UlDciLteControlMessage>
1036 {
1037  NS_LOG_FUNCTION (this);
1038  if (m_ulDciQueue.at (0).size ()>0)
1039  {
1040  std::list<UlDciLteControlMessage> ret = m_ulDciQueue.at (0);
1041  m_ulDciQueue.erase (m_ulDciQueue.begin ());
1042  std::list<UlDciLteControlMessage> l;
1043  m_ulDciQueue.push_back (l);
1044  return (ret);
1045  }
1046  else
1047  {
1048  m_ulDciQueue.erase (m_ulDciQueue.begin ());
1049  std::list<UlDciLteControlMessage> l;
1050  m_ulDciQueue.push_back (l);
1051  std::list<UlDciLteControlMessage> emptylist;
1052  return (emptylist);
1053  }
1054 }
1055 
1056 void
1057 LteEnbPhy::DoSetSrsConfigurationIndex (uint16_t rnti, uint16_t srcCi)
1058 {
1059  NS_LOG_FUNCTION (this);
1060  uint16_t p = GetSrsPeriodicity (srcCi);
1061  if (p!=m_srsPeriodicity)
1062  {
1063  // resize the array of offset -> re-initialize variables
1064  m_srsUeOffset.clear ();
1065  m_srsUeOffset.resize (p, 0);
1066  m_srsPeriodicity = p;
1067  // inhibit SRS until RRC Connection Reconfiguration propagates
1068  // to UEs, otherwise we might be wrong in determining the UE who
1069  // actually sent the SRS (if the UE was using a stale SRS config)
1070  // if we use a static SRS configuration index, we can have a 0ms guard time
1072  }
1073 
1074  NS_LOG_DEBUG (this << " ENB SRS P " << m_srsPeriodicity << " RNTI " << rnti << " offset " << GetSrsSubframeOffset (srcCi) << " CI " << srcCi);
1075  std::map <uint16_t,uint16_t>::iterator it = m_srsCounter.find (rnti);
1076  if (it != m_srsCounter.end ())
1077  {
1078  (*it).second = GetSrsSubframeOffset (srcCi) + 1;
1079  }
1080  else
1081  {
1082  m_srsCounter.insert (std::pair<uint16_t, uint16_t> (rnti, GetSrsSubframeOffset (srcCi) + 1));
1083  }
1084  m_srsUeOffset.at (GetSrsSubframeOffset (srcCi)) = rnti;
1085 
1086 }
1087 
1088 
1089 void
1091 {
1092  NS_LOG_FUNCTION (this);
1093  m_mib = mib;
1094 }
1095 
1096 
1097 void
1099 {
1100  NS_LOG_FUNCTION (this);
1101  m_sib1 = sib1;
1102 }
1103 
1104 
1105 void
1107 {
1108  m_harqPhyModule = harq;
1109 }
1110 
1111 
1112 void
1114 {
1115  NS_LOG_FUNCTION (this);
1116  // forward to scheduler
1118 }
1119 
1120 };
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 ...
virtual void DoInitialize(void)
Initialize() implementation.
Definition: object.cc:353
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
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:430
void DoSetCellId(uint16_t cellId)
Definition: lte-phy.cc:245
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:382
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:413
#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:437
void CalcChannelQualityForUe(std::vector< double > sinr, Ptr< LteSpectrumPhy > ue)
Calculate the channel quality for a given UE.
Definition: lte-enb-phy.cc:498
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:396
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:523
enum ns3::UlCqi_s::Type_e m_type
void DoSendLteControlMessage(Ptr< LteControlMessage > msg)
Definition: lte-enb-phy.cc:505
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:858
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:477
std::vector< std::list< UlDciLteControlMessage > > m_ulDciQueue
For storing info on future receptions.
Definition: lte-enb-phy.h:364
std::map< int, double > m_dlPowerAllocationMap
DL power allocation map.
Definition: lte-enb-phy.h:351
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:487
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:903
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:348
See section 4.3.2 ulDciListElement.
TracedCallback< uint16_t, uint16_t, double > m_reportUeSinr
The ReportUeSinr trace source.
Definition: lte-enb-phy.h:408
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)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:162
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
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:361
uint32_t m_nrFrames
The frame number currently served.
Definition: lte-enb-phy.h:376
std::map< uint16_t, uint16_t > m_srsCounter
Definition: lte-enb-phy.h:386
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:911
LteEnbPhySapUser * m_enbPhySapUser
Definition: lte-enb-phy.h:367
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:359
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:332
void CreateSrsReport(uint16_t rnti, double srs)
static const int Type0AllocationRbg[4]
void SetMacChDelay(uint8_t delay)
Definition: lte-enb-phy.cc:339
static TypeId GetTypeId(void)
Definition: lte-enb-phy.cc:158
virtual void GenerateCtrlCqiReport(const SpectrumValue &sinr)
generate a CQI report based on the given SINR of Ctrl frame
Definition: lte-enb-phy.cc:825
LteEnbCphySapProvider * m_enbCphySapProvider
Definition: lte-enb-phy.h:369
uint16_t GetSrsSubframeOffset(uint16_t srcCi) const
Definition: lte-phy.cc:165
std::vector< struct VendorSpecificListElement_s > m_vendorSpecificList
tuple phy
Definition: third.py:86
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:220
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
Definition: simulator.h:1238
void DoDispose()
Destructor implementation.
Definition: lte-phy.cc:75
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:837
uint8_t GetRbgSize(void) const
Definition: lte-phy.cc:183
Ptr< LteHarqPhy > m_harqPhyModule
Definition: lte-enb-phy.h:402
Ptr< LteSpectrumPhy > GetDlSpectrumPhy() const
Definition: lte-enb-phy.cc:366
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:919
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:414
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
void SetHarqPhyModule(Ptr< LteHarqPhy > harq)
Define the RNTI that has generated the.
uint16_t m_interferenceSamplePeriod
The InterferenceSamplePeriod attribute.
Definition: lte-enb-phy.h:429
virtual void ReceiveLteControlMessage(Ptr< LteControlMessage > msg)
Receive the control message.
Definition: lte-enb-phy.cc:515
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:599
#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:378
#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:845
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:888
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:768
double GetTxPower() const
Definition: lte-enb-phy.cc:311
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:284
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:394
void DoRemoveUe(uint16_t rnti)
Definition: lte-enb-phy.cc:932
void SetControlMessages(Ptr< LteControlMessage > m)
Definition: lte-phy.cc:214
LteEnbPhySapProvider * m_enbPhySapProvider
Definition: lte-enb-phy.h:366
uint16_t m_currentSrsOffset
Definition: lte-enb-phy.h:388
void SetTxPower(double pow)
Definition: lte-enb-phy.cc:304
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:920
static EventId ScheduleNow(MEM mem_ptr, OBJ obj)
Schedule an event to expire Now.
Definition: simulator.h:1401
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:446
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:224
int8_t DoGetReferenceSignalPower() const
Definition: lte-enb-phy.cc:318
virtual void SetCellId(uint16_t cellId)
Definition: lte-enb-phy.cc:109
LteEnbCphySapProvider * GetLteEnbCphySapProvider()
Get the CPHY SAP provider.
Definition: lte-enb-phy.cc:297
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:866
#define SRS_CQI_RNTI_VSP
LteEnbCphySapUser * m_enbCphySapUser
Definition: lte-enb-phy.h:370
#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:90
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:423
static void ScheduleWithContext(uint32_t context, Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event with the given context.
Definition: simulator.h:1319
Ptr< LteNetDevice > m_netDevice
Pointer to the NetDevice where this PHY layer is attached.
Definition: lte-phy.h:216
friend class EnbMemberLteEnbPhySapProvider
Definition: lte-enb-phy.h:49
The attribute can be read.
Definition: type-id.h:63
std::list< Ptr< LteControlMessage > > GetControlMessages(void)
Definition: lte-phy.cc:222
uint32_t GetId(void) const
Definition: node.cc:107
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:325
void SetLteEnbPhySapUser(LteEnbPhySapUser *s)
Set the PHY SAP User.
Definition: lte-enb-phy.cc:278
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:580
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:895
std::vector< int > GetDownlinkSubChannels(void)
Definition: lte-enb-phy.cc:455
std::vector< uint16_t > m_srsUeOffset
Definition: lte-enb-phy.h:387
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:967
void QueueUlDci(UlDciLteControlMessage m)
void GeneratePowerAllocationMap(uint16_t rnti, int rbId)
Generate power allocation map (i.e.
Definition: lte-enb-phy.cc:462
#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:400
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:423
void SendDataChannels(Ptr< PacketBurst > pb)
Send the PDSCH.
Definition: lte-enb-phy.cc:789
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:430
std::set< uint16_t > m_ueAttached
List of RNTI of attached UEs.
Definition: lte-enb-phy.h:344
Ptr< LteSpectrumPhy > GetUlSpectrumPhy() const
Definition: lte-enb-phy.cc:372
void SetMacPdu(Ptr< Packet > p)
Definition: lte-phy.cc:189
a unique identifier for an interface.
Definition: type-id.h:58
uint8_t GetMacChDelay(void) const
Definition: lte-enb-phy.cc:360
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:345
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:904
void SetLteEnbCphySapUser(LteEnbCphySapUser *s)
Set the CPHY SAP User.
Definition: lte-enb-phy.cc:290
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:437
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:384
void EndFrame(void)
End a LTE frame.
Definition: lte-enb-phy.cc:817
void DoSetPa(uint16_t rnti, double pa)
Definition: lte-enb-phy.cc:949
void DoSendMacPdu(Ptr< Packet > p)
Queue the MAC PDU to be sent (according to m_macChTtiDelay)
Definition: lte-enb-phy.cc:416
void EndSubFrame(void)
End a LTE sub frame.
Definition: lte-enb-phy.cc:802
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