A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::dot11s::PeerManagementProtocol Class Reference

802.11s Peer Management Protocol model More...

#include "peer-management-protocol.h"

+ Inheritance diagram for ns3::dot11s::PeerManagementProtocol:
+ Collaboration diagram for ns3::dot11s::PeerManagementProtocol:

Classes

struct  BeaconInfo
 Keeps information about beacon of peer station: beacon interval, association ID, last time we have received a beacon. More...
 
struct  Statistics
 Statistics structure. More...
 

Public Types

typedef void(* LinkOpenCloseTracedCallback) (Mac48Address src, const Mac48Address dst)
 TracedCallback signature for link open/close events.
 

Public Member Functions

 PeerManagementProtocol ()
 
 PeerManagementProtocol (const PeerManagementProtocol &)=delete
 
 ~PeerManagementProtocol () override
 
int64_t AssignStreams (int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model.
 
void DoDispose () override
 Destructor implementation.
 
bool Install (Ptr< MeshPointDevice > mp)
 Install PMP on given mesh point.
 
PeerManagementProtocoloperator= (const PeerManagementProtocol &)=delete
 
void Report (std::ostream &os) const
 Report statistics.
 
void ResetStats ()
 Reset statistics function.
 
This methods interact with MAC_layer plug-in

Methods that handle beacon sending/receiving procedure.

Ptr< IeBeaconTimingGetBeaconTimingElement (uint32_t interface)
 When we are sending a beacon - we fill beacon timing element.
 
void ReceiveBeacon (uint32_t interface, Mac48Address peerAddress, Time beaconInterval, Ptr< IeBeaconTiming > beaconTiming)
 To initiate peer link we must notify about received beacon.
 
Methods that handle Peer link management frames interaction:
void ReceivePeerLinkFrame (uint32_t interface, Mac48Address peerAddress, Mac48Address peerMeshPointAddress, uint16_t aid, IePeerManagement peerManagementElement, IeConfiguration meshConfig)
 Deliver Peer link management information to the protocol-part.
 
void ConfigurationMismatch (uint32_t interface, Mac48Address peerAddress)
 Cancels peer link due to broken configuration (Mesh ID or Supported rates)
 
void TransmissionFailure (uint32_t interface, const Mac48Address peerAddress)
 Cancels peer link due to successive transmission failures.
 
void TransmissionSuccess (uint32_t interface, const Mac48Address peerAddress)
 resets transmission failure statistics
 
bool IsActiveLink (uint32_t interface, Mac48Address peerAddress)
 Checks if there is established link.
 
Interface to other protocols (MLME)
void SetPeerLinkStatusCallback (Callback< void, Mac48Address, Mac48Address, uint32_t, bool > cb)
 Set peer link status change callback.
 
Ptr< PeerLinkFindPeerLink (uint32_t interface, Mac48Address peerAddress)
 Find active peer link by my interface and peer interface MAC.
 
std::vector< Ptr< PeerLink > > GetPeerLinks () const
 Get list of all active peer links.
 
std::vector< Mac48AddressGetPeers (uint32_t interface) const
 Get list of active peers of my given interface.
 
Mac48Address GetAddress ()
 Get mesh point address.
 
uint8_t GetNumberOfLinks () const
 Get number of links.
 
void SetMeshId (std::string s)
 Set mesh ID to a string value.
 
Ptr< IeMeshIdGetMeshId () const
 Get mesh ID information element.
 
void SetBeaconCollisionAvoidance (bool enable)
 Enable or disable beacon collision avoidance.
 
bool GetBeaconCollisionAvoidance () const
 Get beacon collision avoidance.
 
void NotifyBeaconSent (uint32_t interface, Time beaconInterval)
 Notify about beacon send event, needed to schedule BCA.
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Private Types

typedef std::map< uint32_t, BeaconsOnInterfaceBeaconInfoMap
 This map keeps beacon information on all interfaces.
 
typedef std::map< Mac48Address, BeaconInfoBeaconsOnInterface
 This map keeps relationship between peer address and its beacon information.
 
typedef std::map< uint32_t, PeerLinksOnInterfacePeerLinksMap
 This map keeps all peer links.
 
typedef std::vector< Ptr< PeerLink > > PeerLinksOnInterface
 We keep a vector of pointers to PeerLink class.
 
typedef std::map< uint32_t, Ptr< PeerManagementProtocolMac > > PeerManagementProtocolMacMap
 this vector keeps pointers to MAC-plugins
 

Private Member Functions

void CheckBeaconCollisions (uint32_t interface)
 BCA.
 
void DoInitialize () override
 Initialize() implementation.
 
Ptr< PeerLinkInitiateLink (uint32_t interface, Mac48Address peerAddress, Mac48Address peerMeshPointAddress)
 Initiate link function.
 
void NotifyLinkClose (Mac48Address peerMp, Mac48Address peerIface, Mac48Address myIface, uint32_t interface)
 Aux.
 
void NotifyLinkOpen (Mac48Address peerMp, Mac48Address peerIface, Mac48Address myIface, uint32_t interface)
 Aux.
 
void PeerLinkStatus (uint32_t interface, Mac48Address peerAddress, Mac48Address peerMeshPointAddress, PeerLink::PeerState ostate, PeerLink::PeerState nstate)
 Indicates changes in peer links.
 
void ShiftOwnBeacon (uint32_t interface)
 Shift own beacon function.
 
bool ShouldAcceptOpen (uint32_t interface, Mac48Address peerAddress, PmpReasonCode &reasonCode) const
 External peer-chooser.
 
bool ShouldSendOpen (uint32_t interface, Mac48Address peerAddress) const
 External peer-chooser.
 
int TimeToTu (Time x)
 Time<-->TU converters:
 
Time TuToTime (int x)
 Time<-->TU converters:
 

Private Attributes

Mac48Address m_address
 address
 
std::map< uint32_t, Timem_beaconInterval
 Beacon interval at each interface.
 
bool m_enableBca
 Flag which enables BCA.
 
uint16_t m_lastAssocId
 last associated ID
 
std::map< uint32_t, Timem_lastBeacon
 Last beacon at each interface.
 
uint16_t m_lastLocalLinkId
 last local link ID
 
uint16_t m_maxBeaconShift
 Beacon can be shifted at [-m_maxBeaconShift; +m_maxBeaconShift] TUs.
 
uint8_t m_maxNumberOfPeerLinks
 maimum number of peer links
 
Ptr< IeMeshIdm_meshId
 mesh ID
 
PeerManagementProtocolMacMap m_plugins
 plugins
 

Peer Links

typedef TracedCallback< Mac48Address, Mac48AddressLinkEventCallback
 Simple link open/close trace source type. Addresses are: src interface, dst interface.
 
PeerLinksMap m_peerLinks
 Simple link open/close trace source type. Addresses are: src interface, dst interface.
 
Callback< void, Mac48Address, Mac48Address, uint32_t, bool > m_peerStatusCallback
 Callback to notify about peer link changes: Mac48Address is peer address of mesh point, Mac48Address is peer address of interface, uint32_t - interface ID, bool is status - true when new link has appeared, false - when link was closed,.
 
LinkEventCallback m_linkOpenTraceSrc
 LinkOpen trace source.
 
LinkEventCallback m_linkCloseTraceSrc
 LinkClose trace source.
 
Statistics m_stats
 statistics
 
Ptr< UniformRandomVariablem_beaconShift
 Add randomness to beacon shift.
 

Additional Inherited Members

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

Detailed Description

802.11s Peer Management Protocol model

Definition at line 43 of file peer-management-protocol.h.

Member Typedef Documentation

◆ BeaconInfoMap

This map keeps beacon information on all interfaces.

Definition at line 256 of file peer-management-protocol.h.

◆ BeaconsOnInterface

This map keeps relationship between peer address and its beacon information.

Definition at line 254 of file peer-management-protocol.h.

◆ LinkEventCallback

Simple link open/close trace source type. Addresses are: src interface, dst interface.

Definition at line 378 of file peer-management-protocol.h.

◆ LinkOpenCloseTracedCallback

typedef void(* ns3::dot11s::PeerManagementProtocol::LinkOpenCloseTracedCallback) (Mac48Address src, const Mac48Address dst)

TracedCallback signature for link open/close events.

Parameters
[in]srcMAC address of source interface.
[in]dstMAC address of destination interface.

Definition at line 233 of file peer-management-protocol.h.

◆ PeerLinksMap

This map keeps all peer links.

Definition at line 252 of file peer-management-protocol.h.

◆ PeerLinksOnInterface

We keep a vector of pointers to PeerLink class.

This vector keeps all peer links at a given interface.

Definition at line 250 of file peer-management-protocol.h.

◆ PeerManagementProtocolMacMap

this vector keeps pointers to MAC-plugins

Definition at line 258 of file peer-management-protocol.h.

Constructor & Destructor Documentation

◆ PeerManagementProtocol() [1/2]

ns3::dot11s::PeerManagementProtocol::PeerManagementProtocol ( )

Definition at line 78 of file peer-management-protocol.cc.

References ns3::CreateObject(), and m_beaconShift.

+ Here is the call graph for this function:

◆ ~PeerManagementProtocol()

ns3::dot11s::PeerManagementProtocol::~PeerManagementProtocol ( )
override

Definition at line 87 of file peer-management-protocol.cc.

References m_meshId.

◆ PeerManagementProtocol() [2/2]

ns3::dot11s::PeerManagementProtocol::PeerManagementProtocol ( const PeerManagementProtocol & )
delete

Member Function Documentation

◆ AssignStreams()

int64_t ns3::dot11s::PeerManagementProtocol::AssignStreams ( int64_t stream)

Assign a fixed random variable stream number to the random variables used by this model.

Return the number of streams (possibly zero) that have been assigned.

Parameters
streamfirst stream index to use
Returns
the number of stream indices assigned by this model

Definition at line 645 of file peer-management-protocol.cc.

References m_beaconShift, and NS_LOG_FUNCTION.

◆ CheckBeaconCollisions()

void ns3::dot11s::PeerManagementProtocol::CheckBeaconCollisions ( uint32_t interface)
private

BCA.

Parameters
interfaceinterface

Definition at line 407 of file peer-management-protocol.cc.

References GetBeaconCollisionAvoidance(), m_beaconInterval, m_lastBeacon, m_maxBeaconShift, m_peerLinks, m_plugins, NS_ASSERT, NS_ASSERT_MSG, ShiftOwnBeacon(), TimeToTu(), and TuToTime().

Referenced by NotifyBeaconSent().

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

◆ ConfigurationMismatch()

void ns3::dot11s::PeerManagementProtocol::ConfigurationMismatch ( uint32_t interface,
Mac48Address peerAddress )

Cancels peer link due to broken configuration (Mesh ID or Supported rates)

Parameters
interfaceinterface of the link to cancel
peerAddresspeer address of the link to cancel

Definition at line 251 of file peer-management-protocol.cc.

References FindPeerLink(), and ns3::dot11s::REASON11S_MESH_CAPABILITY_POLICY_VIOLATION.

+ Here is the call graph for this function:

◆ DoDispose()

void ns3::dot11s::PeerManagementProtocol::DoDispose ( )
overridevirtual

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 93 of file peer-management-protocol.cc.

References m_peerLinks, and m_plugins.

◆ DoInitialize()

void ns3::dot11s::PeerManagementProtocol::DoInitialize ( )
overrideprivatevirtual

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 653 of file peer-management-protocol.cc.

References m_beaconShift, and m_maxBeaconShift.

◆ FindPeerLink()

Ptr< PeerLink > ns3::dot11s::PeerManagementProtocol::FindPeerLink ( uint32_t interface,
Mac48Address peerAddress )

Find active peer link by my interface and peer interface MAC.

Parameters
interfaceinterface of the link to find
peerAddresspeer address of the link to find
Returns
The peer link (null if not found)

Definition at line 312 of file peer-management-protocol.cc.

References m_peerLinks, and NS_ASSERT.

Referenced by ConfigurationMismatch(), InitiateLink(), IsActiveLink(), PeerLinkStatus(), ReceiveBeacon(), ReceivePeerLinkFrame(), TransmissionFailure(), and TransmissionSuccess().

+ Here is the caller graph for this function:

◆ GetAddress()

Mac48Address ns3::dot11s::PeerManagementProtocol::GetAddress ( )

Get mesh point address.

Todo
this used by plugins only. Now MAC plugins can ask MP address directly from main MAC
Returns
Mac48Address

Definition at line 577 of file peer-management-protocol.cc.

References m_address.

Referenced by TransmissionFailure(), and TransmissionSuccess().

+ Here is the caller graph for this function:

◆ GetBeaconCollisionAvoidance()

bool ns3::dot11s::PeerManagementProtocol::GetBeaconCollisionAvoidance ( ) const

Get beacon collision avoidance.

Returns
the beacon collision avoidance flag

Definition at line 669 of file peer-management-protocol.cc.

References m_enableBca.

Referenced by CheckBeaconCollisions(), GetBeaconTimingElement(), GetTypeId(), and ReceiveBeacon().

+ Here is the caller graph for this function:

◆ GetBeaconTimingElement()

Ptr< IeBeaconTiming > ns3::dot11s::PeerManagementProtocol::GetBeaconTimingElement ( uint32_t interface)

When we are sending a beacon - we fill beacon timing element.

Returns
IeBeaconTiming is a beacon timing element that should be present in beacon
Parameters
interfaceis a interface sending a beacon

Definition at line 139 of file peer-management-protocol.cc.

References ns3::Create(), GetBeaconCollisionAvoidance(), m_peerLinks, NS_ASSERT, and ns3::Seconds().

+ Here is the call graph for this function:

◆ GetMeshId()

Ptr< IeMeshId > ns3::dot11s::PeerManagementProtocol::GetMeshId ( ) const

Get mesh ID information element.

Returns
the mesh ID information element

Definition at line 564 of file peer-management-protocol.cc.

References m_meshId, and NS_ASSERT.

◆ GetNumberOfLinks()

uint8_t ns3::dot11s::PeerManagementProtocol::GetNumberOfLinks ( ) const

Get number of links.

Returns
the number of links

Definition at line 558 of file peer-management-protocol.cc.

References ns3::dot11s::PeerManagementProtocol::Statistics::linksTotal, and m_stats.

◆ GetPeerLinks()

std::vector< Ptr< PeerLink > > ns3::dot11s::PeerManagementProtocol::GetPeerLinks ( ) const

Get list of all active peer links.

Returns
a list of all the active peer links

Definition at line 359 of file peer-management-protocol.cc.

References m_peerLinks.

◆ GetPeers()

std::vector< Mac48Address > ns3::dot11s::PeerManagementProtocol::GetPeers ( uint32_t interface) const

Get list of active peers of my given interface.

Parameters
interfacethe interface
Returns
a list of all the active peer links on an interface

Definition at line 343 of file peer-management-protocol.cc.

References m_peerLinks, and NS_ASSERT.

Referenced by ns3::Dot11sStack::InstallStack().

+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::dot11s::PeerManagementProtocol::GetTypeId ( )
static

Get the type ID.

Returns
the object TypeId

Definition at line 40 of file peer-management-protocol.cc.

References GetBeaconCollisionAvoidance(), m_linkCloseTraceSrc, m_linkOpenTraceSrc, m_maxBeaconShift, m_maxNumberOfPeerLinks, ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), ns3::MakeTraceSourceAccessor(), ns3::MakeUintegerAccessor(), ns3::MakeUintegerChecker(), SetBeaconCollisionAvoidance(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ InitiateLink()

Ptr< PeerLink > ns3::dot11s::PeerManagementProtocol::InitiateLink ( uint32_t interface,
Mac48Address peerAddress,
Mac48Address peerMeshPointAddress )
private

Initiate link function.

Parameters
interfacethe interface to use
peerAddressthe peer address
peerMeshPointAddressthe peer mesh point address
Returns
the peer link

Definition at line 284 of file peer-management-protocol.cc.

References ns3::CreateObject(), FindPeerLink(), m_lastAssocId, m_lastLocalLinkId, m_peerLinks, m_plugins, ns3::MakeCallback(), NS_ASSERT, NS_FATAL_ERROR, and PeerLinkStatus().

Referenced by ReceiveBeacon(), and ReceivePeerLinkFrame().

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

◆ Install()

bool ns3::dot11s::PeerManagementProtocol::Install ( Ptr< MeshPointDevice > mp)

Install PMP on given mesh point.

Parameters
mpthe MeshPointDevice to install onto
Returns
true if successful

Installing protocol causes installation of its interface MAC plugins.

Also MP aggregates all installed protocols, PMP protocol can be accessed via MeshPointDevice::GetObject<PeerManagementProtocol>();

Definition at line 110 of file peer-management-protocol.cc.

References ns3::Mac48Address::ConvertFrom(), ns3::Create(), m_address, m_peerLinks, and m_plugins.

+ Here is the call graph for this function:

◆ IsActiveLink()

bool ns3::dot11s::PeerManagementProtocol::IsActiveLink ( uint32_t interface,
Mac48Address peerAddress )

Checks if there is established link.

Parameters
interfaceinterface of the link to check
peerAddresspeer address of the link to check
Returns
true if the link is active

Definition at line 377 of file peer-management-protocol.cc.

References FindPeerLink().

+ Here is the call graph for this function:

◆ NotifyBeaconSent()

void ns3::dot11s::PeerManagementProtocol::NotifyBeaconSent ( uint32_t interface,
Time beaconInterval )

Notify about beacon send event, needed to schedule BCA.

Parameters
interfacethe interface to use
beaconIntervalthe beacon interval

Definition at line 583 of file peer-management-protocol.cc.

References CheckBeaconCollisions(), m_beaconInterval, m_lastBeacon, m_maxBeaconShift, ns3::Simulator::Now(), ns3::Simulator::Schedule(), and TuToTime().

+ Here is the call graph for this function:

◆ NotifyLinkClose()

void ns3::dot11s::PeerManagementProtocol::NotifyLinkClose ( Mac48Address peerMp,
Mac48Address peerIface,
Mac48Address myIface,
uint32_t interface )
private

Aux.

method to register closed links

Parameters
peerMppeer mesh point address
peerIfacepeer address
myIfacemy address
interfaceinterface

Definition at line 512 of file peer-management-protocol.cc.

References ns3::dot11s::PeerManagementProtocol::Statistics::linksClosed, ns3::dot11s::PeerManagementProtocol::Statistics::linksTotal, m_linkCloseTraceSrc, m_peerStatusCallback, m_stats, and NS_LOG_LOGIC.

Referenced by PeerLinkStatus().

+ Here is the caller graph for this function:

◆ NotifyLinkOpen()

void ns3::dot11s::PeerManagementProtocol::NotifyLinkOpen ( Mac48Address peerMp,
Mac48Address peerIface,
Mac48Address myIface,
uint32_t interface )
private

Aux.

method to register open links

Parameters
peerMppeer mesh point address
peerIfacepeer address
myIfacemy address
interfaceinterface

Definition at line 496 of file peer-management-protocol.cc.

References ns3::dot11s::PeerManagementProtocol::Statistics::linksOpened, ns3::dot11s::PeerManagementProtocol::Statistics::linksTotal, m_linkOpenTraceSrc, m_peerStatusCallback, m_stats, and NS_LOG_LOGIC.

Referenced by PeerLinkStatus().

+ Here is the caller graph for this function:

◆ operator=()

PeerManagementProtocol & ns3::dot11s::PeerManagementProtocol::operator= ( const PeerManagementProtocol & )
delete

◆ PeerLinkStatus()

void ns3::dot11s::PeerManagementProtocol::PeerLinkStatus ( uint32_t interface,
Mac48Address peerAddress,
Mac48Address peerMeshPointAddress,
PeerLink::PeerState ostate,
PeerLink::PeerState nstate )
private

Indicates changes in peer links.

Parameters
interfacethe interface
peerAddressthe peer address
peerMeshPointAddressthe peer mesh point address
ostateold state
nstatenew state

Definition at line 528 of file peer-management-protocol.cc.

References ns3::dot11s::PeerLink::ESTAB, FindPeerLink(), ns3::dot11s::PeerLink::IDLE, m_address, m_plugins, NotifyLinkClose(), NotifyLinkOpen(), NS_ASSERT, NS_LOG_DEBUG, and ns3::dot11s::PeerLink::PeerStateNames.

Referenced by InitiateLink().

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

◆ ReceiveBeacon()

void ns3::dot11s::PeerManagementProtocol::ReceiveBeacon ( uint32_t interface,
Mac48Address peerAddress,
Time beaconInterval,
Ptr< IeBeaconTiming > beaconTiming )

To initiate peer link we must notify about received beacon.

Parameters
interfacethe interface where a beacon was received from
peerAddressaddress of station, which sent a beacon
beaconIntervalbeacon interval (needed by beacon loss counter)
beaconTimingbeacon timing element (needed by BCA)

Definition at line 165 of file peer-management-protocol.cc.

References FindPeerLink(), GetBeaconCollisionAvoidance(), ns3::Mac48Address::GetBroadcast(), InitiateLink(), m_plugins, ns3::Simulator::Now(), ns3::PeekPointer(), and ShouldSendOpen().

+ Here is the call graph for this function:

◆ ReceivePeerLinkFrame()

void ns3::dot11s::PeerManagementProtocol::ReceivePeerLinkFrame ( uint32_t interface,
Mac48Address peerAddress,
Mac48Address peerMeshPointAddress,
uint16_t aid,
IePeerManagement peerManagementElement,
IeConfiguration meshConfig )

Deliver Peer link management information to the protocol-part.

Parameters
interfaceis a interface ID of a given MAC (interfaceID rather than MAC address, because many interfaces may have the same MAC)
peerAddressis address of peer
peerMeshPointAddressis address of peer mesh point device (equal to peer address when only one interface)
aidis association ID, which peer has assigned to us
peerManagementElementis peer link management element
meshConfigis mesh configuration element taken from the peer management frame

Definition at line 200 of file peer-management-protocol.cc.

References FindPeerLink(), ns3::dot11s::IePeerManagement::GetLocalLinkId(), ns3::dot11s::IePeerManagement::GetPeerLinkId(), ns3::dot11s::IePeerManagement::GetReasonCode(), InitiateLink(), ns3::dot11s::REASON11S_RESERVED, ShouldAcceptOpen(), ns3::dot11s::IePeerManagement::SubtypeIsClose(), ns3::dot11s::IePeerManagement::SubtypeIsConfirm(), and ns3::dot11s::IePeerManagement::SubtypeIsOpen().

+ Here is the call graph for this function:

◆ Report()

void ns3::dot11s::PeerManagementProtocol::Report ( std::ostream & os) const

Report statistics.

Parameters
osthe output stream

Definition at line 615 of file peer-management-protocol.cc.

References m_peerLinks, m_plugins, m_stats, NS_ASSERT, and ns3::dot11s::PeerManagementProtocol::Statistics::Print().

+ Here is the call graph for this function:

◆ ResetStats()

void ns3::dot11s::PeerManagementProtocol::ResetStats ( )

Reset statistics function.

Definition at line 635 of file peer-management-protocol.cc.

References ns3::dot11s::PeerManagementProtocol::Statistics::linksTotal, m_plugins, and m_stats.

◆ SetBeaconCollisionAvoidance()

void ns3::dot11s::PeerManagementProtocol::SetBeaconCollisionAvoidance ( bool enable)

Enable or disable beacon collision avoidance.

Parameters
enabletrue to enable beacon collision avoidance

Definition at line 663 of file peer-management-protocol.cc.

References m_enableBca.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ SetMeshId()

void ns3::dot11s::PeerManagementProtocol::SetMeshId ( std::string s)

Set mesh ID to a string value.

Parameters
sthe mesh ID string value

Definition at line 571 of file peer-management-protocol.cc.

References ns3::Create(), and m_meshId.

+ Here is the call graph for this function:

◆ SetPeerLinkStatusCallback()

void ns3::dot11s::PeerManagementProtocol::SetPeerLinkStatusCallback ( Callback< void, Mac48Address, Mac48Address, uint32_t, bool > cb)

Set peer link status change callback.

Parameters
cbthe callback

Definition at line 336 of file peer-management-protocol.cc.

References m_peerStatusCallback.

◆ ShiftOwnBeacon()

void ns3::dot11s::PeerManagementProtocol::ShiftOwnBeacon ( uint32_t interface)
private

Shift own beacon function.

Parameters
interfaceinterface

Definition at line 470 of file peer-management-protocol.cc.

References m_beaconShift, m_plugins, NS_ASSERT, and TuToTime().

Referenced by CheckBeaconCollisions().

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

◆ ShouldAcceptOpen()

bool ns3::dot11s::PeerManagementProtocol::ShouldAcceptOpen ( uint32_t interface,
Mac48Address peerAddress,
PmpReasonCode & reasonCode ) const
private

External peer-chooser.

Parameters
interfacethe interface to use
peerAddressthe peer address
reasonCodereason code
Returns
true is should send an open

Definition at line 394 of file peer-management-protocol.cc.

References ns3::dot11s::PeerManagementProtocol::Statistics::linksTotal, m_maxNumberOfPeerLinks, m_stats, and ns3::dot11s::REASON11S_MESH_MAX_PEERS.

Referenced by ReceivePeerLinkFrame().

+ Here is the caller graph for this function:

◆ ShouldSendOpen()

bool ns3::dot11s::PeerManagementProtocol::ShouldSendOpen ( uint32_t interface,
Mac48Address peerAddress ) const
private

External peer-chooser.

Parameters
interfacethe interface to use
peerAddressthe peer address
Returns
true is should send an open

Definition at line 388 of file peer-management-protocol.cc.

References ns3::dot11s::PeerManagementProtocol::Statistics::linksTotal, m_maxNumberOfPeerLinks, and m_stats.

Referenced by ReceiveBeacon().

+ Here is the caller graph for this function:

◆ TimeToTu()

int ns3::dot11s::PeerManagementProtocol::TimeToTu ( Time x)
private

Time<-->TU converters:

Parameters
xTime
Returns
TU

Definition at line 490 of file peer-management-protocol.cc.

Referenced by CheckBeaconCollisions().

+ Here is the caller graph for this function:

◆ TransmissionFailure()

void ns3::dot11s::PeerManagementProtocol::TransmissionFailure ( uint32_t interface,
const Mac48Address peerAddress )

Cancels peer link due to successive transmission failures.

Parameters
interfaceinterface of the link to cancel
peerAddresspeer address of the link to cancel

Definition at line 261 of file peer-management-protocol.cc.

References FindPeerLink(), GetAddress(), and NS_LOG_DEBUG.

+ Here is the call graph for this function:

◆ TransmissionSuccess()

void ns3::dot11s::PeerManagementProtocol::TransmissionSuccess ( uint32_t interface,
const Mac48Address peerAddress )

resets transmission failure statistics

Parameters
interfaceinterface of the link to reset
peerAddresspeer address of the link to reset

Definition at line 273 of file peer-management-protocol.cc.

References FindPeerLink(), GetAddress(), and NS_LOG_DEBUG.

+ Here is the call graph for this function:

◆ TuToTime()

Time ns3::dot11s::PeerManagementProtocol::TuToTime ( int x)
private

Time<-->TU converters:

Parameters
xTU
Returns
Time

Definition at line 484 of file peer-management-protocol.cc.

References ns3::MicroSeconds().

Referenced by CheckBeaconCollisions(), NotifyBeaconSent(), and ShiftOwnBeacon().

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

Member Data Documentation

◆ m_address

Mac48Address ns3::dot11s::PeerManagementProtocol::m_address
private

address

Definition at line 349 of file peer-management-protocol.h.

Referenced by GetAddress(), Install(), and PeerLinkStatus().

◆ m_beaconInterval

std::map<uint32_t, Time> ns3::dot11s::PeerManagementProtocol::m_beaconInterval
private

Beacon interval at each interface.

Definition at line 362 of file peer-management-protocol.h.

Referenced by CheckBeaconCollisions(), and NotifyBeaconSent().

◆ m_beaconShift

Ptr<UniformRandomVariable> ns3::dot11s::PeerManagementProtocol::m_beaconShift
private

Add randomness to beacon shift.

Definition at line 407 of file peer-management-protocol.h.

Referenced by PeerManagementProtocol(), AssignStreams(), DoInitialize(), and ShiftOwnBeacon().

◆ m_enableBca

bool ns3::dot11s::PeerManagementProtocol::m_enableBca
private

Flag which enables BCA.

Definition at line 356 of file peer-management-protocol.h.

Referenced by GetBeaconCollisionAvoidance(), and SetBeaconCollisionAvoidance().

◆ m_lastAssocId

uint16_t ns3::dot11s::PeerManagementProtocol::m_lastAssocId
private

last associated ID

Definition at line 352 of file peer-management-protocol.h.

Referenced by InitiateLink().

◆ m_lastBeacon

std::map<uint32_t, Time> ns3::dot11s::PeerManagementProtocol::m_lastBeacon
private

Last beacon at each interface.

Definition at line 360 of file peer-management-protocol.h.

Referenced by CheckBeaconCollisions(), and NotifyBeaconSent().

◆ m_lastLocalLinkId

uint16_t ns3::dot11s::PeerManagementProtocol::m_lastLocalLinkId
private

last local link ID

Definition at line 353 of file peer-management-protocol.h.

Referenced by InitiateLink().

◆ m_linkCloseTraceSrc

LinkEventCallback ns3::dot11s::PeerManagementProtocol::m_linkCloseTraceSrc
private

LinkClose trace source.

Definition at line 382 of file peer-management-protocol.h.

Referenced by GetTypeId(), and NotifyLinkClose().

◆ m_linkOpenTraceSrc

LinkEventCallback ns3::dot11s::PeerManagementProtocol::m_linkOpenTraceSrc
private

LinkOpen trace source.

Definition at line 380 of file peer-management-protocol.h.

Referenced by GetTypeId(), and NotifyLinkOpen().

◆ m_maxBeaconShift

uint16_t ns3::dot11s::PeerManagementProtocol::m_maxBeaconShift
private

Beacon can be shifted at [-m_maxBeaconShift; +m_maxBeaconShift] TUs.

Definition at line 358 of file peer-management-protocol.h.

Referenced by CheckBeaconCollisions(), DoInitialize(), GetTypeId(), and NotifyBeaconSent().

◆ m_maxNumberOfPeerLinks

uint8_t ns3::dot11s::PeerManagementProtocol::m_maxNumberOfPeerLinks
private

maimum number of peer links

Definition at line 354 of file peer-management-protocol.h.

Referenced by GetTypeId(), ShouldAcceptOpen(), and ShouldSendOpen().

◆ m_meshId

Ptr<IeMeshId> ns3::dot11s::PeerManagementProtocol::m_meshId
private

mesh ID

Definition at line 350 of file peer-management-protocol.h.

Referenced by ~PeerManagementProtocol(), GetMeshId(), and SetMeshId().

◆ m_peerLinks

PeerLinksMap ns3::dot11s::PeerManagementProtocol::m_peerLinks
private

Simple link open/close trace source type. Addresses are: src interface, dst interface.

Definition at line 367 of file peer-management-protocol.h.

Referenced by CheckBeaconCollisions(), DoDispose(), FindPeerLink(), GetBeaconTimingElement(), GetPeerLinks(), GetPeers(), InitiateLink(), Install(), and Report().

◆ m_peerStatusCallback

Callback<void, Mac48Address, Mac48Address, uint32_t, bool> ns3::dot11s::PeerManagementProtocol::m_peerStatusCallback
private

Callback to notify about peer link changes: Mac48Address is peer address of mesh point, Mac48Address is peer address of interface, uint32_t - interface ID, bool is status - true when new link has appeared, false - when link was closed,.

Definition at line 375 of file peer-management-protocol.h.

Referenced by NotifyLinkClose(), NotifyLinkOpen(), and SetPeerLinkStatusCallback().

◆ m_plugins

PeerManagementProtocolMacMap ns3::dot11s::PeerManagementProtocol::m_plugins
private

◆ m_stats

Statistics ns3::dot11s::PeerManagementProtocol::m_stats
private

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