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 SetCtsToSelfSupported (bool enable);
123  void SetBeaconInterval (Time interval);
127  void SetCfpMaxDuration (Time duration);
133  void SetBssid (Mac48Address ad);
137  void SetPromisc (void);
143  bool GetCtsToSelfSupported (void) const;
149  Mac48Address GetAddress (void) const;
155  Time GetSifs (void) const;
161  Time GetSlotTime (void) const;
167  Time GetPifs (void) const;
171  Time GetBeaconInterval (void) const;
175  Time GetCfpMaxDuration (void) const;
179  Time GetRemainingCfpDuration (void) const;
185  Mac48Address GetBssid (void) const;
192  bool IsPromisc (void) const;
193 
200  void SetRxCallback (Callback<void, Ptr<WifiMacQueueItem>> callback);
205  void RegisterChannelAccessManager (Ptr<ChannelAccessManager> channelAccessManager);
206 
222  uint32_t ampduSize, Time ppduDurationLimit);
239  bool IsWithinSizeAndTimeLimits (uint32_t mpduSize, Mac48Address receiver, uint8_t tid,
240  WifiTxVector txVector, uint32_t ampduSize, Time ppduDurationLimit);
251  const WifiMacHeader* hdr,
252  const MacLowTransmissionParameters& parameters) const;
253 
265  const WifiMacHeader* hdr,
266  const MacLowTransmissionParameters& params,
267  uint32_t fragmentSize = 0) const;
268 
278  const MacLowTransmissionParameters& params) const;
279 
288  virtual void StartTransmission (Ptr<WifiMacQueueItem> mpdu,
289  MacLowTransmissionParameters parameters,
290  Ptr<Txop> txop);
291 
303  void RxStartIndication (WifiTxVector txVector, Time psduDuration);
304 
314  void ReceiveOk (Ptr<WifiMacQueueItem> mpdu, double rxSnr, WifiTxVector txVector, bool ampduSubframe);
321  void ReceiveError (Ptr<WifiPsdu> psdu);
329  void NotifySwitchingStartNow (Time duration);
335  void NotifySleepNow (void);
341  void NotifyOffNow (void);
357  void CreateBlockAckAgreement (const MgtAddBaResponseHeader *respHdr,
358  Mac48Address originator,
359  uint16_t startingSeq);
368  void DestroyBlockAckAgreement (Mac48Address originator, uint8_t tid);
376  void RegisterEdcaForAc (AcIndex ac, Ptr<QosTxop> edca);
386  void DeaggregateAmpduAndReceive (Ptr<WifiPsdu> aggregatedPacket, double rxSnr, WifiTxVector txVector,
387  std::vector<bool> statusPerMpdu);
388 
404  bool DoNavStartNow (Time duration);
411  virtual bool IsCfPeriod (void) const;
418  bool CanTransmitNextCfFrame (void) const;
419 
432 
438  void SetMsduAggregator (const Ptr<MsduAggregator> aggr);
444  void SetMpduAggregator (const Ptr<MpduAggregator> aggr);
445 
446 
447 private:
452  void CancelAllEvents (void);
458  uint32_t GetCfEndSize (void) const;
465  void ForwardDown (Ptr<const WifiPsdu> psdu, WifiTxVector txVector);
485  WifiTxVector GetCtsTxVector (Mac48Address to, WifiMode rtsTxMode) const;
496  WifiTxVector GetAckTxVector (Mac48Address to, WifiMode dataTxMode) const;
507  WifiTxVector GetBlockAckTxVector (Mac48Address to, WifiMode dataTxMode) const;
537  WifiMode GetControlAnswerMode (WifiMode reqMode) const;
544  Time GetCtsDuration (WifiTxVector ctsTxVector) const;
553  Time GetCtsDuration (Mac48Address to, WifiTxVector rtsTxVector) const;
560  Time GetAckDuration (WifiTxVector ackTxVector) const;
569  Time GetAckDuration (Mac48Address to, WifiTxVector dataTxVector) const;
578  Time GetBlockAckDuration (WifiTxVector blockAckReqTxVector, BlockAckType type) const;
587  Time GetBlockAckRequestDuration (WifiTxVector blockAckReqTxVector, BlockAckType type) const;
598  WifiTxVector dataTxVector, Mac48Address receiver) const;
605  bool NeedCtsToSelf (void) const;
606 
613  void NotifyNav (Ptr<const Packet> packet,const WifiMacHeader &hdr);
619  void DoNavResetNow (Time duration);
626  bool IsNavZero (void) const;
632  void NotifyAckTimeoutStartNow (Time duration);
636  void NotifyAckTimeoutResetNow (void);
642  void NotifyCtsTimeoutStartNow (Time duration);
646  void NotifyCtsTimeoutResetNow (void);
647  /* Event handlers */
651  void NormalAckTimeout (void);
655  void BlockAckTimeout (void);
659  void CtsTimeout (void);
663  void CfPollTimeout (void);
667  void SendCtsToSelf (void);
676  void SendCtsAfterRts (Mac48Address source, Time duration, WifiTxVector rtsTxVector, double rtsSnr);
685  void SendAckAfterData (Mac48Address source, Time duration, WifiMode dataTxMode, double dataSnr);
691  void SendDataAfterCts (Time duration);
692 
697  void WaitIfsAfterEndTxFragment (void);
702  void WaitIfsAfterEndTxPacket (void);
703 
707  void EndTxNoAck (void);
711  void SendRtsForPacket (void);
716  void SendDataPacket (void);
723  void StartDataTxTimers (WifiTxVector dataTxVector);
724 
725  void DoDispose (void);
726 
735  void RxCompleteBufferedPacketsWithSmallerSequence (uint16_t seq, Mac48Address originator, uint8_t tid);
748  void RxCompleteBufferedPacketsUntilFirstLost (Mac48Address originator, uint8_t tid);
779  Time duration, WifiMode blockAckReqTxMode, double rxSnr);
790  void SendBlockAckAfterAmpdu (uint8_t tid, Mac48Address originator, Time duration,
791  WifiTxVector blockAckReqTxVector, double rxSnr);
802  void SendBlockAckResponse (const CtrlBAckResponseHeader* blockAck, Mac48Address originator, bool immediate,
803  Time duration, WifiMode blockAckReqTxMode, double rxSnr);
813 
826 
831 
835  struct CfAckInfo
836  {
837  bool appendCfAck;
838  bool expectCfAck;
840  };
841 
845  typedef std::vector<Ptr<ChannelAccessManager> >::const_iterator ChannelAccessManagersCI;
849  typedef std::vector<Ptr<ChannelAccessManager> > ChannelAccessManagers;
851 
854 
864 
870 
873 
876 
880 
881  bool m_promisc;
882 
884 
885  /*
886  * BlockAck data structures.
887  */
888  typedef std::list<Ptr<WifiMacQueueItem>>::iterator BufferedPacketI;
889 
890  typedef std::pair<Mac48Address, uint8_t> AgreementKey;
891  typedef std::pair<BlockAckAgreement, std::list<Ptr<WifiMacQueueItem>> > AgreementValue;
892 
893  typedef std::map<AgreementKey, AgreementValue> Agreements;
894  typedef std::map<AgreementKey, AgreementValue>::iterator AgreementsI;
895 
896  typedef std::map<AgreementKey, BlockAckCache> BlockAckCaches;
897  typedef std::map<AgreementKey, BlockAckCache>::iterator BlockAckCachesI;
898 
901 
902  typedef std::map<AcIndex, Ptr<QosTxop> > QueueEdcas;
904 
907 
909 };
910 
911 } //namespace ns3
912 
913 #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:2016
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
EventId m_navCounterResetCtsMissed
Event to reset NAV when CTS is not received.
Definition: mac-low.h:863
std::vector< Ptr< ChannelAccessManager > >::const_iterator ChannelAccessManagersCI
typedef for an iterator for a list of ChannelAccessManager.
Definition: mac-low.h:845
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:2444
EventId m_blockAckTimeoutEvent
BlockAck timeout event.
Definition: mac-low.h:856
Time CalculateOverallTxTime(Ptr< const Packet > packet, const WifiMacHeader *hdr, const MacLowTransmissionParameters &params, uint32_t fragmentSize=0) const
Definition: mac-low.cc:1430
Callback template class.
Definition: callback.h:1278
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:305
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:2378
bool ReceiveMpdu(Ptr< WifiMacQueueItem > mpdu)
Definition: mac-low.cc:2072
void SetPromisc(void)
Enable promiscuous mode.
Definition: mac-low.cc:361
void DoNavResetNow(Time duration)
Reset NAV with the given duration.
Definition: mac-low.cc:1529
Ptr< Txop > m_currentTxop
Current TXOP.
Definition: mac-low.h:866
void SetupPhyMacLowListener(const Ptr< WifiPhy > phy)
Set up WifiPhy listener for this MacLow.
Definition: mac-low.cc:160
Ptr< QosTxop > GetEdca(uint8_t tid) const
Definition: mac-low.cc:279
Ptr< MsduAggregator > m_msduAggregator
A-MSDU aggregator.
Definition: mac-low.h:852
void SetPhy(const Ptr< WifiPhy > phy)
Set up WifiPhy associated with this MacLow.
Definition: mac-low.cc:253
bool DoNavStartNow(Time duration)
Start NAV with the given duration.
Definition: mac-low.cc:1541
std::pair< Mac48Address, uint8_t > AgreementKey
agreement key typedef
Definition: mac-low.h:890
Time CalculateOverheadTxTime(Ptr< const WifiMacQueueItem > item, const MacLowTransmissionParameters &params) const
Definition: mac-low.cc:1452
void ReceiveError(Ptr< WifiPsdu > psdu)
Definition: mac-low.cc:690
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:1200
bool IsNavZero(void) const
Check if NAV is zero.
Definition: mac-low.cc:1899
void NotifyOffNow(void)
This method is typically invoked by the PhyMacLowListener to notify the MAC layer that the device has...
Definition: mac-low.cc:742
void NotifySleepNow(void)
This method is typically invoked by the PhyMacLowListener to notify the MAC layer that the device has...
Definition: mac-low.cc:727
void NotifyNav(Ptr< const Packet > packet, const WifiMacHeader &hdr)
Notify NAV function.
Definition: mac-low.cc:1484
Mac48Address GetBssid(void) const
Return the Basic Service Set Identification.
Definition: mac-low.cc:391
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:1188
Mac48Address m_bssid
BSSID address (Mac48Address)
Definition: mac-low.h:869
EventId m_sendCtsEvent
Event to send CTS.
Definition: mac-low.h:858
MacLowRxCallback m_rxCallback
Callback to pass packet up.
Definition: mac-low.h:830
bool appendCfAck
Flag used for PCF to indicate whether a CF-Ack should be appended.
Definition: mac-low.h:837
EventId m_sendAckEvent
Event to send Ack.
Definition: mac-low.h:859
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:1228
void NotifyAckTimeoutResetNow(void)
Notify ChannelAccessManager that Ack timer should be reset.
Definition: mac-low.cc:1568
Time m_cfpMaxDuration
CFP max duration.
Definition: mac-low.h:872
Time CalculateTransmissionTime(Ptr< const Packet > packet, const WifiMacHeader *hdr, const MacLowTransmissionParameters &parameters) const
Definition: mac-low.cc:1469
control how a packet is transmitted.
std::list< Ptr< WifiMacQueueItem > >::iterator BufferedPacketI
buffered packet iterator typedef
Definition: mac-low.h:888
void SetCtsToSelfSupported(bool enable)
Enable or disable CTS-to-self capability.
Definition: mac-low.cc:331
bool expectCfAck
Flag used for PCF to indicate whether a CF-Ack should be expected.
Definition: mac-low.h:838
QueueEdcas m_edca
EDCA queues.
Definition: mac-low.h:903
void NormalAckTimeout(void)
Event handler when normal Ack timeout occurs.
Definition: mac-low.cc:1701
phy
Definition: third.py:93
BlockAckCaches m_bAckCaches
block ack caches
Definition: mac-low.h:900
Ptr< WifiMac > m_mac
Pointer to WifiMac (to fetch configuration)
Definition: mac-low.h:828
void RemovePhyMacLowListener(Ptr< WifiPhy > phy)
Remove current WifiPhy listener for this MacLow.
Definition: mac-low.cc:167
bool IsPromisc(void) const
Check if MacLow is operating in promiscuous mode.
Definition: mac-low.cc:409
WifiTxVector m_currentTxVector
TXVECTOR used for the current packet transmission.
Definition: mac-low.h:906
void DestroyBlockAckAgreement(Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2182
Time m_lastNavDuration
The duration of the latest NAV.
Definition: mac-low.h:875
void SetCfpMaxDuration(Time duration)
Definition: mac-low.cc:349
Time GetCtsDuration(WifiTxVector ctsTxVector) const
Return the time required to transmit the CTS (including preamble and FCS).
Definition: mac-low.cc:1181
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:586
bool m_ctsToSelfSupported
Flag whether CTS-to-self is supported.
Definition: mac-low.h:905
void SendCtsToSelf(void)
Send CTS for a CTS-to-self mechanism.
Definition: mac-low.cc:1905
void SendAckAfterData(Mac48Address source, Time duration, WifiMode dataTxMode, double dataSnr)
Send Ack after receiving Data.
Definition: mac-low.cc:2042
Mac48Address GetAddress(void) const
Return the MAC address of this MacLow.
Definition: mac-low.cc:367
virtual void StartTransmission(Ptr< WifiMacQueueItem > mpdu, MacLowTransmissionParameters parameters, Ptr< Txop > txop)
Definition: mac-low.cc:427
void CreateBlockAckAgreement(const MgtAddBaResponseHeader *respHdr, Mac48Address originator, uint16_t startingSeq)
Definition: mac-low.cc:2140
Time m_lastBeacon
The time when the last beacon frame transmission started.
Definition: mac-low.h:878
Listener for PHY events.
Definition: mac-low.cc:62
void CtsTimeout(void)
Event handler when CTS timeout occurs.
Definition: mac-low.cc:1679
void DeaggregateAmpduAndReceive(Ptr< WifiPsdu > aggregatedPacket, double rxSnr, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
Definition: mac-low.cc:2466
Time GetSifs(void) const
Return Short Interframe Space (SIFS) of this MacLow.
Definition: mac-low.cc:373
void EndTxNoAck(void)
A transmission that does not require an Ack has completed.
Definition: mac-low.cc:2023
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:2339
std::map< AgreementKey, BlockAckCache >::iterator BlockAckCachesI
block ack caches iterator typedef
Definition: mac-low.h:897
virtual bool IsCfPeriod(void) const
This function indicates whether Simulator::Now is in the CF period.
Definition: mac-low.cc:2578
static TypeId GetTypeId(void)
Register this type.
Definition: mac-low.cc:149
mac
Definition: third.py:99
bool StoreMpduIfNeeded(Ptr< WifiMacQueueItem > mpdu)
Definition: mac-low.cc:2113
Ptr< WifiRemoteStationManager > m_stationManager
Pointer to WifiRemoteStationManager (rate control)
Definition: mac-low.h:829
void SetMac(const Ptr< WifiMac > mac)
Set up WifiMac associated with this MacLow.
Definition: mac-low.cc:287
Headers for BlockAck response.
Definition: ctrl-headers.h:193
void SendDataAfterCts(Time duration)
Send Data after receiving CTS.
Definition: mac-low.cc:1974
void RegisterEdcaForAc(AcIndex ac, Ptr< QosTxop > edca)
Definition: mac-low.cc:2460
Agreements m_bAckAgreements
block ack agreements
Definition: mac-low.h:899
void RegisterChannelAccessManager(Ptr< ChannelAccessManager > channelAccessManager)
Definition: mac-low.cc:421
virtual WifiTxVector GetDataTxVector(Ptr< const WifiMacQueueItem > item) const
Return a TXVECTOR for the Data frame given the destination.
Definition: mac-low.cc:1194
A struct that holds information about Ack piggybacking (CF-Ack).
Definition: mac-low.h:835
void NotifySwitchingStartNow(Time duration)
Definition: mac-low.cc:711
Time GetCfpMaxDuration(void) const
Definition: mac-low.cc:403
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:1386
void RxStartIndication(WifiTxVector txVector, Time psduDuration)
Definition: mac-low.cc:648
bool m_promisc
Flag if the device is operating in promiscuous mode.
Definition: mac-low.h:881
void CancelAllEvents(void)
Cancel all scheduled events.
Definition: mac-low.cc:201
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:1370
void BlockAckTimeout(void)
Event handler when BlockAck timeout occurs.
Definition: mac-low.cc:1714
void NotifyCtsTimeoutStartNow(Time duration)
Notify ChannelAccessManager that CTS timer should be started for the given duration.
Definition: mac-low.cc:1577
std::map< AgreementKey, BlockAckCache > BlockAckCaches
block ack caches typedef
Definition: mac-low.h:896
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Time GetRemainingCfpDuration(void) const
Definition: mac-low.cc:2569
void SetBssid(Mac48Address ad)
Set the Basic Service Set Identification.
Definition: mac-low.cc:355
EventId m_waitIfsEvent
Wait for IFS event.
Definition: mac-low.h:861
EventId m_normalAckTimeoutEvent
Normal Ack timeout event.
Definition: mac-low.h:855
void StartDataTxTimers(WifiTxVector dataTxVector)
Start a Data timer by scheduling appropriate Ack timeout.
Definition: mac-low.cc:1767
Time m_beaconInterval
Expected interval between two beacon transmissions.
Definition: mac-low.h:871
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:879
std::pair< BlockAckAgreement, std::list< Ptr< WifiMacQueueItem > > > AgreementValue
agreement value typedef
Definition: mac-low.h:891
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:2291
Time GetAckDuration(WifiTxVector ackTxVector) const
Return the time required to transmit the Ack (including preamble and FCS).
Definition: mac-low.cc:1151
EventId m_ctsTimeoutEvent
CTS timeout event.
Definition: mac-low.h:857
void RxCompleteBufferedPacketsWithSmallerSequence(uint16_t seq, Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2198
void SendCtsAfterRts(Mac48Address source, Time duration, WifiTxVector rtsTxVector, double rtsSnr)
Send CTS after receiving RTS.
Definition: mac-low.cc:1944
Ptr< MsduAggregator > GetMsduAggregator(void) const
Returns the aggregator used to construct A-MSDU subframes.
Definition: mac-low.cc:299
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:1168
bool GetCtsToSelfSupported(void) const
Return whether CTS-to-self capability is supported.
Definition: mac-low.cc:337
void SetBeaconInterval(Time interval)
Definition: mac-low.cc:343
Time m_lastNavStart
The time when the latest NAV started.
Definition: mac-low.h:874
std::map< AgreementKey, AgreementValue > Agreements
agreements
Definition: mac-low.h:893
handle RTS/CTS/Data/Ack transactions.
Definition: mac-low.h:59
Mac48Address address
Address of the station to be acknowledged.
Definition: mac-low.h:839
EventId m_sendDataEvent
Event to send Data.
Definition: mac-low.h:860
MacLowTransmissionParameters m_txParams
Transmission parameters of the current packet.
Definition: mac-low.h:867
void DoDispose(void)
Destructor implementation.
Definition: mac-low.cc:178
void SetMsduAggregator(const Ptr< MsduAggregator > aggr)
Set the aggregator used to construct A-MSDU subframes.
Definition: mac-low.cc:311
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:1424
std::map< AcIndex, Ptr< QosTxop > > QueueEdcas
EDCA queues typedef.
Definition: mac-low.h:902
void ReceiveOk(Ptr< WifiMacQueueItem > mpdu, double rxSnr, WifiTxVector txVector, bool ampduSubframe)
Definition: mac-low.cc:757
Mac48Address m_self
Address of this MacLow (Mac48Address)
Definition: mac-low.h:868
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:1402
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:1559
bool CanTransmitNextCfFrame(void) const
This function decides if a CF frame can be transmitted in the current CFP.
Definition: mac-low.cc:2584
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:877
std::map< AgreementKey, AgreementValue >::iterator AgreementsI
agreements iterator
Definition: mac-low.h:894
EventId m_endTxNoAckEvent
Event for finishing transmission that does not require Ack.
Definition: mac-low.h:862
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:1158
CfAckInfo m_cfAckInfo
Info about piggyback Acks used in PCF.
Definition: mac-low.h:908
void SetMpduAggregator(const Ptr< MpduAggregator > aggr)
Set the aggregator used to construct A-MPDU subframes.
Definition: mac-low.cc:318
void SendDataPacket(void)
Send Data packet, which can be Data-Ack or RTS-CTS-Data-Ack transaction.
Definition: mac-low.cc:1816
Time GetPifs(void) const
Return PCF Interframe Space (PIFS) of this MacLow.
Definition: mac-low.cc:385
void SetAddress(Mac48Address ad)
Set MAC address of this MacLow.
Definition: mac-low.cc:325
uint32_t GetCfEndSize(void) const
Return the total CF-END size (including FCS trailer).
Definition: mac-low.cc:1129
void ForwardDown(Ptr< const WifiPsdu > psdu, WifiTxVector txVector)
Forward a PSDU down to WifiPhy for transmission.
Definition: mac-low.cc:1595
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:2009
void SetRxCallback(Callback< void, Ptr< WifiMacQueueItem >> callback)
Definition: mac-low.cc:415
Time GetBeaconInterval(void) const
Definition: mac-low.cc:397
void CfPollTimeout(void)
Event handler when CF-Poll timeout occurs.
Definition: mac-low.cc:1661
void NotifyCtsTimeoutResetNow(void)
Notify ChannelAccessManager that CTS timer should be reset.
Definition: mac-low.cc:1586
Headers for BlockAckRequest.
Definition: ctrl-headers.h:41
Ptr< WifiPsdu > m_currentPacket
Current packet transmitted/to be transmitted.
Definition: mac-low.h:865
void ResetPhy(void)
Remove WifiPhy associated with this MacLow.
Definition: mac-low.cc:269
Time GetSlotTime(void) const
Return slot duration of this MacLow.
Definition: mac-low.cc:379
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:1418
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:849
bool NeedCtsToSelf(void) const
Check if CTS-to-self mechanism should be used for the current packet.
Definition: mac-low.cc:579
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:142
Ptr< MpduAggregator > m_mpduAggregator
A-MPDU aggregator.
Definition: mac-low.h:853
Ptr< WifiPhy > m_phy
Pointer to WifiPhy (actually send/receives frames)
Definition: mac-low.h:827
void SetWifiRemoteStationManager(const Ptr< WifiRemoteStationManager > manager)
Set up WifiRemoteStationManager associated with this MacLow.
Definition: mac-low.cc:293
Implements the IEEE 802.11 MAC header.
Ptr< WifiPhy > GetPhy(void) const
Definition: mac-low.cc:263
class PhyMacLowListener * m_phyMacLowListener
Listener needed to monitor when a channel switching occurs.
Definition: mac-low.h:883
ChannelAccessManagers m_channelAccessManagers
List of ChannelAccessManager.
Definition: mac-low.h:850
void SendRtsForPacket(void)
Send RTS to begin RTS-CTS-Data-Ack transaction.
Definition: mac-low.cc:1724
BlockAckType
The different block ack policies.
void RxCompleteBufferedPacketsUntilFirstLost(Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2261