43 class WifiMacQueueItem;
248 friend class ::TwoLevelAggregationTest;
250 friend class ::AmpduAggregationTest;
480 uint32_t fragmentSize)
const;
545 uint16_t startingSeq);
981 static bool IsInWindow (uint16_t seq, uint16_t winstart, uint16_t winsize);
1014 Time duration,
WifiMode blockAckReqTxMode,
double rxSnr);
1038 Time duration,
WifiMode blockAckReqTxMode,
double rxSnr);
void WaitIfsAfterEndTxPacket(void)
Event handler that is usually scheduled to fired at the appropriate time after sending a packet...
bool MustSendRts(void) const
Time GetPifs(void) const
Return PCF Interframe Space (PIFS) of this MacLow.
void SetPifs(Time pifs)
Set PCF Interframe Space (PIFS) of this MacLow.
Time m_ctsTimeout
CTS timeout duration.
Simulation virtual time values and global simulation resolution.
EventId m_navCounterResetCtsMissed
Event to reset NAV when CTS is not received.
static uint32_t GetRtsSize(void)
Return the total RTS size (including FCS trailer).
Ptr< WifiPhy > GetPhy(void) const
void ResetBlockAckInactivityTimerIfNeeded(BlockAckAgreement &agreement)
Every time that a block ack request or a packet with ack policy equals to block ack are received...
EventId m_blockAckTimeoutEvent
Block ACK timeout event.
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.
Time GetAckDuration(WifiTxVector ackTxVector) const
Return the time required to transmit the ACK (including preamble and FCS).
void SendBlockAckAfterBlockAckRequest(const CtrlBAckRequestHeader reqHdr, Mac48Address originator, Time duration, WifiMode blockAckReqTxMode, double rxSnr)
Invoked after that a block ack request has been received.
virtual void StartTransmission(Ptr< const Packet > packet, const WifiMacHeader *hdr, MacLowTransmissionParameters parameters, Ptr< DcaTxop > dca)
void SetPromisc(void)
Enable promiscuous mode.
void DoNavResetNow(Time duration)
Reset NAV with the given duration.
bool IsPromisc(void) const
Check if MacLow is operating in promiscuous mode.
void EnableBasicBlockAck(void)
Wait BASICBLOCKACKTimeout for a Basic Block Ack Response frame.
void SetupPhyMacLowListener(const Ptr< WifiPhy > phy)
Set up WifiPhy listener for this MacLow.
EventId m_fastAckTimeoutEvent
Fast ACK timeout event.
Time m_pifs
PCF Interframe Space (PIFS) duration.
void SetPhy(const Ptr< WifiPhy > phy)
Set up WifiPhy associated with this MacLow.
void FastAckFailedTimeout(void)
Event handler when fast ACK timeout occurs (busy).
bool DoNavStartNow(Time duration)
Start NAV with the given duration.
Mac48Address GetBssid(void) const
Return the Basic Service Set Identification.
void SetSifs(Time sifs)
Set Short Interframe Space (SIFS) of this MacLow.
void ForwardDown(Ptr< const Packet > packet, const WifiMacHeader *hdr, WifiTxVector txVector)
Forward the packet down to WifiPhy for transmission.
uint32_t m_nextSize
the next size
Ptr< DcaTxop > m_currentDca
Current DCA.
std::pair< Mac48Address, uint8_t > AgreementKey
agreement key typedef
WifiTxVector GetCtsToSelfTxVector(Ptr< const Packet > packet, const WifiMacHeader *hdr) const
Return a TXVECTOR for the CTS-to-self frame.
friend std::ostream & operator<<(std::ostream &os, const MacLowTransmissionParameters ¶ms)
Serialize MacLowTransmissionParameters to ostream in a human-readable form.
void NotifySleepNow(void)
This method is typically invoked by the PhyMacLowListener to notify the MAC layer that the device has...
bool HasDurationId(void) const
bool m_ampdu
Flag if the current transmission involves an A-MPDU.
void SetRxCallback(Callback< void, Ptr< Packet >, const WifiMacHeader * > callback)
std::map< AcIndex, Ptr< EdcaTxopN > > QueueEdcas
EDCA queues typedef.
Time GetCompressedBlockAckTimeout() const
Return Compressed Block ACK timeout of this MacLow.
Mac48Address m_bssid
BSSID address (Mac48Address)
BlockAckType
Enumeration for different block ACK policies.
Ptr< Packet > AggregateToAmpdu(Ptr< const Packet > packet, const WifiMacHeader hdr)
EventId m_sendCtsEvent
Event to send CTS.
MacLowRxCallback m_rxCallback
Callback to pass packet up.
Time GetCtsTimeout(void) const
Return CTS timeout of this MacLow.
EventId m_superFastAckTimeoutEvent
Super fast ACK timeout event.
void DeaggregateAmpduAndReceive(Ptr< Packet > aggregatedPacket, double rxSnr, WifiTxVector txVector)
EventId m_sendAckEvent
Event to send ACK.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Time GetCtsDuration(WifiTxVector ctsTxVector) const
Return the time required to transmit the CTS (including preamble and FCS).
bool MustWaitFastAck(void) const
static void AddWifiMacTrailer(Ptr< Packet > packet)
Add FCS trailer to a packet.
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.
control how a packet is transmitted.
MacLowTransmissionParameters()
void SetCtsToSelfSupported(bool enable)
Enable or disable CTS-to-self capability.
QueueEdcas m_edca
EDCA queues.
void NormalAckTimeout(void)
Event handler when normal ACK timeout occurs.
void SetBasicBlockAckTimeout(Time blockAckTimeout)
Set Basic Block ACK timeout of this MacLow.
BlockAckCaches m_bAckCaches
block ack caches
Time timestamp
the timestamp
void RemovePhyMacLowListener(Ptr< WifiPhy > phy)
Remove current WifiPhy listener for this MacLow.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
WifiTxVector m_currentTxVector
TXVECTOR used for the current packet transmission.
void DestroyBlockAckAgreement(Mac48Address originator, uint8_t tid)
Time m_lastNavDuration
The duration of the latest NAV.
DcfManagers m_dcfManagers
List of DcfManager.
std::pair< Ptr< Packet >, WifiMacHeader > BufferedPacket
buffered packet typedef
bool m_ctsToSelfSupported
Flag whether CTS-to-self is supported.
void SendCtsToSelf(void)
Send CTS for a CTS-to-self mechanism.
void SendAckAfterData(Mac48Address source, Time duration, WifiMode dataTxMode, double dataSnr)
Send ACK after receiving DATA.
void CreateBlockAckAgreement(const MgtAddBaResponseHeader *respHdr, Mac48Address originator, uint16_t startingSeq)
void NotifyNav(Ptr< const Packet > packet, const WifiMacHeader &hdr, WifiPreamble preamble)
Notify NAV function.
std::vector< Ptr< DcfManager > > DcfManagers
typedef for a list of DcfManager.
void CtsTimeout(void)
Event handler when CTS timeout occurs.
void EnableSuperFastAck(void)
void EndTxNoAck(void)
A transmission that does not require an ACK has completed.
void SendBlockAckAfterAmpdu(uint8_t tid, Mac48Address originator, Time duration, WifiTxVector blockAckReqTxVector, double rxSnr)
Invoked after an A-MPDU has been received.
std::map< AgreementKey, BlockAckCache >::iterator BlockAckCachesI
block ack caches iterator typedef
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...
void SetAckTimeout(Time ackTimeout)
Set ACK timeout of this MacLow.
static TypeId GetTypeId(void)
Register this type.
void SendDataAfterCts(Mac48Address source, Time duration)
Send DATA after receiving CTS.
Time GetRifs(void) const
Return Reduced Interframe Space (RIFS) of this MacLow.
void NavCounterResetCtsMissed(Time rtsEndRxTime)
Reset NAV after CTS was missed when the NAV was setted with RTS.
Ptr< WifiRemoteStationManager > m_stationManager
Pointer to WifiRemoteStationManager (rate control)
bool MustWaitMultiTidBlockAck(void) const
Mac48Address GetAddress(void) const
Return the MAC address of this MacLow.
uint32_t GetNextPacketSize(void) const
Agreements m_bAckAgreements
block ack agreements
Ptr< WifiMacQueue > m_aggregateQueue[8]
Queues per TID used for MPDU aggregation.
bool HasNextPacket(void) const
void SendMpdu(Ptr< const Packet > packet, WifiTxVector txVector, MpduType mpdutype)
Forward the MPDU down to WifiPhy for transmission.
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 ...
static uint32_t GetBlockAckSize(BlockAckType type)
Return the total Block ACK size (including FCS trailer).
void NotifySwitchingStartNow(Time duration)
Time CalculateOverallTxFragmentTime(Ptr< const Packet > packet, const WifiMacHeader *hdr, const MacLowTransmissionParameters ¶ms, uint32_t fragmentSize) const
Time m_slotTime
Slot duration.
bool m_promisc
Flag if the device is operating in promiscuous mode.
WifiMacHeader hdr
the header
void CancelAllEvents(void)
Cancel all scheduled events.
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
std::list< BufferedPacket >::iterator BufferedPacketI
buffered packet iterator typedef
void BlockAckTimeout(void)
Event handler when block ACK timeout occurs.
void NotifyCtsTimeoutStartNow(Time duration)
Notify DcfManagerthat CTS timer should be started for the given duration.
Time m_overrideDurationId
override duration ID
std::map< AgreementKey, BlockAckCache > BlockAckCaches
block ack caches typedef
void RegisterDcf(Ptr< DcfManager > dcf)
void EnableCompressedBlockAck(void)
Wait COMPRESSEDBLOCKACKTimeout for a Compressed Block Ack Response frame.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SuperFastAckTimeout(void)
Event handler when super fast ACK timeout occurs.
void SetBssid(Mac48Address ad)
Set the Basic Service Set Identification.
EventId m_waitIfsEvent
Wait for IFS event.
void ReceiveOk(Ptr< Packet > packet, double rxSnr, WifiTxVector txVector, bool ampduSubframe)
void EnableAck(void)
Wait ACKTimeout for an ACK.
Time CalculateTransmissionTime(Ptr< const Packet > packet, const WifiMacHeader *hdr, const MacLowTransmissionParameters ¶meters) const
EventId m_normalAckTimeoutEvent
Normal ACK timeout event.
bool m_sendRts
send an RTS?
void StartDataTxTimers(WifiTxVector dataTxVector)
Start a DATA timer by scheduling appropriate ACK timeout.
void NotifyCtsTimeoutResetNow()
Notify DcfManager that CTS timer should be resetted.
bool MustWaitBasicBlockAck(void) const
bool MustWaitCompressedBlockAck(void) const
Ptr< const Packet > packet
the packet
Callback< void, Ptr< Packet >, const WifiMacHeader * > MacLowRxCallback
typedef for a callback for MacLowRx
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.
Time m_ackTimeout
ACK timeout duration.
static bool IsInWindow(uint16_t seq, uint16_t winstart, uint16_t winsize)
static uint32_t GetCtsSize(void)
Return the total CTS size (including FCS trailer).
bool NeedRts(void) const
Check if the current packet should be sent with a RTS protection.
void FastAckTimeout(void)
Event handler when fast ACK timeout occurs (idle).
void DisableRts(void)
Do not send rts and wait for cts before sending data.
void EnableMultiTidBlockAck(void)
NOT IMPLEMENTED FOR NOW.
EventId m_ctsTimeoutEvent
CTS timeout event.
void RxCompleteBufferedPacketsWithSmallerSequence(uint16_t seq, Mac48Address originator, uint8_t tid)
void SendCtsAfterRts(Mac48Address source, Time duration, WifiTxVector rtsTxVector, double rtsSnr)
Send CTS after receiving RTS.
Time m_basicBlockAckTimeout
Basic block ACK timeout duration.
Time GetDurationId(void) const
void FlushAggregateQueue(uint8_t tid)
This function is called to flush the aggregate queue, which is used for A-MPDU.
Two Level Aggregation Test.
Time m_sifs
Short Interframe Space (SIFS) duration.
static uint32_t GetAckSize(void)
Return the total ACK size (including FCS trailer).
Time GetSlotTime(void) const
Return slot duration of this MacLow.
WifiMacHeader m_lastReceivedHdr
Header of the last received packet.
Time m_lastNavStart
The time when the latest NAV started.
void ReceiveError(Ptr< Packet > packet, double rxSnr)
static uint32_t GetSize(Ptr< const Packet > packet, const WifiMacHeader *hdr, bool isAmpdu)
Return the total size of the packet after WifiMacHeader and FCS trailer have been added...
WifiTxVector GetRtsTxVector(Ptr< const Packet > packet, const WifiMacHeader *hdr) const
Return a TXVECTOR for the RTS frame given the destination.
enum ns3::MacLowTransmissionParameters::@73 m_waitAck
wait ack enumerated type
std::map< AgreementKey, AgreementValue > Agreements
agreements
virtual WifiTxVector GetDataTxVector(Ptr< const Packet > packet, const WifiMacHeader *hdr) const
Return a TXVECTOR for the DATA frame given the destination.
handle RTS/CTS/DATA/ACK transactions.
std::vector< Ptr< DcfManager > >::const_iterator DcfManagersCI
typedef for an iterator for a list of DcfManager.
EventId m_sendDataEvent
Event to send DATA.
bool ReceiveMpdu(Ptr< Packet > packet, WifiMacHeader hdr)
MacLowTransmissionParameters m_txParams
Transmission parameters of the current packet.
void SetRifs(Time rifs)
Set Reduced Interframe Space (RIFS) of this MacLow.
void DoDispose(void)
Destructor implementation.
void NotifyAckTimeoutResetNow()
Notify DcfManager that ACK timer should be resetted.
bool MustWaitSuperFastAck(void) const
Time CalculateOverallTxTime(Ptr< const Packet > packet, const WifiMacHeader *hdr, const MacLowTransmissionParameters ¶ms) const
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 ...
Mac48Address m_self
Address of this MacLow (Mac48Address)
Maintains information for a block ack agreement.
An identifier for simulation events.
EventId m_fastAckFailedTimeoutEvent
Fast ACK failed timeout event.
bool IsNavZero(void) const
Check if NAV is zero.
void EnableRts(void)
Send a RTS, and wait CTSTimeout for a CTS.
void NotifyAckTimeoutStartNow(Time duration)
Notify DcfManager that ACK timer should be started for the given duration.
void SetSlotTime(Time slotTime)
Set slot duration of this MacLow.
Ptr< Packet > m_currentPacket
Current packet transmitted/to be transmitted.
Time GetSifs(void) const
Return Short Interframe Space (SIFS) of this MacLow.
bool NeedCtsToSelf(void) const
Check if CTS-to-self mechanism should be used for the current packet.
bool StopMpduAggregation(Ptr< const Packet > peekedPacket, WifiMacHeader peekedHdr, Ptr< Packet > aggregatedPacket, uint16_t size) const
std::map< AgreementKey, AgreementValue >::iterator AgreementsI
agreements iterator
EventId m_endTxNoAckEvent
Event for finishing transmission that does not require ACK.
void EnableOverrideDurationId(Time durationId)
bool GetCtsToSelfSupported() const
Return whether CTS-to-self capability is supported.
void SetCtsTimeout(Time ctsTimeout)
Set CTS timeout of this MacLow.
void EnableNextData(uint32_t size)
Time GetBlockAckDuration(Mac48Address to, WifiTxVector blockAckReqTxVector, BlockAckType type) const
Return the time required to transmit the Block ACK to the specified address given the TXVECTOR of the...
void DisableOverrideDurationId(void)
Do not force the duration/id field of the packet: its value is automatically calculated by the MacLow...
Time GetAckTimeout(void) const
Return ACK timeout of this MacLow.
void DisableNextData(void)
Do not attempt to send data burst after current transmission.
void SendDataPacket(void)
Send DATA packet, which can be DATA-ACK or RTS-CTS-DATA-ACK transaction.
WifiMacHeader m_currentHdr
Header of the current transmitted packet.
void SetAddress(Mac48Address ad)
Set MAC address of this MacLow.
A base class which provides memory management and object aggregation.
void WaitIfsAfterEndTxFragment(void)
Event handler that is usually scheduled to fired at the appropriate time after completing transmissio...
Time m_compressedBlockAckTimeout
Compressed block ACK timeout duration.
bool MustWaitAck(void) const
bool IsAmpdu(Ptr< const Packet > packet, const WifiMacHeader hdr)
Checks if the given packet will be aggregated to an A-MPDU or not.
void InsertInTxQueue(Ptr< const Packet > packet, const WifiMacHeader &hdr, Time tStamp, uint8_t tid)
Insert in a temporary queue.
void ResetPhy(void)
Remove WifiPhy associated with this MacLow.
void DisableAck(void)
Do not wait for Ack after data transmission.
std::pair< BlockAckAgreement, std::list< BufferedPacket > > AgreementValue
agreement value typedef
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...
Time GetBasicBlockAckTimeout() const
Return Basic Block ACK timeout of this MacLow.
a unique identifier for an interface.
MpduType
This enumeration defines the type of an MPDU.
Time m_rifs
Reduced Interframe Space (RIFS) duration.
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
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...
bool StoreMpduIfNeeded(Ptr< Packet > packet, WifiMacHeader hdr)
bool MustWaitNormalAck(void) const
A struct for packet, Wifi header, and timestamp.item structure.
Ptr< WifiPhy > m_phy
Pointer to WifiPhy (actually send/receives frames)
void SetWifiRemoteStationManager(const Ptr< WifiRemoteStationManager > manager)
Set up WifiRemoteStationManager associated with this MacLow.
void SetCompressedBlockAckTimeout(Time blockAckTimeout)
Set Compressed Block ACK timeout of this MacLow.
class PhyMacLowListener * m_phyMacLowListener
Listener needed to monitor when a channel switching occurs.
void RegisterEdcaForAc(AcIndex ac, Ptr< EdcaTxopN > edca)
void SendRtsForPacket(void)
Send RTS to begin RTS-CTS-DATA-ACK transaction.
void RxCompleteBufferedPacketsUntilFirstLost(Mac48Address originator, uint8_t tid)