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 SetSifs (Time sifs);
149  void SetRifs (Time rifs);
155  void SetSlotTime (Time slotTime);
161  void SetPifs (Time pifs);
165  void SetBeaconInterval (Time interval);
169  void SetCfpMaxDuration (Time duration);
175  void SetBssid (Mac48Address ad);
179  void SetPromisc (void);
185  bool GetCtsToSelfSupported (void) const;
191  Mac48Address GetAddress (void) const;
197  Time GetAckTimeout (void) const;
203  Time GetBasicBlockAckTimeout (void) const;
209  Time GetCompressedBlockAckTimeout (void) const;
215  Time GetSifs (void) const;
221  Time GetSlotTime (void) const;
227  Time GetPifs (void) const;
233  Time GetRifs (void) const;
237  Time GetBeaconInterval (void) const;
241  Time GetCfpMaxDuration (void) const;
245  Time GetRemainingCfpDuration (void) const;
251  Mac48Address GetBssid (void) const;
258  bool IsPromisc (void) const;
259 
266  void SetRxCallback (Callback<void, Ptr<WifiMacQueueItem>> callback);
271  void RegisterChannelAccessManager (Ptr<ChannelAccessManager> channelAccessManager);
272 
288  uint32_t ampduSize, Time ppduDurationLimit);
305  bool IsWithinSizeAndTimeLimits (uint32_t mpduSize, Mac48Address receiver, uint8_t tid,
306  WifiTxVector txVector, uint32_t ampduSize, Time ppduDurationLimit);
317  const WifiMacHeader* hdr,
318  const MacLowTransmissionParameters& parameters) const;
319 
331  const WifiMacHeader* hdr,
332  const MacLowTransmissionParameters& params,
333  uint32_t fragmentSize = 0) const;
334 
344  const MacLowTransmissionParameters& params) const;
345 
354  virtual void StartTransmission (Ptr<WifiMacQueueItem> mpdu,
355  MacLowTransmissionParameters parameters,
356  Ptr<Txop> txop);
357 
369  void RxStartIndication (WifiTxVector txVector, Time psduDuration);
370 
380  void ReceiveOk (Ptr<WifiMacQueueItem> mpdu, double rxSnr, WifiTxVector txVector, bool ampduSubframe);
387  void ReceiveError (Ptr<WifiPsdu> psdu);
395  void NotifySwitchingStartNow (Time duration);
401  void NotifySleepNow (void);
407  void NotifyOffNow (void);
423  void CreateBlockAckAgreement (const MgtAddBaResponseHeader *respHdr,
424  Mac48Address originator,
425  uint16_t startingSeq);
434  void DestroyBlockAckAgreement (Mac48Address originator, uint8_t tid);
442  void RegisterEdcaForAc (AcIndex ac, Ptr<QosTxop> edca);
452  void DeaggregateAmpduAndReceive (Ptr<WifiPsdu> aggregatedPacket, double rxSnr, WifiTxVector txVector,
453  std::vector<bool> statusPerMpdu);
454 
470  bool DoNavStartNow (Time duration);
477  virtual bool IsCfPeriod (void) const;
484  bool CanTransmitNextCfFrame (void) const;
485 
498 
504  void SetMsduAggregator (const Ptr<MsduAggregator> aggr);
510  void SetMpduAggregator (const Ptr<MpduAggregator> aggr);
511 
512 
513 private:
518  void CancelAllEvents (void);
524  uint32_t GetCfEndSize (void) const;
531  void ForwardDown (Ptr<const WifiPsdu> psdu, WifiTxVector txVector);
551  WifiTxVector GetCtsTxVector (Mac48Address to, WifiMode rtsTxMode) const;
562  WifiTxVector GetAckTxVector (Mac48Address to, WifiMode dataTxMode) const;
573  WifiTxVector GetBlockAckTxVector (Mac48Address to, WifiMode dataTxMode) const;
603  WifiMode GetControlAnswerMode (WifiMode reqMode) const;
610  Time GetCtsDuration (WifiTxVector ctsTxVector) const;
619  Time GetCtsDuration (Mac48Address to, WifiTxVector rtsTxVector) const;
626  Time GetAckDuration (WifiTxVector ackTxVector) const;
635  Time GetAckDuration (Mac48Address to, WifiTxVector dataTxVector) const;
644  Time GetBlockAckDuration (WifiTxVector blockAckReqTxVector, BlockAckType type) const;
653  Time GetBlockAckRequestDuration (WifiTxVector blockAckReqTxVector, BlockAckType type) const;
664  WifiTxVector dataTxVector, Mac48Address receiver) const;
671  bool NeedCtsToSelf (void) const;
672 
679  void NotifyNav (Ptr<const Packet> packet,const WifiMacHeader &hdr);
685  void DoNavResetNow (Time duration);
692  bool IsNavZero (void) const;
698  void NotifyAckTimeoutStartNow (Time duration);
702  void NotifyAckTimeoutResetNow (void);
708  void NotifyCtsTimeoutStartNow (Time duration);
712  void NotifyCtsTimeoutResetNow (void);
713  /* Event handlers */
717  void NormalAckTimeout (void);
721  void BlockAckTimeout (void);
725  void CtsTimeout (void);
729  void CfPollTimeout (void);
733  void SendCtsToSelf (void);
742  void SendCtsAfterRts (Mac48Address source, Time duration, WifiTxVector rtsTxVector, double rtsSnr);
751  void SendAckAfterData (Mac48Address source, Time duration, WifiMode dataTxMode, double dataSnr);
757  void SendDataAfterCts (Time duration);
758 
763  void WaitIfsAfterEndTxFragment (void);
768  void WaitIfsAfterEndTxPacket (void);
769 
773  void EndTxNoAck (void);
777  void SendRtsForPacket (void);
782  void SendDataPacket (void);
789  void StartDataTxTimers (WifiTxVector dataTxVector);
790 
791  void DoDispose (void);
792 
801  void RxCompleteBufferedPacketsWithSmallerSequence (uint16_t seq, Mac48Address originator, uint8_t tid);
814  void RxCompleteBufferedPacketsUntilFirstLost (Mac48Address originator, uint8_t tid);
845  Time duration, WifiMode blockAckReqTxMode, double rxSnr);
856  void SendBlockAckAfterAmpdu (uint8_t tid, Mac48Address originator, Time duration,
857  WifiTxVector blockAckReqTxVector, double rxSnr);
868  void SendBlockAckResponse (const CtrlBAckResponseHeader* blockAck, Mac48Address originator, bool immediate,
869  Time duration, WifiMode blockAckReqTxMode, double rxSnr);
879 
892 
897 
901  struct CfAckInfo
902  {
903  bool appendCfAck;
904  bool expectCfAck;
906  };
907 
911  typedef std::vector<Ptr<ChannelAccessManager> >::const_iterator ChannelAccessManagersCI;
915  typedef std::vector<Ptr<ChannelAccessManager> > ChannelAccessManagers;
917 
920 
930 
943 
946 
949 
953 
954  bool m_promisc;
955 
957 
958  /*
959  * BlockAck data structures.
960  */
961  typedef std::list<Ptr<WifiMacQueueItem>>::iterator BufferedPacketI;
962 
963  typedef std::pair<Mac48Address, uint8_t> AgreementKey;
964  typedef std::pair<BlockAckAgreement, std::list<Ptr<WifiMacQueueItem>> > AgreementValue;
965 
966  typedef std::map<AgreementKey, AgreementValue> Agreements;
967  typedef std::map<AgreementKey, AgreementValue>::iterator AgreementsI;
968 
969  typedef std::map<AgreementKey, BlockAckCache> BlockAckCaches;
970  typedef std::map<AgreementKey, BlockAckCache>::iterator BlockAckCachesI;
971 
974 
975  typedef std::map<AcIndex, Ptr<QosTxop> > QueueEdcas;
977 
980 
982 };
983 
984 } //namespace ns3
985 
986 #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:2133
Time GetRifs(void) const
Return Reduced Interframe Space (RIFS) of this MacLow.
Definition: mac-low.cc:439
void SetPifs(Time pifs)
Set PCF Interframe Space (PIFS) of this MacLow.
Definition: mac-low.cc:373
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:929
std::vector< Ptr< ChannelAccessManager > >::const_iterator ChannelAccessManagersCI
typedef for an iterator for a list of ChannelAccessManager.
Definition: mac-low.h:911
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:2561
EventId m_blockAckTimeoutEvent
BlockAck timeout event.
Definition: mac-low.h:922
Time CalculateOverallTxTime(Ptr< const Packet > packet, const WifiMacHeader *hdr, const MacLowTransmissionParameters &params, uint32_t fragmentSize=0) const
Definition: mac-low.cc:1517
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:2495
bool ReceiveMpdu(Ptr< WifiMacQueueItem > mpdu)
Definition: mac-low.cc:2189
void SetPromisc(void)
Enable promiscuous mode.
Definition: mac-low.cc:403
void DoNavResetNow(Time duration)
Reset NAV with the given duration.
Definition: mac-low.cc:1616
Ptr< Txop > m_currentTxop
Current TXOP.
Definition: mac-low.h:932
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:918
Time m_pifs
PCF Interframe Space (PIFS) duration.
Definition: mac-low.h:941
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:1628
void SetSifs(Time sifs)
Set Short Interframe Space (SIFS) of this MacLow.
Definition: mac-low.cc:361
std::pair< Mac48Address, uint8_t > AgreementKey
agreement key typedef
Definition: mac-low.h:963
Time CalculateOverheadTxTime(Ptr< const WifiMacQueueItem > item, const MacLowTransmissionParameters &params) const
Definition: mac-low.cc:1539
void ReceiveError(Ptr< WifiPsdu > psdu)
Definition: mac-low.cc:756
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:1287
bool IsNavZero(void) const
Check if NAV is zero.
Definition: mac-low.cc:2009
void NotifyOffNow(void)
This method is typically invoked by the PhyMacLowListener to notify the MAC layer that the device has...
Definition: mac-low.cc:808
void NotifySleepNow(void)
This method is typically invoked by the PhyMacLowListener to notify the MAC layer that the device has...
Definition: mac-low.cc:793
void NotifyNav(Ptr< const Packet > packet, const WifiMacHeader &hdr)
Notify NAV function.
Definition: mac-low.cc:1571
Mac48Address GetBssid(void) const
Return the Basic Service Set Identification.
Definition: mac-low.cc:457
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:1275
Mac48Address m_bssid
BSSID address (Mac48Address)
Definition: mac-low.h:935
EventId m_sendCtsEvent
Event to send CTS.
Definition: mac-low.h:924
MacLowRxCallback m_rxCallback
Callback to pass packet up.
Definition: mac-low.h:896
bool appendCfAck
Flag used for PCF to indicate whether a CF-Ack should be appended.
Definition: mac-low.h:903
EventId m_sendAckEvent
Event to send Ack.
Definition: mac-low.h:925
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:1315
void NotifyAckTimeoutResetNow(void)
Notify ChannelAccessManager that Ack timer should be reset.
Definition: mac-low.cc:1655
Time m_cfpMaxDuration
CFP max duration.
Definition: mac-low.h:945
Time CalculateTransmissionTime(Ptr< const Packet > packet, const WifiMacHeader *hdr, const MacLowTransmissionParameters &parameters) const
Definition: mac-low.cc:1556
control how a packet is transmitted.
std::list< Ptr< WifiMacQueueItem > >::iterator BufferedPacketI
buffered packet iterator typedef
Definition: mac-low.h:961
void SetCtsToSelfSupported(bool enable)
Enable or disable CTS-to-self capability.
Definition: mac-low.cc:349
bool expectCfAck
Flag used for PCF to indicate whether a CF-Ack should be expected.
Definition: mac-low.h:904
QueueEdcas m_edca
EDCA queues.
Definition: mac-low.h:976
void NormalAckTimeout(void)
Event handler when normal Ack timeout occurs.
Definition: mac-low.cc:1788
void SetBasicBlockAckTimeout(Time blockAckTimeout)
Set Basic BlockAck timeout of this MacLow.
Definition: mac-low.cc:337
phy
Definition: third.py:93
BlockAckCaches m_bAckCaches
block ack caches
Definition: mac-low.h:973
Ptr< WifiMac > m_mac
Pointer to WifiMac (to fetch configuration)
Definition: mac-low.h:894
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:475
WifiTxVector m_currentTxVector
TXVECTOR used for the current packet transmission.
Definition: mac-low.h:979
void DestroyBlockAckAgreement(Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2299
Time m_lastNavDuration
The duration of the latest NAV.
Definition: mac-low.h:948
void SetCfpMaxDuration(Time duration)
Definition: mac-low.cc:391
Time GetCtsDuration(WifiTxVector ctsTxVector) const
Return the time required to transmit the CTS (including preamble and FCS).
Definition: mac-low.cc:1268
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:652
bool m_ctsToSelfSupported
Flag whether CTS-to-self is supported.
Definition: mac-low.h:978
void SendCtsToSelf(void)
Send CTS for a CTS-to-self mechanism.
Definition: mac-low.cc:2015
void SendAckAfterData(Mac48Address source, Time duration, WifiMode dataTxMode, double dataSnr)
Send Ack after receiving Data.
Definition: mac-low.cc:2159
Mac48Address GetAddress(void) const
Return the MAC address of this MacLow.
Definition: mac-low.cc:409
virtual void StartTransmission(Ptr< WifiMacQueueItem > mpdu, MacLowTransmissionParameters parameters, Ptr< Txop > txop)
Definition: mac-low.cc:493
void CreateBlockAckAgreement(const MgtAddBaResponseHeader *respHdr, Mac48Address originator, uint16_t startingSeq)
Definition: mac-low.cc:2257
Time m_lastBeacon
The time when the last beacon frame transmission started.
Definition: mac-low.h:951
Time GetCompressedBlockAckTimeout(void) const
Return Compressed BlockAck timeout of this MacLow.
Definition: mac-low.cc:427
Listener for PHY events.
Definition: mac-low.cc:62
void CtsTimeout(void)
Event handler when CTS timeout occurs.
Definition: mac-low.cc:1766
void DeaggregateAmpduAndReceive(Ptr< WifiPsdu > aggregatedPacket, double rxSnr, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
Definition: mac-low.cc:2583
Time GetSifs(void) const
Return Short Interframe Space (SIFS) of this MacLow.
Definition: mac-low.cc:433
void EndTxNoAck(void)
A transmission that does not require an Ack has completed.
Definition: mac-low.cc:2140
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:2456
std::map< AgreementKey, BlockAckCache >::iterator BlockAckCachesI
block ack caches iterator typedef
Definition: mac-low.h:970
virtual bool IsCfPeriod(void) const
This function indicates whether Simulator::Now is in the CF period.
Definition: mac-low.cc:2690
void SetAckTimeout(Time ackTimeout)
Set Ack timeout of this MacLow.
Definition: mac-low.cc:331
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:2230
Ptr< WifiRemoteStationManager > m_stationManager
Pointer to WifiRemoteStationManager (rate control)
Definition: mac-low.h:895
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:2084
void RegisterEdcaForAc(AcIndex ac, Ptr< QosTxop > edca)
Definition: mac-low.cc:2577
Agreements m_bAckAgreements
block ack agreements
Definition: mac-low.h:972
void RegisterChannelAccessManager(Ptr< ChannelAccessManager > channelAccessManager)
Definition: mac-low.cc:487
virtual WifiTxVector GetDataTxVector(Ptr< const WifiMacQueueItem > item) const
Return a TXVECTOR for the Data frame given the destination.
Definition: mac-low.cc:1281
A struct that holds information about Ack piggybacking (CF-Ack).
Definition: mac-low.h:901
void NotifySwitchingStartNow(Time duration)
Definition: mac-low.cc:777
Time GetCfpMaxDuration(void) const
Definition: mac-low.cc:469
Time m_slotTime
Slot duration.
Definition: mac-low.h:940
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:1473
void RxStartIndication(WifiTxVector txVector, Time psduDuration)
Definition: mac-low.cc:714
bool m_promisc
Flag if the device is operating in promiscuous mode.
Definition: mac-low.h:954
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:1457
void BlockAckTimeout(void)
Event handler when BlockAck timeout occurs.
Definition: mac-low.cc:1801
void NotifyCtsTimeoutStartNow(Time duration)
Notify ChannelAccessManager that CTS timer should be started for the given duration.
Definition: mac-low.cc:1664
std::map< AgreementKey, BlockAckCache > BlockAckCaches
block ack caches typedef
Definition: mac-low.h:969
Time GetAckTimeout(void) const
Return Ack timeout of this MacLow.
Definition: mac-low.cc:415
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Time GetRemainingCfpDuration(void) const
Definition: mac-low.cc:2681
void SetBssid(Mac48Address ad)
Set the Basic Service Set Identification.
Definition: mac-low.cc:397
Time GetBasicBlockAckTimeout(void) const
Return Basic BlockAck timeout of this MacLow.
Definition: mac-low.cc:421
EventId m_waitIfsEvent
Wait for IFS event.
Definition: mac-low.h:927
EventId m_normalAckTimeoutEvent
Normal Ack timeout event.
Definition: mac-low.h:921
void StartDataTxTimers(WifiTxVector dataTxVector)
Start a Data timer by scheduling appropriate Ack timeout.
Definition: mac-low.cc:1854
Time m_beaconInterval
Expected interval between two beacon transmissions.
Definition: mac-low.h:944
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:952
std::pair< BlockAckAgreement, std::list< Ptr< WifiMacQueueItem > > > AgreementValue
agreement value typedef
Definition: mac-low.h:964
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:2408
Time GetAckDuration(WifiTxVector ackTxVector) const
Return the time required to transmit the Ack (including preamble and FCS).
Definition: mac-low.cc:1238
Time m_ackTimeout
Ack timeout duration.
Definition: mac-low.h:936
EventId m_ctsTimeoutEvent
CTS timeout event.
Definition: mac-low.h:923
void RxCompleteBufferedPacketsWithSmallerSequence(uint16_t seq, Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2315
void SendCtsAfterRts(Mac48Address source, Time duration, WifiTxVector rtsTxVector, double rtsSnr)
Send CTS after receiving RTS.
Definition: mac-low.cc:2054
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:1255
Time m_basicBlockAckTimeout
Basic BlockAck timeout duration.
Definition: mac-low.h:937
bool GetCtsToSelfSupported(void) const
Return whether CTS-to-self capability is supported.
Definition: mac-low.cc:355
Time m_sifs
Short Interframe Space (SIFS) duration.
Definition: mac-low.h:939
void SetBeaconInterval(Time interval)
Definition: mac-low.cc:385
Time m_lastNavStart
The time when the latest NAV started.
Definition: mac-low.h:947
std::map< AgreementKey, AgreementValue > Agreements
agreements
Definition: mac-low.h:966
handle RTS/CTS/Data/Ack transactions.
Definition: mac-low.h:59
Mac48Address address
Address of the station to be acknowledged.
Definition: mac-low.h:905
EventId m_sendDataEvent
Event to send Data.
Definition: mac-low.h:926
MacLowTransmissionParameters m_txParams
Transmission parameters of the current packet.
Definition: mac-low.h:933
void SetRifs(Time rifs)
Set Reduced Interframe Space (RIFS) of this MacLow.
Definition: mac-low.cc:379
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:1511
std::map< AcIndex, Ptr< QosTxop > > QueueEdcas
EDCA queues typedef.
Definition: mac-low.h:975
void ReceiveOk(Ptr< WifiMacQueueItem > mpdu, double rxSnr, WifiTxVector txVector, bool ampduSubframe)
Definition: mac-low.cc:823
Mac48Address m_self
Address of this MacLow (Mac48Address)
Definition: mac-low.h:934
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:1489
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:1646
bool CanTransmitNextCfFrame(void) const
This function decides if a CF frame can be transmitted in the current CFP.
Definition: mac-low.cc:2696
void SetSlotTime(Time slotTime)
Set slot duration of this MacLow.
Definition: mac-low.cc:367
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:950
std::map< AgreementKey, AgreementValue >::iterator AgreementsI
agreements iterator
Definition: mac-low.h:967
EventId m_endTxNoAckEvent
Event for finishing transmission that does not require Ack.
Definition: mac-low.h:928
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:1245
CfAckInfo m_cfAckInfo
Info about piggyback Acks used in PCF.
Definition: mac-low.h:981
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:1919
Time GetPifs(void) const
Return PCF Interframe Space (PIFS) of this MacLow.
Definition: mac-low.cc:451
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:1216
void ForwardDown(Ptr< const WifiPsdu > psdu, WifiTxVector txVector)
Forward a PSDU down to WifiPhy for transmission.
Definition: mac-low.cc:1682
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:2126
void SetRxCallback(Callback< void, Ptr< WifiMacQueueItem >> callback)
Definition: mac-low.cc:481
Time GetBeaconInterval(void) const
Definition: mac-low.cc:463
Time m_compressedBlockAckTimeout
Compressed BlockAck timeout duration.
Definition: mac-low.h:938
void CfPollTimeout(void)
Event handler when CF-Poll timeout occurs.
Definition: mac-low.cc:1748
void NotifyCtsTimeoutResetNow(void)
Notify ChannelAccessManager that CTS timer should be reset.
Definition: mac-low.cc:1673
Headers for BlockAckRequest.
Definition: ctrl-headers.h:41
Ptr< WifiPsdu > m_currentPacket
Current packet transmitted/to be transmitted.
Definition: mac-low.h:931
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:445
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:1505
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:915
bool NeedCtsToSelf(void) const
Check if CTS-to-self mechanism should be used for the current packet.
Definition: mac-low.cc:645
Time m_rifs
Reduced Interframe Space (RIFS) duration.
Definition: mac-low.h:942
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:919
Ptr< WifiPhy > m_phy
Pointer to WifiPhy (actually send/receives frames)
Definition: mac-low.h:893
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.
void SetCompressedBlockAckTimeout(Time blockAckTimeout)
Set Compressed BlockAck timeout of this MacLow.
Definition: mac-low.cc:343
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:956
ChannelAccessManagers m_channelAccessManagers
List of ChannelAccessManager.
Definition: mac-low.h:916
void SendRtsForPacket(void)
Send RTS to begin RTS-CTS-Data-Ack transaction.
Definition: mac-low.cc:1811
BlockAckType
The different block ack policies.
void RxCompleteBufferedPacketsUntilFirstLost(Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2378