A Discrete-Event Network Simulator
API
a2-a4-rsrq-handover-algorithm.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  * Copyright (c) 2013 Budiarto Herman
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Original work authors (from lte-enb-rrc.cc):
20  * - Nicola Baldo <nbaldo@cttc.es>
21  * - Marco Miozzo <mmiozzo@cttc.es>
22  * - Manuel Requena <manuel.requena@cttc.es>
23  *
24  * Converted to handover algorithm interface by:
25  * - Budiarto Herman <budiarto.herman@magister.fi>
26  */
27 
28 #ifndef A2_A4_RSRQ_HANDOVER_ALGORITHM_H
29 #define A2_A4_RSRQ_HANDOVER_ALGORITHM_H
30 
31 #include <ns3/lte-handover-algorithm.h>
32 #include <ns3/lte-handover-management-sap.h>
33 #include <ns3/lte-rrc-sap.h>
34 #include <ns3/simple-ref-count.h>
35 #include <ns3/ptr.h>
36 #include <map>
37 
38 namespace ns3 {
39 
40 
81 {
82 public:
85 
86  virtual ~A2A4RsrqHandoverAlgorithm ();
87 
88  // inherited from Object
89  static TypeId GetTypeId ();
90 
91  // inherited from LteHandoverAlgorithm
94 
95  // let the forwarder class access the protected and private members
97 
98 protected:
99  // inherited from Object
100  virtual void DoInitialize ();
101  virtual void DoDispose ();
102 
103  // inherited from LteHandoverAlgorithm as a Handover Management SAP implementation
104  void DoReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults);
105 
106 private:
113  void EvaluateHandover (uint16_t rnti, uint8_t servingCellRsrq);
114 
122  bool IsValidNeighbour (uint16_t cellId);
123 
134  void UpdateNeighbourMeasurements (uint16_t rnti, uint16_t cellId,
135  uint8_t rsrq);
136 
138  uint8_t m_a2MeasId;
140  uint8_t m_a4MeasId;
141 
146  class UeMeasure : public SimpleRefCount<UeMeasure>
147  {
148  public:
149  uint16_t m_cellId;
150  uint8_t m_rsrp;
151  uint8_t m_rsrq;
152  };
153 
158  typedef std::map<uint16_t, Ptr<UeMeasure> > MeasurementRow_t;
159 
164  typedef std::map<uint16_t, MeasurementRow_t> MeasurementTable_t;
165 
167  MeasurementTable_t m_neighbourCellMeasures;
168 
176 
183 
188 
189 }; // end of class A2A4RsrqHandoverAlgorithm
190 
191 
192 } // end of namespace ns3
193 
194 
195 #endif /* A2_A4_RSRQ_HANDOVER_ALGORITHM_H */
The abstract base class of a handover algorithm that operates using the Handover Management SAP inter...
MeasurementTable_t m_neighbourCellMeasures
Table of measurement reports from all UEs.
virtual void SetLteHandoverManagementSapUser(LteHandoverManagementSapUser *s)
Set the "user" part of the Handover Management SAP interface that this handover algorithm instance wi...
LteHandoverManagementSapProvider * m_handoverManagementSapProvider
Receive API calls from the eNodeB RRC instance.
virtual LteHandoverManagementSapProvider * GetLteHandoverManagementSapProvider()
Export the "provider" part of the Handover Management SAP interface.
A2A4RsrqHandoverAlgorithm()
Creates an A2-A4-RSRQ handover algorithm instance.
Handover algorithm implementation based on RSRQ measurements, Event A2 and Event A4.
uint8_t m_neighbourCellOffset
The NeighbourCellOffset attribute.
bool IsValidNeighbour(uint16_t cellId)
Determines if a neighbour cell is a valid destination for handover.
void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults)
Implementation of LteHandoverManagementSapProvider::ReportUeMeas.
LteHandoverManagementSapUser * m_handoverManagementSapUser
Interface to the eNodeB RRC instance.
virtual void DoInitialize()
Initialize() implementation.
Template for the implementation of the LteHandoverManagementSapProvider as a member of an owner class...
std::map< uint16_t, MeasurementRow_t > MeasurementTable_t
Measurements reported by several UEs.
uint8_t m_servingCellThreshold
The ServingCellThreshold attribute.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t m_a2MeasId
The expected measurement identity for A2 measurements.
Service Access Point (SAP) offered by the handover algorithm instance to the eNodeB RRC instance...
void UpdateNeighbourMeasurements(uint16_t rnti, uint16_t cellId, uint8_t rsrq)
Called when Event A4 is reported, then update the measurements table.
std::map< uint16_t, Ptr< UeMeasure > > MeasurementRow_t
Measurements reported by a UE for several cells.
void EvaluateHandover(uint16_t rnti, uint8_t servingCellRsrq)
Called when Event A2 is detected, then trigger a handover if needed.
uint8_t m_a4MeasId
The expected measurement identity for A4 measurements.
virtual void DoDispose()
Destructor implementation.
A template-based reference counting class.
a unique identifier for an interface.
Definition: type-id.h:58
Service Access Point (SAP) offered by the eNodeB RRC instance to the handover algorithm instance...
Measurements reported by a UE for a cell ID.