26 #include "ns3/packet.h"
27 #include "ns3/simulator.h"
29 #include "ns3/pointer.h"
44 .SetGroupName(
"Wimax");
54 m_initRangOppNumber (0),
55 m_contentionRangingRetries (0),
56 m_rngReqFrameNumber (0),
59 m_rangingIntervalFound (false),
62 m_nrInvitedPollsRecvd (0),
65 m_nrRangingTransOpps (0),
66 m_isBackoffSet (false),
67 m_rangingAnomalies (0)
138 if (deleteParameters)
144 "Subscriber Station: Error while scanning: Already registered with a BS");
160 m_ss->GetPhy ()->StartScanning (dlChannel,
m_ss->GetIntervalT20 (),
196 "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");
202 m_ss->GetBurstProfileManager ()->GetBurstProfileToRequest ());
225 connection =
m_ss->GetBasicConnection ();
229 connection =
m_ss->GetInitialRangingConnection ();
240 ==
m_ss->GetCurrentUcd ().GetChannelEncodings ().GetRangReqOppSize ()
241 /
m_ss->GetPhy ()->GetPsPerSymbol (),
242 "SS: Error while sending a ranging request: the allocation size is not correct");
245 m_ss->SendBurst (uiuc, allocationSize, connection);
258 "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");
260 if (
m_ss->GetState ()
268 else if (
m_ss->GetState ()
293 uint16_t nrPsPerRangOpp =
294 m_ss->GetCurrentUcd ().GetChannelEncodings ().GetRangReqOppSize ();
296 m_ss->GetCurrentUcd ().GetChannelEncodings ().GetRangReqOppSize ()
297 /
m_ss->GetPhy ()->GetPsPerSymbol ();
303 defferTime =
Seconds (deferTOs * nrPsPerRangOpp
304 *
m_ss->GetPhy ()->GetPsDuration ().GetSeconds ());
305 timeToAllocation =
m_ss->GetTimeToAllocation (defferTime);
325 "be sure that CW has been set and BO is not already set");
335 m_ss->GetCurrentUcd ().GetRangingBackoffEnd ());
342 (double)
m_ss->GetCurrentUcd ().GetRangingBackoffStart ()) - 1;
351 if (cid ==
m_ss->GetInitialRangingConnection ()->GetCid ())
372 m_ss->SetBasicConnection (CreateObject<WimaxConnection> (rngrsp.
GetBasicCid (),
375 m_ss->SetPrimaryConnection (CreateObject<WimaxConnection> (rngrsp.
GetPrimaryCid (),
377 m_ss->SetAreManagementConnectionsAllocated (
true);
396 "SS: Can not perform ranging: the ranging status should be RANGING_STATUS_CONTINUE or RANGING_STATUS_ABORT or RANGING_STATUS_SUCCESS");
405 m_ss->SetBasicConnection (0);
406 m_ss->SetPrimaryConnection (0);
407 m_ss->SetAreManagementConnectionsAllocated (
false);
418 if (
m_ss->HasServiceFlows () && !
m_ss->GetAreServiceFlowsAllocated ())
420 m_ss->GetServiceFlowManager ()->InitiateServiceFlows ();
452 bool successful =
true;
500 bool deleteUlParameters,
EventId &eventId)
503 this, eventType, deleteUlParameters), eventId);
An identifier for simulation events.
bool IsRunning(void) 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(void) const
uint8_t GetRangStatus(void) const
Cid GetBasicCid(void) const
uint32_t GetTimingAdjust(void) const
Cid GetPrimaryCid(void) const
uint32_t GetDlFreqOverride(void) const
uint8_t GetInitRangOppNumber(void) const
uint32_t GetOffsetFreqAdjust(void) const
uint32_t GetFrameNumber(void) const
uint8_t GetPowerLevelAdjust(void) const
void SetEirXPIrMax(uint16_t eir_x_p_ir_max)
Set EIRX IR maximum.
void AdjustRangingParameters(const RngRsp &rngrsp)
Adjust ranging parameters.
void DeleteUplinkParameters(void)
Delete uplink parameters.
uint8_t m_rangingBO
ranging BO
void SetBsEirp(uint16_t bs_eirp)
Set BS EIRP.
uint16_t CalculateMaxIRSignalStrength(void)
Calculate maximum IR signal strength.
uint8_t m_initRangOppNumber
Initial Ranging opportunity (1–255) in which SS transmitted the RNG_REQ.
uint16_t GetMinTransmitPowerLevel(void)
Get minimum transmit power level.
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.
RngReq m_rngreq
rng request
void PerformBackoff(void)
Perform backoff.
Ptr< SubscriberStationNetDevice > m_ss
subscriber station device
uint8_t m_contentionRangingRetries
contention ranging retries
void IncrementNrInvitedPollsRecvd(void)
Increment NR invited polls received.
void ScheduleScanningRestart(Time interval, SubscriberStationNetDevice::EventType eventType, bool deleteUlParameters, EventId &eventId)
Schedule scanning request.
uint16_t m_nrRngRspsRecvd
number rang responses received
EventId GetDlMapSyncTimeoutEvent(void)
Get DL map sync timeput event.
uint8_t m_nrRangingTransOpps
number ranging trans opps
void SendRangingRequest(uint8_t uiuc, uint16_t allocationSize)
Send ranging request.
void IncreaseRangingRequestCW(void)
Increase rnaging request CW.
void StartContentionResolution(void)
Start contention resolution.
EventId m_waitForRngRspEvent
wait for rang response event
uint16_t m_eirXPIrMax
initial ranging maximum equivalent isotropic received power at BS
void SelectRandomBackoff(void)
Select random backoff.
bool GetRangingIntervalFound(void) const
Get ranging interval found.
uint64_t m_frequency
frequency on which it is currently operating, i.e., where scanning was successful
void SetNrRangingTransOpps(uint8_t nrRangingTransOpps)
Ser NR ranging trans opps.
uint8_t m_rangingCW
ranging CW
bool IsUlChannelUsable(void)
Is UL channel usable.
void ResetRangingRequestCW(void)
Reset ranging request CW.
uint32_t m_rngReqFrameNumber
frame number in which SS sent RNG_REQ message
uint16_t m_bsEirp
BS EIRP.
bool m_isBackoffSet
is backoff set
uint8_t m_dlChnlNr
indicates the channel/frequency currently the SS is scanning
void DoDispose(void)
Destructor implementation.
void PerformRanging(Cid cid, RngRsp rngrsp)
Perform ranging.
static TypeId GetTypeId(void)
Get the type ID.
void NegotiateBasicCapabilities(void)
Negotiate basic capabilities.
WimaxNetDevice::RangingStatus m_rangingStatus
ranging status
void StartSynchronizing(void)
Start synchronizing.
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.
void SetRangingCW(uint8_t rangingCW)
Set ranging CW.
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...
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
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, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...