QosFix
authorKirill Andreev <andreev@iitp.ru>
Tue, 28 Jul 2009 20:22:15 +0400
changeset 5136 6ad13efaccd7
parent 5135 10c2f3ae8c2f
child 5137 22a9d7e537bb
QosFix
src/devices/mesh/mesh-wifi-interface-mac.cc
src/helper/mesh-interface-helper.cc
--- a/src/devices/mesh/mesh-wifi-interface-mac.cc	Mon Jul 27 14:05:20 2009 +0400
+++ b/src/devices/mesh/mesh-wifi-interface-mac.cc	Tue Jul 28 20:22:15 2009 +0400
@@ -399,11 +399,26 @@
     }
   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!");
     }
-  m_queues[AC_VO]->Queue (packet, header);
+  /*
+   * 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);
+    }
 }
 SupportedRates
 MeshWifiInterfaceMac::GetSupportedRates () const
--- a/src/helper/mesh-interface-helper.cc	Mon Jul 27 14:05:20 2009 +0400
+++ b/src/helper/mesh-interface-helper.cc	Tue Jul 28 20:22:15 2009 +0400
@@ -49,6 +49,15 @@
   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;
 }