Bugzilla – Bug 1069
ApWifiMac unduly calls RegularWifiMac::Receive and crashes
Last modified: 2011-04-10 13:12:50 EDT
In a scenario with overlapping AP coverage areas, it is often the case that an AP hears a packet sent from a station to another AP. In this case, ApWifiMac::Receive calls RegularWifiMac::Receive (src/devices/wifi/ap-wifi-mac:538), which in turn crashes (src/devices/wifi/regular-wifi-mac.cc:504). Commenting src/devices/wifi/ap-wifi-mac:538 fixes the issue (and apparently produces no other damage); however, a clean solution would probably be explicitly discarding the packets directed to another AP in ApWifiMac::Receive. I am setting the severity as "major" beacuse this causes ns-3 to spectacularly fail where AP coverage areas overlap, which is a scenario of interest for, e.g., "green" stuff.
Created attachment 1039 [details] First draft patch Thanks for reporting this, Francesco. It is, indeed, a major oversight. I've attached a proposed patch for this based on head of ns-3-dev. Could you confirm that this makes things work sensibly in your case? Comments on the approach taken are welcome. Thanks, Dean.
The attached patch seems to work. Francesco
*** Bug 1080 has been marked as a duplicate of this bug. ***
Dean, thanks for the patch. I am fine with it, except that I would not call NotifyRxDrop in the newly added case. I think the packet should be silently discarded. Other devices (e.g., CSMA) behave this way with packets not addressed to self. Sergio, can you confirm that Dean's patch solves your problem?
(In reply to comment #4) > Dean, thanks for the patch. I am fine with it, except that I would not call > NotifyRxDrop in the newly added case. I think the packet should be silently > discarded. Other devices (e.g., CSMA) behave this way with packets not > addressed to self. I agree. But will it be captured elsewhere by the "monitor" mode (for pcap tracing?) > Sergio, can you confirm that Dean's patch solves your problem?
(In reply to comment #5) > (In reply to comment #4) > > Dean, thanks for the patch. I am fine with it, except that I would not call > > NotifyRxDrop in the newly added case. I think the packet should be silently > > discarded. Other devices (e.g., CSMA) behave this way with packets not > > addressed to self. > > I agree. But will it be captured elsewhere by the "monitor" mode (for pcap > tracing?) > yes, NotifyPromiscSniffRx () is called in YansWifiPhy::EndReceive (), hence all the packets that are received correctly by the phy will end up in the pcap trace.
(In reply to comment #6) > (In reply to comment #5) > > (In reply to comment #4) > > > Dean, thanks for the patch. I am fine with it, except that I would not call > > > NotifyRxDrop in the newly added case. I think the packet should be silently > > > discarded. Other devices (e.g., CSMA) behave this way with packets not > > > addressed to self. > > > > I agree. But will it be captured elsewhere by the "monitor" mode (for pcap > > tracing?) > > > > yes, NotifyPromiscSniffRx () is called in YansWifiPhy::EndReceive (), hence all > the packets that are received correctly by the phy will end up in the pcap > trace. Thanks. @Sergio: does it fix your problem?
changeset: 7014:937151f978b3 user: Dean Armstrong <deanarm@gmail.com> date: Sun Apr 10 19:08:46 2011 +0200 summary: fix Bug 1069 - ApWifiMac unduly calls RegularWifiMac::Receive and crashes changeset: 7015:d70f5487cde0 tag: tip user: Nicola Baldo <nicola@baldo.biz> date: Sun Apr 10 19:11:22 2011 +0200 summary: revised fix for bug 1069