A Discrete-Event Network Simulator
API
ns3::LrWpanMac Class Reference

Class that implements the LR-WPAN MAC state machine. More...

#include "lr-wpan-mac.h"

+ Inheritance diagram for ns3::LrWpanMac:
+ Collaboration diagram for ns3::LrWpanMac:

Classes

struct  IndTxQueueElement
 Helper structure for managing indirect transmission queue elements. More...
 
struct  TxQueueElement
 Helper structure for managing transmission queue elements. More...
 

Public Types

typedef void(* SentTracedCallback) (Ptr< const Packet > packet, uint8_t retries, uint8_t backoffs)
 TracedCallback signature for sent packets. More...
 
typedef void(* StateTracedCallback) (LrWpanMacState oldState, LrWpanMacState newState)
 TracedCallback signature for LrWpanMacState change events. More...
 

Public Member Functions

 LrWpanMac (void)
 Default constructor. More...
 
virtual ~LrWpanMac (void)
 
LrWpanAssociationStatus GetAssociationStatus (void) const
 Get the current association status. More...
 
Mac64Address GetExtendedAddress (void) const
 Get the extended address of this MAC. More...
 
uint32_t GetIfsSize ()
 Get the size of the Interframe Space according to MPDU size (m_txPkt). More...
 
uint64_t GetMacAckWaitDuration (void) const
 Get the macAckWaitDuration attribute value. More...
 
uint8_t GetMacMaxFrameRetries (void) const
 Get the macMaxFrameRetries attribute value. More...
 
uint16_t GetPanId (void) const
 Get the PAN id used by this MAC. More...
 
Ptr< LrWpanPhyGetPhy (void)
 Get the underlying PHY of the MAC. More...
 
bool GetRxOnWhenIdle (void)
 Check if the receiver will be enabled when the MAC is idle. More...
 
Mac16Address GetShortAddress (void) const
 Get the short address of this MAC. More...
 
uint64_t GetTxPacketSymbols (void)
 Obtain the number of symbols in the packet which is currently being sent by the MAC layer. More...
 
bool isCoordDest (void)
 Check if the packet destination is its coordinator. More...
 
bool isTxAckReq (void)
 Check if the packet to transmit requires acknowledgment. More...
 
void McpsDataRequest (McpsDataRequestParams params, Ptr< Packet > p)
 IEEE 802.15.4-2006, section 7.1.1.1 MCPS-DATA.request Request to transfer a MSDU. More...
 
void MlmePollRequest (MlmePollRequestParams params)
 IEEE 802.15.4-2011, section 6.2.14.2 MLME-POLL.request Prompts the device to request data from the coordinator. More...
 
void MlmeStartRequest (MlmeStartRequestParams params)
 IEEE 802.15.4-2006, section 7.1.14.1 MLME-START.request Request to allow a PAN coordinator to initiate a new PAN or beginning a new superframe configuration. More...
 
void MlmeSyncRequest (MlmeSyncRequestParams params)
 IEEE 802.15.4-2011, section 6.2.13.1 MLME-SYNC.request Request to synchronize with the coordinator by acquiring and, if specified, tracking beacons. More...
 
void PdDataConfirm (LrWpanPhyEnumeration status)
 IEEE 802.15.4-2006 section 6.2.1.2 Confirm the end of transmission of an MPDU to MAC. More...
 
void PdDataIndication (uint32_t psduLength, Ptr< Packet > p, uint8_t lqi)
 IEEE 802.15.4-2006 section 6.2.1.3 PD-DATA.indication Indicates the transfer of an MPDU from PHY to MAC (receiving) More...
 
void PlmeCcaConfirm (LrWpanPhyEnumeration status)
 IEEE 802.15.4-2006 section 6.2.2.2 PLME-CCA.confirm status. More...
 
void PlmeEdConfirm (LrWpanPhyEnumeration status, uint8_t energyLevel)
 IEEE 802.15.4-2006 section 6.2.2.4 PLME-ED.confirm status and energy level. More...
 
void PlmeGetAttributeConfirm (LrWpanPhyEnumeration status, LrWpanPibAttributeIdentifier id, LrWpanPhyPibAttributes *attribute)
 IEEE 802.15.4-2006 section 6.2.2.6 PLME-GET.confirm Get attributes per definition from Table 23 in section 6.4.2. More...
 
void PlmeSetAttributeConfirm (LrWpanPhyEnumeration status, LrWpanPibAttributeIdentifier id)
 IEEE 802.15.4-2006 section 6.2.2.10 PLME-SET.confirm Set attributes per definition from Table 23 in section 6.4.2. More...
 
void PlmeSetTRXStateConfirm (LrWpanPhyEnumeration status)
 IEEE 802.15.4-2006 section 6.2.2.8 PLME-SET-TRX-STATE.confirm Set PHY state. More...
 
void PrintTransmitQueueSize (void)
 Print the number of elements in the packet transmit queue. More...
 
void SetAssociatedCoor (Mac16Address mac)
 Check if the packet destination is its coordinator. More...
 
void SetAssociatedCoor (Mac64Address mac)
 Check if the packet destination is its coordinator. More...
 
void SetAssociationStatus (LrWpanAssociationStatus status)
 Set the current association status. More...
 
void SetCsmaCa (Ptr< LrWpanCsmaCa > csmaCa)
 Set the CSMA/CA implementation to be used by the MAC. More...
 
void SetExtendedAddress (Mac64Address address)
 Set the extended address of this MAC. More...
 
void SetLrWpanMacState (LrWpanMacState macState)
 CSMA-CA algorithm calls back the MAC after executing channel assessment. More...
 
void SetMacMaxFrameRetries (uint8_t retries)
 Set the macMaxFrameRetries attribute value. More...
 
void SetMcpsDataConfirmCallback (McpsDataConfirmCallback c)
 Set the callback for the confirmation of a data transmission request. More...
 
void SetMcpsDataIndicationCallback (McpsDataIndicationCallback c)
 Set the callback for the indication of an incoming data packet. More...
 
void SetMlmeBeaconNotifyIndicationCallback (MlmeBeaconNotifyIndicationCallback c)
 Set the callback for the indication of an incoming beacon packet. More...
 
void SetMlmePollConfirmCallback (MlmePollConfirmCallback c)
 Set the callback for the confirmation of a data transmission request. More...
 
void SetMlmeStartConfirmCallback (MlmeStartConfirmCallback c)
 Set the callback for the confirmation of a data transmission request. More...
 
void SetMlmeSyncLossIndicationCallback (MlmeSyncLossIndicationCallback c)
 Set the callback for the loss of synchronization with a coordinator. More...
 
void SetPanId (uint16_t panId)
 Set the PAN id used by this MAC. More...
 
void SetPhy (Ptr< LrWpanPhy > phy)
 Set the underlying PHY for the MAC. More...
 
void SetRxOnWhenIdle (bool rxOnWhenIdle)
 Set if the receiver should be enabled when the MAC is idle. More...
 
void SetShortAddress (Mac16Address address)
 Set the short address of this MAC. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose (void)
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator (void) const
 Get an iterator to the Objects aggregated to this one. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the most derived TypeId for this Object. More...
 
template<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
template<>
Ptr< ObjectGetObject () const
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 
void Initialize (void)
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized (void) const
 Check if the object has been initialized. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising erros. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

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

Public Attributes

uint32_t m_beaconInterval
 Indication of the Interval used by the coordinator to transmit beacon frames expressed in symbols. More...
 
bool m_beaconTrackingOn
 Indication of whether the current device is tracking incoming beacons. More...
 
uint8_t m_deviceCapability
 Indication of current device capability (FFD or RFD) More...
 
uint8_t m_fnlCapSlot
 Indication of the Slot where the CAP portion of the OUTGOING Superframe ends. More...
 
uint32_t m_ifs
 The value of the necessary InterFrame Space after the transmission of a packet. More...
 
uint32_t m_incomingBeaconInterval
 Indication of the interval a node should receive a superframe expressed in symbols. More...
 
uint8_t m_incomingBeaconOrder
 The beaconOrder value of the INCOMING frame. More...
 
uint8_t m_incomingFnlCapSlot
 Indication of the Slot where the CAP portion of the INCOMING Superframe ends. More...
 
