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 
40 
41 namespace ns3 {
42 
43 class WifiPhy;
44 class Txop;
45 class QosTxop;
46 class WifiMacQueueItem;
47 class WifiMacQueue;
48 class BlockAckAgreement;
49 class MgtAddBaResponseHeader;
50 class WifiRemoteStationManager;
51 class CtrlBAckRequestHeader;
52 class CtrlBAckResponseHeader;
53 
58 class MacLow : public Object
59 {
60 public:
62  friend class ::TwoLevelAggregationTest;
64  friend class ::AmpduAggregationTest;
69 
70  MacLow ();
71  virtual ~MacLow ();
72 
77  static TypeId GetTypeId (void);
78 
84  void SetPhy (const Ptr<WifiPhy> phy);
88  Ptr<WifiPhy> GetPhy (void) const;
92  void ResetPhy (void);
104  void SetAddress (Mac48Address ad);
110  void SetAckTimeout (Time ackTimeout);
116  void SetBasicBlockAckTimeout (Time blockAckTimeout);
122  void SetCompressedBlockAckTimeout (Time blockAckTimeout);
128  void SetCtsToSelfSupported (bool enable);
134  void SetCtsTimeout (Time ctsTimeout);
140  void SetSifs (Time sifs);
146  void SetRifs (Time rifs);
152  void SetSlotTime (Time slotTime);
158  void SetPifs (Time pifs);
162  void SetBeaconInterval (Time interval);
166  void SetCfpMaxDuration (Time duration);
172  void SetBssid (Mac48Address ad);
176  void SetPromisc (void);
182  bool GetCtsToSelfSupported () const;
188  Mac48Address GetAddress (void) const;
194  Time GetAckTimeout (void) const;
200  Time GetBasicBlockAckTimeout () const;
212  Time GetCtsTimeout (void) const;
218  Time GetSifs (void) const;
224  Time GetSlotTime (void) const;
230  Time GetPifs (void) const;
236  Time GetRifs (void) const;
240  Time GetBeaconInterval (void) const;
244  Time GetCfpMaxDuration (void) const;
248  Time GetRemainingCfpDuration (void) const;
254  Mac48Address GetBssid (void) const;
261  bool IsPromisc (void) const;
262 
269  void SetRxCallback (Callback<void,Ptr<Packet>,const WifiMacHeader *> callback);
274 
285  const WifiMacHeader* hdr,
286  const MacLowTransmissionParameters& parameters) const;
287 
299  const WifiMacHeader* hdr,
300  const MacLowTransmissionParameters& params,
301  uint32_t fragmentSize = 0) const;
302 
312  virtual void StartTransmission (Ptr<const Packet> packet,
313  const WifiMacHeader* hdr,
314  MacLowTransmissionParameters parameters,
315  Ptr<Txop> txop);
316 
326  void ReceiveOk (Ptr<Packet> packet, double rxSnr, WifiTxVector txVector, bool ampduSubframe);
334  void ReceiveError (Ptr<Packet> packet, double rxSnr);
342  void NotifySwitchingStartNow (Time duration);
348  void NotifySleepNow (void);
354  void NotifyOffNow (void);
370  void CreateBlockAckAgreement (const MgtAddBaResponseHeader *respHdr,
371  Mac48Address originator,
372  uint16_t startingSeq);
381  void DestroyBlockAckAgreement (Mac48Address originator, uint8_t tid);
389  void RegisterEdcaForAc (AcIndex ac, Ptr<QosTxop> edca);
407  void DeaggregateAmpduAndReceive (Ptr<Packet> aggregatedPacket, double rxSnr, WifiTxVector txVector);
418  bool StopMpduAggregation (Ptr<const Packet> peekedPacket, WifiMacHeader peekedHdr, Ptr<Packet> aggregatedPacket, uint8_t blockAckSize) const;
425  void FlushAggregateQueue (uint8_t tid);
426 
436  virtual WifiTxVector GetDataTxVector (Ptr<const Packet> packet, const WifiMacHeader *hdr) const;
443  bool DoNavStartNow (Time duration);
447  virtual bool IsCfPeriod (void) const;
451  bool CanTransmitNextCfFrame (void) const;
452 
453 
454 private:
459  void CancelAllEvents (void);
465  uint32_t GetCfEndSize (void) const;
473  void ForwardDown (Ptr<const Packet> packet, const WifiMacHeader *hdr, WifiTxVector txVector);
481  void SendMpdu (Ptr<const Packet> packet, WifiTxVector txVector, MpduType mpdutype);
491  WifiTxVector GetRtsTxVector (Ptr<const Packet> packet, const WifiMacHeader *hdr) const;
502  WifiTxVector GetCtsTxVector (Mac48Address to, WifiMode rtsTxMode) const;
513  WifiTxVector GetAckTxVector (Mac48Address to, WifiMode dataTxMode) const;
524  WifiTxVector GetBlockAckTxVector (Mac48Address to, WifiMode dataTxMode) const;
553  Time GetCtsDuration (WifiTxVector ctsTxVector) const;
562  Time GetCtsDuration (Mac48Address to, WifiTxVector rtsTxVector) const;
569  Time GetAckDuration (WifiTxVector ackTxVector) const;
578  Time GetAckDuration (Mac48Address to, WifiTxVector dataTxVector) const;
587  Time GetBlockAckDuration (WifiTxVector blockAckReqTxVector, BlockAckType type) const;
594  bool NeedRts (void) const;
601  bool NeedCtsToSelf (void) const;
602 
609  void NotifyNav (Ptr<const Packet> packet,const WifiMacHeader &hdr);
615  void DoNavResetNow (Time duration);
622  bool IsNavZero (void) const;
628  void NotifyAckTimeoutStartNow (Time duration);
632  void NotifyAckTimeoutResetNow ();
638  void NotifyCtsTimeoutStartNow (Time duration);
642  void NotifyCtsTimeoutResetNow ();
649  void NavCounterResetCtsMissed (Time rtsEndRxTime);
650  /* Event handlers */
654  void NormalAckTimeout (void);
658  void BlockAckTimeout (void);
662  void CtsTimeout (void);
666  void CfPollTimeout (void);
670  void SendCtsToSelf (void);
679  void SendCtsAfterRts (Mac48Address source, Time duration, WifiTxVector rtsTxVector, double rtsSnr);
688  void SendAckAfterData (Mac48Address source, Time duration, WifiMode dataTxMode, double dataSnr);
694  void SendDataAfterCts (Time duration);
695 
700  void WaitIfsAfterEndTxFragment (void);
705  void WaitIfsAfterEndTxPacket (void);
706 
710  void EndTxNoAck (void);
714  void SendRtsForPacket (void);
719  void SendDataPacket (void);
726  void StartDataTxTimers (WifiTxVector dataTxVector);
727 
728  void DoDispose (void);
729 
738  void RxCompleteBufferedPacketsWithSmallerSequence (uint16_t seq, Mac48Address originator, uint8_t tid);
751  void RxCompleteBufferedPacketsUntilFirstLost (Mac48Address originator, uint8_t tid);
761  bool ReceiveMpdu (Ptr<Packet> packet, WifiMacHeader hdr);
772  bool StoreMpduIfNeeded (Ptr<Packet> packet, WifiMacHeader hdr);
784  Time duration, WifiMode blockAckReqTxMode, double rxSnr);
795  void SendBlockAckAfterAmpdu (uint8_t tid, Mac48Address originator,
796  Time duration, WifiTxVector blockAckReqTxVector, double rxSnr);
807  void SendBlockAckResponse (const CtrlBAckResponseHeader* blockAck, Mac48Address originator, bool immediate,
808  Time duration, WifiMode blockAckReqTxMode, double rxSnr);
818 
838  bool IsAmpdu (Ptr<const Packet> packet, const WifiMacHeader hdr);
848  void InsertInTxQueue (Ptr<const Packet> packet, const WifiMacHeader &hdr, Time tStamp, uint8_t tid);
860  Ptr<Packet> PerformMsduAggregation (Ptr<const Packet> packet, WifiMacHeader *hdr, Time *tstamp, Ptr<Packet> currentAmpduPacket, uint8_t blockAckSize);
861 
865 
869  struct Item
870  {
874  };
875 
879  struct CfAckInfo
880  {
881  bool appendCfAck;
882  bool expectCfAck;
884  };
885 
889  typedef std::vector<Ptr<ChannelAccessManager> >::const_iterator ChannelAccessManagersCI;
893  typedef std::vector<Ptr<ChannelAccessManager> > ChannelAccessManagers;
895 
905 
920 
923 
926 
930 
931  bool m_promisc;
932  bool m_ampdu;
933 
935 
936  /*
937  * BlockAck data structures.
938  */
939  typedef std::pair<Ptr<Packet>, WifiMacHeader> BufferedPacket;
940  typedef std::list<BufferedPacket>::iterator BufferedPacketI;
941 
942  typedef std::pair<Mac48Address, uint8_t> AgreementKey;
943  typedef std::pair<BlockAckAgreement, std::list<BufferedPacket> > AgreementValue;
944 
945  typedef std::map<AgreementKey, AgreementValue> Agreements;
946  typedef std::map<AgreementKey, AgreementValue>::iterator AgreementsI;
947 
948  typedef std::map<AgreementKey, BlockAckCache> BlockAckCaches;
949  typedef std::map<AgreementKey, BlockAckCache>::iterator BlockAckCachesI;
950 
953 
954  typedef std::map<AcIndex, Ptr<QosTxop> > QueueEdcas;
956 
959  std::vector<Item> m_txPackets[8];
961 
963 };
964 
965 } //namespace ns3
966 
967 #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:1984
Time GetRifs(void) const
Return Reduced Interframe Space (RIFS) of this MacLow.
Definition: mac-low.cc:407
void SetPifs(Time pifs)
Set PCF Interframe Space (PIFS) of this MacLow.
Definition: mac-low.cc:334
Time m_ctsTimeout
CTS timeout duration.
Definition: mac-low.h:915
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:889
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:2420
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:1181
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:959
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:2356
void SetPromisc(void)
Enable promiscuous mode.
Definition: mac-low.cc:364
void DoNavResetNow(Time duration)
Reset NAV with the given duration.
Definition: mac-low.cc:1283
Ptr< Txop > m_currentTxop
Current TXOP.
Definition: mac-low.h:908
void SetupPhyMacLowListener(const Ptr< WifiPhy > phy)
Set up WifiPhy listener for this MacLow.
Definition: mac-low.cc:154
Time m_pifs
PCF Interframe Space (PIFS) duration.
Definition: mac-low.h:918
void SetPhy(const Ptr< WifiPhy > phy)
Set up WifiPhy associated with this MacLow.
Definition: mac-low.cc:250
bool StopMpduAggregation(Ptr< const Packet > peekedPacket, WifiMacHeader peekedHdr, Ptr< Packet > aggregatedPacket, uint8_t blockAckSize) const
Definition: mac-low.cc:2531
bool DoNavStartNow(Time duration)
Start NAV with the given duration.
Definition: mac-low.cc:1295
void SetSifs(Time sifs)
Set Short Interframe Space (SIFS) of this MacLow.
Definition: mac-low.cc:322
void ForwardDown(Ptr< const Packet > packet, const WifiMacHeader *hdr, WifiTxVector txVector)
Forward the packet down to WifiPhy for transmission.
Definition: mac-low.cc:1349
std::pair< Mac48Address, uint8_t > AgreementKey
agreement key typedef
Definition: mac-low.h:942
WifiTxVector GetRtsTxVector(Ptr< const Packet > packet, const WifiMacHeader *hdr) const
Return a TXVECTOR for the RTS frame given the destination.
Definition: mac-low.cc:1137
bool IsNavZero(void) const
Check if NAV is zero.
Definition: mac-low.cc:1784
void NotifyOffNow(void)
This method is typically invoked by the PhyMacLowListener to notify the MAC layer that the device has...
Definition: mac-low.cc:673
void NotifySleepNow(void)
This method is typically invoked by the PhyMacLowListener to notify the MAC layer that the device has...
Definition: mac-low.cc:658
void NotifyNav(Ptr< const Packet > packet, const WifiMacHeader &hdr)
Notify NAV function.
Definition: mac-low.cc:1230
Mac48Address GetBssid(void) const
Return the Basic Service Set Identification.
Definition: mac-low.cc:426
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:1144
bool m_ampdu
Flag if the current transmission involves an A-MPDU.
Definition: mac-low.h:932
Mac48Address m_bssid
BSSID address (Mac48Address)
Definition: mac-low.h:911
Ptr< Packet > AggregateToAmpdu(Ptr< const Packet > packet, const WifiMacHeader hdr)
Definition: mac-low.cc:2566
EventId m_sendCtsEvent
Event to send CTS.
Definition: mac-low.h:899
virtual void StartTransmission(Ptr< const Packet > packet, const WifiMacHeader *hdr, MacLowTransmissionParameters parameters, Ptr< Txop > txop)
Definition: mac-low.cc:478
MacLowRxCallback m_rxCallback
Callback to pass packet up.
Definition: mac-low.h:864
bool NeedRts(void) const
Check if the current packet should be sent with a RTS protection.
Definition: mac-low.cc:606
void DeaggregateAmpduAndReceive(Ptr< Packet > aggregatedPacket, double rxSnr, WifiTxVector txVector)
Definition: mac-low.cc:2442
bool appendCfAck
Flag used for PCF to indicate whether a CF-ACK should be appended.
Definition: mac-low.h:881
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
Time m_cfpMaxDuration
CFP max duration.
Definition: mac-low.h:922
Time CalculateTransmissionTime(Ptr< const Packet > packet, const WifiMacHeader *hdr, const MacLowTransmissionParameters &parameters) const
Definition: mac-low.cc:1215
control how a packet is transmitted.
MpduType
The type of an MPDU.
void SetCtsToSelfSupported(bool enable)
Enable or disable CTS-to-self capability.
Definition: mac-low.cc:304
bool expectCfAck
Flag used for PCF to indicate whether a CF-ACK should be expected.
Definition: mac-low.h:882
QueueEdcas m_edca
EDCA queues.
Definition: mac-low.h:955
void NormalAckTimeout(void)
Event handler when normal ACK timeout occurs.
Definition: mac-low.cc:1517
void SetBasicBlockAckTimeout(Time blockAckTimeout)
Set Basic Block ACK timeout of this MacLow.
Definition: mac-low.cc:292
phy
Definition: third.py:86
BlockAckCaches m_bAckCaches
block ack caches
Definition: mac-low.h:952
Time timestamp
the timestamp
Definition: mac-low.h:873
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:444
WifiTxVector m_currentTxVector
TXVECTOR used for the current packet transmission.
Definition: mac-low.h:960
void DestroyBlockAckAgreement(Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2157
Time m_lastNavDuration
The duration of the latest NAV.
Definition: mac-low.h:925
void SetCfpMaxDuration(Time duration)
Definition: mac-low.cc:352
Time GetCtsDuration(WifiTxVector ctsTxVector) const
Return the time required to transmit the CTS (including preamble and FCS).
Definition: mac-low.cc:1130
std::pair< Ptr< Packet >, WifiMacHeader > BufferedPacket
buffered packet typedef
Definition: mac-low.h:939
bool m_ctsToSelfSupported
Flag whether CTS-to-self is supported.
Definition: mac-low.h:957
void SendCtsToSelf(void)
Send CTS for a CTS-to-self mechanism.
Definition: mac-low.cc:1790
void SendAckAfterData(Mac48Address source, Time duration, WifiMode dataTxMode, double dataSnr)
Send ACK after receiving DATA.
Definition: mac-low.cc:2010
Mac48Address GetAddress(void) const
Return the MAC address of this MacLow.
Definition: mac-low.cc:370
void CreateBlockAckAgreement(const MgtAddBaResponseHeader *respHdr, Mac48Address originator, uint16_t startingSeq)
Definition: mac-low.cc:2115
Time m_lastBeacon
The time when the last beacon frame transmission started.
Definition: mac-low.h:928
Listener for PHY events.
Definition: mac-low.cc:53
void CtsTimeout(void)
Event handler when CTS timeout occurs.
Definition: mac-low.cc:1502
Time GetSifs(void) const
Return Short Interframe Space (SIFS) of this MacLow.
Definition: mac-low.cc:400
void EndTxNoAck(void)
A transmission that does not require an ACK has completed.
Definition: mac-low.cc:1991
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:2326
std::map< AgreementKey, BlockAckCache >::iterator BlockAckCachesI
block ack caches iterator typedef
Definition: mac-low.h:949
virtual bool IsCfPeriod(void) const
This function indicates whether it is the CF period.
Definition: mac-low.cc:2969
void SetAckTimeout(Time ackTimeout)
Set ACK timeout of this MacLow.
Definition: mac-low.cc:286
static TypeId GetTypeId(void)
Register this type.
Definition: mac-low.cc:143
Time GetCtsTimeout(void) const
Return CTS timeout of this MacLow.
Definition: mac-low.cc:394
void NavCounterResetCtsMissed(Time rtsEndRxTime)
Reset NAV after CTS was missed when the NAV was set with RTS.
Definition: mac-low.cc:1274
Ptr< WifiRemoteStationManager > m_stationManager
Pointer to WifiRemoteStationManager (rate control)
Definition: mac-low.h:863
Headers for Block ack response.
Definition: ctrl-headers.h:181
void SendDataAfterCts(Time duration)
Send DATA after receiving CTS.
Definition: mac-low.cc:1891
void RegisterEdcaForAc(AcIndex ac, Ptr< QosTxop > edca)
Definition: mac-low.cc:2436
Agreements m_bAckAgreements
block ack agreements
Definition: mac-low.h:951
Ptr< WifiMacQueue > m_aggregateQueue[8]
Queues per TID used for MPDU aggregation.
Definition: mac-low.h:958
void SendMpdu(Ptr< const Packet > packet, WifiTxVector txVector, MpduType mpdutype)
Forward the MPDU down to WifiPhy for transmission.
Definition: mac-low.cc:1477
A struct that holds information about ACK piggybacking (CF-ACK).
Definition: mac-low.h:879
void NotifySwitchingStartNow(Time duration)
Definition: mac-low.cc:642
Time GetCfpMaxDuration(void) const
Definition: mac-low.cc:438
Time m_slotTime
Slot duration.
Definition: mac-low.h:917
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:1157
bool m_promisc
Flag if the device is operating in promiscuous mode.
Definition: mac-low.h:931
WifiMacHeader hdr
the header
Definition: mac-low.h:872
void CancelAllEvents(void)
Cancel all scheduled events.
Definition: mac-low.cc:198
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:1151
std::list< BufferedPacket >::iterator BufferedPacketI
buffered packet iterator typedef
Definition: mac-low.h:940
void BlockAckTimeout(void)
Event handler when block ACK timeout occurs.
Definition: mac-low.cc:1537
void NotifyCtsTimeoutStartNow(Time duration)
Notify ChannelAccessManager that CTS timer should be started for the given duration.
Definition: mac-low.cc:1331
std::map< AgreementKey, BlockAckCache > BlockAckCaches
block ack caches typedef
Definition: mac-low.h:948
Time GetAckTimeout(void) const
Return ACK timeout of this MacLow.
Definition: mac-low.cc:376
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Time GetRemainingCfpDuration(void) const
Definition: mac-low.cc:2960
Time GetCompressedBlockAckTimeout() const
Return Compressed Block ACK timeout of this MacLow.
Definition: mac-low.cc:388
void RegisterDcf(Ptr< ChannelAccessManager > dcf)
Definition: mac-low.cc:456
void SetBssid(Mac48Address ad)
Set the Basic Service Set Identification.
Definition: mac-low.cc:358
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:688
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:1614
Time m_beaconInterval
Expected interval between two beacon transmissions.
Definition: mac-low.h:921
void NotifyCtsTimeoutResetNow()
Notify ChannelAccessManager that CTS timer should be reset.
Definition: mac-low.cc:1340
an EUI-48 address
Definition: mac48-address.h:43
Ptr< const Packet > packet
the packet
Definition: mac-low.h:871
Time m_cfpForeshortening
The delay the current CF period should be foreshortened.
Definition: mac-low.h:929
Callback< void, Ptr< Packet >, const WifiMacHeader * > MacLowRxCallback
typedef for a callback for MacLowRx
Definition: mac-low.h:68
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:2265
Time GetAckDuration(WifiTxVector ackTxVector) const
Return the time required to transmit the ACK (including preamble and FCS).
Definition: mac-low.cc:1106
Time m_ackTimeout
ACK timeout duration.
Definition: mac-low.h:912
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:2173
void SendCtsAfterRts(Mac48Address source, Time duration, WifiTxVector rtsTxVector, double rtsSnr)
Send CTS after receiving RTS.
Definition: mac-low.cc:1859
Time m_basicBlockAckTimeout
Basic block ACK timeout duration.
Definition: mac-low.h:913
bool GetCtsToSelfSupported() const
Return whether CTS-to-self capability is supported.
Definition: mac-low.cc:310
void FlushAggregateQueue(uint8_t tid)
This function is called to flush the aggregate queue, which is used for A-MPDU.
Definition: mac-low.cc:2875
Two Level Aggregation Test.
Time m_sifs
Short Interframe Space (SIFS) duration.
Definition: mac-low.h:916
void SetBeaconInterval(Time interval)
Definition: mac-low.cc:346
Ampdu Aggregation Test.
Time m_lastNavStart
The time when the latest NAV started.
Definition: mac-low.h:924
void ReceiveError(Ptr< Packet > packet, double rxSnr)
Definition: mac-low.cc:621
std::map< AgreementKey, AgreementValue > Agreements
agreements
Definition: mac-low.h:945
handle RTS/CTS/DATA/ACK transactions.
Definition: mac-low.h:58
Mac48Address address
Address of the station to be acknowledged.
Definition: mac-low.h:883
EventId m_sendDataEvent
Event to send DATA.
Definition: mac-low.h:901
bool ReceiveMpdu(Ptr< Packet > packet, WifiMacHeader hdr)
Definition: mac-low.cc:2042
MacLowTransmissionParameters m_txParams
Transmission parameters of the current packet.
Definition: mac-low.h:909
void SetRifs(Time rifs)
Set Reduced Interframe Space (RIFS) of this MacLow.
Definition: mac-low.cc:340
void DoDispose(void)
Destructor implementation.
Definition: mac-low.cc:172
void NotifyAckTimeoutResetNow()
Notify ChannelAccessManager that ACK timer should be reset.
Definition: mac-low.cc:1322
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:1175
std::map< AcIndex, Ptr< QosTxop > > QueueEdcas
EDCA queues typedef.
Definition: mac-low.h:954
Mac48Address m_self
Address of this MacLow (Mac48Address)
Definition: mac-low.h:910
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:1163
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:1313
bool CanTransmitNextCfFrame(void) const
This function decides if a CF frame can be transmitted in the current CFP.
Definition: mac-low.cc:2975
void SetSlotTime(Time slotTime)
Set slot duration of this MacLow.
Definition: mac-low.cc:328
Ptr< Packet > m_currentPacket
Current packet transmitted/to be transmitted.
Definition: mac-low.h:906
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:927
std::map< AgreementKey, AgreementValue >::iterator AgreementsI
agreements iterator
Definition: mac-low.h:946
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:1113
CfAckInfo m_cfAckInfo
Info about piggyback ACKs used in PCF.
Definition: mac-low.h:962
void SetCtsTimeout(Time ctsTimeout)
Set CTS timeout of this MacLow.
Definition: mac-low.cc:316
void SendDataPacket(void)
Send DATA packet, which can be DATA-ACK or RTS-CTS-DATA-ACK transaction.
Definition: mac-low.cc:1673
Time GetPifs(void) const
Return PCF Interframe Space (PIFS) of this MacLow.
Definition: mac-low.cc:420
WifiMacHeader m_currentHdr
Header of the current transmitted packet.
Definition: mac-low.h:907
void SetAddress(Mac48Address ad)
Set MAC address of this MacLow.
Definition: mac-low.cc:280
uint32_t GetCfEndSize(void) const
Return the total CF-END size (including FCS trailer).
Definition: mac-low.cc:1084
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:1977
Time GetBeaconInterval(void) const
Definition: mac-low.cc:432
Ptr< Packet > PerformMsduAggregation(Ptr< const Packet > packet, WifiMacHeader *hdr, Time *tstamp, Ptr< Packet > currentAmpduPacket, uint8_t blockAckSize)
Perform MSDU aggregation for a given MPDU in an A-MPDU.
Definition: mac-low.cc:2897
Time m_compressedBlockAckTimeout
Compressed block ACK timeout duration.
Definition: mac-low.h:914
void CfPollTimeout(void)
Event handler when CF-POLL timeout occurs.
Definition: mac-low.cc:1484
Headers for Block ack request.
Definition: ctrl-headers.h:41
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:462
void InsertInTxQueue(Ptr< const Packet > packet, const WifiMacHeader &hdr, Time tStamp, uint8_t tid)
Insert in a temporary queue.
Definition: mac-low.cc:2886
void ResetPhy(void)
Remove WifiPhy associated with this MacLow.
Definition: mac-low.cc:265
std::pair< BlockAckAgreement, std::list< BufferedPacket > > AgreementValue
agreement value typedef
Definition: mac-low.h:943
Time GetSlotTime(void) const
Return slot duration of this MacLow.
Definition: mac-low.cc:414
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:1169
a unique identifier for an interface.
Definition: type-id.h:58
void SetRxCallback(Callback< void, Ptr< Packet >, const WifiMacHeader *> callback)
Definition: mac-low.cc:450
std::vector< Ptr< ChannelAccessManager > > ChannelAccessManagers
typedef for a list of ChannelAccessManager.
Definition: mac-low.h:893
bool NeedCtsToSelf(void) const
Check if CTS-to-self mechanism should be used for the current packet.
Definition: mac-low.cc:614
Time GetBasicBlockAckTimeout() const
Return Basic Block ACK timeout of this MacLow.
Definition: mac-low.cc:382
Time m_rifs
Reduced Interframe Space (RIFS) duration.
Definition: mac-low.h:919
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:37
bool StoreMpduIfNeeded(Ptr< Packet > packet, WifiMacHeader hdr)
Definition: mac-low.cc:2086
virtual ~MacLow()
Definition: mac-low.cc:136
A struct for packet, Wifi header, and timestamp.item structure.
Definition: mac-low.h:869
Ptr< WifiPhy > m_phy
Pointer to WifiPhy (actually send/receives frames)
Definition: mac-low.h:862
void SetWifiRemoteStationManager(const Ptr< WifiRemoteStationManager > manager)
Set up WifiRemoteStationManager associated with this MacLow.
Definition: mac-low.cc:274
Implements the IEEE 802.11 MAC header.
void SetCompressedBlockAckTimeout(Time blockAckTimeout)
Set Compressed Block ACK timeout of this MacLow.
Definition: mac-low.cc:298
Ptr< WifiPhy > GetPhy(void) const
Definition: mac-low.cc:259
class PhyMacLowListener * m_phyMacLowListener
Listener needed to monitor when a channel switching occurs.
Definition: mac-low.h:934
ChannelAccessManagers m_channelAccessManagers
List of ChannelAccessManager.
Definition: mac-low.h:894
void SendRtsForPacket(void)
Send RTS to begin RTS-CTS-DATA-ACK transaction.
Definition: mac-low.cc:1552
BlockAckType
The different block ACK policies.
void RxCompleteBufferedPacketsUntilFirstLost(Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2236