Bugzilla – Bug 1849
sta-wifi-mac considers frames with Address 3 == self as "sent by us"
Last modified: 2020-04-27 12:04:13 UTC
Currently StaWifiMac considers all frames with Address 3 as "sent by us", which is not always the case. It is also depend on "To DS" and "From DS" fields. For example: AP STA_1 STA_2 Two cases: Case 1: STA_1 sends a frame intended to STA_2 (through AP), Address 1 = AP, Address 2 = STA_1, Address 3 = STA_2, To DS = 1, and From DS = 0. Case 2: AP forwards a frame originated from STA_2 to STA_1, Address 1 = STA_1, Address 2 = AP, Address 3 = STA_2, To DS = 0, and From DS = 1. Only case 2 is actually "sent by us". In case 1, STA_2 simply overhears the frame intended to itself. I *think* we should call NotifyRxDrop" in case 2. Note that it does not change the behavior (the frame will be ignored in both cases anyway), just the logging and RX traces. Now, I'm not sure which case that we should call NotifyRxDrop?
Forgot to mention that this will occur with promiscuous mode turned on.
The Receive method of StaWifiMac (where the log "sent by us" can be found) doesn't actually handle the sent packet. Case 1 is not possible with the actual code. StaWifiMac::Receive MacRxMiddle::m_callback MacRxMiddle::Receive MacLow::m_rxCallback MacLow::ReceiveOk (some possible steps before reaching this method) MacLow::DeaggregateAmpduAndReceive WifiPhyStateHelper::m_rxOkCallback WifiPhyStateHelper::SwitchFromRxEndOk WifiPhy::EndReceive WifiPhy::StartReceivePayload WifiPhy::StartReceiveHeader WifiPhy::StartRx WifiPhy::StartReceivePreamble SpectrumWifiPhy::StartRx (another branch going through Yans but same logic) WifiSpectrumPhyInterface::StartRx SingleModelSpectrumChannel::StartRx (same for MultiModel) SingleModelSpectrumChannel::StartTx and in StartTx there is a condition stating that the sending PHY is excluded from the StartRx call loop: for (PhyList::const_iterator rxPhyIterator = m_phyList.begin (); rxPhyIterator != m_phyList.end (); ++rxPhyIterator) { if ((*rxPhyIterator) != txParams->txPhy) As for the promiscuous mode (which is at PHY layer), it is just that both transmitted and received packets are monitored in pcap, since both MonitorSnifferTx and MonitorSnifferRx are connected. It is thus normal to see the same packet twice in the pcap.