uint32_t m_incomingSuperframeDuration
 Indication of the superframe duration in symbols (e.g. More...
 
uint8_t m_incomingSuperframeOrder
 Used by all devices that have a parent. More...
 
bool m_macAutoRequest
 Indication of whether a device automatically sends data request command if its address is listed in the beacon frame. More...
 
uint8_t m_macBeaconOrder
 Used by a PAN coordinator or coordinator. More...
 
Time m_macBeaconRxTime
 The time that the device received its last bit of the beacon frame. More...
 
Time m_macBeaconTxTime
 The time that the device transmitted its last beacon frame. More...
 
SequenceNumber8 m_macBsn
 Sequence number added to transmitted beacon frame, 00-ff. More...
 
Mac64Address m_macCoordExtendedAddress
 The extended address of the coordinator through which the device is associated. More...
 
Mac16Address m_macCoordShortAddress
 The short address of the coordinator through which the device is associated. More...
 
SequenceNumber8 m_macDsn
 Sequence number added to transmitted data or MAC command frame, 00-ff. More...
 
uint32_t m_macLIFSPeriod
 The minimum time forming a Long InterFrame Spacing (LIFS) period. More...
 
uint8_t m_macMaxFrameRetries
 The maximum number of retries allowed after a transmission failure. More...
 
uint16_t m_macPanId
 16 bits id of PAN on which this device is operating. More...
 
bool m_macPromiscuousMode
 Indicates if MAC sublayer is in receive all mode. More...
 
bool m_macRxOnWhenIdle
 Indication of whether the MAC sublayer is to enable its receiver during idle periods. More...
 
uint32_t m_macSIFSPeriod
 The minimum time forming a Short InterFrame Spacing (SIFS) period. More...
 
uint8_t m_macSuperframeOrder
 Used by a PAN coordinator or coordinator. More...
 
uint64_t m_macSyncSymbolOffset
 Symbol boundary is same as m_macBeaconTxTime. More...
 
uint16_t m_macTransactionPersistanceTime
 The maximum time (in superframe periods) that a transaction is stored by a coordinator and indicated in its beacon. More...
 
uint8_t m_numLostBeacons
 The number of consecutive loss beacons in a beacon tracking operation. More...
 
bool m_panCoor
 Indication of whether the current device is the PAN coordinator. More...
 
uint64_t m_rxBeaconSymbols
 The total size of the received beacon in symbols. More...
 
uint32_t m_superframeDuration
 Indication of the superframe duration in symbols. More...
 

Static Public Attributes

static const uint32_t aBaseSlotDuration = 60
 Length of a superframe slot in symbols. More...
 
static const uint32_t aBaseSuperframeDuration = aBaseSlotDuration * aNumSuperframeSlots
 Length of a superframe in symbols. More...
 
static const uint32_t aMaxLostBeacons = 4
 The number of consecutive lost beacons that will cause the MAC sublayer of a receiving device to declare a loss of synchronization. More...
 
static const uint32_t aMaxSIFSFrameSize = 18
 The maximum size of an MPDU, in octets, that can be followed by a Short InterFrame Spacing (SIFS) period. More...
 
static const uint32_t aMinMPDUOverhead = 9
 The minimum number of octets added by the MAC sublayer to the PSDU. More...
 
static const uint32_t aNumSuperframeSlots = 16
 Number of a superframe slots per superframe. More...
 

Protected Member Functions

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

Private Member Functions

void AckWaitTimeout (void)
 Handle an ACK timeout with a packet retransmission, if there are retransmission left, or a packet drop. More...
 
void AwaitBeacon (void)
 Called after the end of an INCOMING superframe to start the moment a device waits for a new incoming beacon. More...
 
void BeaconSearchTimeout (void)
 Called if the device is unable to locate a beacon in the time set by MLME-SYNC.request. More...
 
void ChangeMacState (LrWpanMacState newState)
 Change the current MAC state to the given new state. More...
 
void CheckQueue (void)
 Check the transmission queue. More...
 
GtsFields GetGtsFields (void)
 Constructs the Guaranteed Time Slots (GTS) Fields from local information The GTS Fields are part of the beacon frame. More...
 
PendingAddrFields GetPendingAddrFields (void)
 Constructs Pending Address Fields from the local information, the Pending Address Fields are part of the beacon frame. More...
 
SuperframeField GetSuperframeField (void)
 Constructs a Superframe specification field from the local information, the superframe Specification field is necessary to create a beacon frame. More...
 
void IfsWaitTimeout (void)
 After a successful transmission of a frame (beacon, data) or an ack frame reception, the mac layer wait an Interframe Space (IFS) time and triggers this function to continue with the MAC flow. More...
 
bool PrepareRetransmission (void)
 Check for remaining retransmissions for the packet currently being sent. More...
 
void RemoveFirstTxQElement ()
 Remove the tip of the transmission queue, including clean up related to the last packet transmission. More...
 
void SendAck (uint8_t seqno)
 Send an acknowledgment packet for the given sequence number. More...
 
void SendOneBeacon (void)
 Called to send a single beacon frame. More...
 
void StartCAP (SuperframeType superframeType)
 Called to begin the Contention Access Period (CAP) in a beacon-enabled mode. More...
 
void StartCFP (SuperframeType superframeType)
 Called to begin the Contention Free Period (CFP) in a beacon-enabled mode. More...
 
void StartInactivePeriod (SuperframeType superframeType)
 Start the Inactive Period in a beacon-enabled mode. More...
 

Private Attributes

EventId m_ackWaitTimeout
 Scheduler event for the ACK timeout of the currently transmitted data packet. More...
 
LrWpanAssociationStatus m_associationStatus
 The current association status of the MAC layer. More...
 
EventId m_beaconEvent
 Scheduler event for generation of one beacon. More...
 
EventId m_capEvent
 Scheduler event for the end of the outgoing superframe CAP. More...
 
EventId m_cfpEvent
 Scheduler event for the end of the outgoing superframe CFP. More...
 
Ptr< LrWpanCsmaCam_csmaCa
 The CSMA/CA implementation used by this MAC. More...
 
EventId m_ifsEvent
 Scheduler event for Interframe spacing wait time. More...
 
EventId m_incCapEvent
 Scheduler event for the end of the incoming superframe CAP. More...
 
EventId m_incCfpEvent
 Scheduler event for the end of the incoming superframe CFP. More...
 
TracedValue< SuperframeStatusm_incSuperframeStatus
 The current period of the incoming superframe. More...
 
std::deque< IndTxQueueElement * > m_indTxQueue
 The indirect transmit queue used by the MAC pending messages. More...
 
TracedValue< LrWpanMacStatem_lrWpanMacState
 The current state of the MAC layer. More...
 
TracedCallback< Ptr< const Packet > > m_macPromiscRxTrace
 The trace source fired for packets successfully received by the device immediately before being forwarded up to higher layers (at the L2/L3 transition). More...
 
TracedCallback< Ptr< const Packet > > m_macRxDropTrace
 The trace source fired for packets successfully received by the device but dropped before being forwarded up to higher layers (at the L2/L3 transition). More...
 
TracedCallback< Ptr< const Packet > > m_macRxTrace
 The trace source fired for packets successfully received by the device immediately before being forwarded up to higher layers (at the L2/L3 transition). More...
 
TracedCallback< LrWpanMacState, LrWpanMacStatem_macStateLogger
 A trace source that fires when the LrWpanMac changes states. More...
 
TracedCallback< Ptr< const Packet > > m_macTxDequeueTrace
 The trace source fired when packets are dequeued from the L3/l2 transmission queue. More...
 
TracedCallback< Ptr< const Packet > > m_macTxDropTrace
 The trace source fired when packets are dropped due to missing ACKs or because of transmission failures in L1. More...
 
TracedCallback< Ptr< const Packet > > m_macTxEnqueueTrace
 The trace source fired when packets come into the "top" of the device at the L3/L2 transition, when being queued for transmission. More...
 
TracedCallback< Ptr< const Packet > > m_macTxOkTrace
 The trace source fired when packets where successfully transmitted, that is an acknowledgment was received, if requested, or the packet was successfully sent by L1, if no ACK was requested. More...
 
TracedCallback< Ptr< const Packet > > m_macTxTrace
 The trace source fired when packets are being sent down to L1. More...
 
McpsDataConfirmCallback m_mcpsDataConfirmCallback
 This callback is used to report data transmission request status to the upper layers. More...
 
McpsDataIndicationCallback m_mcpsDataIndicationCallback
 This callback is used to notify incoming packets to the upper layers. More...
 
MlmeBeaconNotifyIndicationCallback m_mlmeBeaconNotifyIndicationCallback
 This callback is used to notify incoming beacon packets to the upper layers. More...
 
MlmePollConfirmCallback m_mlmePollConfirmCallback
 This callback is used to report the status after a device send data command request to the coordinator to transmit data. More...
 
MlmeStartConfirmCallback m_mlmeStartConfirmCallback
 This callback is used to report the start of a new PAN or the begin of a new superframe configuration. More...
 
MlmeSyncLossIndicationCallback m_mlmeSyncLossIndicationCallback
 This callback is used to indicate the loss of synchronization with a coordinator. More...
 
uint8_t m_numCsmacaRetry
 The number of CSMA/CA retries used for sending the current packet. More...
 
TracedValue< SuperframeStatusm_outSuperframeStatus
 The current period of the outgoing superframe. More...
 
Ptr< LrWpanPhym_phy
 The PHY associated with this MAC. More...
 
TracedCallback< Ptr< const Packet > > m_promiscSnifferTrace
 A trace source that emulates a promiscuous mode protocol sniffer connected to the device. More...
 
uint8_t m_retransmission
 The number of already used retransmission for the currently transmitted packet. More...
 
Mac64Address m_selfExt
 The extended address used by this MAC. More...
 
TracedCallback< Ptr< const Packet >, uint8_t, uint8_t > m_sentPktTrace
 The trace source fired when packets are considered as successfully sent or the transmission has been given up. More...
 
EventId m_setMacState
 Scheduler event for a deferred MAC state change. More...
 
Mac16Address m_shortAddress
 The short address used by this MAC. More...
 
TracedCallback< Ptr< const Packet > > m_snifferTrace
 A trace source that emulates a non-promiscuous protocol sniffer connected to the device. More...
 
EventId m_trackingEvent
 Scheduler event to track the incoming beacons. More...
 
Ptr< Packetm_txPkt
 The packet which is currently being sent by the MAC layer. More...
 
std::deque< TxQueueElement * > m_txQueue
 The transmit queue used by the MAC. More...
 

Additional Inherited Members

Detailed Description

Class that implements the LR-WPAN MAC state machine.


Config Paths

ns3::LrWpanMac is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/DeviceList/[i]/$ns3::LrWpanNetDevice/Mac"

Attributes

  • PanId: 16-bit identifier of the associated PAN
    • Set with class: ns3::UintegerValue
    • Underlying type: uint16_t 0:65535
    • Initial value: 0
    • Flags: construct write read

TraceSources

  • MacTxEnqueue: Trace source indicating a packet has been enqueued in the transaction queue
    Callback signature: ns3::Packet::TracedCallback
  • MacTxDequeue: Trace source indicating a packet has was dequeued from the transaction queue
    Callback signature: ns3::Packet::TracedCallback
  • MacTx: Trace source indicating a packet has arrived for transmission by this device
    Callback signature: ns3::Packet::TracedCallback
  • MacTxOk: Trace source indicating a packet has been successfully sent
    Callback signature: ns3::Packet::TracedCallback
  • MacTxDrop: Trace source indicating a packet has been dropped during transmission
    Callback signature: ns3::Packet::TracedCallback
  • MacPromiscRx: A packet has been received by this device, has been passed up from the physical layer and is being forwarded up the local protocol stack. This is a promiscuous trace,
    Callback signature: ns3::Packet::TracedCallback
  • MacRx: A packet has been received by this device, has been passed up from the physical layer and is being forwarded up the local protocol stack. This is a non-promiscuous trace,
    Callback signature: ns3::Packet::TracedCallback
  • MacRxDrop: Trace source indicating a packet was received, but dropped before being forwarded up the stack
    Callback signature: ns3::Packet::TracedCallback
  • Sniffer: Trace source simulating a non-promiscuous packet sniffer attached to the device
    Callback signature: ns3::Packet::TracedCallback
  • PromiscSniffer: Trace source simulating a promiscuous packet sniffer attached to the device
    Callback signature: ns3::Packet::TracedCallback
  • MacStateValue: The state of LrWpan Mac
    Callback signature: ns3::TracedValueCallback::LrWpanMacState
  • MacIncSuperframeStatus: The period status of the incoming superframe
    Callback signature: ns3::TracedValueCallback::SuperframeState
  • MacOutSuperframeStatus: The period status of the outgoing superframe
    Callback signature: ns3::TracedValueCallback::SuperframeState
  • MacState: The state of LrWpan Mac
    Callback signature: ns3::LrWpanMac::StateTracedCallback
  • MacSentPkt: Trace source reporting some information about the sent packet
    Callback signature: ns3::LrWpanMac::SentTracedCallback

Size of this type is 888 bytes (on a 64-bit architecture).

Definition at line 448 of file lr-wpan-mac.h.

Member Typedef Documentation

◆ SentTracedCallback

typedef void(* ns3::LrWpanMac::SentTracedCallback) (Ptr< const Packet > packet, uint8_t retries, uint8_t backoffs)

TracedCallback signature for sent packets.

Parameters
[in]packetThe packet.
[in]retriesThe number of retries.
[in]backoffsThe number of CSMA backoffs.

Definition at line 964 of file lr-wpan-mac.h.

◆ StateTracedCallback

typedef void(* ns3::LrWpanMac::StateTracedCallback) (LrWpanMacState oldState, LrWpanMacState newState)

TracedCallback signature for LrWpanMacState change events.

Parameters
[in]oldValueThe original state value.
[in]newValueThe new state value.
Deprecated:
The LrWpanMacState is now accessible as the TracedValue MacStateValue. The MacState TracedCallback will be removed in a future release.

Definition at line 975 of file lr-wpan-mac.h.

Constructor & Destructor Documentation

◆ LrWpanMac()

◆ ~LrWpanMac()

ns3::LrWpanMac::~LrWpanMac ( void  )
virtual

Definition at line 192 of file lr-wpan-mac.cc.

Member Function Documentation

◆ AckWaitTimeout()

void ns3::LrWpanMac::AckWaitTimeout ( void  )
private

Handle an ACK timeout with a packet retransmission, if there are retransmission left, or a packet drop.

Definition at line 1439 of file lr-wpan-mac.cc.

References ns3::MAC_CSMA, ns3::MAC_IDLE, NS_LOG_FUNCTION, PrepareRetransmission(), and SetLrWpanMacState().

Referenced by PdDataConfirm().

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

◆ AwaitBeacon()

void ns3::LrWpanMac::AwaitBeacon ( void  )
private

Called after the end of an INCOMING superframe to start the moment a device waits for a new incoming beacon.

Definition at line 833 of file lr-wpan-mac.cc.

References ns3::BEACON, and m_incSuperframeStatus.

Referenced by StartInactivePeriod().

+ Here is the caller graph for this function:

◆ BeaconSearchTimeout()

void ns3::LrWpanMac::BeaconSearchTimeout ( void  )
private

Called if the device is unable to locate a beacon in the time set by MLME-SYNC.request.

Definition at line 846 of file lr-wpan-mac.cc.

References aBaseSuperframeDuration, aMaxLostBeacons, m_beaconTrackingOn, m_incomingBeaconOrder, ns3::MlmeSyncLossIndicationParams::m_lossReason, m_macPanId, m_mlmeSyncLossIndicationCallback, m_numLostBeacons, ns3::MlmeSyncLossIndicationParams::m_panId, m_phy, m_trackingEvent, ns3::MLMESYNCLOSS_BEACON_LOST, ns3::Simulator::Schedule(), and ns3::Seconds().

Referenced by MlmeSyncRequest(), and PdDataIndication().

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

◆ ChangeMacState()

void ns3::LrWpanMac::ChangeMacState ( LrWpanMacState  newState)
private

Change the current MAC state to the given new state.

Parameters
newStatethe new state

Definition at line 1771 of file lr-wpan-mac.cc.

References m_lrWpanMacState, m_macStateLogger, and NS_LOG_LOGIC.

Referenced by LrWpanMac(), PdDataIndication(), SendAck(), SendOneBeacon(), and SetLrWpanMacState().

+ Here is the caller graph for this function:

◆ CheckQueue()

void ns3::LrWpanMac::CheckQueue ( void  )
private

Check the transmission queue.

If there are packets in the transmission queue and the MAC is idle, pick the first one and initiate a packet transmission.

Definition at line 877 of file lr-wpan-mac.cc.

References ns3::CAP, ns3::EventId::IsRunning(), m_csmaCa, m_incSuperframeStatus, m_lrWpanMacState, m_outSuperframeStatus, m_panCoor, m_setMacState, m_txPkt, m_txQueue, ns3::MAC_CSMA, ns3::MAC_IDLE, NS_LOG_FUNCTION, ns3::Simulator::ScheduleNow(), SetLrWpanMacState(), and ns3::LrWpanMac::TxQueueElement::txQPkt.

Referenced by McpsDataRequest(), SetLrWpanMacState(), and StartCAP().

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

◆ DoDispose()

void ns3::LrWpanMac::DoDispose ( void  )
protectedvirtual

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 211 of file lr-wpan-mac.cc.

References ns3::EventId::Cancel(), ns3::Object::DoDispose(), m_beaconEvent, m_csmaCa, m_mcpsDataConfirmCallback, m_mcpsDataIndicationCallback, m_phy, m_txPkt, and m_txQueue.

+ Here is the call graph for this function:

◆ DoInitialize()

void ns3::LrWpanMac::DoInitialize ( void  )
protectedvirtual

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 196 of file lr-wpan-mac.cc.

References ns3::Object::DoInitialize(), ns3::IEEE_802_15_4_PHY_RX_ON, ns3::IEEE_802_15_4_PHY_TRX_OFF, m_macRxOnWhenIdle, and m_phy.

+ Here is the call graph for this function:

◆ GetAssociationStatus()

LrWpanAssociationStatus ns3::LrWpanMac::GetAssociationStatus ( void  ) const

Get the current association status.

Returns
current association status

Definition at line 1747 of file lr-wpan-mac.cc.

References m_associationStatus.

◆ GetExtendedAddress()

Mac64Address ns3::LrWpanMac::GetExtendedAddress ( void  ) const

Get the extended address of this MAC.

Returns
the extended address

Definition at line 282 of file lr-wpan-mac.cc.

References m_selfExt, and NS_LOG_FUNCTION.

Referenced by McpsDataRequest(), and SendOneBeacon().

+ Here is the caller graph for this function:

◆ GetGtsFields()

GtsFields ns3::LrWpanMac::GetGtsFields ( void  )
private

Constructs the Guaranteed Time Slots (GTS) Fields from local information The GTS Fields are part of the beacon frame.

Definition at line 920 of file lr-wpan-mac.cc.

Referenced by SendOneBeacon().

+ Here is the caller graph for this function:

◆ GetIfsSize()

uint32_t ns3::LrWpanMac::GetIfsSize ( )

Get the size of the Interframe Space according to MPDU size (m_txPkt).

Returns
the IFS size in symbols

Definition at line 1827 of file lr-wpan-mac.cc.

References aMaxSIFSFrameSize, ns3::Packet::GetSize(), m_macLIFSPeriod, m_macSIFSPeriod, m_txPkt, and NS_ASSERT.

Referenced by PdDataConfirm(), and PdDataIndication().

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

◆ GetMacAckWaitDuration()

uint64_t ns3::LrWpanMac::GetMacAckWaitDuration ( void  ) const

Get the macAckWaitDuration attribute value.

Returns
the maximum number symbols to wait for an acknowledgment frame

Definition at line 1781 of file lr-wpan-mac.cc.

References m_csmaCa, and m_phy.

Referenced by PdDataConfirm().

+ Here is the caller graph for this function:

◆ GetMacMaxFrameRetries()

uint8_t ns3::LrWpanMac::GetMacMaxFrameRetries ( void  ) const

Get the macMaxFrameRetries attribute value.

Returns
the maximum number of retries

Definition at line 1788 of file lr-wpan-mac.cc.

References m_macMaxFrameRetries.

◆ GetPanId()

uint16_t ns3::LrWpanMac::GetPanId ( void  ) const

Get the PAN id used by this MAC.

Returns
the PAN id.

Definition at line 1759 of file lr-wpan-mac.cc.

References m_macPanId.

Referenced by McpsDataRequest(), and SendOneBeacon().

+ Here is the caller graph for this function:

◆ GetPendingAddrFields()

PendingAddrFields ns3::LrWpanMac::GetPendingAddrFields ( void  )
private

Constructs Pending Address Fields from the local information, the Pending Address Fields are part of the beacon frame.

Definition at line 930 of file lr-wpan-mac.cc.

Referenced by SendOneBeacon().

+ Here is the caller graph for this function:

◆ GetPhy()

Ptr< LrWpanPhy > ns3::LrWpanMac::GetPhy ( void  )

Get the underlying PHY of the MAC.

Returns
the PHY

Definition at line 952 of file lr-wpan-mac.cc.

References m_phy.

◆ GetRxOnWhenIdle()

bool ns3::LrWpanMac::GetRxOnWhenIdle ( void  )

Check if the receiver will be enabled when the MAC is idle.

Returns
true, if the receiver is enabled during idle periods, false otherwise

Definition at line 235 of file lr-wpan-mac.cc.

References m_macRxOnWhenIdle.

◆ GetShortAddress()

Mac16Address ns3::LrWpanMac::GetShortAddress ( void  ) const

Get the short address of this MAC.

Returns
the short address

Definition at line 275 of file lr-wpan-mac.cc.

References m_shortAddress, and NS_LOG_FUNCTION.

Referenced by McpsDataRequest(), MlmeStartRequest(), and SendOneBeacon().

+ Here is the caller graph for this function:

◆ GetSuperframeField()

SuperframeField ns3::LrWpanMac::GetSuperframeField ( void  )
private

Constructs a Superframe specification field from the local information, the superframe Specification field is necessary to create a beacon frame.

Definition at line 895 of file lr-wpan-mac.cc.

References m_csmaCa, m_fnlCapSlot, m_macBeaconOrder, m_macSuperframeOrder, m_panCoor, ns3::SuperframeField::SetBattLifeExt(), ns3::SuperframeField::SetBeaconOrder(), ns3::SuperframeField::SetFinalCapSlot(), ns3::SuperframeField::SetPanCoor(), and ns3::SuperframeField::SetSuperframeOrder().

Referenced by SendOneBeacon().

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

◆ GetTxPacketSymbols()

uint64_t ns3::LrWpanMac::GetTxPacketSymbols ( void  )

Obtain the number of symbols in the packet which is currently being sent by the MAC layer.

Returns
packet number of symbols

Definition at line 1855 of file lr-wpan-mac.cc.

References ns3::Packet::GetSize(), m_phy, m_txPkt, and NS_ASSERT.

+ Here is the call graph for this function:

◆ GetTypeId()

◆ IfsWaitTimeout()

void ns3::LrWpanMac::IfsWaitTimeout ( void  )
private

After a successful transmission of a frame (beacon, data) or an ack frame reception, the mac layer wait an Interframe Space (IFS) time and triggers this function to continue with the MAC flow.

Definition at line 1457 of file lr-wpan-mac.cc.

References ns3::EventId::Cancel(), m_setMacState, ns3::MAC_IDLE, NS_LOG_DEBUG, ns3::Simulator::ScheduleNow(), and SetLrWpanMacState().

Referenced by PdDataConfirm(), and PdDataIndication().

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

◆ isCoordDest()

bool ns3::LrWpanMac::isCoordDest ( void  )

Check if the packet destination is its coordinator.

Returns
True if m_txPkt (packet awaiting to be sent) destination is its coordinator

Definition at line 1806 of file lr-wpan-mac.cc.

References ns3::LrWpanMacHeader::GetExtDstAddr(), ns3::LrWpanMacHeader::GetShortDstAddr(), m_macCoordExtendedAddress, m_macCoordShortAddress, m_txPkt, NS_ASSERT, and ns3::Packet::PeekHeader().

+ Here is the call graph for this function:

◆ isTxAckReq()

bool ns3::LrWpanMac::isTxAckReq ( void  )

Check if the packet to transmit requires acknowledgment.

Returns
True if the Tx packet requires acknowledgment

Definition at line 1864 of file lr-wpan-mac.cc.

References ns3::LrWpanMacHeader::IsAckReq(), m_txPkt, NS_ASSERT, and ns3::Packet::PeekHeader().

+ Here is the call graph for this function:

◆ McpsDataRequest()

void ns3::LrWpanMac::McpsDataRequest ( McpsDataRequestParams  params,
Ptr< Packet p 
)

IEEE 802.15.4-2006, section 7.1.1.1 MCPS-DATA.request Request to transfer a MSDU.

Parameters
paramsthe request parameters
pthe packet to be transmitted

Definition at line 288 of file lr-wpan-mac.cc.

References aBaseSuperframeDuration, ns3::Packet::AddHeader(), ns3::ADDR_MODE_RESERVED, ns3::Packet::AddTrailer(), ns3::LrWpanPhy::aMaxPhyPacketSize, aMinMPDUOverhead, CheckQueue(), ns3::Node::ChecksumEnabled(), ns3::LrWpanMacTrailer::EnableFcs(), ns3::LrWpanMac::IndTxQueueElement::expireTime, ns3::EXT_ADDR, GetExtendedAddress(), GetPanId(), ns3::Time::GetSeconds(), GetShortAddress(), ns3::Packet::GetSize(), ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::GetValue(), ns3::IEEE_802_15_4_FRAME_TOO_LONG, ns3::IEEE_802_15_4_INVALID_ADDRESS, ns3::IEEE_802_15_4_TRANSACTION_OVERFLOW, ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), ns3::LrWpanMacHeader::LRWPAN_MAC_DATA, ns3::McpsDataRequestParams::m_dstAddr, ns3::McpsDataRequestParams::m_dstAddrMode, ns3::McpsDataRequestParams::m_dstExtAddr, ns3::McpsDataRequestParams::m_dstPanId, m_indTxQueue, m_macBeaconOrder, m_macDsn, m_macTransactionPersistanceTime, m_macTxEnqueueTrace, m_mcpsDataConfirmCallback, ns3::McpsDataRequestParams::m_msduHandle, ns3::McpsDataConfirmParams::m_msduHandle, m_phy, ns3::McpsDataRequestParams::m_srcAddrMode, ns3::McpsDataConfirmParams::m_status, ns3::McpsDataRequestParams::m_txOptions, m_txQueue, ns3::MicroSeconds(), ns3::NO_PANID_ADDR, ns3::Simulator::Now(), NS_ABORT_MSG, NS_LOG_ERROR, NS_LOG_FUNCTION, ns3::LrWpanMacTrailer::SetFcs(), ns3::SHORT_ADDR, ns3::TX_OPTION_ACK, ns3::TX_OPTION_GTS, ns3::TX_OPTION_INDIRECT, ns3::LrWpanMac::TxQueueElement::txQMsduHandle, ns3::LrWpanMac::IndTxQueueElement::txQMsduHandle, ns3::LrWpanMac::TxQueueElement::txQPkt, and ns3::LrWpanMac::IndTxQueueElement::txQPkt.

