24 #include "ns3/peer-link.h"
26 #include "ns3/simulator.h"
27 #include "ns3/traced-value.h"
42 .AddConstructor<PeerLink> ()
43 .AddAttribute (
"RetryTimeout",
50 .AddAttribute (
"HoldingTimeout",
57 .AddAttribute (
"ConfirmTimeout",
64 .AddAttribute (
"MaxRetries",
65 "Maximum number of retries",
67 MakeUintegerAccessor (
69 MakeUintegerChecker<uint16_t> ()
71 .AddAttribute (
"MaxBeaconLoss",
72 "Maximum number of lost beacons before link will be closed",
74 MakeUintegerAccessor (
76 MakeUintegerChecker<uint16_t> (1)
78 .AddAttribute (
"MaxPacketFailure",
79 "Maximum number of failed packets before link will be closed",
81 MakeUintegerAccessor (
83 MakeUintegerChecker<uint16_t> (1)
100 m_lastBeacon (Seconds (0)),
101 m_beaconInterval (Seconds (0)),
695 os <<
"<PeerLink" << std::endl <<
697 "peerInterfaceAddress=\"" <<
m_peerAddress <<
"\"" << std::endl <<
703 "assocId=\"" <<
m_assocId <<
"\"" << std::endl <<
keep track of time values and allow control of global simulation resolution
void SetBeaconTimingElement(IeBeaconTiming beaconTiming)
void TransmissionSuccess()
Reports about transmission success/failure.
Mac48Address m_peerMeshPointAddress
Mesh point address, equal to peer address in case of single interface mesh point. ...
void MLMECancelPeerLink(PmpReasonCode reason)
MLME-CancelPeerLink.request.
void SetPeerAddress(Mac48Address macaddr)
void Report(std::ostream &os) const
Statistics.
uint16_t GetPeerAid() const
SignalStatusCallback m_linkStatusCallback
How to report my status change.
#define NS_ASSERT(condition)
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
Channel is IDLE, no packet is being transmitted.
IeConfiguration m_configuration
Mesh interface configuration.
void StateMachine(PeerEvent event, PmpReasonCode=REASON11S_RESERVED)
State transition.
bool LinkIsIdle() const
True if link is idle. Link can be deleted in this state.
void SetLocalAid(uint16_t aid)
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
IeBeaconTiming m_beaconTiming
Beacon timing element received from the peer. Needed by BCA.
Ptr< PeerManagementProtocolMac > m_macPlugin
pointer to MAC plugin, which is responsible for peer management
void SetLocalLinkId(uint16_t id)
void OpenAccept(uint16_t localLinkId, IeConfiguration conf, Mac48Address peerMp)
Accept open link.
double GetSeconds(void) const
uint16_t m_peerLinkId
Peer ID of this link.
void SendPeerLinkClose(PmpReasonCode reasoncode)
void BeaconLoss()
Several successive beacons were lost, close link.
uint16_t m_packetFail
How many successive packets were failed to transmit.
See 7.3.2.85 of draft 2.07.
int64_t GetMicroSeconds(void) const
hold objects of type ns3::Time
void ClearTimingElement()
Hold an unsigned integer type.
uint16_t GetLocalAid() const
PeerLink()
C-tor create empty link.
void SetPeerClose(uint16_t localLinkID, uint16_t peerLinkId, PmpReasonCode reasonCode)
also timeout of retry timer
See 7.3.2.89 of 802.11s draft 2.07.
uint16_t m_assocId
My association ID.
IeBeaconTiming GetBeaconTimingElement() const
static Mac48Address GetBroadcast(void)
void SetMacPlugin(Ptr< PeerManagementProtocolMac > plugin)
Set pointer to MAC-plugin, which is responsible for sending peer link management frames.
void DoDispose()
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
uint32_t GetLinkMetric(Mac48Address peerAddress)
void Close(uint16_t localLinkID, uint16_t peerLinkID, PmpReasonCode reason)
Close link.
Time m_dot11MeshHoldingTimeout
void MLMEActivePeerLinkOpen()
MLME-ActivePeerLinkOpen.request.
Time m_dot11MeshConfirmTimeout
PeerState m_state
Current state.
Mac48Address m_peerAddress
Peer address.
void SendPeerLinkManagementFrame(Mac48Address peerAddress, Mac48Address peerMpAddress, uint16_t aid, IePeerManagement peerElement, IeConfiguration meshConfig)
PeerLinkOpenReject by internal reason.
NS_LOG_COMPONENT_DEFINE("Dot11sPeerManagementProtocol")
Mac48Address GetAddress() const
debug only, used to print established links
void SetPeerMeshPointAddress(Mac48Address macaddr)
Time GetLastBeacon() const
void SetInterface(uint32_t interface)
void MLMESetSignalStatusCallback(SignalStatusCallback)
Set callback.
void SetBeaconInformation(Time lastBeacon, Time BeaconInterval)
Process beacon received from peer.
Timeout of confirm timer.
uint16_t m_peerAssocId
Assoc Id assigned to me by peer.
EventId m_beaconLossTimer
bool LinkIsEstab() const
True if link is established.
void SetPeerConfirm(uint16_t localLinkID, uint16_t peerLinkId)
PeerEvent
Peer link events, see 802.11s draft 11B.3.3.2.
PmpReasonCode
Codes used by 802.11s Peer Management Protocol.
uint16_t m_dot11MeshMaxRetries
Time m_beaconInterval
Current beacon interval on corresponding interface.
uint16_t m_localLinkId
My ID of this link.
Describes Mesh Configuration Element see 7.3.2.86 of 802.11s draft 3.0.
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::cancel method.
Time m_lastBeacon
When last beacon was received.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
void SetPeerOpen(uint16_t localLinkId)
static TypeId GetTypeId()
Support object system.
a base class which provides memory management and object aggregation
Time GetBeaconInterval() const
void TransmissionFailure()
Callback type for MLME-SignalPeerLinkStatus event.
void SendPeerLinkConfirm()
uint32_t m_interface
The number of interface I am associated with.
Timeout of holding (graceful closing) timer.
Mac48Address GetPeerAddress() const
void ConfirmReject(uint16_t localLinkId, uint16_t peerLinkId, IeConfiguration conf, Mac48Address peerMp, PmpReasonCode reason)
Confirm reject.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Time m_dot11MeshRetryTimeout
void ConfirmAccept(uint16_t localLinkId, uint16_t peerLinkId, uint16_t peerAid, IeConfiguration conf, Mac48Address peerMp)
Confirm accept.
void MLMEPeeringRequestReject()
MLME-PeeringRequestReject.
void OpenReject(uint16_t localLinkId, IeConfiguration conf, Mac48Address peerMp, PmpReasonCode reason)
Reject open link.