Question

I want to receive UDP packets from an Android WiFi AP (Access Point). I plan to receive broadcast packets with libpcap, so I do not need to associate STA (Associated Station) in network, to save time.

I wrote an Android app sending UDP packets to 192.168.43.255, and generally it works - I can receive the packets on STA, after it is registered in BSS. The problem is that the AP does not send UDP packets when no STA is registered in BSS. From app point of view, the packets are being sent via socket w/o any errors/exceptions, but they are not detected with wireshark sniffer (being run on a not-associated PC, scanning AP channel). When I connect to the AP (from another Android phone), the UDP packets does appear in wireshark log.

From the log I see that UDP packets appear after STA receives 802.11 frame "Association Response" from AP. As soon as the STA detaches from BSS with frame "Deauthentication", the UDP packets are not sent to air (but the Android app still sends them without any errors).

I tried to send UDP packet via raw socket (as a native NDK app, found a sample on inet), with the same (negative) result.

I guess that Android WiFi code is optimized to not send UDP packets when there is no STAs in BSS. I would like to disable this 'optimization', is it possible? Is it the same in Linux AP, or it's Android-specific feature? I use TI dev board AM335x Starter Kit, and I'm building Android ROM from source code, so I can change almost everything, just I do not know where it is )) Any ideas are appreciated.

I probably could try to send my data not via UDP packet, but via a customized 802.11 frame, just UDP seemed easier for me, and it works via standard Android Java API. For 802.11 frames approach I will need to work via NDK, probably jNetpcap (java libpcap wrapper ported to Android), so it it looks not so easy for me.

I must say I'm not very good in this area (WiFi networking), so I may be asking something dump...

About my use case - I need to collect data via WiFi from a fast moving object (car), this is why I think that it would be good to send data in single WiFi frame without STA association procedure. I would like to broadcast the data without the limitation to have at least one STA in BSS.

Thanks in advance, Mike

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top