+ Here is the call graph for this function:

◆ MlmePollRequest()

void ns3::LrWpanMac::MlmePollRequest ( MlmePollRequestParams  params)

IEEE 802.15.4-2011, section 6.2.14.2 MLME-POLL.request Prompts the device to request data from the coordinator.

Parameters
paramsthe request parameters

Definition at line 631 of file lr-wpan-mac.cc.

References ns3::CommandPayloadHeader::DATA_REQ, ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::GetValue(), ns3::LrWpanMacHeader::LRWPAN_MAC_COMMAND, m_macBsn, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ MlmeStartRequest()

◆ MlmeSyncRequest()

void ns3::LrWpanMac::MlmeSyncRequest ( MlmeSyncRequestParams  params)

IEEE 802.15.4-2011, section 6.2.13.1 MLME-SYNC.request Request to synchronize with the coordinator by acquiring and, if specified, tracking beacons.

Parameters
paramsthe request parameters

Definition at line 591 of file lr-wpan-mac.cc.

References aBaseSuperframeDuration, BeaconSearchTimeout(), ns3::EventId::Cancel(), ns3::IEEE_802_15_4_PHY_RX_ON, ns3::EventId::IsRunning(), m_beaconTrackingOn, m_incomingBeaconOrder, ns3::MlmeSyncRequestParams::m_logCh, m_macPanId, m_numLostBeacons, m_phy, ns3::MlmeSyncRequestParams::m_trackBcn, m_trackingEvent, NS_ASSERT, NS_LOG_FUNCTION, ns3::phyCurrentChannel, ns3::LrWpanPhyPibAttributes::phyCurrentChannel, ns3::Simulator::Schedule(), and ns3::Seconds().

