26 #include "ns3/packet.h"
27 #include "ns3/simulator.h"
29 #include "ns3/pointer.h"
53 m_initRangOppNumber (0),
54 m_contentionRangingRetries (0),
55 m_rngReqFrameNumber (0),
58 m_rangingIntervalFound (false),
61 m_nrInvitedPollsRecvd (0),
64 m_nrRangingTransOpps (0),
65 m_isBackoffSet (false),
66 m_rangingAnomalies (0)
137 if (deleteParameters)
143 "Subscriber Station: Error while scanning: Already registered with a BS");
159 m_ss->GetPhy ()->StartScanning (dlChannel,
m_ss->GetIntervalT20 (),
195 "SS: Error while sending a ranging request: the ss state should be SS_STATE_WAITING_REG_RANG_INTRVL or SS_STATE_WAITING_INV_RANG_INTRVL");
201 m_ss->GetBurstProfileManager ()->GetBurstProfileToRequest ());
224 connection =
m_ss->GetBasicConnection ();
228 connection =
m_ss->GetInitialRangingConnection ();
239 ==
m_ss->GetCurrentUcd ().GetChannelEncodings ().GetRangReqOppSize ()
240 /
m_ss->GetPhy ()->GetPsPerSymbol (),
241 "SS: Error while sending a ranging request: the allocation size is not correct");
244 m_ss->SendBurst (uiuc, allocationSize, connection);
257 "SS: Can not start connection resolution: The SS state should be SS_STATE_WAITING_RNG_RSP or SS_STATE_WAITING_REG_RANG_INTRVL or SS_STATE_ADJUSTING_PARAMETERS");
259 if (
m_ss->GetState ()
267 else if (
m_ss->GetState ()
290 Time defferTime = Seconds (0);
291 Time timeToAllocation = Seconds (0);
292 uint16_t nrPsPerRangOpp =
293 m_ss->GetCurrentUcd ().GetChannelEncodings ().GetRangReqOppSize ();
295 m_ss->GetCurrentUcd ().GetChannelEncodings ().GetRangReqOppSize ()
296 /
m_ss->GetPhy ()->GetPsPerSymbol ();
302 defferTime = Seconds (deferTOs * nrPsPerRangOpp
303 *
m_ss->GetPhy ()->GetPsDuration ().GetSeconds ());
304 timeToAllocation =
m_ss->GetTimeToAllocation (defferTime);
324 "be sure that CW has been set and BO is not already set");
334 m_ss->GetCurrentUcd ().GetRangingBackoffEnd ());
341 (double)
m_ss->GetCurrentUcd ().GetRangingBackoffStart ()) - 1;
350 if (cid ==
m_ss->GetInitialRangingConnection ()->GetCid ())
371 m_ss->SetBasicConnection (CreateObject<WimaxConnection> (rngrsp.
GetBasicCid (),
374 m_ss->SetPrimaryConnection (CreateObject<WimaxConnection> (rngrsp.
GetPrimaryCid (),
376 m_ss->SetAreManagementConnectionsAllocated (
true);
395 "SS: Can not perform ranging: the ranging status should be RANGING_STATUS_CONTINUE or RANGING_STATUS_ABORT or RANGING_STATUS_SUCCESS");
404 m_ss->SetBasicConnection (0);
405 m_ss->SetPrimaryConnection (0);
406 m_ss->SetAreManagementConnectionsAllocated (
false);
417 if (
m_ss->HasServiceFlows () && !
m_ss->GetAreServiceFlowsAllocated ())
419 m_ss->GetServiceFlowManager ()->InitiateServiceFlows ();
451 bool successful =
true;
499 bool deleteUlParameters,
EventId &eventId)
502 this, eventType, deleteUlParameters), eventId);
void SetMacAddress(Mac48Address macAddress)
Simulation virtual time values and global simulation resolution.
smart pointer class similar to boost::intrusive_ptr
void SetReqDlBurstProfile(uint8_t reqDlBurstProfile)
Ptr< SubscriberStationNetDevice > m_ss
Doxygen introspection did not find any typical Config paths.
void ResetRangingRequestCW(void)
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register the class in the ns-3 factory.
WimaxNetDevice::RangingStatus m_rangingStatus
Doxygen introspection did not find any typical Config paths.
void ScheduleScanningRestart(Time interval, SubscriberStationNetDevice::EventType eventType, bool deleteUlParameters, EventId &eventId)
EventId m_waitForRngRspEvent
void SetBsEirp(uint16_t bs_eirp)
uint8_t m_contentionRangingRetries
SSLinkManager(Ptr< SubscriberStationNetDevice > ss)
void StartSynchronizing(void)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
bool GetRangingIntervalFound(void) const
uint16_t CalculateMaxIRSignalStrength(void)
void StartScanning(SubscriberStationNetDevice::EventType type, bool deleteParameters)
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...
bool IsRunning(void) const
This method is syntactic sugar for the ns3::Simulator::isExpired method.
uint32_t GetDlFreqOverride(void) const
void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
void PerformRanging(Cid cid, RngRsp rngrsp)
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
uint8_t m_nrRangingTransOpps
void AdjustRangingParameters(const RngRsp &rngrsp)
uint16_t m_nrRngRspsRecvd
uint8_t GetInitRangOppNumber(void) const
uint8_t m_initRangOppNumber
uint32_t GetTimingAdjust(void) const
void SendRangingRequest(uint8_t uiuc, uint16_t allocationSize)
void PerformBackoff(void)
uint8_t m_rangingAnomalies
bool IsUlChannelUsable(void)
Doxygen introspection did not find any typical Config paths.
Cid GetBasicCid(void) const
void SetRangingCW(uint8_t rangingCW)
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
uint16_t m_nrInvitedPollsRecvd
void NegotiateBasicCapabilities(void)
void SelectRandomBackoff(void)
uint8_t GetRangStatus(void) const
void StartContentionResolution(void)
Hold together all Wimax-related objects in a NetDevice.
void SetNrRangingTransOpps(uint8_t nrRangingTransOpps)
uint32_t GetFrameNumber(void) const
void SetEirXPIrMax(uint16_t eir_x_p_ir_max)
uint32_t m_rngReqFrameNumber
void IncreaseRangingRequestCW(void)
void SetRangingIntervalFound(bool rangingIntervalFound)
Mac48Address GetMacAddress(void) const
uint16_t GetMinTransmitPowerLevel(void)
void IncrementNrInvitedPollsRecvd(void)
uint8_t GetPowerLevelAdjust(void) const
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
void DeleteUplinkParameters(void)
an identifier for simulation events.
EventId GetDlMapSyncTimeoutEvent(void)
static TypeId GetTypeId(void)
Cid GetPrimaryCid(void) const
uint32_t GetOffsetFreqAdjust(void) const
void EndScanning(bool status, uint64_t frequency)
a base class which provides memory management and object aggregation
EventId m_dlMapSyncTimeoutEvent
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
void AddHeader(const Header &header)
Add header to this packet.
void SetRangingAnomalies(uint8_t rangingAnomalies)
bool m_rangingIntervalFound