X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=helper%2Flte-indication-message-helper.cc;fp=helper%2Flte-indication-message-helper.cc;h=1f77021b2722661e68b09c639af59abaffff65f2;hb=8585bec317470bd91aa09d3274748af569ec5b75;hp=0000000000000000000000000000000000000000;hpb=240b99b7058fa8e961b36911746848a1b6b618b3;p=sim%2Fns3-o-ran-e2.git diff --git a/helper/lte-indication-message-helper.cc b/helper/lte-indication-message-helper.cc new file mode 100644 index 0000000..1f77021 --- /dev/null +++ b/helper/lte-indication-message-helper.cc @@ -0,0 +1,106 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2022 Northeastern University + * Copyright (c) 2022 Sapienza, University of Rome + * Copyright (c) 2022 University of Padova + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Andrea Lacava + * Tommaso Zugno + * Michele Polese + */ + + +#include + +namespace ns3 { + +LteIndicationMessageHelper::LteIndicationMessageHelper (IndicationMessageType type, bool isOffline, + bool reducedPmValues) + : IndicationMessageHelper (type, isOffline, reducedPmValues) +{ + NS_ABORT_MSG_IF (type == IndicationMessageType::Du, + "Wrong type for LTE Indication Message, expected CuUp or CuCp"); +} + +void +LteIndicationMessageHelper::AddCuUpUePmItem (std::string ueImsiComplete, long txBytes, + long txDlPackets, double pdcpThroughput, + double pdcpLatency) +{ + Ptr ueVal = Create (ueImsiComplete); + + if (!m_reducedPmValues) + { + // UE-specific PDCP SDU volume from LTE eNB. Unit is Mbits + ueVal->AddItem ("DRB.PdcpSduVolumeDl_Filter.UEID", txBytes); + + // UE-specific number of PDCP SDUs from LTE eNB + ueVal->AddItem ("Tot.PdcpSduNbrDl.UEID", txDlPackets); + + // UE-specific Downlink IP combined EN-DC throughput from LTE eNB. Unit is kbps + ueVal->AddItem ("DRB.PdcpSduBitRateDl.UEID", pdcpThroughput); + + //UE-specific Downlink IP combined EN-DC throughput from LTE eNB + ueVal->AddItem ("DRB.PdcpSduDelayDl.UEID", pdcpLatency); + } + + m_msgValues.m_ueIndications.insert (ueVal); +} + +void +LteIndicationMessageHelper::AddCuUpCellPmItem (double cellAverageLatency) +{ + if (!m_reducedPmValues) + { + Ptr cellVal = Create (); + cellVal->AddItem ("DRB.PdcpSduDelayDl", cellAverageLatency); + m_msgValues.m_cellMeasurementItems = cellVal; + } +} + +void +LteIndicationMessageHelper::FillCuUpValues (std::string plmId, long pdcpBytesUl, long pdcpBytesDl) +{ + m_cuUpValues->m_pDCPBytesUL = pdcpBytesUl; + m_cuUpValues->m_pDCPBytesDL = pdcpBytesDl; + FillBaseCuUpValues (plmId); +} + +void +LteIndicationMessageHelper::FillCuCpValues (uint16_t numActiveUes) +{ + FillBaseCuCpValues (numActiveUes); +} + +void +LteIndicationMessageHelper::AddCuCpUePmItem (std::string ueImsiComplete, long numDrb, + long drbRelAct) +{ + + Ptr ueVal = Create (ueImsiComplete); + if (!m_reducedPmValues) + { + ueVal->AddItem ("DRB.EstabSucc.5QI.UEID", numDrb); + ueVal->AddItem ("DRB.RelActNbr.5QI.UEID", drbRelAct); // not modeled in the simulator + } + m_msgValues.m_ueIndications.insert (ueVal); +} + +LteIndicationMessageHelper::~LteIndicationMessageHelper () +{ +} + +} // namespace ns3 \ No newline at end of file