diff -r 4b99e8f05b44 src/wifi/model/dca-txop.cc --- a/src/wifi/model/dca-txop.cc Thu Jul 02 21:11:24 2015 +0200 +++ b/src/wifi/model/dca-txop.cc Mon Jul 06 19:16:41 2015 +0200 @@ -445,6 +445,7 @@ NS_ASSERT (m_currentPacket != 0); uint16_t sequence = m_txMiddle->GetNextSequenceNumberfor (&m_currentHdr); m_currentHdr.SetSequenceNumber (sequence); + m_stationManager->UpdateFragmentationThreshold (); m_currentHdr.SetFragmentNumber (0); m_currentHdr.SetNoMoreFragments (); m_currentHdr.SetNoRetry (); diff -r 4b99e8f05b44 src/wifi/model/edca-txop-n.cc --- a/src/wifi/model/edca-txop-n.cc Thu Jul 02 21:11:24 2015 +0200 +++ b/src/wifi/model/edca-txop-n.cc Mon Jul 06 19:16:41 2015 +0200 @@ -506,6 +506,7 @@ uint16_t sequence = m_txMiddle->GetNextSequenceNumberfor (&m_currentHdr); m_currentHdr.SetSequenceNumber (sequence); + m_stationManager->UpdateFragmentationThreshold (); m_currentHdr.SetFragmentNumber (0); m_currentHdr.SetNoMoreFragments (); m_currentHdr.SetNoRetry (); diff -r 4b99e8f05b44 src/wifi/model/wifi-remote-station-manager.cc --- a/src/wifi/model/wifi-remote-station-manager.cc Thu Jul 02 21:11:24 2015 +0200 +++ b/src/wifi/model/wifi-remote-station-manager.cc Mon Jul 06 19:16:41 2015 +0200 @@ -861,7 +861,7 @@ * ASN.1 encoding of the MAC and PHY MIB (256 ... 8000) */ NS_LOG_WARN ("Fragmentation threshold should be larger than 256. Setting to 256."); - m_fragmentationThreshold = 256; + m_nextFragmentationThreshold = 256; } else { @@ -872,15 +872,21 @@ if (threshold % 2 != 0) { NS_LOG_WARN ("Fragmentation threshold should be an even number. Setting to " << threshold - 1); - m_fragmentationThreshold = threshold - 1; + m_nextFragmentationThreshold = threshold - 1; } else { - m_fragmentationThreshold = threshold; + m_nextFragmentationThreshold = threshold; } } } +void +WifiRemoteStationManager::UpdateFragmentationThreshold (void) +{ + m_fragmentationThreshold = m_nextFragmentationThreshold; +} + uint32_t WifiRemoteStationManager::DoGetFragmentationThreshold (void) const { diff -r 4b99e8f05b44 src/wifi/model/wifi-remote-station-manager.h --- a/src/wifi/model/wifi-remote-station-manager.h Thu Jul 02 21:11:24 2015 +0200 +++ b/src/wifi/model/wifi-remote-station-manager.h Mon Jul 06 19:16:41 2015 +0200 @@ -157,6 +157,11 @@ */ void SetFragmentationThreshold (uint32_t threshold); /** + * Typically called to update the fragmentation threshold at the start of a new transmission. + * This avoid that the fragmentation threshold gets changed during a transmission (see bug 730). + */ + void UpdateFragmentationThreshold (void); + /** * Records HT capabilities of the remote station. * * \param from the address of the station being recorded @@ -990,7 +995,8 @@ uint32_t m_maxSsrc; //!< Maximum STA short retry count (SSRC) uint32_t m_maxSlrc; //!< Maximum STA long retry count (SLRC) uint32_t m_rtsCtsThreshold; //!< Threshold for RTS/CTS - uint32_t m_fragmentationThreshold; //!< Threshold for fragmentation + uint32_t m_fragmentationThreshold; //!< Current threshold for fragmentation + uint32_t m_nextFragmentationThreshold; //!< Threshold for fragmentation that will be used for the next transmission uint8_t m_defaultTxPowerLevel; //!< Default tranmission power level WifiMode m_nonUnicastMode; //!< Transmission mode for non-unicast DATA frames