+ Here is the call graph for this function:

◆ PdDataConfirm()

void ns3::LrWpanMac::PdDataConfirm ( LrWpanPhyEnumeration  status)

◆ PdDataIndication()

void ns3::LrWpanMac::PdDataIndication ( uint32_t  psduLength,
Ptr< Packet p,
uint8_t  lqi 
)

IEEE 802.15.4-2006 section 6.2.1.3 PD-DATA.indication Indicates the transfer of an MPDU from PHY to MAC (receiving)

Parameters
psduLengthnumber of bytes in the PSDU
pthe packet to be transmitted
lqiLink quality (LQI) value measured during reception of the PPDU

Definition at line 994 of file lr-wpan-mac.cc.

References aBaseSuperframeDuration, ns3::Time::As(), BeaconSearchTimeout(), ns3::EventId::Cancel(), ChangeMacState(), ns3::LrWpanMacTrailer::CheckFcs(), ns3::Node::ChecksumEnabled(), ns3::Packet::Copy(), ns3::Mac16Address::CopyTo(), ns3::LrWpanMacTrailer::EnableFcs(), ns3::EXT_ADDR, ns3::SuperframeField::GetBeaconOrder(), ns3::LrWpanMacHeader::GetDstAddrMode(), ns3::LrWpanMacHeader::GetDstPanId(), ns3::LrWpanMacHeader::GetExtDstAddr(), ns3::LrWpanMacHeader::GetExtSrcAddr(), ns3::SuperframeField::GetFinalCapSlot(), ns3::SuperframeField::GetFrameOrder(), ns3::LrWpanMacHeader::GetFrameVer(), GetIfsSize(), ns3::BeaconPayloadHeader::GetPndAddrFields(), ns3::LrWpanMacHeader::GetSeqNum(), ns3::LrWpanMacHeader::GetShortDstAddr(), ns3::LrWpanMacHeader::GetShortSrcAddr(), ns3::Packet::GetSize(), ns3::LrWpanMacHeader::GetSrcAddrMode(), ns3::LrWpanMacHeader::GetSrcPanId(), ns3::BeaconPayloadHeader::GetSuperframeSpecField(), ns3::LrWpanMacHeader::GetType(), ns3::IEEE_802_15_4_SUCCESS, IfsWaitTimeout(), ns3::INCOMING, ns3::LrWpanMacHeader::IsAcknowledgment(), ns3::LrWpanMacHeader::IsAckReq(), ns3::SuperframeField::IsBattLifeExt(), ns3::LrWpanMacHeader::IsBeacon(), ns3::LrWpanMacHeader::IsCommand(), ns3::LrWpanMacHeader::IsData(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), ns3::EventId::IsRunning(), ns3::LrWpanMacHeader::LRWPAN_MAC_BEACON, ns3::LrWpanMacHeader::LRWPAN_MAC_COMMAND, ns3::LrWpanMacHeader::LRWPAN_MAC_DATA, ns3::LrWpanMacHeader::LRWPAN_MAC_RESERVED, m_ackWaitTimeout, m_beaconTrackingOn, ns3::MlmeBeaconNotifyIndicationParams::m_bsn, m_csmaCa, ns3::McpsDataIndicationParams::m_dsn, ns3::McpsDataIndicationParams::m_dstAddr, ns3::McpsDataIndicationParams::m_dstAddrMode, ns3::McpsDataIndicationParams::m_dstExtAddr, ns3::McpsDataIndicationParams::m_dstPanId, m_ifsEvent, m_incCapEvent, m_incomingBeaconInterval, m_incomingBeaconOrder, m_incomingFnlCapSlot, m_incomingSuperframeDuration, m_incomingSuperframeOrder, m_lrWpanMacState, m_macAutoRequest, m_macBeaconRxTime, m_macPanId, m_macPromiscRxTrace, m_macPromiscuousMode, m_macRxDropTrace, m_macRxTrace, m_macTxOkTrace, m_mcpsDataConfirmCallback, m_mcpsDataIndicationCallback, m_mlmeBeaconNotifyIndicationCallback, ns3::McpsDataIndicationParams::m_mpduLinkQuality, ns3::McpsDataConfirmParams::m_msduHandle, m_numLostBeacons, m_phy, m_promiscSnifferTrace, m_rxBeaconSymbols, m_selfExt, m_setMacState, m_shortAddress, ns3::McpsDataIndicationParams::m_srcAddr, ns3::McpsDataIndicationParams::m_srcAddrMode, ns3::McpsDataIndicationParams::m_srcExtAddr, ns3::McpsDataIndicationParams::m_srcPanId, ns3::McpsDataConfirmParams::m_status, m_trackingEvent, m_txPkt, m_txQueue, ns3::MAC_ACK_PENDING, ns3::MAC_CSMA, ns3::MAC_IDLE, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_ERROR, NS_LOG_FUNCTION, ns3::Packet::PeekHeader(), PrepareRetransmission(), RemoveFirstTxQElement(), ns3::Packet::RemoveHeader(), ns3::Packet::RemoveTrailer(), ns3::Time::S, ns3::Simulator::Schedule(), ns3::Simulator::ScheduleNow(), ns3::Seconds(), SendAck(), SetLrWpanMacState(), ns3::SHORT_ADDR, StartCAP(), and ns3::LrWpanMac::TxQueueElement::txQMsduHandle.

Referenced by ns3::LrWpanNetDevice::CompleteConfig().

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

◆ PlmeCcaConfirm()

void ns3::LrWpanMac::PlmeCcaConfirm ( LrWpanPhyEnumeration  status)

IEEE 802.15.4-2006 section 6.2.2.2 PLME-CCA.confirm status.

Parameters
statusTRX_OFF, BUSY or IDLE

