refer to 1609.4-2010 chapter 6.4 Vendor Specific Action (VSA) frames transmission. More...
#include "vsa-manager.h"
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< Object > | GetObject () 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< Object > | GetObject (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... | |
SimpleRefCount & | operator= ([[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< WaveNetDevice > | m_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... | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
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.
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.
ns3::VsaManager::VsaManager | ( | void | ) |
Definition at line 48 of file vsa-manager.cc.
References m_vsaReceived.
|
virtual |
Definition at line 54 of file vsa-manager.cc.
|
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().
|
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().
|
private |
vsa | the 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().
|
private |
interval | the specific channel interval for VSA transmission |
channel | the specific channel number for VSA transmission |
vsc | the data field of VSA frame that contains vendor specific content |
oi | the Organization Identifier for VSA frame |
peer | the 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().
|
static |
Get the type ID.
Definition at line 38 of file vsa-manager.cc.
References ns3::TypeId::SetParent().
|
private |
mac | the MAC entity which receives VSA frame |
oi | the Organization Identifier of received VSA frame |
vsc | the vendor specific content of received VSA frame |
src | the source address of received VSA frame |
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().
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().
void ns3::VsaManager::RemoveByChannel | ( | uint32_t | channelNumber | ) |
channelNumber | cancel VSA transmission specified by channel number |
Definition at line 209 of file vsa-manager.cc.
References m_vsas, and NS_LOG_FUNCTION.
void ns3::VsaManager::RemoveByOrganizationIdentifier | ( | const OrganizationIdentifier & | oi | ) |
oi | cancel VSA transmission specified by organization identifier |
Definition at line 234 of file vsa-manager.cc.
References m_vsas, and NS_LOG_FUNCTION.
void ns3::VsaManager::SendVsa | ( | const VsaInfo & | vsaInfo | ) |
vsaInfo | the tx information for VSA transmissions |
Definition at line 85 of file vsa-manager.cc.
References ns3::VsaInfo::channelNumber, ns3::VsaManager::VsaWork::channelNumber, ns3::Packet::Copy(), DoRepeat(), DoSendVsa(), ns3::Mac48Address::IsGroup(), ns3::OrganizationIdentifier::IsNull(), m_vsas, ns3::VsaInfo::managementId, ns3::MilliSeconds(), NS_LOG_FUNCTION, ns3::VsaInfo::oi, ns3::VsaManager::VsaWork::oi, ns3::VsaInfo::peer, ns3::VsaManager::VsaWork::peer, ns3::VsaManager::VsaWork::repeat, ns3::VsaManager::VsaWork::repeatPeriod, ns3::VsaInfo::repeatRate, ns3::Simulator::Schedule(), ns3::VsaInfo::sendInterval, ns3::VsaManager::VsaWork::sentInterval, VSA_REPEAT_PERIOD, ns3::VsaInfo::vsc, and ns3::VsaManager::VsaWork::vsc.
void ns3::VsaManager::SetWaveNetDevice | ( | Ptr< WaveNetDevice > | device | ) |
device | WaveNetDevice associated with VsaManager |
Definition at line 78 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 | ) |
Set wave vsa callback function.
vsaCallback | the callback |
Definition at line 258 of file vsa-manager.cc.
References m_vsaReceived, and NS_LOG_FUNCTION.
|
private |
the device
Definition at line 202 of file vsa-manager.h.
Referenced by DoDispose(), DoInitialize(), DoSendVsa(), and SetWaveNetDevice().
|
private |
VSA received callback.
Definition at line 200 of file vsa-manager.h.
Referenced by VsaManager(), ReceiveVsc(), and SetWaveVsaCallback().
|
private |
VSAs.
Definition at line 201 of file vsa-manager.h.
Referenced by RemoveAll(), RemoveByChannel(), RemoveByOrganizationIdentifier(), and SendVsa().
|
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().