Class that implements the LR-WPAN MAC state machine. More...
#include "lr-wpan-mac.h"
Classes | |
struct | IndTxQueueElement |
Helper structure for managing pending transaction list elements (Indirect transmissions). 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 () | |
Default constructor. More... | |
~LrWpanMac () override | |
LrWpanAssociationStatus | GetAssociationStatus () const |
Get the current association status. More... | |
Mac64Address | GetCoordExtAddress () const |
Get the coordinator extended address currently associated to this device. More... | |
Mac16Address | GetCoordShortAddress () const |
Get the coordinator short address currently associated to this device. More... | |
Mac64Address | GetExtendedAddress () 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 () const |
Get the macAckWaitDuration attribute value. More... | |
uint8_t | GetMacMaxFrameRetries () const |
Get the macMaxFrameRetries attribute value. More... | |
uint16_t | GetPanId () const |
Get the PAN id used by this MAC. More... | |
Ptr< LrWpanPhy > | GetPhy () |
Get the underlying PHY of the MAC. More... | |
bool | GetRxOnWhenIdle () |
Check if the receiver will be enabled when the MAC is idle. More... | |
Mac16Address | GetShortAddress () const |
Get the short address of this MAC. More... | |
uint64_t | GetTxPacketSymbols () |
Obtain the number of symbols in the packet which is currently being sent by the MAC layer. More... | |
bool | isCoordDest () |
Check if the packet destination is its coordinator. More... | |
bool | isTxAckReq () |
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 | MlmeAssociateRequest (MlmeAssociateRequestParams params) |
IEEE 802.15.4-2011, section 6.2.2.1 MLME-ASSOCIATE.request Request primitive used by a device to request an association with a coordinator. More... | |
void | MlmeAssociateResponse (MlmeAssociateResponseParams params) |
IEEE 802.15.4-2011, section 6.2.2.3 MLME-ASSOCIATE.response Primitive used to initiate a response to an MLME-ASSOCIATE.indication primitive. 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 | MlmeScanRequest (MlmeScanRequestParams params) |
IEEE 802.15.4-2011, section 6.2.10.1 MLME-SCAN.request Request primitive used to initiate a channel scan over a given list of channels. 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 | PrintPendTxQ (std::ostream &os) const |
Print the Pending transaction list. More... | |
void | PrintTransmitQueueSize () |
Print the number of elements in the packet transmit queue. More... | |
void | PrintTxQueue (std::ostream &os) const |
Print the 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 | SetIndTxQMaxSize (uint32_t queueSize) |
Set the max size of the indirect transmit queue (Pending Transaction list) 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 | SetMlmeAssociateConfirmCallback (MlmeAssociateConfirmCallback c) |
Set the callback for the confirmation of a data transmission request. More... | |
void | SetMlmeAssociateIndicationCallback (MlmeAssociateIndicationCallback c) |
Set the callback for the indication of an incoming associate request command. More... | |
void | SetMlmeBeaconNotifyIndicationCallback (MlmeBeaconNotifyIndicationCallback c) |
Set the callback for the indication of an incoming beacon packet. More... | |
void | SetMlmeCommStatusIndicationCallback (MlmeCommStatusIndicationCallback c) |
Set the callback for the indication to a response primitive. More... | |
void | SetMlmePollConfirmCallback (MlmePollConfirmCallback c) |
Set the callback for the confirmation of a data transmission request. More... | |
void | SetMlmeScanConfirmCallback (MlmeScanConfirmCallback 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... | |
void | SetTxQMaxSize (uint32_t queueSize) |
Set the max size of the transmit queue. More... | |
![]() | |
Object () | |
Constructor. More... | |
~Object () override | |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose () |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. More... | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. More... | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized () const |
Check if the object has been initialized. More... | |
![]() | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref () const |
Increment the reference count. More... | |
void | Unref () const |
Decrement the reference count. More... | |
![]() | |
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... | |
virtual TypeId | GetInstanceTypeId () const =0 |
Get the most derived TypeId for this Object. 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 () |
Get the type ID. More... | |
![]() | |
static TypeId | GetTypeId () |
Register this type. More... | |
![]() | |
static TypeId | GetTypeId () |
Get the type ID. More... | |
Public Attributes | |
uint64_t | m_assocRespCmdWaitTime |
The maximum wait time for an association response command after the reception of data request command ACK during the association process. More... | |
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_macAssociationPermit |
Indication of whether a coordinator is currently allowing association. 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... | |
uint16_t | m_macPanIdScan |
Temporally stores the value of the current m_macPanId when a MLME-SCAN.request is performed. More... | |
bool | m_macPromiscuousMode |
Indicates if MAC sublayer is in receive all mode. More... | |
uint64_t | m_macResponseWaitTime |
The maximum time, in multiples of aBaseSuperframeDuration, a device shall wait for a response command frame to be available following a request command frame. 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_macTransactionPersistenceTime |
The maximum time (in UNIT periods) that a transaction is stored by a coordinator and indicated in its beacon. More... | |
uint8_t | m_maxEnergyLevel |
The maximum energy level detected during ED scan on the current channel. 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 constexpr uint32_t | aBaseSlotDuration = 60 |
Length of a superframe slot in symbols. More... | |
static constexpr uint32_t | aBaseSuperframeDuration = aBaseSlotDuration * aNumSuperframeSlots |
Length of a superframe in symbols. More... | |
static constexpr 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 constexpr 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 constexpr uint32_t | aMinMPDUOverhead = 9 |
The minimum number of octets added by the MAC sublayer to the PSDU. More... | |
static constexpr uint32_t | aNumSuperframeSlots = 16 |
Number of a superframe slots per superframe. More... | |
Protected Member Functions | |
void | DoDispose () override |
Destructor implementation. More... | |
void | DoInitialize () override |
Initialize() implementation. More... | |
![]() | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoDispose () |
Destructor implementation. More... | |
virtual void | DoInitialize () |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate () |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
![]() | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted () |
Notifier called once the ObjectBase is fully constructed. More... | |
Private Member Functions | |
void | AckWaitTimeout () |
Handle an ACK timeout with a packet retransmission, if there are retransmission left, or a packet drop. More... | |
void | AwaitBeacon () |
Called after the end of an INCOMING superframe to start the moment a device waits for a new incoming beacon. More... | |
void | BeaconSearchTimeout () |
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 () |
Check the transmission queue. More... | |
bool | DequeueInd (Mac64Address dst, Ptr< IndTxQueueElement > entry) |
Extracts a packet from pending transactions list (Indirect transmissions). More... | |
void | EndAssociateRequest () |
Called to end an MLME-ASSOCIATE.request after changing the page and channel number. More... | |
void | EndChannelEnergyScan () |
Called at the end of one ED channel scan. More... | |
void | EndChannelScan () |
Called at the end of the current channel scan (Active or Passive) for a given duration. More... | |
void | EndStartRequest () |
Called to end a MLME-START.request after changing the page and channel number. More... | |
void | EnqueueInd (Ptr< Packet > p) |
Adds a packet to the pending transactions list (Indirect transmissions). More... | |
void | EnqueueTxQElement (Ptr< TxQueueElement > txQElement) |
Add an element to the transmission queue. More... | |
GtsFields | GetGtsFields () |
Constructs the Guaranteed Time Slots (GTS) Fields from local information. More... | |
PendingAddrFields | GetPendingAddrFields () |
Constructs Pending Address Fields from the local information, the Pending Address Fields are part of the beacon frame. More... | |
SuperframeField | GetSuperframeField () |
Constructs a Superframe specification field from the local information, the superframe Specification field is necessary to create a beacon frame. More... | |
void | IfsWaitTimeout (Time ifsTime) |
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... | |
void | LostAssocRespCommand () |
Called after m_assocRespCmdWaitTime timeout while waiting for an association response command. More... | |
bool | PrepareRetransmission () |
Check for remaining retransmissions for the packet currently being sent. More... | |
void | PurgeInd () |
Purge expired transactions from the pending transactions list. More... | |
void | RemoveFirstTxQElement () |
Remove the tip of the transmission queue, including clean up related to the last packet transmission. More... | |
void | RemovePendTxQElement (Ptr< Packet > p) |
Remove an element from the pending transaction list. More... | |
void | SendAck (uint8_t seqno) |
Send an acknowledgment packet for the given sequence number. More... | |
void | SendAssocRequestCommand () |
Called to send an associate request command. More... | |
void | SendAssocResponseCommand (Ptr< Packet > rxDataReqPkt) |
Called to send an associate response command. More... | |
void | SendBeaconRequestCommand () |
Called to send a beacon request command. More... | |
void | SendDataRequestCommand () |
Used to send a data request command (i.e. More... | |
void | SendOneBeacon () |
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... | |
MlmeAssociateRequestParams | m_associateParams |
The parameters used during a MLME-ASSOCIATE.request. More... | |
LrWpanAssociationStatus | m_associationStatus |
The current association status of the MAC layer. More... | |
EventId | m_assocResCmdWaitTimeout |
Scheduler event for the lost of a association response command frame. 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... | |
uint16_t | m_channelScanIndex |
The channel list index used to obtain the current scanned channel. More... | |
Ptr< LrWpanCsmaCa > | m_csmaCa |
The CSMA/CA implementation used by this MAC. More... | |
std::vector< uint8_t > | m_energyDetectList |
The list of energy measurements, one for each channel searched during an ED scan. 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< SuperframeStatus > | m_incSuperframeStatus |
The current period of the incoming superframe. More... | |
std::deque< Ptr< IndTxQueueElement > > | m_indTxQueue |
The indirect transmit queue used by the MAC pending messages (The pending transaction list). More... | |
TracedValue< LrWpanMacState > | m_lrWpanMacState |
The current state of the MAC layer. More... | |
TracedCallback< Time > | m_macIfsEndTrace |
The trace source is fired at the end of any Interframe Space (IFS). More... | |
TracedCallback< Ptr< const Packet > > | m_macIndTxDequeueTrace |
The trace source fired when packets are dequeued from the L3/l2 indirect transmission queue (Pending transaction list). More... | |
TracedCallback< Ptr< const Packet > > | m_macIndTxDropTrace |
The trace source fired when packets are dropped due to indirect Tx queue overflows or expiration. More... | |
TracedCallback< Ptr< const Packet > > | m_macIndTxEnqueueTrace |
The trace source fired when packets come into the "top" of the device at the L3/L2 transition, when being queued for indirect transmission (pending transaction list). 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, LrWpanMacState > | m_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... | |
uint32_t | m_maxIndTxQueueSize |
The maximum size of the indirect transmit queue (The pending transaction list). More... | |
uint32_t | m_maxTxQueueSize |
The maximum size of the transmit queue. 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... | |
MlmeAssociateConfirmCallback | m_mlmeAssociateConfirmCallback |
This callback is used to report the status after a device request an association with a coordinator. More... | |
MlmeAssociateIndicationCallback | m_mlmeAssociateIndicationCallback |
This callback is used to indicate the reception of an association request command. More... | |
MlmeBeaconNotifyIndicationCallback | m_mlmeBeaconNotifyIndicationCallback |
This callback is used to notify incoming beacon packets to the upper layers. More... | |
MlmeCommStatusIndicationCallback | m_mlmeCommStatusIndicationCallback |
This callback is instigated through a response primitive. 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... | |
MlmeScanConfirmCallback | m_mlmeScanConfirmCallback |
This callback is used to report the result of a scan on a group of channels for the selected channel page. 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< SuperframeStatus > | m_outSuperframeStatus |
The current period of the outgoing superframe. More... | |
std::vector< PanDescriptor > | m_panDescriptorList |
The list of PAN descriptors accumulated during channel scans, used to select a PAN to associate. More... | |
PendingPrimitiveStatus | m_pendPrimitive |
Indicates the pending primitive when PLME.SET operation (page or channel switch) is called from within another MLME primitive (e.g. More... | |
Ptr< LrWpanPhy > | m_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... | |
EventId | m_respWaitTimeout |
Scheduler event for a response to a request command frame. More... | |
uint8_t | m_retransmission |
The number of already used retransmission for the currently transmitted packet. More... | |
Ptr< Packet > | m_rxPkt |
The command request packet received. More... | |
EventId | m_scanEnergyEvent |
Scheduler event for the end of a ED channel scan. More... | |
EventId | m_scanEvent |
Scheduler event for the end of a channel scan. More... | |
MlmeScanRequestParams | m_scanParams |
The parameters used during a MLME-SCAN.request. 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... | |
MlmeStartRequestParams | m_startParams |
The parameters used during a MLME-START.request. More... | |
EventId | m_trackingEvent |
Scheduler event to track the incoming beacons. More... | |
Ptr< Packet > | m_txPkt |
The packet which is currently being sent by the MAC layer. More... | |
std::deque< Ptr< TxQueueElement > > | m_txQueue |
The transmit queue used by the MAC. More... | |
Additional Inherited Members | |
![]() | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
Class that implements the LR-WPAN MAC state machine.
ns3::LrWpanMac is accessible through the following paths with Config::Set and Config::Connect:
Size of this type is 1232 bytes (on a 64-bit architecture).
Definition at line 708 of file lr-wpan-mac.h.
typedef void(* ns3::LrWpanMac::SentTracedCallback) (Ptr< const Packet > packet, uint8_t retries, uint8_t backoffs) |
TracedCallback signature for sent packets.
[in] | packet | The packet. |
[in] | retries | The number of retries. |
[in] | backoffs | The number of CSMA backoffs. |
Definition at line 1439 of file lr-wpan-mac.h.
typedef void(* ns3::LrWpanMac::StateTracedCallback) (LrWpanMacState oldState, LrWpanMacState newState) |
TracedCallback signature for LrWpanMacState change events.
[in] | oldValue | The original state value. |
[in] | newValue | The new state value. |
MacStateValue
. The MacState
TracedCallback will be removed in a future release. Definition at line 1450 of file lr-wpan-mac.h.
ns3::LrWpanMac::LrWpanMac | ( | ) |
Default constructor.
Definition at line 161 of file lr-wpan-mac.cc.
References aBaseSuperframeDuration, ns3::Mac64Address::Allocate(), ns3::ASSOCIATED, ChangeMacState(), ns3::FFD, ns3::UniformRandomVariable::GetValue(), ns3::INACTIVE, m_associationStatus, m_assocRespCmdWaitTime, m_beaconTrackingOn, m_channelScanIndex, m_deviceCapability, m_ifs, m_incomingBeaconOrder, m_incomingSuperframeOrder, m_incSuperframeStatus, m_indTxQueue, m_lrWpanMacState, m_macAssociationPermit, m_macAutoRequest, m_macBeaconOrder, m_macBsn, m_macCoordExtendedAddress, m_macCoordShortAddress, m_macDsn, m_macLIFSPeriod, m_macMaxFrameRetries, m_macPanId, m_macPromiscuousMode, m_macResponseWaitTime, m_macRxOnWhenIdle, m_macSIFSPeriod, m_macSuperframeOrder, m_macTransactionPersistenceTime, m_maxEnergyLevel, m_maxIndTxQueueSize, m_maxTxQueueSize, m_numCsmacaRetry, m_numLostBeacons, m_outSuperframeStatus, m_panCoor, m_pendPrimitive, m_retransmission, m_rxPkt, m_selfExt, m_shortAddress, m_txPkt, m_txQueue, ns3::MAC_IDLE, ns3::MLME_NONE, and ns3::ObjectBase::SetAttribute().
|
override |
Definition at line 219 of file lr-wpan-mac.cc.
|
private |
Handle an ACK timeout with a packet retransmission, if there are retransmission left, or a packet drop.
Definition at line 2327 of file lr-wpan-mac.cc.
References ns3::MAC_CSMA, ns3::MAC_IDLE, NS_LOG_FUNCTION, PrepareRetransmission(), and SetLrWpanMacState().
Referenced by PdDataConfirm().
|
private |
Called after the end of an INCOMING superframe to start the moment a device waits for a new incoming beacon.
Definition at line 1402 of file lr-wpan-mac.cc.
References ns3::BEACON, and m_incSuperframeStatus.
Referenced by StartInactivePeriod().
|
private |
Called if the device is unable to locate a beacon in the time set by MLME-SYNC.request.
Definition at line 1414 of file lr-wpan-mac.cc.
References aBaseSuperframeDuration, aMaxLostBeacons, BeaconSearchTimeout(), 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 BeaconSearchTimeout(), MlmeSyncRequest(), and PdDataIndication().
|
private |
Change the current MAC state to the given new state.
newState | the new state |
Definition at line 3424 of file lr-wpan-mac.cc.
References m_lrWpanMacState, m_macStateLogger, and NS_LOG_LOGIC.
Referenced by LrWpanMac(), PdDataIndication(), SendAck(), SendOneBeacon(), and SetLrWpanMacState().
|
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 1444 of file lr-wpan-mac.cc.
References ns3::CAP, ns3::EventId::IsRunning(), m_csmaCa, m_ifsEvent, 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(), and SetLrWpanMacState().
Referenced by IfsWaitTimeout(), McpsDataRequest(), PlmeSetTRXStateConfirm(), SendAssocRequestCommand(), SendBeaconRequestCommand(), SendDataRequestCommand(), and StartCAP().
|
private |
Extracts a packet from pending transactions list (Indirect transmissions).
dst | The extended address used an index to obtain an element from the pending transaction list. |
entry | The dequeued element from the pending transaction list. |
Definition at line 2549 of file lr-wpan-mac.cc.
References m_indTxQueue, m_macIndTxDequeueTrace, and PurgeInd().
Referenced by SendAssocResponseCommand().
|
overrideprotectedvirtual |
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 239 of file lr-wpan-mac.cc.
References ns3::EventId::Cancel(), ns3::Object::DoDispose(), m_beaconEvent, m_csmaCa, m_indTxQueue, m_mcpsDataConfirmCallback, m_mcpsDataIndicationCallback, m_mlmeAssociateConfirmCallback, m_mlmeAssociateIndicationCallback, m_mlmeBeaconNotifyIndicationCallback, m_mlmeCommStatusIndicationCallback, m_mlmePollConfirmCallback, m_mlmeScanConfirmCallback, m_mlmeStartConfirmCallback, m_mlmeSyncLossIndicationCallback, m_phy, m_txPkt, and m_txQueue.
|
overrideprotectedvirtual |
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 224 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.
|
private |
Called to end an MLME-ASSOCIATE.request after changing the page and channel number.
Definition at line 690 of file lr-wpan-mac.cc.
References m_associateParams, ns3::MlmeAssociateRequestParams::m_coordAddrMode, ns3::MlmeAssociateRequestParams::m_coordExtAddr, ns3::MlmeAssociateRequestParams::m_coordPanId, ns3::MlmeAssociateRequestParams::m_coordShortAddr, m_macCoordExtendedAddress, m_macCoordShortAddress, m_macPanId, m_pendPrimitive, ns3::MLME_NONE, SendAssocRequestCommand(), and ns3::SHORT_ADDR.
Referenced by PlmeSetAttributeConfirm().
|
private |
Called at the end of one ED channel scan.
Definition at line 1211 of file lr-wpan-mac.cc.
References ns3::Callback< R, UArgs >::IsNull(), m_channelScanIndex, ns3::MlmeScanConfirmParams::m_chPage, m_energyDetectList, ns3::MlmeScanConfirmParams::m_energyDetList, m_macPanId, m_macPanIdScan, m_maxEnergyLevel, m_mlmeScanConfirmCallback, m_pendPrimitive, m_phy, ns3::MlmeScanRequestParams::m_scanChannels, m_scanParams, ns3::MlmeScanRequestParams::m_scanType, ns3::MlmeScanConfirmParams::m_scanType, ns3::MlmeScanConfirmParams::m_status, ns3::MLME_NONE, ns3::MLMESCAN_SUCCESS, NS_LOG_FUNCTION, ns3::phyCurrentChannel, and ns3::LrWpanPhyPibAttributes::phyCurrentChannel.
Referenced by PlmeSetAttributeConfirm().
|
private |
Called at the end of the current channel scan (Active or Passive) for a given duration.
Definition at line 1156 of file lr-wpan-mac.cc.
References ns3::Callback< R, UArgs >::IsNull(), m_channelScanIndex, ns3::MlmeScanRequestParams::m_chPage, ns3::MlmeScanConfirmParams::m_chPage, ns3::MlmeScanConfirmParams::m_energyDetList, m_macPanId, m_macPanIdScan, m_mlmeScanConfirmCallback, ns3::MlmeScanConfirmParams::m_panDescList, m_panDescriptorList, m_pendPrimitive, m_phy, ns3::MlmeScanRequestParams::m_scanChannels, m_scanParams, ns3::MlmeScanRequestParams::m_scanType, ns3::MlmeScanConfirmParams::m_scanType, ns3::MlmeScanConfirmParams::m_status, ns3::MLME_NONE, ns3::MLMESCAN_SUCCESS, NS_LOG_FUNCTION, ns3::phyCurrentChannel, and ns3::LrWpanPhyPibAttributes::phyCurrentChannel.
Referenced by PlmeSetAttributeConfirm().
|
private |
Called to end a MLME-START.request after changing the page and channel number.
Definition at line 1078 of file lr-wpan-mac.cc.
References aBaseSuperframeDuration, ns3::EventId::Cancel(), ns3::IEEE_802_15_4_PHY_RX_ON, ns3::Callback< R, UArgs >::IsNull(), ns3::MlmeStartRequestParams::m_battLifeExt, ns3::MlmeStartRequestParams::m_bcnOrd, m_beaconEvent, m_beaconInterval, m_capEvent, m_cfpEvent, ns3::MlmeStartRequestParams::m_coorRealgn, m_csmaCa, m_fnlCapSlot, m_incCapEvent, m_incCfpEvent, m_macBeaconOrder, m_macPanId, m_macSuperframeOrder, m_mlmeStartConfirmCallback, ns3::MlmeStartRequestParams::m_panCoor, m_panCoor, ns3::MlmeStartRequestParams::m_PanId, m_pendPrimitive, m_phy, m_scanEnergyEvent, m_scanEvent, ns3::MlmeStartRequestParams::m_sfrmOrd, m_startParams, ns3::MlmeStartConfirmParams::m_status, m_superframeDuration, m_trackingEvent, ns3::MLME_NONE, ns3::MLMESTART_SUCCESS, NS_ASSERT, NS_LOG_ERROR, NS_LOG_FUNCTION, ns3::Simulator::ScheduleNow(), and SendOneBeacon().
Referenced by PlmeSetAttributeConfirm().
Adds a packet to the pending transactions list (Indirect transmissions).
p | The packet added to pending transaction list. |
Definition at line 2483 of file lr-wpan-mac.cc.
References aBaseSuperframeDuration, ns3::EXT_ADDR, ns3::LrWpanMacHeader::EXTADDR, ns3::LrWpanMacHeader::GetDstAddrMode(), ns3::LrWpanMacHeader::GetExtDstAddr(), ns3::LrWpanMacHeader::GetExtSrcAddr(), ns3::LrWpanMacHeader::GetSeqNum(), ns3::LrWpanMacHeader::GetShortDstAddr(), ns3::Callback< R, UArgs >::IsNull(), ns3::MlmeCommStatusIndicationParams::m_dstAddrMode, ns3::MlmeCommStatusIndicationParams::m_dstExtAddr, m_indTxQueue, m_macBeaconOrder, m_macIndTxDropTrace, m_macIndTxEnqueueTrace, m_macPanId, m_macTransactionPersistenceTime, m_maxIndTxQueueSize, m_mlmeCommStatusIndicationCallback, ns3::MlmeCommStatusIndicationParams::m_panId, m_phy, ns3::MlmeCommStatusIndicationParams::m_srcAddrMode, ns3::MlmeCommStatusIndicationParams::m_srcExtAddr, ns3::MlmeCommStatusIndicationParams::m_status, ns3::MLMECOMMSTATUS_TRANSACTION_OVERFLOW, ns3::Simulator::Now(), NS_ASSERT, ns3::Packet::PeekHeader(), PurgeInd(), ns3::Seconds(), and ns3::SHORT_ADDR.
Referenced by MlmeAssociateResponse().
|
private |
Add an element to the transmission queue.
txQElement | The element added to the Tx Queue. |
Definition at line 2281 of file lr-wpan-mac.cc.
References ns3::IEEE_802_15_4_TRANSACTION_OVERFLOW, ns3::Callback< R, UArgs >::IsNull(), m_macTxDropTrace, m_macTxEnqueueTrace, m_maxTxQueueSize, m_mcpsDataConfirmCallback, ns3::McpsDataConfirmParams::m_msduHandle, ns3::McpsDataConfirmParams::m_status, m_txQueue, and NS_LOG_DEBUG.
Referenced by McpsDataRequest(), SendAssocRequestCommand(), SendBeaconRequestCommand(), and SendDataRequestCommand().
LrWpanAssociationStatus ns3::LrWpanMac::GetAssociationStatus | ( | ) | const |
Get the current association status.
Definition at line 3376 of file lr-wpan-mac.cc.
References m_associationStatus.
Mac64Address ns3::LrWpanMac::GetCoordExtAddress | ( | ) | const |
Get the coordinator extended address currently associated to this device.
Definition at line 3412 of file lr-wpan-mac.cc.
References m_macCoordExtendedAddress.
Mac16Address ns3::LrWpanMac::GetCoordShortAddress | ( | ) | const |
Get the coordinator short address currently associated to this device.
Definition at line 3406 of file lr-wpan-mac.cc.
References m_macCoordShortAddress.
Mac64Address ns3::LrWpanMac::GetExtendedAddress | ( | ) | const |
Get the extended address of this MAC.
Definition at line 329 of file lr-wpan-mac.cc.
References m_selfExt, and NS_LOG_FUNCTION.
Referenced by McpsDataRequest(), MlmeAssociateResponse(), PrintPendTxQ(), PrintTxQueue(), SendAssocRequestCommand(), and SendOneBeacon().
|
private |
Constructs the Guaranteed Time Slots (GTS) Fields from local information.
The GTS Fields are part of the beacon frame.
Definition at line 1497 of file lr-wpan-mac.cc.
Referenced by SendOneBeacon().
uint32_t ns3::LrWpanMac::GetIfsSize | ( | ) |
Get the size of the Interframe Space according to MPDU size (m_txPkt).
Definition at line 3482 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().
uint64_t ns3::LrWpanMac::GetMacAckWaitDuration | ( | ) | const |
Get the macAckWaitDuration attribute value.
Definition at line 3433 of file lr-wpan-mac.cc.
References m_csmaCa, and m_phy.
Referenced by PdDataConfirm().
uint8_t ns3::LrWpanMac::GetMacMaxFrameRetries | ( | ) | const |
Get the macMaxFrameRetries attribute value.
Definition at line 3440 of file lr-wpan-mac.cc.
References m_macMaxFrameRetries.
uint16_t ns3::LrWpanMac::GetPanId | ( | ) | const |
Get the PAN id used by this MAC.
Definition at line 3400 of file lr-wpan-mac.cc.
References m_macPanId.
Referenced by McpsDataRequest(), and SendOneBeacon().
|
private |
Constructs Pending Address Fields from the local information, the Pending Address Fields are part of the beacon frame.
Definition at line 1507 of file lr-wpan-mac.cc.
Referenced by SendOneBeacon().
Get the underlying PHY of the MAC.
Definition at line 1528 of file lr-wpan-mac.cc.
References m_phy.
bool ns3::LrWpanMac::GetRxOnWhenIdle | ( | ) |
Check if the receiver will be enabled when the MAC is idle.
Definition at line 283 of file lr-wpan-mac.cc.
References m_macRxOnWhenIdle.
Mac16Address ns3::LrWpanMac::GetShortAddress | ( | ) | const |
Get the short address of this MAC.
Definition at line 322 of file lr-wpan-mac.cc.
References m_shortAddress, and NS_LOG_FUNCTION.
Referenced by McpsDataRequest(), MlmeStartRequest(), PdDataConfirm(), PdDataIndication(), PrintPendTxQ(), PrintTxQueue(), and SendOneBeacon().
|
private |
Constructs a Superframe specification field from the local information, the superframe Specification field is necessary to create a beacon frame.
Definition at line 1469 of file lr-wpan-mac.cc.
References m_csmaCa, m_fnlCapSlot, m_macAssociationPermit, m_macBeaconOrder, m_macSuperframeOrder, m_panCoor, ns3::SuperframeField::SetAssocPermit(), ns3::SuperframeField::SetBattLifeExt(), ns3::SuperframeField::SetBeaconOrder(), ns3::SuperframeField::SetFinalCapSlot(), ns3::SuperframeField::SetPanCoor(), and ns3::SuperframeField::SetSuperframeOrder().
Referenced by SendOneBeacon().
uint64_t ns3::LrWpanMac::GetTxPacketSymbols | ( | ) |
Obtain the number of symbols in the packet which is currently being sent by the MAC layer.
Definition at line 3509 of file lr-wpan-mac.cc.
References ns3::Packet::GetSize(), m_phy, m_txPkt, and NS_ASSERT.
|
static |
Get the type ID.
Definition at line 50 of file lr-wpan-mac.cc.
References m_incSuperframeStatus, m_lrWpanMacState, m_macIfsEndTrace, m_macIndTxDequeueTrace, m_macIndTxDropTrace, m_macIndTxEnqueueTrace, m_macPanId, m_macPromiscRxTrace, m_macRxDropTrace, m_macRxTrace, m_macStateLogger, m_macTxDequeueTrace, m_macTxDropTrace, m_macTxEnqueueTrace, m_macTxOkTrace, m_macTxTrace, m_outSuperframeStatus, m_promiscSnifferTrace, m_sentPktTrace, m_snifferTrace, ns3::MakeTraceSourceAccessor(), ns3::MakeUintegerAccessor(), and ns3::TypeId::SetParent().
|
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.
ifsTime | IFS time |
Definition at line 2345 of file lr-wpan-mac.cc.
References ns3::Time::As(), CheckQueue(), m_macIfsEndTrace, m_macLIFSPeriod, m_macSIFSPeriod, m_phy, NS_LOG_DEBUG, ns3::Time::S, and ns3::Seconds().
Referenced by PdDataConfirm(), and PdDataIndication().
bool ns3::LrWpanMac::isCoordDest | ( | ) |
Check if the packet destination is its coordinator.
Definition at line 3458 of file lr-wpan-mac.cc.
References ns3::LrWpanMacHeader::GetExtDstAddr(), ns3::LrWpanMacHeader::GetShortDstAddr(), m_macCoordExtendedAddress, m_macCoordShortAddress, m_panCoor, m_txPkt, NS_ASSERT, NS_LOG_DEBUG, and ns3::Packet::PeekHeader().
bool ns3::LrWpanMac::isTxAckReq | ( | ) |
Check if the packet to transmit requires acknowledgment.
Definition at line 3518 of file lr-wpan-mac.cc.
References ns3::LrWpanMacHeader::IsAckReq(), m_txPkt, NS_ASSERT, and ns3::Packet::PeekHeader().
|
private |
Called after m_assocRespCmdWaitTime timeout while waiting for an association response command.
Definition at line 1061 of file lr-wpan-mac.cc.
References ns3::Callback< R, UArgs >::IsNull(), ns3::MlmeAssociateConfirmParams::m_assocShortAddr, m_macCoordExtendedAddress, m_macCoordShortAddress, m_macPanId, m_mlmeAssociateConfirmCallback, ns3::MlmeAssociateConfirmParams::m_status, and ns3::MLMEASSOC_NO_DATA.
Referenced by PdDataIndication().
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.
params | the request parameters |
p | the packet to be transmitted |
Definition at line 336 of file lr-wpan-mac.cc.
References ns3::Packet::AddHeader(), ns3::ADDR_MODE_RESERVED, ns3::Packet::AddTrailer(), ns3::LrWpanPhy::aMaxPhyPacketSize, aMinMPDUOverhead, CheckQueue(), ns3::Node::ChecksumEnabled(), ns3::LrWpanMacTrailer::EnableFcs(), EnqueueTxQElement(), ns3::EXT_ADDR, ns3::LrWpanMacHeader::GetDstAddrMode(), ns3::LrWpanMacHeader::GetDstPanId(), GetExtendedAddress(), GetPanId(), GetShortAddress(), ns3::LrWpanMacHeader::GetShortDstAddr(), ns3::Packet::GetSize(), ns3::LrWpanMacHeader::GetSrcPanId(), ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::GetValue(), ns3::IEEE_802_15_4_FRAME_TOO_LONG, ns3::IEEE_802_15_4_INVALID_ADDRESS, ns3::Mac16Address::IsBroadcast(), ns3::Mac16Address::IsMulticast(), ns3::Callback< R, UArgs >::IsNull(), ns3::LrWpanMacHeader::LRWPAN_MAC_DATA, ns3::McpsDataRequestParams::m_dstAddr, ns3::McpsDataRequestParams::m_dstAddrMode, ns3::McpsDataRequestParams::m_dstExtAddr, ns3::McpsDataRequestParams::m_dstPanId, m_macDsn, m_mcpsDataConfirmCallback, ns3::McpsDataRequestParams::m_msduHandle, ns3::McpsDataConfirmParams::m_msduHandle, m_panCoor, ns3::McpsDataRequestParams::m_srcAddrMode, ns3::McpsDataConfirmParams::m_status, ns3::McpsDataRequestParams::m_txOptions, ns3::NO_PANID_ADDR, NS_ABORT_MSG, NS_ASSERT, NS_LOG_ERROR, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::LrWpanMacHeader::SetAckReq(), ns3::LrWpanMacHeader::SetDstAddrFields(), ns3::LrWpanMacHeader::SetDstAddrMode(), ns3::LrWpanMacTrailer::SetFcs(), ns3::LrWpanMacHeader::SetNoAckReq(), ns3::LrWpanMacHeader::SetNoPanIdComp(), ns3::LrWpanMacHeader::SetPanIdComp(), ns3::LrWpanMacHeader::SetSecDisable(), ns3::LrWpanMacHeader::SetSrcAddrFields(), ns3::LrWpanMacHeader::SetSrcAddrMode(), ns3::SHORT_ADDR, ns3::TX_OPTION_ACK, ns3::TX_OPTION_GTS, and ns3::TX_OPTION_INDIRECT.
void ns3::LrWpanMac::MlmeAssociateRequest | ( | MlmeAssociateRequestParams | params | ) |
IEEE 802.15.4-2011, section 6.2.2.1 MLME-ASSOCIATE.request Request primitive used by a device to request an association with a coordinator.
params | the request parameters |
Definition at line 635 of file lr-wpan-mac.cc.
References ns3::EXT_ADDR, ns3::Callback< R, UArgs >::IsNull(), m_associateParams, ns3::MlmeAssociateConfirmParams::m_assocShortAddr, ns3::MlmeAssociateRequestParams::m_chPage, ns3::MlmeAssociateRequestParams::m_coordAddrMode, ns3::MlmeAssociateRequestParams::m_coordExtAddr, ns3::MlmeAssociateRequestParams::m_coordPanId, ns3::MlmeAssociateRequestParams::m_coordShortAddr, m_mlmeAssociateConfirmCallback, m_pendPrimitive, m_phy, ns3::MlmeAssociateConfirmParams::m_status, ns3::MLME_ASSOC_REQ, ns3::MLME_NONE, ns3::MLMEASSOC_INVALID_PARAMETER, NS_LOG_ERROR, NS_LOG_FUNCTION, ns3::phyCurrentPage, ns3::LrWpanPhyPibAttributes::phyCurrentPage, and ns3::SHORT_ADDR.
void ns3::LrWpanMac::MlmeAssociateResponse | ( | MlmeAssociateResponseParams | params | ) |
IEEE 802.15.4-2011, section 6.2.2.3 MLME-ASSOCIATE.response Primitive used to initiate a response to an MLME-ASSOCIATE.indication primitive.
params | the associate response parameters |
Definition at line 710 of file lr-wpan-mac.cc.
References ns3::CommandPayloadHeader::ACCESS_DENIED, ns3::Packet::AddHeader(), ns3::Packet::AddTrailer(), ns3::ASSOCIATED, ns3::ASSOCIATED_WITHOUT_ADDRESS, ns3::CommandPayloadHeader::ASSOCIATION_RESP, ns3::Node::ChecksumEnabled(), ns3::DISASSOCIATED, ns3::LrWpanMacTrailer::EnableFcs(), EnqueueInd(), ns3::LrWpanMacHeader::EXTADDR, ns3::CommandPayloadHeader::FULL_CAPACITY, GetExtendedAddress(), ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::GetValue(), ns3::LrWpanMacHeader::LRWPAN_MAC_COMMAND, ns3::MlmeAssociateResponseParams::m_assocShortAddr, ns3::MlmeAssociateResponseParams::m_extDevAddr, m_macDsn, m_macPanId, ns3::MlmeAssociateResponseParams::m_status, NS_LOG_ERROR, NS_LOG_FUNCTION, ns3::PAN_ACCESS_DENIED, ns3::PAN_AT_CAPACITY, ns3::LrWpanMacHeader::SetAckReq(), ns3::CommandPayloadHeader::SetAssociationStatus(), ns3::LrWpanMacHeader::SetDstAddrFields(), ns3::LrWpanMacHeader::SetDstAddrMode(), ns3::LrWpanMacTrailer::SetFcs(), ns3::LrWpanMacHeader::SetPanIdComp(), ns3::LrWpanMacHeader::SetSecDisable(), ns3::CommandPayloadHeader::SetShortAddr(), ns3::LrWpanMacHeader::SetSrcAddrFields(), ns3::LrWpanMacHeader::SetSrcAddrMode(), and ns3::CommandPayloadHeader::SUCCESSFUL.
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.
params | the request parameters |
Definition at line 811 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, NS_FATAL_ERROR, and NS_LOG_FUNCTION.
void ns3::LrWpanMac::MlmeScanRequest | ( | MlmeScanRequestParams | params | ) |
IEEE 802.15.4-2011, section 6.2.10.1 MLME-SCAN.request Request primitive used to initiate a channel scan over a given list of channels.
params | the scan request parameters |
Definition at line 576 of file lr-wpan-mac.cc.
References ns3::EventId::Cancel(), ns3::Callback< R, UArgs >::IsNull(), ns3::EventId::IsRunning(), m_capEvent, m_cfpEvent, m_channelScanIndex, ns3::MlmeScanRequestParams::m_chPage, ns3::MlmeScanConfirmParams::m_chPage, m_csmaCa, m_energyDetectList, m_incCapEvent, m_incCfpEvent, m_macPanId, m_macPanIdScan, m_mlmeScanConfirmCallback, m_panDescriptorList, m_pendPrimitive, m_phy, ns3::MlmeScanRequestParams::m_scanDuration, m_scanEnergyEvent, m_scanEvent, m_scanParams, ns3::MlmeScanRequestParams::m_scanType, ns3::MlmeScanConfirmParams::m_scanType, ns3::MlmeScanConfirmParams::m_status, m_trackingEvent, ns3::MLME_SCAN_REQ, ns3::MLMESCAN_INVALID_PARAMETER, ns3::MLMESCAN_PASSIVE, ns3::MLMESCAN_SCAN_IN_PROGRESS, NS_LOG_ERROR, NS_LOG_FUNCTION, ns3::phyCurrentPage, and ns3::LrWpanPhyPibAttributes::phyCurrentPage.
void ns3::LrWpanMac::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.
params | the request parameters |
Definition at line 537 of file lr-wpan-mac.cc.
References ns3::FFD, GetShortAddress(), ns3::Callback< R, UArgs >::IsNull(), ns3::MlmeStartRequestParams::m_bcnOrd, m_deviceCapability, ns3::MlmeStartRequestParams::m_logChPage, m_mlmeStartConfirmCallback, m_pendPrimitive, m_phy, ns3::MlmeStartRequestParams::m_sfrmOrd, m_startParams, ns3::MlmeStartConfirmParams::m_status, ns3::MLME_START_REQ, ns3::MLMESTART_INVALID_PARAMETER, ns3::MLMESTART_NO_SHORT_ADDRESS, NS_ASSERT, NS_LOG_ERROR, NS_LOG_FUNCTION, ns3::phyCurrentPage, and ns3::LrWpanPhyPibAttributes::phyCurrentPage.
Referenced by ns3::LrWpanHelper::AssociateToBeaconPan().
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.
params | the request parameters |
Definition at line 772 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().
void ns3::LrWpanMac::PdDataConfirm | ( | LrWpanPhyEnumeration | status | ) |
IEEE 802.15.4-2006 section 6.2.1.2 Confirm the end of transmission of an MPDU to MAC.
status | to report to MAC PHY PD-DATA.confirm status |
Definition at line 2715 of file lr-wpan-mac.cc.
References ns3::CommandPayloadHeader::ACCESS_DENIED, AckWaitTimeout(), ns3::Time::As(), ns3::CommandPayloadHeader::ASSOCIATION_REQ, ns3::CommandPayloadHeader::ASSOCIATION_RESP, ns3::EventId::Cancel(), ns3::MlmeAssociateIndicationParams::capabilityInfo, ns3::Packet::Copy(), ns3::CommandPayloadHeader::DATA_REQ, ns3::CommandPayloadHeader::FULL_CAPACITY, ns3::CommandPayloadHeader::GetAssociationStatus(), ns3::CommandPayloadHeader::GetCapabilityField(), ns3::CommandPayloadHeader::GetCommandFrameType(), ns3::LrWpanMacHeader::GetExtSrcAddr(), GetIfsSize(), GetMacAckWaitDuration(), GetShortAddress(), ns3::Packet::GetSize(), ns3::LrWpanMacHeader::GetSrcPanId(), ns3::IEEE_802_15_4_FRAME_TOO_LONG, ns3::IEEE_802_15_4_PHY_SUCCESS, ns3::IEEE_802_15_4_PHY_UNSPECIFIED, ns3::IEEE_802_15_4_SUCCESS, IfsWaitTimeout(), ns3::LrWpanMacHeader::IsAcknowledgment(), ns3::LrWpanMacHeader::IsAckReq(), ns3::LrWpanMacHeader::IsBeacon(), ns3::LrWpanMacHeader::IsCommand(), ns3::EventId::IsExpired(), ns3::Callback< R, UArgs >::IsNull(), ns3::Time::IsZero(), m_ackWaitTimeout, ns3::MlmeAssociateConfirmParams::m_assocShortAddr, m_capEvent, m_csmaCa, ns3::MlmeAssociateIndicationParams::m_extDevAddr, m_ifsEvent, m_incCapEvent, m_incCfpEvent, m_incomingBeaconOrder, m_incomingSuperframeOrder, m_lrWpanMacState, m_macBeaconTxTime, m_macCoordExtendedAddress, m_macCoordShortAddress, m_macPanId, m_macTxDropTrace, m_macTxOkTrace, m_mcpsDataConfirmCallback, m_mlmeAssociateConfirmCallback, m_mlmeAssociateIndicationCallback, m_mlmeStartConfirmCallback, ns3::McpsDataConfirmParams::m_msduHandle, m_phy, m_rxPkt, m_setMacState, ns3::McpsDataConfirmParams::m_status, ns3::MlmeAssociateConfirmParams::m_status, ns3::MlmeStartConfirmParams::m_status, m_txPkt, m_txQueue, ns3::MAC_ACK_PENDING, ns3::MAC_IDLE, ns3::MAC_SENDING, ns3::MLMEASSOC_ACCESS_DENIED, ns3::MLMEASSOC_FULL_CAPACITY, ns3::MLMEASSOC_SUCCESS, ns3::MLMESTART_SUCCESS, ns3::Simulator::Now(), NS_ASSERT, NS_ASSERT_MSG, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_ERROR, NS_LOG_FUNCTION, ns3::OUTGOING, ns3::Packet::PeekHeader(), RemoveFirstTxQElement(), ns3::Packet::RemoveHeader(), ns3::Time::S, ns3::Simulator::Schedule(), ns3::Simulator::ScheduleNow(), ns3::Seconds(), SendAssocResponseCommand(), SetLrWpanMacState(), SetShortAddress(), StartCAP(), and ns3::CommandPayloadHeader::SUCCESSFUL.
Referenced by ns3::LrWpanNetDevice::CompleteConfig().
IEEE 802.15.4-2006 section 6.2.1.3 PD-DATA.indication Indicates the transfer of an MPDU from PHY to MAC (receiving)
psduLength | number of bytes in the PSDU |
p | the packet to be transmitted |
lqi | Link quality (LQI) value measured during reception of the PPDU |
Definition at line 1594 of file lr-wpan-mac.cc.
References aBaseSuperframeDuration, ns3::Time::As(), ns3::CommandPayloadHeader::ASSOCIATION_REQ, ns3::CommandPayloadHeader::ASSOCIATION_RESP, ns3::CommandPayloadHeader::BEACON_REQ, BeaconSearchTimeout(), ns3::EventId::Cancel(), ChangeMacState(), ns3::LrWpanMacTrailer::CheckFcs(), ns3::Node::ChecksumEnabled(), ns3::Packet::Copy(), ns3::CommandPayloadHeader::DATA_REQ, ns3::LrWpanMacTrailer::EnableFcs(), ns3::EXT_ADDR, ns3::LrWpanMacHeader::EXTADDR, ns3::SuperframeField::GetBeaconOrder(), ns3::CommandPayloadHeader::GetCommandFrameType(), ns3::Simulator::GetDelayLeft(), ns3::LrWpanMacHeader::GetDstAddrMode(), ns3::LrWpanMacHeader::GetDstPanId(), ns3::LrWpanMacHeader::GetExtDstAddr(), ns3::LrWpanMacHeader::GetExtSrcAddr(), ns3::SuperframeField::GetFinalCapSlot(), ns3::SuperframeField::GetFrameOrder(), ns3::LrWpanMacHeader::GetFrameVer(), ns3::BeaconPayloadHeader::GetGtsFields(), ns3::GtsFields::GetGtsPermit(), GetIfsSize(), ns3::BeaconPayloadHeader::GetPndAddrFields(), ns3::LrWpanMacHeader::GetSeqNum(), GetShortAddress(), 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::Mac16Address::IsBroadcast(), ns3::LrWpanMacHeader::IsCommand(), ns3::LrWpanMacHeader::IsData(), ns3::Mac16Address::IsMulticast(), ns3::Callback< R, UArgs >::IsNull(), ns3::EventId::IsRunning(), LostAssocRespCommand(), ns3::LrWpanMacHeader::LRWPAN_MAC_RESERVED, m_ackWaitTimeout, m_assocResCmdWaitTimeout, m_assocRespCmdWaitTime, m_beaconTrackingOn, ns3::MlmeBeaconNotifyIndicationParams::m_bsn, m_capEvent, ns3::PanDescriptor::m_coorAddrMode, ns3::PanDescriptor::m_coorExtAddr, ns3::PanDescriptor::m_coorPanId, ns3::PanDescriptor::m_coorShortAddr, m_csmaCa, ns3::McpsDataIndicationParams::m_dsn, ns3::McpsDataIndicationParams::m_dstAddr, ns3::McpsDataIndicationParams::m_dstAddrMode, ns3::MlmeCommStatusIndicationParams::m_dstAddrMode, ns3::McpsDataIndicationParams::m_dstExtAddr, ns3::MlmeCommStatusIndicationParams::m_dstExtAddr, ns3::McpsDataIndicationParams::m_dstPanId, ns3::PanDescriptor::m_gtsPermit, m_ifsEvent, m_incCapEvent, m_incomingBeaconInterval, m_incomingBeaconOrder, m_incomingFnlCapSlot, m_incomingSuperframeDuration, m_incomingSuperframeOrder, ns3::PanDescriptor::m_linkQuality, ns3::PanDescriptor::m_logCh, ns3::PanDescriptor::m_logChPage, m_lrWpanMacState, m_macAssociationPermit, m_macAutoRequest, m_macBeaconRxTime, m_macPanId, m_macPromiscRxTrace, m_macPromiscuousMode, m_macResponseWaitTime, m_macRxDropTrace, m_macRxTrace, m_macTxOkTrace, m_mcpsDataConfirmCallback, m_mcpsDataIndicationCallback, m_mlmeBeaconNotifyIndicationCallback, m_mlmeCommStatusIndicationCallback, m_mlmePollConfirmCallback, ns3::McpsDataIndicationParams::m_mpduLinkQuality, ns3::McpsDataConfirmParams::m_msduHandle, m_numLostBeacons, m_panCoor, ns3::MlmeBeaconNotifyIndicationParams::m_panDescriptor, m_panDescriptorList, ns3::MlmeCommStatusIndicationParams::m_panId, m_phy, m_promiscSnifferTrace, m_respWaitTimeout, m_rxBeaconSymbols, m_rxPkt, m_scanEnergyEvent, m_scanEvent, ns3::MlmeBeaconNotifyIndicationParams::m_sdu, ns3::MlmeBeaconNotifyIndicationParams::m_sduLength, m_selfExt, m_setMacState, m_shortAddress, ns3::McpsDataIndicationParams::m_srcAddr, ns3::McpsDataIndicationParams::m_srcAddrMode, ns3::MlmeCommStatusIndicationParams::m_srcAddrMode, ns3::McpsDataIndicationParams::m_srcExtAddr, ns3::MlmeCommStatusIndicationParams::m_srcExtAddr, ns3::McpsDataIndicationParams::m_srcPanId, ns3::McpsDataConfirmParams::m_status, ns3::MlmeCommStatusIndicationParams::m_status, ns3::MlmePollConfirmParams::m_status, ns3::PanDescriptor::m_superframeSpec, ns3::PanDescriptor::m_timeStamp, m_trackingEvent, m_txPkt, m_txQueue, ns3::MAC_ACK_PENDING, ns3::MAC_CSMA, ns3::MAC_IDLE, ns3::MLMECOMMSTATUS_SUCCESS, ns3::MLMEPOLL_SUCCESS, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_ERROR, NS_LOG_FUNCTION, ns3::Packet::PeekHeader(), PrepareRetransmission(), RemoveFirstTxQElement(), ns3::Packet::RemoveHeader(), RemovePendTxQElement(), ns3::Packet::RemoveTrailer(), ns3::Time::S, ns3::Simulator::Schedule(), ns3::Simulator::ScheduleNow(), ns3::Seconds(), SendAck(), SendDataRequestCommand(), SendOneBeacon(), SetLrWpanMacState(), ns3::SHORT_ADDR, and StartCAP().
Referenced by ns3::LrWpanNetDevice::CompleteConfig().
void ns3::LrWpanMac::PlmeCcaConfirm | ( | LrWpanPhyEnumeration | status | ) |
IEEE 802.15.4-2006 section 6.2.2.2 PLME-CCA.confirm status.
status | TRX_OFF, BUSY or IDLE |
Definition at line 2932 of file lr-wpan-mac.cc.
References m_csmaCa, and NS_LOG_FUNCTION.
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.
status | SUCCESS, TRX_OFF or TX_ON |
energyLevel | 0x00-0xff ED level for the channel |
Definition at line 2940 of file lr-wpan-mac.cc.
References ns3::Simulator::GetDelayLeft(), m_maxEnergyLevel, m_phy, m_scanEnergyEvent, NS_LOG_FUNCTION, and ns3::Seconds().
Referenced by ns3::LrWpanNetDevice::CompleteConfig().
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.
status | SUCCESS or UNSUPPORTED_ATTRIBUTE |
id | the attributed identifier |
attribute | the attribute value |
Definition at line 2957 of file lr-wpan-mac.cc.
References NS_LOG_FUNCTION.
Referenced by ns3::LrWpanNetDevice::CompleteConfig().
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.
status | SUCCESS, UNSUPPORTED_ATTRIBUTE, INVALID_PARAMETER, or READ_ONLY |
id | the attributed identifier |
Definition at line 3016 of file lr-wpan-mac.cc.
References aBaseSuperframeDuration, ns3::EventId::Cancel(), EndAssociateRequest(), EndChannelEnergyScan(), EndChannelScan(), EndStartRequest(), ns3::IEEE_802_15_4_PHY_RX_ON, ns3::IEEE_802_15_4_PHY_SUCCESS, ns3::Callback< R, UArgs >::IsNull(), m_associateParams, ns3::MlmeAssociateConfirmParams::m_assocShortAddr, m_channelScanIndex, ns3::MlmeAssociateRequestParams::m_chNum, ns3::MlmeScanRequestParams::m_chPage, ns3::MlmeScanConfirmParams::m_chPage, m_csmaCa, m_incCapEvent, m_incCfpEvent, m_incomingBeaconOrder, m_incomingSuperframeOrder, ns3::MlmeStartRequestParams::m_logCh, m_macCoordExtendedAddress, m_macCoordShortAddress, m_macPanId, m_maxEnergyLevel, m_mlmeAssociateConfirmCallback, m_mlmeScanConfirmCallback, m_mlmeStartConfirmCallback, m_pendPrimitive, m_phy, ns3::MlmeScanRequestParams::m_scanChannels, ns3::MlmeScanRequestParams::m_scanDuration, m_scanEnergyEvent, m_scanEvent, m_scanParams, ns3::MlmeScanRequestParams::m_scanType, ns3::MlmeScanConfirmParams::m_scanType, m_startParams, ns3::MlmeScanConfirmParams::m_status, ns3::MlmeAssociateConfirmParams::m_status, ns3::MlmeStartConfirmParams::m_status, ns3::MLME_ASSOC_REQ, ns3::MLME_SCAN_REQ, ns3::MLME_START_REQ, ns3::MLMEASSOC_INVALID_PARAMETER, ns3::MLMESCAN_ACTIVE, ns3::MLMESCAN_ED, ns3::MLMESCAN_INVALID_PARAMETER, ns3::MLMESCAN_ORPHAN, ns3::MLMESCAN_PASSIVE, ns3::MLMESTART_INVALID_PARAMETER, NS_LOG_ERROR, NS_LOG_FUNCTION, ns3::phyCurrentChannel, ns3::LrWpanPhyPibAttributes::phyCurrentChannel, ns3::phyCurrentPage, ns3::Simulator::Schedule(), ns3::Seconds(), and SendBeaconRequestCommand().
Referenced by ns3::LrWpanNetDevice::CompleteConfig().
void ns3::LrWpanMac::PlmeSetTRXStateConfirm | ( | LrWpanPhyEnumeration | status | ) |
IEEE 802.15.4-2006 section 6.2.2.8 PLME-SET-TRX-STATE.confirm Set PHY state.
status | in RX_ON,TRX_OFF,FORCE_TRX_OFF,TX_ON |
Definition at line 2965 of file lr-wpan-mac.cc.
References CheckQueue(), 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, ns3::EventId::IsRunning(), m_csmaCa, m_lrWpanMacState, m_macTxTrace, m_phy, m_promiscSnifferTrace, m_scanEnergyEvent, 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().
|
private |
Check for remaining retransmissions for the packet currently being sent.
Drop the packet, if there are no retransmissions left.
Definition at line 2371 of file lr-wpan-mac.cc.
References ns3::CommandPayloadHeader::ASSOCIATION_REQ, ns3::CommandPayloadHeader::ASSOCIATION_RESP, ns3::EventId::Cancel(), ns3::Packet::Copy(), ns3::CommandPayloadHeader::DATA_REQ, ns3::LrWpanMacHeader::EXTADDR, ns3::CommandPayloadHeader::GetCommandFrameType(), ns3::LrWpanMacHeader::GetExtDstAddr(), ns3::LrWpanMacHeader::GetExtSrcAddr(), ns3::IEEE_802_15_4_NO_ACK, ns3::LrWpanMacHeader::IsCommand(), ns3::Callback< R, UArgs >::IsNull(), ns3::MlmeAssociateConfirmParams::m_assocShortAddr, m_csmaCa, ns3::MlmeCommStatusIndicationParams::m_dstAddrMode, ns3::MlmeCommStatusIndicationParams::m_dstExtAddr, m_incCapEvent, m_incCfpEvent, m_incomingBeaconOrder, m_incomingSuperframeOrder, m_macCoordExtendedAddress, m_macCoordShortAddress, m_macMaxFrameRetries, m_macPanId, m_macTxDropTrace, m_mcpsDataConfirmCallback, m_mlmeAssociateConfirmCallback, m_mlmeCommStatusIndicationCallback, m_mlmePollConfirmCallback, ns3::McpsDataConfirmParams::m_msduHandle, m_numCsmacaRetry, ns3::MlmeCommStatusIndicationParams::m_panId, m_retransmission, ns3::MlmeCommStatusIndicationParams::m_srcAddrMode, ns3::MlmeCommStatusIndicationParams::m_srcExtAddr, ns3::McpsDataConfirmParams::m_status, ns3::MlmeAssociateConfirmParams::m_status, ns3::MlmeCommStatusIndicationParams::m_status, ns3::MlmePollConfirmParams::m_status, m_txPkt, m_txQueue, ns3::MLMEASSOC_NO_ACK, ns3::MLMECOMMSTATUS_NO_ACK, ns3::MLMEPOLL_NO_ACK, NS_LOG_FUNCTION, ns3::Packet::PeekHeader(), RemoveFirstTxQElement(), ns3::Packet::RemoveHeader(), and RemovePendTxQElement().
Referenced by AckWaitTimeout(), and PdDataIndication().
void ns3::LrWpanMac::PrintPendTxQ | ( | std::ostream & | os | ) | const |
Print the Pending transaction list.
os | The reference to the output stream used by this print function. |
Definition at line 2614 of file lr-wpan-mac.cc.
References ns3::Time::As(), GetExtendedAddress(), GetShortAddress(), ns3::LrWpanMacHeader::IsCommand(), ns3::LrWpanMacHeader::IsData(), m_indTxQueue, ns3::Simulator::Now(), and ns3::Time::S.
void ns3::LrWpanMac::PrintTransmitQueueSize | ( | ) |
Print the number of elements in the packet transmit queue.
Definition at line 3446 of file lr-wpan-mac.cc.
References m_txQueue, and NS_LOG_DEBUG.
void ns3::LrWpanMac::PrintTxQueue | ( | std::ostream & | os | ) | const |
Print the Transmit Queue.
os | The reference to the output stream used by this print function. |
Definition at line 2646 of file lr-wpan-mac.cc.
References ns3::Time::As(), ns3::LrWpanMacHeader::GetDstPanId(), ns3::LrWpanMacHeader::GetExtDstAddr(), GetExtendedAddress(), ns3::LrWpanMacHeader::GetSeqNum(), GetShortAddress(), ns3::LrWpanMacHeader::GetShortDstAddr(), ns3::LrWpanMacHeader::IsCommand(), ns3::LrWpanMacHeader::IsData(), m_indTxQueue, m_txQueue, ns3::Simulator::Now(), and ns3::Time::S.
|
private |
Purge expired transactions from the pending transactions list.
Definition at line 2567 of file lr-wpan-mac.cc.
References ns3::LrWpanMacHeader::EXTADDR, ns3::LrWpanMacHeader::GetExtDstAddr(), ns3::LrWpanMacHeader::GetExtSrcAddr(), ns3::IEEE_802_15_4_TRANSACTION_EXPIRED, ns3::LrWpanMacHeader::IsCommand(), ns3::LrWpanMacHeader::IsData(), ns3::Callback< R, UArgs >::IsNull(), ns3::MlmeCommStatusIndicationParams::m_dstAddrMode, ns3::MlmeCommStatusIndicationParams::m_dstExtAddr, m_indTxQueue, m_macIndTxDropTrace, m_macPanId, m_mcpsDataConfirmCallback, m_mlmeCommStatusIndicationCallback, ns3::MlmeCommStatusIndicationParams::m_panId, ns3::MlmeCommStatusIndicationParams::m_srcAddrMode, ns3::MlmeCommStatusIndicationParams::m_srcExtAddr, ns3::McpsDataConfirmParams::m_status, ns3::MlmeCommStatusIndicationParams::m_status, ns3::MLMECOMMSTATUS_TRANSACTION_EXPIRED, and ns3::Simulator::Now().
Referenced by DequeueInd(), and EnqueueInd().
|
private |
Remove the tip of the transmission queue, including clean up related to the last packet transmission.
Definition at line 2303 of file lr-wpan-mac.cc.
References ns3::Packet::Copy(), ns3::LrWpanMacHeader::GetShortDstAddr(), ns3::Mac16Address::IsBroadcast(), ns3::Mac16Address::IsMulticast(), m_csmaCa, m_macTxDequeueTrace, m_numCsmacaRetry, m_retransmission, m_sentPktTrace, m_txPkt, m_txQueue, and ns3::Packet::RemoveHeader().
Referenced by PdDataConfirm(), PdDataIndication(), PrepareRetransmission(), and SetLrWpanMacState().
Remove an element from the pending transaction list.
p | The packet to be removed from the pending transaction list. |
Definition at line 2682 of file lr-wpan-mac.cc.
References ns3::EXT_ADDR, ns3::LrWpanMacHeader::GetDstAddrMode(), ns3::LrWpanMacHeader::GetExtDstAddr(), ns3::LrWpanMacHeader::GetSeqNum(), ns3::LrWpanMacHeader::GetShortDstAddr(), m_indTxQueue, m_macIndTxDequeueTrace, ns3::Packet::PeekHeader(), and ns3::SHORT_ADDR.
Referenced by PdDataIndication(), PrepareRetransmission(), and SetLrWpanMacState().
|
private |
Send an acknowledgment packet for the given sequence number.
seqno | the sequence number for the ACK |
Definition at line 2252 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().
|
private |
Called to send an associate request command.
Definition at line 928 of file lr-wpan-mac.cc.
References ns3::Packet::AddHeader(), ns3::Packet::AddTrailer(), ns3::CommandPayloadHeader::ASSOCIATION_REQ, CheckQueue(), ns3::Node::ChecksumEnabled(), ns3::LrWpanMacTrailer::EnableFcs(), EnqueueTxQElement(), ns3::LrWpanMacHeader::EXTADDR, GetExtendedAddress(), ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::GetValue(), ns3::LrWpanMacHeader::LRWPAN_MAC_COMMAND, m_associateParams, ns3::MlmeAssociateRequestParams::m_capabilityInfo, ns3::MlmeAssociateRequestParams::m_coordAddrMode, ns3::MlmeAssociateRequestParams::m_coordExtAddr, ns3::MlmeAssociateRequestParams::m_coordPanId, ns3::MlmeAssociateRequestParams::m_coordShortAddr, m_macDsn, NS_LOG_FUNCTION, ns3::LrWpanMacHeader::SetAckReq(), ns3::CommandPayloadHeader::SetCapabilityField(), ns3::LrWpanMacHeader::SetDstAddrFields(), ns3::LrWpanMacHeader::SetDstAddrMode(), ns3::LrWpanMacTrailer::SetFcs(), ns3::LrWpanMacHeader::SetSecDisable(), ns3::LrWpanMacHeader::SetSrcAddrFields(), ns3::LrWpanMacHeader::SetSrcAddrMode(), ns3::SHORT_ADDR, and ns3::LrWpanMacHeader::SHORTADDR.
Referenced by EndAssociateRequest().
Called to send an associate response command.
rxDataReqPkt | The received data request pkt that instigated the Association response command. |
Definition at line 1036 of file lr-wpan-mac.cc.
References ns3::CommandPayloadHeader::DATA_REQ, DequeueInd(), ns3::CommandPayloadHeader::GetCommandFrameType(), ns3::LrWpanMacHeader::GetExtSrcAddr(), m_txQueue, NS_ASSERT, NS_LOG_DEBUG, and ns3::Packet::RemoveHeader().
Referenced by PdDataConfirm().
|
private |
Called to send a beacon request command.
Definition at line 886 of file lr-wpan-mac.cc.
References ns3::Packet::AddHeader(), ns3::Packet::AddTrailer(), ns3::CommandPayloadHeader::BEACON_REQ, CheckQueue(), ns3::Node::ChecksumEnabled(), ns3::LrWpanMacTrailer::EnableFcs(), EnqueueTxQElement(), ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::GetValue(), ns3::LrWpanMacHeader::LRWPAN_MAC_COMMAND, m_macDsn, ns3::LrWpanMacHeader::NOADDR, NS_LOG_FUNCTION, ns3::CommandPayloadHeader::SetCommandFrameType(), ns3::LrWpanMacHeader::SetDstAddrFields(), ns3::LrWpanMacHeader::SetDstAddrMode(), ns3::LrWpanMacTrailer::SetFcs(), ns3::LrWpanMacHeader::SetNoAckReq(), ns3::LrWpanMacHeader::SetNoPanIdComp(), ns3::LrWpanMacHeader::SetSecDisable(), ns3::LrWpanMacHeader::SetSrcAddrMode(), and ns3::LrWpanMacHeader::SHORTADDR.
Referenced by PlmeSetAttributeConfirm().
|
private |
Used to send a data request command (i.e.
Request the coordinator to send the association response)
Definition at line 977 of file lr-wpan-mac.cc.
References ns3::Packet::AddHeader(), ns3::Packet::AddTrailer(), CheckQueue(), ns3::Node::ChecksumEnabled(), ns3::CommandPayloadHeader::DATA_REQ, ns3::LrWpanMacTrailer::EnableFcs(), EnqueueTxQElement(), ns3::LrWpanMacHeader::EXTADDR, ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::GetValue(), ns3::LrWpanMacHeader::LRWPAN_MAC_COMMAND, m_macCoordExtendedAddress, m_macCoordShortAddress, m_macDsn, m_macPanId, m_selfExt, NS_LOG_FUNCTION, ns3::LrWpanMacHeader::SetAckReq(), ns3::LrWpanMacHeader::SetDstAddrFields(), ns3::LrWpanMacHeader::SetDstAddrMode(), ns3::LrWpanMacTrailer::SetFcs(), ns3::LrWpanMacHeader::SetSecDisable(), ns3::LrWpanMacHeader::SetSrcAddrFields(), ns3::LrWpanMacHeader::SetSrcAddrMode(), and ns3::LrWpanMacHeader::SHORTADDR.
Referenced by PdDataIndication().
|
private |
Called to send a single beacon frame.
Definition at line 826 of file lr-wpan-mac.cc.
References ns3::Packet::AddHeader(), ns3::Packet::AddTrailer(), ns3::BEACON, ChangeMacState(), ns3::Node::ChecksumEnabled(), ns3::LrWpanMacTrailer::EnableFcs(), ns3::LrWpanMacHeader::EXTADDR, GetExtendedAddress(), GetGtsFields(), GetPanId(), GetPendingAddrFields(), GetShortAddress(), GetSuperframeField(), ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::GetValue(), ns3::IEEE_802_15_4_PHY_TX_ON, ns3::LrWpanMacHeader::LRWPAN_MAC_BEACON, m_csmaCa, m_lrWpanMacState, m_macBsn, m_outSuperframeStatus, m_phy, m_superframeDuration, m_txPkt, ns3::MAC_IDLE, ns3::MAC_SENDING, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::LrWpanMacHeader::SetDstAddrFields(), ns3::LrWpanMacHeader::SetDstAddrMode(), ns3::LrWpanMacTrailer::SetFcs(), ns3::BeaconPayloadHeader::SetGtsFields(), ns3::LrWpanMacHeader::SetNoAckReq(), ns3::BeaconPayloadHeader::SetPndAddrFields(), ns3::LrWpanMacHeader::SetSecDisable(), ns3::LrWpanMacHeader::SetSrcAddrFields(), ns3::LrWpanMacHeader::SetSrcAddrMode(), ns3::BeaconPayloadHeader::SetSuperframeSpecField(), and ns3::LrWpanMacHeader::SHORTADDR.
Referenced by EndStartRequest(), PdDataIndication(), and StartInactivePeriod().
void ns3::LrWpanMac::SetAssociatedCoor | ( | Mac16Address | mac | ) |
Check if the packet destination is its coordinator.
mac | The coordinator short MAC Address |
Definition at line 3497 of file lr-wpan-mac.cc.
References m_macCoordShortAddress, and third::mac.
void ns3::LrWpanMac::SetAssociatedCoor | ( | Mac64Address | mac | ) |
Check if the packet destination is its coordinator.
mac | The coordinator extended MAC Address |
Definition at line 3503 of file lr-wpan-mac.cc.
References m_macCoordExtendedAddress, and third::mac.
void ns3::LrWpanMac::SetAssociationStatus | ( | LrWpanAssociationStatus | status | ) |
Set the current association status.
status | new association status |
Definition at line 3382 of file lr-wpan-mac.cc.
References m_associationStatus.
void ns3::LrWpanMac::SetCsmaCa | ( | Ptr< LrWpanCsmaCa > | csmaCa | ) |
Set the CSMA/CA implementation to be used by the MAC.
csmaCa | the CSMA/CA implementation |
Definition at line 1516 of file lr-wpan-mac.cc.
References m_csmaCa.
void ns3::LrWpanMac::SetExtendedAddress | ( | Mac64Address | address | ) |
Set the extended address of this MAC.
address | the new address |
Definition at line 315 of file lr-wpan-mac.cc.
References first::address, m_selfExt, and NS_LOG_FUNCTION.
void ns3::LrWpanMac::SetIndTxQMaxSize | ( | uint32_t | queueSize | ) |
Set the max size of the indirect transmit queue (Pending Transaction list)
queueSize | The indirect transmit queue size. |
Definition at line 3394 of file lr-wpan-mac.cc.
References m_maxIndTxQueueSize.
void ns3::LrWpanMac::SetLrWpanMacState | ( | LrWpanMacState | macState | ) |
CSMA-CA algorithm calls back the MAC after executing channel assessment.
macState | indicate BUSY oder IDLE channel condition |
Definition at line 3217 of file lr-wpan-mac.cc.
References ns3::CommandPayloadHeader::ASSOCIATION_REQ, ns3::CommandPayloadHeader::ASSOCIATION_RESP, ns3::EventId::Cancel(), ChangeMacState(), ns3::CHANNEL_ACCESS_FAILURE, ns3::CHANNEL_IDLE, ns3::Packet::Copy(), ns3::CommandPayloadHeader::DATA_REQ, ns3::LrWpanMacHeader::EXTADDR, ns3::CommandPayloadHeader::GetCommandFrameType(), ns3::LrWpanMacHeader::GetExtDstAddr(), ns3::LrWpanMacHeader::GetExtSrcAddr(), ns3::IEEE_802_15_4_CHANNEL_ACCESS_FAILURE, ns3::IEEE_802_15_4_PHY_RX_ON, ns3::IEEE_802_15_4_PHY_TRX_OFF, ns3::IEEE_802_15_4_PHY_TX_ON, ns3::LrWpanMacHeader::IsCommand(), ns3::LrWpanMacHeader::IsData(), ns3::Callback< R, UArgs >::IsNull(), ns3::MlmeAssociateConfirmParams::m_assocShortAddr, m_csmaCa, ns3::MlmeCommStatusIndicationParams::m_dstAddrMode, ns3::MlmeCommStatusIndicationParams::m_dstExtAddr, m_incCapEvent, m_incCfpEvent, m_incomingBeaconOrder, m_incomingSuperframeOrder, m_lrWpanMacState, m_macCoordExtendedAddress, m_macCoordShortAddress, m_macPanId, m_macRxOnWhenIdle, m_macTxDropTrace, m_mcpsDataConfirmCallback, m_mlmeAssociateConfirmCallback, m_mlmeCommStatusIndicationCallback, m_mlmePollConfirmCallback, ns3::McpsDataConfirmParams::m_msduHandle, m_numCsmacaRetry, ns3::MlmeCommStatusIndicationParams::m_panId, m_phy, m_retransmission, ns3::MlmeCommStatusIndicationParams::m_srcAddrMode, ns3::MlmeCommStatusIndicationParams::m_srcExtAddr, ns3::McpsDataConfirmParams::m_status, ns3::MlmeAssociateConfirmParams::m_status, ns3::MlmeCommStatusIndicationParams::m_status, ns3::MlmePollConfirmParams::m_status, m_txPkt, m_txQueue, ns3::MAC_ACK_PENDING, ns3::MAC_CSMA, ns3::MAC_CSMA_DEFERRED, ns3::MAC_IDLE, ns3::MAC_SENDING, ns3::MLMEASSOC_CHANNEL_ACCESS_FAILURE, ns3::MLMECOMMSTATUS_CHANNEL_ACCESS_FAILURE, ns3::MLMEPOLL_CHANNEL_ACCESS_FAILURE, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, RemoveFirstTxQElement(), ns3::Packet::RemoveHeader(), and RemovePendTxQElement().
Referenced by AckWaitTimeout(), CheckQueue(), ns3::LrWpanNetDevice::CompleteConfig(), PdDataConfirm(), and PdDataIndication().
void ns3::LrWpanMac::SetMacMaxFrameRetries | ( | uint8_t | retries | ) |
Set the macMaxFrameRetries attribute value.
retries | the maximum number of retries |
Definition at line 3452 of file lr-wpan-mac.cc.
References m_macMaxFrameRetries.
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.
c | the callback |
Definition at line 1552 of file lr-wpan-mac.cc.
References m_mcpsDataConfirmCallback.
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.
c | the callback |
Definition at line 1534 of file lr-wpan-mac.cc.
References m_mcpsDataIndicationCallback.
void ns3::LrWpanMac::SetMlmeAssociateConfirmCallback | ( | MlmeAssociateConfirmCallback | c | ) |
Set the callback for the confirmation of a data transmission request.
The callback implements MLME-ASSOCIATE.confirm SAP of IEEE 802.15.4-2011, section 6.2.2.4.
c | the callback |
Definition at line 1570 of file lr-wpan-mac.cc.
References m_mlmeAssociateConfirmCallback.
void ns3::LrWpanMac::SetMlmeAssociateIndicationCallback | ( | MlmeAssociateIndicationCallback | c | ) |
Set the callback for the indication of an incoming associate request command.
The callback implements MLME-ASSOCIATE.indication SAP of IEEE 802.15.4-2011, section 6.2.2.2.
c | the callback |
Definition at line 1540 of file lr-wpan-mac.cc.
References m_mlmeAssociateIndicationCallback.
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.
c | the callback |
Definition at line 1576 of file lr-wpan-mac.cc.
References m_mlmeBeaconNotifyIndicationCallback.
void ns3::LrWpanMac::SetMlmeCommStatusIndicationCallback | ( | MlmeCommStatusIndicationCallback | c | ) |
Set the callback for the indication to a response primitive.
The callback implements MLME-COMM-STATUS.indication SAP of IEEE 802.15.4-2011, section 6.2.4.2.
c | the callback |
Definition at line 1546 of file lr-wpan-mac.cc.
References m_mlmeCommStatusIndicationCallback.
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
c | the callback |
Definition at line 1588 of file lr-wpan-mac.cc.
References m_mlmePollConfirmCallback.
void ns3::LrWpanMac::SetMlmeScanConfirmCallback | ( | MlmeScanConfirmCallback | c | ) |
Set the callback for the confirmation of a data transmission request.
The callback implements MLME-SCAN.confirm SAP of IEEE 802.15.4-2011, section 6.2.10.2.
c | the callback |
Definition at line 1564 of file lr-wpan-mac.cc.
References m_mlmeScanConfirmCallback.
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.
c | the callback |
Definition at line 1558 of file lr-wpan-mac.cc.
References m_mlmeStartConfirmCallback.
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.
c | the callback |
Definition at line 1582 of file lr-wpan-mac.cc.
References m_mlmeSyncLossIndicationCallback.
void ns3::LrWpanMac::SetPanId | ( | uint16_t | panId | ) |
Set the PAN id used by this MAC.
panId | the new PAN id. |
Definition at line 3418 of file lr-wpan-mac.cc.
References m_macPanId.
Set the underlying PHY for the MAC.
phy | the PHY |
Definition at line 1522 of file lr-wpan-mac.cc.
References m_phy, and third::phy.
void ns3::LrWpanMac::SetRxOnWhenIdle | ( | bool | rxOnWhenIdle | ) |
Set if the receiver should be enabled when the MAC is idle.
rxOnWhenIdle | set to true to enable the receiver during idle periods |
Definition at line 289 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.
void ns3::LrWpanMac::SetShortAddress | ( | Mac16Address | address | ) |
Set the short address of this MAC.
address | the new address |
Definition at line 308 of file lr-wpan-mac.cc.
References first::address, m_shortAddress, and NS_LOG_FUNCTION.
Referenced by PdDataConfirm().
void ns3::LrWpanMac::SetTxQMaxSize | ( | uint32_t | queueSize | ) |
Set the max size of the transmit queue.
queueSize | The transmit queue size. |
Definition at line 3388 of file lr-wpan-mac.cc.
References m_maxTxQueueSize.
|
private |
Called to begin the Contention Access Period (CAP) in a beacon-enabled mode.
superframeType | The incoming or outgoing superframe reference |
Definition at line 1265 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().
|
private |
Called to begin the Contention Free Period (CFP) in a beacon-enabled mode.
superframeType | The incoming or outgoing superframe reference |
Definition at line 1313 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().
|
private |
Start the Inactive Period in a beacon-enabled mode.
superframeType | The incoming or outgoing superframe reference |
Definition at line 1363 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().
|
staticconstexpr |
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 729 of file lr-wpan-mac.h.
|
staticconstexpr |
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 742 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), BeaconSearchTimeout(), EndStartRequest(), EnqueueInd(), MlmeSyncRequest(), PdDataIndication(), and PlmeSetAttributeConfirm().
|
staticconstexpr |
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 750 of file lr-wpan-mac.h.
Referenced by BeaconSearchTimeout().
|
staticconstexpr |
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 757 of file lr-wpan-mac.h.
Referenced by GetIfsSize().
|
staticconstexpr |
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 722 of file lr-wpan-mac.h.
Referenced by McpsDataRequest().
|
staticconstexpr |
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 735 of file lr-wpan-mac.h.
|
private |
Scheduler event for the ACK timeout of the currently transmitted data packet.
Definition at line 2031 of file lr-wpan-mac.h.
Referenced by PdDataConfirm(), and PdDataIndication().
|
private |
The parameters used during a MLME-ASSOCIATE.request.
These parameters are stored here while PLME-SET operations (set channel page, set channel number) take place.
Definition at line 2003 of file lr-wpan-mac.h.
Referenced by EndAssociateRequest(), MlmeAssociateRequest(), PlmeSetAttributeConfirm(), and SendAssocRequestCommand().
|
private |
The current association status of the MAC layer.
Definition at line 1929 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), GetAssociationStatus(), and SetAssociationStatus().
|
private |
Scheduler event for the lost of a association response command frame.
Definition at line 2041 of file lr-wpan-mac.h.
Referenced by PdDataIndication().
uint64_t ns3::LrWpanMac::m_assocRespCmdWaitTime |
The maximum wait time for an association response command after the reception of data request command ACK during the association process.
Not explicitly listed by the standard but its use is required for a device to react to the lost of the association response (failure of the association: NO_DATA)
Definition at line 1143 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), and PdDataIndication().
|
private |
Scheduler event for generation of one beacon.
Definition at line 2056 of file lr-wpan-mac.h.
Referenced by DoDispose(), EndStartRequest(), and StartInactivePeriod().
uint32_t ns3::LrWpanMac::m_beaconInterval |
Indication of the Interval used by the coordinator to transmit beacon frames expressed in symbols.
Definition at line 1317 of file lr-wpan-mac.h.
Referenced by EndStartRequest(), and StartInactivePeriod().
bool ns3::LrWpanMac::m_beaconTrackingOn |
Indication of whether the current device is tracking incoming beacons.
Definition at line 1345 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), BeaconSearchTimeout(), MlmeSyncRequest(), and PdDataIndication().
|
private |
Scheduler event for the end of the outgoing superframe CAP.
Definition at line 2061 of file lr-wpan-mac.h.
Referenced by EndStartRequest(), MlmeScanRequest(), PdDataConfirm(), PdDataIndication(), and StartCAP().
|
private |
Scheduler event for the end of the outgoing superframe CFP.
Definition at line 2066 of file lr-wpan-mac.h.
Referenced by EndStartRequest(), MlmeScanRequest(), and StartCFP().
|
private |
The channel list index used to obtain the current scanned channel.
Definition at line 2008 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), EndChannelEnergyScan(), EndChannelScan(), MlmeScanRequest(), and PlmeSetAttributeConfirm().
|
private |
The CSMA/CA implementation used by this MAC.
Definition at line 1844 of file lr-wpan-mac.h.
Referenced by CheckQueue(), DoDispose(), EndStartRequest(), GetMacAckWaitDuration(), GetSuperframeField(), MlmeScanRequest(), PdDataConfirm(), PdDataIndication(), PlmeCcaConfirm(), PlmeSetAttributeConfirm(), PlmeSetTRXStateConfirm(), PrepareRetransmission(), RemoveFirstTxQElement(), SendOneBeacon(), SetCsmaCa(), and SetLrWpanMacState().
uint8_t ns3::LrWpanMac::m_deviceCapability |
Indication of current device capability (FFD or RFD)
Definition at line 1340 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), and MlmeStartRequest().
|
private |
The list of energy measurements, one for each channel searched during an ED scan.
Definition at line 1985 of file lr-wpan-mac.h.
Referenced by EndChannelEnergyScan(), and MlmeScanRequest().
uint8_t ns3::LrWpanMac::m_fnlCapSlot |
Indication of the Slot where the CAP portion of the OUTGOING Superframe ends.
Definition at line 1203 of file lr-wpan-mac.h.
Referenced by EndStartRequest(), GetSuperframeField(), StartCAP(), and StartCFP().
uint32_t ns3::LrWpanMac::m_ifs |
The value of the necessary InterFrame Space after the transmission of a packet.
Definition at line 1306 of file lr-wpan-mac.h.
Referenced by LrWpanMac().
|
private |
Scheduler event for Interframe spacing wait time.
Definition at line 2051 of file lr-wpan-mac.h.
Referenced by CheckQueue(), PdDataConfirm(), and PdDataIndication().
|
private |
Scheduler event for the end of the incoming superframe CAP.
Definition at line 2071 of file lr-wpan-mac.h.
Referenced by EndStartRequest(), MlmeScanRequest(), PdDataConfirm(), PdDataIndication(), PlmeSetAttributeConfirm(), PrepareRetransmission(), and SetLrWpanMacState().
|
private |
Scheduler event for the end of the incoming superframe CFP.
Definition at line 2076 of file lr-wpan-mac.h.
Referenced by EndStartRequest(), MlmeScanRequest(), PdDataConfirm(), PlmeSetAttributeConfirm(), PrepareRetransmission(), SetLrWpanMacState(), and StartCFP().
uint32_t ns3::LrWpanMac::m_incomingBeaconInterval |
Indication of the interval a node should receive a superframe expressed in symbols.
Definition at line 1329 of file lr-wpan-mac.h.
Referenced by PdDataIndication(), and StartInactivePeriod().
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 1210 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), BeaconSearchTimeout(), MlmeSyncRequest(), PdDataConfirm(), PdDataIndication(), PlmeSetAttributeConfirm(), PrepareRetransmission(), and SetLrWpanMacState().
uint8_t ns3::LrWpanMac::m_incomingFnlCapSlot |
Indication of the Slot where the CAP portion of the INCOMING Superframe ends.
Definition at line 1223 of file lr-wpan-mac.h.
Referenced by PdDataIndication(), StartCAP(), and StartCFP().
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 1335 of file lr-wpan-mac.h.
Referenced by PdDataIndication(), StartCAP(), StartCFP(), and StartInactivePeriod().
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 1218 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), PdDataConfirm(), PdDataIndication(), PlmeSetAttributeConfirm(), PrepareRetransmission(), and SetLrWpanMacState().
|
private |
The current period of the incoming superframe.
Definition at line 1919 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), AwaitBeacon(), CheckQueue(), GetTypeId(), StartCAP(), StartCFP(), and StartInactivePeriod().
|
private |
The indirect transmit queue used by the MAC pending messages (The pending transaction list).
Definition at line 1964 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), DequeueInd(), DoDispose(), EnqueueInd(), PrintPendTxQ(), PrintTxQueue(), PurgeInd(), and RemovePendTxQElement().
|
private |
The current state of the MAC layer.
Definition at line 1914 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), ChangeMacState(), CheckQueue(), GetTypeId(), PdDataConfirm(), PdDataIndication(), PlmeSetTRXStateConfirm(), SendAck(), SendOneBeacon(), SetLrWpanMacState(), and SetRxOnWhenIdle().
bool ns3::LrWpanMac::m_macAssociationPermit |
Indication of whether a coordinator is currently allowing association.
A value of TRUE indicates that the association is permitted. See IEEE 802.15.4-2011, section 6.4.2, Table 52.
Definition at line 1287 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), GetSuperframeField(), and PdDataIndication().
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 1296 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), and PdDataIndication().
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 1173 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), EndStartRequest(), EnqueueInd(), and GetSuperframeField().
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 1128 of file lr-wpan-mac.h.
Referenced by PdDataIndication(), and StartCAP().
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 1120 of file lr-wpan-mac.h.
Referenced by PdDataConfirm(), and StartCAP().
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 1255 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), MlmePollRequest(), and SendOneBeacon().
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 1159 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), EndAssociateRequest(), GetCoordExtAddress(), isCoordDest(), LostAssocRespCommand(), PdDataConfirm(), PlmeSetAttributeConfirm(), PrepareRetransmission(), SendDataRequestCommand(), SetAssociatedCoor(), and SetLrWpanMacState().
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 1152 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), EndAssociateRequest(), GetCoordShortAddress(), isCoordDest(), LostAssocRespCommand(), PdDataConfirm(), PlmeSetAttributeConfirm(), PrepareRetransmission(), SendDataRequestCommand(), SetAssociatedCoor(), and SetLrWpanMacState().
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 1249 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), McpsDataRequest(), MlmeAssociateResponse(), SendAssocRequestCommand(), SendBeaconRequestCommand(), and SendDataRequestCommand().
|
private |
The trace source is fired at the end of any Interframe Space (IFS).
Definition at line 1681 of file lr-wpan-mac.h.
Referenced by GetTypeId(), and IfsWaitTimeout().
|
private |
The trace source fired when packets are dequeued from the L3/l2 indirect transmission queue (Pending transaction list).
Definition at line 1725 of file lr-wpan-mac.h.
Referenced by DequeueInd(), GetTypeId(), and RemovePendTxQElement().
|
private |
The trace source fired when packets are dropped due to indirect Tx queue overflows or expiration.
Definition at line 1757 of file lr-wpan-mac.h.
Referenced by EnqueueInd(), GetTypeId(), and PurgeInd().
|
private |
The trace source fired when packets come into the "top" of the device at the L3/L2 transition, when being queued for indirect transmission (pending transaction list).
Definition at line 1717 of file lr-wpan-mac.h.
Referenced by EnqueueInd(), and GetTypeId().
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 1274 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), GetIfsSize(), and IfsWaitTimeout().
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 1261 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), GetMacMaxFrameRetries(), PrepareRetransmission(), and SetMacMaxFrameRetries().
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 1237 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), BeaconSearchTimeout(), EndAssociateRequest(), EndChannelEnergyScan(), EndChannelScan(), EndStartRequest(), EnqueueInd(), GetPanId(), GetTypeId(), LostAssocRespCommand(), MlmeAssociateResponse(), MlmeScanRequest(), MlmeSyncRequest(), PdDataConfirm(), PdDataIndication(), PlmeSetAttributeConfirm(), PrepareRetransmission(), PurgeInd(), SendDataRequestCommand(), SetLrWpanMacState(), and SetPanId().
uint16_t ns3::LrWpanMac::m_macPanIdScan |
Temporally stores the value of the current m_macPanId when a MLME-SCAN.request is performed.
See IEEE 802.15.4-2011, section 5.1.2.1.2.
Definition at line 1243 of file lr-wpan-mac.h.
Referenced by EndChannelEnergyScan(), EndChannelScan(), and MlmeScanRequest().
|
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.
Definition at line 1766 of file lr-wpan-mac.h.
Referenced by GetTypeId(), and PdDataIndication().
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 1230 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), and PdDataIndication().
uint64_t ns3::LrWpanMac::m_macResponseWaitTime |
The maximum time, in multiples of aBaseSuperframeDuration, a device shall wait for a response command frame to be available following a request command frame.
Definition at line 1135 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), and PdDataIndication().
|
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).
Definition at line 1784 of file lr-wpan-mac.h.
Referenced by GetTypeId(), and PdDataIndication().
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 1268 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), DoInitialize(), GetRxOnWhenIdle(), SetLrWpanMacState(), and SetRxOnWhenIdle().
|
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.
Definition at line 1775 of file lr-wpan-mac.h.
Referenced by GetTypeId(), and PdDataIndication().
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 1280 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), GetIfsSize(), and IfsWaitTimeout().
|
private |
A trace source that fires when the LrWpanMac changes states.
Parameters are the old mac state and the new mac state.
MacStateValue
TracedValue. Definition at line 1834 of file lr-wpan-mac.h.
Referenced by ChangeMacState(), and GetTypeId().
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 1181 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), EndStartRequest(), and GetSuperframeField().
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 1165 of file lr-wpan-mac.h.
uint16_t ns3::LrWpanMac::m_macTransactionPersistenceTime |
The maximum time (in UNIT periods) that a transaction is stored by a coordinator and indicated in its beacon.
This value establish the expiration time of the packets stored in the pending transaction list (indirect transmissions). 1 Unit Period: Beacon-enabled = aBaseSuperframeDuration * 2^BO Non-beacon enabled = aBaseSuperframeDuration See IEEE 802.15.4-2006, section 7.4.2, Table 86.
Definition at line 1192 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), and EnqueueInd().
|
private |
The trace source fired when packets are dequeued from the L3/l2 transmission queue.
Definition at line 1709 of file lr-wpan-mac.h.
Referenced by GetTypeId(), and RemoveFirstTxQElement().
|
private |
The trace source fired when packets are dropped due to missing ACKs or because of transmission failures in L1.
Definition at line 1749 of file lr-wpan-mac.h.
Referenced by EnqueueTxQElement(), GetTypeId(), PdDataConfirm(), PrepareRetransmission(), and SetLrWpanMacState().
|
private |
The trace source fired when packets come into the "top" of the device at the L3/L2 transition, when being queued for transmission.
Definition at line 1701 of file lr-wpan-mac.h.
Referenced by EnqueueTxQElement(), and GetTypeId().
|
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.
Definition at line 1741 of file lr-wpan-mac.h.
Referenced by GetTypeId(), PdDataConfirm(), and PdDataIndication().
|
private |
The trace source fired when packets are being sent down to L1.
Definition at line 1732 of file lr-wpan-mac.h.
Referenced by GetTypeId(), and PlmeSetTRXStateConfirm().
uint8_t ns3::LrWpanMac::m_maxEnergyLevel |
The maximum energy level detected during ED scan on the current channel.
Definition at line 1301 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), EndChannelEnergyScan(), PlmeEdConfirm(), and PlmeSetAttributeConfirm().
|
private |
The maximum size of the indirect transmit queue (The pending transaction list).
Definition at line 1974 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), EnqueueInd(), and SetIndTxQMaxSize().
|
private |
The maximum size of the transmit queue.
Definition at line 1969 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), EnqueueTxQElement(), and SetTxQMaxSize().
|
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 1909 of file lr-wpan-mac.h.
Referenced by DoDispose(), EnqueueTxQElement(), McpsDataRequest(), PdDataConfirm(), PdDataIndication(), PrepareRetransmission(), PurgeInd(), SetLrWpanMacState(), and SetMcpsDataConfirmCallback().
|
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 1890 of file lr-wpan-mac.h.
Referenced by DoDispose(), PdDataIndication(), and SetMcpsDataIndicationCallback().
|
private |
This callback is used to report the status after a device request an association with a coordinator.
See IEEE 802.15.4-2011, section 6.2.2.4.
Definition at line 1870 of file lr-wpan-mac.h.
Referenced by DoDispose(), LostAssocRespCommand(), MlmeAssociateRequest(), PdDataConfirm(), PlmeSetAttributeConfirm(), PrepareRetransmission(), SetLrWpanMacState(), and SetMlmeAssociateConfirmCallback().
|
private |
This callback is used to indicate the reception of an association request command.
See IEEE 802.15.4-2011, section 6.2.2.2
Definition at line 1896 of file lr-wpan-mac.h.
Referenced by DoDispose(), PdDataConfirm(), and SetMlmeAssociateIndicationCallback().
|
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 1850 of file lr-wpan-mac.h.
Referenced by DoDispose(), PdDataIndication(), and SetMlmeBeaconNotifyIndicationCallback().
|
private |
This callback is instigated through a response primitive.
See IEEE 802.15.4-2011, section 6.2.4.2
Definition at line 1902 of file lr-wpan-mac.h.
Referenced by DoDispose(), EnqueueInd(), PdDataIndication(), PrepareRetransmission(), PurgeInd(), SetLrWpanMacState(), and SetMlmeCommStatusIndicationCallback().
|
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 1877 of file lr-wpan-mac.h.
Referenced by DoDispose(), PdDataIndication(), PrepareRetransmission(), SetLrWpanMacState(), and SetMlmePollConfirmCallback().
|
private |
This callback is used to report the result of a scan on a group of channels for the selected channel page.
See IEEE 802.15.4-2011, section 6.2.10.2.
Definition at line 1863 of file lr-wpan-mac.h.
Referenced by DoDispose(), EndChannelEnergyScan(), EndChannelScan(), MlmeScanRequest(), PlmeSetAttributeConfirm(), and SetMlmeScanConfirmCallback().
|
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 1884 of file lr-wpan-mac.h.
Referenced by DoDispose(), EndStartRequest(), MlmeStartRequest(), PdDataConfirm(), PlmeSetAttributeConfirm(), and SetMlmeStartConfirmCallback().
|
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 1856 of file lr-wpan-mac.h.
Referenced by BeaconSearchTimeout(), DoDispose(), and SetMlmeSyncLossIndicationCallback().
|
private |
The number of CSMA/CA retries used for sending the current packet.
Definition at line 2025 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), PrepareRetransmission(), RemoveFirstTxQElement(), and SetLrWpanMacState().
uint8_t ns3::LrWpanMac::m_numLostBeacons |
The number of consecutive loss beacons in a beacon tracking operation.
Definition at line 1350 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), BeaconSearchTimeout(), MlmeSyncRequest(), and PdDataIndication().
|
private |
The current period of the outgoing superframe.
Definition at line 1924 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), CheckQueue(), GetTypeId(), SendOneBeacon(), StartCAP(), StartCFP(), and StartInactivePeriod().
bool ns3::LrWpanMac::m_panCoor |
Indication of whether the current device is the PAN coordinator.
Definition at line 1311 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), CheckQueue(), EndStartRequest(), GetSuperframeField(), isCoordDest(), McpsDataRequest(), and PdDataIndication().
|
private |
The list of PAN descriptors accumulated during channel scans, used to select a PAN to associate.
Definition at line 1980 of file lr-wpan-mac.h.
Referenced by EndChannelScan(), MlmeScanRequest(), and PdDataIndication().
|
private |
Indicates the pending primitive when PLME.SET operation (page or channel switch) is called from within another MLME primitive (e.g.
Association, Scan, Sync, Start).
Definition at line 2014 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), EndAssociateRequest(), EndChannelEnergyScan(), EndChannelScan(), EndStartRequest(), MlmeAssociateRequest(), MlmeScanRequest(), MlmeStartRequest(), and PlmeSetAttributeConfirm().
The PHY associated with this MAC.
Definition at line 1839 of file lr-wpan-mac.h.
Referenced by BeaconSearchTimeout(), DoDispose(), DoInitialize(), EndChannelEnergyScan(), EndChannelScan(), EndStartRequest(), EnqueueInd(), GetMacAckWaitDuration(), GetPhy(), GetTxPacketSymbols(), IfsWaitTimeout(), MlmeAssociateRequest(), MlmeScanRequest(), MlmeStartRequest(), MlmeSyncRequest(), PdDataConfirm(), PdDataIndication(), PlmeEdConfirm(), PlmeSetAttributeConfirm(), PlmeSetTRXStateConfirm(), SendAck(), SendOneBeacon(), SetLrWpanMacState(), SetPhy(), SetRxOnWhenIdle(), StartCAP(), StartCFP(), and StartInactivePeriod().
|
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.
Definition at line 1824 of file lr-wpan-mac.h.
Referenced by GetTypeId(), PdDataIndication(), and PlmeSetTRXStateConfirm().
|
private |
Scheduler event for a response to a request command frame.
Definition at line 2036 of file lr-wpan-mac.h.
Referenced by PdDataIndication().
|
private |
The number of already used retransmission for the currently transmitted packet.
Definition at line 2020 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), PrepareRetransmission(), RemoveFirstTxQElement(), and SetLrWpanMacState().
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 1198 of file lr-wpan-mac.h.
Referenced by PdDataIndication().
The command request packet received.
Briefly stored to proceed with operations that take place after ACK messages.
Definition at line 1940 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), PdDataConfirm(), and PdDataIndication().
|
private |
Scheduler event for the end of a ED channel scan.
Definition at line 2091 of file lr-wpan-mac.h.
Referenced by EndStartRequest(), MlmeScanRequest(), PdDataIndication(), PlmeEdConfirm(), PlmeSetAttributeConfirm(), and PlmeSetTRXStateConfirm().
|
private |
Scheduler event for the end of a channel scan.
Definition at line 2086 of file lr-wpan-mac.h.
Referenced by EndStartRequest(), MlmeScanRequest(), PdDataIndication(), and PlmeSetAttributeConfirm().
|
private |
The parameters used during a MLME-SCAN.request.
These parameters are stored here while PLME-SET operations (set channel page, set channel number) and multiple ed scans take place.
Definition at line 1991 of file lr-wpan-mac.h.
Referenced by EndChannelEnergyScan(), EndChannelScan(), MlmeScanRequest(), and PlmeSetAttributeConfirm().
|
private |
The extended address used by this MAC.
Extended addresses are currently not really supported.
Definition at line 1953 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), GetExtendedAddress(), PdDataIndication(), SendDataRequestCommand(), and SetExtendedAddress().
|
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
Definition at line 1693 of file lr-wpan-mac.h.
Referenced by GetTypeId(), and RemoveFirstTxQElement().
|
private |
Scheduler event for a deferred MAC state change.
Definition at line 2046 of file lr-wpan-mac.h.
Referenced by CheckQueue(), PdDataConfirm(), and PdDataIndication().
|
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 1947 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), GetShortAddress(), PdDataIndication(), and SetShortAddress().
|
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.
Definition at line 1804 of file lr-wpan-mac.h.
Referenced by GetTypeId(), and PlmeSetTRXStateConfirm().
|
private |
The parameters used during a MLME-START.request.
These parameters are stored here while PLME-SET operations (set channel page, set channel number) take place.
Definition at line 1997 of file lr-wpan-mac.h.
Referenced by EndStartRequest(), MlmeStartRequest(), and PlmeSetAttributeConfirm().
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 1323 of file lr-wpan-mac.h.
Referenced by EndStartRequest(), SendOneBeacon(), StartCAP(), StartCFP(), and StartInactivePeriod().
|
private |
Scheduler event to track the incoming beacons.
Definition at line 2081 of file lr-wpan-mac.h.
Referenced by BeaconSearchTimeout(), EndStartRequest(), MlmeScanRequest(), MlmeSyncRequest(), and PdDataIndication().
The packet which is currently being sent by the MAC layer.
Definition at line 1934 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), CheckQueue(), DoDispose(), GetIfsSize(), GetTxPacketSymbols(), isCoordDest(), isTxAckReq(), PdDataConfirm(), PdDataIndication(), PlmeSetTRXStateConfirm(), PrepareRetransmission(), RemoveFirstTxQElement(), SendAck(), SendOneBeacon(), and SetLrWpanMacState().
|
private |
The transmit queue used by the MAC.
Definition at line 1958 of file lr-wpan-mac.h.
Referenced by LrWpanMac(), CheckQueue(), DoDispose(), EnqueueTxQElement(), PdDataConfirm(), PdDataIndication(), PrepareRetransmission(), PrintTransmitQueueSize(), PrintTxQueue(), RemoveFirstTxQElement(), SendAssocResponseCommand(), and SetLrWpanMacState().