A Discrete-Event Network Simulator
API
ns3::VsaManager Class Reference

refer to 1609.4-2010 chapter 6.4 Vendor Specific Action (VSA) frames transmission. More...

#include "vsa-manager.h"

+ Inheritance diagram for ns3::VsaManager:
+ Collaboration diagram for ns3::VsaManager:

Classes

struct  VsaWork
 

Public Member Functions

 VsaManager (void)
 
virtual ~VsaManager (void)
 
void RemoveAll (void)
 cancel all VSA transmissions More...
 
void RemoveByChannel (uint32_t channelNumber)
 
void RemoveByOrganizationIdentifier (const OrganizationIdentifier &oi)
 
void SendVsa (const VsaInfo &vsaInfo)
 
void SetWaveNetDevice (Ptr< WaveNetDevice > device)
 
void SetWaveVsaCallback (Callback< bool, Ptr< const Packet >, const Address &, uint32_t, uint32_t > vsaCallback)
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose (void)
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator (void) const
 Get an iterator to the Objects aggregated to this one. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Implement the GetInstanceTypeId method defined in ObjectBase. More...
 
template<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
void Initialize (void)
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized (void) const
 Check if the object has been initialized. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising erros. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
static void Cleanup (void)
 Noop. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Member Functions

void DoDispose (void)
 Destructor implementation. More...
 
void DoInitialize (void)
 Initialize() implementation. More...
 
void DoRepeat (VsaWork *vsa)
 
void DoSendVsa (enum VsaTransmitInterval interval, uint32_t channel, Ptr< Packet > vsc, OrganizationIdentifier oi, Mac48Address peer)
 
bool ReceiveVsc (Ptr< WifiMac > mac, const OrganizationIdentifier &oi, Ptr< const Packet > vsc, const Address &src)
 

Private Attributes

Ptr< WaveNetDevicem_device
 
Callback< bool, Ptr< const Packet >, const Address &, uint32_t, uint32_t > m_vsaReceived
 
std::vector< VsaWork * > m_vsas
 

Static Private Attributes

static const uint32_t VSA_REPEAT_PERIOD = 5
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void NotifyNewAggregate (void)
 Notify all Objects aggregated to this one of a new Object being aggregated. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted (void)
 Notifier called once the ObjectBase is fully constructed. More...
 

Detailed Description

refer to 1609.4-2010 chapter 6.4 Vendor Specific Action (VSA) frames transmission.

The channel interval and channel number indicating how to transmit VSA frames. However making the VSA transmitted strictly in required channel interval and channel number is hard to achieve. For example, if current channel is assigned “Alternating Access” and higher layer wants VSA transmitted only in CCHI (VSA_TRANSMIT_IN_CCHI), but when packet is dequeued from the internal queue of MAC layer in SCHI and can contend for channel access, how to deal with this case? Reinserting into the head of the queue and dequeuing the second packet is not a good choice, because it will require queue traversal. Reinserting the packet into the tail of the queue is worse, because it will make queue not in order. And both solutions may affect many MAC classes of Wifi module. Current approach is to guarantee packets can be inserted into the MAC internal queue strictly in channel interval and channel number required by higher layers. This solution will result in high probability that packets will be sent in channel interval as higher layer wants, while some packet may be sent practically in other channel interval that not follows the requirement of higher layer request due to queue delay of MAC layer. Therefore, we suggest users assign alternating access for sending VSAs in CCH Interval (VSA_TRANSMIT_IN_CCHI) or SCH Interval (VSA_TRANSMIT_IN_SCHI), and assign continuous access or extended access for sending VSAs in both interval (VSA_TRANSMIT_IN_BOTHI) to avoid the above cases.

Config Paths

ns3::VsaManager is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/DeviceList/[i]/$ns3::WaveNetDevice/VsaManager"

No Attributes are defined for this type.
No TraceSources are defined for this type.
Size of this type is 72 bytes (on a 64-bit architecture).

Definition at line 104 of file vsa-manager.h.

Constructor & Destructor Documentation

ns3::VsaManager::VsaManager ( void  )

Definition at line 46 of file vsa-manager.cc.

References m_vsaReceived.

ns3::VsaManager::~VsaManager ( void  )
virtual

Definition at line 52 of file vsa-manager.cc.

Member Function Documentation

void ns3::VsaManager::DoDispose ( void  )
privatevirtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overriden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 58 of file vsa-manager.cc.

References m_device, NS_LOG_FUNCTION, and RemoveAll().

+ Here is the call graph for this function:

void ns3::VsaManager::DoInitialize ( void  )
privatevirtual

Initialize() implementation.

This method is called only once by Initialize(). If the user calls Initialize() multiple times, DoInitialize() is called only the first time.

Subclasses are expected to override this method and chain up to their parent's implementation once they are done. It is safe to call GetObject() and AggregateObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 66 of file vsa-manager.cc.

References ns3::WaveNetDevice::GetMacs(), m_device, ns3::MakeCallback(), and ReceiveVsc().

+ Here is the call graph for this function:

void ns3::VsaManager::DoRepeat ( VsaWork vsa)
private
Parameters
vsathe specific VSA repeat work