Definition at line 1614 of file lr-wpan-mac.cc.

References m_csmaCa, and NS_LOG_FUNCTION.

◆ PlmeEdConfirm()

void ns3::LrWpanMac::PlmeEdConfirm ( LrWpanPhyEnumeration  status,
uint8_t  energyLevel 
)

IEEE 802.15.4-2006 section 6.2.2.4 PLME-ED.confirm status and energy level.

Parameters
statusSUCCESS, TRX_OFF or TX_ON
energyLevel0x00-0xff ED level for the channel

Definition at line 1622 of file lr-wpan-mac.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::LrWpanNetDevice::CompleteConfig().

+ Here is the caller graph for this function:

◆ PlmeGetAttributeConfirm()

void ns3::LrWpanMac::PlmeGetAttributeConfirm ( LrWpanPhyEnumeration  status,
LrWpanPibAttributeIdentifier  id,
LrWpanPhyPibAttributes attribute 
)

IEEE 802.15.4-2006 section 6.2.2.6 PLME-GET.confirm Get attributes per definition from Table 23 in section 6.4.2.

Parameters
statusSUCCESS or UNSUPPORTED_ATTRIBUTE
idthe attributed identifier
attributethe attribute value

Definition at line 1629 of file lr-wpan-mac.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::LrWpanNetDevice::CompleteConfig().

+ Here is the caller graph for this function:

◆ PlmeSetAttributeConfirm()

void ns3::LrWpanMac::PlmeSetAttributeConfirm ( LrWpanPhyEnumeration  status,
LrWpanPibAttributeIdentifier  id 
)

IEEE 802.15.4-2006 section 6.2.2.10 PLME-SET.confirm Set attributes per definition from Table 23 in section 6.4.2.

Parameters
statusSUCCESS, UNSUPPORTED_ATTRIBUTE, INVALID_PARAMETER, or READ_ONLY
idthe attributed identifier

Definition at line 1675 of file lr-wpan-mac.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::LrWpanNetDevice::CompleteConfig().

+ Here is the caller graph for this function:

◆ PlmeSetTRXStateConfirm()

void ns3::LrWpanMac::PlmeSetTRXStateConfirm ( LrWpanPhyEnumeration  status)

IEEE 802.15.4-2006 section 6.2.2.8 PLME-SET-TRX-STATE.confirm Set PHY state.

Parameters
statusin RX_ON,TRX_OFF,FORCE_TRX_OFF,TX_ON

Definition at line 1637 of file lr-wpan-mac.cc.

References ns3::Packet::GetSize(), ns3::IEEE_802_15_4_PHY_RX_ON, ns3::IEEE_802_15_4_PHY_SUCCESS, ns3::IEEE_802_15_4_PHY_TRX_OFF, ns3::IEEE_802_15_4_PHY_TX_ON, m_csmaCa, m_lrWpanMacState, m_macTxTrace, m_phy, m_promiscSnifferTrace, m_snifferTrace, m_txPkt, ns3::MAC_ACK_PENDING, ns3::MAC_CSMA, ns3::MAC_IDLE, ns3::MAC_SENDING, NS_ASSERT, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

Referenced by ns3::LrWpanNetDevice::CompleteConfig().

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

◆ PrepareRetransmission()

bool ns3::LrWpanMac::PrepareRetransmission ( void  )
private

Check for remaining retransmissions for the packet currently being sent.

Drop the packet, if there are no retransmissions left.

Returns
true, if the packet should be retransmitted, false otherwise.

Definition at line 1466 of file lr-wpan-mac.cc.

References ns3::IEEE_802_15_4_NO_ACK, ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_csmaCa, m_macMaxFrameRetries, m_macTxDropTrace, m_mcpsDataConfirmCallback, ns3::McpsDataConfirmParams::m_msduHandle, m_numCsmacaRetry, m_retransmission, ns3::McpsDataConfirmParams::m_status, m_txQueue, NS_LOG_FUNCTION, RemoveFirstTxQElement(), ns3::LrWpanMac::TxQueueElement::txQMsduHandle, and ns3::LrWpanMac::TxQueueElement::txQPkt.

Referenced by AckWaitTimeout(), and PdDataIndication().

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

◆ PrintTransmitQueueSize()

void ns3::LrWpanMac::PrintTransmitQueueSize ( void  )

Print the number of elements in the packet transmit queue.

Definition at line 1794 of file lr-wpan-mac.cc.

References m_txQueue, and NS_LOG_DEBUG.

◆ RemoveFirstTxQElement()

void ns3::LrWpanMac::RemoveFirstTxQElement ( )
private

Remove the tip of the transmission queue, including clean up related to the last packet transmission.

Definition at line 1415 of file lr-wpan-mac.cc.

References ns3::Packet::Copy(), ns3::LrWpanMacHeader::GetShortDstAddr(), m_csmaCa, m_macTxDequeueTrace, m_numCsmacaRetry, m_retransmission, m_sentPktTrace, m_txPkt, m_txQueue, ns3::Packet::RemoveHeader(), and ns3::LrWpanMac::TxQueueElement::txQPkt.

Referenced by PdDataConfirm(), PdDataIndication(), PrepareRetransmission(), and SetLrWpanMacState().

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

◆ SendAck()

void ns3::LrWpanMac::SendAck ( uint8_t  seqno)
private

Send an acknowledgment packet for the given sequence number.

Parameters
seqnothe sequence number for the ACK

Definition at line 1385 of file lr-wpan-mac.cc.

References ns3::Packet::AddHeader(), ns3::Packet::AddTrailer(), ChangeMacState(), ns3::Node::ChecksumEnabled(), ns3::LrWpanMacTrailer::EnableFcs(), ns3::IEEE_802_15_4_PHY_TX_ON, ns3::LrWpanMacHeader::LRWPAN_MAC_ACKNOWLEDGMENT, m_lrWpanMacState, m_phy, m_txPkt, ns3::MAC_IDLE, ns3::MAC_SENDING, NS_ASSERT, NS_LOG_FUNCTION, and ns3::LrWpanMacTrailer::SetFcs().

Referenced by PdDataIndication().

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

◆ SendOneBeacon()

◆ SetAssociatedCoor() [1/2]

void ns3::LrWpanMac::SetAssociatedCoor ( Mac16Address  mac)

Check if the packet destination is its coordinator.

Parameters
macThe coordinator short MAC Address

Definition at line 1842 of file lr-wpan-mac.cc.

References m_macCoordShortAddress, and third::mac.

◆ SetAssociatedCoor() [2/2]

void ns3::LrWpanMac::SetAssociatedCoor ( Mac64Address  mac)

Check if the packet destination is its coordinator.

Parameters
macThe coordinator extended MAC Address

Definition at line 1848 of file lr-wpan-mac.cc.

References m_macCoordExtendedAddress, and third::mac.

◆ SetAssociationStatus()

void ns3::LrWpanMac::SetAssociationStatus ( LrWpanAssociationStatus  status)

Set the current association status.

Parameters
statusnew association status

Definition at line 1753 of file lr-wpan-mac.cc.

References m_associationStatus.

◆ SetCsmaCa()

void ns3::LrWpanMac::SetCsmaCa ( Ptr< LrWpanCsmaCa csmaCa)

Set the CSMA/CA implementation to be used by the MAC.

Parameters
csmaCathe CSMA/CA implementation

Definition at line 940 of file lr-wpan-mac.cc.

References m_csmaCa.

◆ SetExtendedAddress()

void ns3::LrWpanMac::SetExtendedAddress ( Mac64Address  address)

Set the extended address of this MAC.

Parameters
addressthe new address

Definition at line 267 of file lr-wpan-mac.cc.

References first::address, and m_selfExt.

◆ SetLrWpanMacState()

◆ SetMacMaxFrameRetries()

void ns3::LrWpanMac::SetMacMaxFrameRetries ( uint8_t  retries)

Set the macMaxFrameRetries attribute value.

Parameters
retriesthe maximum number of retries

Definition at line 1800 of file lr-wpan-mac.cc.

References m_macMaxFrameRetries.

◆ SetMcpsDataConfirmCallback()

void ns3::LrWpanMac::SetMcpsDataConfirmCallback ( McpsDataConfirmCallback  c)

Set the callback for the confirmation of a data transmission request.

The callback implements MCPS-DATA.confirm SAP of IEEE 802.15.4-2006, section 7.1.1.2.

Parameters
cthe callback

Definition at line 964 of file lr-wpan-mac.cc.

References m_mcpsDataConfirmCallback.

◆ SetMcpsDataIndicationCallback()

void ns3::LrWpanMac::SetMcpsDataIndicationCallback ( McpsDataIndicationCallback  c)

Set the callback for the indication of an incoming data packet.

The callback implements MCPS-DATA.indication SAP of IEEE 802.15.4-2006, section 7.1.1.3.

Parameters
cthe callback

Definition at line 958 of file lr-wpan-mac.cc.

References m_mcpsDataIndicationCallback.

◆ SetMlmeBeaconNotifyIndicationCallback()

void ns3::LrWpanMac::SetMlmeBeaconNotifyIndicationCallback ( MlmeBeaconNotifyIndicationCallback  c)

Set the callback for the indication of an incoming beacon packet.

The callback implements MLME-BEACON-NOTIFY.indication SAP of IEEE 802.15.4-2011, section 6.2.4.1.

Parameters
cthe callback

Definition at line 976 of file lr-wpan-mac.cc.

References m_mlmeBeaconNotifyIndicationCallback.

◆ SetMlmePollConfirmCallback()

void ns3::LrWpanMac::SetMlmePollConfirmCallback ( MlmePollConfirmCallback  c)

Set the callback for the confirmation of a data transmission request.

The callback implements MLME-POLL.confirm SAP of IEEE 802.15.4-2011, section 6.2.14.2

Parameters
cthe callback

Definition at line 988 of file lr-wpan-mac.cc.

References m_mlmePollConfirmCallback.

◆ SetMlmeStartConfirmCallback()

void ns3::LrWpanMac::SetMlmeStartConfirmCallback ( MlmeStartConfirmCallback  c)

Set the callback for the confirmation of a data transmission request.

The callback implements MLME-START.confirm SAP of IEEE 802.15.4-2006, section 7.1.14.2.

Parameters
cthe callback

Definition at line 970 of file lr-wpan-mac.cc.

References m_mlmeStartConfirmCallback.

◆ SetMlmeSyncLossIndicationCallback()

void ns3::LrWpanMac::SetMlmeSyncLossIndicationCallback ( MlmeSyncLossIndicationCallback  c)

Set the callback for the loss of synchronization with a coordinator.

The callback implements MLME-BEACON-NOTIFY.indication SAP of IEEE 802.15.4-2011, section 6.2.13.2.

Parameters
cthe callback

Definition at line 982 of file lr-wpan-mac.cc.

