27 #include "ns3/simulator.h"
46 .SetGroupName(
"Wimax");
71 uint32_t allocationSize = 0;
98 allocationSize = bs->GetBwReqOppSize ();
108 allocationSize = bs->GetBwReqOppSize ();
116 allocationSize = bs->GetBwReqOppSize ();
123 return allocationSize;
135 for (std::vector<ServiceFlow*>::iterator iter = serviceFlows.begin (); iter != serviceFlows.end (); ++iter)
145 bytesToRequest = serviceFlow->
GetQueue ()->GetQueueLengthWithMACOverhead ();
159 uint32_t bytesToRequest = 0;
162 if (!serviceFlow || !bytesToRequest)
173 bwRequestHdr.
SetBr (bytesToRequest);
188 ServiceFlow *serviceFlow = bs->GetConnectionManager ()->GetConnection (bwRequestHdr.
GetCid ())->GetServiceFlow ();
191 serviceFlow->GetRecord ()->UpdateRequestedBandwidth (bwRequestHdr.
GetBr ());
195 serviceFlow->GetRecord ()->SetRequestedBandwidth (bwRequestHdr.
GetBr ());
196 bs->GetUplinkScheduler ()->OnSetRequestedBandwidth (serviceFlow->GetRecord ());
198 bs->GetUplinkScheduler ()->ProcessBandwidthRequest (bwRequestHdr);
200 serviceFlow->GetRecord ()->IncreaseBacklogged (bwRequestHdr.
GetBr ());
210 uint32_t symbolsPerFrame = bs->GetPhy ()->GetSymbolsPerFrame ();
213 bs->SetNrDlSymbols (symbolsPerFrame / 2);
214 bs->SetNrUlSymbols (symbolsPerFrame / 2);
222 uint32_t allocationPerFrame = 0;
224 std::vector<SSRecord*> *ssRecords = bs->GetSSManager ()->GetSSRecords ();
225 for (std::vector<SSRecord*>::iterator iter1 = ssRecords->begin (); iter1 != ssRecords->end (); ++iter1)
230 allocationPerFrame += (*iter2)->GetRecord ()->GetGrantSize ();
233 return allocationPerFrame;
void SendBandwidthRequest(uint8_t uiuc, uint16_t allocationSize)
Send bandwidth request.
Simulation virtual time values and global simulation resolution.
Smart pointer class similar to boost::intrusive_ptr.
enum ServiceFlow::SchedulingType GetSchedulingType(void) const
Get scheduling type.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
void SetType(uint8_t type)
Set type field.
Cid GetCid(void) const
Get CID field.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void SetBr(uint32_t br)
Set BR field.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Ptr< WimaxMacQueue > GetQueue(void) const
Get pointer to queue.
uint8_t GetType(void) const
Get type field.
void DoDispose(void)
Destructor implementation.
Ptr< WimaxConnection > GetConnection(void) const
Can return a null connection is this service flow has not been associated yet to a connection...
Ptr< WimaxNetDevice > m_device
the device
static TypeId GetTypeId(void)
Get the type ID.
NS_ASSERT_MSG(false,"Ipv4AddressGenerator::MaskToIndex(): Impossible")
Time GetGrantTimeStamp(void) const
void SetGrantTimeStamp(Time grantTimeStamp)
Set the grant time stamp.
ServiceFlow * SelectFlowForRequest(uint32_t &bytesToRequest)
Select flow for request function.
void ProcessBandwidthRequest(const BandwidthRequestHeader &bwRequestHdr)
Process bandwidth request.
bool GetHasServiceFlowUgs(void) const
Check if at least one flow has scheduling type SF_TYPE_UGS.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool GetPollMeBit(void) const
Get poll ME bit.
void SetCid(Cid cid)
Set CID field.
This class implements the bandwidth-request mac Header as described by IEEE Standard for Local and me...
BandwidthManager(Ptr< WimaxNetDevice > device)
Constructor.
This class implements service flows as described by the IEEE-802.16 standard.
static Time Now(void)
Return the current simulation virtual time.
ServiceFlowRecord * GetRecord(void) const
Get service flow record.
uint16_t m_nrBwReqsSent
bandwith requests sent
uint32_t GetBr(void) const
Get BR field.
void SetSubframeRatio(void)
Set subframe ratio.
uint32_t GetGrantSize(void) const
uint32_t GetSymbolsPerFrameAllocated(void)
Get symbols per frame allocated.
SubscriberStationNetDevice subclass of WimaxNetDevice.
uint16_t GetUnsolicitedGrantInterval(void) const
Get unsolicited grant interval.
This class is used by the base station to store some information related to subscriber station in the...
A base class which provides memory management and object aggregation.
uint32_t CalculateAllocationSize(const SSRecord *ssRecord, const ServiceFlow *serviceFlow)
Calculate allocation size function.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
void AddHeader(const Header &header)
Add header to this packet.
uint16_t GetUnsolicitedPollingInterval(void) const
Get unsolicited polling interval.
bool HasPackets(void) const
Check if packets are present.