From 6318ca7f7145146916b270d2ef29f1cea75997b4 Mon Sep 17 00:00:00 2001 From: Kirill Andreev Date: Tue, 28 Jul 2009 20:22:15 +0400 Subject: [PATCH] QosFix --- src/devices/mesh/mesh-wifi-interface-mac.cc | 21 ++++++++++++++++++--- src/helper/mesh-interface-helper.cc | 9 +++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/devices/mesh/mesh-wifi-interface-mac.cc b/src/devices/mesh/mesh-wifi-interface-mac.cc index ab7fc2810..e69119723 100644 --- a/src/devices/mesh/mesh-wifi-interface-mac.cc +++ b/src/devices/mesh/mesh-wifi-interface-mac.cc @@ -399,11 +399,26 @@ MeshWifiInterfaceMac::SendManagementFrame (Ptr packet, const WifiMacHead } m_stats.sentFrames++; m_stats.sentBytes += packet->GetSize (); - if (m_queues.find (AC_VO) == m_queues.end ()) + if ((m_queues.find (AC_VO) == m_queues.end ()) || (m_queues.find (AC_VO) == m_queues.end ())) { - NS_FATAL_ERROR ("Voice queue is not set up!"); + NS_FATAL_ERROR ("Voice or Background queue is not set up!"); + } + /* + * When we send a management frame - it is better to enqueue it to + * priority queue. But when we send a broadcast management frame, + * like PREQ, little MinCw value may cause collisions during + * retransmissions (two neighbor stations may choose the same window + * size, and two packets will be collided). So, broadcast management + * frames go to BK queue. + */ + if (hdr.GetAddr1 () != Mac48Address::GetBroadcast ()) + { + m_queues[AC_VO]->Queue (packet, header); + } + else + { + m_queues[AC_BK]->Queue (packet, header); } - m_queues[AC_VO]->Queue (packet, header); } SupportedRates MeshWifiInterfaceMac::GetSupportedRates () const diff --git a/src/helper/mesh-interface-helper.cc b/src/helper/mesh-interface-helper.cc index 7a4924a02..5f284862e 100644 --- a/src/helper/mesh-interface-helper.cc +++ b/src/helper/mesh-interface-helper.cc @@ -49,6 +49,15 @@ MeshInterfaceHelper::Default (void) MeshInterfaceHelper helper; helper.SetType (); helper.SetRemoteStationManager ("ns3::ArfWifiManager"); + /* For more details about this default parameters see IEE802.11 section 7.3.2.29 */ + helper.SetQueueParameters (AC_VO, "MinCw", UintegerValue (3), "MaxCw", UintegerValue (7), "Aifsn", + UintegerValue (2)); + helper.SetQueueParameters (AC_VI, "MinCw", UintegerValue (7), "MaxCw", UintegerValue (15), "Aifsn", + UintegerValue (2)); + helper.SetQueueParameters (AC_BE, "MinCw", UintegerValue (15), "MaxCw", UintegerValue (1023), "Aifsn", + UintegerValue (3)); + helper.SetQueueParameters (AC_BK, "MinCw", UintegerValue (15), "MaxCw", UintegerValue (1023), "Aifsn", + UintegerValue (7)); return helper; }