References m_mlmeSyncLossIndicationCallback.

◆ SetPanId()

void ns3::LrWpanMac::SetPanId ( uint16_t  panId)

Set the PAN id used by this MAC.

Parameters
panIdthe new PAN id.

Definition at line 1765 of file lr-wpan-mac.cc.

References m_macPanId.

◆ SetPhy()

void ns3::LrWpanMac::SetPhy ( Ptr< LrWpanPhy phy)

Set the underlying PHY for the MAC.

Parameters
phythe PHY

Definition at line 946 of file lr-wpan-mac.cc.

References m_phy, and third::phy.

◆ SetRxOnWhenIdle()

void ns3::LrWpanMac::SetRxOnWhenIdle ( bool  rxOnWhenIdle)

Set if the receiver should be enabled when the MAC is idle.

Parameters
rxOnWhenIdleset to true to enable the receiver during idle periods

Definition at line 241 of file lr-wpan-mac.cc.

References ns3::IEEE_802_15_4_PHY_RX_ON, ns3::IEEE_802_15_4_PHY_TRX_OFF, m_lrWpanMacState, m_macRxOnWhenIdle, m_phy, ns3::MAC_IDLE, and NS_LOG_FUNCTION.

◆ SetShortAddress()

void ns3::LrWpanMac::SetShortAddress ( Mac16Address  address)

Set the short address of this MAC.

Parameters
addressthe new address

Definition at line 260 of file lr-wpan-mac.cc.

References first::address, and m_shortAddress.

◆ StartCAP()

void ns3::LrWpanMac::StartCAP ( SuperframeType  superframeType)
private

Called to begin the Contention Access Period (CAP) in a beacon-enabled mode.

Parameters
superframeTypeThe incoming or outgoing superframe reference

Definition at line 703 of file lr-wpan-mac.cc.

References ns3::CAP, CheckQueue(), ns3::INCOMING, m_capEvent, m_fnlCapSlot, m_incomingFnlCapSlot, m_incomingSuperframeDuration, m_incSuperframeStatus, m_macBeaconRxTime, m_macBeaconTxTime, m_outSuperframeStatus, m_phy, m_superframeDuration, ns3::Simulator::Now(), NS_LOG_DEBUG, ns3::OUTGOING, ns3::Time::S, ns3::Simulator::Schedule(), ns3::Seconds(), and StartCFP().

Referenced by PdDataConfirm(), and PdDataIndication().

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

◆ StartCFP()

void ns3::LrWpanMac::StartCFP ( SuperframeType  superframeType)
private

Called to begin the Contention Free Period (CFP) in a beacon-enabled mode.

Parameters
superframeTypeThe incoming or outgoing superframe reference

Definition at line 750 of file lr-wpan-mac.cc.

References ns3::CFP, ns3::INCOMING, m_cfpEvent, m_fnlCapSlot, m_incCfpEvent, m_incomingFnlCapSlot, m_incomingSuperframeDuration, m_incSuperframeStatus, m_outSuperframeStatus, m_phy, m_superframeDuration, NS_LOG_DEBUG, ns3::OUTGOING, ns3::Time::S, ns3::Simulator::Schedule(), ns3::Seconds(), and StartInactivePeriod().

Referenced by StartCAP().

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

◆ StartInactivePeriod()

void ns3::LrWpanMac::StartInactivePeriod ( SuperframeType  superframeType)
private

Start the Inactive Period in a beacon-enabled mode.

Parameters
superframeTypeThe incoming or outgoing superframe reference

Definition at line 796 of file lr-wpan-mac.cc.

References ns3::Time::As(), AwaitBeacon(), ns3::INACTIVE, ns3::INCOMING, m_beaconEvent, m_beaconInterval, m_incomingBeaconInterval, m_incomingSuperframeDuration, m_incSuperframeStatus, m_outSuperframeStatus, m_phy, m_superframeDuration, NS_LOG_DEBUG, ns3::Time::S, ns3::Simulator::Schedule(), ns3::Seconds(), and SendOneBeacon().

Referenced by StartCFP().

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

Member Data Documentation

◆ aBaseSlotDuration

const uint32_t ns3::LrWpanMac::aBaseSlotDuration = 60
static

Length of a superframe slot in symbols.

Defaults to 60 symbols in each superframe slot. See IEEE 802.15.4-2011, section 6.4.1, Table 51.

Definition at line 468 of file lr-wpan-mac.h.

◆ aBaseSuperframeDuration

const uint32_t ns3::LrWpanMac::aBaseSuperframeDuration = aBaseSlotDuration * aNumSuperframeSlots
static

Length of a superframe in symbols.

Defaults to aBaseSlotDuration * aNumSuperframeSlots in symbols. See IEEE 802.15.4-2011, section 6.4.1, Table 51.

Definition at line 479 of file lr-wpan-mac.h.

Referenced by BeaconSearchTimeout(), McpsDataRequest(), MlmeStartRequest(), MlmeSyncRequest(), and PdDataIndication().

◆ aMaxLostBeacons

const uint32_t ns3::LrWpanMac::aMaxLostBeacons = 4
static

The number of consecutive lost beacons that will cause the MAC sublayer of a receiving device to declare a loss of synchronization.

See IEEE 802.15.4-2011, section 6.4.1, Table 51.

Definition at line 486 of file lr-wpan-mac.h.

Referenced by BeaconSearchTimeout().

◆ aMaxSIFSFrameSize

const uint32_t ns3::LrWpanMac::aMaxSIFSFrameSize = 18
static

The maximum size of an MPDU, in octets, that can be followed by a Short InterFrame Spacing (SIFS) period.

See IEEE 802.15.4-2011, section 6.4.1, Table 51.

Definition at line 492 of file lr-wpan-mac.h.

Referenced by GetIfsSize().

◆ aMinMPDUOverhead

const uint32_t ns3::LrWpanMac::aMinMPDUOverhead = 9
static

The minimum number of octets added by the MAC sublayer to the PSDU.

See IEEE 802.15.4-2011, section 6.4.1, Table 51.

Definition at line 462 of file lr-wpan-mac.h.

Referenced by McpsDataRequest().

◆ aNumSuperframeSlots

const uint32_t ns3::LrWpanMac::aNumSuperframeSlots = 16
static

Number of a superframe slots per superframe.

Defaults to 16. See IEEE 802.15.4-2011, section 6.4.1, Table 51.

Definition at line 473 of file lr-wpan-mac.h.

◆ m_ackWaitTimeout

EventId ns3::LrWpanMac::m_ackWaitTimeout
private

Scheduler event for the ACK timeout of the currently transmitted data packet.

Definition at line 1303 of file lr-wpan-mac.h.

Referenced by PdDataConfirm(), and PdDataIndication().

◆ m_associationStatus

LrWpanAssociationStatus ns3::LrWpanMac::m_associationStatus
private

The current association status of the MAC layer.

Definition at line 1266 of file lr-wpan-mac.h.

Referenced by GetAssociationStatus(), LrWpanMac(), and SetAssociationStatus().

◆ m_beaconEvent

EventId ns3::LrWpanMac::m_beaconEvent
private

Scheduler event for generation of one beacon.

Definition at line 1315 of file lr-wpan-mac.h.

Referenced by DoDispose(), MlmeStartRequest(), and StartInactivePeriod().

◆ m_beaconInterval

uint32_t ns3::LrWpanMac::m_beaconInterval

Indication of the Interval used by the coordinator to transmit beacon frames expressed in symbols.

Definition at line 871 of file lr-wpan-mac.h.

Referenced by MlmeStartRequest(), and StartInactivePeriod().

◆ m_beaconTrackingOn

bool ns3::LrWpanMac::m_beaconTrackingOn

Indication of whether the current device is tracking incoming beacons.

Definition at line 894 of file lr-wpan-mac.h.

Referenced by BeaconSearchTimeout(), LrWpanMac(), MlmeSyncRequest(), and PdDataIndication().

◆ m_capEvent

EventId ns3::LrWpanMac::m_capEvent
private

Scheduler event for the end of the outgoing superframe CAP.

Definition at line 1319 of file lr-wpan-mac.h.

Referenced by PdDataConfirm(), and StartCAP().

◆ m_cfpEvent

EventId ns3::LrWpanMac::m_cfpEvent
private

Scheduler event for the end of the outgoing superframe CFP.

Definition at line 1323 of file lr-wpan-mac.h.

Referenced by StartCFP().

◆ m_csmaCa

◆ m_deviceCapability

uint8_t ns3::LrWpanMac::m_deviceCapability

Indication of current device capability (FFD or RFD)

Definition at line 890 of file lr-wpan-mac.h.

Referenced by LrWpanMac(), and MlmeStartRequest().

◆ m_fnlCapSlot

uint8_t ns3::LrWpanMac::m_fnlCapSlot

Indication of the Slot where the CAP portion of the OUTGOING Superframe ends.

Definition at line 790 of file lr-wpan-mac.h.

Referenced by GetSuperframeField(), MlmeStartRequest(), StartCAP(), and StartCFP().

◆ m_ifs

uint32_t ns3::LrWpanMac::m_ifs

The value of the necessary InterFrame Space after the transmission of a packet.

Definition at line 862 of file lr-wpan-mac.h.

Referenced by LrWpanMac().

◆ m_ifsEvent

EventId ns3::LrWpanMac::m_ifsEvent
private

Scheduler event for Interframe spacing wait time.

Definition at line 1311 of file lr-wpan-mac.h.

Referenced by PdDataConfirm(), and PdDataIndication().

◆ m_incCapEvent

EventId ns3::LrWpanMac::m_incCapEvent
private

Scheduler event for the end of the incoming superframe CAP.

Definition at line 1327 of file lr-wpan-mac.h.

Referenced by PdDataIndication().

◆ m_incCfpEvent

EventId ns3::LrWpanMac::m_incCfpEvent
private

Scheduler event for the end of the incoming superframe CFP.

Definition at line 1331 of file lr-wpan-mac.h.

Referenced by StartCFP().

◆ m_incomingBeaconInterval

uint32_t ns3::LrWpanMac::m_incomingBeaconInterval

Indication of the interval a node should receive a superframe expressed in symbols.

Definition at line 881 of file lr-wpan-mac.h.

Referenced by PdDataIndication(), and StartInactivePeriod().

◆ m_incomingBeaconOrder

uint8_t ns3::LrWpanMac::m_incomingBeaconOrder

The beaconOrder value of the INCOMING frame.

Used by all devices that have a parent. Specification of how often the parent coordinator transmits its beacon. 0 - 15 with 15 means the parent is not currently transmitting beacons.

Definition at line 796 of file lr-wpan-mac.h.

Referenced by BeaconSearchTimeout(), LrWpanMac(), MlmeSyncRequest(), and PdDataIndication().

◆ m_incomingFnlCapSlot

