A Discrete-Event Network Simulator
API
lr-wpan-mac.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 The Boeing Company
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Authors:
18  * Gary Pei <guangyu.pei@boeing.com>
19  * kwong yin <kwong-sang.yin@boeing.com>
20  * Tom Henderson <thomas.r.henderson@boeing.com>
21  * Sascha Alexander Jopen <jopen@cs.uni-bonn.de>
22  * Alberto Gallegos Ramonet <ramonet@fc.ritsumei.ac.jp>
23  */
24 
25 #ifndef LR_WPAN_MAC_H
26 #define LR_WPAN_MAC_H
27 
28 #include "lr-wpan-fields.h"
29 #include "lr-wpan-mac-base.h"
30 #include "lr-wpan-phy.h"
31 
32 #include <ns3/event-id.h>
33 #include <ns3/sequence-number.h>
34 #include <ns3/traced-callback.h>
35 #include <ns3/traced-value.h>
36 
37 #include <deque>
38 #include <memory>
39 
40 namespace ns3
41 {
42 
43 class Packet;
44 class LrWpanCsmaCa;
45 
59 {
64 };
65 
72 {
83 };
84 
92 std::ostream& operator<<(std::ostream& os, const LrWpanMacState& state);
93 
100 {
102  CAP,
103  CFP,
104  INACTIVE
105 };
106 
113 {
114  OUTGOING = 0,
115  INCOMING = 1
116 };
117 
124 {
125  MLME_NONE = 0,
129  MLME_SYNC_REQ = 4
130 };
131 
132 namespace TracedValueCallback
133 {
134 
142 typedef void (*LrWpanMacState)(LrWpanMacState oldValue, LrWpanMacState newValue);
143 
151 typedef void (*SuperframeStatus)(SuperframeStatus oldValue, SuperframeStatus newValue);
152 
153 } // namespace TracedValueCallback
154 
160 class LrWpanMac : public LrWpanMacBase
161 {
162  public:
168  static TypeId GetTypeId();
169 
173  LrWpanMac();
174  ~LrWpanMac() override;
175 
181  bool GetRxOnWhenIdle() const;
182 
188  void SetRxOnWhenIdle(bool rxOnWhenIdle);
189 
190  // XXX these setters will become obsolete if we use the attribute system
197 
204 
211 
218 
224  void SetPanId(uint16_t panId);
225 
231  uint16_t GetPanId() const;
232 
239 
246 
248 
250 
252 
254 
256 
258 
260 
262 
264  Ptr<LrWpanMacPibAttributes> attribute) override;
265 
267 
273  void SetCsmaCa(Ptr<LrWpanCsmaCa> csmaCa);
274 
280  void SetPhy(Ptr<LrWpanPhy> phy);
281 
288 
290  // Interfaces between MAC and PHY //
292 
301  void PdDataIndication(uint32_t psduLength, Ptr<Packet> p, uint8_t lqi);
302 
309  void PdDataConfirm(LrWpanPhyEnumeration status);
310 
317 
324  void PlmeEdConfirm(LrWpanPhyEnumeration status, uint8_t energyLevel);
325 
336  Ptr<LrWpanPhyPibAttributes> attribute);
337 
345 
354 
360  void SetLrWpanMacState(LrWpanMacState macState);
361 
367  void SetTxQMaxSize(uint32_t queueSize);
368 
374  void SetIndTxQMaxSize(uint32_t queueSize);
375 
376  // MAC PIB attributes
377 
384 
392 
399 
407 
416 
423 
429 
437 
445 
456 
462 
466  uint8_t m_fnlCapSlot;
467 
474 
482 
487 
494 
500  uint16_t m_macPanId;
501 
506  uint16_t m_macPanIdScan;
507 
513 
519 
526 
532 
538 
545 
550  uint32_t m_macLIFSPeriod;
551 
556  uint32_t m_macSIFSPeriod;
557 
564 
573 
578 
582  uint32_t m_ifs;
583 
587  bool m_panCoor;
588 
592  bool m_coor;
593 
599 
605 
611 
617 
622 
627 
632 
638  uint64_t GetMacAckWaitDuration() const;
639 
645  uint8_t GetMacMaxFrameRetries() const;
646 
650  void PrintTransmitQueueSize();
651 
657  void SetMacMaxFrameRetries(uint8_t retries);
658 
664  bool isCoordDest();
665 
672 
679 
685  uint32_t GetIfsSize();
686 
692  uint64_t GetTxPacketSymbols();
693 
699  bool isTxAckReq();
700 
705  void PrintPendingTxQueue(std::ostream& os) const;
706 
711  void PrintTxQueue(std::ostream& os) const;
712 
720  typedef void (*SentTracedCallback)(Ptr<const Packet> packet, uint8_t retries, uint8_t backoffs);
721 
731  typedef void (*StateTracedCallback)(LrWpanMacState oldState, LrWpanMacState newState);
732 
733  protected:
734  // Inherited from Object.
735  void DoInitialize() override;
736  void DoDispose() override;
737 
738  private:
742  struct TxQueueElement : public SimpleRefCount<TxQueueElement>
743  {
744  uint8_t txQMsduHandle;
746  };
747 
751  struct IndTxQueueElement : public SimpleRefCount<IndTxQueueElement>
752  {
753  uint8_t seqNum;
758  };
759 
763  void SendOneBeacon();
764 
769 
774  void SendDataRequestCommand();
775 
782  void SendAssocResponseCommand(Ptr<Packet> rxDataReqPkt);
783 
788  void LostAssocRespCommand();
789 
794 
801 
805  void EndStartRequest();
806 
810  void EndChannelScan();
811 
815  void EndChannelEnergyScan();
816 
820  void EndAssociateRequest();
821 
828  void StartCFP(SuperframeType superframeType);
829 
836  void StartCAP(SuperframeType superframeType);
837 
844  void StartInactivePeriod(SuperframeType superframeType);
845 
850  void AwaitBeacon();
851 
855  void BeaconSearchTimeout();
856 
862  void SendAck(uint8_t seqno);
863 
869  void EnqueueTxQElement(Ptr<TxQueueElement> txQElement);
870 
875  void RemoveFirstTxQElement();
876 
882  void ChangeMacState(LrWpanMacState newState);
883 
888  void AckWaitTimeout();
889 
897  void IfsWaitTimeout(Time ifsTime);
898 
905  bool PrepareRetransmission();
906 
912  void EnqueueInd(Ptr<Packet> p);
913 
922 
926  void PurgeInd();
927 
934 
940  void CheckQueue();
941 
948  uint16_t GetSuperframeField();
949 
957 
965 
970 
982 
990 
998 
1006 
1014 
1021 
1030 
1038 
1046 
1055 
1064 
1073 
1093 
1113 
1123 
1128 
1133 
1138 
1143 
1148 
1153 
1159 
1166 
1171 
1175  std::deque<Ptr<TxQueueElement>> m_txQueue;
1176 
1181  std::deque<Ptr<IndTxQueueElement>> m_indTxQueue;
1182 
1187 
1192 
1197  std::vector<PanDescriptor> m_panDescriptorList;
1198 
1202  std::vector<uint8_t> m_energyDetectList;
1203 
1207  std::vector<uint8_t> m_unscannedChannels;
1208 
1214 
1220 
1226 
1231 
1237 
1243 
1248 
1253 
1259 
1264 
1269 
1274 
1279 
1284 
1289 
1294 
1299 
1304 
1309 
1314 
1319 
1324 };
1325 } // namespace ns3
1326 
1327 #endif /* LR_WPAN_MAC_H */
An identifier for simulation events.
Definition: event-id.h:55
Represent the GTS information fields.
Lr-wpan MAC layer abstraction.
Class that implements the LR-WPAN MAC state machine.
Definition: lr-wpan-mac.h:161
uint32_t m_incomingBeaconInterval
Indication of the interval a node should receive a superframe expressed in symbols.
Definition: lr-wpan-mac.h:610
uint32_t GetIfsSize()
Get the size of the Interframe Space according to MPDU size (m_txPkt).
void McpsDataRequest(McpsDataRequestParams params, Ptr< Packet > p) override
IEEE 802.15.4-2006, section 7.1.1.1 MCPS-DATA.request Request to transfer a MSDU.
Definition: lr-wpan-mac.cc:384
Ptr< LrWpanCsmaCa > m_csmaCa
The CSMA/CA implementation used by this MAC.
Definition: lr-wpan-mac.h:1132
uint64_t m_assocRespCmdWaitTime
The maximum wait time for an association response command after the reception of data request command...
Definition: lr-wpan-mac.h:406
uint64_t GetMacAckWaitDuration() const
Get the macAckWaitDuration attribute value.
Time m_macBeaconRxTime
The time that the device received its last bit of the beacon frame.
Definition: lr-wpan-mac.h:391
void PlmeCcaConfirm(LrWpanPhyEnumeration status)
IEEE 802.15.4-2006 section 6.2.2.2 PLME-CCA.confirm status.
void MlmeAssociateRequest(MlmeAssociateRequestParams params) override
IEEE 802.15.4-2011, section 6.2.2.1 MLME-ASSOCIATE.request Request primitive used by a device to requ...
Definition: lr-wpan-mac.cc:683
~LrWpanMac() override
Definition: lr-wpan-mac.cc:263
bool m_macRxOnWhenIdle
Indication of whether the MAC sublayer is to enable its receiver during idle periods.
Definition: lr-wpan-mac.h:544
bool m_macAssociationPermit
Indication of whether a coordinator is currently allowing association.
Definition: lr-wpan-mac.h:563
TracedCallback< Ptr< const Packet > > m_macTxOkTrace
The trace source fired when packets where successfully transmitted, that is an acknowledgment was rec...
Definition: lr-wpan-mac.h:1029
uint64_t m_rxBeaconSymbols
The total size of the received beacon in symbols.
Definition: lr-wpan-mac.h:461
void SetRxOnWhenIdle(bool rxOnWhenIdle)
Set if the receiver should be enabled when the MAC is idle.
Definition: lr-wpan-mac.cc:337
uint64_t GetTxPacketSymbols()
Obtain the number of symbols in the packet which is currently being sent by the MAC layer.
bool m_panCoor
Indication of whether the current device is the PAN coordinator.
Definition: lr-wpan-mac.h:587
void PlmeSetTRXStateConfirm(LrWpanPhyEnumeration status)
IEEE 802.15.4-2006 section 6.2.2.8 PLME-SET-TRX-STATE.confirm Set PHY state.
uint8_t m_numCsmacaRetry
The number of CSMA/CA retries used for sending the current packet.
Definition: lr-wpan-mac.h:1247
static TypeId GetTypeId()
Get the type ID.
Definition: lr-wpan-mac.cc:91
uint8_t m_deviceCapability
Indication of current device capability (FFD or RFD)
Definition: lr-wpan-mac.h:621
void AwaitBeacon()
Called after the end of an INCOMING superframe to start the moment a device waits for a new incoming ...
void MlmePollRequest(MlmePollRequestParams params) override
IEEE 802.15.4-2011, section 6.2.14.2 MLME-POLL.request Prompts the device to request data from the co...
Definition: lr-wpan-mac.cc:903
bool m_coor
Indicates if the current device is a coordinator type.
Definition: lr-wpan-mac.h:592
void LostAssocRespCommand()
Called after m_assocRespCmdWaitTime timeout while waiting for an association response command.
bool isCoordDest()
Check if the packet destination is its coordinator.
EventId m_trackingEvent
Scheduler event to track the incoming beacons.
Definition: lr-wpan-mac.h:1308
uint32_t m_maxIndTxQueueSize
The maximum size of the indirect transmit queue (The pending transaction list).
Definition: lr-wpan-mac.h:1191
EventId m_assocResCmdWaitTimeout
Scheduler event for the lost of a association response command frame.
Definition: lr-wpan-mac.h:1268
void PurgeInd()
Purge expired transactions from the pending transactions list.
void MlmeAssociateResponse(MlmeAssociateResponseParams params) override
IEEE 802.15.4-2011, section 6.2.2.3 MLME-ASSOCIATE.response Primitive used to initiate a response to ...
Definition: lr-wpan-mac.cc:758
void RemoveFirstTxQElement()
Remove the tip of the transmission queue, including clean up related to the last packet transmission.
void PlmeEdConfirm(LrWpanPhyEnumeration status, uint8_t energyLevel)
IEEE 802.15.4-2006 section 6.2.2.4 PLME-ED.confirm status and energy level.
TracedCallback< Ptr< const Packet > > m_macRxTrace
The trace source fired for packets successfully received by the device immediately before being forwa...
Definition: lr-wpan-mac.h:1063
TracedCallback< Ptr< const Packet > > m_promiscSnifferTrace
A trace source that emulates a promiscuous mode protocol sniffer connected to the device.
Definition: lr-wpan-mac.h:1112
void SetExtendedAddress(Mac64Address address)
Set the extended address of this MAC.
Definition: lr-wpan-mac.cc:363
uint32_t m_macLIFSPeriod
The minimum time forming a Long InterFrame Spacing (LIFS) period.
Definition: lr-wpan-mac.h:550
void StartInactivePeriod(SuperframeType superframeType)
Start the Inactive Period in a beacon-enabled mode.
TracedCallback< Ptr< const Packet > > m_macTxDropTrace
The trace source fired when packets are dropped due to missing ACKs or because of transmission failur...
Definition: lr-wpan-mac.h:1037
TracedCallback< Ptr< const Packet > > m_macIndTxDequeueTrace
The trace source fired when packets are dequeued from the L3/l2 indirect transmission queue (Pending ...
Definition: lr-wpan-mac.h:1013
TracedCallback< Ptr< const Packet > > m_macIndTxDropTrace
The trace source fired when packets are dropped due to indirect Tx queue overflows or expiration.
Definition: lr-wpan-mac.h:1045
Mac16Address GetShortAddress() const
Get the short address of this MAC.
Definition: lr-wpan-mac.cc:370
void SendDataRequestCommand()
Used to send a data request command (i.e.
EventId m_cfpEvent
Scheduler event for the end of the outgoing superframe CFP.
Definition: lr-wpan-mac.h:1293
void PlmeGetAttributeConfirm(LrWpanPhyEnumeration status, LrWpanPibAttributeIdentifier id, Ptr< LrWpanPhyPibAttributes > attribute)
IEEE 802.15.4-2006 section 6.2.2.6 PLME-GET.confirm Get attributes per definition from Table 23 in se...
uint8_t m_macMaxFrameRetries
The maximum number of retries allowed after a transmission failure.
Definition: lr-wpan-mac.h:537
Mac64Address m_macCoordExtendedAddress
The extended address of the coordinator through which the device is associated.
Definition: lr-wpan-mac.h:422
PendingPrimitiveStatus m_pendPrimitive
Indicates the pending primitive when PLME.SET operation (page or channel switch) is called from withi...
Definition: lr-wpan-mac.h:1236
uint8_t GetMacMaxFrameRetries() const
Get the macMaxFrameRetries attribute value.
uint16_t m_channelScanIndex
The channel list index used to obtain the current scanned channel.
Definition: lr-wpan-mac.h:1230
uint16_t GetPanId() const
Get the PAN id used by this MAC.
PendingAddrFields GetPendingAddrFields()
Constructs Pending Address Fields from the local information, the Pending Address Fields are part of ...
std::vector< PanDescriptor > m_panDescriptorList
The list of PAN descriptors accumulated during channel scans, used to select a PAN to associate.
Definition: lr-wpan-mac.h:1197
void SendBeaconRequestCommand()
Called to send a beacon request command.
EventId m_respWaitTimeout
Scheduler event for a response to a request command frame.
Definition: lr-wpan-mac.h:1263
uint32_t m_maxTxQueueSize
The maximum size of the transmit queue.
Definition: lr-wpan-mac.h:1186
Ptr< Packet > m_macBeaconPayload
The contents of the beacon payload.
Definition: lr-wpan-mac.h:525
std::deque< Ptr< TxQueueElement > > m_txQueue
The transmit queue used by the MAC.
Definition: lr-wpan-mac.h:1175
SequenceNumber8 m_macBsn
Sequence number added to transmitted beacon frame, 00-ff.
Definition: lr-wpan-mac.h:518
Ptr< Packet > m_rxPkt
The command request packet received.
Definition: lr-wpan-mac.h:1158
TracedCallback< Ptr< const Packet > > m_macIndTxEnqueueTrace
The trace source fired when packets come into the "top" of the device at the L3/L2 transition,...
Definition: lr-wpan-mac.h:1005
void SetLrWpanMacState(LrWpanMacState macState)
CSMA-CA algorithm calls back the MAC after executing channel assessment.
Mac16Address m_shortAddress
The short address (16 bit address) used by this MAC.
Definition: lr-wpan-mac.h:1165
uint8_t m_macSuperframeOrder
Used by a PAN coordinator or coordinator.
Definition: lr-wpan-mac.h:444
void(* StateTracedCallback)(LrWpanMacState oldState, LrWpanMacState newState)
TracedCallback signature for LrWpanMacState change events.
Definition: lr-wpan-mac.h:731
void SetCsmaCa(Ptr< LrWpanCsmaCa > csmaCa)
Set the CSMA/CA implementation to be used by the MAC.
void BeaconSearchTimeout()
Called if the device is unable to locate a beacon in the time set by MLME-SYNC.request.
bool isTxAckReq()
Check if the packet to transmit requires acknowledgment.
std::vector< uint8_t > m_energyDetectList
The list of energy measurements, one for each channel searched during an ED scan.
Definition: lr-wpan-mac.h:1202
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 M...
void SendOneBeacon()
Called to send a single beacon frame.
Time m_macBeaconTxTime
The time that the device transmitted its last beacon frame.
Definition: lr-wpan-mac.h:383
uint16_t GetSuperframeField()
Constructs a Superframe specification field from the local information, the superframe Specification ...
void EndStartRequest()
Called to end a MLME-START.request after changing the page and channel number.
TracedCallback< LrWpanMacState, LrWpanMacState > m_macStateLogger
A trace source that fires when the LrWpanMac changes states.
Definition: lr-wpan-mac.h:1122
Mac64Address GetExtendedAddress() const
Get the extended address of this MAC.
Definition: lr-wpan-mac.cc:377
EventId m_setMacState
Scheduler event for a deferred MAC state change.
Definition: lr-wpan-mac.h:1273
uint64_t m_macResponseWaitTime
The maximum time, in multiples of aBaseSuperframeDuration, a device shall wait for a response command...
Definition: lr-wpan-mac.h:398
void EnqueueInd(Ptr< Packet > p)
Adds a packet to the pending transactions list (Indirect transmissions).
void SendAssocResponseCommand(Ptr< Packet > rxDataReqPkt)
Called to send an associate response command.
void StartCFP(SuperframeType superframeType)
Called to begin the Contention Free Period (CFP) in a beacon-enabled mode.
EventId m_scanEnergyEvent
Scheduler event for the end of a ED channel scan.
Definition: lr-wpan-mac.h:1323
bool PrepareRetransmission()
Check for remaining retransmissions for the packet currently being sent.
void EnqueueTxQElement(Ptr< TxQueueElement > txQElement)
Add an element to the transmission queue.
void SetPanId(uint16_t panId)
Set the PAN id used by this MAC.
EventId m_scanEvent
Scheduler event for the end of an ACTIVE or PASSIVE channel scan.
Definition: lr-wpan-mac.h:1313
TracedCallback< Ptr< const Packet > > m_snifferTrace
A trace source that emulates a non-promiscuous protocol sniffer connected to the device.
Definition: lr-wpan-mac.h:1092
uint8_t m_incomingBeaconOrder
The beaconOrder value of the INCOMING frame.
Definition: lr-wpan-mac.h:473
SequenceNumber8 m_macDsn
Sequence number added to transmitted data or MAC command frame, 00-ff.
Definition: lr-wpan-mac.h:512
void SendOrphanNotificationCommand()
Called to send a orphan notification command.
void MlmeSyncRequest(MlmeSyncRequestParams params) override
IEEE 802.15.4-2011, section 6.2.13.1 MLME-SYNC.request Request to synchronize with the coordinator by...
Definition: lr-wpan-mac.cc:863
uint32_t m_ifs
The value of the necessary InterFrame Space after the transmission of a packet.
Definition: lr-wpan-mac.h:582
uint16_t m_macTransactionPersistenceTime
The maximum time (in UNIT periods) that a transaction is stored by a coordinator and indicated in its...
Definition: lr-wpan-mac.h:455
Mac16Address GetCoordShortAddress() const
Get the coordinator short address currently associated to this device.
void ChangeMacState(LrWpanMacState newState)
Change the current MAC state to the given new state.
void(* SentTracedCallback)(Ptr< const Packet > packet, uint8_t retries, uint8_t backoffs)
TracedCallback signature for sent packets.
Definition: lr-wpan-mac.h:720
MlmeStartRequestParams m_startParams
The parameters used during a MLME-START.request.
Definition: lr-wpan-mac.h:1219
void AckWaitTimeout()
Handle an ACK timeout with a packet retransmission, if there are retransmission left,...
std::vector< uint8_t > m_unscannedChannels
The list of unscanned channels during a scan operation.
Definition: lr-wpan-mac.h:1207
Mac64Address GetCoordExtAddress() const
Get the coordinator extended address currently associated to this device.
void MlmeScanRequest(MlmeScanRequestParams params) override
IEEE 802.15.4-2011, section 6.2.10.1 MLME-SCAN.request Request primitive used to initiate a channel s...
Definition: lr-wpan-mac.cc:623
uint8_t m_macBeaconOrder
Used by a PAN coordinator or coordinator.
Definition: lr-wpan-mac.h:436
TracedCallback< Time > m_macIfsEndTrace
The trace source is fired at the end of any Interframe Space (IFS).
Definition: lr-wpan-mac.h:969
TracedValue< SuperframeStatus > m_outSuperframeStatus
The current period of the outgoing superframe.
Definition: lr-wpan-mac.h:1147
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 s...
bool DequeueInd(Mac64Address dst, Ptr< IndTxQueueElement > entry)
Extracts a packet from pending transactions list (Indirect transmissions).
MlmeAssociateRequestParams m_associateParams
The parameters used during a MLME-ASSOCIATE.request.
Definition: lr-wpan-mac.h:1225
LrWpanMac()
Default constructor.
Definition: lr-wpan-mac.cc:202
void CheckQueue()
Check the transmission queue.
EventId m_ackWaitTimeout
Scheduler event for the ACK timeout of the currently transmitted data packet.
Definition: lr-wpan-mac.h:1258
void MlmeStartRequest(MlmeStartRequestParams params) override
IEEE 802.15.4-2006, section 7.1.14.1 MLME-START.request Request to allow a PAN coordinator to initiat...
Definition: lr-wpan-mac.cc:584
bool m_macPromiscuousMode
Indicates if MAC sublayer is in receive all mode.
Definition: lr-wpan-mac.h:493
uint8_t m_fnlCapSlot
Indication of the Slot where the CAP portion of the OUTGOING Superframe ends.
Definition: lr-wpan-mac.h:466
uint32_t m_macSIFSPeriod
The minimum time forming a Short InterFrame Spacing (SIFS) period.
Definition: lr-wpan-mac.h:556
void IfsWaitTimeout(Time ifsTime)
After a successful transmission of a frame (beacon, data) or an ack frame reception,...
std::deque< Ptr< IndTxQueueElement > > m_indTxQueue
The indirect transmit queue used by the MAC pending messages (The pending transaction list).
Definition: lr-wpan-mac.h:1181
void PrintPendingTxQueue(std::ostream &os) const
Print the Pending transaction list.
uint32_t m_beaconInterval
Indication of the Interval used by the coordinator to transmit beacon frames expressed in symbols.
Definition: lr-wpan-mac.h:598
TracedValue< LrWpanMacState > m_lrWpanMacState
The current state of the MAC layer.
Definition: lr-wpan-mac.h:1137
TracedCallback< Ptr< const Packet > > m_macTxEnqueueTrace
The trace source fired when packets come into the "top" of the device at the L3/L2 transition,...
Definition: lr-wpan-mac.h:989
EventId m_capEvent
Scheduler event for the end of the outgoing superframe CAP.
Definition: lr-wpan-mac.h:1288
TracedCallback< Ptr< const Packet > > m_macTxTrace
The trace source fired when packets are being sent down to L1.
Definition: lr-wpan-mac.h:1020
uint16_t m_macPanId
16 bits id of PAN on which this device is operating.
Definition: lr-wpan-mac.h:500
void EndChannelScan()
Called at the end of the current channel scan (Active or Passive) for a given duration.
void DoInitialize() override
Initialize() implementation.
Definition: lr-wpan-mac.cc:268
void MlmeGetRequest(LrWpanMacPibAttributeIdentifier id) override
IEEE 802.15.4-2011, section 6.2.5.1 MLME-GET.request Request information about a given PIB attribute.
Definition: lr-wpan-mac.cc:962
void PrintTxQueue(std::ostream &os) const
Print the Transmit Queue.
TracedCallback< Ptr< const Packet > > m_macRxDropTrace
The trace source fired for packets successfully received by the device but dropped before being forwa...
Definition: lr-wpan-mac.h:1072
bool m_macAutoRequest
Indication of whether a device automatically sends data request command if its address is listed in t...
Definition: lr-wpan-mac.h:572
uint8_t m_incomingSuperframeOrder
Used by all devices that have a parent.
Definition: lr-wpan-mac.h:481
uint16_t m_macPanIdScan
Temporally stores the value of the current m_macPanId when a MLME-SCAN.request is performed.
Definition: lr-wpan-mac.h:506
uint32_t m_macBeaconPayloadLength
The length, in octets, of the beacon payload.
Definition: lr-wpan-mac.h:531
TracedCallback< Ptr< const Packet > > m_macTxDequeueTrace
The trace source fired when packets are dequeued from the L3/l2 transmission queue.
Definition: lr-wpan-mac.h:997
void MlmeOrphanResponse(MlmeOrphanResponseParams params) override
IEEE 802.15.4-2011, section 6.2.7.2 MLME-ORPHAN.response Primitive used to initiatte a response to an...
Definition: lr-wpan-mac.cc:803
void PdDataConfirm(LrWpanPhyEnumeration status)
IEEE 802.15.4-2006 section 6.2.1.2 Confirm the end of transmission of an MPDU to MAC.
uint8_t m_numLostBeacons
The number of consecutive loss beacons in a beacon tracking operation.
Definition: lr-wpan-mac.h:631
Ptr< Packet > m_txPkt
The packet which is currently being sent by the MAC layer.
Definition: lr-wpan-mac.h:1152
void SendAssocRequestCommand()
Called to send an associate request command.
uint8_t m_maxEnergyLevel
The maximum energy level detected during ED scan on the current channel.
Definition: lr-wpan-mac.h:577
void DoDispose() override
Destructor implementation.
Definition: lr-wpan-mac.cc:283
MlmeScanRequestParams m_scanParams
The parameters used during a MLME-SCAN.request.
Definition: lr-wpan-mac.h:1213
void SetPhy(Ptr< LrWpanPhy > phy)
Set the underlying PHY for the MAC.
Ptr< LrWpanPhy > GetPhy()
Get the underlying PHY of the MAC.
uint8_t m_lastRxFrameLqi
Keep track of the last received frame Link Quality Indicator.
Definition: lr-wpan-mac.h:1252
EventId m_scanOrphanEvent
Scheduler event for the end of an ORPHAN channel scan.
Definition: lr-wpan-mac.h:1318
void EndAssociateRequest()
Called to end an MLME-ASSOCIATE.request after changing the page and channel number.
Definition: lr-wpan-mac.cc:738
Mac64Address m_selfExt
The extended 64 address (IEEE EUI-64) used by this MAC.
Definition: lr-wpan-mac.h:1170
EventId m_incCapEvent
Scheduler event for the end of the incoming superframe CAP.
Definition: lr-wpan-mac.h:1298
void SetTxQMaxSize(uint32_t queueSize)
Set the max size of the transmit queue.
void SetIndTxQMaxSize(uint32_t queueSize)
Set the max size of the indirect transmit queue (Pending Transaction list)
bool m_beaconTrackingOn
Indication of whether the current device is tracking incoming beacons.
Definition: lr-wpan-mac.h:626
uint32_t m_superframeDuration
Indication of the superframe duration in symbols.
Definition: lr-wpan-mac.h:604
bool GetRxOnWhenIdle() const
Check if the receiver will be enabled when the MAC is idle.
Definition: lr-wpan-mac.cc:331
Mac16Address m_macCoordShortAddress
The short address of the coordinator through which the device is associated.
Definition: lr-wpan-mac.h:415
GtsFields GetGtsFields()
Constructs the Guaranteed Time Slots (GTS) Fields from local information.
Ptr< LrWpanPhy > m_phy
The PHY associated with this MAC.
Definition: lr-wpan-mac.h:1127
void MlmeSetRequest(LrWpanMacPibAttributeIdentifier id, Ptr< LrWpanMacPibAttributes > attribute) override
IEEE 802.15.4-2011, section 6.2.11.1 MLME-SET.request Attempts to write the given value to the indica...
Definition: lr-wpan-mac.cc:918
void EndChannelEnergyScan()
Called at the end of one ED channel scan.
uint64_t m_macSyncSymbolOffset
Symbol boundary is same as m_macBeaconTxTime.
Definition: lr-wpan-mac.h:428
void PrintTransmitQueueSize()
Print the number of elements in the packet transmit queue.
void StartCAP(SuperframeType superframeType)
Called to begin the Contention Access Period (CAP) in a beacon-enabled mode.
TracedCallback< Ptr< const Packet > > m_macPromiscRxTrace
The trace source fired for packets successfully received by the device immediately before being forwa...
Definition: lr-wpan-mac.h:1054
EventId m_ifsEvent
Scheduler event for Interframe spacing wait time.
Definition: lr-wpan-mac.h:1278
EventId m_beaconEvent
Scheduler event for generation of one beacon.
Definition: lr-wpan-mac.h:1283
uint32_t m_incomingSuperframeDuration
Indication of the superframe duration in symbols (e.g.
Definition: lr-wpan-mac.h:616
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 ...
Definition: lr-wpan-mac.h:981
void RemovePendTxQElement(Ptr< Packet > p)
Remove an element from the pending transaction list.
void SetShortAddress(Mac16Address address)
Set the short address of this MAC.
Definition: lr-wpan-mac.cc:356
void SetMacMaxFrameRetries(uint8_t retries)
Set the macMaxFrameRetries attribute value.
uint8_t m_retransmission
The number of already used retransmission for the currently transmitted packet.
Definition: lr-wpan-mac.h:1242
EventId m_incCfpEvent
Scheduler event for the end of the incoming superframe CFP.
Definition: lr-wpan-mac.h:1303
void SendAck(uint8_t seqno)
Send an acknowledgment packet for the given sequence number.
uint8_t m_incomingFnlCapSlot
Indication of the Slot where the CAP portion of the INCOMING Superframe ends.
Definition: lr-wpan-mac.h:486
TracedValue< SuperframeStatus > m_incSuperframeStatus
The current period of the incoming superframe.
Definition: lr-wpan-mac.h:1142
void SetAssociatedCoor(Mac16Address mac)
Check if the packet destination is its coordinator.
This class can contain 16 bit addresses.
Definition: mac16-address.h:44
an EUI-64 address
Definition: mac64-address.h:46
Represent the Pending Address Specification field.
A template-based reference counting class.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition: type-id.h:59
LrWpanMacState
MAC states.
Definition: lr-wpan-mac.h:72
SuperframeStatus
Superframe status.
Definition: lr-wpan-mac.h:100
LrWpanPhyEnumeration
IEEE802.15.4-2006 PHY Emumerations Table 18 in section 6.2.3.
Definition: lr-wpan-phy.h:111
LrWpanTxOption
Tx options.
Definition: lr-wpan-mac.h:59
PendingPrimitiveStatus
Indicates a pending MAC primitive.
Definition: lr-wpan-mac.h:124
SuperframeType
Superframe type.
Definition: lr-wpan-mac.h:113
LrWpanMacPibAttributeIdentifier
IEEE802.15.4-2011 MAC PIB Attribute Identifiers Table 52 in section 6.4.2.
LrWpanPibAttributeIdentifier
IEEE802.15.4-2006 PHY PIB Attribute Identifiers Table 23 in section 6.4.2.
Definition: lr-wpan-phy.h:163
@ CHANNEL_ACCESS_FAILURE
CHANNEL_ACCESS_FAILURE.
Definition: lr-wpan-mac.h:77
@ MAC_IDLE
MAC_IDLE.
Definition: lr-wpan-mac.h:73
@ MAC_CSMA_DEFERRED
MAC_CSMA_DEFERRED.
Definition: lr-wpan-mac.h:82
@ MAC_CSMA
MAC_CSMA.
Definition: lr-wpan-mac.h:74
@ CHANNEL_IDLE
CHANNEL_IDLE.
Definition: lr-wpan-mac.h:78
@ MAC_GTS
MAC_GTS.
Definition: lr-wpan-mac.h:80
@ SET_PHY_TX_ON
SET_PHY_TX_ON.
Definition: lr-wpan-mac.h:79
@ MAC_INACTIVE
MAC_INACTIVE.
Definition: lr-wpan-mac.h:81
@ MAC_SENDING
MAC_SENDING.
Definition: lr-wpan-mac.h:75
@ MAC_ACK_PENDING
MAC_ACK_PENDING.
Definition: lr-wpan-mac.h:76
@ CFP
Contention Free Period.
Definition: lr-wpan-mac.h:103
@ INACTIVE
Inactive Period or unslotted CSMA-CA.
Definition: lr-wpan-mac.h:104
@ CAP
Contention Access Period.
Definition: lr-wpan-mac.h:102
@ BEACON
The Beacon transmission or reception Period.
Definition: lr-wpan-mac.h:101
@ TX_OPTION_ACK
TX_OPTION_ACK.
Definition: lr-wpan-mac.h:61
@ TX_OPTION_INDIRECT
TX_OPTION_INDIRECT.
Definition: lr-wpan-mac.h:63
@ TX_OPTION_NONE
TX_OPTION_NONE.
Definition: lr-wpan-mac.h:60
@ TX_OPTION_GTS
TX_OPTION_GTS.
Definition: lr-wpan-mac.h:62
@ MLME_SCAN_REQ
Pending MLME-SCAN.request primitive.
Definition: lr-wpan-mac.h:127
@ MLME_ASSOC_REQ
Pending MLME-ASSOCIATION.request primitive.
Definition: lr-wpan-mac.h:128
@ MLME_SYNC_REQ
Pending MLME-SYNC.request primitive.
Definition: lr-wpan-mac.h:129
@ MLME_START_REQ
Pending MLME-START.request primitive.
Definition: lr-wpan-mac.h:126
@ MLME_NONE
No pending primitive.
Definition: lr-wpan-mac.h:125
@ INCOMING
Incoming Superframe.
Definition: lr-wpan-mac.h:115
@ OUTGOING
Outgoing Superframe.
Definition: lr-wpan-mac.h:114
address
Definition: first.py:47
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:159
mac
Definition: third.py:92
phy
Definition: third.py:89
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.
Helper structure for managing pending transaction list elements (Indirect transmissions).
Definition: lr-wpan-mac.h:752
Time expireTime
The expiration time of the packet in the indirect transmission queue.
Definition: lr-wpan-mac.h:757
Mac64Address dstExtAddress
The destination extended Mac Address.
Definition: lr-wpan-mac.h:755
uint8_t seqNum
The sequence number of the queued packet.
Definition: lr-wpan-mac.h:753
Mac16Address dstShortAddress
The destination short Mac Address.
Definition: lr-wpan-mac.h:754
Ptr< Packet > txQPkt
Queued packet.
Definition: lr-wpan-mac.h:756
Helper structure for managing transmission queue elements.
Definition: lr-wpan-mac.h:743
Ptr< Packet > txQPkt
Queued packet.
Definition: lr-wpan-mac.h:745
uint8_t txQMsduHandle
MSDU Handle.
Definition: lr-wpan-mac.h:744
MCPS-DATA.request params.
MLME-ASSOCIATE.request params.
MLME-ASSOCIATE.response params.
MLME-ORPHAN.response params.
MLME-POLL.request params.
MLME-SCAN.request params.
MLME-START.request params.
MLME-SYNC.request params.
std::ofstream queueSize