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