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

Peer link model for 802.11s Peer Management protocol. More...

#include "peer-link.h"

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

Public Types

enum  PeerState {
  IDLE , OPN_SNT , CNF_RCVD , OPN_RCVD ,
  ESTAB , HOLDING
}
 Peer Link state: More...
 

Public Member Functions

 PeerLink ()
 C-tor create empty link.
 
 PeerLink (const PeerLink &)=delete
 
 ~PeerLink () override
 
void DoDispose () override
 Destructor implementation.
 
PeerLinkoperator= (const PeerLink &)=delete
 
void Report (std::ostream &os) const
 Statistics.
 
void SetBeaconInformation (Time lastBeacon, Time BeaconInterval)
 Process beacon received from peer.
 
void SetLinkStatusCallback (Callback< void, uint32_t, Mac48Address, bool > cb)
 Method used to detect peer link changes.
 
Peer link getters/setters
void SetPeerAddress (Mac48Address macaddr)
 Set the peer address.
 
void SetPeerMeshPointAddress (Mac48Address macaddr)
 Set the peer mesh point address.
 
void SetInterface (uint32_t interface)
 Set the interface.
 
void SetLocalLinkId (uint16_t id)
 Set the local link ID.
 
void SetLocalAid (uint16_t aid)
 Set the local association ID.
 
uint16_t GetPeerAid () const
 Set the peer association ID.
 
void SetBeaconTimingElement (IeBeaconTiming beaconTiming)
 Set the beacon timing element.
 
Mac48Address GetPeerAddress () const
 Get the peer address.
 
uint16_t GetLocalAid () const
 Get the local association ID.
 
Time GetLastBeacon () const
 Get the time of the last received beacon.
 
Time GetBeaconInterval () const
 Get the beacon interval.
 
IeBeaconTiming GetBeaconTimingElement () const
 Get the beacon timing element.
 
- 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.
 

Static Public Attributes

static const char *const PeerStateNames [6]
 Literal names of Mesh Peer Management states for use in log messages.
 

Private Types

enum  PeerEvent {
  CNCL , ACTOPN , CLS_ACPT , OPN_ACPT ,
  OPN_RJCT , REQ_RJCT , CNF_ACPT , CNF_RJCT ,
  TOR1 , TOR2 , TOC , TOH
}
 Peer link events, see 802.11s draft 11B.3.3.2. More...
 

Private Member Functions

void BeaconLoss ()
 Several successive beacons were lost, close link.
 
bool LinkIsEstab () const
 
bool LinkIsIdle () const
 
void SetMacPlugin (Ptr< PeerManagementProtocolMac > plugin)
 Set pointer to MAC-plugin, which is responsible for sending peer link management frames.
 
void StateMachine (PeerEvent event, PmpReasonCode=REASON11S_RESERVED)
 State transition.
 
Link response to received management frames
Attention
In all this methods {local/peer}LinkID correspond to peer station, as written in received frame, e.g. I am peerLinkID and peer link is localLinkID .
void Close (uint16_t localLinkID, uint16_t peerLinkID, PmpReasonCode reason)
 Close link.
 
void OpenAccept (uint16_t localLinkId, IeConfiguration conf, Mac48Address peerMp)
 Accept open link.
 
void OpenReject (uint16_t localLinkId, IeConfiguration conf, Mac48Address peerMp, PmpReasonCode reason)
 Reject open link.
 
void ConfirmAccept (uint16_t localLinkId, uint16_t peerLinkId, uint16_t peerAid, IeConfiguration conf, Mac48Address peerMp)
 Confirm accept.
 
void ConfirmReject (uint16_t localLinkId, uint16_t peerLinkId, IeConfiguration conf, Mac48Address peerMp, PmpReasonCode reason)
 Confirm reject.
 
Event handlers
void ClearRetryTimer ()
 
void ClearConfirmTimer ()
 Clear the confirm timer.
 
void ClearHoldingTimer ()
 Clear the holding timer.
 
void SetHoldingTimer ()
 Set the holding timer.
 
void SetRetryTimer ()
 Set the retry timer.
 
void SetConfirmTimer ()
 Set the confirm timer.
 
Work with management frames
void SendPeerLinkClose (PmpReasonCode reasoncode)
 Send a peer link close.
 
void SendPeerLinkOpen ()
 Send a peer link open.
 
void SendPeerLinkConfirm ()
 Send a peer link confirm.
 
