20 #ifndef LR_WPAN_MAC_BASE_H
21 #define LR_WPAN_MAC_BASE_H
23 #include <ns3/callback.h>
24 #include <ns3/mac16-address.h>
25 #include <ns3/mac64-address.h>
26 #include <ns3/nstime.h>
27 #include <ns3/object.h>
28 #include <ns3/packet.h>
Lr-wpan MAC layer abstraction.
void SetMlmeCommStatusIndicationCallback(MlmeCommStatusIndicationCallback c)
Set the callback for the indication to a response primitive.
virtual void MlmeGetRequest(LrWpanMacPibAttributeIdentifier id)=0
IEEE 802.15.4-2011, section 6.2.5.1 MLME-GET.request Request information about a given PIB attribute.
virtual void MlmePollRequest(MlmePollRequestParams params)=0
IEEE 802.15.4-2011, section 6.2.14.2 MLME-POLL.request Prompts the device to request data from the co...
MlmeOrphanIndicationCallback m_mlmeOrphanIndicationCallback
This callback is used to indicate the reception of a orphan notification command.
MlmeStartConfirmCallback m_mlmeStartConfirmCallback
This callback is used to report the start of a new PAN or the begin of a new superframe configuration...
void SetMlmeScanConfirmCallback(MlmeScanConfirmCallback c)
Set the callback for the confirmation of a data transmission request.
virtual void MlmeAssociateRequest(MlmeAssociateRequestParams params)=0
IEEE 802.15.4-2011, section 6.2.2.1 MLME-ASSOCIATE.request Request primitive used by a device to requ...
void SetMlmeAssociateConfirmCallback(MlmeAssociateConfirmCallback c)
Set the callback for the confirmation of a data transmission request.
void SetMcpsDataConfirmCallback(McpsDataConfirmCallback c)
Set the callback for the confirmation of a data transmission request.
void SetMlmeBeaconNotifyIndicationCallback(MlmeBeaconNotifyIndicationCallback c)
Set the callback for the indication of an incoming beacon packet.
virtual void MlmeAssociateResponse(MlmeAssociateResponseParams params)=0
IEEE 802.15.4-2011, section 6.2.2.3 MLME-ASSOCIATE.response Primitive used to initiate a response to ...
MlmeCommStatusIndicationCallback m_mlmeCommStatusIndicationCallback
This callback is instigated through a response primitive.
void SetMlmeAssociateIndicationCallback(MlmeAssociateIndicationCallback c)
Set the callback for the indication of an incoming associate request command.
McpsDataIndicationCallback m_mcpsDataIndicationCallback
This callback is used to notify incoming packets to the upper layers.
MlmeGetConfirmCallback m_mlmeGetConfirmCallback
This callback is used to report the result of an attribute read request to the upper layers.
void SetMlmeStartConfirmCallback(MlmeStartConfirmCallback c)
Set the callback for the confirmation of a data transmission request.
void SetMlmeGetConfirmCallback(MlmeGetConfirmCallback c)
Set the callback for the confirmation of an attempt to read an attribute.
MlmeBeaconNotifyIndicationCallback m_mlmeBeaconNotifyIndicationCallback
This callback is used to notify incoming beacon packets to the upper layers.
static TypeId GetTypeId()
Get the type ID.
void SetMlmeSetConfirmCallback(MlmeSetConfirmCallback c)
Set the callback for the confirmation of an attempt to write an attribute.
virtual void MlmeStartRequest(MlmeStartRequestParams params)=0
IEEE 802.15.4-2006, section 7.1.14.1 MLME-START.request Request to allow a PAN coordinator to initiat...
virtual void MlmeScanRequest(MlmeScanRequestParams params)=0
IEEE 802.15.4-2011, section 6.2.10.1 MLME-SCAN.request Request primitive used to initiate a channel s...
void SetMlmeOrphanIndicationCallback(MlmeOrphanIndicationCallback c)
Set the callback for the indication to the reception of an orphan notification.
MlmeAssociateConfirmCallback m_mlmeAssociateConfirmCallback
This callback is used to report the status after a device request an association with a coordinator.
virtual void MlmeOrphanResponse(MlmeOrphanResponseParams params)=0
IEEE 802.15.4-2011, section 6.2.7.2 MLME-ORPHAN.response Primitive used to initiatte a response to an...
void SetMcpsDataIndicationCallback(McpsDataIndicationCallback c)
Set the callback for the indication of an incoming data packet.
MlmeAssociateIndicationCallback m_mlmeAssociateIndicationCallback
This callback is used to indicate the reception of an association request command.
MlmeScanConfirmCallback m_mlmeScanConfirmCallback
This callback is used to report the result of a scan on a group of channels for the selected channel ...
void SetMlmePollConfirmCallback(MlmePollConfirmCallback c)
Set the callback for the confirmation of a data transmission request.
McpsDataConfirmCallback m_mcpsDataConfirmCallback
This callback is used to report data transmission request status to the upper layers.
virtual void MlmeSyncRequest(MlmeSyncRequestParams params)=0
IEEE 802.15.4-2011, section 6.2.13.1 MLME-SYNC.request Request to synchronize with the coordinator by...
virtual void MlmeSetRequest(LrWpanMacPibAttributeIdentifier id, Ptr< LrWpanMacPibAttributes > attribute)=0
IEEE 802.15.4-2011, section 6.2.11.1 MLME-SET.request Attempts to write the given value to the indica...
~LrWpanMacBase() override
MlmePollConfirmCallback m_mlmePollConfirmCallback
This callback is used to report the status after a device send data command request to the coordinato...
virtual void McpsDataRequest(McpsDataRequestParams params, Ptr< Packet > p)=0
IEEE 802.15.4-2006, section 7.1.1.1 MCPS-DATA.request Request to transfer a MSDU.
void SetMlmeSyncLossIndicationCallback(MlmeSyncLossIndicationCallback c)
Set the callback for the loss of synchronization with a coordinator.
MlmeSetConfirmCallback m_mlmeSetConfirmCallback
This callback is used to report the result of an attribute writing request to the upper layers.
MlmeSyncLossIndicationCallback m_mlmeSyncLossIndicationCallback
This callback is used to indicate the loss of synchronization with a coordinator.
This class can contain 16 bit addresses.
A base class which provides memory management and object aggregation.
A template-based reference counting class.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
LrWpanMlmeScanType
Table 30 of IEEE 802.15.4-2011.
LrWpanMacStatus
The status of a confirm or an indication primitive as a result of a previous request.
LrWpanAddressMode
table 80 of 802.15.4
LrWpanMacPibAttributeIdentifier
IEEE802.15.4-2011 MAC PIB Attribute Identifiers Table 52 in section 6.4.2.
@ CHANNEL_ACCESS_FAILURE
CHANNEL_ACCESS_FAILURE.
@ TRANSACTION_OVERFLOW
There is no capacity to store the transaction.
@ NO_BEACON
A scan operation failed to find any network beacons.
@ TX_ACTIVE
The transceiver was already enabled.
@ INVALID_GTS
Missing GTS transmit or undefined direction.
@ UNSUPPORTED_ATTRIBUTE
SET/GET request issued with a non supported ID.
@ NO_SHORT_ADDRESS
Failure due to unallocated 16-bit short address.
@ PAST_TIME
Rx enable request fail due to lack of time in superframe.
@ ACCESS_DENIED
PAN access denied.
@ BEACON_LOSS
The beacon was lost following a synchronization request.
@ PAN_ID_CONFLICT
PAN id conflict detected and informed to the coordinator.
@ DISABLE_TRX_FAILURE
The attempt to disable the transceier has failed.
@ LIMIT_REACHED
PAN descriptors stored reached max capacity.
@ TRACKING_OFF
This device is currently not tracking beacons.
@ READ_ONLY
SET/GET request issued for a read only attribute.
@ ON_TIME_TOO_LONG
RX enable request fail due to syms.
@ TRANSACTION_EXPIRED
The transaction expired and its information discarded.
@ SCAN_IN_PROGRESS
Scan failed because already performing another scan.
@ FRAME_TOO_LONG
Frame more than aMaxPHYPacketSize or too large for CAP or GTS.
@ OUT_OF_CAP
(Deprecated) See IEEE 802.15.4-2003
@ IMPROPER_KEY_TYPE
The key is not allowed to be used with that frame type.
@ DENIED
The GTS request has been denied by the PAN coordinator.
@ IMPROPER_SECURITY_LEVEL
Insufficient security level expected by the recipient.
@ INVALID_ADDRESS
Invalid source or destination address.
@ INVALID_HANDLE
When purging from TX queue handle was not found.
@ REALIGMENT
A coordinator realigment command has been received.
@ FULL_CAPACITY
PAN at capacity.
@ COUNTER_ERROR
The frame counter of the received frame is invalid.
@ UNSUPPORTED_LEGACY
Deprecated security used in IEEE 802.15.4-2003.
@ NO_ACK
No acknowledgment was received after macMaxFrameRetries.
@ SUPERFRAME_OVERLAP
Coordinator sperframe and this device superframe tx overlap.
@ UNAVAILABLE_KEY
Unavailable key, unknown or blacklisted.
@ UNSUPPORTED_SECURITY
The security applied is not supported.
@ NO_DATA
No response data were available following a request.
@ INVALID_INDEX
A MAC PIB write failed because specified index is out of range.
@ INVALID_PARAMETER
Primitive parameter not supported or out of range.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.
IEEE802.15.4-2011 PHY PIB Attributes Table 52 in section 6.4.2.
Mac64Address macExtendedAddress
The EUI-64 bit address.
uint8_t macBeaconPayloadLength
The length in octets of the beacon payload.
uint8_t pCurrentChannel
The current logical channel in used in the PHY.
uint8_t pCurrentPage
The current logical page in use in the PHY.
Ptr< Packet > macBeaconPayload
The contents of the beacon payload.
Mac16Address macShortAddress
The 16 bit mac short address.
uint16_t macPanId
The identifier of the PAN.
MCPS-DATA.confirm params.
LrWpanMacStatus m_status
The status of the last MSDU transmission.
uint8_t m_msduHandle
MSDU handle.
MCPS-DATA.indication params.
Mac16Address m_dstAddr
Destination address.
uint8_t m_dstAddrMode
Destination address mode.
uint16_t m_dstPanId
Destination PAN identifier.
uint8_t m_dsn
The DSN of the received data frame.
uint8_t m_mpduLinkQuality
LQI value measured during reception of the MPDU.
uint16_t m_srcPanId
Source PAN identifier.
Mac64Address m_dstExtAddr
Destination extended address.
uint8_t m_srcAddrMode
Source address mode.
Mac64Address m_srcExtAddr
Source extended address.
Mac16Address m_srcAddr
Source address.
MCPS-DATA.request params.
LrWpanAddressMode m_srcAddrMode
Source address mode.
Mac64Address m_dstExtAddr
Destination extended address.
LrWpanAddressMode m_dstAddrMode
Destination address mode.
uint16_t m_dstPanId
Destination PAN identifier.
Mac16Address m_dstAddr
Destination address.
uint8_t m_msduHandle
MSDU handle.
uint8_t m_txOptions
Tx Options (bitfield)
MLME-ASSOCIATE.confirm params.
LrWpanMacStatus m_status
The status of a MLME-associate.request.
Mac16Address m_assocShortAddr
The short address used in the association request.
MLME-ASSOCIATE.indication params.
uint8_t capabilityInfo
The operational capabilities of the device requesting association.
uint8_t lqi
The link quality indicator of the received associate request command (Not officially supported in the...
Mac64Address m_extDevAddr
The extended address of the device requesting association.
MLME-ASSOCIATE.request params.
uint8_t m_chNum
The channel number on which to attempt association.
uint8_t m_coordAddrMode
The coordinator addressing mode for this primitive and subsequent MPDU.
uint8_t m_capabilityInfo
Specifies the operational capabilities of the associating device (bitmap).
uint32_t m_chPage
The channel page on which to attempt association.
Mac64Address m_coordExtAddr
The extended address of the coordinator with which to associate.
Mac16Address m_coordShortAddr
The short address of the coordinator with which to associate.
uint16_t m_coordPanId
The identifier of the PAN with which to associate.
MLME-ASSOCIATE.response params.
Mac16Address m_assocShortAddr
The short address allocated by the coordinator on successful assoc.
LrWpanMacStatus m_status
The status of the association attempt (As defined on Table 83 IEEE 802.15.4-2006)
Mac64Address m_extDevAddr
The extended address of the device requesting association.
MLME-BEACON-NOTIFY.indication params.
uint32_t m_sduLength
The number of octets contained in the beacon payload.
uint8_t m_bsn
The beacon sequence number.
Ptr< Packet > m_sdu
The set of octets comprising the beacon payload.
PanDescriptor m_panDescriptor
The PAN descriptor for the received beacon.
MLME-COMM-STATUS.indication params.
Mac16Address m_srcShortAddr
The short address of the entity from which the frame causing the error originated.
Mac16Address m_dstShortAddr
The short address of the device for which the frame was intended.
Mac64Address m_dstExtAddr
The extended address of the device for which the frame was intended.
uint16_t m_panId
The PAN identifier of the device from which the frame was received or to which the frame was being se...
Mac64Address m_srcExtAddr
The extended address of the entity from which the frame causing the error originated.
uint8_t m_dstAddrMode
The destination addressing mode for this primitive.
uint8_t m_srcAddrMode
The source addressing mode for this primitive.
LrWpanMacStatus m_status
The communication status.
MLME-ORPHAN.indication params.
Mac64Address m_orphanAddr
The address of the orphaned device.
MLME-ORPHAN.response params.
Mac16Address m_shortAddr
The short address allocated.
Mac64Address m_orphanAddr
The address of the orphaned device.
bool m_assocMember
T = allocated with this coord | F = otherwise.
MLME-START.confirm params.
LrWpanMacStatus m_status
The confirmation status resulting from a MLME-poll.request.
MLME-POLL.request params.
Mac16Address m_coorShortAddr
Coordinator short address.
uint16_t m_coorPanId
The PAN id of the coordinator to which the poll is intended.
Mac64Address m_coorExtAddr
Coordinator extended address.
LrWpanAddressMode m_coorAddrMode
The addressing mode of the coordinator to which the pool is intended.
MLME-SCAN.confirm params.
std::vector< PanDescriptor > m_panDescList
A list of PAN descriptor, one for each beacon found (Not valid for ED and Orphan scans).
uint32_t m_chPage
The channel page on which the scan was performed.
uint8_t m_scanType
Indicates the type of scan performed (ED,ACTIVE,PASSIVE,ORPHAN).
std::vector< uint8_t > m_unscannedCh
A list of channels given in the request which were not scanned (Not valid for ED scans).
std::vector< uint8_t > m_energyDetList
A list of energy measurements, one for each channel searched during ED scan (Not valid for Active,...
LrWpanMacStatus m_status
The status of the scan request.
uint8_t m_resultListSize
The number of elements returned in the appropriate result list.
MLME-SCAN.request params.
uint32_t m_scanChannels
The channel numbers to be scanned.
uint32_t m_chPage
The channel page on which to perform scan.
uint8_t m_scanDuration
The factor (0-14) used to calculate the length of time to spend scanning.
LrWpanMlmeScanType m_scanType
Indicates the type of scan performed as described in IEEE 802.15.4-2011 (5.1.2.1).
LrWpanMacStatus m_status
The result of the request to write the PIB attribute.
LrWpanMacPibAttributeIdentifier id
The id of the PIB attribute that was written.
MLME-START.confirm params.
LrWpanMacStatus m_status
The status of a MLME-start.request.
MLME-START.request params.
uint32_t m_logChPage
Logical channel page on which to start using the new superframe configuration.
uint8_t m_logCh
Logical channel on which to start using the new superframe configuration.
bool m_panCoor
On true this device will become coordinator.
bool m_coorRealgn
True if a realignment request command is to be transmitted prior changing the superframe.
uint8_t m_bcnOrd
Beacon Order, Used to calculate the beacon interval, a value of 15 indicates no periodic beacons will...
uint32_t m_startTime
Time at which to begin transmitting beacons (Used by Coordinator not PAN Coordinators).
uint16_t m_PanId
Pan Identifier used by the device.
uint8_t m_sfrmOrd
Superframe Order, indicates the length of the CAP in time slots.
bool m_battLifeExt
Flag indicating whether or not the Battery life extension (BLE) features are used.
MLME-SYNC-LOSS.indication params.
uint16_t m_panId
The PAN identifier with which the device lost synchronization or to which it was realigned.
LrWpanMacStatus m_lossReason
The reason for the lost of synchronization.
uint8_t m_logCh
The channel number on which the device lost synchronization or to which it was realigned.
MLME-SYNC.request params.
bool m_trackBcn
True if the mlme sync with the next beacon and attempts to track future beacons.
uint8_t m_logCh
The channel number on which to attempt coordinator synchronization.
PAN Descriptor, Table 17 IEEE 802.15.4-2011.
LrWpanAddressMode m_coorAddrMode
The coordinator addressing mode corresponding to the received beacon frame.
uint16_t m_superframeSpec
The superframe specification as specified in the received beacon frame.
Mac64Address m_coorExtAddr
The coordinator extended address as specified in the coordinator address mode.
Mac16Address m_coorShortAddr
The coordinator short address as specified in the coordinator address mode.
uint8_t m_logChPage
The current channel page occupied by the network.
uint16_t m_coorPanId
The PAN ID of the coordinator as specified in the received beacon frame.
bool m_gtsPermit
TRUE if the beacon is from the PAN coordinator that is accepting GTS requests.
uint8_t m_linkQuality
The LQI at which the network beacon was received.
Time m_timeStamp
Beacon frame reception time.
uint8_t m_logCh
The current channel number occupied by the network.