# HG changeset patch # Parent bc07f96a4742b31c9ca26c2add0ae9464b6e0d3d diff -r bc07f96a4742 -r 43a052cd9f9e src/wifi/model/minstrel-ht-wifi-manager.cc --- a/src/wifi/model/minstrel-ht-wifi-manager.cc Fri Jun 08 18:48:49 2018 +0200 +++ b/src/wifi/model/minstrel-ht-wifi-manager.cc Wed Jun 13 08:19:21 2018 +0200 @@ -958,7 +958,7 @@ } bool -MinstrelHtWifiManager::DoNeedDataRetransmission (WifiRemoteStation *st, Ptr packet, bool normally) +MinstrelHtWifiManager::DoNeedRetransmission (WifiRemoteStation *st, Ptr packet, bool normally) { NS_LOG_FUNCTION (this << st << packet << normally); diff -r bc07f96a4742 -r 43a052cd9f9e src/wifi/model/minstrel-ht-wifi-manager.h --- a/src/wifi/model/minstrel-ht-wifi-manager.h Fri Jun 08 18:48:49 2018 +0200 +++ b/src/wifi/model/minstrel-ht-wifi-manager.h Wed Jun 13 08:19:21 2018 +0200 @@ -241,7 +241,7 @@ uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr); bool IsLowLatency (void) const; - bool DoNeedDataRetransmission (WifiRemoteStation *st, Ptr packet, bool normally); + bool DoNeedRetransmission (WifiRemoteStation *st, Ptr packet, bool normally); /** * Check the validity of a combination of number of streams, chWidth and mode. diff -r bc07f96a4742 -r 43a052cd9f9e src/wifi/model/minstrel-wifi-manager.cc --- a/src/wifi/model/minstrel-wifi-manager.cc Fri Jun 08 18:48:49 2018 +0200 +++ b/src/wifi/model/minstrel-wifi-manager.cc Wed Jun 13 08:19:21 2018 +0200 @@ -855,7 +855,7 @@ } bool -MinstrelWifiManager::DoNeedDataRetransmission (WifiRemoteStation *st, Ptr packet, bool normally) +MinstrelWifiManager::DoNeedRetransmission (WifiRemoteStation *st, Ptr packet, bool normally) { NS_LOG_FUNCTION (this << st << packet << normally); MinstrelWifiRemoteStation *station = (MinstrelWifiRemoteStation *)st; diff -r bc07f96a4742 -r 43a052cd9f9e src/wifi/model/minstrel-wifi-manager.h --- a/src/wifi/model/minstrel-wifi-manager.h Fri Jun 08 18:48:49 2018 +0200 +++ b/src/wifi/model/minstrel-wifi-manager.h Wed Jun 13 08:19:21 2018 +0200 @@ -273,7 +273,7 @@ WifiTxVector DoGetDataTxVector (WifiRemoteStation *station); WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station); - bool DoNeedDataRetransmission (WifiRemoteStation *st, + bool DoNeedRetransmission (WifiRemoteStation *st, Ptr packet, bool normally); bool IsLowLatency (void) const; diff -r bc07f96a4742 -r 43a052cd9f9e src/wifi/model/txop.cc --- a/src/wifi/model/txop.cc Fri Jun 08 18:48:49 2018 +0200 +++ b/src/wifi/model/txop.cc Wed Jun 13 08:19:21 2018 +0200 @@ -353,14 +353,14 @@ Txop::NeedRtsRetransmission (Ptr packet, const WifiMacHeader &hdr) { NS_LOG_FUNCTION (this); - return m_stationManager->NeedRtsRetransmission (hdr.GetAddr1 (), &hdr, packet); + return m_stationManager->NeedRetransmission (hdr.GetAddr1 (), &hdr, packet); } bool Txop::NeedDataRetransmission (Ptr packet, const WifiMacHeader &hdr) { NS_LOG_FUNCTION (this); - return m_stationManager->NeedDataRetransmission (hdr.GetAddr1 (), &hdr, packet); + return m_stationManager->NeedRetransmission (hdr.GetAddr1 (), &hdr, packet); } bool diff -r bc07f96a4742 -r 43a052cd9f9e src/wifi/model/wifi-remote-station-manager.cc --- a/src/wifi/model/wifi-remote-station-manager.cc Fri Jun 08 18:48:49 2018 +0200 +++ b/src/wifi/model/wifi-remote-station-manager.cc Wed Jun 13 08:19:21 2018 +0200 @@ -334,13 +334,13 @@ MakeBooleanAccessor (&WifiRemoteStationManager::IsLowLatency), MakeBooleanChecker ()) .AddAttribute ("MaxSsrc", - "The maximum number of retransmission attempts for an RTS. " - " This value will not have any effect on some rate control algorithms.", + "The maximum number of retransmission attempts for any packet with size <= RtsCtsThreshold. " + "This value will not have any effect on some rate control algorithms.", UintegerValue (7), MakeUintegerAccessor (&WifiRemoteStationManager::SetMaxSsrc), MakeUintegerChecker ()) .AddAttribute ("MaxSlrc", - "The maximum number of retransmission attempts for a DATA packet. " + "The maximum number of retransmission attempts for any packet with size > RtsCtsThreshold. " "This value will not have any effect on some rate control algorithms.", UintegerValue (4), MakeUintegerAccessor (&WifiRemoteStationManager::SetMaxSlrc), @@ -1144,27 +1144,27 @@ } bool -WifiRemoteStationManager::NeedRtsRetransmission (Mac48Address address, const WifiMacHeader *header, +WifiRemoteStationManager::NeedRetransmission (Mac48Address address, const WifiMacHeader *header, Ptr packet) { NS_LOG_FUNCTION (this << address << packet << *header); NS_ASSERT (!address.IsGroup ()); WifiRemoteStation *station = Lookup (address, header); - bool normally = station->m_ssrc < m_maxSsrc; - NS_LOG_DEBUG ("WifiRemoteStationManager::NeedDataRetransmission count: " << station->m_ssrc << " result: " << std::boolalpha << normally); - return DoNeedRtsRetransmission (station, packet, normally); -} - -bool -WifiRemoteStationManager::NeedDataRetransmission (Mac48Address address, const WifiMacHeader *header, - Ptr packet) -{ - NS_LOG_FUNCTION (this << address << packet << *header); - NS_ASSERT (!address.IsGroup ()); - WifiRemoteStation *station = Lookup (address, header); - bool normally = station->m_slrc < m_maxSlrc; - NS_LOG_DEBUG ("WifiRemoteStationManager::NeedDataRetransmission count: " << station->m_slrc << " result: " << std::boolalpha << normally); - return DoNeedDataRetransmission (station, packet, normally); + bool longMpdu = (packet->GetSize () + header->GetSize () + WIFI_MAC_FCS_LENGTH) > m_rtsCtsThreshold; + uint32_t retryCount, maxRetryCount; + if (longMpdu) + { + retryCount = station->m_slrc; + maxRetryCount = m_maxSlrc; + } + else + { + retryCount = station->m_ssrc; + maxRetryCount = m_maxSsrc; + } + bool normally = retryCount < maxRetryCount; + NS_LOG_DEBUG ("WifiRemoteStationManager::NeedRetransmission count: " << retryCount << " result: " << std::boolalpha << normally); + return DoNeedRetransmission (station, packet, normally); } bool @@ -1979,15 +1979,8 @@ } bool -WifiRemoteStationManager::DoNeedRtsRetransmission (WifiRemoteStation *station, - Ptr packet, bool normally) -{ - return normally; -} - -bool -WifiRemoteStationManager::DoNeedDataRetransmission (WifiRemoteStation *station, - Ptr packet, bool normally) +WifiRemoteStationManager::DoNeedRetransmission (WifiRemoteStation *station, + Ptr packet, bool normally) { return normally; } diff -r bc07f96a4742 -r 43a052cd9f9e src/wifi/model/wifi-remote-station-manager.h --- a/src/wifi/model/wifi-remote-station-manager.h Fri Jun 08 18:48:49 2018 +0200 +++ b/src/wifi/model/wifi-remote-station-manager.h Wed Jun 13 08:19:21 2018 +0200 @@ -688,7 +688,7 @@ double ackSnr, WifiMode ackMode, double dataSnr); /** * Should be invoked after calling ReportRtsFailed if - * NeedRtsRetransmission returns false + * NeedRetransmission returns false * * \param address the address of the receiver * \param header MAC header of the DATA packet @@ -696,7 +696,7 @@ void ReportFinalRtsFailed (Mac48Address address, const WifiMacHeader *header); /** * Should be invoked after calling ReportDataFailed if - * NeedDataRetransmission returns false + * NeedRetransmission returns false * * \param address the address of the receiver * \param header MAC header of the DATA packet @@ -753,21 +753,11 @@ * \param header MAC header * \param packet the packet to send * - * \return true if we want to restart a failed RTS/CTS handshake, - * false otherwise. - */ - bool NeedRtsRetransmission (Mac48Address address, const WifiMacHeader *header, - Ptr packet); - /** - * \param address remote address - * \param header MAC header - * \param packet the packet to send - * * \return true if we want to resend a packet after a failed transmission attempt, * false otherwise. */ - bool NeedDataRetransmission (Mac48Address address, const WifiMacHeader *header, - Ptr packet); + bool NeedRetransmission (Mac48Address address, const WifiMacHeader *header, + Ptr packet); /** * \param address remote address * \param header MAC header @@ -1083,29 +1073,15 @@ /** * \param station the station that we need to communicate * \param packet the packet to send - * \param normally indicates whether the normal 802.11 rts enable mechanism would - * request that the rts is retransmitted or not. - * - * \return true if we want to restart a failed RTS/CTS handshake, - * false otherwise. - * - * Note: This method is called after an rts/cts handshake has been attempted - * and has failed. - */ - virtual bool DoNeedRtsRetransmission (WifiRemoteStation *station, - Ptr packet, bool normally); - /** - * \param station the station that we need to communicate - * \param packet the packet to send * \param normally indicates whether the normal 802.11 data retransmission mechanism * would request that the data is retransmitted or not. * \return true if we want to resend a packet after a failed transmission attempt, * false otherwise. * - * Note: This method is called after a unicast packet transmission has been attempted - * and has failed. + * Note: This method is called after any unicast packet transmission (control, management, + * or data) has been attempted and has failed. */ - virtual bool DoNeedDataRetransmission (WifiRemoteStation *station, + virtual bool DoNeedRetransmission (WifiRemoteStation *station, Ptr packet, bool normally); /** * \param station the station that we need to communicate