Timeout handlers
void HoldingTimeout ()
 
void RetryTimeout ()
 Retry Timeout event handler.
 
void ConfirmTimeout ()
 Confirm Timeout event handler.
 

Private Attributes

uint16_t m_assocId
 My association ID.
 
Time m_beaconInterval
 Current beacon interval on corresponding interface.
 
IeBeaconTiming m_beaconTiming
 Beacon timing element received from the peer. Needed by BCA.
 
IeConfiguration m_configuration
 Mesh interface configuration.
 
uint32_t m_interface
 The number of interface I am associated with.
 
Time m_lastBeacon
 When last beacon was received.
 
SignalStatusCallback m_linkStatusCallback
 How to report my status change.
 
uint16_t m_localLinkId
 My ID of this link.
 
Ptr< PeerManagementProtocolMacm_macPlugin
 pointer to MAC plugin, which is responsible for peer management
 
uint16_t m_packetFail
 How many successive packets were failed to transmit.
 
Mac48Address m_peerAddress
 Peer address.
 
uint16_t m_peerAssocId
 Assoc Id assigned to me by peer.
 
uint16_t m_peerLinkId
 Peer ID of this link.
 
Mac48Address m_peerMeshPointAddress
 Mesh point address, equal to peer address in case of single interface mesh point.
 
PeerState m_state
 Current state.
 
Timers & counters used for internal state transitions
uint16_t m_dot11MeshMaxRetries
 Maximum number of retries.
 
Time m_dot11MeshRetryTimeout
 Retry timeout.
 
Time m_dot11MeshHoldingTimeout
 Holding timeout.
 
Time m_dot11MeshConfirmTimeout
 Confirm timeout.
 
EventId m_retryTimer
 Retry timer.
 
EventId m_holdingTimer
 Holding timer.
 
EventId m_confirmTimer
 Confirm timer.
 
uint16_t m_retryCounter
 Retry counter.
 
EventId m_beaconLossTimer
 Beacon loss timer.
 
uint16_t m_maxBeaconLoss
 Maximum number of lost beacons before link will be closed.
 
uint16_t m_maxPacketFail
 Maximum number of failed packets before link will be closed.
 

Friends

class PeerManagementProtocol
 allow PeerManagementProtocol class friend access
 

MLME

typedef Callback< void, uint32_t, Mac48Address, Mac48Address, PeerLink::PeerState, PeerLink::PeerStateSignalStatusCallback
 Callback type for MLME-SignalPeerLinkStatus event.
 
void MLMECancelPeerLink (PmpReasonCode reason)
 MLME-CancelPeerLink.request.
 
void MLMEActivePeerLinkOpen ()
 MLME-ActivePeerLinkOpen.request.
 
void MLMEPeeringRequestReject ()
 MLME-PeeringRequestReject.
 
void MLMESetSignalStatusCallback (SignalStatusCallback cb)
 Set callback.
 
void TransmissionSuccess ()
 Reports about transmission success/failure.
 
void TransmissionFailure ()
 Callback type for MLME-SignalPeerLinkStatus event.
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
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

Peer link model for 802.11s Peer Management protocol.

Definition at line 35 of file peer-link.h.

Member Typedef Documentation

◆ SignalStatusCallback

Callback type for MLME-SignalPeerLinkStatus event.

Definition at line 167 of file peer-link.h.

Member Enumeration Documentation

◆ PeerEvent

Peer link events, see 802.11s draft 11B.3.3.2.

Enumerator
CNCL 

Cancel peer link.

ACTOPN 

Active peer link open.

CLS_ACPT 

PeerLinkClose_Accept.

OPN_ACPT 

PeerLinkOpen_Accept.

OPN_RJCT 

PeerLinkOpen_Reject.

REQ_RJCT 

PeerLinkOpenReject by internal reason.

CNF_ACPT 

PeerLinkConfirm_Accept.

CNF_RJCT 

PeerLinkConfirm_Reject.

TOR1 

Timeout of retry timer.

TOR2 

also timeout of retry timer

TOC 

Timeout of confirm timer.

TOH 

Timeout of holding (graceful closing) timer.

Definition at line 186 of file peer-link.h.

◆ PeerState

Peer Link state:

Enumerator
IDLE 
OPN_SNT 
CNF_RCVD 
OPN_RCVD 
ESTAB 
HOLDING 

Definition at line 56 of file peer-link.h.

Constructor & Destructor Documentation

◆ PeerLink() [1/2]

