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);
void SetMacAddress(Mac48Address macAddress)
Set MAC address field.
Simulation virtual time values and global simulation resolution.
Smart pointer class similar to boost::intrusive_ptr.
void SetReqDlBurstProfile(uint8_t reqDlBurstProfile)
Set request DL burst profile field.
uint16_t m_eirXPIrMax
initial ranging maximum equivalent isotropic received power at BS
uint16_t m_nrRngReqsSent
number rang requests sent
Ptr< SubscriberStationNetDevice > m_ss
subscriber station device
This class implements the ranging response message described by "IEEE Standard for Local and metropol...
void ResetRangingRequestCW(void)
Reset ranging request CW.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
WimaxNetDevice::RangingStatus m_rangingStatus
ranging status
Mac Management messages Section 6.3.2.3 MAC Management messages page 42, Table 14 page 43...
void ScheduleScanningRestart(Time interval, SubscriberStationNetDevice::EventType eventType, bool deleteUlParameters, EventId &eventId)
Schedule scanning request.
EventId m_waitForRngRspEvent
wait for rang response event
void SetBsEirp(uint16_t bs_eirp)
Set BS EIRP.
uint8_t m_contentionRangingRetries
contention ranging retries
SSLinkManager(Ptr< SubscriberStationNetDevice > ss)
Constructor.
void StartSynchronizing(void)
Start synchronizing.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
bool GetRangingIntervalFound(void) const
Get ranging interval found.
uint16_t CalculateMaxIRSignalStrength(void)
Calculate maximum IR signal strength.
void StartScanning(SubscriberStationNetDevice::EventType type, bool deleteParameters)
Start scanning.
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 !IsExpired().
uint32_t GetDlFreqOverride(void) const
void DoDispose(void)
Destructor implementation.
void PerformRanging(Cid cid, RngRsp rngrsp)
Perform ranging.
uint8_t m_nrRangingTransOpps
number ranging trans opps
void AdjustRangingParameters(const RngRsp &rngrsp)
Adjust ranging parameters.
uint16_t m_nrRngRspsRecvd
number rang responses received
uint8_t GetInitRangOppNumber(void) const
uint8_t m_initRangOppNumber
Initial Ranging opportunity (1–255) in which SS transmitted the RNG_REQ.
uint32_t GetTimingAdjust(void) const
RangingStatus
RangingStatus enumeration.
void SendRangingRequest(uint8_t uiuc, uint16_t allocationSize)
Send ranging request.
NS_ASSERT_MSG(false,"Ipv4AddressGenerator::MaskToIndex(): Impossible")
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
void PerformBackoff(void)
Perfrom backoff.
uint8_t m_rangingAnomalies
ranging anomalies
bool IsUlChannelUsable(void)
Is UL channel usable.
This class implements the UCD message as described by "IEEE Standard for Local and metropolitan area ...
Cid GetBasicCid(void) const
void SetRangingCW(uint8_t rangingCW)
Set ranging CW.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
uint16_t m_nrInvitedPollsRecvd
number invited polls received
void NegotiateBasicCapabilities(void)
Negotiate basic capabilities.
uint8_t m_dlChnlNr
indicates the channel/frequency currently the SS is scanning
void SelectRandomBackoff(void)
Select random backoff.
uint16_t m_pTxIrMax
maximum transmit signal strength for initial ranging calculated by SS
uint8_t GetRangStatus(void) const
void StartContentionResolution(void)
Start contention resolution.
Hold together all WiMAX-related objects in a NetDevice.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetNrRangingTransOpps(uint8_t nrRangingTransOpps)
Ser NR ranging trans opps.
uint32_t GetFrameNumber(void) const
void SetEirXPIrMax(uint16_t eir_x_p_ir_max)
Set EIRX IR maximum.
uint32_t m_rngReqFrameNumber
frame number in which SS sent RNG_REQ message
void IncreaseRangingRequestCW(void)
Increase rnaging request CW.
void SetRangingIntervalFound(bool rangingIntervalFound)
Set ranging interval found.
Mac48Address GetMacAddress(void) const
uint16_t GetMinTransmitPowerLevel(void)
Get minimum transmit power level.
uint64_t m_frequency
frequency on which it is currently operating, i.e., where scanning was successful ...
void IncrementNrInvitedPollsRecvd(void)
Increment NR invited polls received.
uint8_t m_rangingCW
ranging CW
uint8_t GetPowerLevelAdjust(void) const
bool m_isBackoffSet
is backoff set
void DeleteUplinkParameters(void)
Delete uplink parameters.
An identifier for simulation events.
EventId GetDlMapSyncTimeoutEvent(void)
Get DL map sync timeput event.
Time Seconds(double value)
Construct a Time in the indicated unit.
static TypeId GetTypeId(void)
Get the type ID.
EventType
EventType enumeration.
Cid GetPrimaryCid(void) const
uint8_t m_rangingBO
ranging BO
uint32_t GetOffsetFreqAdjust(void) const
void EndScanning(bool status, uint64_t frequency)
End scanning.
RngReq m_rngreq
rng request
A base class which provides memory management and object aggregation.
EventId m_dlMapSyncTimeoutEvent
DL map sync timeout event.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
uint16_t m_bsEirp
BS EIRP.
void AddHeader(const Header &header)
Add header to this packet.
void SetRangingAnomalies(uint8_t rangingAnomalies)
Set ranging anomalies field.
bool m_rangingIntervalFound
ranging interval found