21#include "ns3/packet.h"
22#include "ns3/simulator.h"
43 m_signalQualityThreshold(10)
57 return rand() % 8 + 2;
67 "Base station: Error while processing ranging request: !BS_STATE_UL_SUB_FRAME");
71 if (
m_bs->GetUplinkScheduler()->GetIsInvIrIntrvlAllocated())
73 if (
m_bs->GetUplinkScheduler()->GetIsIrIntrvlAllocated())
76 m_bs->GetUlSubframeStartTime() +
77 Seconds((
m_bs->GetUplinkScheduler()->GetNrIrOppsAllocated() + 1) *
78 m_bs->GetRangReqOppSize() *
m_bs->GetSymbolDuration().GetSeconds());
83 m_bs->GetUlSubframeStartTime() +
84 Seconds(
m_bs->GetRangReqOppSize() *
m_bs->GetSymbolDuration().GetSeconds());
90 m_bs->GetUplinkScheduler()->GetIsIrIntrvlAllocated(),
91 "Base station: Error while processing ranging request: IR interval not allocated");
94 m_bs->GetUlSubframeStartTime() +
95 Seconds(
m_bs->GetUplinkScheduler()->GetNrIrOppsAllocated() *
m_bs->GetRangReqOppSize() *
96 m_bs->GetSymbolDuration().GetSeconds());
129 rngrsp.SetInitRangOppNumber(
m_bs->GetRangingOppNumber());
137 if (
cid.IsInitialRanging())
174 ssRecord->ResetRangingCorrectionRetries();
175 ssRecord->ResetInvitedRangingRetries();
218 ssRecord->ResetInvitedRangingRetries();
226 if (
ssRecord->GetRangingCorrectionRetries() ==
m_bs->GetMaxRangingCorrectionRetries())
243 if (
ssRecord->GetInvitedRangRetries() > 0)
247 if (
ssRecord->GetInvitedRangRetries() ==
m_bs->GetMaxInvitedRangRetries())
260 rngrsp->SetTimingAdjust(40);
261 rngrsp->SetPowerLevelAdjust(8);
262 rngrsp->SetOffsetFreqAdjust(30);
334 return m_bs->GetChannel(1);
Ptr< BaseStationNetDevice > m_bs
base station
void PerformInvitedRanging(Cid cid, RngRsp *rngrsp)
Perform inivted ranging function.
uint32_t GetNewDlChannel()
Get new DL channel function.
BSLinkManager(Ptr< BaseStationNetDevice > bs)
Constructor.
void ProcessRangingRequest(Cid cid, RngReq rngreq)
process a ranging request message
~BSLinkManager() override
void AbortRanging(Cid cid, RngRsp *rngrsp, SSRecord *ssRecord, bool isNewSS)
Abort ranging function.
bool ChangeDlChannel()
Change DL channel function.
void VerifyInvitedRanging(Cid cid, uint8_t uiuc)
Verifies at the end of an invited ranging interval if SS sent ranging message in it or not.
void DeallocateCids(Cid cid)
Deallocate CIDs function.
int tries
variable to test multiple RNG-REQ by the SS for example undecodable at BS or lost RNG-RSP
uint8_t m_signalQualityThreshold
signal quality threshold
void ScheduleRngRspMessage(Cid cid, RngRsp *rngrsp)
Schedule range response message function.
void PerformInitialRanging(Cid cid, RngReq *rngreq, RngRsp *rngrsp)
Perform initial ranging function.
bool IsRangingAcceptable()
Is ranging acceptable function.
static TypeId GetTypeId()
Get the type ID.
uint64_t SelectDlChannel()
void SetParametersToAdjust(RngRsp *rngrsp)
Set parameters to adjust function.
uint8_t GetSignalQuality()
Get signal quality function.
void ContinueRanging(Cid cid, RngRsp *rngrsp, SSRecord *ssRecord)
Continue ranging function.
void AcceptRanging(Cid cid, RngRsp *rngrsp, SSRecord *ssRecord)
Accept ranging function.
uint8_t CalculateRangingOppsToAllocate()
void PerformRanging(Cid cid, RngReq rngreq)
Perform ranging function.
uint32_t m_signalQuality
signal quality
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.
Smart pointer class similar to boost::intrusive_ptr.
This class implements the ranging request message described by "IEEE Standard for Local and metropoli...
This class implements the ranging response message described by "IEEE Standard for Local and metropol...
This class is used by the base station to store some information related to subscriber station in the...
void IncrementRangingCorrectionRetries()
Increment ranging correction retries.
void IncrementInvitedRangingRetries()
Increment invited ranging retries.
static Time Now()
Return the current simulation virtual time.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
@ RANGING_STATUS_CONTINUE
ModulationType
ModulationType enumeration.
#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_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.