Repeat to send VSA frames

Definition at line 117 of file vsa-manager.cc.

References ns3::VsaManager::VsaWork::channelNumber, ns3::Packet::Copy(), DoSendVsa(), NS_LOG_FUNCTION, ns3::VsaManager::VsaWork::oi, ns3::VsaManager::VsaWork::peer, ns3::VsaManager::VsaWork::repeat, ns3::VsaManager::VsaWork::repeatPeriod, ns3::Simulator::Schedule(), ns3::VsaManager::VsaWork::sentInterval, and ns3::VsaManager::VsaWork::vsc.

Referenced by SendVsa().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::VsaManager::DoSendVsa ( enum VsaTransmitInterval  interval,
uint32_t  channel,
Ptr< Packet vsc,
OrganizationIdentifier  oi,
Mac48Address  peer 
)
private
Parameters
intervalthe specific channel interval for VSA transmission
channelthe specific channel number for VSA transmission
vscthe data field of VSA frame that contains vendor specific content
oithe Organization Identifier for VSA frame
peerthe destination address

Definition at line 125 of file vsa-manager.cc.

References ns3::Packet::AddPacketTag(), ns3::WaveNetDevice::GetChannelCoordinator(), ns3::WaveNetDevice::GetChannelManager(), ns3::WaveNetDevice::GetChannelScheduler(), ns3::WaveNetDevice::GetMac(), m_device, third::mac, ns3::ChannelCoordinator::NeedTimeToCchInterval(), ns3::ChannelCoordinator::NeedTimeToSchInterval(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), ns3::Seconds(), ns3::OcbWifiMac::SendVsc(), ns3::WifiTxVector::SetChannelWidth(), ns3::WifiTxVector::SetMode(), ns3::SocketPriorityTag::SetPriority(), ns3::WifiTxVector::SetTxPowerLevel(), ns3::VSA_TRANSMIT_IN_BOTHI, ns3::VSA_TRANSMIT_IN_CCHI, and ns3::VSA_TRANSMIT_IN_SCHI.

Referenced by DoRepeat(), and SendVsa().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TypeId ns3::VsaManager::GetTypeId ( void  )
static

Definition at line 36 of file vsa-manager.cc.

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

bool ns3::VsaManager::ReceiveVsc ( Ptr< WifiMac mac,
const OrganizationIdentifier oi,
Ptr< const Packet vsc,
const Address src 
)
private
Parameters
macthe MAC entity which receives VSA frame
oithe Organization Identifier of received VSA frame
vscthe vendor specific content of received VSA frame
srcthe source address of received VSA frame

Definition at line 262 of file vsa-manager.cc.

References ns3::OrganizationIdentifier::GetManagementId(), m_vsaReceived, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by DoInitialize().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::VsaManager::RemoveAll ( void  )

cancel all VSA transmissions

Definition at line 189 of file vsa-manager.cc.

References m_vsas, and NS_LOG_FUNCTION.

Referenced by DoDispose().

+ Here is the caller graph for this function:

void ns3::VsaManager::RemoveByChannel ( uint32_t  channelNumber)
Parameters
channelNumbercancel VSA transmission specified by channel number

Definition at line 206 of file vsa-manager.cc.

References m_vsas, and NS_LOG_FUNCTION.

void ns3::VsaManager::RemoveByOrganizationIdentifier ( const OrganizationIdentifier oi)
Parameters
channelNumbercancel VSA transmission specified by organization identifier

Definition at line 231 of file vsa-manager.cc.

References m_vsas, and NS_LOG_FUNCTION.

void ns3::VsaManager::SetWaveNetDevice ( Ptr< WaveNetDevice device)
Parameters
deviceWaveNetDevice associated with VsaManager

Definition at line 76 of file vsa-manager.cc.

References m_device, and NS_LOG_FUNCTION.

void ns3::VsaManager::SetWaveVsaCallback ( Callback< bool, Ptr< const Packet >, const Address &, uint32_t, uint32_t >  vsaCallback)

Definition at line 255 of file vsa-manager.cc.

References m_vsaReceived, and NS_LOG_FUNCTION.

Member Data Documentation

Ptr<WaveNetDevice> ns3::VsaManager::m_device
private

Definition at line 177 of file vsa-manager.h.

Referenced by DoDispose(), DoInitialize(), DoSendVsa(), and SetWaveNetDevice().

Callback<bool, Ptr<const Packet>,const Address &, uint32_t, uint32_t> ns3::VsaManager::m_vsaReceived
private

Definition at line 175 of file vsa-manager.h.

Referenced by ReceiveVsc(), SetWaveVsaCallback(), and VsaManager().

std::vector<VsaWork *> ns3::VsaManager::m_vsas
private

Definition at line 176 of file vsa-manager.h.

Referenced by RemoveAll(), RemoveByChannel(), RemoveByOrganizationIdentifier(), and SendVsa().

const uint32_t ns3::VsaManager::VSA_REPEAT_PERIOD = 5
staticprivate

Definition at line 147 of file vsa-manager.h.

Referenced by SendVsa().


The documentation for this class was generated from the following files: