802.11s Peer Management Protocol model More...
#include <peer-management-protocol.h>
Classes | |
struct | BeaconInfo |
Keeps information about beacon of peer station: beacon interval, association ID, last time we have received a beacon. More... | |
struct | Statistics |
Public Member Functions | |
void | DoDispose () |
bool | Install (Ptr< MeshPointDevice >) |
Install PMP on given mesh point. More... | |
This methods interact with MAC_layer plug-in | |
Methods that handle beacon sending/receiving procedure. | |
Ptr< IeBeaconTiming > | GetBeaconTimingElement (uint32_t interface) |
When we are sending a beacon - we fill beacon timing element. More... | |
void | ReceiveBeacon (uint32_t interface, Mac48Address peerAddress, Time beaconInterval, Ptr< IeBeaconTiming > beaconTiming) |
To initiate peer link we must notify about received beacon. More... | |
void | ReceivePeerLinkFrame (uint32_t interface, Mac48Address peerAddress, Mac48Address peerMeshPointAddress, uint16_t aid, IePeerManagement peerManagementElement, IeConfiguration meshConfig) |
Methods that handle Peer link management frames interaction: More... | |
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. | |
Public Member Functions inherited from ns3::Object | |
void | AggregateObject (Ptr< Object > other) |
void | Dispose (void) |
AggregateIterator | GetAggregateIterator (void) const |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Initialize (void) |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
Public Member Functions inherited from ns3::ObjectBase | |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId (void) |
Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
static void | Cleanup (void) |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Private Types | |
typedef TracedCallback < Mac48Address, Mac48Address > | LinkEventCallback |
Simple link open/close trace source type. Addresses are: src interface, dst interface. | |
Private structures | |
typedef std::vector< Ptr < PeerLink > > | PeerLinksOnInterface |
typedef std::map< uint32_t, PeerLinksOnInterface > | PeerLinksMap |
This map keeps all peer links. | |
typedef std::map< Mac48Address, BeaconInfo > | BeaconsOnInterface |
This map keeps relationship between peer address and its beacon information. | |
typedef std::map< uint32_t, BeaconsOnInterface > | BeaconInfoMap |
This map keeps beacon information on all interfaces. | |
typedef std::map< uint32_t, Ptr< PeerManagementProtocolMac > > | PeerManagementProtocolMacMap |
this vector keeps pointers to MAC-plugins | |
Private Member Functions | |
PeerManagementProtocol (const PeerManagementProtocol &) | |
void | CheckBeaconCollisions (uint32_t interface) |
BCA. | |
Ptr< PeerLink > | InitiateLink (uint32_t interface, Mac48Address peerAddress, Mac48Address peerMeshPointAddress) |
void | NotifyLinkClose (Mac48Address peerMp, Mac48Address peerIface, Mac48Address myIface, uint32_t interface) |
Aux. method to register closed links. | |
void | NotifyLinkOpen (Mac48Address peerMp, Mac48Address peerIface, Mac48Address myIface, uint32_t interface) |
Aux. method to register open links. | |
PeerManagementProtocol & | operator= (const PeerManagementProtocol &) |
void | PeerLinkStatus (uint32_t interface, Mac48Address peerAddress, Mac48Address peerMeshPointAddres, PeerLink::PeerState ostate, PeerLink::PeerState nstate) |
Indicates changes in peer links. | |
void | ShiftOwnBeacon (uint32_t interface) |
External peer-chooser | |
bool | ShouldSendOpen (uint32_t interface, Mac48Address peerAddress) |
bool | ShouldAcceptOpen (uint32_t interface, Mac48Address peerAddress, PmpReasonCode &reasonCode) |
Time<-->TU converters: | |
Time | TuToTime (int x) |
int | TimeToTu (Time x) |
Private Attributes | |
Mac48Address | m_address |
std::map< uint32_t, Time > | m_beaconInterval |
Beacon interval at each interface. | |
Ptr< UniformRandomVariable > | m_beaconShift |
Add randomness to beacon shift. | |
bool | m_enableBca |
Flag which enables BCA. | |
uint16_t | m_lastAssocId |
std::map< uint32_t, Time > | m_lastBeacon |
Last beacon at each interface. | |
uint16_t | m_lastLocalLinkId |
LinkEventCallback | m_linkCloseTraceSrc |
LinkClose trace source. | |
LinkEventCallback | m_linkOpenTraceSrc |
LinkOpen trace source. | |
uint16_t | m_maxBeaconShift |
Beacon can be shifted at [-m_maxBeaconShift; +m_maxBeaconShift] TUs. | |
uint8_t | m_maxNumberOfPeerLinks |
Ptr< IeMeshId > | m_meshId |
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,. | |
PeerManagementProtocolMacMap | m_plugins |
Peer Links | |
PeerLinksMap | m_peerLinks |
Statistics: | |
struct Statistics | m_stats |
Interface to other protocols (MLME) | |
void | SetPeerLinkStatusCallback (Callback< void, Mac48Address, Mac48Address, uint32_t, bool > cb) |
Set peer link status change callback. | |
Ptr< PeerLink > | FindPeerLink (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< Mac48Address > | GetPeers (uint32_t interface) const |
Get list of active peers of my given interface. | |
Mac48Address | GetAddress () |
Get mesh point address. TODO this used by plugins only. Now MAC plugins can ask MP addrress directly from main MAC. | |
uint8_t | GetNumberOfLinks () |
void | SetMeshId (std::string s) |
Ptr< IeMeshId > | GetMeshId () const |
void | SetBeaconCollisionAvoidance (bool enable) |
Enable or disable beacon collision avoidance. | |
bool | GetBeaconCollisionAvoidance () const |
void | NotifyBeaconSent (uint32_t interface, Time beaconInterval) |
Notify about beacon send event, needed to schedule BCA. | |
void | Report (std::ostream &) const |
: Report statistics | |
void | ResetStats () |
int64_t | AssignStreams (int64_t stream) |
virtual void | DoInitialize () |
Additional Inherited Members | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
virtual void | NotifyNewAggregate (void) |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
virtual void | NotifyConstructionCompleted (void) |
802.11s Peer Management Protocol model
Doxygen introspection did not find any typical Config paths.
Definition at line 49 of file peer-management-protocol.h.
|
private |
We keep a vector of pointers to PeerLink class. This vector keeps all peer links at a given interface.
Definition at line 178 of file peer-management-protocol.h.
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.
stream | first stream index to use |
Definition at line 582 of file peer-management-protocol.cc.
References m_beaconShift, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().
|
virtual |
This method is called by Object::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 95 of file peer-management-protocol.cc.
|
privatevirtual |
This method is called only once by Object::Initialize. If the user calls Object::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 590 of file peer-management-protocol.cc.
References m_beaconShift, m_maxBeaconShift, and ns3::ObjectBase::SetAttribute().
Ptr< IeBeaconTiming > ns3::dot11s::PeerManagementProtocol::GetBeaconTimingElement | ( | uint32_t | interface | ) |
When we are sending a beacon - we fill beacon timing element.
interface | is a interface sending a beacon |
Definition at line 140 of file peer-management-protocol.cc.
References NS_ASSERT, and ns3::Seconds().
bool ns3::dot11s::PeerManagementProtocol::Install | ( | Ptr< MeshPointDevice > | mp | ) |
Install PMP on given mesh point.
Installing protocol cause installing its interface MAC plugins.
Also MP aggregates all installed protocols, PMP protocol can be accessed via MeshPointDevice::GetObject<PeerManagementProtocol>();
Definition at line 112 of file peer-management-protocol.cc.
References ns3::Mac48Address::ConvertFrom().
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.
interface | the interface where a beacon was received from |
peerAddress | address of station, which sent a beacon |
beaconInterval | beacon interval (needed by beacon loss counter) |
beaconTiming | beacon timing element (needed by BCA) |
Definition at line 164 of file peer-management-protocol.cc.
References ns3::Mac48Address::GetBroadcast(), and ns3::Simulator::Now().
void ns3::dot11s::PeerManagementProtocol::ReceivePeerLinkFrame | ( | uint32_t | interface, |
Mac48Address | peerAddress, | ||
Mac48Address | peerMeshPointAddress, | ||
uint16_t | aid, | ||
IePeerManagement | peerManagementElement, | ||
IeConfiguration | meshConfig | ||
) |
Methods that handle Peer link management frames interaction:
Deliver Peer link management information to the protocol-part
interface | is a interface ID of a given MAC (interfaceID rather than MAC address, because many interfaces may have the same MAC) |
peerAddress | is address of peer |
peerMeshPointAddress | is address of peer mesh point device (equal to peer address when only one interface) |
aid | is association ID, which peer has assigned to us |
peerManagementElement | is peer link management element |
meshConfig | is mesh configuration element taken from the peer management frame |
Definition at line 196 of file peer-management-protocol.cc.