A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ss-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 "cid.h"
26#include "mac-messages.h"
27#include "ss-net-device.h"
28#include "wimax-net-device.h"
29
30#include "ns3/event-id.h"
31#include "ns3/nstime.h"
32
33#include <stdint.h>
34
35namespace ns3
36{
37
38/**
39 * \ingroup wimax
40 * \brief this class implements the link manager of subscriber station net device. An ss link
41 * manager is responsible for link scanning and ranging
42 */
43class SSLinkManager : public Object
44{
45 public:
46 /**
47 * \brief Get the type ID.
48 * \return the object TypeId
49 */
50 static TypeId GetTypeId();
51 /**
52 * Constructor
53 *
54 * \param ss subscriber station device
55 */
57 ~SSLinkManager() override;
58 void DoDispose() override;
59
60 /**
61 * Set BS EIRP
62 * \param bs_eirp the BS EIRP
63 */
64 void SetBsEirp(uint16_t bs_eirp);
65 /**
66 * Set EIRX IR maximum
67 * \param eir_x_p_ir_max the EIRX IR maximum
68 */
69 void SetEirXPIrMax(uint16_t eir_x_p_ir_max);
70 /**
71 * Set ranging interval found
72 * \param rangingIntervalFound the ranging interval found
73 */
74 void SetRangingIntervalFound(bool rangingIntervalFound);
75 /**
76 * Get ranging interval found
77 * \returns the ranging interval found
78 */
79 bool GetRangingIntervalFound() const;
80 /**
81 * Set NR ranging trans opps
82 * \param nrRangingTransOpps the NR ranging trans opps
83 */
84 void SetNrRangingTransOpps(uint8_t nrRangingTransOpps);
85 /**
86 * Set ranging CW
87 * \param rangingCW the ranging CW
88 */
89 void SetRangingCW(uint8_t rangingCW);
90 /// Increment NR invited polls received
92 /**
93 * Get DL map sync timeout event
94 * \returns the event ID
95 */
97
98 /**
99 * Perform ranging
100 * \param cid the CID
101 * \param rngrsp the ranging response
102 */
103 void PerformRanging(Cid cid, RngRsp rngrsp);
104 /**
105 * Start scanning
106 * \param type the event type
107 * \param deleteParameters the delete parameters
108 */
109 void StartScanning(SubscriberStationNetDevice::EventType type, bool deleteParameters);
110 /**
111 * Send ranging request
112 * \param uiuc the UIUC
113 * \param allocationSize the allocation size
114 */
115 void SendRangingRequest(uint8_t uiuc, uint16_t allocationSize);
116 /// Start contention resolution
118 /// Perform backoff
119 void PerformBackoff();
120 /**
121 * Is UL channel usable
122 * \returns the UL channel usable flag
123 */
124 bool IsUlChannelUsable();
125 /**
126 * Schedule scanning request
127 * \param interval the scanning request interval
128 * \param eventType event type
129 * \param deleteUlParameters the delete UL parameters
130 * \param eventId the event ID
131 */
132 void ScheduleScanningRestart(Time interval,
134 bool deleteUlParameters,
135 EventId& eventId);
136
137 private:
138 /// type conversion operator
140 /**
141 * assignment operator
142 * \returns SS link manager
143 */
145
146 /**
147 * End scanning
148 * \param status the end status
149 * \param frequency the frequency
150 */
151 void EndScanning(bool status, uint64_t frequency);
152 /// Start synchronizing
153 void StartSynchronizing();
154 /**
155 * Search for DL channel
156 * \param channel the DL channel
157 * \returns true if found
158 */
159 bool SearchForDlChannel(uint8_t channel);
160 /// Select random backoff
161 void SelectRandomBackoff();
162 /// Increase rnaging request CW
164 /// Reset ranging request CW
166 /// Delete uplink parameters
168 /**
169 * Adjust ranging parameters
170 * \param rngrsp the ranging response
171 */
172 void AdjustRangingParameters(const RngRsp& rngrsp);
173 /// Negotiate basic capabilities
175 /**
176 * Calculate maximum IR signal strength
177 * \returns the maximum IR signal strength
178 */
180 /**
181 * Get minimum transmit power level
182 * \returns the minimum transmit power level
183 */
184 uint16_t GetMinTransmitPowerLevel();
185
186 Ptr<SubscriberStationNetDevice> m_ss; ///< subscriber station device
187
189 // initial ranging parameters obtained from DCD (in channel encodings)
190 uint16_t m_bsEirp; ///< BS EIRP
191 uint16_t m_eirXPIrMax; ///< initial ranging maximum equivalent isotropic received power at BS
192 uint16_t m_pTxIrMax; ///< maximum transmit signal strength for initial ranging calculated by SS
193
194 uint8_t m_initRangOppNumber; ///< Initial Ranging opportunity (1–255) in which SS transmitted
195 ///< the RNG_REQ
196 uint8_t m_contentionRangingRetries; ///< contention ranging retries
197 uint32_t m_rngReqFrameNumber; ///< frame number in which SS sent RNG_REQ message
198 RngReq m_rngreq; ///< rng request
199
200 uint8_t m_dlChnlNr; ///< indicates the channel/frequency currently the SS is scanning
201 uint64_t m_frequency; ///< frequency on which it is currently operating, i.e., where scanning
202 ///< was successful
203 bool m_rangingIntervalFound; ///< ranging interval found
204
205 // stats members
206 uint16_t m_nrRngReqsSent; ///< number rang requests sent
207 uint16_t m_nrRngRspsRecvd; ///< number rang responses received
208 uint16_t m_nrInvitedPollsRecvd; ///< number invited polls received
209
210 uint8_t m_rangingCW; ///< ranging CW
211 uint8_t m_rangingBO; ///< ranging BO
212 uint8_t m_nrRangingTransOpps; ///< number ranging trans opps
213 bool m_isBackoffSet; ///< is backoff set
214 uint8_t m_rangingAnomalies; ///< ranging anomalies
215
216 EventId m_waitForRngRspEvent; ///< wait for rang response event
217 EventId m_dlMapSyncTimeoutEvent; ///< DL map sync timeout event
218};
219
220} // namespace ns3
221
222#endif /* LINK_MANAGER_H */
Cid class.
Definition: cid.h:37
An identifier for simulation events.
Definition: event-id.h:55
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
EventType
EventType enumeration.
Definition: ss-net-device.h:70
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
RangingStatus
RangingStatus enumeration.
Every class exported by the ns3 library is enclosed in the ns3 namespace.