ns3::dot11s::PeerLink::PeerLink ( )

C-tor create empty link.

Definition at line 76 of file peer-link.cc.

References NS_LOG_FUNCTION.

◆ ~PeerLink()

ns3::dot11s::PeerLink::~PeerLink ( )
override

Definition at line 93 of file peer-link.cc.

◆ PeerLink() [2/2]

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

Member Function Documentation

◆ BeaconLoss()

void ns3::dot11s::PeerLink::BeaconLoss ( )
private

Several successive beacons were lost, close link.

Definition at line 156 of file peer-link.cc.

References CNCL, NS_LOG_FUNCTION, and StateMachine().

Referenced by SetBeaconInformation().

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

◆ ClearConfirmTimer()

void ns3::dot11s::PeerLink::ClearConfirmTimer ( )
private

Clear the confirm timer.

Definition at line 735 of file peer-link.cc.

References ns3::EventId::Cancel(), and m_confirmTimer.

Referenced by StateMachine().

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

◆ ClearHoldingTimer()

void ns3::dot11s::PeerLink::ClearHoldingTimer ( )
private

Clear the holding timer.

Definition at line 741 of file peer-link.cc.

References ns3::EventId::Cancel(), and m_holdingTimer.

Referenced by StateMachine().

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

◆ ClearRetryTimer()

void ns3::dot11s::PeerLink::ClearRetryTimer ( )
private

Clear the retry timer

Definition at line 729 of file peer-link.cc.

References ns3::EventId::Cancel(), and m_retryTimer.

Referenced by StateMachine().

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

◆ Close()

void ns3::dot11s::PeerLink::Close ( uint16_t localLinkID,
uint16_t peerLinkID,
PmpReasonCode reason )
private

Close link.

Parameters
localLinkIDthe local link ID
peerLinkIDthe peer link ID
reasonthe reason to close

Definition at line 242 of file peer-link.cc.

References CLS_ACPT, m_localLinkId, m_peerLinkId, NS_LOG_FUNCTION, and StateMachine().

+ Here is the call graph for this function:

◆ ConfirmAccept()

void ns3::dot11s::PeerLink::ConfirmAccept ( uint16_t localLinkId,
uint16_t peerLinkId,
uint16_t peerAid,
IeConfiguration conf,
Mac48Address peerMp )
private

Confirm accept.

Parameters
localLinkIdthe local link ID
peerLinkIdthe peer link ID
peerAidthe peer AID
confthe IE configuration
peerMpthe peer MP

Definition at line 304 of file peer-link.cc.

References CNF_ACPT, ns3::Mac48Address::GetBroadcast(), m_configuration, m_localLinkId, m_peerAssocId, m_peerLinkId, m_peerMeshPointAddress, NS_ASSERT, NS_LOG_FUNCTION, and StateMachine().

+ Here is the call graph for this function:

◆ ConfirmReject()

void ns3::dot11s::PeerLink::ConfirmReject ( uint16_t localLinkId,
uint16_t peerLinkId,
IeConfiguration conf,
Mac48Address peerMp,
PmpReasonCode reason )
private

Confirm reject.

Parameters
localLinkIdthe local link ID
peerLinkIdthe peer link ID
confthe IE configuration
peerMpthe peer MP
reasonthe reason to close

Definition at line 340 of file peer-link.cc.

References CNF_RJCT, ns3::Mac48Address::GetBroadcast(), m_configuration, m_localLinkId, m_peerLinkId, m_peerMeshPointAddress, NS_ASSERT, NS_LOG_FUNCTION, and StateMachine().

+ Here is the call graph for this function:

◆ ConfirmTimeout()

void ns3::dot11s::PeerLink::ConfirmTimeout ( )
private

Confirm Timeout event handler.

Definition at line 830 of file peer-link.cc.

References StateMachine(), and TOC.

Referenced by SetConfirmTimer().

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

◆ DoDispose()

void ns3::dot11s::PeerLink::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 98 of file peer-link.cc.

References ns3::EventId::Cancel(), ns3::dot11s::IeBeaconTiming::ClearTimingElement(), m_beaconLossTimer, m_beaconTiming, m_confirmTimer, m_holdingTimer, m_retryTimer, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetBeaconInterval()

Time ns3::dot11s::PeerLink::GetBeaconInterval ( ) const

Get the beacon interval.

Returns
The beacon interval

Definition at line 212 of file peer-link.cc.