uint8_t ns3::LrWpanMac::m_incomingFnlCapSlot

Indication of the Slot where the CAP portion of the INCOMING Superframe ends.

Definition at line 807 of file lr-wpan-mac.h.

Referenced by PdDataIndication(), StartCAP(), and StartCFP().

◆ m_incomingSuperframeDuration

uint32_t ns3::LrWpanMac::m_incomingSuperframeDuration

Indication of the superframe duration in symbols (e.g.

1 symbol = 4 bits in a 250kbps O-QPSK PHY)

Definition at line 886 of file lr-wpan-mac.h.

Referenced by PdDataIndication(), StartCAP(), StartCFP(), and StartInactivePeriod().

◆ m_incomingSuperframeOrder

uint8_t ns3::LrWpanMac::m_incomingSuperframeOrder

Used by all devices that have a parent.

The length of the active portion of the INCOMING superframe, including the beacon frame. 0 - 15 with 15 meaning the superframe will not be active after the beacon.

Definition at line 803 of file lr-wpan-mac.h.

Referenced by LrWpanMac(), and PdDataIndication().

◆ m_incSuperframeStatus

TracedValue<SuperframeStatus> ns3::LrWpanMac::m_incSuperframeStatus
private

The current period of the incoming superframe.

Definition at line 1258 of file lr-wpan-mac.h.

Referenced by AwaitBeacon(), CheckQueue(), GetTypeId(), LrWpanMac(), StartCAP(), StartCFP(), and StartInactivePeriod().

◆ m_indTxQueue

std::deque<IndTxQueueElement*> ns3::LrWpanMac::m_indTxQueue
private

The indirect transmit queue used by the MAC pending messages.

Definition at line 1289 of file lr-wpan-mac.h.

Referenced by McpsDataRequest().

◆ m_lrWpanMacState

TracedValue<LrWpanMacState> ns3::LrWpanMac::m_lrWpanMacState
private

◆ m_macAutoRequest

bool ns3::LrWpanMac::m_macAutoRequest

Indication of whether a device automatically sends data request command if its address is listed in the beacon frame.

TRUE = request command automatically is sent. This command also affects the generation of MLME-BEACON-NOTIFY.indication (6.2.4.1) See IEEE 802.15.4-2011, section 6.4.2, Table 52.

Definition at line 858 of file lr-wpan-mac.h.

Referenced by LrWpanMac(), and PdDataIndication().

◆ m_macBeaconOrder

uint8_t ns3::LrWpanMac::m_macBeaconOrder

Used by a PAN coordinator or coordinator.

Defines how often the coordinator transmits its beacon (outgoing superframe). Range 0 - 15 with 15 meaning no beacons are being sent. See IEEE 802.15.4-2011, section 6.4.2, Table 52.

Definition at line 768 of file lr-wpan-mac.h.

Referenced by GetSuperframeField(), LrWpanMac(), McpsDataRequest(), and MlmeStartRequest().

◆ m_macBeaconRxTime

Time ns3::LrWpanMac::m_macBeaconRxTime

The time that the device received its last bit of the beacon frame.

It does not indicate the start of the Active Period in the Incoming superframe. Not explicitly listed by the standard but its use is implied. Its purpose is somehow similar to m_macBeaconTxTime

Definition at line 742 of file lr-wpan-mac.h.

Referenced by PdDataIndication(), and StartCAP().

◆ m_macBeaconTxTime

Time ns3::LrWpanMac::m_macBeaconTxTime

The time that the device transmitted its last beacon frame.

It also indicates the start of the Active Period in the Outgoing superframe. See IEEE 802.15.4-2011, section 6.4.2, Table 52.

Definition at line 735 of file lr-wpan-mac.h.

Referenced by PdDataConfirm(), and StartCAP().

◆ m_macBsn

SequenceNumber8 ns3::LrWpanMac::m_macBsn

Sequence number added to transmitted beacon frame, 00-ff.

See IEEE 802.15.4-2011, section 6.4.2, Table 52.

Definition at line 829 of file lr-wpan-mac.h.

Referenced by LrWpanMac(), MlmePollRequest(), and SendOneBeacon().

◆ m_macCoordExtendedAddress

Mac64Address ns3::LrWpanMac::m_macCoordExtendedAddress

The extended address of the coordinator through which the device is associated.

See IEEE 802.15.4-2011, section 6.4.2, Table 52.

Definition at line 756 of file lr-wpan-mac.h.

Referenced by isCoordDest(), and SetAssociatedCoor().

◆ m_macCoordShortAddress

Mac16Address ns3::LrWpanMac::m_macCoordShortAddress

The short address of the coordinator through which the device is associated.

0xFFFF indicates this value is unknown. 0xFFFE indicates the coordinator is only using its extended address. See IEEE 802.15.4-2011, section 6.4.2, Table 52.

Definition at line 750 of file lr-wpan-mac.h.

Referenced by isCoordDest(), and SetAssociatedCoor().

◆ m_macDsn

SequenceNumber8 ns3::LrWpanMac::m_macDsn

Sequence number added to transmitted data or MAC command frame, 00-ff.

See IEEE 802.15.4-2006, section 7.4.2, Table 86.

Definition at line 824 of file lr-wpan-mac.h.

Referenced by LrWpanMac(), and McpsDataRequest().

◆ m_macLIFSPeriod

uint32_t ns3::LrWpanMac::m_macLIFSPeriod

The minimum time forming a Long InterFrame Spacing (LIFS) period.

See IEEE 802.15.4-2011, section 6.4.2, Table 52.

Definition at line 845 of file lr-wpan-mac.h.

Referenced by GetIfsSize(), and LrWpanMac().

◆ m_macMaxFrameRetries

uint8_t ns3::LrWpanMac::m_macMaxFrameRetries

The maximum number of retries allowed after a transmission failure.

See IEEE 802.15.4-2006, section 7.4.2, Table 86.

Definition at line 834 of file lr-wpan-mac.h.

Referenced by GetMacMaxFrameRetries(), LrWpanMac(), PrepareRetransmission(), and SetMacMaxFrameRetries().

◆ m_macPanId

uint16_t ns3::LrWpanMac::m_macPanId

16 bits id of PAN on which this device is operating.

0xffff means not associated. See IEEE 802.15.4-2006, section 7.4.2, Table 86.

Definition at line 819 of file lr-wpan-mac.h.

Referenced by BeaconSearchTimeout(), GetPanId(), GetTypeId(), LrWpanMac(), MlmeStartRequest(), MlmeSyncRequest(), PdDataIndication(), and SetPanId().

◆ m_macPromiscRxTrace

TracedCallback<Ptr<const Packet> > ns3::LrWpanMac::m_macPromiscRxTrace
private

The trace source fired for packets successfully received by the device immediately before being forwarded up to higher layers (at the L2/L3 transition).

This is a promiscuous trace.

See also
class CallBackTraceSource

Definition at line 1145 of file lr-wpan-mac.h.

Referenced by GetTypeId(), and PdDataIndication().

◆ m_macPromiscuousMode

bool ns3::LrWpanMac::m_macPromiscuousMode

Indicates if MAC sublayer is in receive all mode.

True mean accept all frames from PHY. See IEEE 802.15.4-2006, section 7.4.2, Table 86.

Definition at line 813 of file lr-wpan-mac.h.

Referenced by LrWpanMac(), and PdDataIndication().

◆ m_macRxDropTrace

TracedCallback<Ptr<const Packet> > ns3::LrWpanMac::m_macRxDropTrace
private

The trace source fired for packets successfully received by the device but dropped before being forwarded up to higher layers (at the L2/L3 transition).

See also
class CallBackTraceSource

Definition at line 1161 of file lr-wpan-mac.h.

Referenced by GetTypeId(), and PdDataIndication().

◆ m_macRxOnWhenIdle

bool ns3::LrWpanMac::m_macRxOnWhenIdle

Indication of whether the MAC sublayer is to enable its receiver during idle periods.

See IEEE 802.15.4-2006, section 7.4.2, Table 86.

Definition at line 840 of file lr-wpan-mac.h.

Referenced by DoInitialize(), GetRxOnWhenIdle(), LrWpanMac(), SetLrWpanMacState(), and SetRxOnWhenIdle().

◆ m_macRxTrace

TracedCallback<Ptr<const Packet> > ns3::LrWpanMac::m_macRxTrace
private

The trace source fired for packets successfully received by the device immediately before being forwarded up to higher layers (at the L2/L3 transition).

This is a non-promiscuous trace.

See also
class CallBackTraceSource

Definition at line 1153 of file lr-wpan-mac.h.

Referenced by GetTypeId(), and PdDataIndication().

◆ m_macSIFSPeriod

uint32_t ns3::LrWpanMac::m_macSIFSPeriod

The minimum time forming a Short InterFrame Spacing (SIFS) period.

See IEEE 802.15.4-2011, section 6.4.2, Table 52.

Definition at line 850 of file lr-wpan-mac.h.

Referenced by GetIfsSize(), and LrWpanMac().

◆ m_macStateLogger

TracedCallback<LrWpanMacState, LrWpanMacState> ns3::LrWpanMac::m_macStateLogger
private

A trace source that fires when the LrWpanMac changes states.

Parameters are the old mac state and the new mac state.

Deprecated:
This TracedCallback is deprecated and will be removed in a future release, Instead, use the MacStateValue TracedValue.

Definition at line 1209 of file lr-wpan-mac.h.

Referenced by ChangeMacState(), and GetTypeId().

◆ m_macSuperframeOrder

uint8_t ns3::LrWpanMac::m_macSuperframeOrder

Used by a PAN coordinator or coordinator.

The length of the active portion of the outgoing superframe, including the beacon frame. 0 - 15 with 15 means the superframe will not be active after the beacon. See IEEE 802.15.4-2011, section 6.4.2, Table 52.

Definition at line 775 of file lr-wpan-mac.h.

Referenced by GetSuperframeField(), LrWpanMac(), and MlmeStartRequest().

◆ m_macSyncSymbolOffset

uint64_t ns3::LrWpanMac::m_macSyncSymbolOffset

Symbol boundary is same as m_macBeaconTxTime.

See IEEE 802.15.4-2006, section 7.4.2, Table 86.

Definition at line 761 of file lr-wpan-mac.h.

◆ m_macTransactionPersistanceTime

uint16_t ns3::LrWpanMac::m_macTransactionPersistanceTime

The maximum time (in superframe periods) that a transaction is stored by a coordinator and indicated in its beacon.

See IEEE 802.15.4-2011, section 6.4.2, Table 52.

Definition at line 781 of file lr-wpan-mac.h.

Referenced by LrWpanMac(), and McpsDataRequest().

◆ m_macTxDequeueTrace

TracedCallback<Ptr<const Packet> > ns3::LrWpanMac::m_macTxDequeueTrace
private

The trace source fired when packets are dequeued from the L3/l2 transmission queue.

