|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
24 #include "ns3/simulator.h"
25 #include "ns3/packet.h"
31 #include "ns3/pointer.h"
38 #include "ns3/buffer.h"
48 m_maxDsaRspRetries (100)
63 .SetGroupName (
"Wifi")
111 std::vector<ServiceFlow*>
134 SSRecord *ssRecord = bs->GetSSManager ()->GetSSRecord (cid);
137 NS_LOG_INFO (
"SS not registered with the BS CID:" << cid);
143 ssRecord->AddServiceFlow (serviceFlow);
146 bs->GetUplinkScheduler ()->SetupServiceFlow (ssRecord, serviceFlow);
151 if (ssRecord->GetDsaRspRetries () == 0)
153 dsaRsp =
CreateDsaRsp (serviceFlow, ssRecord->GetSfTransactionId ());
155 ssRecord->SetDsaRsp (dsaRsp);
165 NS_LOG_DEBUG (
"Service flows could not be initialized!");
169 ssRecord->IncrementDsaRspRetries ();
192 SSRecord *ssRecord = bs->GetSSManager ()->GetSSRecord (cid);
194 NS_LOG_INFO (
"BsServiceFlowManager: Processing DSA-REQ...");
195 if (ssRecord->GetSfTransactionId () != 0)
199 "Error while processing DSA request:the received transaction ID is not expected");
207 transportConnection = BsConManager->CreateConnection (
Cid::TRANSPORT);
209 transportConnection->SetServiceFlow (serviceFlow);
216 NS_LOG_INFO (
"BsServiceFlowManager: Creating a new Service flow: SFID = " << serviceFlow->
GetSfid () <<
" CID = "
217 << serviceFlow->
GetCid ());
235 bs->GetUplinkScheduler ()->SetupServiceFlow (0, serviceFlow);
245 NS_LOG_INFO (
"No service Flow. Could not connect.");
253 SSRecord *ssRecord = bs->GetSSManager ()->GetSSRecord (cid);
260 ssRecord->SetDsaRspRetries (0);
261 ssRecord->SetSfTransactionId (0);
266 ssRecord->SetAreServiceFlowsAllocated (
true);
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void AllocateServiceFlows(const DsaReq &dsaReq, Cid cid)
allocate service flows
void SetUnsolicitedGrantInterval(uint16_t unsolicitedGrantInterval)
Set unsolicied grant interval.
uint8_t GetMaxDsaRspRetries(void) const
uint16_t GetTransactionId(void) const
An identifier for simulation events.
void AddHeader(const Header &header)
Add header to this packet.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint16_t GetCid(void) const
Get CID.
CsParameters GetConvergenceSublayerParam(void) const
Get convergence sublayer.
Mac Management messages Section 6.3.2.3 MAC Management messages page 42, Table 14 page 43.
void SetMaxDsaRspRetries(uint8_t maxDsaRspRetries)
set the maximum Dynamic ServiceFlow Add (DSA) retries
@ CONFIRMATION_CODE_SUCCESS
Cid m_inuseScheduleDsaRspCid
in use schedule DSA response CID
The same service flow manager class serves both for BS and SS though some functions are exclusive to ...
void SetType(enum Type type)
Set type of service flow.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
EventId m_dsaAckTimeoutEvent
DSA ack timeout event.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
ServiceFlow * ProcessDsaReq(const DsaReq &dsaReq, Cid cid)
process a DSA-Req message
Smart pointer class similar to boost::intrusive_ptr.
This class implements the DSA-REQ message described by "IEEE Standard for Local and metropolitan area...
void SetConvergenceSublayerParam(CsParameters csparam)
Set convergence sublayer parameters.
bool IsRunning(void) const
This method is syntactic sugar for !IsExpired().
ModulationType
ModulationType enumeration.
DsaRsp CreateDsaRsp(const ServiceFlow *serviceFlow, uint16_t transactionId)
Create DSA response function.
This class implements the DSA-ACK message described by "IEEE Standard for Local and metropolitan area...
void SetUnsolicitedPollingInterval(uint16_t unsolicitedPollingInterval)
Set unsolicited polling interval.
ServiceFlow GetServiceFlow(void) const
void SetConnection(Ptr< WimaxConnection > connection)
Set connection.
static Cid InitialRanging(void)
This class is used by the base station to store some information related to subscriber station in the...
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 ScheduleDsaRsp(ServiceFlow *serviceFlow, Cid cid)
Create DSA response function.
std::vector< ServiceFlow * > GetServiceFlows(ServiceFlow::SchedulingType schedulingType) const
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
static TypeId GetTypeId(void)
Register this type.
void CopyParametersFrom(ServiceFlow sf)
Copy parameters from another service flow.
This class implements the DSA-RSP message described by "IEEE Standard for Local and metropolitan ar...
ServiceFlow * GetServiceFlow(uint32_t sfid) const
Get service flow by flow id.
uint32_t m_sfidIndex
SFID index.
void SetIsMulticast(bool isMulticast)
Set is multicast.
uint8_t m_maxDsaRspRetries
maximum number of DSA response retries
bool AreServiceFlowsAllocated()
#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 DoDispose(void)
Destructor implementation.
void DoDispose(void)
Destructor implementation.
enum Direction GetDirection(void) const
Get direction.
Ptr< WimaxNetDevice > m_device
the device
BsServiceFlowManager(Ptr< BaseStationNetDevice > device)
Constructor.
void AddMulticastServiceFlow(ServiceFlow sf, enum WimaxPhy::ModulationType modulation)
add a multicast service flow
std::vector< ServiceFlow * > GetServiceFlows(enum ServiceFlow::SchedulingType schedulingType) const
Get service flows function.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
void AddServiceFlow(ServiceFlow *serviceFlow)
Add a new service flow.
uint16_t GetTransactionId(void) const
Get transaction ID field.
ServiceFlow * GetServiceFlow(uint32_t sfid) const
void SetConfirmationCode(uint16_t confirmationCode)
set the confirmation code
void SetIsEnabled(bool isEnabled)
Set is enabled flag.
SchedulingType
section 11.13.11 Service flow scheduling type, page 701
void ProcessDsaAck(const DsaAck &dsaAck, Cid cid)
process a DSA-ACK message
void AddServiceFlow(ServiceFlow *serviceFlow)
Add service flow function.
void SetModulation(enum WimaxPhy::ModulationType modulationType)
Set modulation.
EventId GetDsaAckTimeoutEvent(void) const
This class implements service flows as described by the IEEE-802.16 standard.
~BsServiceFlowManager(void)
void SetServiceFlow(ServiceFlow sf)
specify a service flow to be requested by this message
void SetTransactionId(uint16_t transactionId)
set the transaction ID
uint32_t GetSfid(void) const
Get SFID.