References m_beaconInterval.

◆ GetBeaconTimingElement()

IeBeaconTiming ns3::dot11s::PeerLink::GetBeaconTimingElement ( ) const

Get the beacon timing element.

Returns
The beacon timing element

Definition at line 218 of file peer-link.cc.

References m_beaconTiming.

◆ GetLastBeacon()

Time ns3::dot11s::PeerLink::GetLastBeacon ( ) const

Get the time of the last received beacon.

Returns
The time of the last received beacon

Definition at line 206 of file peer-link.cc.

References m_lastBeacon.

◆ GetLocalAid()

uint16_t ns3::dot11s::PeerLink::GetLocalAid ( ) const

Get the local association ID.

Returns
The local association ID

Definition at line 194 of file peer-link.cc.

References m_assocId.

◆ GetPeerAddress()

Mac48Address ns3::dot11s::PeerLink::GetPeerAddress ( ) const

Get the peer address.

Returns
The peer address

Definition at line 188 of file peer-link.cc.

References m_peerAddress.

◆ GetPeerAid()

uint16_t ns3::dot11s::PeerLink::GetPeerAid ( ) const

Set the peer association ID.

Returns
The peer association ID

Definition at line 200 of file peer-link.cc.

References m_peerAssocId.

◆ GetTypeId()

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

Get the type ID.

Returns
the object TypeId

Definition at line 30 of file peer-link.cc.