See also
class CallBackTraceSource

Definition at line 1116 of file lr-wpan-mac.h.

Referenced by GetTypeId(), and RemoveFirstTxQElement().

◆ m_macTxDropTrace

TracedCallback<Ptr<const Packet> > ns3::LrWpanMac::m_macTxDropTrace
private

The trace source fired when packets are dropped due to missing ACKs or because of transmission failures in L1.

See also
class CallBackTraceSource

Definition at line 1137 of file lr-wpan-mac.h.

Referenced by GetTypeId(), PdDataConfirm(), PrepareRetransmission(), and SetLrWpanMacState().

◆ m_macTxEnqueueTrace

TracedCallback<Ptr<const Packet> > ns3::LrWpanMac::m_macTxEnqueueTrace
private

The trace source fired when packets come into the "top" of the device at the L3/L2 transition, when being queued for transmission.

See also
class CallBackTraceSource

Definition at line 1109 of file lr-wpan-mac.h.

Referenced by GetTypeId(), and McpsDataRequest().

◆ m_macTxOkTrace

TracedCallback<Ptr<const Packet> > ns3::LrWpanMac::m_macTxOkTrace
private

The trace source fired when packets where successfully transmitted, that is an acknowledgment was received, if requested, or the packet was successfully sent by L1, if no ACK was requested.

See also
class CallBackTraceSource

Definition at line 1130 of file lr-wpan-mac.h.

Referenced by GetTypeId(), PdDataConfirm(), and PdDataIndication().

◆ m_macTxTrace

TracedCallback<Ptr<const Packet> > ns3::LrWpanMac::m_macTxTrace
private

The trace source fired when packets are being sent down to L1.

See also
class CallBackTraceSource

Definition at line 1122 of file lr-wpan-mac.h.

Referenced by GetTypeId(), and PlmeSetTRXStateConfirm().

◆ m_mcpsDataConfirmCallback

McpsDataConfirmCallback ns3::LrWpanMac::m_mcpsDataConfirmCallback
private

This callback is used to report data transmission request status to the upper layers.

See IEEE 802.15.4-2006, section 7.1.1.2.

Definition at line 1250 of file lr-wpan-mac.h.

Referenced by DoDispose(), McpsDataRequest(), PdDataConfirm(), PdDataIndication(), PrepareRetransmission(), SetLrWpanMacState(), and SetMcpsDataConfirmCallback().

◆ m_mcpsDataIndicationCallback

McpsDataIndicationCallback ns3::LrWpanMac::m_mcpsDataIndicationCallback
private

This callback is used to notify incoming packets to the upper layers.

See IEEE 802.15.4-2006, section 7.1.1.3.

Definition at line 1244 of file lr-wpan-mac.h.

Referenced by DoDispose(), PdDataIndication(), and SetMcpsDataIndicationCallback().

◆ m_mlmeBeaconNotifyIndicationCallback

MlmeBeaconNotifyIndicationCallback ns3::LrWpanMac::m_mlmeBeaconNotifyIndicationCallback
private

This callback is used to notify incoming beacon packets to the upper layers.

See IEEE 802.15.4-2011, section 6.2.4.1.

Definition at line 1222 of file lr-wpan-mac.h.

Referenced by PdDataIndication(), and SetMlmeBeaconNotifyIndicationCallback().

◆ m_mlmePollConfirmCallback

MlmePollConfirmCallback ns3::LrWpanMac::m_mlmePollConfirmCallback
private

This callback is used to report the status after a device send data command request to the coordinator to transmit data.

See IEEE 802.15.4-2011, section 6.2.14.2.

Definition at line 1233 of file lr-wpan-mac.h.

Referenced by SetMlmePollConfirmCallback().

◆ m_mlmeStartConfirmCallback

MlmeStartConfirmCallback ns3::LrWpanMac::m_mlmeStartConfirmCallback
private

This callback is used to report the start of a new PAN or the begin of a new superframe configuration.

See IEEE 802.15.4-2006, section 7.1.14.2.

Definition at line 1239 of file lr-wpan-mac.h.

Referenced by MlmeStartRequest(), PdDataConfirm(), and SetMlmeStartConfirmCallback().

◆ m_mlmeSyncLossIndicationCallback

MlmeSyncLossIndicationCallback ns3::LrWpanMac::m_mlmeSyncLossIndicationCallback
private

This callback is used to indicate the loss of synchronization with a coordinator.

See IEEE 802.15.4-2011, section 6.2.13.2.

Definition at line 1227 of file lr-wpan-mac.h.

Referenced by BeaconSearchTimeout(), and SetMlmeSyncLossIndicationCallback().

◆ m_numCsmacaRetry

uint8_t ns3::LrWpanMac::m_numCsmacaRetry
private

The number of CSMA/CA retries used for sending the current packet.

Definition at line 1298 of file lr-wpan-mac.h.

Referenced by LrWpanMac(), PrepareRetransmission(), and RemoveFirstTxQElement().

◆ m_numLostBeacons

uint8_t ns3::LrWpanMac::m_numLostBeacons

The number of consecutive loss beacons in a beacon tracking operation.

Definition at line 898 of file lr-wpan-mac.h.

Referenced by BeaconSearchTimeout(), LrWpanMac(), MlmeSyncRequest(), and PdDataIndication().

◆ m_outSuperframeStatus

TracedValue<SuperframeStatus> ns3::LrWpanMac::m_outSuperframeStatus
private

The current period of the outgoing superframe.

Definition at line 1262 of file lr-wpan-mac.h.

Referenced by CheckQueue(), GetTypeId(), LrWpanMac(), SendOneBeacon(), StartCAP(), StartCFP(), and StartInactivePeriod().

◆ m_panCoor

bool ns3::LrWpanMac::m_panCoor

Indication of whether the current device is the PAN coordinator.

Definition at line 866 of file lr-wpan-mac.h.

Referenced by CheckQueue(), GetSuperframeField(), and MlmeStartRequest().

◆ m_phy

◆ m_promiscSnifferTrace

TracedCallback<Ptr<const Packet> > ns3::LrWpanMac::m_promiscSnifferTrace
private

A trace source that emulates a promiscuous mode protocol sniffer connected to the device.

This trace source fire on packets destined for any host just like your average everyday packet sniffer.

On the transmit size, this trace hook will fire after a packet is dequeued from the device queue for transmission. In Linux, for example, this would correspond to the point just before a device hard_start_xmit where dev_queue_xmit_nit is called to dispatch the packet to the PF_PACKET ETH_P_ALL handlers.

On the receive side, this trace hook will fire when a packet is received, just before the receive callback is executed. In Linux, for example, this would correspond to the point at which the packet is dispatched to packet sniffers in netif_receive_skb.

See also
class CallBackTraceSource

Definition at line 1200 of file lr-wpan-mac.h.

Referenced by GetTypeId(), PdDataIndication(), and PlmeSetTRXStateConfirm().

◆ m_retransmission

uint8_t ns3::LrWpanMac::m_retransmission
private

The number of already used retransmission for the currently transmitted packet.

Definition at line 1294 of file lr-wpan-mac.h.

Referenced by LrWpanMac(), PrepareRetransmission(), and RemoveFirstTxQElement().

◆ m_rxBeaconSymbols

uint64_t ns3::LrWpanMac::m_rxBeaconSymbols

The total size of the received beacon in symbols.

Its value is used to calculate the end CAP time of the incoming superframe.

Definition at line 786 of file lr-wpan-mac.h.

Referenced by PdDataIndication().

◆ m_selfExt

Mac64Address ns3::LrWpanMac::m_selfExt
private

The extended address used by this MAC.

Extended addresses are currently not really supported.

Definition at line 1281 of file lr-wpan-mac.h.

Referenced by GetExtendedAddress(), LrWpanMac(), PdDataIndication(), and SetExtendedAddress().

◆ m_sentPktTrace

TracedCallback<Ptr<const Packet>, uint8_t, uint8_t > ns3::LrWpanMac::m_sentPktTrace
private

The trace source fired when packets are considered as successfully sent or the transmission has been given up.

Only non-broadcast packets are traced.

The data should represent: packet, number of retries, total number of csma backoffs

See also
class CallBackTraceSource

Definition at line 1102 of file lr-wpan-mac.h.

Referenced by GetTypeId(), and RemoveFirstTxQElement().

◆ m_setMacState

EventId ns3::LrWpanMac::m_setMacState
private

Scheduler event for a deferred MAC state change.

Definition at line 1307 of file lr-wpan-mac.h.

Referenced by CheckQueue(), IfsWaitTimeout(), PdDataConfirm(), and PdDataIndication().

◆ m_shortAddress

Mac16Address ns3::LrWpanMac::m_shortAddress
private

The short address used by this MAC.

Currently we do not have complete extended address support in the MAC, nor do we have the association primitives, so this address has to be configured manually.

Definition at line 1276 of file lr-wpan-mac.h.

Referenced by GetShortAddress(), LrWpanMac(), PdDataIndication(), and SetShortAddress().

◆ m_snifferTrace

TracedCallback<Ptr<const Packet> > ns3::LrWpanMac::m_snifferTrace
private

A trace source that emulates a non-promiscuous protocol sniffer connected to the device.

Unlike your average everyday sniffer, this trace source will not fire on PACKET_OTHERHOST events.

On the transmit size, this trace hook will fire after a packet is dequeued from the device queue for transmission. In Linux, for example, this would correspond to the point just before a device hard_start_xmit where dev_queue_xmit_nit is called to dispatch the packet to the PF_PACKET ETH_P_ALL handlers.

On the receive side, this trace hook will fire when a packet is received, just before the receive callback is executed. In Linux, for example, this would correspond to the point at which the packet is dispatched to packet sniffers in netif_receive_skb.

See also
class CallBackTraceSource

Definition at line 1180 of file lr-wpan-mac.h.

Referenced by GetTypeId(), and PlmeSetTRXStateConfirm().

◆ m_superframeDuration

uint32_t ns3::LrWpanMac::m_superframeDuration

Indication of the superframe duration in symbols.

(e.g. 1 symbol = 4 bits in a 250kbps O-QPSK PHY)

Definition at line 876 of file lr-wpan-mac.h.

Referenced by MlmeStartRequest(), SendOneBeacon(), StartCAP(), StartCFP(), and StartInactivePeriod().

◆ m_trackingEvent

EventId ns3::LrWpanMac::m_trackingEvent
private

Scheduler event to track the incoming beacons.

Definition at line 1335 of file lr-wpan-mac.h.

Referenced by BeaconSearchTimeout(), MlmeSyncRequest(), and PdDataIndication().

◆ m_txPkt

Ptr<Packet> ns3::LrWpanMac::m_txPkt
private

◆ m_txQueue

std::deque<TxQueueElement*> ns3::LrWpanMac::m_txQueue
private

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