Comments (8)
Hello,
The ACK and re-transmission state machine is in FPGA xpu (tx_control.v). Regarding ACK, there are two things:
- After FPGA transmits a packet, wait for ACK. If ACK is received in time, report to ARM --> Linux. If ACK is not received in time, do re-transmission according to the packet re-transmission configuration, and report finally to ARM --> Linux (how many times re-transmission is tried, etc)
Above behavior is configured per packet in driver (sdr.c, openwifi_tx() ):
dma_reg = ( (( ((prio<<(NUM_BIT_MAX_NUM_HW_QUEUE+NUM_BIT_MAX_PHY_TX_SN))|(ring->bd_wr_idx<<NUM_BIT_MAX_NUM_HW_QUEUE)|queue_idx) )<<18)|(retry_limit_hw_value<<14)|(pkt_need_ack<<13)|num_dma_symbol );
If pkt_need_ack is 0, FPGA won't wait for ACK and return immediately without any re-transmission (tx_control.v):
RECV_ACK_JUDGE: begin
// ack_tx_flag<=ack_tx_flag;
// wea<=wea;
// dina<=dina;
// send_ack_count <= send_ack_count;
// ack_addr <= ack_addr;
// ack_timeout_count<=ack_timeout_count;
// start_retrans<=start_retrans;
// tx_dpram_op_counter<=tx_dpram_op_counter;
// douta_reg<=douta_reg;
// recv_ack_timeout_top<=recv_ack_timeout_top;
retrans_started<=0;
if (tx_pkt_need_ack==1) // continue to actual ACK receiving
begin
tx_control_state<= RECV_ACK_WAIT_TX_BB_DONE;
addra<=2;
tx_try_complete<=0;
// tx_status<=tx_status; //maintain status from state RECV_ACK for ARM reading
// num_retrans<=num_retrans;
retrans_in_progress<=1;
end
else
begin
tx_control_state<= IDLE;
...
retry_limit_hw_value controls the maximum number of re-transmission.
You need to check these two parameters (pkt_need_ack, retry_limit_hw_value) in your mode (monitor mode) when sdr.c is running, to foresee the FPGA behavior.
- After FPGA receives a packet, FPGA will send back ACK according to the packet type and CRC result. In tx_control.v:
if ( fcs_valid && (is_data||is_management||is_blockackreq||is_blockack||is_pspoll||(is_rts&&(!cts_torts_disable)))
&& (self_mac_addr==addr1)) // send ACK will not back to this IDLE until the last IQ sample sent.
begin
tx_control_state <= SEND_ACK; //we also send cts (if rts is received) in SEND_ACK status
end
Indeed this part is not affected by the monitor mode currently, so even in monitor mode FPGA still sends ACK for the incoming packet (if the condition is met).
In all the ACK related processing (if happens), the target MAC address is checked/set.
I guess the automatic ACK sent by FPGA is very useful for fuzzing work, because purely relying on your packet injection in monitor mode can not make ACK in time (16 or 10us). I don't know whether other COTS WiFi card does similar auto ACK like us in the monitor mode.
Or,
Should we disable the FPGA auto sending ACK in monitor mode? Or add a switch (register) to give user more control from driver/strctl? If you could elaborate more about your use case and consideration, we can do the implementation (shouldn't be heavy I think).
from openwifi.
If no further question, I will close this issue.
from openwifi.
Hi @JiaoXianjun thanks a lot for your detailed answer. Actually, for my application auto acknowledgment responses during monitor mode is already what we want. Generally, commercial Wi-Fi hardware disables auto acknowledgments in monitor mode under Linux and we need to enable it by setting a hardware register bit, so OpenWi-FI already has this enabled by default.
However, I see that to maintain behavior compatibility with Linux, adding an ack register so we can disable or enable this behavior would be ideal since in monitor mode we may want to be as transparent as possible and not auto-reply nor auto-retry when injecting packets.
Regards.
from openwifi.
To disable (or confirm it is already the case from Linux config per packet) “waiting for ack and auto retry”, you can set (or print) pkt_need_ack and retry_limit_hw_value to 0 in driver.
To disable “auto reply ack” in monitor mode, we will add a register for user to control.
from openwifi.
Thanks a lot, @JiaoXianjun . And once again, thanks a lot for this great project. I'm going to close the issue and would suggest that the information of auto acknowledgments may be added to the monitor mode documentation so people know of these side effects when running OpenWi-Fi in monitor mode.
from openwifi.
Hello,
We have lots of update just now in driver and FPGA. Two are related to the WiFi fuzzing:
- the ACK disable register is added.
- a bug of retransmission when packet is injected under monitor mode is fixed.
- According to the comments on "struct ieee80211_tx_rate" in mac80211.h, mac80211 should tell driver that the packet should be transmitted "up to" how many times. However when packet is injected under monitor mode, this "up to" number is 0, which is abnormal/make-no-sense. In this case our original code uses 15 instead of 0. Now the code uses 1 instead of 0. You can also override it.
See more explanations: https://github.com/open-sdr/openwifi/blob/master/doc/app_notes/inject_80211.md
You can use the latest SD card image directly or pull the latest driver/FPGA.
from openwifi.
@JiaoXianjun thanks a lot, I've also seen the updated documentation and this will definitely suit our use.
from openwifi.
Hi @JiaoXianjun thanks a lot for your detailed answer. Actually, for my application auto acknowledgment responses during monitor mode is already what we want. Generally, commercial Wi-Fi hardware disables auto acknowledgments in monitor mode under Linux and we need to enable it by setting a hardware register bit, so OpenWi-FI already has this enabled by default.
However, I see that to maintain behavior compatibility with Linux, adding an ack register so we can disable or enable this behavior would be ideal since in monitor mode we may want to be as transparent as possible and not auto-reply nor auto-retry when injecting packets.
Regards.
Hello, just curious, would you please tell us about which COTS WiFi support the auto ACK in monitor mode? (by the register setting as you mentioned)
Thanks!
from openwifi.
Related Issues (20)
- CSI Phase keeps changing Despite relatively stable environment HOT 7
- extracting CSI results from two RX antennas HOT 2
- adrv9361z7035 can't connect 'openwifi'
- Modifying the bandwidth can impact the stability of work HOT 1
- capturing CSI for 2 antenas HOT 4
- XC7Z015 support?
- Some questions about clock tree
- ADRV9361Z7035 reports wrong amount of available memory HOT 1
- rssi correction HOT 2
- Instability in CSI Data Obtained by OpenWiFi When Monitoring Mobile Phone WiFi Signals in a Stable Environment HOT 6
- In the IQ capture experiment, running ./monitor_ch.sh will change the master of sdr0, causing the phone connection to disconnect.
- How to use packet-iq-self-loopback-test HOT 1
- Cannot find the E310v2 kernel in BOOT/openwifi/ after burning the SD card HOT 5
- How to extracting CSI results from two RX antennas for the phase difference HOT 2
- Error reporting about CSI radar HOT 5
- is:issue is:open May I ask how to change the RF power of OpenWiFi? The current board used is Antsdr, and I want to increase the RF power to improve communication quality and distance
- [Feature request] Support of SoapySDR as a neutral and platform independent SDR support library HOT 8
- How to output a fixed RF frequency with openwifi
- MCS problem HOT 4
- SD card image download links "Not Found"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openwifi.