References m_dot11MeshConfirmTimeout, m_dot11MeshHoldingTimeout, m_dot11MeshMaxRetries, m_dot11MeshRetryTimeout, m_maxBeaconLoss, m_maxPacketFail, ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeUintegerAccessor(), ns3::MakeUintegerChecker(), ns3::MicroSeconds(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ HoldingTimeout()

void ns3::dot11s::PeerLink::HoldingTimeout ( )
private

Holding Timeout event handler

Definition at line 792 of file peer-link.cc.

References NS_LOG_FUNCTION, StateMachine(), and TOH.

Referenced by SetHoldingTimer().

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

◆ LinkIsEstab()

bool ns3::dot11s::PeerLink::LinkIsEstab ( ) const
private
Returns
True if link is established

Definition at line 372 of file peer-link.cc.

References ESTAB, and m_state.

◆ LinkIsIdle()

bool ns3::dot11s::PeerLink::LinkIsIdle ( ) const
private
Returns
True if link is idle. Link can be deleted in this state

Definition at line 378 of file peer-link.cc.

References IDLE, and m_state.

◆ MLMEActivePeerLinkOpen()

void ns3::dot11s::PeerLink::MLMEActivePeerLinkOpen ( )

MLME-ActivePeerLinkOpen.request.

Definition at line 230 of file peer-link.cc.

References ACTOPN, and StateMachine().

+ Here is the call graph for this function:

◆ MLMECancelPeerLink()

void ns3::dot11s::PeerLink::MLMECancelPeerLink ( PmpReasonCode reason)

MLME-CancelPeerLink.request.

Parameters
reasonthe reason for the request

Definition at line 224 of file peer-link.cc.

References CNCL, and StateMachine().

+ Here is the call graph for this function:

◆ MLMEPeeringRequestReject()

void ns3::dot11s::PeerLink::MLMEPeeringRequestReject ( )

MLME-PeeringRequestReject.

Definition at line 236 of file peer-link.cc.

References ns3::dot11s::REASON11S_PEERING_CANCELLED, REQ_RJCT, and StateMachine().

+ Here is the call graph for this function:

◆ MLMESetSignalStatusCallback()

void ns3::dot11s::PeerLink::MLMESetSignalStatusCallback ( PeerLink::SignalStatusCallback cb)

Set callback.

Parameters
cbthe callback function

Definition at line 150 of file peer-link.cc.

References m_linkStatusCallback.

◆ OpenAccept()

void ns3::dot11s::PeerLink::OpenAccept ( uint16_t localLinkId,
IeConfiguration conf,
Mac48Address peerMp )
private

Accept open link.

Parameters
localLinkIdthe local link ID
confthe IE configuration
peerMpthe peer MP

Definition at line 264 of file peer-link.cc.

References ns3::Mac48Address::GetBroadcast(), m_configuration, m_peerLinkId, m_peerMeshPointAddress, NS_ASSERT, NS_LOG_FUNCTION, OPN_ACPT, and StateMachine().

+ Here is the call graph for this function:

◆ OpenReject()

void ns3::dot11s::PeerLink::OpenReject ( uint16_t localLinkId,
IeConfiguration conf,
Mac48Address peerMp,
PmpReasonCode reason )
private

Reject open link.

Parameters
localLinkIdthe local link ID
confthe IE configuration
peerMpthe peer MP
reasonthe reason to close

Definition at line 281 of file peer-link.cc.

References ns3::Mac48Address::GetBroadcast(), m_configuration, m_peerLinkId, m_peerMeshPointAddress, NS_ASSERT, NS_LOG_FUNCTION, OPN_RJCT, and StateMachine().

+ Here is the call graph for this function:

◆ operator=()

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

◆ Report()

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

Statistics.

Parameters
osthe output stream

Definition at line 836 of file peer-link.cc.

References ESTAB, ns3::dot11s::PeerManagementProtocolMac::GetAddress(), ns3::dot11s::PeerManagementProtocolMac::GetLinkMetric(), ns3::Time::GetSeconds(), m_assocId, m_lastBeacon, m_localLinkId, m_macPlugin, m_peerAddress, m_peerLinkId, m_peerMeshPointAddress, and m_state.

+ Here is the call graph for this function:

◆ RetryTimeout()

void ns3::dot11s::PeerLink::RetryTimeout ( )
private

Retry Timeout event handler.

Definition at line 806 of file peer-link.cc.

References m_dot11MeshMaxRetries, m_retryCounter, NS_LOG_FUNCTION, NS_LOG_LOGIC, StateMachine(), TOR1, and TOR2.

Referenced by SetRetryTimer().

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

◆ SendPeerLinkClose()

void ns3::dot11s::PeerLink::SendPeerLinkClose ( PmpReasonCode reasoncode)
private

Send a peer link close.

Parameters
reasoncodereason for closing the line

Definition at line 747 of file peer-link.cc.

References m_assocId, m_configuration, m_localLinkId, m_macPlugin, m_peerAddress, m_peerLinkId, m_peerMeshPointAddress, ns3::dot11s::PeerManagementProtocolMac::SendPeerLinkManagementFrame(), and ns3::dot11s::IePeerManagement::SetPeerClose().

Referenced by StateMachine().

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

◆ SendPeerLinkConfirm()

void ns3::dot11s::PeerLink::SendPeerLinkConfirm ( )
private

Send a peer link confirm.

Definition at line 772 of file peer-link.cc.

References m_assocId, m_configuration, m_localLinkId, m_macPlugin, m_peerAddress, m_peerLinkId, m_peerMeshPointAddress, ns3::dot11s::PeerManagementProtocolMac::SendPeerLinkManagementFrame(), and ns3::dot11s::IePeerManagement::SetPeerConfirm().

Referenced by StateMachine().

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

◆ SendPeerLinkOpen()

void ns3::dot11s::PeerLink::SendPeerLinkOpen ( )
private

Send a peer link open.

Definition at line 759 of file peer-link.cc.

References m_assocId, m_configuration, m_localLinkId, m_macPlugin, m_peerAddress, m_peerMeshPointAddress, NS_ASSERT, ns3::dot11s::PeerManagementProtocolMac::SendPeerLinkManagementFrame(), and ns3::dot11s::IePeerManagement::SetPeerOpen().

Referenced by StateMachine().

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

◆ SetBeaconInformation()

void ns3::dot11s::PeerLink::SetBeaconInformation ( Time lastBeacon,
Time BeaconInterval )

Process beacon received from peer.

Parameters
lastBeaconthe last beacon
BeaconIntervalthe beacon interval

Definition at line 139 of file peer-link.cc.

References BeaconLoss(), ns3::EventId::Cancel(), ns3::Time::GetMicroSeconds(), ns3::Time::GetSeconds(), m_beaconInterval, m_beaconLossTimer, m_lastBeacon, m_maxBeaconLoss, NS_ASSERT, ns3::Simulator::Schedule(), and ns3::Seconds().

+ Here is the call graph for this function:

◆ SetBeaconTimingElement()

void ns3::dot11s::PeerLink::SetBeaconTimingElement ( IeBeaconTiming beaconTiming)

Set the beacon timing element.

Parameters
beaconTimingthe beacon timing element

Definition at line 182 of file peer-link.cc.

References m_beaconTiming.

◆ SetConfirmTimer()

void ns3::dot11s::PeerLink::SetConfirmTimer ( )
private

Set the confirm timer.

Definition at line 822 of file peer-link.cc.

References ConfirmTimeout(), ns3::Time::GetMicroSeconds(), m_confirmTimer, m_dot11MeshConfirmTimeout, NS_ASSERT, and ns3::Simulator::Schedule().

Referenced by StateMachine().

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

◆ SetHoldingTimer()

void ns3::dot11s::PeerLink::SetHoldingTimer ( )
private

Set the holding timer.

Definition at line 784 of file peer-link.cc.

References ns3::Time::GetMicroSeconds(), HoldingTimeout(), m_dot11MeshHoldingTimeout, m_holdingTimer, NS_ASSERT, and ns3::Simulator::Schedule().

Referenced by StateMachine().

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

◆ SetInterface()

void ns3::dot11s::PeerLink::SetInterface ( uint32_t interface)

Set the interface.

Parameters
interfacethe interface

Definition at line 121 of file peer-link.cc.

References m_interface.

◆ SetLinkStatusCallback()

void ns3::dot11s::PeerLink::SetLinkStatusCallback ( Callback< void, uint32_t, Mac48Address, bool > cb)

Method used to detect peer link changes.

Parameters
cbis a callback, which notifies, that on interface (uint32_t), peer link with address (Mac48Address) was opened (bool is true) or closed (bool is false)

◆ SetLocalAid()

void ns3::dot11s::PeerLink::SetLocalAid ( uint16_t aid)

Set the local association ID.

Parameters
aidthe local association ID

Definition at line 133 of file peer-link.cc.

References m_assocId.

◆ SetLocalLinkId()

void ns3::dot11s::PeerLink::SetLocalLinkId ( uint16_t id)

Set the local link ID.

Parameters
idthe local link ID

Definition at line 127 of file peer-link.cc.

References m_localLinkId.

◆ SetMacPlugin()

void ns3::dot11s::PeerLink::SetMacPlugin ( Ptr< PeerManagementProtocolMac > plugin)
private

Set pointer to MAC-plugin, which is responsible for sending peer link management frames.

Parameters
pluginthe peer management protocol MAC

Definition at line 384 of file peer-link.cc.

References m_macPlugin.

◆ SetPeerAddress()

void ns3::dot11s::PeerLink::SetPeerAddress ( Mac48Address macaddr)

Set the peer address.

Parameters
macaddrthe peer mac address

Definition at line 109 of file peer-link.cc.

References m_peerAddress.

◆ SetPeerMeshPointAddress()

void ns3::dot11s::PeerLink::SetPeerMeshPointAddress ( Mac48Address macaddr)

Set the peer mesh point address.

Parameters
macaddrthe peer mesh point address

Definition at line 115 of file peer-link.cc.

References m_peerMeshPointAddress.

◆ SetRetryTimer()

void ns3::dot11s::PeerLink::SetRetryTimer ( )
private

Set the retry timer.

Definition at line 799 of file peer-link.cc.

References ns3::Time::GetMicroSeconds(), m_dot11MeshRetryTimeout, m_retryTimer, NS_ASSERT, RetryTimeout(), and ns3::Simulator::Schedule().

Referenced by StateMachine().

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

◆ StateMachine()

void ns3::dot11s::PeerLink::StateMachine ( PeerEvent event,
PmpReasonCode reasoncode = REASON11S_RESERVED )
private

State transition.

Parameters
eventthe event to update the state machine
reasoncodethe reason for the state transition

Definition at line 393 of file peer-link.cc.

References ACTOPN, ClearConfirmTimer(), ClearHoldingTimer(), ClearRetryTimer(), CLS_ACPT, CNCL, CNF_ACPT, CNF_RCVD, CNF_RJCT, ESTAB, ns3::Mac48Address::GetBroadcast(), HOLDING, IDLE, m_interface, m_linkStatusCallback, m_peerAddress, m_peerMeshPointAddress, m_retryCounter, m_state, NS_ASSERT, OPN_ACPT, OPN_RCVD, OPN_RJCT, OPN_SNT, ns3::dot11s::REASON11S_MESH_CLOSE_RCVD, ns3::dot11s::REASON11S_MESH_CONFIRM_TIMEOUT, ns3::dot11s::REASON11S_MESH_MAX_RETRIES, ns3::dot11s::REASON11S_PEERING_CANCELLED, REQ_RJCT, SendPeerLinkClose(), SendPeerLinkConfirm(), SendPeerLinkOpen(), SetConfirmTimer(), SetHoldingTimer(), SetRetryTimer(), TOC, TOH, TOR1, and TOR2.

Referenced by BeaconLoss(), Close(), ConfirmAccept(), ConfirmReject(), ConfirmTimeout(), HoldingTimeout(), MLMEActivePeerLinkOpen(), MLMECancelPeerLink(), MLMEPeeringRequestReject(), OpenAccept(), OpenReject(), RetryTimeout(), and TransmissionFailure().

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

◆ TransmissionFailure()

void ns3::dot11s::PeerLink::TransmissionFailure ( )

Callback type for MLME-SignalPeerLinkStatus event.

Definition at line 169 of file peer-link.cc.

References CNCL, m_maxPacketFail, m_packetFail, NS_LOG_DEBUG, NS_LOG_FUNCTION, and StateMachine().

+ Here is the call graph for this function:

◆ TransmissionSuccess()

void ns3::dot11s::PeerLink::TransmissionSuccess ( )

Reports about transmission success/failure.

Definition at line 163 of file peer-link.cc.

References m_packetFail.

Friends And Related Symbol Documentation

◆ PeerManagementProtocol

friend class PeerManagementProtocol
friend

allow PeerManagementProtocol class friend access

Definition at line 39 of file peer-link.h.

Member Data Documentation

◆ m_assocId

uint16_t ns3::dot11s::PeerLink::m_assocId
private

My association ID.

Definition at line 352 of file peer-link.h.

Referenced by GetLocalAid(), Report(), SendPeerLinkClose(), SendPeerLinkConfirm(), SendPeerLinkOpen(), and SetLocalAid().

◆ m_beaconInterval

Time ns3::dot11s::PeerLink::m_beaconInterval
private

Current beacon interval on corresponding interface.

Definition at line 359 of file peer-link.h.

Referenced by GetBeaconInterval(), and SetBeaconInformation().

◆ m_beaconLossTimer

EventId ns3::dot11s::PeerLink::m_beaconLossTimer
private

Beacon loss timer.

Definition at line 386 of file peer-link.h.

Referenced by DoDispose(), and SetBeaconInformation().

◆ m_beaconTiming

IeBeaconTiming ns3::dot11s::PeerLink::m_beaconTiming
private

Beacon timing element received from the peer. Needed by BCA.

Definition at line 371 of file peer-link.h.

Referenced by DoDispose(), GetBeaconTimingElement(), and SetBeaconTimingElement().

◆ m_configuration

IeConfiguration ns3::dot11s::PeerLink::m_configuration
private

Mesh interface configuration.

Attention
Is not used now, nothing to configure :)

