A Discrete-Event Network Simulator
API
mac-low.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005, 2006 INRIA
4  * Copyright (c) 2009 MIRKO BANCHI
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20  * Mirko Banchi <mk.banchi@gmail.com>
21  */
22 
23 #ifndef MAC_LOW_H
24 #define MAC_LOW_H
25 
26 #include <map>
27 #include "ns3/object.h"
28 #include "ns3/nstime.h"
29 #include "channel-access-manager.h"
30 #include "block-ack-cache.h"
32 #include "qos-utils.h"
33 #include "wifi-mac-header.h"
34 #include "wifi-tx-vector.h"
35 #include "block-ack-type.h"
36 #include "wifi-mpdu-type.h"
37 
38 namespace ns3 {
39 
40 class WifiMac;
41 class WifiPhy;
42 class Txop;
43 class QosTxop;
44 class WifiMacQueueItem;
45 class WifiMacQueue;
46 class WifiPsdu;
47 class BlockAckAgreement;
48 class MgtAddBaResponseHeader;
49 class WifiRemoteStationManager;
50 class CtrlBAckRequestHeader;
51 class CtrlBAckResponseHeader;
52 class MsduAggregator;
53 class MpduAggregator;
54 
59 class MacLow : public Object
60 {
61 public:
62 
67 
68  MacLow ();
69  virtual ~MacLow ();
70 
75  static TypeId GetTypeId (void);
76 
82  void SetPhy (const Ptr<WifiPhy> phy);
86  Ptr<WifiPhy> GetPhy (void) const;
90  void ResetPhy (void);
95  Ptr<QosTxop> GetEdca (uint8_t tid) const;
101  void SetMac (const Ptr<WifiMac> mac);
113  void SetAddress (Mac48Address ad);
119  void SetAckTimeout (Time ackTimeout);
125  void SetBasicBlockAckTimeout (Time blockAckTimeout);
131  void SetCompressedBlockAckTimeout (Time blockAckTimeout);
137  void SetCtsToSelfSupported (bool enable);
143  void SetCtsTimeout (Time ctsTimeout);
149  void SetSifs (Time sifs);
155  void SetRifs (Time rifs);
161  void SetSlotTime (Time slotTime);
167  void SetPifs (Time pifs);
171  void SetBeaconInterval (Time interval);
175  void SetCfpMaxDuration (Time duration);
181  void SetBssid (Mac48Address ad);
185  void SetPromisc (void);
191  bool GetCtsToSelfSupported (void) const;
197  Mac48Address GetAddress (void) const;
203  Time GetAckTimeout (void) const;
209  Time GetBasicBlockAckTimeout (void) const;
215  Time GetCompressedBlockAckTimeout (void) const;
221  Time GetCtsTimeout (void) const;
227  Time GetSifs (void) const;
233  Time GetSlotTime (void) const;
239  Time GetPifs (void) const;
245  Time GetRifs (void) const;
249  Time GetBeaconInterval (void) const;
253  Time GetCfpMaxDuration (void) const;
257  Time GetRemainingCfpDuration (void) const;
263  Mac48Address GetBssid (void) const;
270  bool IsPromisc (void) const;
271 
278  void SetRxCallback (Callback<void, Ptr<WifiMacQueueItem>> callback);
283  void RegisterChannelAccessManager (Ptr<ChannelAccessManager> channelAccessManager);
284 
300  uint32_t ampduSize, Time ppduDurationLimit);
317  bool IsWithinSizeAndTimeLimits (uint32_t mpduSize, Mac48Address receiver, uint8_t tid,
318  WifiTxVector txVector, uint32_t ampduSize, Time ppduDurationLimit);
329  const WifiMacHeader* hdr,
330  const MacLowTransmissionParameters& parameters) const;
331 
343  const WifiMacHeader* hdr,
344  const MacLowTransmissionParameters& params,
345  uint32_t fragmentSize = 0) const;
346 
356  const MacLowTransmissionParameters& params) const;
357 
366  virtual void StartTransmission (Ptr<WifiMacQueueItem> mpdu,
367  MacLowTransmissionParameters parameters,
368  Ptr<Txop> txop);
369 
379  void ReceiveOk (Ptr<WifiMacQueueItem> mpdu, double rxSnr, WifiTxVector txVector, bool ampduSubframe);
386  void ReceiveError (Ptr<WifiPsdu> psdu);
394  void NotifySwitchingStartNow (Time duration);
400  void NotifySleepNow (void);
406  void NotifyOffNow (void);
422  void CreateBlockAckAgreement (const MgtAddBaResponseHeader *respHdr,
423  Mac48Address originator,
424  uint16_t startingSeq);
433  void DestroyBlockAckAgreement (Mac48Address originator, uint8_t tid);
441  void RegisterEdcaForAc (AcIndex ac, Ptr<QosTxop> edca);
451  void DeaggregateAmpduAndReceive (Ptr<WifiPsdu> aggregatedPacket, double rxSnr, WifiTxVector txVector,
452  std::vector<bool> statusPerMpdu);
453 
469  bool DoNavStartNow (Time duration);
476  virtual bool IsCfPeriod (void) const;
483  bool CanTransmitNextCfFrame (void) const;
484 
497 
503  void SetMsduAggregator (const Ptr<MsduAggregator> aggr);
509  void SetMpduAggregator (const Ptr<MpduAggregator> aggr);
510 
511 
512 private:
517  void CancelAllEvents (void);
523  uint32_t GetCfEndSize (void) const;
530  void ForwardDown (Ptr<const WifiPsdu> psdu, WifiTxVector txVector);
550  WifiTxVector GetCtsTxVector (Mac48Address to, WifiMode rtsTxMode) const;
561  WifiTxVector GetAckTxVector (Mac48Address to, WifiMode dataTxMode) const;
572  WifiTxVector GetBlockAckTxVector (Mac48Address to, WifiMode dataTxMode) const;
602  WifiMode GetControlAnswerMode (WifiMode reqMode) const;
609  Time GetCtsDuration (WifiTxVector ctsTxVector) const;
618  Time GetCtsDuration (Mac48Address to, WifiTxVector rtsTxVector) const;
625  Time GetAckDuration (WifiTxVector ackTxVector) const;
634  Time GetAckDuration (Mac48Address to, WifiTxVector dataTxVector) const;
643  Time GetBlockAckDuration (WifiTxVector blockAckReqTxVector, BlockAckType type) const;
652  Time GetBlockAckRequestDuration (WifiTxVector blockAckReqTxVector, BlockAckType type) const;
663  WifiTxVector dataTxVector, Mac48Address receiver) const;
670  bool NeedCtsToSelf (void) const;
671 
678  void NotifyNav (Ptr<const Packet> packet,const WifiMacHeader &hdr);
684  void DoNavResetNow (Time duration);
691  bool IsNavZero (void) const;
697  void NotifyAckTimeoutStartNow (Time duration);
701  void NotifyAckTimeoutResetNow (void);
707  void NotifyCtsTimeoutStartNow (Time duration);
711  void NotifyCtsTimeoutResetNow (void);
718  void NavCounterResetCtsMissed (Time rtsEndRxTime);
719  /* Event handlers */
723  void NormalAckTimeout (void);
727  void BlockAckTimeout (void);
731  void CtsTimeout (void);
735  void CfPollTimeout (void);
739  void SendCtsToSelf (void);
748  void SendCtsAfterRts (Mac48Address source, Time duration, WifiTxVector rtsTxVector, double rtsSnr);
757  void SendAckAfterData (Mac48Address source, Time duration, WifiMode dataTxMode, double dataSnr);
763  void SendDataAfterCts (Time duration);
764 
769  void WaitIfsAfterEndTxFragment (void);
774  void WaitIfsAfterEndTxPacket (void);
775 
779  void EndTxNoAck (void);
783  void SendRtsForPacket (void);
788  void SendDataPacket (void);
795  void StartDataTxTimers (WifiTxVector dataTxVector);
796 
797  void DoDispose (void);
798 
807  void RxCompleteBufferedPacketsWithSmallerSequence (uint16_t seq, Mac48Address originator, uint8_t tid);
820  void RxCompleteBufferedPacketsUntilFirstLost (Mac48Address originator, uint8_t tid);
851  Time duration, WifiMode blockAckReqTxMode, double rxSnr);
862  void SendBlockAckAfterAmpdu (uint8_t tid, Mac48Address originator, Time duration,
863  WifiTxVector blockAckReqTxVector, double rxSnr);
874  void SendBlockAckResponse (const CtrlBAckResponseHeader* blockAck, Mac48Address originator, bool immediate,
875  Time duration, WifiMode blockAckReqTxMode, double rxSnr);
885 
898 
903 
907  struct CfAckInfo
908  {
909  bool appendCfAck;
910  bool expectCfAck;
912  };
913 
917  typedef std::vector<Ptr<ChannelAccessManager> >::const_iterator ChannelAccessManagersCI;
921  typedef std::vector<Ptr<ChannelAccessManager> > ChannelAccessManagers;
923 
926 
936 
950 
953 
956 
960 
961  bool m_promisc;
962 
964 
965  /*
966  * BlockAck data structures.
967  */
968  typedef std::list<Ptr<WifiMacQueueItem>>::iterator BufferedPacketI;
969 
970  typedef std::pair<Mac48Address, uint8_t> AgreementKey;
971  typedef std::pair<BlockAckAgreement, std::list<Ptr<WifiMacQueueItem>> > AgreementValue;
972 
973  typedef std::map<AgreementKey, AgreementValue> Agreements;
974  typedef std::map<AgreementKey, AgreementValue>::iterator AgreementsI;
975 
976  typedef std::map<AgreementKey, BlockAckCache> BlockAckCaches;
977  typedef std::map<AgreementKey, BlockAckCache>::iterator BlockAckCachesI;
978 
981 
982  typedef std::map<AcIndex, Ptr<QosTxop> > QueueEdcas;
984 
987 
989 };
990 
991 } //namespace ns3
992 
993 #endif /* MAC_LOW_H */
void WaitIfsAfterEndTxPacket(void)
Event handler that is usually scheduled to fired at the appropriate time after sending a packet...
Definition: mac-low.cc:2107
Time GetRifs(void) const
Return Reduced Interframe Space (RIFS) of this MacLow.
Definition: mac-low.cc:444
void SetPifs(Time pifs)
Set PCF Interframe Space (PIFS) of this MacLow.
Definition: mac-low.cc:372
Time m_ctsTimeout
CTS timeout duration.
Definition: mac-low.h:945
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
EventId m_navCounterResetCtsMissed
Event to reset NAV when CTS is not received.
Definition: mac-low.h:935
std::vector< Ptr< ChannelAccessManager > >::const_iterator ChannelAccessManagersCI
typedef for an iterator for a list of ChannelAccessManager.
Definition: mac-low.h:917
void ResetBlockAckInactivityTimerIfNeeded(BlockAckAgreement &agreement)
Every time that a BlockAckRequest or a packet with Ack Policy equals to Block Ack are received...
Definition: mac-low.cc:2535
EventId m_blockAckTimeoutEvent
BlockAck timeout event.
Definition: mac-low.h:928
Time CalculateOverallTxTime(Ptr< const Packet > packet, const WifiMacHeader *hdr, const MacLowTransmissionParameters &params, uint32_t fragmentSize=0) const
Definition: mac-low.cc:1489
Callback template class.
Definition: callback.h:1273
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Ptr< MpduAggregator > GetMpduAggregator(void) const
Returns the aggregator used to construct A-MPDU subframes.
Definition: mac-low.cc:298
void SendBlockAckAfterBlockAckRequest(const CtrlBAckRequestHeader reqHdr, Mac48Address originator, Time duration, WifiMode blockAckReqTxMode, double rxSnr)
Invoked after that a BlockAckRequest has been received.
Definition: mac-low.cc:2469
bool ReceiveMpdu(Ptr< WifiMacQueueItem > mpdu)
Definition: mac-low.cc:2163
void SetPromisc(void)
Enable promiscuous mode.
Definition: mac-low.cc:402
void DoNavResetNow(Time duration)
Reset NAV with the given duration.
Definition: mac-low.cc:1596
Ptr< Txop > m_currentTxop
Current TXOP.
Definition: mac-low.h:938
void SetupPhyMacLowListener(const Ptr< WifiPhy > phy)
Set up WifiPhy listener for this MacLow.
Definition: mac-low.cc:155
Ptr< QosTxop > GetEdca(uint8_t tid) const
Definition: mac-low.cc:272
Ptr< MsduAggregator > m_msduAggregator
A-MSDU aggregator.
Definition: mac-low.h:924
Time m_pifs
PCF Interframe Space (PIFS) duration.
Definition: mac-low.h:948
void SetPhy(const Ptr< WifiPhy > phy)
Set up WifiPhy associated with this MacLow.
Definition: mac-low.cc:248
bool DoNavStartNow(Time duration)
Start NAV with the given duration.
Definition: mac-low.cc:1608
void SetSifs(Time sifs)
Set Short Interframe Space (SIFS) of this MacLow.
Definition: mac-low.cc:360
std::pair< Mac48Address, uint8_t > AgreementKey
agreement key typedef
Definition: mac-low.h:970
Time CalculateOverheadTxTime(Ptr< const WifiMacQueueItem > item, const MacLowTransmissionParameters &params) const
Definition: mac-low.cc:1511
void ReceiveError(Ptr< WifiPsdu > psdu)
Definition: mac-low.cc:719
Time GetResponseDuration(const MacLowTransmissionParameters &params, WifiTxVector dataTxVector, Mac48Address receiver) const
Return the time required to transmit the response frames (Ack or BAR+BA following the policy configur...
Definition: mac-low.cc:1259
bool IsNavZero(void) const
Check if NAV is zero.
Definition: mac-low.cc:1983
void NotifyOffNow(void)
This method is typically invoked by the PhyMacLowListener to notify the MAC layer that the device has...
Definition: mac-low.cc:771
void NotifySleepNow(void)
This method is typically invoked by the PhyMacLowListener to notify the MAC layer that the device has...
Definition: mac-low.cc:756
void NotifyNav(Ptr< const Packet > packet, const WifiMacHeader &hdr)
Notify NAV function.
Definition: mac-low.cc:1543
Mac48Address GetBssid(void) const
Return the Basic Service Set Identification.
Definition: mac-low.cc:462
Callback< void, Ptr< WifiMacQueueItem > > MacLowRxCallback
typedef for a callback for MacLowRx
Definition: mac-low.h:66
WifiTxVector GetRtsTxVector(Ptr< const WifiMacQueueItem > item) const
Return a TXVECTOR for the RTS frame given the destination.
Definition: mac-low.cc:1245
Mac48Address m_bssid
BSSID address (Mac48Address)
Definition: mac-low.h:941
EventId m_sendCtsEvent
Event to send CTS.
Definition: mac-low.h:930
MacLowRxCallback m_rxCallback
Callback to pass packet up.
Definition: mac-low.h:902
bool appendCfAck
Flag used for PCF to indicate whether a CF-Ack should be appended.
Definition: mac-low.h:909
EventId m_sendAckEvent
Event to send Ack.
Definition: mac-low.h:931
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:97
WifiMode GetControlAnswerMode(WifiMode reqMode) const
Get control answer mode function.
Definition: mac-low.cc:1287
void NotifyAckTimeoutResetNow(void)
Notify ChannelAccessManager that Ack timer should be reset.
Definition: mac-low.cc:1635
Time m_cfpMaxDuration
CFP max duration.
Definition: mac-low.h:952
Time CalculateTransmissionTime(Ptr< const Packet > packet, const WifiMacHeader *hdr, const MacLowTransmissionParameters &parameters) const
Definition: mac-low.cc:1528
control how a packet is transmitted.
std::list< Ptr< WifiMacQueueItem > >::iterator BufferedPacketI
buffered packet iterator typedef
Definition: mac-low.h:968
void SetCtsToSelfSupported(bool enable)
Enable or disable CTS-to-self capability.
Definition: mac-low.cc:342
bool expectCfAck
Flag used for PCF to indicate whether a CF-Ack should be expected.
Definition: mac-low.h:910
QueueEdcas m_edca
EDCA queues.
Definition: mac-low.h:983
void NormalAckTimeout(void)
Event handler when normal Ack timeout occurs.
Definition: mac-low.cc:1768
void SetBasicBlockAckTimeout(Time blockAckTimeout)
Set Basic BlockAck timeout of this MacLow.
Definition: mac-low.cc:330
phy
Definition: third.py:93
BlockAckCaches m_bAckCaches
block ack caches
Definition: mac-low.h:980
Ptr< WifiMac > m_mac
Pointer to WifiMac (to fetch configuration)
Definition: mac-low.h:900
void RemovePhyMacLowListener(Ptr< WifiPhy > phy)
Remove current WifiPhy listener for this MacLow.
Definition: mac-low.cc:162
bool IsPromisc(void) const
Check if MacLow is operating in promiscuous mode.
Definition: mac-low.cc:480
WifiTxVector m_currentTxVector
TXVECTOR used for the current packet transmission.
Definition: mac-low.h:986
void DestroyBlockAckAgreement(Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2273
Time m_lastNavDuration
The duration of the latest NAV.
Definition: mac-low.h:955
void SetCfpMaxDuration(Time duration)
Definition: mac-low.cc:390
Time GetCtsDuration(WifiTxVector ctsTxVector) const
Return the time required to transmit the CTS (including preamble and FCS).
Definition: mac-low.cc:1238
bool IsWithinSizeAndTimeLimits(Ptr< const WifiMacQueueItem > mpdu, WifiTxVector txVector, uint32_t ampduSize, Time ppduDurationLimit)
Check whether the given MPDU, if transmitted according to the given TX vector, meets the constraint o...
Definition: mac-low.cc:657
bool m_ctsToSelfSupported
Flag whether CTS-to-self is supported.
Definition: mac-low.h:985
void SendCtsToSelf(void)
Send CTS for a CTS-to-self mechanism.
Definition: mac-low.cc:1989
void SendAckAfterData(Mac48Address source, Time duration, WifiMode dataTxMode, double dataSnr)
Send Ack after receiving Data.
Definition: mac-low.cc:2133
Mac48Address GetAddress(void) const
Return the MAC address of this MacLow.
Definition: mac-low.cc:408
virtual void StartTransmission(Ptr< WifiMacQueueItem > mpdu, MacLowTransmissionParameters parameters, Ptr< Txop > txop)
Definition: mac-low.cc:498
void CreateBlockAckAgreement(const MgtAddBaResponseHeader *respHdr, Mac48Address originator, uint16_t startingSeq)
Definition: mac-low.cc:2231
Time m_lastBeacon
The time when the last beacon frame transmission started.
Definition: mac-low.h:958
Time GetCompressedBlockAckTimeout(void) const
Return Compressed BlockAck timeout of this MacLow.
Definition: mac-low.cc:426
Listener for PHY events.
Definition: mac-low.cc:57
void CtsTimeout(void)
Event handler when CTS timeout occurs.
Definition: mac-low.cc:1746
void DeaggregateAmpduAndReceive(Ptr< WifiPsdu > aggregatedPacket, double rxSnr, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
Definition: mac-low.cc:2557
Time GetSifs(void) const
Return Short Interframe Space (SIFS) of this MacLow.
Definition: mac-low.cc:438
void EndTxNoAck(void)
A transmission that does not require an Ack has completed.
Definition: mac-low.cc:2114
void SendBlockAckAfterAmpdu(uint8_t tid, Mac48Address originator, Time duration, WifiTxVector blockAckReqTxVector, double rxSnr)
Invoked after an A-MPDU has been received.
Definition: mac-low.cc:2430
std::map< AgreementKey, BlockAckCache >::iterator BlockAckCachesI
block ack caches iterator typedef
Definition: mac-low.h:977
virtual bool IsCfPeriod(void) const
This function indicates whether Simulator::Now is in the CF period.
Definition: mac-low.cc:2664
void SetAckTimeout(Time ackTimeout)
Set Ack timeout of this MacLow.
Definition: mac-low.cc:324
static TypeId GetTypeId(void)
Register this type.
Definition: mac-low.cc:144
mac
Definition: third.py:99
bool StoreMpduIfNeeded(Ptr< WifiMacQueueItem > mpdu)
Definition: mac-low.cc:2204
Time GetCtsTimeout(void) const
Return CTS timeout of this MacLow.
Definition: mac-low.cc:432
void NavCounterResetCtsMissed(Time rtsEndRxTime)
Reset NAV after CTS was missed when the NAV was set with RTS.
Definition: mac-low.cc:1587
Ptr< WifiRemoteStationManager > m_stationManager
Pointer to WifiRemoteStationManager (rate control)
Definition: mac-low.h:901
void SetMac(const Ptr< WifiMac > mac)
Set up WifiMac associated with this MacLow.
Definition: mac-low.cc:280
Headers for BlockAck response.
Definition: ctrl-headers.h:193
void SendDataAfterCts(Time duration)
Send Data after receiving CTS.
Definition: mac-low.cc:2058
void RegisterEdcaForAc(AcIndex ac, Ptr< QosTxop > edca)
Definition: mac-low.cc:2551
Agreements m_bAckAgreements
block ack agreements
Definition: mac-low.h:979
void RegisterChannelAccessManager(Ptr< ChannelAccessManager > channelAccessManager)
Definition: mac-low.cc:492
virtual WifiTxVector GetDataTxVector(Ptr< const WifiMacQueueItem > item) const
Return a TXVECTOR for the Data frame given the destination.
Definition: mac-low.cc:1252
A struct that holds information about Ack piggybacking (CF-Ack).
Definition: mac-low.h:907
void NotifySwitchingStartNow(Time duration)
Definition: mac-low.cc:740
Time GetCfpMaxDuration(void) const
Definition: mac-low.cc:474
Time m_slotTime
Slot duration.
Definition: mac-low.h:947
WifiTxVector GetAckTxVector(Mac48Address to, WifiMode dataTxMode) const
Return a TXVECTOR for the Ack frame given the destination and the mode of the Data used by the sender...
Definition: mac-low.cc:1445
bool m_promisc
Flag if the device is operating in promiscuous mode.
Definition: mac-low.h:961
void CancelAllEvents(void)
Cancel all scheduled events.
Definition: mac-low.cc:196
WifiTxVector GetCtsTxVector(Mac48Address to, WifiMode rtsTxMode) const
Return a TXVECTOR for the CTS frame given the destination and the mode of the RTS used by the sender...
Definition: mac-low.cc:1429
void BlockAckTimeout(void)
Event handler when BlockAck timeout occurs.
Definition: mac-low.cc:1781
void NotifyCtsTimeoutStartNow(Time duration)
Notify ChannelAccessManager that CTS timer should be started for the given duration.
Definition: mac-low.cc:1644
std::map< AgreementKey, BlockAckCache > BlockAckCaches
block ack caches typedef
Definition: mac-low.h:976
Time GetAckTimeout(void) const
Return Ack timeout of this MacLow.
Definition: mac-low.cc:414
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Time GetRemainingCfpDuration(void) const
Definition: mac-low.cc:2655
void SetBssid(Mac48Address ad)
Set the Basic Service Set Identification.
Definition: mac-low.cc:396
Time GetBasicBlockAckTimeout(void) const
Return Basic BlockAck timeout of this MacLow.
Definition: mac-low.cc:420
EventId m_waitIfsEvent
Wait for IFS event.
Definition: mac-low.h:933
EventId m_normalAckTimeoutEvent
Normal Ack timeout event.
Definition: mac-low.h:927
void StartDataTxTimers(WifiTxVector dataTxVector)
Start a Data timer by scheduling appropriate Ack timeout.
Definition: mac-low.cc:1831
Time m_beaconInterval
Expected interval between two beacon transmissions.
Definition: mac-low.h:951
an EUI-48 address
Definition: mac48-address.h:43
Time m_cfpForeshortening
The delay the current CF period should be foreshortened.
Definition: mac-low.h:959
std::pair< BlockAckAgreement, std::list< Ptr< WifiMacQueueItem > > > AgreementValue
agreement value typedef
Definition: mac-low.h:971
void SendBlockAckResponse(const CtrlBAckResponseHeader *blockAck, Mac48Address originator, bool immediate, Time duration, WifiMode blockAckReqTxMode, double rxSnr)
This method creates BlockAck frame with header equals to blockAck and start its transmission.
Definition: mac-low.cc:2382
Time GetAckDuration(WifiTxVector ackTxVector) const
Return the time required to transmit the Ack (including preamble and FCS).
Definition: mac-low.cc:1208
Time m_ackTimeout
Ack timeout duration.
Definition: mac-low.h:942
EventId m_ctsTimeoutEvent
CTS timeout event.
Definition: mac-low.h:929
void RxCompleteBufferedPacketsWithSmallerSequence(uint16_t seq, Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2289
void SendCtsAfterRts(Mac48Address source, Time duration, WifiTxVector rtsTxVector, double rtsSnr)
Send CTS after receiving RTS.
Definition: mac-low.cc:2028
Ptr< MsduAggregator > GetMsduAggregator(void) const
Returns the aggregator used to construct A-MSDU subframes.
Definition: mac-low.cc:292
Time GetBlockAckRequestDuration(WifiTxVector blockAckReqTxVector, BlockAckType type) const
Return the time required to transmit the BlockAckRequest to the specified address given the TXVECTOR ...
Definition: mac-low.cc:1225
Time m_basicBlockAckTimeout
Basic BlockAck timeout duration.
Definition: mac-low.h:943
bool GetCtsToSelfSupported(void) const
Return whether CTS-to-self capability is supported.
Definition: mac-low.cc:348
Time m_sifs
Short Interframe Space (SIFS) duration.
Definition: mac-low.h:946
void SetBeaconInterval(Time interval)
Definition: mac-low.cc:384
Time m_lastNavStart
The time when the latest NAV started.
Definition: mac-low.h:954
std::map< AgreementKey, AgreementValue > Agreements
agreements
Definition: mac-low.h:973
handle RTS/CTS/Data/Ack transactions.
Definition: mac-low.h:59
Mac48Address address
Address of the station to be acknowledged.
Definition: mac-low.h:911
EventId m_sendDataEvent
Event to send Data.
Definition: mac-low.h:932
MacLowTransmissionParameters m_txParams
Transmission parameters of the current packet.
Definition: mac-low.h:939
void SetRifs(Time rifs)
Set Reduced Interframe Space (RIFS) of this MacLow.
Definition: mac-low.cc:378
void DoDispose(void)
Destructor implementation.
Definition: mac-low.cc:173
void SetMsduAggregator(const Ptr< MsduAggregator > aggr)
Set the aggregator used to construct A-MSDU subframes.
Definition: mac-low.cc:304
WifiTxVector GetAckTxVectorForData(Mac48Address to, WifiMode dataTxMode) const
Return a TXVECTOR for the BlockAck frame given the destination and the mode of the Data used by the s...
Definition: mac-low.cc:1483
std::map< AcIndex, Ptr< QosTxop > > QueueEdcas
EDCA queues typedef.
Definition: mac-low.h:982
void ReceiveOk(Ptr< WifiMacQueueItem > mpdu, double rxSnr, WifiTxVector txVector, bool ampduSubframe)
Definition: mac-low.cc:786
Mac48Address m_self
Address of this MacLow (Mac48Address)
Definition: mac-low.h:940
Maintains information for a block ack agreement.
WifiTxVector GetBlockAckTxVector(Mac48Address to, WifiMode dataTxMode) const
Return a TXVECTOR for the BlockAck frame given the destination and the mode of the Data used by the s...
Definition: mac-low.cc:1461
An identifier for simulation events.
Definition: event-id.h:53
void NotifyAckTimeoutStartNow(Time duration)
Notify ChannelAccessManager that Ack timer should be started for the given duration.
Definition: mac-low.cc:1626
bool CanTransmitNextCfFrame(void) const
This function decides if a CF frame can be transmitted in the current CFP.
Definition: mac-low.cc:2670
void SetSlotTime(Time slotTime)
Set slot duration of this MacLow.
Definition: mac-low.cc:366
Implement the header for management frames of type Add Block Ack response.
Definition: mgt-headers.h:1135
Time m_cfpStart
The time when the latest CF period started.
Definition: mac-low.h:957
std::map< AgreementKey, AgreementValue >::iterator AgreementsI
agreements iterator
Definition: mac-low.h:974
EventId m_endTxNoAckEvent
Event for finishing transmission that does not require Ack.
Definition: mac-low.h:934
Time GetBlockAckDuration(WifiTxVector blockAckReqTxVector, BlockAckType type) const
Return the time required to transmit the BlockAck to the specified address given the TXVECTOR of the ...
Definition: mac-low.cc:1215
CfAckInfo m_cfAckInfo
Info about piggyback Acks used in PCF.
Definition: mac-low.h:988
void SetMpduAggregator(const Ptr< MpduAggregator > aggr)
Set the aggregator used to construct A-MPDU subframes.
Definition: mac-low.cc:311
void SetCtsTimeout(Time ctsTimeout)
Set CTS timeout of this MacLow.
Definition: mac-low.cc:354
void SendDataPacket(void)
Send Data packet, which can be Data-Ack or RTS-CTS-Data-Ack transaction.
Definition: mac-low.cc:1893
Time GetPifs(void) const
Return PCF Interframe Space (PIFS) of this MacLow.
Definition: mac-low.cc:456
void SetAddress(Mac48Address ad)
Set MAC address of this MacLow.
Definition: mac-low.cc:318
uint32_t GetCfEndSize(void) const
Return the total CF-END size (including FCS trailer).
Definition: mac-low.cc:1186
void ForwardDown(Ptr< const WifiPsdu > psdu, WifiTxVector txVector)
Forward a PSDU down to WifiPhy for transmission.
Definition: mac-low.cc:1662
A base class which provides memory management and object aggregation.
Definition: object.h:87
void WaitIfsAfterEndTxFragment(void)
Event handler that is usually scheduled to fired at the appropriate time after completing transmissio...
Definition: mac-low.cc:2100
void SetRxCallback(Callback< void, Ptr< WifiMacQueueItem >> callback)
Definition: mac-low.cc:486
Time GetBeaconInterval(void) const
Definition: mac-low.cc:468
Time m_compressedBlockAckTimeout
Compressed BlockAck timeout duration.
Definition: mac-low.h:944
void CfPollTimeout(void)
Event handler when CF-Poll timeout occurs.
Definition: mac-low.cc:1728
void NotifyCtsTimeoutResetNow(void)
Notify ChannelAccessManager that CTS timer should be reset.
Definition: mac-low.cc:1653
Headers for BlockAckRequest.
Definition: ctrl-headers.h:41
Ptr< WifiPsdu > m_currentPacket
Current packet transmitted/to be transmitted.
Definition: mac-low.h:937
void ResetPhy(void)
Remove WifiPhy associated with this MacLow.
Definition: mac-low.cc:263
Time GetSlotTime(void) const
Return slot duration of this MacLow.
Definition: mac-low.cc:450
WifiTxVector GetCtsTxVectorForRts(Mac48Address to, WifiMode rtsTxMode) const
Return a TXVECTOR for the CTS frame given the destination and the mode of the RTS used by the sender...
Definition: mac-low.cc:1477
a unique identifier for an interface.
Definition: type-id.h:58
std::vector< Ptr< ChannelAccessManager > > ChannelAccessManagers
typedef for a list of ChannelAccessManager.
Definition: mac-low.h:921
bool NeedCtsToSelf(void) const
Check if CTS-to-self mechanism should be used for the current packet.
Definition: mac-low.cc:650
Time m_rifs
Reduced Interframe Space (RIFS) duration.
Definition: mac-low.h:949
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:38
virtual ~MacLow()
Definition: mac-low.cc:137
Ptr< MpduAggregator > m_mpduAggregator
A-MPDU aggregator.
Definition: mac-low.h:925
Ptr< WifiPhy > m_phy
Pointer to WifiPhy (actually send/receives frames)
Definition: mac-low.h:899
void SetWifiRemoteStationManager(const Ptr< WifiRemoteStationManager > manager)
Set up WifiRemoteStationManager associated with this MacLow.
Definition: mac-low.cc:286
Implements the IEEE 802.11 MAC header.
void SetCompressedBlockAckTimeout(Time blockAckTimeout)
Set Compressed BlockAck timeout of this MacLow.
Definition: mac-low.cc:336
Ptr< WifiPhy > GetPhy(void) const
Definition: mac-low.cc:257
class PhyMacLowListener * m_phyMacLowListener
Listener needed to monitor when a channel switching occurs.
Definition: mac-low.h:963
ChannelAccessManagers m_channelAccessManagers
List of ChannelAccessManager.
Definition: mac-low.h:922
void SendRtsForPacket(void)
Send RTS to begin RTS-CTS-Data-Ack transaction.
Definition: mac-low.cc:1791
BlockAckType
The different block ack policies.
void RxCompleteBufferedPacketsUntilFirstLost(Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2352