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