19#include "ns3/simulator.h"
20#include "ns3/uinteger.h"
34 : m_windowInterval(time)
51 .SetGroupName(
"Wimax")
53 .AddAttribute(
"WindowInterval",
54 "The time to wait to reset window",
84 if (
randNr % 5 == 0 ||
GetBs()->GetNrDcdSent() == 0)
90 if (
randNr % 5 == 0 ||
GetBs()->GetNrUcdSent() == 0)
135 return GetBs()->GetNrDlSymbols() *
GetBs()->GetPhy()->GetPsPerSymbol() +
GetBs()->GetTtg();
158 if (!
GetBs()->GetSSManager())
164 std::vector<SSRecord*>*
ssRecords =
GetBs()->GetSSManager()->GetSSRecords();
183 if ((
serviceFlow->GetRecord()->GetBacklogged() > 0) &&
191 (
serviceFlow->GetRecord()->GetBwSinceLastExpiry()))
223 std::vector<SSRecord*>*
ssRecords =
GetBs()->GetSSManager()->GetSSRecords();
236 if (
ssRecord->GetPollForRanging() &&
259 ulMapIe.SetUiuc(
GetBs()->GetBurstProfileManager()->GetBurstProfile(
265 !
ssRecord->GetAreServiceFlowsAllocated())
304 if (
ssRecord->GetHasServiceFlowUgs())
307 <<
" offering be unicast polling");
313 ->GetLastGrantTime() +
316 ->GetUnsolicitedGrantInterval());
335 if (
ssRecord->GetHasServiceFlowRtps())
338 <<
" offering rtps unicast polling");
344 if (
ssRecord->GetHasServiceFlowNrtps())
347 <<
" offering nrtps unicast polling");
354 if (
ssRecord->GetHasServiceFlowBe())
357 <<
" offering be unicast polling");
458 NS_FATAL_ERROR(
"Intermediate priority queue only should enqueue data packets.");
492 NS_FATAL_ERROR(
"Low priority queue only should enqueue data packets.");
505 GetBs()->GetBandwidthManager()->SetSubframeRatio();
538 <<
", CID: " <<
serviceFlow->GetConnection()->GetCid()
540 <<
", bw requested: " <<
record->GetRequestedBandwidth()
610 record->GetRequestedBandwidth() -
record->GetGrantedBandwidth();
686 <<
job->GetServiceFlow()->GetMinReservedTrafficRate()
688 <<
" frame start: " <<
GetBs()->m_frameStartTime.As(
Time::S)
698 job->GetSsRecord()->GetModulationType());
712 job->GetSsRecord()->GetModulationType());
718 job->GetSsRecord()->GetModulationType());
726 newJob->SetServiceFlow(
job->GetServiceFlow());
729 newJob->SetReleaseTime(
job->GetReleaseTime());
730 newJob->SetSchedulingType(
job->GetSchedulingType());
763 std::vector<SSRecord*>*
ssRecords =
GetBs()->GetSSManager()->GetSSRecords();
902 <<
", modulation: BPSK 1/2");
973 <<
", CID: " <<
serviceFlow->GetConnection()->GetCid()
975 <<
", bw requested: " <<
record->GetRequestedBandwidth()
976 <<
", bw granted: " <<
record->GetGrantedBandwidth());
1015 GetBs()->GetInitialRangingInterval() &&
1024 NS_LOG_DEBUG(
"BS uplink scheduler, initial ranging allocation, size: "
1026 <<
", modulation: BPSK 1/2");
1031 GetBs()->MarkRangingOppStart(
1035 GetBs()->GetSymbolDuration().GetSeconds()));
1075 serviceFlow->SetUnsolicitedGrantInterval(interval);
1084 uint16_t interval = 1000;
1085 serviceFlow->SetUnsolicitedPollingInterval(interval);
1112 size +=
job->GetSize();
1150 <<
" at BS uplink scheduler, processing bandwidth request from."
1151 <<
ssRecord->GetMacAddress() <<
" and sf "
1152 <<
serviceFlow->GetSchedulingType() <<
" with deadline in "
1163 job->SetPeriod(period);
This class implements the bandwidth-request mac Header as described by IEEE Standard for Local and me...
This class implements the DSA-REQ message described by "IEEE Standard for Local and metropolitan area...
This class implements the UL-MAP_IE message as described by "IEEE Standard for Local and metropolitan...
void SetCid(const Cid &cid)
Set CID.
Smart pointer class similar to boost::intrusive_ptr.
This class is used by the base station to store some information related to subscriber station in the...
std::vector< ServiceFlow * > GetServiceFlows(ServiceFlow::SchedulingType schedulingType) const
Get service flows.
This class implements service flows as described by the IEEE-802.16 standard.
SchedulingType
section 11.13.11 Service flow scheduling type, page 701
ServiceFlowRecord * GetRecord() const
Get service flow record.
this class implements a structure to manage some parameters and statistics related to a service flow
void SetBackloggedTemp(uint32_t backloggedTemp)
set temporary back logged
void UpdateBwSinceLastExpiry(uint32_t bwSinceLastExpiry)
update BW since last expiry
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static Time Now()
Return the current simulation virtual time.
Simulation virtual time values and global simulation resolution.
TimeWithUnit As(const Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
AttributeValue implementation for Time.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
JobPriority
Job priority enumeration.
Virtual class for uplink scheduler.
virtual void SetUcdTimeStamp(Time ucdTimeStamp)
Set UCD timestamp.
virtual void SetDcdTimeStamp(Time dcdTimeStamp)
Set DCD timestamp.
virtual void SetNrIrOppsAllocated(uint8_t nrIrOppsAllocated)
Set the number of IR opps allocated.
virtual void SetBs(Ptr< BaseStationNetDevice > bs)
Set base station device.
virtual void SetIsIrIntrvlAllocated(bool isIrIntrvlAllocated)
Set if the IR interval is allocated.
virtual uint8_t GetNrIrOppsAllocated() const
virtual void SetIsInvIrIntrvlAllocated(bool isInvIrIntrvlAllocated)
Set if the Inv IR interval is allocated.
virtual Time GetTimeStampIrInterval()
virtual Time GetDcdTimeStamp() const
virtual void SetTimeStampIrInterval(Time timeStampIrInterval)
Set timestamp IR interval.
virtual Ptr< BaseStationNetDevice > GetBs()
virtual Time GetUcdTimeStamp() const
void InitOnce() override
This method is called once to initialize window.
uint32_t CountSymbolsQueue(std::list< Ptr< UlJob > > jobs)
~UplinkSchedulerMBQoS() override
Ptr< UlJob > CreateUlJob(SSRecord *ssRecord, ServiceFlow::SchedulingType schedType, ReqType reqType)
void CheckDeadline(uint32_t &availableSymbols)
Check deadline from jobs. Migrate requests if necessary.
void OnSetRequestedBandwidth(ServiceFlowRecord *sfr) override
Set requested bandwidth.
std::list< Ptr< UlJob > > m_uplinkJobs_inter
uplink jobs intermedite priority
std::list< Ptr< UlJob > > m_uplinkJobs_low
uplink jobs low priority
bool ServiceBandwidthRequestsBytes(ServiceFlow *serviceFlow, ServiceFlow::SchedulingType schedulingType, OfdmUlMapIe &ulMapIe, const WimaxPhy::ModulationType modulationType, uint32_t &symbolsToAllocation, uint32_t &availableSymbols, uint32_t allocationSizeBytes)
Service bandwidth requests bytes.
std::list< OfdmUlMapIe > GetUplinkAllocations() const override
Get uplink allocations.
uint32_t CountSymbolsJobs(Ptr< UlJob > job)
void GetChannelDescriptorsToUpdate(bool &updateDcd, bool &updateUcd, bool &sendDcd, bool &sendUcd) override
Determines if channel descriptors sent in the current frame are required to be updated.
void ServiceUnsolicitedGrants(const SSRecord *ssRecord, ServiceFlow::SchedulingType schedulingType, OfdmUlMapIe &ulMapIe, const WimaxPhy::ModulationType modulationType, uint32_t &symbolsToAllocation, uint32_t &availableSymbols) override
Service unsolicited grants.
Time m_windowInterval
windows interval
void ProcessBandwidthRequest(const BandwidthRequestHeader &bwRequestHdr) override
Process bandwidth request function.
void AllocateInitialRangingInterval(uint32_t &symbolsToAllocation, uint32_t &availableSymbols) override
Allocate initial ranging interval.
void ServiceBandwidthRequests(const SSRecord *ssRecord, ServiceFlow::SchedulingType schedulingType, OfdmUlMapIe &ulMapIe, const WimaxPhy::ModulationType modulationType, uint32_t &symbolsToAllocation, uint32_t &availableSymbols) override
Service bandwidth requests.
Ptr< UlJob > DequeueJob(UlJob::JobPriority priority)
Dequeue a job from a priority queue.
uint32_t CalculateAllocationStartTime() override
Calculate allocation start time.
void Schedule() override
Schedule function.
std::list< Ptr< UlJob > > m_uplinkJobs_high
uplink jobs high priority
uint32_t GetPendingSize(ServiceFlow *serviceFlow)
void EnqueueJob(UlJob::JobPriority priority, Ptr< UlJob > job)
Enqueue a job in a priority queue.
Time DetermineDeadline(ServiceFlow *serviceFlow)
Calculates deadline of a request.
static TypeId GetTypeId()
Get the type ID.
void CheckMinimumBandwidth(uint32_t &availableSymbols)
Check if Minimum bandwidth is guarantee. Migrate requests if necessary.
void UplinkSchedWindowTimer()
Reset the current window.
void SetupServiceFlow(SSRecord *ssRecord, ServiceFlow *serviceFlow) override
Setup service flow.
void AddUplinkAllocation(OfdmUlMapIe &ulMapIe, const uint32_t &allocationSize, uint32_t &symbolsToAllocation, uint32_t &availableSymbols) override
Add uplink allocation.
std::list< OfdmUlMapIe > m_uplinkAllocations
uplink allocations
@ RANGING_STATUS_CONTINUE
ModulationType
ModulationType enumeration.
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#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_LOG(level, msg)
This macro allows you to log an arbitrary message at a specific log level.
#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.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
ReqType
Request type enumeration.
@ LOG_DEBUG
Full voluminous logging to support debugging.
SortProcessPtr structure.