Definition at line 369 of file peer-link.h.

Referenced by ConfirmAccept(), ConfirmReject(), OpenAccept(), OpenReject(), SendPeerLinkClose(), SendPeerLinkConfirm(), and SendPeerLinkOpen().

◆ m_confirmTimer

EventId ns3::dot11s::PeerLink::m_confirmTimer
private

Confirm timer.

Definition at line 384 of file peer-link.h.

Referenced by ClearConfirmTimer(), DoDispose(), and SetConfirmTimer().

◆ m_dot11MeshConfirmTimeout

Time ns3::dot11s::PeerLink::m_dot11MeshConfirmTimeout
private

Confirm timeout.

Definition at line 380 of file peer-link.h.

Referenced by GetTypeId(), and SetConfirmTimer().

◆ m_dot11MeshHoldingTimeout

Time ns3::dot11s::PeerLink::m_dot11MeshHoldingTimeout
private

Holding timeout.

Definition at line 379 of file peer-link.h.

Referenced by GetTypeId(), and SetHoldingTimer().

◆ m_dot11MeshMaxRetries

uint16_t ns3::dot11s::PeerLink::m_dot11MeshMaxRetries
private

Maximum number of retries.

Definition at line 377 of file peer-link.h.

Referenced by GetTypeId(), and RetryTimeout().

