Bug 730 [wifi] - Enabling fragmentation at run-time breaks simulation (patch from Christian Facchini)
This commit is contained in:
@@ -445,6 +445,7 @@ DcaTxop::NotifyAccessGranted (void)
|
||||
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 ();
|
||||
|
||||
@@ -506,6 +506,7 @@ EdcaTxopN::NotifyAccessGranted (void)
|
||||
|
||||
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 ();
|
||||
|
||||
@@ -862,7 +862,7 @@ WifiRemoteStationManager::DoSetFragmentationThreshold (uint32_t threshold)
|
||||
* 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
|
||||
{
|
||||
@@ -873,15 +873,21 @@ WifiRemoteStationManager::DoSetFragmentationThreshold (uint32_t threshold)
|
||||
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
|
||||
{
|
||||
|
||||
@@ -156,6 +156,11 @@ public:
|
||||
* \param threshold the fragmentation threshold
|
||||
*/
|
||||
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.
|
||||
*
|
||||
@@ -999,7 +1004,8 @@ private:
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user