Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(623)

Unified Diff: src/wifi/model/mac-low.h

Issue 333660043: 802.11 PCF implementation
Patch Set: Fix wifi-blockack example in previous patchset Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/wifi/model/mac-low.h
===================================================================
--- a/src/wifi/model/mac-low.h
+++ b/src/wifi/model/mac-low.h
@@ -38,8 +38,8 @@
namespace ns3 {
-class DcaTxop;
-class EdcaTxopN;
+class Txop;
+class QosTxop;
class DcfManager;
class WifiMacQueueItem;
class WifiMacQueue;
@@ -150,6 +150,14 @@
*/
void SetPifs (Time pifs);
/**
+ * \param interval the expected interval between two beacon transmissions.
+ */
+ void SetBeaconInterval (Time interval);
+ /**
+ * \param duration the maximum duration for the CF period.
+ */
+ void SetCfpMaxDuration (Time duration);
+ /**
* Set the Basic Service Set Identification.
*
* \param ad the BSSID
@@ -220,6 +228,18 @@
*/
Time GetRifs (void) const;
/**
+ * \return the expected interval between two beacon transmissions.
+ */
+ Time GetBeaconInterval (void) const;
+ /**
+ * \return the maximum duration for the CF period.
+ */
+ Time GetCfpMaxDuration (void) const;
+ /**
+ * \return the remaining duration for the CF period.
+ */
+ Time GetRemainingCfpDuration (void) const;
+ /**
* Return the Basic Service Set Identification.
*
* \return BSSID
@@ -277,7 +297,7 @@
* \param packet packet to send
* \param hdr 802.11 header for packet to send
* \param parameters the transmission parameters to use for this packet.
- * \param dca pointer to the calling DcaTxop.
+ * \param txop pointer to the calling Txop.
*
* Start the transmission of the input packet and notify the listener
* of transmission events.
@@ -285,7 +305,7 @@
virtual void StartTransmission (Ptr<const Packet> packet,
const WifiMacHeader* hdr,
MacLowTransmissionParameters parameters,
- Ptr<DcaTxop> dca);
+ Ptr<Txop> txop);
/**
* \param packet packet received
@@ -354,12 +374,12 @@
void DestroyBlockAckAgreement (Mac48Address originator, uint8_t tid);
/**
* \param ac Access class managed by the queue.
- * \param edca the EdcaTxopN for the queue.
+ * \param edca the QosTxop for the queue.
*
- * The lifetime of the registered EdcaTxopN is typically equal to the lifetime of the queue
+ * The lifetime of the registered QosTxop is typically equal to the lifetime of the queue
* associated to this AC.
*/
- void RegisterEdcaForAc (AcIndex ac, Ptr<EdcaTxopN> edca);
+ void RegisterEdcaForAc (AcIndex ac, Ptr<QosTxop> edca);
/**
* \param packet the packet to be aggregated. If the aggregation is succesfull, it corresponds either to the first data packet that will be aggregated or to the BAR that will be piggybacked at the end of the A-MPDU.
* \param hdr the WifiMacHeader for the packet.
@@ -407,6 +427,21 @@
* \return TXVECTOR for the given packet
*/
virtual WifiTxVector GetDataTxVector (Ptr<const Packet> packet, const WifiMacHeader *hdr) const;
+ /**
+ * Start NAV with the given duration.
+ *
+ * \param duration the duration
+ * \return true if NAV is resetted
+ */
+ bool DoNavStartNow (Time duration);
+ /**
+ * This function indicates whether it is the CF period.
+ */
+ virtual bool IsCfPeriod (void) const;
+ /**
+ * This function decides if a CF frame can be transmitted in the current CFP.
+ */
+ bool CanTransmitNextCfFrame (void) const;
private:
@@ -416,6 +451,18 @@
*/
void CancelAllEvents (void);
/**
+ * Return the total ACK size (including FCS trailer).
+ *
+ * \return the total ACK size
+ */
+ static uint32_t GetAckSize (void);
+ /**
+ * Return the total CF-END size (including FCS trailer).
+ *
+ * \return the total CF-END size
+ */
+ uint32_t GetCfEndSize (void) const;
+ /**
* Forward the packet down to WifiPhy for transmission. This is called for the entire A-MPDu when MPDU aggregation is used.
*
* \param packet the packet
@@ -566,13 +613,6 @@
*/
void DoNavResetNow (Time duration);
/**
- * Start NAV with the given duration.
- *
- * \param duration the duration
- * \return true if NAV is resetted
- */
- bool DoNavStartNow (Time duration);
- /**
* Check if NAV is zero.
*
* \return true if NAV is zero,
@@ -620,6 +660,10 @@
*/
void CtsTimeout (void);
/**
+ * Event handler when CF-POLL timeout occurs.
+ */
+ void CfPollTimeout (void);
+ /**
* Send CTS for a CTS-to-self mechanism.
*/
void SendCtsToSelf (void);
@@ -829,6 +873,16 @@
}; //!< item structure
/**
+ * A struct that holds information about ACK piggybacking (CF-ACK).
+ */
+ struct CfAckInfo
+ {
+ bool appendCfAck; //!< Flag used for PCF to indicate whether a CF-ACK should be appended
+ bool expectCfAck; //!< Flag used for PCF to indicate whether a CF-ACK should be expected
+ Mac48Address address; //!< Address of the station to be acknowledged
+ };
+
+ /**
* typedef for an iterator for a list of DcfManager.
*/
typedef std::vector<Ptr<DcfManager> >::const_iterator DcfManagersCI;
@@ -850,7 +904,7 @@
Ptr<Packet> m_currentPacket; //!< Current packet transmitted/to be transmitted
WifiMacHeader m_currentHdr; //!< Header of the current transmitted packet
- Ptr<DcaTxop> m_currentDca; //!< Current DCA
+ Ptr<Txop> m_currentTxop; //!< Current TXOP
WifiMacHeader m_lastReceivedHdr; //!< Header of the last received packet
MacLowTransmissionParameters m_txParams; //!< Transmission parameters of the current packet
Mac48Address m_self; //!< Address of this MacLow (Mac48Address)
@@ -864,9 +918,16 @@
Time m_pifs; //!< PCF Interframe Space (PIFS) duration
Time m_rifs; //!< Reduced Interframe Space (RIFS) duration
+ Time m_beaconInterval; //!< Expected interval between two beacon transmissions
+ Time m_cfpMaxDuration; //!< CFP max duration
+
Time m_lastNavStart; //!< The time when the latest NAV started
Time m_lastNavDuration; //!< The duration of the latest NAV
+ Time m_cfpStart; //!< The time when the latest CF period started
+ Time m_lastBeacon; //!< The time when the last beacon frame transmission started
+ Time m_cfpForeshortening; //!< The delay the current CF period should be foreshortened
+
bool m_promisc; //!< Flag if the device is operating in promiscuous mode
bool m_ampdu; //!< Flag if the current transmission involves an A-MPDU
@@ -890,13 +951,15 @@
Agreements m_bAckAgreements; //!< block ack agreements
BlockAckCaches m_bAckCaches; //!< block ack caches
- typedef std::map<AcIndex, Ptr<EdcaTxopN> > QueueEdcas; //!< EDCA queues typedef
+ typedef std::map<AcIndex, Ptr<QosTxop> > QueueEdcas; //!< EDCA queues typedef
QueueEdcas m_edca; //!< EDCA queues
bool m_ctsToSelfSupported; //!< Flag whether CTS-to-self is supported
Ptr<WifiMacQueue> m_aggregateQueue[8]; //!< Queues per TID used for MPDU aggregation
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.
WifiTxVector m_currentTxVector; //!< TXVECTOR used for the current packet transmission
+
+ CfAckInfo m_cfAckInfo; //!< Info about piggyback ACKs used in PCF
};
} //namespace ns3

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b