30 #include "ns3/packet.h"
31 #include "ns3/pointer.h"
32 #include "ns3/simulator.h"
56 m_initRangOppNumber(0),
57 m_contentionRangingRetries(0),
58 m_rngReqFrameNumber(0),
61 m_rangingIntervalFound(false),
64 m_nrInvitedPollsRecvd(0),
67 m_nrRangingTransOpps(0),
68 m_isBackoffSet(false),
137 if (deleteParameters)
143 "Subscriber Station: Error while scanning: Already registered with a BS");
160 m_ss->GetPhy()->StartScanning(dlChannel,
161 m_ss->GetIntervalT20(),
197 "SS: Error while sending a ranging request: the ss state should be "
198 "SS_STATE_WAITING_REG_RANG_INTRVL or SS_STATE_WAITING_INV_RANG_INTRVL");
225 connection =
m_ss->GetBasicConnection();
229 connection =
m_ss->GetInitialRangingConnection();
241 m_ss->GetCurrentUcd().GetChannelEncodings().GetRangReqOppSize() /
242 m_ss->GetPhy()->GetPsPerSymbol(),
243 "SS: Error while sending a ranging request: the allocation size is not correct");
247 m_ss->SendBurst(uiuc, allocationSize, connection);
257 "SS: Can not start connection resolution: The SS state should be SS_STATE_WAITING_RNG_RSP "
258 "or SS_STATE_WAITING_REG_RANG_INTRVL or SS_STATE_ADJUSTING_PARAMETERS");
289 uint16_t nrPsPerRangOpp =
m_ss->GetCurrentUcd().GetChannelEncodings().GetRangReqOppSize();
290 uint16_t oppSize =
m_ss->GetCurrentUcd().GetChannelEncodings().GetRangReqOppSize() /
291 m_ss->GetPhy()->GetPsPerSymbol();
298 Seconds(deferTOs * nrPsPerRangOpp *
m_ss->GetPhy()->GetPsDuration().GetSeconds());
299 timeToAllocation =
m_ss->GetTimeToAllocation(deferTime);
322 "be sure that CW has been set and BO is not already set");
340 (uint8_t)std::pow(2.0, (
double)
m_ss->GetCurrentUcd().GetRangingBackoffStart()) - 1;
348 if (cid ==
m_ss->GetInitialRangingConnection()->GetCid())
370 m_ss->SetPrimaryConnection(
372 m_ss->SetAreManagementConnectionsAllocated(
true);
390 "SS: Can not perform ranging: the ranging status should be "
391 "RANGING_STATUS_CONTINUE or RANGING_STATUS_ABORT or RANGING_STATUS_SUCCESS");
400 m_ss->SetBasicConnection(
nullptr);
401 m_ss->SetPrimaryConnection(
nullptr);
402 m_ss->SetAreManagementConnectionsAllocated(
false);
412 if (
m_ss->HasServiceFlows() && !
m_ss->GetAreServiceFlowsAllocated())
414 m_ss->GetServiceFlowManager()->InitiateServiceFlows();
444 bool successful =
true;
493 bool deleteUlParameters,
An identifier for simulation events.
bool IsRunning() const
This method is syntactic sugar for !IsExpired().
Mac Management messages Section 6.3.2.3 MAC Management messages page 42, Table 14 page 43.
A base class which provides memory management and object aggregation.
void AddHeader(const Header &header)
Add header to this packet.
Smart pointer class similar to boost::intrusive_ptr.
void SetReqDlBurstProfile(uint8_t reqDlBurstProfile)
Set request DL burst profile field.
void SetRangingAnomalies(uint8_t rangingAnomalies)
Set ranging anomalies field.
void SetMacAddress(Mac48Address macAddress)
Set MAC address field.
This class implements the ranging response message described by "IEEE Standard for Local and metropol...
Mac48Address GetMacAddress() const
uint32_t GetTimingAdjust() const
Cid GetPrimaryCid() const
uint8_t GetPowerLevelAdjust() const
uint8_t GetRangStatus() const
uint32_t GetOffsetFreqAdjust() const
uint32_t GetDlFreqOverride() const
uint32_t GetFrameNumber() const
uint8_t GetInitRangOppNumber() const
void SetEirXPIrMax(uint16_t eir_x_p_ir_max)
Set EIRX IR maximum.
void AdjustRangingParameters(const RngRsp &rngrsp)
Adjust ranging parameters.
~SSLinkManager() override
uint8_t m_rangingBO
ranging BO
void SetBsEirp(uint16_t bs_eirp)
Set BS EIRP.
void IncrementNrInvitedPollsRecvd()
Increment NR invited polls received.
uint8_t m_initRangOppNumber
Initial Ranging opportunity (1–255) in which SS transmitted the RNG_REQ.
EventId m_dlMapSyncTimeoutEvent
DL map sync timeout event.
uint16_t m_nrRngReqsSent
number rang requests sent
void SetRangingIntervalFound(bool rangingIntervalFound)
Set ranging interval found.
uint16_t m_pTxIrMax
maximum transmit signal strength for initial ranging calculated by SS
uint16_t m_nrInvitedPollsRecvd
number invited polls received
void EndScanning(bool status, uint64_t frequency)
End scanning.
void SelectRandomBackoff()
Select random backoff.
static TypeId GetTypeId()
Get the type ID.
RngReq m_rngreq
rng request
Ptr< SubscriberStationNetDevice > m_ss
subscriber station device
uint8_t m_contentionRangingRetries
contention ranging retries
void ScheduleScanningRestart(Time interval, SubscriberStationNetDevice::EventType eventType, bool deleteUlParameters, EventId &eventId)
Schedule scanning request.
uint16_t m_nrRngRspsRecvd
number rang responses received
uint8_t m_nrRangingTransOpps
number ranging trans opps
void SendRangingRequest(uint8_t uiuc, uint16_t allocationSize)
Send ranging request.
bool IsUlChannelUsable()
Is UL channel usable.
void StartContentionResolution()
Start contention resolution.
void ResetRangingRequestCW()
Reset ranging request CW.
EventId m_waitForRngRspEvent
wait for rang response event
uint16_t m_eirXPIrMax
initial ranging maximum equivalent isotropic received power at BS
uint64_t m_frequency
frequency on which it is currently operating, i.e., where scanning was successful
void SetNrRangingTransOpps(uint8_t nrRangingTransOpps)
Set NR ranging trans opps.
uint16_t CalculateMaxIRSignalStrength()
Calculate maximum IR signal strength.
uint8_t m_rangingCW
ranging CW
void DoDispose() override
Destructor implementation.
uint32_t m_rngReqFrameNumber
frame number in which SS sent RNG_REQ message
void PerformBackoff()
Perform backoff.
uint16_t m_bsEirp
BS EIRP.
void DeleteUplinkParameters()
Delete uplink parameters.
bool m_isBackoffSet
is backoff set
void NegotiateBasicCapabilities()
Negotiate basic capabilities.
bool GetRangingIntervalFound() const
Get ranging interval found.
uint8_t m_dlChnlNr
indicates the channel/frequency currently the SS is scanning
void StartSynchronizing()
Start synchronizing.
void PerformRanging(Cid cid, RngRsp rngrsp)
Perform ranging.
void IncreaseRangingRequestCW()
Increase rnaging request CW.
WimaxNetDevice::RangingStatus m_rangingStatus
ranging status
EventId GetDlMapSyncTimeoutEvent()
Get DL map sync timeout event.
void StartScanning(SubscriberStationNetDevice::EventType type, bool deleteParameters)
Start scanning.
uint8_t m_rangingAnomalies
ranging anomalies
bool m_rangingIntervalFound
ranging interval found
SSLinkManager(Ptr< SubscriberStationNetDevice > ss)
Constructor.
uint16_t GetMinTransmitPowerLevel()
Get minimum transmit power level.
void SetRangingCW(uint8_t rangingCW)
Set ranging CW.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Cancel(const EventId &id)
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
EventType
EventType enumeration.
@ EVENT_DL_MAP_SYNC_TIMEOUT
@ SS_STATE_WAITING_REG_RANG_INTRVL
@ SS_STATE_ADJUSTING_PARAMETERS
@ SS_STATE_WAITING_INV_RANG_INTRVL
@ SS_STATE_WAITING_RNG_RSP
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
This class implements the UCD message as described by "IEEE Standard for Local and metropolitan area ...
Hold together all WiMAX-related objects in a NetDevice.
RangingStatus
RangingStatus enumeration.
@ RANGING_STATUS_CONTINUE
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...