A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
bs-link-manager.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007,2008,2009 INRIA, UDcast
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Authors: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
18 * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
19 * <amine.ismail@UDcast.com>
20 */
21
22#ifndef LINK_MANAGER_H
23#define LINK_MANAGER_H
24
25#include "bs-net-device.h"
26#include "cid.h"
27#include "mac-messages.h"
28#include "wimax-net-device.h"
29
30#include "ns3/event-id.h"
31
32#include <stdint.h>
33
34namespace ns3
35{
36
37/**
38 * \ingroup wimax
39 *
40 * BaseStation Link Manager
41 */
42class BSLinkManager : public Object
43{
44 public:
45 /**
46 * \brief Get the type ID.
47 * \return the object TypeId
48 */
49 static TypeId GetTypeId();
50 /**
51 * Constructor
52 *
53 * \param bs base station device
54 */
56 ~BSLinkManager() override;
57
58 // Delete copy constructor and assignment operator to avoid misuse
59 BSLinkManager(const BSLinkManager&) = delete;
61
62 /**
63 * \return the ranging opportunities to allocate
64 */
66 /**
67 * \return an available downlink channel
68 */
69 uint64_t SelectDlChannel();
70 /**
71 * \brief process a ranging request message
72 * \param cid the connection identifier in which the ranging message was received
73 * \param rngreq the ranging request message
74 */
75
76 void ProcessRangingRequest(Cid cid, RngReq rngreq);
77 /**
78 * \brief Verifies at the end of an invited ranging interval if SS sent ranging message in it or
79 * not
80 * \param cid the connection identifier in which the ranging message was received
81 * \param uiuc the ranging
82 */
83 void VerifyInvitedRanging(Cid cid, uint8_t uiuc);
84
85 private:
86 /**
87 * Perform ranging function
88 * \param cid the CID
89 * \param rngreq the ranging request
90 */
91 void PerformRanging(Cid cid, RngReq rngreq);
92 /**
93 * Perform initial ranging function
94 * \param cid the CID
95 * \param rngreq the ranging request
96 * \param rngrsp the ranging response
97 */
98 void PerformInitialRanging(Cid cid, RngReq* rngreq, RngRsp* rngrsp);
99 /**
100 * Perform inivted ranging function
101 * \param cid the CID
102 * \param rngrsp the ranging response
103 */
104 void PerformInvitedRanging(Cid cid, RngRsp* rngrsp);
105
106 /**
107 * Set parameters to adjust function
108 * \param rngrsp the ranging response
109 */
110 void SetParametersToAdjust(RngRsp* rngrsp);
111 /**
112 * Abort ranging function
113 * \param cid the CID
114 * \param rngrsp the ranging response
115 * \param ssRecord the SS record
116 * \param isNewSS true if a new SS
117 */
118 void AbortRanging(Cid cid, RngRsp* rngrsp, SSRecord* ssRecord, bool isNewSS);
119 /**
120 * Accept ranging function
121 * \param cid the CID
122 * \param rngrsp the ranging response
123 * \param ssRecord the SS record
124 */
125 void AcceptRanging(Cid cid, RngRsp* rngrsp, SSRecord* ssRecord);
126 /**
127 * Continue ranging function
128 * \param cid the CID
129 * \param rngrsp the ranging response
130 * \param ssRecord the SS record
131 */
132 void ContinueRanging(Cid cid, RngRsp* rngrsp, SSRecord* ssRecord);
133 /**
134 * Schedule range response message function
135 * \param cid the CID
136 * \param rngrsp the ranging response
137 */
138 void ScheduleRngRspMessage(Cid cid, RngRsp* rngrsp);
139 /**
140 * Deallocate CIDs function
141 * \param cid the CID
142 */
143 void DeallocateCids(Cid cid);
144
145 /**
146 * Change DL channel function
147 * \returns true if the DL channel changed
148 */
149 bool ChangeDlChannel();
150 /**
151 * Get new DL channel function
152 * \returns the new DL channel
153 */
155 /**
156 * Get signal quality function
157 * \returns the signal quality
158 */
159 uint8_t GetSignalQuality();
160 /**
161 * Is ranging acceptable function
162 * \returns true if ranging is acceptable
163 */
164 bool IsRangingAcceptable();
165
167
168 // ranging parameters
169 uint32_t m_signalQuality; ///< signal quality
170 uint8_t m_signalQualityThreshold; ///< signal quality threshold
171 int tries; ///< variable to test multiple RNG-REQ by the SS for example undecodable at BS or
172 ///< lost RNG-RSP
173};
174
175} // namespace ns3
176
177#endif /* LINK_MANAGER_H */
Cid class.
Definition: cid.h:37
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
This class implements the ranging request message described by "IEEE Standard for Local and metropoli...
Definition: mac-messages.h:664
This class implements the ranging response message described by "IEEE Standard for Local and metropol...
Definition: mac-messages.h:125
This class is used by the base station to store some information related to subscriber station in the...
Definition: ss-record.h:46
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.