How can I set the adjacent RSSI and Mac number in the same ad-hoc mode?

I changed some Android phones in ad-hoc mode and gave them the same essid (using the command on each phone: "iwconfig .. essid XXX"). Thus, they are combined into one ad-hoc network and can successfully send udp packets among them.

Next, I want to get neighboring RSSI phones and MAC addresses on the same ad-hoc network. I am trying to start the wpa_supplicant process and the intention is to get rssi by scanning (not via Android system, so android API like getRssi (), getScanResult () cannot be used), but I only get one essid "XXX" that supports this adhoc network (BSSID) and fake MAC address .

then I try to change the "iwlist" command to recompile it on android, I got the same results above. I do not know if this phenomenon is detected by the linux system or the wireless driver.

then I try to catch phone beacon packets, I get the correct mac and rssi, but the beacon receiver is in moniter mode, but not in ad-hoc mode, so it cannot send udp packets to neighboring phones.

so what can i do to each RSSI address and MAC address of every phone in the same ad-hoc network?

Thank you very much!

+4
source share
1 answer

I'm not sure I fully understand your question, but I think you have a bit of an obscure attitude towards Wi-Fi.

Firstly, RSSI stands for โ€œSignal Strength of a Receive Signal,โ€ which means signal strength from the perspective of the receiver. In your situation, the only way to know one RSSI of another phone is if the RSSI data is transmitted at a higher (i.e. application) level.

For instance:

  • Phone A sends an XYZ radio message to Phone B.
  • Phone B can hear the XYZ message from Phone A at -75dBm.
  • Phone B can then send a message to Phone A to inform Phone A that it is listening on Phone A at -75dBm.
  • (Phone A can now use the same as Phone B, using the RSSI messages it receives from phone B)

Secondly, I do not quite understand how ad-hoc networks handle BSSIDs, etc., but I am sure that you will encounter a similar problem with RSSI described above. That is, ad-hoc mode probably chooses which BSSID to use to establish the WiFi network. This should not be the MAC address of any of the devices (for example, it could be a fake MAC address). If you want to transfer your own MAC address to another phone, you will have to put it in a message at the application level and send it to the receiving application on another phone.

For instance:

  • Phone A requests its own OS / Network interfaces and finds its own MAC address (NB: it can find more than one!)
  • Phone A places this in the application message (i.e. your own UDP packet) and sends it to Phone B.
  • Phone B receives the message, unpacks the message, and finds out what MAC phone A told him.

So, in short, the answer is: collect and exchange information at the application level, you can not "sniffer / listen" to the information received after the Wi-Fi stack.

+1
source

All Articles