A Discrete-Event Network Simulator
API
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
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:

Classes

struct  VsaWork
 VsaWork structure. More...
 

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)
 set wave vsa callback function More...
 
- 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
 Get the most derived TypeId for this Object. 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 ()
 Default 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 operator. 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)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. 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
 the device More...
 
Callback< bool, Ptr< const Packet >, const Address &, uint32_t, uint32_t > m_vsaReceived
 VSA received callback. More...
 
std::vector< VsaWork * > m_vsas
 VSAs. More...
 

Static Private Attributes

static const uint32_t VSA_REPEAT_PERIOD = 5
 A number of VSA frames will be transmitted repeatedly during the period of 5s. More...
 

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:

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 119 of file vsa-manager.h.

Constructor & Destructor Documentation

◆ VsaManager()

ns3::VsaManager::VsaManager ( void  )

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

References m_vsaReceived.

◆ ~VsaManager()

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

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

Member Function Documentation

◆ DoDispose()

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 overridden 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 60 of file vsa-manager.cc.

References m_device, NS_LOG_FUNCTION, and RemoveAll().

◆ DoInitialize()

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 68 of file vsa-manager.cc.

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

◆ DoRepeat()

void ns3::VsaManager::DoRepeat ( VsaWork vsa)
private

◆ DoSendVsa()

void ns3::VsaManager::DoSendVsa ( enum VsaTransmitInterval  interval,
uint32_t  channel,
Ptr< Packet vsc,
OrganizationIdentifier  oi,
Mac48Address  peer 
)
private

◆ GetTypeId()

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

Get the type ID.

Returns
the object TypeId

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

References ns3::TypeId::SetParent().

◆ ReceiveVsc()

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
Returns
true if successful

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

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

Referenced by DoInitialize().

◆ RemoveAll()

void ns3::VsaManager::RemoveAll ( void  )

cancel all VSA transmissions

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

References m_vsas, and NS_LOG_FUNCTION.

Referenced by DoDispose().

◆ RemoveByChannel()

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

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

References m_vsas, and NS_LOG_FUNCTION.

◆ RemoveByOrganizationIdentifier()

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

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

References m_vsas, and NS_LOG_FUNCTION.

◆ SendVsa()

void ns3::VsaManager::SendVsa ( const VsaInfo vsaInfo)

◆ SetWaveNetDevice()

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

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

References m_device, and NS_LOG_FUNCTION.

◆ SetWaveVsaCallback()

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

set wave vsa callback function

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

References m_vsaReceived, and NS_LOG_FUNCTION.

Member Data Documentation

◆ m_device

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

the device

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

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

◆ m_vsaReceived

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

VSA received callback.

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

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

◆ m_vsas

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

VSAs.

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

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

◆ VSA_REPEAT_PERIOD

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

A number of VSA frames will be transmitted repeatedly during the period of 5s.

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

Referenced by SendVsa().


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