◆ m_dot11MeshRetryTimeout

Time ns3::dot11s::PeerLink::m_dot11MeshRetryTimeout
private

Retry timeout.

Definition at line 378 of file peer-link.h.

Referenced by GetTypeId(), and SetRetryTimer().

◆ m_holdingTimer

EventId ns3::dot11s::PeerLink::m_holdingTimer
private

Holding timer.

Definition at line 383 of file peer-link.h.

Referenced by ClearHoldingTimer(), DoDispose(), and SetHoldingTimer().

◆ m_interface

uint32_t ns3::dot11s::PeerLink::m_interface
private

The number of interface I am associated with.

Definition at line 339 of file peer-link.h.

Referenced by SetInterface(), and StateMachine().

◆ m_lastBeacon

Time ns3::dot11s::PeerLink::m_lastBeacon
private

When last beacon was received.

Definition at line 357 of file peer-link.h.

Referenced by GetLastBeacon(), Report(), and SetBeaconInformation().

◆ m_linkStatusCallback

SignalStatusCallback ns3::dot11s::PeerLink::m_linkStatusCallback
private

How to report my status change.

Definition at line 392 of file peer-link.h.

Referenced by MLMESetSignalStatusCallback(), and StateMachine().

◆ m_localLinkId

uint16_t ns3::dot11s::PeerLink::m_localLinkId
private

