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