1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
3 * Copyright (c) 2022 Northeastern University
4 * Copyright (c) 2022 Sapienza, University of Rome
5 * Copyright (c) 2022 University of Padova
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation;
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 * Author: Andrea Lacava <thecave003@gmail.com>
21 * Tommaso Zugno <tommasozugno@gmail.com>
22 * Michele Polese <michele.polese@gmail.com>
25 #include <ns3/mmwave-indication-message-helper.h>
29 MmWaveIndicationMessageHelper::MmWaveIndicationMessageHelper (IndicationMessageType type,
30 bool isOffline, bool reducedPmValues)
31 : IndicationMessageHelper (type, isOffline, reducedPmValues)
36 MmWaveIndicationMessageHelper::AddCuUpUePmItem (std::string ueImsiComplete,
37 long txPdcpPduBytesNrRlc, long txPdcpPduNrRlc)
39 Ptr<MeasurementItemList> ueVal = Create<MeasurementItemList> (ueImsiComplete);
40 if (!m_reducedPmValues)
42 // UE-specific PDCP PDU volume transmitted to NR gNB (Unit is Kbits)
43 ueVal->AddItem<long> ("QosFlow.PdcpPduVolumeDL_Filter.UEID", txPdcpPduBytesNrRlc);
45 // UE-specific number of PDCP PDUs split with NR gNB
46 ueVal->AddItem<long> ("DRB.PdcpPduNbrDl.Qos.UEID", txPdcpPduNrRlc);
49 m_msgValues.m_ueIndications.insert (ueVal);
53 MmWaveIndicationMessageHelper::FillCuUpValues (std::string plmId)
55 FillBaseCuUpValues (plmId);
59 MmWaveIndicationMessageHelper::FillCuCpValues (uint16_t numActiveUes)
61 FillBaseCuCpValues (numActiveUes);
65 MmWaveIndicationMessageHelper::FillDuValues (std::string cellObjectId)
67 m_msgValues.m_cellObjectId = cellObjectId;
68 m_msgValues.m_pmContainerValues = m_duValues;
72 MmWaveIndicationMessageHelper::AddDuUePmItem (
73 std::string ueImsiComplete, long macPduUe, long macPduInitialUe, long macQpsk, long mac16Qam,
74 long mac64Qam, long macRetx, long macVolume, long macPrb, long macMac04, long macMac59,
75 long macMac1014, long macMac1519, long macMac2024, long macMac2529, long macSinrBin1,
76 long macSinrBin2, long macSinrBin3, long macSinrBin4, long macSinrBin5, long macSinrBin6,
77 long macSinrBin7, long rlcBufferOccup, double drbThrDlUeid)
80 Ptr<MeasurementItemList> ueVal = Create<MeasurementItemList> (ueImsiComplete);
81 if (!m_reducedPmValues)
83 ueVal->AddItem<long> ("TB.TotNbrDl.1.UEID", macPduUe);
84 ueVal->AddItem<long> ("TB.TotNbrDlInitial.UEID", macPduInitialUe);
85 ueVal->AddItem<long> ("TB.TotNbrDlInitial.Qpsk.UEID", macQpsk);
86 ueVal->AddItem<long> ("TB.TotNbrDlInitial.16Qam.UEID", mac16Qam);
87 ueVal->AddItem<long> ("TB.TotNbrDlInitial.64Qam.UEID", mac64Qam);
88 ueVal->AddItem<long> ("TB.ErrTotalNbrDl.1.UEID", macRetx);
89 ueVal->AddItem<long> ("QosFlow.PdcpPduVolumeDL_Filter.UEID", macVolume);
90 ueVal->AddItem<long> ("RRU.PrbUsedDl.UEID", (long) std::ceil (macPrb));
91 ueVal->AddItem<long> ("CARR.PDSCHMCSDist.Bin1.UEID", macMac04);
92 ueVal->AddItem<long> ("CARR.PDSCHMCSDist.Bin2.UEID", macMac59);
93 ueVal->AddItem<long> ("CARR.PDSCHMCSDist.Bin3.UEID", macMac1014);
94 ueVal->AddItem<long> ("CARR.PDSCHMCSDist.Bin4.UEID", macMac1519);
95 ueVal->AddItem<long> ("CARR.PDSCHMCSDist.Bin5.UEID", macMac2024);
96 ueVal->AddItem<long> ("CARR.PDSCHMCSDist.Bin6.UEID", macMac2529);
97 ueVal->AddItem<long> ("L1M.RS-SINR.Bin34.UEID", macSinrBin1);
98 ueVal->AddItem<long> ("L1M.RS-SINR.Bin46.UEID", macSinrBin2);
99 ueVal->AddItem<long> ("L1M.RS-SINR.Bin58.UEID", macSinrBin3);
100 ueVal->AddItem<long> ("L1M.RS-SINR.Bin70.UEID", macSinrBin4);
101 ueVal->AddItem<long> ("L1M.RS-SINR.Bin82.UEID", macSinrBin5);
102 ueVal->AddItem<long> ("L1M.RS-SINR.Bin94.UEID", macSinrBin6);
103 ueVal->AddItem<long> ("L1M.RS-SINR.Bin127.UEID", macSinrBin7);
104 ueVal->AddItem<long> ("DRB.BufferSize.Qos.UEID", rlcBufferOccup);
107 // This value is not requested anymore, so it has been removed from the delivery, but it will be still logged;
108 // ueVal->AddItem<double> ("DRB.UEThpDlPdcpBased.UEID", drbThrDlPdcpBasedUeid);
110 ueVal->AddItem<double> ("DRB.UEThpDl.UEID", drbThrDlUeid);
112 m_msgValues.m_ueIndications.insert (ueVal);
116 MmWaveIndicationMessageHelper::AddDuCellPmItem (
117 long macPduCellSpecific, long macPduInitialCellSpecific, long macQpskCellSpecific,
118 long mac16QamCellSpecific, long mac64QamCellSpecific, double prbUtilizationDl,
119 long macRetxCellSpecific, long macVolumeCellSpecific, long macMac04CellSpecific,
120 long macMac59CellSpecific, long macMac1014CellSpecific, long macMac1519CellSpecific,
121 long macMac2024CellSpecific, long macMac2529CellSpecific, long macSinrBin1CellSpecific,
122 long macSinrBin2CellSpecific, long macSinrBin3CellSpecific, long macSinrBin4CellSpecific,
123 long macSinrBin5CellSpecific, long macSinrBin6CellSpecific, long macSinrBin7CellSpecific,
124 long rlcBufferOccupCellSpecific, long activeUeDl)
126 Ptr<MeasurementItemList> cellVal = Create<MeasurementItemList> ();
128 if (!m_reducedPmValues)
130 cellVal->AddItem<long> ("TB.TotNbrDl.1", macPduCellSpecific);
131 cellVal->AddItem<long> ("TB.TotNbrDlInitial", macPduInitialCellSpecific);
134 cellVal->AddItem<long> ("TB.TotNbrDlInitial.Qpsk", macQpskCellSpecific);
135 cellVal->AddItem<long> ("TB.TotNbrDlInitial.16Qam", mac16QamCellSpecific);
136 cellVal->AddItem<long> ("TB.TotNbrDlInitial.64Qam", mac64QamCellSpecific);
137 cellVal->AddItem<long> ("RRU.PrbUsedDl", (long) std::ceil (prbUtilizationDl));
139 if (!m_reducedPmValues)
141 cellVal->AddItem<long> ("TB.ErrTotalNbrDl.1", macRetxCellSpecific);
142 cellVal->AddItem<long> ("QosFlow.PdcpPduVolumeDL_Filter", macVolumeCellSpecific);
143 cellVal->AddItem<long> ("CARR.PDSCHMCSDist.Bin1", macMac04CellSpecific);
144 cellVal->AddItem<long> ("CARR.PDSCHMCSDist.Bin2", macMac59CellSpecific);
145 cellVal->AddItem<long> ("CARR.PDSCHMCSDist.Bin3", macMac1014CellSpecific);
146 cellVal->AddItem<long> ("CARR.PDSCHMCSDist.Bin4", macMac1519CellSpecific);
147 cellVal->AddItem<long> ("CARR.PDSCHMCSDist.Bin5", macMac2024CellSpecific);
148 cellVal->AddItem<long> ("CARR.PDSCHMCSDist.Bin6", macMac2529CellSpecific);
149 cellVal->AddItem<long> ("L1M.RS-SINR.Bin34", macSinrBin1CellSpecific);
150 cellVal->AddItem<long> ("L1M.RS-SINR.Bin46", macSinrBin2CellSpecific);
151 cellVal->AddItem<long> ("L1M.RS-SINR.Bin58", macSinrBin3CellSpecific);
152 cellVal->AddItem<long> ("L1M.RS-SINR.Bin70", macSinrBin4CellSpecific);
153 cellVal->AddItem<long> ("L1M.RS-SINR.Bin82", macSinrBin5CellSpecific);
154 cellVal->AddItem<long> ("L1M.RS-SINR.Bin94", macSinrBin6CellSpecific);
155 cellVal->AddItem<long> ("L1M.RS-SINR.Bin127", macSinrBin7CellSpecific);
156 cellVal->AddItem<long> ("DRB.BufferSize.Qos", rlcBufferOccupCellSpecific);
159 cellVal->AddItem<long> ("DRB.MeanActiveUeDl",activeUeDl);
161 m_msgValues.m_cellMeasurementItems = cellVal;
165 MmWaveIndicationMessageHelper::AddDuCellResRepPmItem (Ptr<CellResourceReport> cellResRep)
167 m_duValues->m_cellResourceReportItems.insert (cellResRep);
171 MmWaveIndicationMessageHelper::AddCuCpUePmItem (std::string ueImsiComplete, long numDrb,
173 Ptr<L3RrcMeasurements> l3RrcMeasurementServing,
174 Ptr<L3RrcMeasurements> l3RrcMeasurementNeigh)
177 Ptr<MeasurementItemList> ueVal = Create<MeasurementItemList> (ueImsiComplete);
178 if (!m_reducedPmValues)
180 ueVal->AddItem<long> ("DRB.EstabSucc.5QI.UEID", numDrb);
181 ueVal->AddItem<long> ("DRB.RelActNbr.5QI.UEID", drbRelAct); // not modeled in the simulator
184 ueVal->AddItem<Ptr<L3RrcMeasurements>> ("HO.SrcCellQual.RS-SINR.UEID", l3RrcMeasurementServing);
185 ueVal->AddItem<Ptr<L3RrcMeasurements>> ("HO.TrgtCellQual.RS-SINR.UEID", l3RrcMeasurementNeigh);
187 m_msgValues.m_ueIndications.insert (ueVal);
190 MmWaveIndicationMessageHelper::~MmWaveIndicationMessageHelper ()