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
 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<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object. More...
 
template<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. 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[[maybe_unused]])
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= ([[maybe_unused]] 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:

  • "/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 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().

+ Here is the call graph for this function:

◆ 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().

+ Here is the call graph for this function:

◆ DoRepeat()

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

Repeat to send VSA frames

Definition at line 119 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:

◆ DoSendVsa()

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

References ns3::Packet::AddPacketTag(), third::channel, 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::WifiTxVector::SetChannelWidth(), ns3::WifiTxVector::SetMode(), ns3::WifiTxVector::SetPreambleType(), 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:

◆ 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().

+ Here is the call graph for this function:

◆ 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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().

+ Here is the caller graph for this function:

◆ 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()

◆ 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.

Parameters
vsaCallbackthe callback

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

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

◆ m_vsas

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

VSAs.

Definition at line 201 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 171 of file vsa-manager.h.

Referenced by SendVsa().


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