|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
24 #include "ns3/peer-link.h"
26 #include "ns3/simulator.h"
27 #include "ns3/traced-value.h"
42 .SetGroupName (
"Mesh")
44 .AddAttribute (
"RetryTimeout",
51 .AddAttribute (
"HoldingTimeout",
58 .AddAttribute (
"ConfirmTimeout",
65 .AddAttribute (
"MaxRetries",
66 "Maximum number of retries",
70 MakeUintegerChecker<uint16_t> ()
72 .AddAttribute (
"MaxBeaconLoss",
73 "Maximum number of lost beacons before link will be closed",
77 MakeUintegerChecker<uint16_t> (1)
79 .AddAttribute (
"MaxPacketFailure",
80 "Maximum number of failed packets before link will be closed",
84 MakeUintegerChecker<uint16_t> (1)
104 m_beaconInterval (
Seconds (0)),
300 NS_LOG_FUNCTION (
this << localLinkId << peerLinkId << peerAid << peerMp);
332 NS_LOG_FUNCTION (
this << localLinkId << peerLinkId << peerMp << reason);
712 os <<
"<PeerLink" << std::endl <<
714 "peerInterfaceAddress=\"" <<
m_peerAddress <<
"\"" << std::endl <<
720 "assocId=\"" <<
m_assocId <<
"\"" << std::endl <<
Peer link model for 802.11s Peer Management protocol.
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void TransmissionFailure()
Callback type for MLME-SignalPeerLinkStatus event.
void SendPeerLinkConfirm()
Send a peer link confirm.
EventId m_confirmTimer
Confirm timer.
PeerEvent
Peer link events, see 802.11s draft 11B.3.3.2.
void OpenReject(uint16_t localLinkId, IeConfiguration conf, Mac48Address peerMp, PmpReasonCode reason)
Reject open link.
void OpenAccept(uint16_t localLinkId, IeConfiguration conf, Mac48Address peerMp)
Accept open link.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
void StateMachine(PeerEvent event, PmpReasonCode=REASON11S_RESERVED)
State transition.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
void SetInterface(uint32_t interface)
Set the interface.
@ TOC
Timeout of confirm timer.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
IeConfiguration m_configuration
Mesh interface configuration.
void ClearTimingElement()
Clear timing element.
uint16_t m_retryCounter
Retry counter.
void MLMECancelPeerLink(PmpReasonCode reason)
MLME-CancelPeerLink.request.
IeBeaconTiming GetBeaconTimingElement() const
Get the beacon timing element.
void ClearConfirmTimer()
Clear the confirm timer.
@ TOR1
Timeout of retry timer.
IeBeaconTiming m_beaconTiming
Beacon timing element received from the peer. Needed by BCA.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
void MLMEActivePeerLinkOpen()
MLME-ActivePeerLinkOpen.request.
See 7.3.2.89 of 802.11s draft 2.07.
Describes Mesh Configuration Element see 7.3.2.86 of 802.11s draft 3.0.
void ConfirmTimeout()
Confirm Timeout event handler.
@ REASON11S_MESH_CLOSE_RCVD
Mac48Address m_peerMeshPointAddress
Mesh point address, equal to peer address in case of single interface mesh point.
EventId m_retryTimer
Retry timer.
Ptr< PeerManagementProtocolMac > m_macPlugin
pointer to MAC plugin, which is responsible for peer management
PmpReasonCode
Codes used by 802.11s Peer Management Protocol.
void SetBeaconTimingElement(IeBeaconTiming beaconTiming)
Set the beacon timing element.
uint16_t GetPeerAid() const
Set the peer association ID.
void SetHoldingTimer()
Set the holding timer.
Mac48Address GetPeerAddress() const
Get the peer address.
@ OPN_RJCT
PeerLinkOpen_Reject.
void SetRetryTimer()
Set the retry timer.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
@ ACTOPN
Active peer link open.
void Close(uint16_t localLinkID, uint16_t peerLinkID, PmpReasonCode reason)
Close link.
Time GetBeaconInterval() const
Get the beacon interval.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
void SetBeaconInformation(Time lastBeacon, Time BeaconInterval)
Process beacon received from peer.
@ CLS_ACPT
PeerLinkClose_Accept.
EventId m_beaconLossTimer
Beacon loss timer.
void SetLocalAid(uint16_t aid)
Set the local association ID.
void SetPeerClose(uint16_t localLinkID, uint16_t peerLinkId, PmpReasonCode reasonCode)
Set peer close function.
static Mac48Address GetBroadcast(void)
void SendPeerLinkOpen()
Send a peer link open.
uint16_t m_dot11MeshMaxRetries
Maximum number of retries.
Time m_dot11MeshHoldingTimeout
Holding timeout.
void BeaconLoss()
Several successive beacons were lost, close link.
uint16_t m_peerLinkId
Peer ID of this link.
Time m_dot11MeshRetryTimeout
Retry timeout.
@ IDLE
Channel is IDLE, no packet is being transmitted.
EventId m_holdingTimer
Holding timer.
void SendPeerLinkManagementFrame(Mac48Address peerAddress, Mac48Address peerMpAddress, uint16_t aid, IePeerManagement peerElement, IeConfiguration meshConfig)
Send peer link management frame function.
void SetConfirmTimer()
Set the confirm timer.
@ CNF_RJCT
PeerLinkConfirm_Reject.
int64_t GetMicroSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
A base class which provides memory management and object aggregation.
uint16_t m_assocId
My association ID.
@ OPN_ACPT
PeerLinkOpen_Accept.
void SetPeerAddress(Mac48Address macaddr)
Set the peer address.
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
void SetMacPlugin(Ptr< PeerManagementProtocolMac > plugin)
Set pointer to MAC-plugin, which is responsible for sending peer link management frames.
uint32_t GetLinkMetric(Mac48Address peerAddress)
Get the link metric.
Time m_dot11MeshConfirmTimeout
Confirm timeout.
SignalStatusCallback m_linkStatusCallback
How to report my status change.
@ TOH
Timeout of holding (graceful closing) timer.
void SendPeerLinkClose(PmpReasonCode reasoncode)
Send a peer link close.
Time m_beaconInterval
Current beacon interval on corresponding interface.
@ REASON11S_PEERING_CANCELLED
Simulation virtual time values and global simulation resolution.
Time m_lastBeacon
When last beacon was received.
PeerState m_state
Current state.
void ConfirmReject(uint16_t localLinkId, uint16_t peerLinkId, IeConfiguration conf, Mac48Address peerMp, PmpReasonCode reason)
Confirm reject.
Time GetLastBeacon() const
Get the time of the last received beacon.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
uint16_t m_peerAssocId
Assoc Id assigned to me by peer.
Mac48Address m_peerAddress
Peer address.
@ REASON11S_MESH_CONFIRM_TIMEOUT
uint16_t GetLocalAid() const
Get the local association ID.
void RetryTimeout()
Retry Timeout event handler.
void TransmissionSuccess()
Reports about transmission success/failure.
void SetPeerMeshPointAddress(Mac48Address macaddr)
Set the peer mesh point address.
void SetPeerConfirm(uint16_t localLinkID, uint16_t peerLinkId)
Set peer confirm function.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
void Report(std::ostream &os) const
Statistics.
void DoDispose()
Destructor implementation.
Time Seconds(double value)
Construct a Time in the indicated unit.
Mac48Address GetAddress() const
debug only, used to print established links
uint16_t m_maxBeaconLoss
Maximum number of lost beacons before link will be closed.
@ TOR2
also timeout of retry timer
AttributeValue implementation for Time.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
static TypeId GetTypeId()
Get the type ID.
@ REASON11S_MESH_MAX_RETRIES
@ CNF_ACPT
PeerLinkConfirm_Accept.
@ REQ_RJCT
PeerLinkOpenReject by internal reason.
Hold an unsigned integer type.
static const char *const PeerStateNames[6]
Literal names of Mesh Peer Management states for use in log messages.
uint32_t m_interface
The number of interface I am associated with.
PeerLink()
C-tor create empty link.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
uint16_t m_maxPacketFail
Maximum number of failed packets before link will be closed.
uint16_t m_packetFail
How many successive packets were failed to transmit.
void SetPeerOpen(uint16_t localLinkId)
Set peer open function.
void ConfirmAccept(uint16_t localLinkId, uint16_t peerLinkId, uint16_t peerAid, IeConfiguration conf, Mac48Address peerMp)
Confirm accept.
according to IEEE 802.11 - 2012
uint16_t m_localLinkId
My ID of this link.
void MLMEPeeringRequestReject()
MLME-PeeringRequestReject.
void ClearHoldingTimer()
Clear the holding timer.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
void SetLocalLinkId(uint16_t id)
Set the local link ID.
void MLMESetSignalStatusCallback(SignalStatusCallback cb)
Set callback.