A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-enb-phy.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Giuseppe Piro <g.piro@poliba.it>
18 * Marco Miozzo <mmiozzo@cttc.es>
19 */
20
21#include "lte-enb-phy.h"
22
23#include "lte-common.h"
25#include "lte-net-device.h"
28
29#include <ns3/attribute-accessor-helper.h>
30#include <ns3/double.h>
31#include <ns3/log.h>
32#include <ns3/object-factory.h>
33#include <ns3/simulator.h>
34
35#include <cfloat>
36#include <cmath>
37
38// WILD HACK for the initialization of direct eNB-UE ctrl messaging
39#include <ns3/node-list.h>
40#include <ns3/node.h>
41#include <ns3/pointer.h>
42
43namespace ns3
44{
45
46NS_LOG_COMPONENT_DEFINE("LteEnbPhy");
47
49
56static const Time DL_DATA_DURATION = NanoSeconds(785714 - 1);
57
64
66// member SAP forwarders
68
71{
72 public:
79
80 // inherited from LteEnbPhySapProvider
81 void SendMacPdu(Ptr<Packet> p) override;
83 uint8_t GetMacChTtiDelay() override;
90 virtual void SetBandwidth(uint16_t ulBandwidth, uint16_t dlBandwidth);
96 virtual void SetCellId(uint16_t cellId);
97
98 private:
100};
101
103 : m_phy(phy)
104{
105}
106
107void
109{
111}
112
113void
114EnbMemberLteEnbPhySapProvider::SetBandwidth(uint16_t ulBandwidth, uint16_t dlBandwidth)
115{
116 m_phy->DoSetBandwidth(ulBandwidth, dlBandwidth);
117}
118
119void
121{
122 m_phy->DoSetCellId(cellId);
123}
124
125void
127{
129}
130
131uint8_t
133{
134 return (m_phy->DoGetMacChTtiDelay());
135}
136
138// generic LteEnbPhy methods
140
142{
143 NS_LOG_FUNCTION(this);
144 NS_FATAL_ERROR("This constructor should not be called");
145}
146
148 : LtePhy(dlPhy, ulPhy),
149 m_enbPhySapUser(nullptr),
150 m_enbCphySapUser(nullptr),
151 m_nrFrames(0),
152 m_nrSubFrames(0),
153 m_srsPeriodicity(0),
154 m_srsStartTime(Seconds(0)),
155 m_currentSrsOffset(0),
156 m_interferenceSampleCounter(0)
157{
160 m_harqPhyModule = Create<LteHarqPhy>();
161 m_downlinkSpectrumPhy->SetHarqPhyModule(m_harqPhyModule);
162 m_uplinkSpectrumPhy->SetHarqPhyModule(m_harqPhyModule);
163}
164
165TypeId
167{
168 static TypeId tid =
169 TypeId("ns3::LteEnbPhy")
170 .SetParent<LtePhy>()
171 .SetGroupName("Lte")
172 .AddConstructor<LteEnbPhy>()
173 .AddAttribute("TxPower",
174 "Transmission power in dBm",
175 DoubleValue(30.0),
177 MakeDoubleChecker<double>())
178 .AddAttribute(
179 "NoiseFigure",
180 "Loss (dB) in the Signal-to-Noise-Ratio due to "
181 "non-idealities in the receiver. According to Wikipedia "
182 "(http://en.wikipedia.org/wiki/Noise_figure), this is "
183 "\"the difference in decibels (dB) between"
184 " the noise output of the actual receiver to "
185 "the noise output of an ideal receiver with "
186 "the same overall gain and bandwidth when the receivers "
187 "are connected to sources at the standard noise "
188 "temperature T0.\" In this model, we consider T0 = 290K.",
189 DoubleValue(5.0),
191 MakeDoubleChecker<double>())
192 .AddAttribute(
193 "MacToChannelDelay",
194 "The delay in TTI units that occurs between "
195 "a scheduling decision in the MAC and the actual "
196 "start of the transmission by the PHY. This is "
197 "intended to be used to model the latency of real PHY "
198 "and MAC implementations.",
199 UintegerValue(2),
201 MakeUintegerChecker<uint8_t>())
202 .AddTraceSource("ReportUeSinr",
203 "Report UEs' averaged linear SINR",
205 "ns3::LteEnbPhy::ReportUeSinrTracedCallback")
206 .AddAttribute("UeSinrSamplePeriod",
207 "The sampling period for reporting UEs' SINR stats.",
208 UintegerValue(1),
210 MakeUintegerChecker<uint16_t>())
211 .AddTraceSource("ReportInterference",
212 "Report linear interference power per PHY RB",
214 "ns3::LteEnbPhy::ReportInterferenceTracedCallback")
215 .AddAttribute("InterferenceSamplePeriod",
216 "The sampling period for reporting interference stats",
217 UintegerValue(1),
219 MakeUintegerChecker<uint16_t>())
220 .AddTraceSource("DlPhyTransmission",
221 "DL transmission PHY layer statistics.",
223 "ns3::PhyTransmissionStatParameters::TracedCallback")
224 .AddAttribute("DlSpectrumPhy",
225 "The downlink LteSpectrumPhy associated to this LtePhy",
227 PointerValue(),
229 MakePointerChecker<LteSpectrumPhy>())
230 .AddAttribute("UlSpectrumPhy",
231 "The uplink LteSpectrumPhy associated to this LtePhy",
233 PointerValue(),
235 MakePointerChecker<LteSpectrumPhy>());
236 return tid;
237}
238
240{
241}
242
243void
245{
246 NS_LOG_FUNCTION(this);
247 m_ueAttached.clear();
248 m_srsUeOffset.clear();
249 delete m_enbPhySapProvider;
252}
253
254void
256{
257 NS_LOG_FUNCTION(this);
258
259 NS_ABORT_MSG_IF(!m_netDevice, "LteEnbDevice is not available in LteEnbPhy");
260 Ptr<Node> node = m_netDevice->GetNode();
261 NS_ABORT_MSG_IF(!node, "Node is not available in the LteNetDevice of LteEnbPhy");
262 uint32_t nodeId = node->GetId();
263
264 // ScheduleWithContext() is needed here to set context for logs,
265 // because Initialize() is called outside of Node::AddDevice().
266
268
269 Ptr<SpectrumValue> noisePsd =
273 m_uplinkSpectrumPhy->SetNoisePowerSpectralDensity(noisePsd);
275}
276
277void
279{
280 m_enbPhySapUser = s;
281}
282
285{
286 return (m_enbPhySapProvider);
287}
288
289void
291{
292 NS_LOG_FUNCTION(this);
294}
295
298{
299 NS_LOG_FUNCTION(this);
300 return (m_enbCphySapProvider);
301}
302
303void
305{
306 NS_LOG_FUNCTION(this << pow);
307 m_txPower = pow;
308}
309
310double
312{
313 NS_LOG_FUNCTION(this);
314 return m_txPower;
315}
316
317int8_t
319{
320 NS_LOG_FUNCTION(this);
321 return m_txPower;
322}
323
324void
326{
327 NS_LOG_FUNCTION(this << nf);
328 m_noiseFigure = nf;
329}
330
331double
333{
334 NS_LOG_FUNCTION(this);
335 return m_noiseFigure;
336}
337
338void
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
359uint8_t
361{
362 return (m_macChTtiDelay);
363}
364
367{
369}
370
373{
374 return m_uplinkSpectrumPhy;
375}
376
377bool
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
395bool
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
413void
415{
416 NS_LOG_FUNCTION(this);
417 SetMacPdu(p);
418}
419
420uint8_t
422{
423 return (m_macChTtiDelay);
424}
425
426void
428{
429 NS_LOG_FUNCTION(this);
431}
432
433void
435{
436 NS_LOG_FUNCTION(this);
439 m_downlinkSpectrumPhy->SetTxPowerSpectralDensity(txPsd);
440}
441
442void
444{
445 NS_LOG_FUNCTION(this);
448 m_downlinkSpectrumPhy->SetTxPowerSpectralDensity(txPsd);
449}
450
451std::vector<int>
453{
454 NS_LOG_FUNCTION(this);
456}
457
458void
460{
461 NS_LOG_FUNCTION(this);
462 double rbgTxPower = m_txPower;
463
464 std::map<uint16_t, double>::iterator it = m_paMap.find(rnti);
465 if (it != m_paMap.end())
466 {
467 rbgTxPower = m_txPower + it->second;
468 }
469
470 m_dlPowerAllocationMap.insert(std::pair<int, double>(rbId, rbgTxPower));
471}
472
475{
476 NS_LOG_FUNCTION(this);
477
481 m_txPower,
483
484 return psd;
485}
486
489{
490 NS_LOG_FUNCTION(this);
491
495 m_txPower,
498
499 return psd;
500}
501
502void
504{
505 NS_LOG_FUNCTION(this);
506}
507
508void
510{
511 NS_LOG_FUNCTION(this << msg);
512 // queues the message (wait for MAC-PHY delay)
514}
515
516void
518{
519 NS_FATAL_ERROR("Obsolete function");
520 NS_LOG_FUNCTION(this << msg);
522}
523
524void
526{
527 NS_LOG_FUNCTION(this);
528 std::list<Ptr<LteControlMessage>>::iterator it;
529 for (it = msgList.begin(); it != msgList.end(); it++)
530 {
531 switch ((*it)->GetMessageType())
532 {
535 DynamicCast<RachPreambleLteControlMessage>(*it);
536 m_enbPhySapUser->ReceiveRachPreamble(rachPreamble->GetRapId());
537 }
538 break;
540 Ptr<DlCqiLteControlMessage> dlcqiMsg = DynamicCast<DlCqiLteControlMessage>(*it);
541 CqiListElement_s dlcqi = dlcqiMsg->GetDlCqi();
542 // check whether the UE is connected
543 if (m_ueAttached.find(dlcqi.m_rnti) != m_ueAttached.end())
544 {
546 }
547 }
548 break;
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;
561 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
577void
579{
580 NS_LOG_FUNCTION(this);
581
582 ++m_nrFrames;
583 NS_LOG_INFO("-----frame " << m_nrFrames << "-----");
584 m_nrSubFrames = 0;
585
586 // send MIB at beginning of every frame
588 Ptr<MibLteControlMessage> mibMsg = Create<MibLteControlMessage>();
589 mibMsg->SetMib(m_mib);
590 m_controlMessagesQueue.at(0).emplace_back(mibMsg);
591
593}
594
595void
597{
598 NS_LOG_FUNCTION(this);
599
601
602 /*
603 * Send SIB1 at 6th subframe of every odd-numbered radio frame. This is
604 * equivalent with Section 5.2.1.2 of 3GPP TS 36.331, where it is specified
605 * "repetitions are scheduled in subframe #5 of all other radio frames for
606 * which SFN mod 2 = 0," except that 3GPP counts frames and subframes starting
607 * from 0, while ns-3 counts starting from 1.
608 */
609 if ((m_nrSubFrames == 6) && ((m_nrFrames % 2) == 1))
610 {
611 Ptr<Sib1LteControlMessage> msg = Create<Sib1LteControlMessage>();
612 msg->SetSib1(m_sib1);
613 m_controlMessagesQueue.at(0).emplace_back(msg);
614 }
615
616 if (m_srsPeriodicity > 0)
617 {
618 // might be 0 in case the eNB has no UEs attached
619 NS_ASSERT_MSG(m_nrFrames > 1, "the SRS index check code assumes that frameNo starts at 1");
621 "the SRS index check code assumes that subframeNo starts at 1");
623 }
624 NS_LOG_INFO("-----sub frame " << m_nrSubFrames << "-----");
625 m_harqPhyModule->SubframeIndication(m_nrFrames, m_nrSubFrames);
626
627 // update info on TB to be received
628 std::list<UlDciLteControlMessage> uldcilist = DequeueUlDci();
629 std::list<UlDciLteControlMessage>::iterator dciIt = uldcilist.begin();
630 NS_LOG_DEBUG(this << " eNB Expected TBs " << uldcilist.size());
631 for (dciIt = uldcilist.begin(); dciIt != uldcilist.end(); dciIt++)
632 {
633 std::set<uint16_t>::iterator it2;
634 it2 = m_ueAttached.find((*dciIt).GetDci().m_rnti);
635
636 if (it2 == m_ueAttached.end())
637 {
638 NS_LOG_ERROR("UE not attached");
639 }
640 else
641 {
642 // send info of TB to LteSpectrumPhy
643 // translate to allocation map
644 std::vector<int> rbMap;
645 for (int i = (*dciIt).GetDci().m_rbStart;
646 i < (*dciIt).GetDci().m_rbStart + (*dciIt).GetDci().m_rbLen;
647 i++)
648 {
649 rbMap.push_back(i);
650 }
651 m_uplinkSpectrumPhy->AddExpectedTb((*dciIt).GetDci().m_rnti,
652 (*dciIt).GetDci().m_ndi,
653 (*dciIt).GetDci().m_tbSize,
654 (*dciIt).GetDci().m_mcs,
655 rbMap,
656 0 /* always SISO*/,
657 0 /* no HARQ proc id in UL*/,
658 0 /*evaluated by LteSpectrumPhy*/,
659 false /* UL*/);
660 if ((*dciIt).GetDci().m_ndi == 1)
661 {
662 NS_LOG_DEBUG(this << " RNTI " << (*dciIt).GetDci().m_rnti << " NEW TB");
663 }
664 else
665 {
666 NS_LOG_DEBUG(this << " RNTI " << (*dciIt).GetDci().m_rnti << " HARQ RETX");
667 }
668 }
669 }
670
671 // process the current burst of control messages
672 std::list<Ptr<LteControlMessage>> ctrlMsg = GetControlMessages();
673 m_dlDataRbMap.clear();
675 if (!ctrlMsg.empty())
676 {
677 std::list<Ptr<LteControlMessage>>::iterator it;
678 it = ctrlMsg.begin();
679 while (it != ctrlMsg.end())
680 {
681 Ptr<LteControlMessage> msg = (*it);
682 if (msg->GetMessageType() == LteControlMessage::DL_DCI)
683 {
684 Ptr<DlDciLteControlMessage> dci = DynamicCast<DlDciLteControlMessage>(msg);
685 // get the tx power spectral density according to DL-DCI(s)
686 // translate the DCI to Spectrum framework
687 uint32_t mask = 0x1;
688 for (int i = 0; i < 32; i++)
689 {
690 if (((dci->GetDci().m_rbBitmap & mask) >> i) == 1)
691 {
692 for (int k = 0; k < GetRbgSize(); k++)
693 {
694 m_dlDataRbMap.push_back((i * GetRbgSize()) + k);
695 // NS_LOG_DEBUG(this << " [enb]DL-DCI allocated PRB " <<
696 // (i*GetRbgSize()) + k);
697 GeneratePowerAllocationMap(dci->GetDci().m_rnti,
698 (i * GetRbgSize()) + k);
699 }
700 }
701 mask = (mask << 1);
702 }
703 // fire trace of DL Tx PHY stats
704 for (std::size_t i = 0; i < dci->GetDci().m_mcs.size(); i++)
705 {
707 params.m_cellId = m_cellId;
708 params.m_imsi = 0; // it will be set by DlPhyTransmissionCallback in LteHelper
709 params.m_timestamp = Simulator::Now().GetMilliSeconds();
710 params.m_rnti = dci->GetDci().m_rnti;
711 params.m_txMode = 0; // TBD
712 params.m_layer = i;
713 params.m_mcs = dci->GetDci().m_mcs.at(i);
714 params.m_size = dci->GetDci().m_tbsSize.at(i);
715 params.m_rv = dci->GetDci().m_rv.at(i);
716 params.m_ndi = dci->GetDci().m_ndi.at(i);
717 params.m_ccId = m_componentCarrierId;
718 m_dlPhyTransmission(params);
719 }
720 }
721 else if (msg->GetMessageType() == LteControlMessage::UL_DCI)
722 {
723 Ptr<UlDciLteControlMessage> dci = DynamicCast<UlDciLteControlMessage>(msg);
724 QueueUlDci(*dci);
725 }
726 else if (msg->GetMessageType() == LteControlMessage::RAR)
727 {
728 Ptr<RarLteControlMessage> rarMsg = DynamicCast<RarLteControlMessage>(msg);
729 for (std::list<RarLteControlMessage::Rar>::const_iterator it =
730 rarMsg->RarListBegin();
731 it != rarMsg->RarListEnd();
732 ++it)
733 {
734 if (it->rarPayload.m_grant.m_ulDelay)
735 {
736 NS_FATAL_ERROR(" RAR delay is not yet implemented");
737 }
738 UlGrant_s ulGrant = it->rarPayload.m_grant;
739 // translate the UL grant in a standard UL-DCI and queue it
741 dci.m_rnti = ulGrant.m_rnti;
742 dci.m_rbStart = ulGrant.m_rbStart;
743 dci.m_rbLen = ulGrant.m_rbLen;
744 dci.m_tbSize = ulGrant.m_tbSize;
745 dci.m_mcs = ulGrant.m_mcs;
746 dci.m_hopping = ulGrant.m_hopping;
747 dci.m_tpc = ulGrant.m_tpc;
748 dci.m_cqiRequest = ulGrant.m_cqiRequest;
749 dci.m_ndi = 1;
751 msg.SetDci(dci);
752 QueueUlDci(msg);
753 }
754 }
755 it++;
756 }
757 }
758
759 SendControlChannels(ctrlMsg);
760
761 // send data frame
763 if (pb)
764 {
765 Simulator::Schedule(DL_CTRL_DELAY_FROM_SUBFRAME_START, // ctrl frame fixed to 3 symbols
767 this,
768 pb);
769 }
770
771 // trigger the MAC
773
775}
776
777void
779{
780 NS_LOG_FUNCTION(this << " eNB " << m_cellId << " start tx ctrl frame");
781 // set the current tx power spectral density (full bandwidth)
782 std::vector<int> dlRb;
783 for (uint16_t i = 0; i < m_dlBandwidth; i++)
784 {
785 dlRb.push_back(i);
786 }
788 NS_LOG_LOGIC(this << " eNB start TX CTRL");
789 bool pss = false;
790 if ((m_nrSubFrames == 1) || (m_nrSubFrames == 6))
791 {
792 pss = true;
793 }
794 m_downlinkSpectrumPhy->StartTxDlCtrlFrame(ctrlMsgList, pss);
795}
796
797void
799{
800 // set the current tx power spectral density
802 // send the current burts of packets
803 NS_LOG_LOGIC(this << " eNB start TX DATA");
804 std::list<Ptr<LteControlMessage>> ctrlMsgList;
805 ctrlMsgList.clear();
806 m_downlinkSpectrumPhy->StartTxDataFrame(pb, ctrlMsgList, DL_DATA_DURATION);
807}
808
809void
811{
813 if (m_nrSubFrames == 10)
814 {
816 }
817 else
818 {
820 }
821}
822
823void
825{
828}
829
830void
832{
833 NS_LOG_FUNCTION(this << sinr << Simulator::Now() << m_srsStartTime);
834 // avoid processing SRSs sent with an old SRS configuration index
836 {
839 }
840}
841
842void
844{
845 NS_LOG_FUNCTION(this << sinr);
848}
849
850void
852{
853 NS_LOG_FUNCTION(this << interf);
854 Ptr<SpectrumValue> interfCopy = Create<SpectrumValue>(interf);
857 {
860 }
861}
862
863void
865{
866 // not used by eNB
867}
868
871{
872 NS_LOG_FUNCTION(this << sinr);
873 Values::const_iterator it;
875 ulcqi.m_ulCqi.m_type = UlCqi_s::PUSCH;
876 for (it = sinr.ConstValuesBegin(); it != sinr.ConstValuesEnd(); it++)
877 {
878 double sinrdb = 10 * std::log10((*it));
879 // NS_LOG_DEBUG ("ULCQI RB " << i << " value " << sinrdb);
880 // convert from double to fixed point notation Sxxxxxxxxxxx.xxx
881 int16_t sinrFp = LteFfConverter::double2fpS11dot3(sinrdb);
882 ulcqi.m_ulCqi.m_sinr.push_back(sinrFp);
883 }
884 return ulcqi;
885}
886
887void
888LteEnbPhy::DoSetBandwidth(uint16_t ulBandwidth, uint16_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
910void
912{
913 NS_LOG_FUNCTION(this << ulEarfcn << dlEarfcn);
914 m_ulEarfcn = ulEarfcn;
915 m_dlEarfcn = dlEarfcn;
916}
917
918void
919LteEnbPhy::DoAddUe(uint16_t rnti)
920{
921 NS_LOG_FUNCTION(this << rnti);
922
923 bool success = AddUePhy(rnti);
924 NS_ASSERT_MSG(success, "AddUePhy() failed");
925
926 // add default P_A value
927 DoSetPa(rnti, 0);
928}
929
930void
932{
933 NS_LOG_FUNCTION(this << rnti);
934
935 bool success = DeleteUePhy(rnti);
936 NS_ASSERT_MSG(success, "DeleteUePhy() failed");
937
938 // remove also P_A value
939 std::map<uint16_t, double>::iterator it = m_paMap.find(rnti);
940 if (it != m_paMap.end())
941 {
942 m_paMap.erase(it);
943 }
944
945 // additional data to be removed
946 m_uplinkSpectrumPhy->RemoveExpectedTb(rnti);
947 // remove srs info to avoid trace errors
948 std::map<uint16_t, uint16_t>::iterator sit = m_srsSampleCounterMap.find(rnti);
949 if (sit != m_srsSampleCounterMap.end())
950 {
951 m_srsSampleCounterMap.erase(rnti);
952 }
953 // remove DL_DCI message otherwise errors occur for m_dlPhyTransmission trace
954 // remove also any UL_DCI message for the UE to be removed
955
956 for (auto& ctrlMessageList : m_controlMessagesQueue)
957 {
958 std::list<Ptr<LteControlMessage>>::iterator ctrlMsgListIt = ctrlMessageList.begin();
959 while (ctrlMsgListIt != ctrlMessageList.end())
960 {
961 Ptr<LteControlMessage> msg = (*ctrlMsgListIt);
962 if (msg->GetMessageType() == LteControlMessage::DL_DCI)
963 {
964 auto dci = DynamicCast<DlDciLteControlMessage>(msg);
965 if (dci->GetDci().m_rnti == rnti)
966 {
967 NS_LOG_INFO("DL_DCI to be sent from cell id : " << m_cellId << " to RNTI : "
968 << rnti << " is deleted");
969 ctrlMsgListIt = ctrlMessageList.erase(ctrlMsgListIt);
970 }
971 else
972 {
973 ++ctrlMsgListIt;
974 }
975 }
976 else if (msg->GetMessageType() == LteControlMessage::UL_DCI)
977 {
978 auto dci = DynamicCast<UlDciLteControlMessage>(msg);
979 if (dci->GetDci().m_rnti == rnti)
980 {
981 NS_LOG_INFO("UL_DCI to be sent from cell id : " << m_cellId << " to RNTI : "
982 << rnti << " is deleted");
983 ctrlMsgListIt = ctrlMessageList.erase(ctrlMsgListIt);
984 }
985 else
986 {
987 ++ctrlMsgListIt;
988 }
989 }
990 else
991 {
992 ++ctrlMsgListIt;
993 }
994 }
995 }
996}
997
998void
999LteEnbPhy::DoSetPa(uint16_t rnti, double pa)
1000{
1001 NS_LOG_FUNCTION(this << rnti);
1002
1003 std::map<uint16_t, double>::iterator it = m_paMap.find(rnti);
1004
1005 if (it == m_paMap.end())
1006 {
1007 m_paMap.insert(std::pair<uint16_t, double>(rnti, pa));
1008 }
1009 else
1010 {
1011 it->second = pa;
1012 }
1013}
1014
1017{
1018 NS_LOG_FUNCTION(this << sinr);
1019 Values::const_iterator it;
1021 ulcqi.m_ulCqi.m_type = UlCqi_s::SRS;
1022 int i = 0;
1023 double srsSum = 0.0;
1024 for (it = sinr.ConstValuesBegin(); it != sinr.ConstValuesEnd(); it++)
1025 {
1026 double sinrdb = 10 * log10((*it));
1027 // NS_LOG_DEBUG ("ULCQI RB " << i << " value " << sinrdb);
1028 // convert from double to fixed point notation Sxxxxxxxxxxx.xxx
1029 int16_t sinrFp = LteFfConverter::double2fpS11dot3(sinrdb);
1030 srsSum += (*it);
1031 ulcqi.m_ulCqi.m_sinr.push_back(sinrFp);
1032 i++;
1033 }
1034 // Insert the user generated the srs as a vendor specific parameter
1035 NS_LOG_DEBUG(this << " ENB RX UL-CQI of " << m_srsUeOffset.at(m_currentSrsOffset));
1038 vsp.m_length = sizeof(SrsCqiRntiVsp);
1039 Ptr<SrsCqiRntiVsp> rnti = Create<SrsCqiRntiVsp>(m_srsUeOffset.at(m_currentSrsOffset));
1040 vsp.m_value = rnti;
1041 ulcqi.m_vendorSpecificList.push_back(vsp);
1042 // call SRS tracing method
1043 CreateSrsReport(m_srsUeOffset.at(m_currentSrsOffset), (i > 0) ? (srsSum / i) : DBL_MAX);
1044 return (ulcqi);
1045}
1046
1047void
1048LteEnbPhy::CreateSrsReport(uint16_t rnti, double srs)
1049{
1050 NS_LOG_FUNCTION(this << rnti << srs);
1051 std::map<uint16_t, uint16_t>::iterator it = m_srsSampleCounterMap.find(rnti);
1052 if (it == m_srsSampleCounterMap.end())
1053 {
1054 // create new entry
1055 m_srsSampleCounterMap.insert(std::pair<uint16_t, uint16_t>(rnti, 0));
1056 it = m_srsSampleCounterMap.find(rnti);
1057 }
1058 (*it).second++;
1059 if ((*it).second == m_srsSamplePeriod)
1060 {
1061 m_reportUeSinr(m_cellId, rnti, srs, (uint16_t)m_componentCarrierId);
1062 (*it).second = 0;
1063 }
1064}
1065
1066void
1067LteEnbPhy::DoSetTransmissionMode(uint16_t rnti, uint8_t txMode)
1068{
1069 NS_LOG_FUNCTION(this << rnti << (uint16_t)txMode);
1070 // UL supports only SISO MODE
1071}
1072
1073void
1075{
1076 NS_LOG_FUNCTION(this);
1077 m_ulDciQueue.at(UL_PUSCH_TTIS_DELAY - 1).push_back(m);
1078}
1079
1080std::list<UlDciLteControlMessage>
1082{
1083 NS_LOG_FUNCTION(this);
1084 if (!m_ulDciQueue.at(0).empty())
1085 {
1086 std::list<UlDciLteControlMessage> ret = m_ulDciQueue.at(0);
1087 m_ulDciQueue.erase(m_ulDciQueue.begin());
1088 std::list<UlDciLteControlMessage> l;
1089 m_ulDciQueue.push_back(l);
1090 return (ret);
1091 }
1092 else
1093 {
1094 m_ulDciQueue.erase(m_ulDciQueue.begin());
1095 std::list<UlDciLteControlMessage> l;
1096 m_ulDciQueue.push_back(l);
1097 std::list<UlDciLteControlMessage> emptylist;
1098 return (emptylist);
1099 }
1100}
1101
1102void
1103LteEnbPhy::DoSetSrsConfigurationIndex(uint16_t rnti, uint16_t srcCi)
1104{
1105 NS_LOG_FUNCTION(this);
1106 uint16_t p = GetSrsPeriodicity(srcCi);
1107 if (p != m_srsPeriodicity)
1108 {
1109 // resize the array of offset -> re-initialize variables
1110 m_srsUeOffset.clear();
1111 m_srsUeOffset.resize(p, 0);
1112 m_srsPeriodicity = p;
1113 // inhibit SRS until RRC Connection Reconfiguration propagates
1114 // to UEs, otherwise we might be wrong in determining the UE who
1115 // actually sent the SRS (if the UE was using a stale SRS config)
1116 // if we use a static SRS configuration index, we can have a 0ms guard time
1118 }
1119
1120 NS_LOG_DEBUG(this << " ENB SRS P " << m_srsPeriodicity << " RNTI " << rnti << " offset "
1121 << GetSrsSubframeOffset(srcCi) << " CI " << srcCi);
1122 std::map<uint16_t, uint16_t>::iterator it = m_srsCounter.find(rnti);
1123 if (it != m_srsCounter.end())
1124 {
1125 (*it).second = GetSrsSubframeOffset(srcCi) + 1;
1126 }
1127 else
1128 {
1129 m_srsCounter.insert(std::pair<uint16_t, uint16_t>(rnti, GetSrsSubframeOffset(srcCi) + 1));
1130 }
1131 m_srsUeOffset.at(GetSrsSubframeOffset(srcCi)) = rnti;
1132}
1133
1134void
1136{
1137 NS_LOG_FUNCTION(this);
1138 m_mib = mib;
1139}
1140
1141void
1143{
1144 NS_LOG_FUNCTION(this);
1145 m_sib1 = sib1;
1146}
1147
1148void
1150{
1151 m_harqPhyModule = harq;
1152}
1153
1154void
1156{
1157 NS_LOG_FUNCTION(this);
1158 // forward to scheduler
1160}
1161
1162} // namespace ns3
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition: double.h:42
void SendMacPdu(Ptr< Packet > p) override
Send the MAC PDU to the channel.
Definition: lte-enb-phy.cc:108
EnbMemberLteEnbPhySapProvider(LteEnbPhy *phy)
Constructor.
Definition: lte-enb-phy.cc:102
virtual void SetBandwidth(uint16_t ulBandwidth, uint16_t dlBandwidth)
Set bandwidth function.
Definition: lte-enb-phy.cc:114
uint8_t GetMacChTtiDelay() override
Get the delay from MAC to Channel expressed in TTIs.
Definition: lte-enb-phy.cc:132
LteEnbPhy * m_phy
the ENB Phy
Definition: lte-enb-phy.cc:99
virtual void SetCellId(uint16_t cellId)
Set Cell ID function.
Definition: lte-enb-phy.cc:120
void SendLteControlMessage(Ptr< LteControlMessage > msg) override
Send SendLteControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel.
Definition: lte-enb-phy.cc:126
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
LteEnbPhy models the physical layer for the eNodeB.
Definition: lte-enb-phy.h:45
uint16_t m_srsPeriodicity
SRS periodicity.
Definition: lte-enb-phy.h:461
double GetTxPower() const
Definition: lte-enb-phy.cc:311
Time m_srsStartTime
SRS start time.
Definition: lte-enb-phy.h:462
int8_t DoGetReferenceSignalPower() const
Definition: lte-enb-phy.cc:318
void StartSubFrame()
Start a LTE sub frame.
Definition: lte-enb-phy.cc:596
void CreateSrsReport(uint16_t rnti, double srs)
Create SRS report function.
uint16_t m_interferenceSamplePeriod
The InterferenceSamplePeriod attribute.
Definition: lte-enb-phy.h:506
virtual void ReportUlHarqFeedback(UlInfoListElement_s mes)
Report the uplink HARQ feedback generated by LteSpectrumPhy to MAC.
std::list< UlDciLteControlMessage > DequeueUlDci()
uint16_t m_srsSamplePeriod
The UeSinrSamplePeriod trace source.
Definition: lte-enb-phy.h:490
void SetLteEnbCphySapUser(LteEnbCphySapUser *s)
Set the CPHY SAP User.
Definition: lte-enb-phy.cc:290
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:870
uint32_t m_nrSubFrames
The subframe number currently served.
Definition: lte-enb-phy.h:459
std::set< uint16_t > m_ueAttached
List of RNTI of attached UEs.
Definition: lte-enb-phy.h:422
LteEnbPhySapProvider * GetLteEnbPhySapProvider()
Get the PHY SAP provider.
Definition: lte-enb-phy.cc:284
void SetLteEnbPhySapUser(LteEnbPhySapUser *s)
Set the PHY SAP User.
Definition: lte-enb-phy.cc:278
void DoSetMasterInformationBlock(LteRrcSap::MasterInformationBlock mib)
Set master information block.
bool DeleteUePhy(uint16_t rnti)
Remove the given RNTI from the list of attached UE m_ueAttached.
Definition: lte-enb-phy.cc:396
std::vector< std::list< UlDciLteControlMessage > > m_ulDciQueue
For storing info on future receptions.
Definition: lte-enb-phy.h:441
double GetNoiseFigure() const
Definition: lte-enb-phy.cc:332
void SetTxPower(double pow)
Definition: lte-enb-phy.cc:304
std::vector< int > m_dlDataRbMap
DL data RB map.
Definition: lte-enb-phy.h:438
TracedCallback< uint16_t, uint16_t, double, uint8_t > m_reportUeSinr
The ReportUeSinr trace source.
Definition: lte-enb-phy.h:485
~LteEnbPhy() override
Definition: lte-enb-phy.cc:239
Ptr< LteSpectrumPhy > GetDlSpectrumPhy() const
Definition: lte-enb-phy.cc:366
void DoDispose() override
Destructor implementation.
Definition: lte-enb-phy.cc:244
void GenerateCtrlCqiReport(const SpectrumValue &sinr) override
generate a CQI report based on the given SINR of Ctrl frame
Definition: lte-enb-phy.cc:831
void GenerateDataCqiReport(const SpectrumValue &sinr) override
generate a CQI report based on the given SINR of Data frame (used for PUSCH CQIs)
Definition: lte-enb-phy.cc:843
void SendDataChannels(Ptr< PacketBurst > pb)
Send the PDSCH.
Definition: lte-enb-phy.cc:798
std::map< uint16_t, uint16_t > m_srsSampleCounterMap
SRS sample counter map.
Definition: lte-enb-phy.h:491
void DoSetSrsConfigurationIndex(uint16_t rnti, uint16_t srcCi)
Set source configuration index.
void PhyPduReceived(Ptr< Packet > p)
PhySpectrum received a new PHY-PDU.
Definition: lte-enb-phy.cc:427
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters CreateSrsCqiReport(const SpectrumValue &sinr)
Create the UL CQI feedback from SINR values perceived at the physical layer with the SRS signal recei...
LteEnbPhySapUser * m_enbPhySapUser
ENB Phy SAP user.
Definition: lte-enb-phy.h:444
void EndFrame()
End a LTE frame.
Definition: lte-enb-phy.cc:824
void CalcChannelQualityForUe(std::vector< double > sinr, Ptr< LteSpectrumPhy > ue)
Calculate the channel quality for a given UE.
Definition: lte-enb-phy.cc:503
void DoSetPa(uint16_t rnti, double pa)
Set PA.
Definition: lte-enb-phy.cc:999
uint8_t GetMacChDelay() const
Definition: lte-enb-phy.cc:360
uint16_t m_currentSrsOffset
current SRS offset
Definition: lte-enb-phy.h:465
void DoSetEarfcn(uint32_t dlEarfcn, uint32_t ulEarfcn)
Set EARFCN.
Definition: lte-enb-phy.cc:911
Ptr< SpectrumValue > CreateTxPowerSpectralDensity() override
Create the PSD for TX.
Definition: lte-enb-phy.cc:474
void DoSetTransmissionMode(uint16_t rnti, uint8_t txMode)
Set transmission mode.
LteEnbPhySapProvider * m_enbPhySapProvider
ENB Phy SAP provider.
Definition: lte-enb-phy.h:443
uint8_t DoGetMacChTtiDelay()
Get MAC ch TTI delay function.
Definition: lte-enb-phy.cc:421
std::map< int, double > m_dlPowerAllocationMap
DL power allocation map.
Definition: lte-enb-phy.h:428
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:436
void GeneratePowerAllocationMap(uint16_t rnti, int rbId)
Generate power allocation map (i.e.
Definition: lte-enb-phy.cc:459
void QueueUlDci(UlDciLteControlMessage m)
void SetNoiseFigure(double pow)
Definition: lte-enb-phy.cc:325
std::map< uint16_t, uint16_t > m_srsCounter
SRS counter.
Definition: lte-enb-phy.h:463
void SetMacChDelay(uint8_t delay)
Definition: lte-enb-phy.cc:339
void SetHarqPhyModule(Ptr< LteHarqPhy > harq)
Set the HARQ Phy module.
virtual void ReceiveLteControlMessageList(std::list< Ptr< LteControlMessage > > msgList)
PhySpectrum received a new list of LteControlMessage.
Definition: lte-enb-phy.cc:525
void SendControlChannels(std::list< Ptr< LteControlMessage > > ctrlMsgList)
Send the PDCCH and PCFICH in the first 3 symbols.
Definition: lte-enb-phy.cc:778
void DoRemoveUe(uint16_t rnti)
Remove UE.
Definition: lte-enb-phy.cc:931
void SetDownlinkSubChannelsWithPowerAllocation(std::vector< int > mask)
set the resource blocks (a.k.a.
Definition: lte-enb-phy.cc:443
void ReportRsReceivedPower(const SpectrumValue &power) override
generate a report based on the linear RS power perceived during CTRL frame NOTE: used only by UE for ...
Definition: lte-enb-phy.cc:864
LteRrcSap::MasterInformationBlock m_mib
The Master Information Block message to be broadcasted every frame.
Definition: lte-enb-phy.h:471
void DoSendMacPdu(Ptr< Packet > p) override
Queue the MAC PDU to be sent (according to m_macChTtiDelay)
Definition: lte-enb-phy.cc:414
void ReportInterference(const SpectrumValue &interf) override
generate a report based on the linear interference and noise power perceived during DATA frame NOTE: ...
Definition: lte-enb-phy.cc:851
TracedCallback< uint16_t, Ptr< SpectrumValue > > m_reportInterferenceTrace
The ReportInterference trace source.
Definition: lte-enb-phy.h:500
Ptr< LteSpectrumPhy > GetUlSpectrumPhy() const
Definition: lte-enb-phy.cc:372
void DoAddUe(uint16_t rnti)
Add UE.
Definition: lte-enb-phy.cc:919
friend class EnbMemberLteEnbPhySapProvider
allow EnbMemberLteEnbPhySapProvider class friend access
Definition: lte-enb-phy.h:47
void DoSetSystemInformationBlockType1(LteRrcSap::SystemInformationBlockType1 sib1)
Set system information block.
void DoSendLteControlMessage(Ptr< LteControlMessage > msg)
Send LTE Control Message function.
Definition: lte-enb-phy.cc:509
virtual Ptr< SpectrumValue > CreateTxPowerSpectralDensityWithPowerAllocation()
Create the PSD for TX with power allocation for each RB.
Definition: lte-enb-phy.cc:488
bool AddUePhy(uint16_t rnti)
Add the given RNTI to the list of attached UE m_ueAttached.
Definition: lte-enb-phy.cc:378
void DoInitialize() override
Initialize() implementation.
Definition: lte-enb-phy.cc:255
LteRrcSap::SystemInformationBlockType1 m_sib1
The System Information Block Type 1 message to be broadcasted.
Definition: lte-enb-phy.h:477
std::map< uint16_t, double > m_paMap
P_A per UE RNTI.
Definition: lte-enb-phy.h:425
void DoSetBandwidth(uint16_t ulBandwidth, uint16_t dlBandwidth)
Set bandwidth function.
Definition: lte-enb-phy.cc:888
void EndSubFrame()
End a LTE sub frame.
Definition: lte-enb-phy.cc:810
LteEnbCphySapUser * m_enbCphySapUser
ENB CPhy SAP user.
Definition: lte-enb-phy.h:447
uint16_t m_interferenceSampleCounter
interference sample counter
Definition: lte-enb-phy.h:507
void SetDownlinkSubChannels(std::vector< int > mask)
set the resource blocks (a.k.a.
Definition: lte-enb-phy.cc:434
virtual void ReceiveLteControlMessage(Ptr< LteControlMessage > msg)
Receive the control message.
Definition: lte-enb-phy.cc:517
void StartFrame()
Start a LTE frame.
Definition: lte-enb-phy.cc:578
uint32_t m_nrFrames
The frame number currently served.
Definition: lte-enb-phy.h:453
LteEnbCphySapProvider * m_enbCphySapProvider
ENB CPhy SAP provider.
Definition: lte-enb-phy.h:446
std::vector< uint16_t > m_srsUeOffset
SRS UE offset.
Definition: lte-enb-phy.h:464
LteEnbCphySapProvider * GetLteEnbCphySapProvider()
Get the CPHY SAP provider.
Definition: lte-enb-phy.cc:297
TracedCallback< PhyTransmissionStatParameters > m_dlPhyTransmission
The DlPhyTransmission trace source.
Definition: lte-enb-phy.h:514
std::vector< int > GetDownlinkSubChannels()
Definition: lte-enb-phy.cc:452
Ptr< LteHarqPhy > m_harqPhyModule
HARQ Phy module.
Definition: lte-enb-phy.h:479
friend class MemberLteEnbCphySapProvider< LteEnbPhy >
allow MemberLteEnbCphySapProvider<LteEnbPhy> class friend access
Definition: lte-enb-phy.h:49
static TypeId GetTypeId()
Get the type ID.
Definition: lte-enb-phy.cc:166
Service Access Point (SAP) offered by the eNB-PHY to the eNB-MAC.
Service Access Point (SAP) offered by the eNB-PHY to the eNB-MAC.
virtual void ReceivePhyPdu(Ptr< Packet > p)=0
Called by the Phy to notify the MAC of the reception of a new PHY-PDU.
virtual void UlCqiReport(FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi)=0
Returns to MAC level the UL-CQI evaluated.
virtual void UlInfoListElementHarqFeedback(UlInfoListElement_s params)=0
Notify the HARQ on the UL transmission status.
virtual void ReceiveLteControlMessage(Ptr< LteControlMessage > msg)=0
Receive SendLteControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel.
virtual void ReceiveRachPreamble(uint32_t prachId)=0
notify the reception of a RACH preamble on the PRACH
virtual void SubframeIndication(uint32_t frameNo, uint32_t subframeNo)=0
Trigger the start from a new frame (input from Phy layer)
static uint16_t double2fpS11dot3(double val)
Convert from double to fixed point S11.3 notation.
Definition: lte-common.cc:134
The LtePhy models the physical layer of LTE.
Definition: lte-phy.h:51
void DoSetCellId(uint16_t cellId)
Definition: lte-phy.cc:240
double m_txPower
Transmission power in dBm.
Definition: lte-phy.h:241
uint8_t GetRbgSize() const
Definition: lte-phy.cc:180
void DoDispose() override
Destructor implementation.
Definition: lte-phy.cc:76
uint16_t GetSrsPeriodicity(uint16_t srcCi) const
Definition: lte-phy.cc:144
std::vector< Ptr< PacketBurst > > m_packetBurstQueue
A queue of packet bursts to be sent.
Definition: lte-phy.h:281
uint16_t m_ulBandwidth
The UL bandwidth in number of PRBs.
Definition: lte-phy.h:261
Ptr< PacketBurst > GetPacketBurst()
Definition: lte-phy.cc:192
uint8_t m_componentCarrierId
component carrier Id used to address sap
Definition: lte-phy.h:303
double m_noiseFigure
Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver.
Definition: lte-phy.h:253
uint32_t m_ulEarfcn
The uplink carrier frequency.
Definition: lte-phy.h:278
uint16_t m_dlBandwidth
The DL bandwidth in number of PRBs.
Definition: lte-phy.h:266
Ptr< LteSpectrumPhy > m_downlinkSpectrumPhy
The downlink LteSpectrumPhy associated to this LtePhy.
Definition: lte-phy.h:230
void SetMacPdu(Ptr< Packet > p)
Definition: lte-phy.cc:186
std::list< Ptr< LteControlMessage > > GetControlMessages()
Definition: lte-phy.cc:218
uint16_t GetSrsSubframeOffset(uint16_t srcCi) const
Definition: lte-phy.cc:162
Ptr< LteNetDevice > m_netDevice
Pointer to the NetDevice where this PHY layer is attached.
Definition: lte-phy.h:224
uint16_t m_cellId
Cell identifier.
Definition: lte-phy.h:300
void SetControlMessages(Ptr< LteControlMessage > m)
Definition: lte-phy.cc:210
uint32_t m_dlEarfcn
The downlink carrier frequency.
Definition: lte-phy.h:273
Ptr< LteSpectrumPhy > m_uplinkSpectrumPhy
The uplink LteSpectrumPhy associated to this LtePhy.
Definition: lte-phy.h:235
double GetTti() const
Definition: lte-phy.cc:137
std::vector< std::list< Ptr< LteControlMessage > > > m_controlMessagesQueue
A queue of control messages to be sent.
Definition: lte-phy.h:283
uint8_t m_rbgSize
The RB group size according to the bandwidth.
Definition: lte-phy.h:268
uint8_t m_macChTtiDelay
Delay between MAC and channel layer in terms of TTIs.
Definition: lte-phy.h:293
static Ptr< SpectrumValue > CreateNoisePowerSpectralDensity(uint32_t earfcn, uint16_t bandwidth, double noiseFigure)
create a SpectrumValue that models the power spectral density of AWGN
static Ptr< SpectrumValue > CreateTxPowerSpectralDensity(uint32_t earfcn, uint16_t bandwidth, double powerTx, std::vector< int > activeRbs)
create a spectrum value representing the power spectral density of a signal to be transmitted.
virtual void DoInitialize()
Initialize() implementation.
Definition: object.cc:360
Hold objects of type Ptr<T>.
Definition: pointer.h:37
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition: simulator.h:568
static void ScheduleWithContext(uint32_t context, const Time &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
Definition: simulator.h:587
static Time Now()
Return the current simulation virtual time.
Definition: simulator.cc:199
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
Definition: simulator.h:606
Set of values corresponding to a given SpectrumModel.
Values::const_iterator ConstValuesBegin() const
Values::const_iterator ConstValuesEnd() const
Define the RNTI that has generated the.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
int64_t GetMilliSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:407
@ S
second
Definition: nstime.h:116
a unique identifier for an interface.
Definition: type-id.h:59
@ ATTR_GET
The attribute can be read.
Definition: type-id.h:64
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:936
Hold an unsigned integer type.
Definition: uinteger.h:45
The Uplink Data Control Indicator messages defines the RB allocation for the users in the uplink.
void SetDci(UlDciListElement_s dci)
add a DCI into the message
#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:86
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Definition: double.h:43
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Definition: pointer.h:227
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Definition: uinteger.h:46
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:179
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition: abort.h:108
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition: log.h:254
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:268
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:282
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:275
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:46
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1372
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1336
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1348
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
#define UL_PUSCH_TTIS_DELAY
Definition: lte-common.h:28
#define SRS_CQI_RNTI_VSP
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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:63
static const Time DL_DATA_DURATION
Duration of the data portion of a DL subframe.
Definition: lte-enb-phy.cc:56
static const int Type0AllocationRbg[4]
Type 0 RGB allocation.
See section 4.3.24 cqiListElement.
uint16_t m_rnti
RNTI.
See section 4.3.23 dlInfoListElement.
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
std::vector< VendorSpecificListElement_s > m_vendorSpecificList
vendor specific list
MasterInformationBlock structure.
Definition: lte-rrc-sap.h:622
uint16_t systemFrameNumber
system frame number
Definition: lte-rrc-sap.h:624
SystemInformationBlockType1 structure.
Definition: lte-rrc-sap.h:629
See section 4.3.14 macCEListElement.
PhyTransmissionStatParameters structure.
Definition: lte-common.h:188
std::vector< uint16_t > m_sinr
SINR.
See section 4.3.2 ulDciListElement.
int8_t m_tpc
Tx power control command.
bool m_cqiRequest
CQI request.
Substitutive structure for specifying BuildRarListElement_s::m_grant field.
int8_t m_tpc
Tx power control command.
bool m_cqiRequest
CQI request?
bool m_hopping
hopping?
uint16_t m_tbSize
size
uint8_t m_rbLen
length
uint8_t m_mcs
MCS.
uint8_t m_rbStart
start
uint16_t m_rnti
RNTI.
See section 4.3.12 ulInfoListElement.
See section 4.3.3 vendorSpecificListElement.
Ptr< VendorSpecificValue > m_value
value