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);
96  void SetMac (const Ptr<WifiMac> mac);
108  void SetAddress (Mac48Address ad);
114  void SetAckTimeout (Time ackTimeout);
120  void SetBasicBlockAckTimeout (Time blockAckTimeout);
126  void SetCompressedBlockAckTimeout (Time blockAckTimeout);
132  void SetCtsToSelfSupported (bool enable);
138  void SetCtsTimeout (Time ctsTimeout);
144  void SetSifs (Time sifs);
150  void SetRifs (Time rifs);
156  void SetSlotTime (Time slotTime);
162  void SetPifs (Time pifs);
166  void SetBeaconInterval (Time interval);
170  void SetCfpMaxDuration (Time duration);
176  void SetBssid (Mac48Address ad);
180  void SetPromisc (void);
186  bool GetCtsToSelfSupported (void) const;
192  Mac48Address GetAddress (void) const;
198  Time GetAckTimeout (void) const;
204  Time GetBasicBlockAckTimeout (void) const;
210  Time GetCompressedBlockAckTimeout (void) const;
216  Time GetCtsTimeout (void) const;
222  Time GetSifs (void) const;
228  Time GetSlotTime (void) const;
234  Time GetPifs (void) const;
240  Time GetRifs (void) const;
244  Time GetBeaconInterval (void) const;
248  Time GetCfpMaxDuration (void) const;
252  Time GetRemainingCfpDuration (void) const;
258  Mac48Address GetBssid (void) const;
265  bool IsPromisc (void) const;
266 
273  void SetRxCallback (Callback<void,Ptr<Packet>,const WifiMacHeader *> callback);
278 
294  uint32_t ampduSize, Time ppduDurationLimit);
311  bool IsWithinSizeAndTimeLimits (uint32_t mpduSize, Mac48Address receiver, uint8_t tid,
312  WifiTxVector txVector, uint32_t ampduSize, Time ppduDurationLimit);
323  const WifiMacHeader* hdr,
324  const MacLowTransmissionParameters& parameters) const;
325 
337  const WifiMacHeader* hdr,
338  const MacLowTransmissionParameters& params,
339  uint32_t fragmentSize = 0) const;
340 
350  const MacLowTransmissionParameters& params) const;
351 
360  virtual void StartTransmission (Ptr<WifiMacQueueItem> mpdu,
361  MacLowTransmissionParameters parameters,
362  Ptr<Txop> txop);
363 
373  void ReceiveOk (Ptr<Packet> packet, double rxSnr, WifiTxVector txVector, bool ampduSubframe);
380  void ReceiveError (Ptr<Packet> packet);
388  void NotifySwitchingStartNow (Time duration);
394  void NotifySleepNow (void);
400  void NotifyOffNow (void);
416  void CreateBlockAckAgreement (const MgtAddBaResponseHeader *respHdr,
417  Mac48Address originator,
418  uint16_t startingSeq);
427  void DestroyBlockAckAgreement (Mac48Address originator, uint8_t tid);
435  void RegisterEdcaForAc (AcIndex ac, Ptr<QosTxop> edca);
445  void DeaggregateAmpduAndReceive (Ptr<Packet> aggregatedPacket, double rxSnr, WifiTxVector txVector,
446  std::vector<bool> statusPerMpdu);
447 
463  bool DoNavStartNow (Time duration);
467  virtual bool IsCfPeriod (void) const;
471  bool CanTransmitNextCfFrame (void) const;
472 
485 
491  void SetMsduAggregator (const Ptr<MsduAggregator> aggr);
497  void SetMpduAggregator (const Ptr<MpduAggregator> aggr);
498 
499 private:
504  void CancelAllEvents (void);
510  uint32_t GetCfEndSize (void) const;
517  void ForwardDown (Ptr<const WifiPsdu> psdu, WifiTxVector txVector);
537  WifiTxVector GetCtsTxVector (Mac48Address to, WifiMode rtsTxMode) const;
548  WifiTxVector GetAckTxVector (Mac48Address to, WifiMode dataTxMode) const;
559  WifiTxVector GetBlockAckTxVector (Mac48Address to, WifiMode dataTxMode) const;
589  WifiMode GetControlAnswerMode (WifiMode reqMode) const;
596  Time GetCtsDuration (WifiTxVector ctsTxVector) const;
605  Time GetCtsDuration (Mac48Address to, WifiTxVector rtsTxVector) const;
612  Time GetAckDuration (WifiTxVector ackTxVector) const;
621  Time GetAckDuration (Mac48Address to, WifiTxVector dataTxVector) const;
630  Time GetBlockAckDuration (WifiTxVector blockAckReqTxVector, BlockAckType type) const;
637  bool NeedCtsToSelf (void) const;
638 
645  void NotifyNav (Ptr<const Packet> packet,const WifiMacHeader &hdr);
651  void DoNavResetNow (Time duration);
658  bool IsNavZero (void) const;
664  void NotifyAckTimeoutStartNow (Time duration);
668  void NotifyAckTimeoutResetNow (void);
674  void NotifyCtsTimeoutStartNow (Time duration);
678  void NotifyCtsTimeoutResetNow (void);
685  void NavCounterResetCtsMissed (Time rtsEndRxTime);
686  /* Event handlers */
690  void NormalAckTimeout (void);
694  void BlockAckTimeout (void);
698  void CtsTimeout (void);
702  void CfPollTimeout (void);
706  void SendCtsToSelf (void);
715  void SendCtsAfterRts (Mac48Address source, Time duration, WifiTxVector rtsTxVector, double rtsSnr);
724  void SendAckAfterData (Mac48Address source, Time duration, WifiMode dataTxMode, double dataSnr);
730  void SendDataAfterCts (Time duration);
731 
736  void WaitIfsAfterEndTxFragment (void);
741  void WaitIfsAfterEndTxPacket (void);
742 
746  void EndTxNoAck (void);
750  void SendRtsForPacket (void);
755  void SendDataPacket (void);
762  void StartDataTxTimers (WifiTxVector dataTxVector);
763 
764  void DoDispose (void);
765 
774  void RxCompleteBufferedPacketsWithSmallerSequence (uint16_t seq, Mac48Address originator, uint8_t tid);
787  void RxCompleteBufferedPacketsUntilFirstLost (Mac48Address originator, uint8_t tid);
797  bool ReceiveMpdu (Ptr<Packet> packet, WifiMacHeader hdr);
808  bool StoreMpduIfNeeded (Ptr<Packet> packet, WifiMacHeader hdr);
820  Time duration, WifiMode blockAckReqTxMode, double rxSnr);
831  void SendBlockAckAfterAmpdu (uint8_t tid, Mac48Address originator, Time duration,
832  WifiTxVector blockAckReqTxVector, double rxSnr);
843  void SendBlockAckResponse (const CtrlBAckResponseHeader* blockAck, Mac48Address originator, bool immediate,
844  Time duration, WifiMode blockAckReqTxMode, double rxSnr);
854 
867 
872 
876  struct CfAckInfo
877  {
878  bool appendCfAck;
879  bool expectCfAck;
881  };
882 
886  typedef std::vector<Ptr<ChannelAccessManager> >::const_iterator ChannelAccessManagersCI;
890  typedef std::vector<Ptr<ChannelAccessManager> > ChannelAccessManagers;
892 
895 
905 
919 
922 
925 
929 
930  bool m_promisc;
931 
933 
934  /*
935  * BlockAck data structures.
936  */
937  typedef std::pair<Ptr<Packet>, WifiMacHeader> BufferedPacket;
938  typedef std::list<BufferedPacket>::iterator BufferedPacketI;
939 
940  typedef std::pair<Mac48Address, uint8_t> AgreementKey;
941  typedef std::pair<BlockAckAgreement, std::list<BufferedPacket> > AgreementValue;
942 
943  typedef std::map<AgreementKey, AgreementValue> Agreements;
944  typedef std::map<AgreementKey, AgreementValue>::iterator AgreementsI;
945 
946  typedef std::map<AgreementKey, BlockAckCache> BlockAckCaches;
947  typedef std::map<AgreementKey, BlockAckCache>::iterator BlockAckCachesI;
948 
951 
952  typedef std::map<AcIndex, Ptr<QosTxop> > QueueEdcas;
954 
957 
959 };
960 
961 } //namespace ns3
962 
963 #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:2104
Time GetRifs(void) const
Return Reduced Interframe Space (RIFS) of this MacLow.
Definition: mac-low.cc:435
void SetPifs(Time pifs)
Set PCF Interframe Space (PIFS) of this MacLow.
Definition: mac-low.cc:363
Time m_ctsTimeout
CTS timeout duration.
Definition: mac-low.h:914
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:904
std::vector< Ptr< ChannelAccessManager > >::const_iterator ChannelAccessManagersCI
typedef for an iterator for a list of ChannelAccessManager.
Definition: mac-low.h:886
void ResetBlockAckInactivityTimerIfNeeded(BlockAckAgreement &agreement)
Every time that a block ack request or a packet with ack policy equals to block ack are received...
Definition: mac-low.cc:2539
EventId m_blockAckTimeoutEvent
Block ACK timeout event.
Definition: mac-low.h:897
Time CalculateOverallTxTime(Ptr< const Packet > packet, const WifiMacHeader *hdr, const MacLowTransmissionParameters &params, uint32_t fragmentSize=0) const
Definition: mac-low.cc:1413
Callback template class.
Definition: callback.h:1176
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void ReceiveError(Ptr< Packet > packet)
Definition: mac-low.cc:677
Ptr< MpduAggregator > GetMpduAggregator(void) const
Returns the aggregator used to construct A-MPDU subframes.
Definition: mac-low.cc:289
void SendBlockAckAfterBlockAckRequest(const CtrlBAckRequestHeader reqHdr, Mac48Address originator, Time duration, WifiMode blockAckReqTxMode, double rxSnr)
Invoked after that a block ack request has been received.
Definition: mac-low.cc:2471
void SetPromisc(void)
Enable promiscuous mode.
Definition: mac-low.cc:393
void DoNavResetNow(Time duration)
Reset NAV with the given duration.
Definition: mac-low.cc:1531
Ptr< Txop > m_currentTxop
Current TXOP.
Definition: mac-low.h:907
void SetupPhyMacLowListener(const Ptr< WifiPhy > phy)
Set up WifiPhy listener for this MacLow.
Definition: mac-low.cc:154
Ptr< MsduAggregator > m_msduAggregator
A-MSDU aggregator.
Definition: mac-low.h:893
Time m_pifs
PCF Interframe Space (PIFS) duration.
Definition: mac-low.h:917
void SetPhy(const Ptr< WifiPhy > phy)
Set up WifiPhy associated with this MacLow.
Definition: mac-low.cc:247
bool DoNavStartNow(Time duration)
Start NAV with the given duration.
Definition: mac-low.cc:1543
void SetSifs(Time sifs)
Set Short Interframe Space (SIFS) of this MacLow.
Definition: mac-low.cc:351
std::pair< Mac48Address, uint8_t > AgreementKey
agreement key typedef
Definition: mac-low.h:940
Time CalculateOverheadTxTime(Ptr< const WifiMacQueueItem > item, const MacLowTransmissionParameters &params) const
Definition: mac-low.cc:1435
bool IsNavZero(void) const
Check if NAV is zero.
Definition: mac-low.cc:1944
void NotifyOffNow(void)
This method is typically invoked by the PhyMacLowListener to notify the MAC layer that the device has...
Definition: mac-low.cc:729
void NotifySleepNow(void)
This method is typically invoked by the PhyMacLowListener to notify the MAC layer that the device has...
Definition: mac-low.cc:714
void NotifyNav(Ptr< const Packet > packet, const WifiMacHeader &hdr)
Notify NAV function.
Definition: mac-low.cc:1478
Mac48Address GetBssid(void) const
Return the Basic Service Set Identification.
Definition: mac-low.cc:453
WifiTxVector GetRtsTxVector(Ptr< const WifiMacQueueItem > item) const
Return a TXVECTOR for the RTS frame given the destination.
Definition: mac-low.cc:1197
Mac48Address m_bssid
BSSID address (Mac48Address)
Definition: mac-low.h:910
EventId m_sendCtsEvent
Event to send CTS.
Definition: mac-low.h:899
MacLowRxCallback m_rxCallback
Callback to pass packet up.
Definition: mac-low.h:871
bool appendCfAck
Flag used for PCF to indicate whether a CF-ACK should be appended.
Definition: mac-low.h:878
EventId m_sendAckEvent
Event to send ACK.
Definition: mac-low.h:900
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:1211
void NotifyAckTimeoutResetNow(void)
Notify ChannelAccessManager that ACK timer should be reset.
Definition: mac-low.cc:1570
Time m_cfpMaxDuration
CFP max duration.
Definition: mac-low.h:921
Time CalculateTransmissionTime(Ptr< const Packet > packet, const WifiMacHeader *hdr, const MacLowTransmissionParameters &parameters) const
Definition: mac-low.cc:1463
control how a packet is transmitted.
void SetCtsToSelfSupported(bool enable)
Enable or disable CTS-to-self capability.
Definition: mac-low.cc:333
bool expectCfAck
Flag used for PCF to indicate whether a CF-ACK should be expected.
Definition: mac-low.h:879
QueueEdcas m_edca
EDCA queues.
Definition: mac-low.h:953
void NormalAckTimeout(void)
Event handler when normal ACK timeout occurs.
Definition: mac-low.cc:1707
void SetBasicBlockAckTimeout(Time blockAckTimeout)
Set Basic Block ACK timeout of this MacLow.
Definition: mac-low.cc:321
phy
Definition: third.py:86
BlockAckCaches m_bAckCaches
block ack caches
Definition: mac-low.h:950
Ptr< WifiMac > m_mac
Pointer to WifiMac (to fetch configuration)
Definition: mac-low.h:869
void RemovePhyMacLowListener(Ptr< WifiPhy > phy)
Remove current WifiPhy listener for this MacLow.
Definition: mac-low.cc:161
bool IsPromisc(void) const
Check if MacLow is operating in promiscuous mode.
Definition: mac-low.cc:471
WifiTxVector m_currentTxVector
TXVECTOR used for the current packet transmission.
Definition: mac-low.h:956
void DestroyBlockAckAgreement(Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2275
Time m_lastNavDuration
The duration of the latest NAV.
Definition: mac-low.h:924
void SetCfpMaxDuration(Time duration)
Definition: mac-low.cc:381
Time GetCtsDuration(WifiTxVector ctsTxVector) const
Return the time required to transmit the CTS (including preamble and FCS).
Definition: mac-low.cc:1190
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:620
std::pair< Ptr< Packet >, WifiMacHeader > BufferedPacket
buffered packet typedef
Definition: mac-low.h:937
bool m_ctsToSelfSupported
Flag whether CTS-to-self is supported.
Definition: mac-low.h:955
void SendCtsToSelf(void)
Send CTS for a CTS-to-self mechanism.
Definition: mac-low.cc:1950
void SendAckAfterData(Mac48Address source, Time duration, WifiMode dataTxMode, double dataSnr)
Send ACK after receiving DATA.
Definition: mac-low.cc:2130
Mac48Address GetAddress(void) const
Return the MAC address of this MacLow.
Definition: mac-low.cc:399
virtual void StartTransmission(Ptr< WifiMacQueueItem > mpdu, MacLowTransmissionParameters parameters, Ptr< Txop > txop)
Definition: mac-low.cc:489
void CreateBlockAckAgreement(const MgtAddBaResponseHeader *respHdr, Mac48Address originator, uint16_t startingSeq)
Definition: mac-low.cc:2233
Time m_lastBeacon
The time when the last beacon frame transmission started.
Definition: mac-low.h:927
Time GetCompressedBlockAckTimeout(void) const
Return Compressed Block ACK timeout of this MacLow.
Definition: mac-low.cc:417
Listener for PHY events.
Definition: mac-low.cc:56
void CtsTimeout(void)
Event handler when CTS timeout occurs.
Definition: mac-low.cc:1685
Time GetSifs(void) const
Return Short Interframe Space (SIFS) of this MacLow.
Definition: mac-low.cc:429
void EndTxNoAck(void)
A transmission that does not require an ACK has completed.
Definition: mac-low.cc:2111
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:2432
std::map< AgreementKey, BlockAckCache >::iterator BlockAckCachesI
block ack caches iterator typedef
Definition: mac-low.h:947
virtual bool IsCfPeriod(void) const
This function indicates whether it is the CF period.
Definition: mac-low.cc:2669
void SetAckTimeout(Time ackTimeout)
Set ACK timeout of this MacLow.
Definition: mac-low.cc:315
static TypeId GetTypeId(void)
Register this type.
Definition: mac-low.cc:143
mac
Definition: third.py:92
Time GetCtsTimeout(void) const
Return CTS timeout of this MacLow.
Definition: mac-low.cc:423
void NavCounterResetCtsMissed(Time rtsEndRxTime)
Reset NAV after CTS was missed when the NAV was set with RTS.
Definition: mac-low.cc:1522
Ptr< WifiRemoteStationManager > m_stationManager
Pointer to WifiRemoteStationManager (rate control)
Definition: mac-low.h:870
void SetMac(const Ptr< WifiMac > mac)
Set up WifiMac associated with this MacLow.
Definition: mac-low.cc:271
Headers for Block ack response.
Definition: ctrl-headers.h:193
void SendDataAfterCts(Time duration)
Send DATA after receiving CTS.
Definition: mac-low.cc:2041
void RegisterEdcaForAc(AcIndex ac, Ptr< QosTxop > edca)
Definition: mac-low.cc:2555
Agreements m_bAckAgreements
block ack agreements
Definition: mac-low.h:949
virtual WifiTxVector GetDataTxVector(Ptr< const WifiMacQueueItem > item) const
Return a TXVECTOR for the DATA frame given the destination.
Definition: mac-low.cc:1204
A struct that holds information about ACK piggybacking (CF-ACK).
Definition: mac-low.h:876
void NotifySwitchingStartNow(Time duration)
Definition: mac-low.cc:698
Time GetCfpMaxDuration(void) const
Definition: mac-low.cc:465
Time m_slotTime
Slot duration.
Definition: mac-low.h:916
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:1369
bool m_promisc
Flag if the device is operating in promiscuous mode.
Definition: mac-low.h:930
void CancelAllEvents(void)
Cancel all scheduled events.
Definition: mac-low.cc:195
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:1353
std::list< BufferedPacket >::iterator BufferedPacketI
buffered packet iterator typedef
Definition: mac-low.h:938
void BlockAckTimeout(void)
Event handler when block ACK timeout occurs.
Definition: mac-low.cc:1720
void NotifyCtsTimeoutStartNow(Time duration)
Notify ChannelAccessManager that CTS timer should be started for the given duration.
Definition: mac-low.cc:1579
std::map< AgreementKey, BlockAckCache > BlockAckCaches
block ack caches typedef
Definition: mac-low.h:946
Time GetAckTimeout(void) const
Return ACK timeout of this MacLow.
Definition: mac-low.cc:405
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Time GetRemainingCfpDuration(void) const
Definition: mac-low.cc:2660
void RegisterDcf(Ptr< ChannelAccessManager > dcf)
Definition: mac-low.cc:483
void SetBssid(Mac48Address ad)
Set the Basic Service Set Identification.
Definition: mac-low.cc:387
Time GetBasicBlockAckTimeout(void) const
Return Basic Block ACK timeout of this MacLow.
Definition: mac-low.cc:411
EventId m_waitIfsEvent
Wait for IFS event.
Definition: mac-low.h:902
void ReceiveOk(Ptr< Packet > packet, double rxSnr, WifiTxVector txVector, bool ampduSubframe)
Definition: mac-low.cc:744
EventId m_normalAckTimeoutEvent
Normal ACK timeout event.
Definition: mac-low.h:896
void StartDataTxTimers(WifiTxVector dataTxVector)
Start a DATA timer by scheduling appropriate ACK timeout.
Definition: mac-low.cc:1783
Time m_beaconInterval
Expected interval between two beacon transmissions.
Definition: mac-low.h:920
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:928
Callback< void, Ptr< Packet >, const WifiMacHeader * > MacLowRxCallback
typedef for a callback for MacLowRx
Definition: mac-low.h:66
void SendBlockAckResponse(const CtrlBAckResponseHeader *blockAck, Mac48Address originator, bool immediate, Time duration, WifiMode blockAckReqTxMode, double rxSnr)
This method creates block ack frame with header equals to blockAck and start its transmission.
Definition: mac-low.cc:2384
Time GetAckDuration(WifiTxVector ackTxVector) const
Return the time required to transmit the ACK (including preamble and FCS).
Definition: mac-low.cc:1166
Time m_ackTimeout
ACK timeout duration.
Definition: mac-low.h:911
EventId m_ctsTimeoutEvent
CTS timeout event.
Definition: mac-low.h:898
void RxCompleteBufferedPacketsWithSmallerSequence(uint16_t seq, Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2291
void SendCtsAfterRts(Mac48Address source, Time duration, WifiTxVector rtsTxVector, double rtsSnr)
Send CTS after receiving RTS.
Definition: mac-low.cc:2011
Ptr< MsduAggregator > GetMsduAggregator(void) const
Returns the aggregator used to construct A-MSDU subframes.
Definition: mac-low.cc:283
Time m_basicBlockAckTimeout
Basic block ACK timeout duration.
Definition: mac-low.h:912
bool GetCtsToSelfSupported(void) const
Return whether CTS-to-self capability is supported.
Definition: mac-low.cc:339
Time m_sifs
Short Interframe Space (SIFS) duration.
Definition: mac-low.h:915
void SetBeaconInterval(Time interval)
Definition: mac-low.cc:375
Time m_lastNavStart
The time when the latest NAV started.
Definition: mac-low.h:923
std::map< AgreementKey, AgreementValue > Agreements
agreements
Definition: mac-low.h:943
handle RTS/CTS/DATA/ACK transactions.
Definition: mac-low.h:59
Mac48Address address
Address of the station to be acknowledged.
Definition: mac-low.h:880
EventId m_sendDataEvent
Event to send DATA.
Definition: mac-low.h:901
bool ReceiveMpdu(Ptr< Packet > packet, WifiMacHeader hdr)
Definition: mac-low.cc:2160
MacLowTransmissionParameters m_txParams
Transmission parameters of the current packet.
Definition: mac-low.h:908
void SetRifs(Time rifs)
Set Reduced Interframe Space (RIFS) of this MacLow.
Definition: mac-low.cc:369
void DoDispose(void)
Destructor implementation.
Definition: mac-low.cc:172
void SetMsduAggregator(const Ptr< MsduAggregator > aggr)
Set the aggregator used to construct A-MSDU subframes.
Definition: mac-low.cc:295
WifiTxVector GetAckTxVectorForData(Mac48Address to, WifiMode dataTxMode) const
Return a TXVECTOR for the Block ACK frame given the destination and the mode of the DATA used by the ...
Definition: mac-low.cc:1407
std::map< AcIndex, Ptr< QosTxop > > QueueEdcas
EDCA queues typedef.
Definition: mac-low.h:952
Mac48Address m_self
Address of this MacLow (Mac48Address)
Definition: mac-low.h:909
Maintains information for a block ack agreement.
WifiTxVector GetBlockAckTxVector(Mac48Address to, WifiMode dataTxMode) const
Return a TXVECTOR for the Block ACK frame given the destination and the mode of the DATA used by the ...
Definition: mac-low.cc:1385
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:1561
bool CanTransmitNextCfFrame(void) const
This function decides if a CF frame can be transmitted in the current CFP.
Definition: mac-low.cc:2675
void SetSlotTime(Time slotTime)
Set slot duration of this MacLow.
Definition: mac-low.cc:357
Implement the header for management frames of type add block ack response.
Definition: mgt-headers.h:1129
Time m_cfpStart
The time when the latest CF period started.
Definition: mac-low.h:926
std::map< AgreementKey, AgreementValue >::iterator AgreementsI
agreements iterator
Definition: mac-low.h:944
EventId m_endTxNoAckEvent
Event for finishing transmission that does not require ACK.
Definition: mac-low.h:903
Time GetBlockAckDuration(WifiTxVector blockAckReqTxVector, BlockAckType type) const
Return the time required to transmit the Block ACK to the specified address given the TXVECTOR of the...
Definition: mac-low.cc:1173
CfAckInfo m_cfAckInfo
Info about piggyback ACKs used in PCF.
Definition: mac-low.h:958
void SetMpduAggregator(const Ptr< MpduAggregator > aggr)
Set the aggregator used to construct A-MPDU subframes.
Definition: mac-low.cc:302
void SetCtsTimeout(Time ctsTimeout)
Set CTS timeout of this MacLow.
Definition: mac-low.cc:345
void SendDataPacket(void)
Send DATA packet, which can be DATA-ACK or RTS-CTS-DATA-ACK transaction.
Definition: mac-low.cc:1845
void DeaggregateAmpduAndReceive(Ptr< Packet > aggregatedPacket, double rxSnr, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
Definition: mac-low.cc:2561
Time GetPifs(void) const
Return PCF Interframe Space (PIFS) of this MacLow.
Definition: mac-low.cc:447
void SetAddress(Mac48Address ad)
Set MAC address of this MacLow.
Definition: mac-low.cc:309
uint32_t GetCfEndSize(void) const
Return the total CF-END size (including FCS trailer).
Definition: mac-low.cc:1144
void ForwardDown(Ptr< const WifiPsdu > psdu, WifiTxVector txVector)
Forward a PSDU down to WifiPhy for transmission.
Definition: mac-low.cc:1597
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:2097
Time GetBeaconInterval(void) const
Definition: mac-low.cc:459
Time m_compressedBlockAckTimeout
Compressed block ACK timeout duration.
Definition: mac-low.h:913
void CfPollTimeout(void)
Event handler when CF-POLL timeout occurs.
Definition: mac-low.cc:1667
void NotifyCtsTimeoutResetNow(void)
Notify ChannelAccessManager that CTS timer should be reset.
Definition: mac-low.cc:1588
Headers for Block ack request.
Definition: ctrl-headers.h:41
Ptr< WifiPsdu > m_currentPacket
Current packet transmitted/to be transmitted.
Definition: mac-low.h:906
void ResetPhy(void)
Remove WifiPhy associated with this MacLow.
Definition: mac-low.cc:262
std::pair< BlockAckAgreement, std::list< BufferedPacket > > AgreementValue
agreement value typedef
Definition: mac-low.h:941
Time GetSlotTime(void) const
Return slot duration of this MacLow.
Definition: mac-low.cc:441
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:1401
a unique identifier for an interface.
Definition: type-id.h:58
void SetRxCallback(Callback< void, Ptr< Packet >, const WifiMacHeader *> callback)
Definition: mac-low.cc:477
std::vector< Ptr< ChannelAccessManager > > ChannelAccessManagers
typedef for a list of ChannelAccessManager.
Definition: mac-low.h:890
bool NeedCtsToSelf(void) const
Check if CTS-to-self mechanism should be used for the current packet.
Definition: mac-low.cc:613
Time m_rifs
Reduced Interframe Space (RIFS) duration.
Definition: mac-low.h:918
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:38
bool StoreMpduIfNeeded(Ptr< Packet > packet, WifiMacHeader hdr)
Definition: mac-low.cc:2204
virtual ~MacLow()
Definition: mac-low.cc:136
Ptr< MpduAggregator > m_mpduAggregator
A-MPDU aggregator.
Definition: mac-low.h:894
Ptr< WifiPhy > m_phy
Pointer to WifiPhy (actually send/receives frames)
Definition: mac-low.h:868
void SetWifiRemoteStationManager(const Ptr< WifiRemoteStationManager > manager)
Set up WifiRemoteStationManager associated with this MacLow.
Definition: mac-low.cc:277
Implements the IEEE 802.11 MAC header.
void SetCompressedBlockAckTimeout(Time blockAckTimeout)
Set Compressed Block ACK timeout of this MacLow.
Definition: mac-low.cc:327
Ptr< WifiPhy > GetPhy(void) const
Definition: mac-low.cc:256
class PhyMacLowListener * m_phyMacLowListener
Listener needed to monitor when a channel switching occurs.
Definition: mac-low.h:932
ChannelAccessManagers m_channelAccessManagers
List of ChannelAccessManager.
Definition: mac-low.h:891
void SendRtsForPacket(void)
Send RTS to begin RTS-CTS-DATA-ACK transaction.
Definition: mac-low.cc:1730
BlockAckType
The different block ACK policies.
void RxCompleteBufferedPacketsUntilFirstLost(Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2354