◆ m_macPlugin

Ptr<PeerManagementProtocolMac> ns3::dot11s::PeerLink::m_macPlugin
private

pointer to MAC plugin, which is responsible for peer management

Definition at line 341 of file peer-link.h.

Referenced by Report(), SendPeerLinkClose(), SendPeerLinkConfirm(), SendPeerLinkOpen(), and SetMacPlugin().

◆ m_maxBeaconLoss

uint16_t ns3::dot11s::PeerLink::m_maxBeaconLoss
private

Maximum number of lost beacons before link will be closed.

Definition at line 387 of file peer-link.h.

Referenced by GetTypeId(), and SetBeaconInformation().

◆ m_maxPacketFail

uint16_t ns3::dot11s::PeerLink::m_maxPacketFail
private

Maximum number of failed packets before link will be closed.

Definition at line 388 of file peer-link.h.

Referenced by GetTypeId(), and TransmissionFailure().

◆ m_packetFail

uint16_t ns3::dot11s::PeerLink::m_packetFail
private

How many successive packets were failed to transmit.

Definition at line 361 of file peer-link.h.

Referenced by TransmissionFailure(), and TransmissionSuccess().

◆ m_peerAddress

Mac48Address ns3::dot11s::PeerLink::m_peerAddress
private

◆ m_peerAssocId

uint16_t ns3::dot11s::PeerLink::m_peerAssocId
private

Assoc Id assigned to me by peer.

Definition at line 354 of file peer-link.h.

Referenced by ConfirmAccept(), and GetPeerAid().

◆ m_peerLinkId

uint16_t ns3::dot11s::PeerLink::m_peerLinkId
private

Peer ID of this link.

Definition at line 350 of file peer-link.h.

Referenced by Close(), ConfirmAccept(), ConfirmReject(), OpenAccept(), OpenReject(), Report(), SendPeerLinkClose(), and SendPeerLinkConfirm().

◆ m_peerMeshPointAddress

Mac48Address ns3::dot11s::PeerLink::m_peerMeshPointAddress
private

Mesh point address, equal to peer address in case of single interface mesh point.

Definition at line 346 of file peer-link.h.

Referenced by ConfirmAccept(), ConfirmReject(), OpenAccept(), OpenReject(), Report(), SendPeerLinkClose(), SendPeerLinkConfirm(), SendPeerLinkOpen(), SetPeerMeshPointAddress(), and StateMachine().

◆ m_retryCounter

uint16_t ns3::dot11s::PeerLink::m_retryCounter
private

Retry counter.

Definition at line 385 of file peer-link.h.

Referenced by RetryTimeout(), and StateMachine().

◆ m_retryTimer

EventId ns3::dot11s::PeerLink::m_retryTimer
private

Retry timer.

Definition at line 382 of file peer-link.h.

Referenced by ClearRetryTimer(), DoDispose(), and SetRetryTimer().

◆ m_state

PeerState ns3::dot11s::PeerLink::m_state
private

Current state.

Definition at line 364 of file peer-link.h.

Referenced by LinkIsEstab(), LinkIsIdle(), Report(), and StateMachine().

◆ PeerStateNames

const char *const ns3::dot11s::PeerLink::PeerStateNames
static
Initial value:
=
{"IDLE", "OPN_SNT", "CNF_RCVD", "OPN_RCVD", "ESTAB", "HOLDING"}

Literal names of Mesh Peer Management states for use in log messages.

Definition at line 69 of file peer-link.h.

Referenced by ns3::dot11s::PeerManagementProtocol::PeerLinkStatus().


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