diff --git a/RELEASE_NOTES b/RELEASE_NOTES index d5ad21434..392c477a5 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -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 ------------ diff --git a/src/wave/model/ocb-wifi-mac.cc b/src/wave/model/ocb-wifi-mac.cc index 9a1f8650c..8a1c36d67 100644 --- a/src/wave/model/ocb-wifi-mac.cc +++ b/src/wave/model/ocb-wifi-mac.cc @@ -160,8 +160,17 @@ OcbWifiMac::Enqueue (Ptr 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, 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 ()) diff --git a/src/wifi/model/adhoc-wifi-mac.cc b/src/wifi/model/adhoc-wifi-mac.cc index 9f14cf9aa..4b596d49c 100644 --- a/src/wifi/model/adhoc-wifi-mac.cc +++ b/src/wifi/model/adhoc-wifi-mac.cc @@ -178,6 +178,22 @@ AdhocWifiMac::Receive (Ptr 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 ()) diff --git a/src/wifi/model/wifi-remote-station-manager.cc b/src/wifi/model/wifi-remote-station-manager.cc index c41a1e934..0d9065785 100644 --- a/src/wifi/model/wifi-remote-station-manager.cc +++ b/src/wifi/model/wifi-remote-station-manager.cc @@ -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 ();