Change the range of WiFi-Direct IP? Force IPv6 in Android WiFi-Direct?

I have two Android KitKat phones, both work with WiFi-Direct groups as group owners, let them call GO1 and GO2

I managed to connect GO1 as an outdated client to GO2 without violating any (previously installed) wifi-direct groups.

The problem is that, as you know, the GO IP address is hardcoded in the Android source and set to 192.168.49.1

Therefore, both my GO1 and GO2 devices have the same IP address (**) ... each on its own local network.

My application is both a client and a server. But both networks use the same IP range (192.168.49.XXX), which, apparently, I cannot change.

As a result, I canโ€™t create a TCP connection between them if they both host a WiFi-Direct Group, since any device will connect to itself when trying to connect to 192.168.49.1

So the questions are:

  • Is there a way to change the IP range used in Wifi-Direct?
  • Is there a way to use IPv6 instead of IPv4 in Wifi-Direct?
  • Can this be done without shortening the phone?
  • Any other suggestion?

**: In fact, since GO1 connects as an old client to GO2, then GO1 is known as 192.168.49.227 (for example) for GO2, and GO2 is known as 192.168.49.1 by GO1. But since GO1 is also GO, it is also known as 192.168.49.1 for its customers (and itself).

+4
source share
2 answers

It is not possible to change the IP range because, as you pointed out correctly, it is hardcoded in the Android Wi-Fi Direct system service. Personally, I do not know that IPv6 is enabled on a P2P Wi-Fi interface, and even if that were the case, it would be a hard IPv6 address.

If GO1 and GO2 need to be connected to each other while in GO mode, then maybe look at using Bluetooth or some other vehicle so that they can communicate. If the connection between GO1 and GO2 can be delayed, then cache any information that needs to be exchanged, and send it between these two devices, if it can be another client, for example. when GO1 may cease to be GO and may be a client of GO2.

0
source

A way to get around this without using a phone is to send your packets through multicast UDP *. These packages will do this from GO1 to GO2.

There are some side effects:

  • To use this for networking, you must perform OSI application encapsulation and routing (inefficient).

  • You will also need to route based on MAC addresses, since each device has the same address 192.168.49.1.

  • โ€œItโ€™s important to note that a multicast socket encapsulates a unicast unicast connection and as a result cannot fully utilize the total available bandwidth of WiFi and WiFi Directโ€ *

Something else worth noting:

  • When you increase the number of GOs, you will encounter the problem of all nodes working on the same wifi channel. This is not a problem with multiple devices, but with hundreds of devices this will be a huge problem.

* This method was mentioned in documents by Colin Funai, Cristiano Tapparello and Wendi Heinzelman entitled "Support for multi-compressor Device-to-Device networks via Wi-Fi Direct Multi-group Networking": https://arxiv.org/pdf/1601.00028. pdf

0
source

Source: https://habr.com/ru/post/1015508/


All Articles