refer to 1609.4-2010 chapter 6.4 Vendor Specific Action (VSA) frames transmission. More...
#include "vsa-manager.h"
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) |
![]() | |
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... | |
![]() | |
SimpleRefCount () | |
Constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
![]() | |
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 TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
static void | Cleanup (void) |
Noop. More... | |
![]() | |
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 |
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 | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
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 104 of file vsa-manager.h.
ns3::VsaManager::VsaManager | ( | void | ) |
Definition at line 46 of file vsa-manager.cc.
References m_vsaReceived.
|
virtual |
Definition at line 52 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 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().
|
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().
|
private |
vsa | the 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().
|
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 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().
|
static |
Definition at line 36 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 262 of file vsa-manager.cc.
References ns3::OrganizationIdentifier::GetManagementId(), m_vsaReceived, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by DoInitialize().
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().
void ns3::VsaManager::RemoveByChannel | ( | uint32_t | channelNumber | ) |
channelNumber | cancel 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 | ) |
channelNumber | cancel 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::SendVsa | ( | const VsaInfo & | vsaInfo | ) |
vsaInfo | the tx information for VSA transmissions |
Definition at line 83 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 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.
|
private |
Definition at line 177 of file vsa-manager.h.
Referenced by DoDispose(), DoInitialize(), DoSendVsa(), and SetWaveNetDevice().
|
private |
Definition at line 175 of file vsa-manager.h.
Referenced by ReceiveVsc(), SetWaveVsaCallback(), and VsaManager().
|
private |
Definition at line 176 of file vsa-manager.h.
Referenced by RemoveAll(), RemoveByChannel(), RemoveByOrganizationIdentifier(), and SendVsa().
|
staticprivate |
Definition at line 147 of file vsa-manager.h.
Referenced by SendVsa().