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 "wifi-phy.h"
27 #include "dcf-manager.h"
29 #include "block-ack-agreement.h"
30 #include "qos-utils.h"
31 #include "block-ack-cache.h"
32 #include "mpdu-aggregator.h"
33 #include "msdu-aggregator.h"
35 
38 
39 namespace ns3 {
40 
41 class DcaTxop;
42 class EdcaTxopN;
43 class DcfManager;
44 class WifiMacQueueItem;
45 class WifiMacQueue;
46 
51 class MacLow : public Object
52 {
53 public:
55  friend class ::TwoLevelAggregationTest;
57  friend class ::AmpduAggregationTest;
62 
63  MacLow ();
64  virtual ~MacLow ();
65 
70  static TypeId GetTypeId (void);
71 
77  void SetPhy (const Ptr<WifiPhy> phy);
81  Ptr<WifiPhy> GetPhy (void) const;
85  void ResetPhy (void);
97  void SetAddress (Mac48Address ad);
103  void SetAckTimeout (Time ackTimeout);
109  void SetBasicBlockAckTimeout (Time blockAckTimeout);
115  void SetCompressedBlockAckTimeout (Time blockAckTimeout);
121  void SetCtsToSelfSupported (bool enable);
127  void SetCtsTimeout (Time ctsTimeout);
133  void SetSifs (Time sifs);
139  void SetRifs (Time rifs);
145  void SetSlotTime (Time slotTime);
151  void SetPifs (Time pifs);
157  void SetBssid (Mac48Address ad);
161  void SetPromisc (void);
167  bool GetCtsToSelfSupported () const;
173  Mac48Address GetAddress (void) const;
179  Time GetAckTimeout (void) const;
185  Time GetBasicBlockAckTimeout () const;
197  Time GetCtsTimeout (void) const;
203  Time GetSifs (void) const;
209  Time GetSlotTime (void) const;
215  Time GetPifs (void) const;
221  Time GetRifs (void) const;
227  Mac48Address GetBssid (void) const;
234  bool IsPromisc (void) const;
235 
242  void SetRxCallback (Callback<void,Ptr<Packet>,const WifiMacHeader *> callback);
246  void RegisterDcf (Ptr<DcfManager> dcf);
247 
258  const WifiMacHeader* hdr,
259  const MacLowTransmissionParameters& parameters) const;
260 
272  const WifiMacHeader* hdr,
273  const MacLowTransmissionParameters& params,
274  uint32_t fragmentSize = 0) const;
275 
285  virtual void StartTransmission (Ptr<const Packet> packet,
286  const WifiMacHeader* hdr,
287  MacLowTransmissionParameters parameters,
288  Ptr<DcaTxop> dca);
289 
299  void ReceiveOk (Ptr<Packet> packet, double rxSnr, WifiTxVector txVector, bool ampduSubframe);
307  void ReceiveError (Ptr<Packet> packet, double rxSnr);
315  void NotifySwitchingStartNow (Time duration);
321  void NotifySleepNow (void);
327  void NotifyOffNow (void);
343  void CreateBlockAckAgreement (const MgtAddBaResponseHeader *respHdr,
344  Mac48Address originator,
345  uint16_t startingSeq);
354  void DestroyBlockAckAgreement (Mac48Address originator, uint8_t tid);
362  void RegisterEdcaForAc (AcIndex ac, Ptr<EdcaTxopN> edca);
380  void DeaggregateAmpduAndReceive (Ptr<Packet> aggregatedPacket, double rxSnr, WifiTxVector txVector);
391  bool StopMpduAggregation (Ptr<const Packet> peekedPacket, WifiMacHeader peekedHdr, Ptr<Packet> aggregatedPacket, uint16_t size) const;
398  void FlushAggregateQueue (uint8_t tid);
399 
409  virtual WifiTxVector GetDataTxVector (Ptr<const Packet> packet, const WifiMacHeader *hdr) const;
410 
411 
412 private:
417  void CancelAllEvents (void);
425  void ForwardDown (Ptr<const Packet> packet, const WifiMacHeader *hdr, WifiTxVector txVector);
433  void SendMpdu (Ptr<const Packet> packet, WifiTxVector txVector, MpduType mpdutype);
443  WifiTxVector GetRtsTxVector (Ptr<const Packet> packet, const WifiMacHeader *hdr) const;
454  WifiTxVector GetCtsTxVector (Mac48Address to, WifiMode rtsTxMode) const;
465  WifiTxVector GetAckTxVector (Mac48Address to, WifiMode dataTxMode) const;
476  WifiTxVector GetBlockAckTxVector (Mac48Address to, WifiMode dataTxMode) const;
505  Time GetCtsDuration (WifiTxVector ctsTxVector) const;
514  Time GetCtsDuration (Mac48Address to, WifiTxVector rtsTxVector) const;
521  Time GetAckDuration (WifiTxVector ackTxVector) const;
530  Time GetAckDuration (Mac48Address to, WifiTxVector dataTxVector) const;
539  Time GetBlockAckDuration (WifiTxVector blockAckReqTxVector, BlockAckType type) const;
546  bool NeedRts (void) const;
553  bool NeedCtsToSelf (void) const;
554 
561  void NotifyNav (Ptr<const Packet> packet,const WifiMacHeader &hdr);
567  void DoNavResetNow (Time duration);
574  bool DoNavStartNow (Time duration);
581  bool IsNavZero (void) const;
587  void NotifyAckTimeoutStartNow (Time duration);
591  void NotifyAckTimeoutResetNow ();
597  void NotifyCtsTimeoutStartNow (Time duration);
601  void NotifyCtsTimeoutResetNow ();
608  void NavCounterResetCtsMissed (Time rtsEndRxTime);
609  /* Event handlers */
613  void NormalAckTimeout (void);
617  void FastAckTimeout (void);
621  void SuperFastAckTimeout (void);
625  void FastAckFailedTimeout (void);
629  void BlockAckTimeout (void);
633  void CtsTimeout (void);
637  void SendCtsToSelf (void);
646  void SendCtsAfterRts (Mac48Address source, Time duration, WifiTxVector rtsTxVector, double rtsSnr);
655  void SendAckAfterData (Mac48Address source, Time duration, WifiMode dataTxMode, double dataSnr);
661  void SendDataAfterCts (Time duration);
662 
667  void WaitIfsAfterEndTxFragment (void);
672  void WaitIfsAfterEndTxPacket (void);
673 
677  void EndTxNoAck (void);
681  void SendRtsForPacket (void);
686  void SendDataPacket (void);
693  void StartDataTxTimers (WifiTxVector dataTxVector);
694 
695  void DoDispose (void);
696 
705  void RxCompleteBufferedPacketsWithSmallerSequence (uint16_t seq, Mac48Address originator, uint8_t tid);
718  void RxCompleteBufferedPacketsUntilFirstLost (Mac48Address originator, uint8_t tid);
728  bool ReceiveMpdu (Ptr<Packet> packet, WifiMacHeader hdr);
739  bool StoreMpduIfNeeded (Ptr<Packet> packet, WifiMacHeader hdr);
751  Time duration, WifiMode blockAckReqTxMode, double rxSnr);
762  void SendBlockAckAfterAmpdu (uint8_t tid, Mac48Address originator,
763  Time duration, WifiTxVector blockAckReqTxVector, double rxSnr);
774  void SendBlockAckResponse (const CtrlBAckResponseHeader* blockAck, Mac48Address originator, bool immediate,
775  Time duration, WifiMode blockAckReqTxMode, double rxSnr);
785 
805  bool IsAmpdu (Ptr<const Packet> packet, const WifiMacHeader hdr);
815  void InsertInTxQueue (Ptr<const Packet> packet, const WifiMacHeader &hdr, Time tStamp, uint8_t tid);
827  Ptr<Packet> PerformMsduAggregation (Ptr<const Packet> packet, WifiMacHeader *hdr, Time *tstamp, Ptr<Packet> currentAmpduPacket, uint16_t blockAckSize);
828 
831  MacLowRxCallback m_rxCallback;
832 
836  struct Item
837  {
841  };
842 
846  typedef std::vector<Ptr<DcfManager> >::const_iterator DcfManagersCI;
850  typedef std::vector<Ptr<DcfManager> > DcfManagers;
851  DcfManagers m_dcfManagers;
852 
865 
881 
884 
885  bool m_promisc;
886  bool m_ampdu;
887 
889 
890  /*
891  * BlockAck data structures.
892  */
893  typedef std::pair<Ptr<Packet>, WifiMacHeader> BufferedPacket;
894  typedef std::list<BufferedPacket>::iterator BufferedPacketI;
895 
896  typedef std::pair<Mac48Address, uint8_t> AgreementKey;
897  typedef std::pair<BlockAckAgreement, std::list<BufferedPacket> > AgreementValue;
898 
899  typedef std::map<AgreementKey, AgreementValue> Agreements;
900  typedef std::map<AgreementKey, AgreementValue>::iterator AgreementsI;
901 
902  typedef std::map<AgreementKey, BlockAckCache> BlockAckCaches;
903  typedef std::map<AgreementKey, BlockAckCache>::iterator BlockAckCachesI;
904 
905  Agreements m_bAckAgreements;
906  BlockAckCaches m_bAckCaches;
907 
908  typedef std::map<AcIndex, Ptr<EdcaTxopN> > QueueEdcas;
909  QueueEdcas m_edca;
910 
913  std::vector<Item> m_txPackets[8];
915 };
916 
917 } //namespace ns3
918 
919 #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:1846
Time GetPifs(void) const
Return PCF Interframe Space (PIFS) of this MacLow.
Definition: mac-low.cc:415
void SetPifs(Time pifs)
Set PCF Interframe Space (PIFS) of this MacLow.
Definition: mac-low.cc:341
Time m_ctsTimeout
CTS timeout duration.
Definition: mac-low.h:876
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:864
Ptr< WifiPhy > GetPhy(void) const
Definition: mac-low.cc:266
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:2282
EventId m_blockAckTimeoutEvent
Block ACK timeout event.
Definition: mac-low.h:857
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...
std::vector< Item > m_txPackets[8]
Contain temporary items to be sent with the next A-MPDU transmission for a given TID, once RTS/CTS exchange has succeeded.
Definition: mac-low.h:913
Time GetAckDuration(WifiTxVector ackTxVector) const
Return the time required to transmit the ACK (including preamble and FCS).
Definition: mac-low.cc:1016
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:2218
virtual void StartTransmission(Ptr< const Packet > packet, const WifiMacHeader *hdr, MacLowTransmissionParameters parameters, Ptr< DcaTxop > dca)
Definition: mac-low.cc:461
void SetPromisc(void)
Enable promiscuous mode.
Definition: mac-low.cc:359
void DoNavResetNow(Time duration)
Reset NAV with the given duration.
Definition: mac-low.cc:1191
bool IsPromisc(void) const
Check if MacLow is operating in promiscuous mode.
Definition: mac-low.cc:427
void SetupPhyMacLowListener(const Ptr< WifiPhy > phy)
Set up WifiPhy listener for this MacLow.
Definition: mac-low.cc:143
EventId m_fastAckTimeoutEvent
Fast ACK timeout event.
Definition: mac-low.h:854
Time m_pifs
PCF Interframe Space (PIFS) duration.
Definition: mac-low.h:879
void SetPhy(const Ptr< WifiPhy > phy)
Set up WifiPhy associated with this MacLow.
Definition: mac-low.cc:257
void FastAckFailedTimeout(void)
Event handler when fast ACK timeout occurs (busy).
Definition: mac-low.cc:1862
bool DoNavStartNow(Time duration)
Start NAV with the given duration.
Definition: mac-low.cc:1202
Mac48Address GetBssid(void) const
Return the Basic Service Set Identification.
Definition: mac-low.cc:421
void SetSifs(Time sifs)
Set Short Interframe Space (SIFS) of this MacLow.
Definition: mac-low.cc:329
void ForwardDown(Ptr< const Packet > packet, const WifiMacHeader *hdr, WifiTxVector txVector)
Forward the packet down to WifiPhy for transmission.
Definition: mac-low.cc:1256
Ptr< DcaTxop > m_currentDca
Current DCA.
Definition: mac-low.h:868
std::pair< Mac48Address, uint8_t > AgreementKey
agreement key typedef
Definition: mac-low.h:896
Time CalculateOverallTxTime(Ptr< const Packet > packet, const WifiMacHeader *hdr, const MacLowTransmissionParameters &params, uint32_t fragmentSize=0) const
Definition: mac-low.cc:1091
void NotifyOffNow(void)
This method is typically invoked by the PhyMacLowListener to notify the MAC layer that the device has...
Definition: mac-low.cc:649
void NotifySleepNow(void)
This method is typically invoked by the PhyMacLowListener to notify the MAC layer that the device has...
Definition: mac-low.cc:634
void NotifyNav(Ptr< const Packet > packet, const WifiMacHeader &hdr)
Notify NAV function.
Definition: mac-low.cc:1140
bool m_ampdu
Flag if the current transmission involves an A-MPDU.
Definition: mac-low.h:886
void SetRxCallback(Callback< void, Ptr< Packet >, const WifiMacHeader * > callback)
Definition: mac-low.cc:433
std::map< AcIndex, Ptr< EdcaTxopN > > QueueEdcas
EDCA queues typedef.
Definition: mac-low.h:908
Time GetCompressedBlockAckTimeout() const
Return Compressed Block ACK timeout of this MacLow.
Definition: mac-low.cc:383
Mac48Address m_bssid
BSSID address (Mac48Address)
Definition: mac-low.h:872
BlockAckType
Enumeration for different block ACK policies.
Definition: ctrl-headers.h:31
Ptr< Packet > AggregateToAmpdu(Ptr< const Packet > packet, const WifiMacHeader hdr)
Definition: mac-low.cc:2428
EventId m_sendCtsEvent
Event to send CTS.
Definition: mac-low.h:859
MacLowRxCallback m_rxCallback
Callback to pass packet up.
Definition: mac-low.h:831
Time GetCtsTimeout(void) const
Return CTS timeout of this MacLow.
Definition: mac-low.cc:389
EventId m_superFastAckTimeoutEvent
Super fast ACK timeout event.
Definition: mac-low.h:855
void DeaggregateAmpduAndReceive(Ptr< Packet > aggregatedPacket, double rxSnr, WifiTxVector txVector)
Definition: mac-low.cc:2304
EventId m_sendAckEvent
Event to send ACK.
Definition: mac-low.h:860
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:97
Time GetCtsDuration(WifiTxVector ctsTxVector) const
Return the time required to transmit the CTS (including preamble and FCS).
Definition: mac-low.cc:1040
Ptr< Packet > PerformMsduAggregation(Ptr< const Packet > packet, WifiMacHeader *hdr, Time *tstamp, Ptr< Packet > currentAmpduPacket, uint16_t blockAckSize)
Perform MSDU aggregation for a given MPDU in an A-MPDU.
Definition: mac-low.cc:2760
control how a packet is transmitted.
void SetCtsToSelfSupported(bool enable)
Enable or disable CTS-to-self capability.
Definition: mac-low.cc:311
QueueEdcas m_edca
EDCA queues.
Definition: mac-low.h:909
void NormalAckTimeout(void)
Event handler when normal ACK timeout occurs.
Definition: mac-low.cc:1383
void SetBasicBlockAckTimeout(Time blockAckTimeout)
Set Basic Block ACK timeout of this MacLow.
Definition: mac-low.cc:299
BlockAckCaches m_bAckCaches
block ack caches
Definition: mac-low.h:906
Time timestamp
the timestamp
Definition: mac-low.h:840
void RemovePhyMacLowListener(Ptr< WifiPhy > phy)
Remove current WifiPhy listener for this MacLow.
Definition: mac-low.cc:150
WifiTxVector m_currentTxVector
TXVECTOR used for the current packet transmission.
Definition: mac-low.h:914
void DestroyBlockAckAgreement(Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2019
Time m_lastNavDuration
The duration of the latest NAV.
Definition: mac-low.h:883
DcfManagers m_dcfManagers
List of DcfManager.
Definition: mac-low.h:851
std::pair< Ptr< Packet >, WifiMacHeader > BufferedPacket
buffered packet typedef
Definition: mac-low.h:893
bool m_ctsToSelfSupported
Flag whether CTS-to-self is supported.
Definition: mac-low.h:911
void SendCtsToSelf(void)
Send CTS for a CTS-to-self mechanism.
Definition: mac-low.cc:1652
tuple phy
Definition: third.py:86
void SendAckAfterData(Mac48Address source, Time duration, WifiMode dataTxMode, double dataSnr)
Send ACK after receiving DATA.
Definition: mac-low.cc:1872
void CreateBlockAckAgreement(const MgtAddBaResponseHeader *respHdr, Mac48Address originator, uint16_t startingSeq)
Definition: mac-low.cc:1977
std::vector< Ptr< DcfManager > > DcfManagers
typedef for a list of DcfManager.
Definition: mac-low.h:850
Listener for PHY events.
Definition: mac-low.cc:43
void CtsTimeout(void)
Event handler when CTS timeout occurs.
Definition: mac-low.cc:1368
void EndTxNoAck(void)
A transmission that does not require an ACK has completed.
Definition: mac-low.cc:1853
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:2188
std::map< AgreementKey, BlockAckCache >::iterator BlockAckCachesI
block ack caches iterator typedef
Definition: mac-low.h:903
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:1067
void SetAckTimeout(Time ackTimeout)
Set ACK timeout of this MacLow.
Definition: mac-low.cc:293
static TypeId GetTypeId(void)
Register this type.
Definition: mac-low.cc:132
Time GetRifs(void) const
Return Reduced Interframe Space (RIFS) of this MacLow.
Definition: mac-low.cc:402
void NavCounterResetCtsMissed(Time rtsEndRxTime)
Reset NAV after CTS was missed when the NAV was setted with RTS.
Definition: mac-low.cc:1182
Ptr< WifiRemoteStationManager > m_stationManager
Pointer to WifiRemoteStationManager (rate control)
Definition: mac-low.h:830
Headers for Block ack response.
Definition: ctrl-headers.h:190
Mac48Address GetAddress(void) const
Return the MAC address of this MacLow.
Definition: mac-low.cc:365
void SendDataAfterCts(Time duration)
Send DATA after receiving CTS.
Definition: mac-low.cc:1753
Agreements m_bAckAgreements
block ack agreements
Definition: mac-low.h:905
Ptr< WifiMacQueue > m_aggregateQueue[8]
Queues per TID used for MPDU aggregation.
Definition: mac-low.h:912
void SendMpdu(Ptr< const Packet > packet, WifiTxVector txVector, MpduType mpdutype)
Forward the MPDU down to WifiPhy for transmission.
Definition: mac-low.cc:1361
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:1085
void NotifySwitchingStartNow(Time duration)
Definition: mac-low.cc:618
Time m_slotTime
Slot duration.
Definition: mac-low.h:878
bool m_promisc
Flag if the device is operating in promiscuous mode.
Definition: mac-low.h:885
WifiMacHeader hdr
the header
Definition: mac-low.h:839
void CancelAllEvents(void)
Cancel all scheduled events.
Definition: mac-low.cc:190
std::list< BufferedPacket >::iterator BufferedPacketI
buffered packet iterator typedef
Definition: mac-low.h:894
void BlockAckTimeout(void)
Event handler when block ACK timeout occurs.
Definition: mac-low.cc:1420
void NotifyCtsTimeoutStartNow(Time duration)
Notify DcfManagerthat CTS timer should be started for the given duration.
Definition: mac-low.cc:1238
std::map< AgreementKey, BlockAckCache > BlockAckCaches
block ack caches typedef
Definition: mac-low.h:902
void RegisterDcf(Ptr< DcfManager > dcf)
Definition: mac-low.cc:439
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SuperFastAckTimeout(void)
Event handler when super fast ACK timeout occurs.
Definition: mac-low.cc:1434
void SetBssid(Mac48Address ad)
Set the Basic Service Set Identification.
Definition: mac-low.cc:353
EventId m_waitIfsEvent
Wait for IFS event.
Definition: mac-low.h:862
void ReceiveOk(Ptr< Packet > packet, double rxSnr, WifiTxVector txVector, bool ampduSubframe)
Definition: mac-low.cc:664
Time CalculateTransmissionTime(Ptr< const Packet > packet, const WifiMacHeader *hdr, const MacLowTransmissionParameters &parameters) const
Definition: mac-low.cc:1125
EventId m_normalAckTimeoutEvent
Normal ACK timeout event.
Definition: mac-low.h:853
void StartDataTxTimers(WifiTxVector dataTxVector)
Start a DATA timer by scheduling appropriate ACK timeout.
Definition: mac-low.cc:1515
void NotifyCtsTimeoutResetNow()
Notify DcfManager that CTS timer should be resetted.
Definition: mac-low.cc:1247
an EUI-48 address
Definition: mac48-address.h:43
Ptr< const Packet > packet
the packet
Definition: mac-low.h:838
Callback< void, Ptr< Packet >, const WifiMacHeader * > MacLowRxCallback
typedef for a callback for MacLowRx
Definition: mac-low.h:61
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:2127
Time m_ackTimeout
ACK timeout duration.
Definition: mac-low.h:873
bool NeedRts(void) const
Check if the current packet should be sent with a RTS protection.
Definition: mac-low.cc:589
void FastAckTimeout(void)
Event handler when fast ACK timeout occurs (idle).
Definition: mac-low.cc:1402
EventId m_ctsTimeoutEvent
CTS timeout event.
Definition: mac-low.h:858
void RxCompleteBufferedPacketsWithSmallerSequence(uint16_t seq, Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2035
void SendCtsAfterRts(Mac48Address source, Time duration, WifiTxVector rtsTxVector, double rtsSnr)
Send CTS after receiving RTS.
Definition: mac-low.cc:1721
Time m_basicBlockAckTimeout
Basic block ACK timeout duration.
Definition: mac-low.h:874
void FlushAggregateQueue(uint8_t tid)
This function is called to flush the aggregate queue, which is used for A-MPDU.
Definition: mac-low.cc:2738
Two Level Aggregation Test.
Time m_sifs
Short Interframe Space (SIFS) duration.
Definition: mac-low.h:877
Time GetSlotTime(void) const
Return slot duration of this MacLow.
Definition: mac-low.cc:409
Ampdu Aggregation Test.
WifiMacHeader m_lastReceivedHdr
Header of the last received packet.
Definition: mac-low.h:869
Time m_lastNavStart
The time when the latest NAV started.
Definition: mac-low.h:882
void ReceiveError(Ptr< Packet > packet, double rxSnr)
Definition: mac-low.cc:604
WifiTxVector GetRtsTxVector(Ptr< const Packet > packet, const WifiMacHeader *hdr) const
Return a TXVECTOR for the RTS frame given the destination.
Definition: mac-low.cc:1047
std::map< AgreementKey, AgreementValue > Agreements
agreements
Definition: mac-low.h:899
virtual WifiTxVector GetDataTxVector(Ptr< const Packet > packet, const WifiMacHeader *hdr) const
Return a TXVECTOR for the DATA frame given the destination.
Definition: mac-low.cc:1054
handle RTS/CTS/DATA/ACK transactions.
Definition: mac-low.h:51
std::vector< Ptr< DcfManager > >::const_iterator DcfManagersCI
typedef for an iterator for a list of DcfManager.
Definition: mac-low.h:846
EventId m_sendDataEvent
Event to send DATA.
Definition: mac-low.h:861
bool ReceiveMpdu(Ptr< Packet > packet, WifiMacHeader hdr)
Definition: mac-low.cc:1904
MacLowTransmissionParameters m_txParams
Transmission parameters of the current packet.
Definition: mac-low.h:870
void SetRifs(Time rifs)
Set Reduced Interframe Space (RIFS) of this MacLow.
Definition: mac-low.cc:347
void DoDispose(void)
Destructor implementation.
Definition: mac-low.cc:161
void NotifyAckTimeoutResetNow()
Notify DcfManager that ACK timer should be resetted.
Definition: mac-low.cc:1229
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:1073
Mac48Address m_self
Address of this MacLow (Mac48Address)
Definition: mac-low.h:871
Maintains information for a block ack agreement.
An identifier for simulation events.
Definition: event-id.h:53
EventId m_fastAckFailedTimeoutEvent
Fast ACK failed timeout event.
Definition: mac-low.h:856
bool IsNavZero(void) const
Check if NAV is zero.
Definition: mac-low.cc:1646
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:1023
void NotifyAckTimeoutStartNow(Time duration)
Notify DcfManager that ACK timer should be started for the given duration.
Definition: mac-low.cc:1220
void SetSlotTime(Time slotTime)
Set slot duration of this MacLow.
Definition: mac-low.cc:335
Ptr< Packet > m_currentPacket
Current packet transmitted/to be transmitted.
Definition: mac-low.h:866
Time GetSifs(void) const
Return Short Interframe Space (SIFS) of this MacLow.
Definition: mac-low.cc:395
bool NeedCtsToSelf(void) const
Check if CTS-to-self mechanism should be used for the current packet.
Definition: mac-low.cc:597
bool StopMpduAggregation(Ptr< const Packet > peekedPacket, WifiMacHeader peekedHdr, Ptr< Packet > aggregatedPacket, uint16_t size) const
Definition: mac-low.cc:2393
Implement the header for management frames of type add block ack response.
Definition: mgt-headers.h:1115
std::map< AgreementKey, AgreementValue >::iterator AgreementsI
agreements iterator
Definition: mac-low.h:900
EventId m_endTxNoAckEvent
Event for finishing transmission that does not require ACK.
Definition: mac-low.h:863
bool GetCtsToSelfSupported() const
Return whether CTS-to-self capability is supported.
Definition: mac-low.cc:317
void SetCtsTimeout(Time ctsTimeout)
Set CTS timeout of this MacLow.
Definition: mac-low.cc:323
Time GetAckTimeout(void) const
Return ACK timeout of this MacLow.
Definition: mac-low.cc:371
void SendDataPacket(void)
Send DATA packet, which can be DATA-ACK or RTS-CTS-DATA-ACK transaction.
Definition: mac-low.cc:1589
WifiMacHeader m_currentHdr
Header of the current transmitted packet.
Definition: mac-low.h:867
void SetAddress(Mac48Address ad)
Set MAC address of this MacLow.
Definition: mac-low.cc:287
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:1839
Time m_compressedBlockAckTimeout
Compressed block ACK timeout duration.
Definition: mac-low.h:875
Headers for Block ack request.
Definition: ctrl-headers.h:50
bool IsAmpdu(Ptr< const Packet > packet, const WifiMacHeader hdr)
Checks if the given packet will be aggregated to an A-MPDU or not.
Definition: mac-low.cc:445
void InsertInTxQueue(Ptr< const Packet > packet, const WifiMacHeader &hdr, Time tStamp, uint8_t tid)
Insert in a temporary queue.
Definition: mac-low.cc:2749
void ResetPhy(void)
Remove WifiPhy associated with this MacLow.
Definition: mac-low.cc:272
std::pair< BlockAckAgreement, std::list< BufferedPacket > > AgreementValue
agreement value typedef
Definition: mac-low.h:897
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:1079
Time GetBasicBlockAckTimeout() const
Return Basic Block ACK timeout of this MacLow.
Definition: mac-low.cc:377
a unique identifier for an interface.
Definition: type-id.h:58
MpduType
This enumeration defines the type of an MPDU.
Definition: wifi-phy.h:61
Time m_rifs
Reduced Interframe Space (RIFS) duration.
Definition: mac-low.h:880
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:38
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:1061
bool StoreMpduIfNeeded(Ptr< Packet > packet, WifiMacHeader hdr)
Definition: mac-low.cc:1948
virtual ~MacLow()
Definition: mac-low.cc:125
A struct for packet, Wifi header, and timestamp.item structure.
Definition: mac-low.h:836
Ptr< WifiPhy > m_phy
Pointer to WifiPhy (actually send/receives frames)
Definition: mac-low.h:829
void SetWifiRemoteStationManager(const Ptr< WifiRemoteStationManager > manager)
Set up WifiRemoteStationManager associated with this MacLow.
Definition: mac-low.cc:281
Implements the IEEE 802.11 MAC header.
void SetCompressedBlockAckTimeout(Time blockAckTimeout)
Set Compressed Block ACK timeout of this MacLow.
Definition: mac-low.cc:305
class PhyMacLowListener * m_phyMacLowListener
Listener needed to monitor when a channel switching occurs.
Definition: mac-low.h:888
void RegisterEdcaForAc(AcIndex ac, Ptr< EdcaTxopN > edca)
Definition: mac-low.cc:2298
void SendRtsForPacket(void)
Send RTS to begin RTS-CTS-DATA-ACK transaction.
Definition: mac-low.cc:1453
void RxCompleteBufferedPacketsUntilFirstLost(Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2098