wifi: (fixes #2406) Fix poor performance in 802.11g ad-hoc
This commit is contained in:
@@ -43,6 +43,7 @@ Bugs fixed
|
||||
- Bug 2396 - move utility functions to WifiPhy
|
||||
- Bug 2397 - add backoff and cw tracing to EDCA
|
||||
- Bug 2398 - add SNR tag to beacons and probe responses
|
||||
- Bug 2406 - Poor 802.11g performance in ad-hoc mode
|
||||
|
||||
Known issues
|
||||
------------
|
||||
|
||||
@@ -160,8 +160,17 @@ OcbWifiMac::Enqueue (Ptr<const Packet> packet, Mac48Address to)
|
||||
NS_LOG_FUNCTION (this << packet << to);
|
||||
if (m_stationManager->IsBrandNew (to))
|
||||
{
|
||||
// In ocb mode, we assume that every destination supports all
|
||||
// the rates we support.
|
||||
//In ad hoc mode, we assume that every destination supports all
|
||||
//the rates we support.
|
||||
if (m_htSupported || m_vhtSupported)
|
||||
{
|
||||
m_stationManager->AddAllSupportedMcs (to);
|
||||
m_stationManager->AddStationHtCapabilities (to, GetHtCapabilities());
|
||||
}
|
||||
if (m_vhtSupported)
|
||||
{
|
||||
m_stationManager->AddStationVhtCapabilities (to, GetVhtCapabilities());
|
||||
}
|
||||
m_stationManager->AddAllSupportedModes (to);
|
||||
m_stationManager->RecordDisassociated (to);
|
||||
}
|
||||
@@ -237,6 +246,23 @@ OcbWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr)
|
||||
Mac48Address from = hdr->GetAddr2 ();
|
||||
Mac48Address to = hdr->GetAddr1 ();
|
||||
|
||||
if (m_stationManager->IsBrandNew (from))
|
||||
{
|
||||
//In ad hoc mode, we assume that every destination supports all
|
||||
//the rates we support.
|
||||
if (m_htSupported || m_vhtSupported)
|
||||
{
|
||||
m_stationManager->AddAllSupportedMcs (from);
|
||||
m_stationManager->AddStationHtCapabilities (from, GetHtCapabilities());
|
||||
}
|
||||
if (m_vhtSupported)
|
||||
{
|
||||
m_stationManager->AddStationVhtCapabilities (from, GetVhtCapabilities());
|
||||
}
|
||||
m_stationManager->AddAllSupportedModes (from);
|
||||
m_stationManager->RecordDisassociated (from);
|
||||
}
|
||||
|
||||
if (hdr->IsData ())
|
||||
{
|
||||
if (hdr->IsQosData () && hdr->IsQosAmsdu ())
|
||||
|
||||
@@ -178,6 +178,22 @@ AdhocWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr)
|
||||
NS_ASSERT (!hdr->IsCtl ());
|
||||
Mac48Address from = hdr->GetAddr2 ();
|
||||
Mac48Address to = hdr->GetAddr1 ();
|
||||
if (m_stationManager->IsBrandNew (from))
|
||||
{
|
||||
//In ad hoc mode, we assume that every destination supports all
|
||||
//the rates we support.
|
||||
if (m_htSupported || m_vhtSupported)
|
||||
{
|
||||
m_stationManager->AddAllSupportedMcs (from);
|
||||
m_stationManager->AddStationHtCapabilities (from, GetHtCapabilities());
|
||||
}
|
||||
if (m_vhtSupported)
|
||||
{
|
||||
m_stationManager->AddStationVhtCapabilities (from, GetVhtCapabilities());
|
||||
}
|
||||
m_stationManager->AddAllSupportedModes (from);
|
||||
m_stationManager->RecordDisassociated (from);
|
||||
}
|
||||
if (hdr->IsData ())
|
||||
{
|
||||
if (hdr->IsQosData () && hdr->IsQosAmsdu ())
|
||||
|
||||
@@ -569,18 +569,24 @@ WifiRemoteStationManager::AddSupportedMode (Mac48Address address, WifiMode mode)
|
||||
void
|
||||
WifiRemoteStationManager::AddAllSupportedModes (Mac48Address address)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << address);
|
||||
NS_ASSERT (!address.IsGroup ());
|
||||
WifiRemoteStationState *state = LookupState (address);
|
||||
state->m_operationalRateSet.clear ();
|
||||
for (uint32_t i = 0; i < m_wifiPhy->GetNModes (); i++)
|
||||
{
|
||||
state->m_operationalRateSet.push_back (m_wifiPhy->GetMode (i));
|
||||
if (m_wifiPhy->GetMode (i).IsMandatory ())
|
||||
{
|
||||
AddBasicMode (m_wifiPhy->GetMode (i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
WifiRemoteStationManager::AddAllSupportedMcs (Mac48Address address)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << address);
|
||||
NS_ASSERT (!address.IsGroup ());
|
||||
WifiRemoteStationState *state = LookupState (address);
|
||||
state->m_operationalMcsSet.clear ();
|
||||
|
||||
Reference in New Issue
Block a user