5G-LENA nr-v4.0
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-a2-a4-rsrq-handover-algorithm.h
1// Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2// Copyright (c) 2013 Budiarto Herman
3//
4// SPDX-License-Identifier: GPL-2.0-only
5//
6// Original work authors (from lte-enb-rrc.cc):
7// Nicola Baldo <nbaldo@cttc.es>
8// Marco Miozzo <mmiozzo@cttc.es>
9// Manuel Requena <manuel.requena@cttc.es>
10//
11// Converted to handover algorithm interface by:
12// Budiarto Herman <budiarto.herman@magister.fi>
13
14#ifndef A2_A4_RSRQ_HANDOVER_ALGORITHM_H
15#define A2_A4_RSRQ_HANDOVER_ALGORITHM_H
16
17#include "nr-handover-algorithm.h"
18#include "nr-handover-management-sap.h"
19#include "nr-rrc-sap.h"
20
21#include "ns3/ptr.h"
22#include "ns3/simple-ref-count.h"
23
24#include <map>
25
26namespace ns3
27{
28
69{
70 public:
73
75
80 static TypeId GetTypeId();
81
82 // inherited from NrHandoverAlgorithm
85
88
89 protected:
90 // inherited from Object
91 void DoInitialize() override;
92 void DoDispose() override;
93
94 // inherited from NrHandoverAlgorithm as a Handover Management SAP implementation
95 void DoReportUeMeas(uint16_t rnti, NrRrcSap::MeasResults measResults) override;
96
97 private:
104 void EvaluateHandover(uint16_t rnti, uint8_t servingCellRsrq);
105
113 bool IsValidNeighbour(uint16_t cellId);
114
125 void UpdateNeighbourMeasurements(uint16_t rnti, uint16_t cellId, uint8_t rsrq);
126
128 std::vector<uint8_t> m_a2MeasIds;
130 std::vector<uint8_t> m_a4MeasIds;
131
136 class UeMeasure : public SimpleRefCount<UeMeasure>
137 {
138 public:
139 uint16_t m_cellId;
140 uint8_t m_rsrp;
141 uint8_t m_rsrq;
142 };
143
148 typedef std::map<uint16_t, Ptr<UeMeasure>> MeasurementRow_t;
149
154 typedef std::map<uint16_t, MeasurementRow_t> MeasurementTable_t;
155
157 MeasurementTable_t m_neighbourCellMeasures;
158
165 uint8_t m_servingCellThreshold;
166
172 uint8_t m_neighbourCellOffset;
173
175 NrHandoverManagementSapUser* m_handoverManagementSapUser;
177 NrHandoverManagementSapProvider* m_handoverManagementSapProvider;
178
179}; // end of class NrA2A4RsrqHandoverAlgorithm
180
181} // end of namespace ns3
182
183#endif /* A2_A4_RSRQ_HANDOVER_ALGORITHM_H */
Template for the implementation of the NrHandoverManagementSapProvider as a member of an owner class ...
Handover algorithm implementation based on RSRQ measurements, Event A2 and Event A4.
void SetNrHandoverManagementSapUser(NrHandoverManagementSapUser *s) override
Set the "user" part of the Handover Management SAP interface that this handover algorithm instance wi...
NrHandoverManagementSapProvider * GetNrHandoverManagementSapProvider() override
Export the "provider" part of the Handover Management SAP interface.
NrA2A4RsrqHandoverAlgorithm()
Creates an A2-A4-RSRQ handover algorithm instance.
void DoReportUeMeas(uint16_t rnti, NrRrcSap::MeasResults measResults) override
Implementation of NrHandoverManagementSapProvider::ReportUeMeas.
The abstract base class of a handover algorithm that operates using the Handover Management SAP inter...
Service Access Point (SAP) offered by the handover algorithm instance to the eNodeB RRC instance.
Service Access Point (SAP) offered by the eNodeB RRC instance to the handover algorithm instance.
MeasResults structure.
Definition nr-rrc-sap.h:723