Bugzilla – Bug 813
Nqos AP sends packet to non associated STA
Last modified: 2010-04-16 14:08:17 UTC
In a wireless network with several AP using the same ssid and connected through a wired backbone, one AP sends packets to one of the STA associated with another AP (other bssid). Results in that the considered STA receives the packets twice. Patch to apply to the example wifi-wired-bridging to reproduce the bug is following below. Patch to correct the bug is attached (generated with Mercurial tool). regards, Charline Taibi Guguen Technicolor --- examples/wireless/wifi-wired-bridging.cc 2009-12-02 11:03:34.793217000 +0100 +++ scratch/my_wifi-wired-bridging.cc 2010-02-01 15:28:19.705864000 +0100 @@ -92,12 +92,19 @@ YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); wifiPhy.SetPcapFormat (YansWifiPhyHelper::PCAP_FORMAT_80211_RADIOTAP); + // calculate ssid for wifi subnetwork + std::ostringstream oss; + oss << "wifi-default-"; + Ssid ssid = Ssid (oss.str ()); + + YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default (); + wifiPhy.SetChannel (wifiChannel.Create ()); + + Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("300")); + + for (uint32_t i = 0; i < nWifis; ++i) { - // calculate ssid for wifi subnetwork - std::ostringstream oss; - oss << "wifi-default-" << i; - Ssid ssid = Ssid (oss.str ()); NodeContainer sta; NetDeviceContainer staDev; @@ -108,8 +115,6 @@ BridgeHelper bridge; WifiHelper wifi = WifiHelper::Default (); NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); - YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default (); - wifiPhy.SetChannel (wifiChannel.Create ()); sta.Create (nStas); mobility.SetPositionAllocator ("ns3::GridPositionAllocator", @@ -164,7 +169,7 @@ std::string protocol; if (sendIp) { - dest = InetSocketAddress (staInterfaces[1].GetAddress (1), 1025); + dest = InetSocketAddress (staInterfaces[0].GetAddress (1), 1025); protocol = "ns3::UdpSocketFactory"; } else @@ -183,9 +188,35 @@ ApplicationContainer apps = onoff.Install (staNodes[0].Get (0)); apps.Start (Seconds (0.5)); apps.Stop (Seconds (3.0)); + + //Create sink + PacketSinkHelper packetSinkHelper (protocol, dest); + ApplicationContainer appSinks = packetSinkHelper.Install (staNodes [0].Get(1)); + appSinks.Start (Seconds (0.5)); + appSinks.Stop (Seconds (3.0)); + wifiPhy.EnablePcap ("wifi-wired-bridging", apDevices[0]); wifiPhy.EnablePcap ("wifi-wired-bridging", apDevices[1]); + wifiPhy.EnablePcap ("wifi-wired-bridging", staDevices[0]); + + std::ofstream ofsAsciiWifi; + ofsAsciiWifi.open ("wifi-wired-bridging-wifi-x-x.tr"); + YansWifiPhyHelper::EnableAscii (ofsAsciiWifi, apDevices[0]); + YansWifiPhyHelper::EnableAscii (ofsAsciiWifi, apDevices[1]); + YansWifiPhyHelper::EnableAscii (ofsAsciiWifi, staDevices[0]); + +// std::ofstream ofsAsciiWifi2; +// ofsAsciiWifi2.open ("wifi-wired-bridging-wifi-sta0--x-x.tr"); +// YansWifiPhyHelper::EnableAscii (ofsAsciiWifi2, staDevices[0]); +// std::ofstream ofsAsciiWifi3; +// ofsAsciiWifi3.open ("wifi-wired-bridging-wifi-sta1--x-x.tr"); +// YansWifiPhyHelper::EnableAscii (ofsAsciiWifi3, staDevices[0]); + + std::ofstream ofsAsciiCsma; + ofsAsciiCsma.open ("wifi-wired-bridging-csma--x-x.tr"); + CsmaHelper::EnableAscii (ofsAsciiCsma, backboneDevices); + std::ofstream os; os.open ("wifi-wired-bridging.mob");
Created attachment 760 [details] correction to Nqap-wifi-mac::Enqueue() functions
Problem with broadcast packets with current patch. New patch coming soon.
Created attachment 763 [details] Prevent Nqap to send packet to non associated sta wo blocking broadcast packets patch done with Mercurial export command on NS-3.7 version
Created attachment 825 [details] test program that works with ns-3-dev rev. 6188
Created attachment 826 [details] patch that works with ns-3-dev rev. 6188
I have been checking the IEEE Std. 802.11-2007 to see if it says anything about this bug. Sections 5.4.1.1 and 5.4.2.2 shed some light: 1) the standard suggest that the DS should take care of identifying the AP to which the destination STA is associated, and forwarding the message only to that AP. This is currently not implemented in ns-3; if it were implemented, we wouldn't have bug 813. 2) I couldn't find any sentence in the standard saying that the AP should not forward data packets to a STA if not associated. However, I still think that the patch by Carline still makes sense: it is a "workaround" for the moment, since we don't have a proper DS implementation, and even if we will have a full-fledged DS in the future the modification introduced by this patch will still be useful as a "sanity check". I would like to leave this open for a while to potentially gather any comments. If nobody complains, I'll push the patch.
Created attachment 827 [details] patch for both Nqap and Qap Also Qap is affected.
changeset 6220 393892be322a