Loading...
Searching...
No Matches
satellite-handover-module.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2018 CNES
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Mathias Ettinger <mettinger@toulouse.viveris.fr>
19 */
20
21#ifndef SATELLITE_HANDOVER_MODULE_H
22#define SATELLITE_HANDOVER_MODULE_H
23
25
26#include "ns3/callback.h"
27#include "ns3/node-container.h"
28#include "ns3/node.h"
29#include "ns3/nstime.h"
30#include "ns3/object.h"
31#include "ns3/ptr.h"
32
33#include <stdint.h>
34#include <utility>
35#include <vector>
36
37namespace ns3
38{
39
44class SatHandoverModule : public Object
45{
46 public:
51
57 typedef Callback<void, uint32_t, uint32_t> HandoverRequestCallback;
58
62 static TypeId GetTypeId(void);
63
67 virtual void DoDispose();
68
73
80 SatHandoverModule(Ptr<Node> utNode,
81 NodeContainer satellites,
82 Ptr<SatAntennaGainPatternContainer> agpContainer);
83
88
94
99 uint32_t GetAskedSatId();
100
105 uint32_t GetAskedBeamId();
106
110 void HandoverFinished();
111
119 bool CheckForHandoverRecommendation(uint32_t satId, uint32_t beamId);
120
121 private:
128 std::vector<uint32_t> GetNClosestSats(uint32_t numberOfSats);
129
136 std::pair<uint32_t, uint32_t> AlgorithmNClosest(GeoCoordinate coords);
137
142
147
149
150 Ptr<Node> m_utNode;
151 NodeContainer m_satellites;
152 Ptr<SatAntennaGainPatternContainer> m_antennaGainPatterns;
153
157 uint32_t m_askedSatId;
159
160 TracedCallback<double> m_antennaGainTrace;
161};
162
163} // namespace ns3
164
165#endif /* SATELLITE_HANDOVER_MODULE_H */
GeoCoordinate class is used to store and operate with geodetic coordinates.
void HandoverFinished()
Method to call when a handover has been performed.
HandoverDecisionAlgorithm_t m_handoverDecisionAlgorithm
Algorithm used to detect if handover is needed.
uint32_t GetAskedBeamId()
Get the best beam ID.
~SatHandoverModule()
Destroy a SatHandoverModule.
void SetHandoverRequestCallback(SatHandoverModule::HandoverRequestCallback cb)
Set the handover recommendation message sending callback.
HandoverRequestCallback m_handoverCallback
SatHandoverModule()
Default constructor, which is not used.
bool CheckForHandoverRecommendation(uint32_t satId, uint32_t beamId)
Inspect whether or not the given beam is still suitable for the underlying mobility model.
virtual void DoDispose()
Dispose of this class instance.
std::pair< uint32_t, uint32_t > AlgorithmNClosest(GeoCoordinate coords)
Handover algorithm choosing best beam between N closest satellites.
TracedCallback< double > m_antennaGainTrace
Ptr< SatAntennaGainPatternContainer > m_antennaGainPatterns
uint32_t GetAskedSatId()
Get the best sat ID.
uint32_t m_numberClosestSats
Number of satellites to consider when using algorithm SAT_N_CLOSEST_SAT.
std::vector< uint32_t > GetNClosestSats(uint32_t numberOfSats)
Get the N closest satellites to the UT node.
static TypeId GetTypeId(void)
Derived from Object.
Callback< void, uint32_t, uint32_t > HandoverRequestCallback
Handover recommendation message sending callback.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.